From 9a2d874d7c40e92ceb86e33513fbabc34129d8cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 11:04:17 +0000 Subject: [PATCH 001/381] Bump dawidd6/action-send-mail from 16 to 17 Bumps [dawidd6/action-send-mail](https://github.com/dawidd6/action-send-mail) from 16 to 17. - [Release notes](https://github.com/dawidd6/action-send-mail/releases) - [Commits](https://github.com/dawidd6/action-send-mail/compare/d38f3f7cd391cdebfe0d38efc3998b935e951c4f...42942bc2f8fba4e611b459a018967a6a7c78c68c) --- updated-dependencies: - dependency-name: dawidd6/action-send-mail dependency-version: '17' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/email-notification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/email-notification.yml b/.github/workflows/email-notification.yml index cf5dba17ae0..37c85f51d5a 100644 --- a/.github/workflows/email-notification.yml +++ b/.github/workflows/email-notification.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Send mail - uses: dawidd6/action-send-mail@d38f3f7cd391cdebfe0d38efc3998b935e951c4f # v16 + uses: dawidd6/action-send-mail@42942bc2f8fba4e611b459a018967a6a7c78c68c # v17 with: subject: ${{ inputs.subject }} body: ${{ inputs.body }} From 75a9c95025308e2f92668d81d7edf6da395dfac3 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Wed, 13 May 2026 15:11:59 +0200 Subject: [PATCH 002/381] [#73354] add deletion confirmation dialog for page links - https://community.openproject.org/work_packages/73354 - add confirmation dialog component - add delete action and controller - add action to permission - add page link data to page info object - add additional routes - NOT ADDED: deletion service --- ...ink_confirmation_dialog_component.html.erb | 36 +++++++++++ ...page_link_confirmation_dialog_component.rb | 61 +++++++++++++++++++ .../wikis/page_link_component.html.erb | 7 +-- .../components/wikis/page_link_component.rb | 32 +++++++++- ...b => inline_page_link_macro_controller.rb} | 2 +- .../wikis/relation_page_link_controller.rb | 54 ++++++++++++++++ .../wikis/adapters/results/page_info.rb | 6 +- .../internal/queries/relation_page_links.rb | 6 +- modules/wikis/config/locales/en.yml | 3 + modules/wikis/config/routes.rb | 8 ++- .../wikis/lib/open_project/wikis/engine.rb | 2 +- 11 files changed, 205 insertions(+), 12 deletions(-) create mode 100644 modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb create mode 100644 modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb rename modules/wikis/app/controllers/wikis/{page_link_controller.rb => inline_page_link_macro_controller.rb} (97%) create mode 100644 modules/wikis/app/controllers/wikis/relation_page_link_controller.rb diff --git a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb new file mode 100644 index 00000000000..53efb1fdde4 --- /dev/null +++ b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb @@ -0,0 +1,36 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. + +++#%> + +<%= + render(Primer::OpenProject::DangerDialog.new(title: t(".title"), form_arguments:)) do |dialog| + dialog.with_confirmation_message do |message| + message.with_heading(tag: :h2) { t(".heading") } + end + end +%> diff --git a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb new file mode 100644 index 00000000000..e527e125809 --- /dev/null +++ b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + class DeletePageLinkConfirmationDialogComponent < ApplicationComponent + include OpTurbo::Streamable + + def initialize(page_link:) + super + @page_link = page_link + end + + def form_arguments + { + action: page_link_url, + method: :delete + } + end + + private + + def page_link_url + url_helpers.project_work_package_relation_wiki_page_link_path(@page_link, work_package_id:, project_id:) + end + + def work_package_id + @page_link.linkable_id + end + + def project_id + @page_link.linkable.project_id + end + end +end diff --git a/modules/wikis/app/components/wikis/page_link_component.html.erb b/modules/wikis/app/components/wikis/page_link_component.html.erb index df6d99bec5f..9a77c4af97b 100644 --- a/modules/wikis/app/components/wikis/page_link_component.html.erb +++ b/modules/wikis/app/components/wikis/page_link_component.html.erb @@ -40,12 +40,7 @@ See COPYRIGHT and LICENSE files for more details. if show_action_menu? render(Primer::Alpha::ActionMenu.new) do |menu| menu.with_show_button(icon: :"kebab-horizontal", "aria-label": t(:label_more), scheme: :invisible) - - if actions.include?(:remove) - menu.with_item(label: t(".remove"), scheme: :danger) do |item| - item.with_leading_visual_icon(icon: :trash) - end - end + menu_items(menu) end end %> diff --git a/modules/wikis/app/components/wikis/page_link_component.rb b/modules/wikis/app/components/wikis/page_link_component.rb index 521db5bf1ee..e77772fc25f 100644 --- a/modules/wikis/app/components/wikis/page_link_component.rb +++ b/modules/wikis/app/components/wikis/page_link_component.rb @@ -54,7 +54,37 @@ module Wikis end def show_action_menu? - actions.any? + page_info_result.success? && actions.any? + end + + def menu_items(menu) + if actions.include?(:remove) + deletion_action_item(menu) + end + end + + private + + def page_link + page_info_result.value!.page_link + end + + def work_package_id = page_link.linkable_id + + def project_id = page_link.linkable.project_id + + def deletion_action_item(menu) + href = url_helpers.confirm_delete_project_work_package_relation_wiki_page_link_path(page_link, + work_package_id:, + project_id:) + + menu.with_item(label: t(".remove"), + scheme: :danger, + tag: :a, + href:, + content_arguments: { data: { controller: "async-dialog" } }) do |item| + item.with_leading_visual_icon(icon: :trash) + end end end end diff --git a/modules/wikis/app/controllers/wikis/page_link_controller.rb b/modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb similarity index 97% rename from modules/wikis/app/controllers/wikis/page_link_controller.rb rename to modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb index 535461e389d..2c81ca3d27e 100644 --- a/modules/wikis/app/controllers/wikis/page_link_controller.rb +++ b/modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb @@ -29,7 +29,7 @@ #++ module Wikis - class PageLinkController < ApplicationController + class InlinePageLinkMacroController < ApplicationController include Dry::Monads[:result] before_action :find_provider diff --git a/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb b/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb new file mode 100644 index 00000000000..c5d81fefaef --- /dev/null +++ b/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + class RelationPageLinkController < ApplicationController + include OpTurbo::ComponentStream + + before_action :find_page_link + before_action :authorize, except: %i[confirm_delete] + + no_authorization_required! :confirm_delete + + def destroy + # TODO: implement delete service + end + + def confirm_delete + respond_with_dialog(DeletePageLinkConfirmationDialogComponent.new(page_link: @page_link)) + end + + private + + def find_page_link + @page_link = RelationPageLink.find(params[:id]) + end + end +end diff --git a/modules/wikis/app/models/wikis/adapters/results/page_info.rb b/modules/wikis/app/models/wikis/adapters/results/page_info.rb index e887846e240..d6acceaf444 100644 --- a/modules/wikis/app/models/wikis/adapters/results/page_info.rb +++ b/modules/wikis/app/models/wikis/adapters/results/page_info.rb @@ -29,5 +29,9 @@ #++ module Wikis::Adapters::Results - PageInfo = Data.define(:identifier, :provider, :title, :href) + PageInfo = Data.define(:identifier, :provider, :title, :href, :page_link) do + def initialize(identifier:, provider:, title:, href:, page_link: nil) + super + end + end end diff --git a/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb b/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb index c7deeaaf9b3..23350823a43 100644 --- a/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb +++ b/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb @@ -38,7 +38,11 @@ module Wikis page_link_infos = provider.page_links .merge(RelationPageLink.all) .where(linkable: input_data.linkable) - .map { |page_link| page_info(identifier: page_link.identifier, auth_strategy:) } + .map do |page_link| + page_info(identifier: page_link.identifier, auth_strategy:).fmap do |page_info| + page_info.with(page_link:) + end + end success(page_link_infos) end diff --git a/modules/wikis/config/locales/en.yml b/modules/wikis/config/locales/en.yml index ad8a3c5320d..033228ca422 100644 --- a/modules/wikis/config/locales/en.yml +++ b/modules/wikis/config/locales/en.yml @@ -32,6 +32,9 @@ en: done_continue: Done, continue save_and_continue: Save and continue wiki_page: Wiki page + delete_page_link_confirmation_dialog_component: + title: Delete related wiki page link + heading: Delete related wiki page link? work_package_wikis_tab_component: inline_page_links: Inline page links referencing_pages: Referenced in diff --git a/modules/wikis/config/routes.rb b/modules/wikis/config/routes.rb index ead743ca191..5fde4ef61e3 100644 --- a/modules/wikis/config/routes.rb +++ b/modules/wikis/config/routes.rb @@ -44,7 +44,7 @@ Rails.application.routes.draw do end end - resource :wiki_page_link_macro, controller: "wikis/page_link" do + resource :wiki_page_link_macro, controller: "wikis/inline_page_link_macro", only: [] do get :load end @@ -55,6 +55,12 @@ Rails.application.routes.draw do resources :tab, only: %i[index], controller: "work_package_wikis_tab", as: "wikis_tab" end end + + resources :relation_wiki_page_links, only: %i[destroy], controller: "wikis/relation_page_link" do + member do + get :confirm_delete + end + end end end end diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index aa9cd4e8ce8..15c219692b2 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -72,7 +72,7 @@ module OpenProject::Wikis register "openproject-wikis", author_url: "https://openproject.org" do project_module :work_package_tracking do permission :manage_wiki_page_links, - {}, + { "wikis/relation_page_link": %i[destroy] }, permissible_on: :project, dependencies: %i[edit_work_packages], contract_actions: { wiki_page_links: %i[manage] } From b9ebe6bd0214f321f1a8b178c789931c8b7888c4 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Wed, 13 May 2026 22:43:41 +0200 Subject: [PATCH 003/381] Fix timezone service spec in local timezones Mock the guessed timezone when the configuration has no explicit timezone so the UTC expectation is deterministic across developer environments. --- .../app/core/datetime/timezone.service.spec.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/core/datetime/timezone.service.spec.ts b/frontend/src/app/core/datetime/timezone.service.spec.ts index 1fe0ae27037..45ed4a8ca16 100644 --- a/frontend/src/app/core/datetime/timezone.service.spec.ts +++ b/frontend/src/app/core/datetime/timezone.service.spec.ts @@ -32,6 +32,7 @@ import { PathHelperService } from 'core-app/core/path-helper/path-helper.service import { I18nService } from 'core-app/core/i18n/i18n.service'; import { ConfigurationService } from 'core-app/core/config/configuration.service'; import { TimezoneService } from 'core-app/core/datetime/timezone.service'; +import moment from 'moment-timezone'; describe('TimezoneService', () => { const TIME = '2013-02-08T09:30:26'; @@ -44,20 +45,28 @@ describe('TimezoneService', () => { timezone: () => timezone, }; + if (!timezone) { + vi.spyOn(moment.tz, 'guess').mockReturnValue('Etc/UTC'); + } + TestBed.configureTestingModule({ - imports: [], - providers: [ + imports: [], + providers: [ { provide: I18nService, useValue: {} }, { provide: ConfigurationService, useValue: ConfigurationServiceStub }, PathHelperService, TimezoneService, provideHttpClient(withInterceptorsFromDi()), - ] -}); + ], + }); timezoneService = TestBed.inject(TimezoneService); }; + afterEach(() => { + vi.restoreAllMocks(); + }); + describe('without time zone set', () => { beforeEach(() => { compile(); From 33fda3dc84f3cc52685bf88e4f597f239798176f Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Mon, 13 Apr 2026 20:46:39 +0200 Subject: [PATCH 004/381] log an error when rescuing turbo:frame-missing --- frontend/src/turbo/setup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/turbo/setup.ts b/frontend/src/turbo/setup.ts index 2b1f597f3a7..f4e5eead282 100644 --- a/frontend/src/turbo/setup.ts +++ b/frontend/src/turbo/setup.ts @@ -60,5 +60,10 @@ TurboPower.initialize(Turbo.StreamActions); document.addEventListener('turbo:frame-missing', (event) => { const { detail: { response, visit } } = event; event.preventDefault(); + whenDebugging(() => { + const frameId = event.target instanceof Element ? event.target.id : undefined; + const message = frameId ? `no turbo-frame#${frameId} in` : 'destination frame id missing for'; + console.error(`${message} response from ${response.url}`); + }); void visit(response.url, {}); }); From 04f301df0e09532328f2c737a4136576edfae3ef Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Mon, 13 Apr 2026 20:46:53 +0200 Subject: [PATCH 005/381] fix whitespace --- frontend/src/turbo/setup.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/turbo/setup.ts b/frontend/src/turbo/setup.ts index f4e5eead282..26916d8151b 100644 --- a/frontend/src/turbo/setup.ts +++ b/frontend/src/turbo/setup.ts @@ -24,10 +24,10 @@ whenDebugging(() => { TURBO_EVENTS .filter((name) => name !== 'turbo:before-stream-render') .forEach((name:string) => { - document.addEventListener(name, (event) => { - debugLog(`[TURBO EVENT ${name}] %O`, event); + document.addEventListener(name, (event) => { + debugLog(`[TURBO EVENT ${name}] %O`, event); + }); }); - }); document.addEventListener('turbo:before-stream-render', (event) => { const { detail: { newStream:stream } } = event; From 6e59a197693ebe50eef97d6c11634441efcccaf0 Mon Sep 17 00:00:00 2001 From: ihordubas99 Date: Tue, 19 May 2026 14:27:50 +0300 Subject: [PATCH 006/381] fix: remove overflow auto from bn-editor to prevent card border clipping --- modules/documents/app/assets/stylesheets/_index.sass | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/documents/app/assets/stylesheets/_index.sass b/modules/documents/app/assets/stylesheets/_index.sass index 3e7befa4d95..848b2ecedc3 100644 --- a/modules/documents/app/assets/stylesheets/_index.sass +++ b/modules/documents/app/assets/stylesheets/_index.sass @@ -18,7 +18,6 @@ $blocknote-max-width: 800px height: 100% max-width: $blocknote-max-width min-height: 80vh - overflow: auto width: 100% background-color: transparent padding-top: 10px // Small padding to display cursor label when at the very top From 3ea01ef5676e13b22c40ce8d0c79aacb502f6d2b Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Tue, 19 May 2026 13:44:25 +0200 Subject: [PATCH 007/381] [#73354] move relation page link routes out of wp context --- ...delete_page_link_confirmation_dialog_component.rb | 10 +--------- .../app/components/wikis/page_link_component.rb | 8 +------- .../wikis/relation_page_link_controller.rb | 8 ++++---- modules/wikis/config/routes.rb | 12 ++++++------ 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb index e527e125809..c0d48e303de 100644 --- a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb +++ b/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb @@ -47,15 +47,7 @@ module Wikis private def page_link_url - url_helpers.project_work_package_relation_wiki_page_link_path(@page_link, work_package_id:, project_id:) - end - - def work_package_id - @page_link.linkable_id - end - - def project_id - @page_link.linkable.project_id + url_helpers.relation_wiki_page_link_path(@page_link) end end end diff --git a/modules/wikis/app/components/wikis/page_link_component.rb b/modules/wikis/app/components/wikis/page_link_component.rb index e77772fc25f..1da9dfdce3b 100644 --- a/modules/wikis/app/components/wikis/page_link_component.rb +++ b/modules/wikis/app/components/wikis/page_link_component.rb @@ -69,14 +69,8 @@ module Wikis page_info_result.value!.page_link end - def work_package_id = page_link.linkable_id - - def project_id = page_link.linkable.project_id - def deletion_action_item(menu) - href = url_helpers.confirm_delete_project_work_package_relation_wiki_page_link_path(page_link, - work_package_id:, - project_id:) + href = url_helpers.confirm_delete_dialog_relation_wiki_page_link_path(page_link) menu.with_item(label: t(".remove"), scheme: :danger, diff --git a/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb b/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb index c5d81fefaef..629400eeea6 100644 --- a/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb +++ b/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb @@ -33,22 +33,22 @@ module Wikis include OpTurbo::ComponentStream before_action :find_page_link - before_action :authorize, except: %i[confirm_delete] + before_action :authorize, except: %i[confirm_delete_dialog] - no_authorization_required! :confirm_delete + no_authorization_required! :confirm_delete_dialog def destroy # TODO: implement delete service end - def confirm_delete + def confirm_delete_dialog respond_with_dialog(DeletePageLinkConfirmationDialogComponent.new(page_link: @page_link)) end private def find_page_link - @page_link = RelationPageLink.find(params[:id]) + @page_link = RelationPageLink.find(params.expect(:id)) end end end diff --git a/modules/wikis/config/routes.rb b/modules/wikis/config/routes.rb index 5fde4ef61e3..0dd92d5eae4 100644 --- a/modules/wikis/config/routes.rb +++ b/modules/wikis/config/routes.rb @@ -48,6 +48,12 @@ Rails.application.routes.draw do get :load end + resources :relation_wiki_page_links, only: %i[destroy], controller: "wikis/relation_page_link" do + member do + get :confirm_delete_dialog + end + end + resources :projects, only: %i[] do resources :work_packages, only: %i[] do resources :wikis, only: %i[] do @@ -55,12 +61,6 @@ Rails.application.routes.draw do resources :tab, only: %i[index], controller: "work_package_wikis_tab", as: "wikis_tab" end end - - resources :relation_wiki_page_links, only: %i[destroy], controller: "wikis/relation_page_link" do - member do - get :confirm_delete - end - end end end end From 780aa63668213ddbdfc7cd9a8b8f0da1f856e5c6 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Tue, 19 May 2026 15:02:04 +0200 Subject: [PATCH 008/381] [#73354] fix component test --- .../components/wikis/relation_page_links_component_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb index 82afda08831..3fb0ce62e66 100644 --- a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb +++ b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb @@ -87,12 +87,14 @@ RSpec.describe Wikis::RelationPageLinksComponent, type: :component do end context "when the user has a token and there are page links" do + let(:page_link) { create(:relation_wiki_page_link, linkable: work_package, provider:) } let(:page_info) do Wikis::Adapters::Results::PageInfo.new( identifier: "MyPage", provider:, title: "My Wiki Page", - href: "https://wiki.example.com/MyPage" + href: "https://wiki.example.com/MyPage", + page_link: ) end From 611230c03c778907f92bf077155c1df6403d4719 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Tue, 19 May 2026 17:03:00 +0200 Subject: [PATCH 009/381] [#73354] fixed naming of template --- .../wikis/{page_link => inline_page_link_macro}/load.html.erb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/wikis/app/views/wikis/{page_link => inline_page_link_macro}/load.html.erb (100%) diff --git a/modules/wikis/app/views/wikis/page_link/load.html.erb b/modules/wikis/app/views/wikis/inline_page_link_macro/load.html.erb similarity index 100% rename from modules/wikis/app/views/wikis/page_link/load.html.erb rename to modules/wikis/app/views/wikis/inline_page_link_macro/load.html.erb From f6bb72a109b53e8c17c0d81bec947a2936102f8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 18:19:33 +0000 Subject: [PATCH 010/381] Bump mcp from 0.14.0 to 0.15.0 Bumps [mcp](https://github.com/modelcontextprotocol/ruby-sdk) from 0.14.0 to 0.15.0. - [Release notes](https://github.com/modelcontextprotocol/ruby-sdk/releases) - [Changelog](https://github.com/modelcontextprotocol/ruby-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/modelcontextprotocol/ruby-sdk/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: mcp dependency-version: 0.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 6d0c8caebb8..cd3b273703e 100644 --- a/Gemfile +++ b/Gemfile @@ -162,7 +162,7 @@ gem "ttfunk", "~> 1.7.0" # remove after https://github.com/prawnpdf/prawn/issues # prawn implicitly depends on matrix gem no longer in ruby core with 3.1 gem "matrix", "~> 0.4.3" -gem "mcp", "~> 0.14.0" +gem "mcp", "~> 0.15.0" gem "meta-tags", "~> 2.23.0" diff --git a/Gemfile.lock b/Gemfile.lock index 1f49b6858bd..827e0079512 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -829,7 +829,7 @@ GEM marcel (1.0.4) markly (0.16.0) matrix (0.4.3) - mcp (0.14.0) + mcp (0.15.0) json-schema (>= 4.1) messagebird-rest (5.0.0) jwt (< 4) @@ -1656,7 +1656,7 @@ DEPENDENCIES mail (= 2.9.0) markly (~> 0.15) matrix (~> 0.4.3) - mcp (~> 0.14.0) + mcp (~> 0.15.0) md_to_pdf! meta-tags (~> 2.23.0) mini_magick (~> 5.3.0) @@ -1849,6 +1849,7 @@ CHECKSUMS browser (6.2.0) sha256=281d5295788825c9396427c292c2d2be0a5c91875c93c390fde6e5d61a5ace2d budgets (1.0.0) builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f + bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d capybara (3.40.0) sha256=42dba720578ea1ca65fd7a41d163dd368502c191804558f6e0f71b391054aeef capybara-screenshot (1.0.27) sha256=afa1896cc23df77be1774e8d3b3ce3953bf060aeaa04ff87607b5daf689174f2 @@ -2013,7 +2014,7 @@ CHECKSUMS marcel (1.0.4) sha256=0d5649feb64b8f19f3d3468b96c680bae9746335d02194270287868a661516a4 markly (0.16.0) sha256=6f70d79e385b1efc9e171f74c81628826259039fe6c778e03c3924c71dac5511 matrix (0.4.3) sha256=a0d5ab7ddcc1973ff690ab361b67f359acbb16958d1dc072b8b956a286564c5b - mcp (0.14.0) sha256=9e3ca2e6b5e568739e8c07090982829896f2e4d884ffbb668d06f0fe758489e1 + mcp (0.15.0) sha256=64e26fee4ab5a55aba8b166b516a87f663647608a9e11083bb57cb9c74a82def md_to_pdf (0.2.6) messagebird-rest (5.0.0) sha256=da4cc1efba3d5e4aa021fad07426c2cb6b326ce5670da5104bb8f6056a39d59c meta-tags (2.23.0) sha256=ffe78b5bee398de4ff5ac3316f5a786049538a651643b8476def06c3acc762c1 From a78ebd359a80aca0162a95208940eb13483ce95c Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Wed, 20 May 2026 16:12:30 +0200 Subject: [PATCH 011/381] [#73354] simple renaming of controllers, components, and routes --- ..._relation_page_link_confirmation_dialog.html.erb} | 0 ...delete_relation_page_link_confirmation_dialog.rb} | 2 +- .../app/components/wikis/page_link_component.rb | 9 +++++++++ ...o_controller.rb => page_link_macro_controller.rb} | 2 +- ...ntroller.rb => relation_page_links_controller.rb} | 4 ++-- .../views/wikis/admin/wiki_providers/edit.html.erb | 12 +++++++----- modules/wikis/config/locales/en.yml | 2 +- modules/wikis/config/routes.rb | 4 ++-- 8 files changed, 23 insertions(+), 12 deletions(-) rename modules/wikis/app/components/wikis/{delete_page_link_confirmation_dialog_component.html.erb => delete_relation_page_link_confirmation_dialog.html.erb} (100%) rename modules/wikis/app/components/wikis/{delete_page_link_confirmation_dialog_component.rb => delete_relation_page_link_confirmation_dialog.rb} (95%) rename modules/wikis/app/controllers/wikis/{inline_page_link_macro_controller.rb => page_link_macro_controller.rb} (97%) rename modules/wikis/app/controllers/wikis/{relation_page_link_controller.rb => relation_page_links_controller.rb} (91%) diff --git a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb b/modules/wikis/app/components/wikis/delete_relation_page_link_confirmation_dialog.html.erb similarity index 100% rename from modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.html.erb rename to modules/wikis/app/components/wikis/delete_relation_page_link_confirmation_dialog.html.erb diff --git a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb b/modules/wikis/app/components/wikis/delete_relation_page_link_confirmation_dialog.rb similarity index 95% rename from modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb rename to modules/wikis/app/components/wikis/delete_relation_page_link_confirmation_dialog.rb index c0d48e303de..2f492c197ab 100644 --- a/modules/wikis/app/components/wikis/delete_page_link_confirmation_dialog_component.rb +++ b/modules/wikis/app/components/wikis/delete_relation_page_link_confirmation_dialog.rb @@ -29,7 +29,7 @@ #++ module Wikis - class DeletePageLinkConfirmationDialogComponent < ApplicationComponent + class DeleteRelationPageLinkConfirmationDialog < ApplicationComponent include OpTurbo::Streamable def initialize(page_link:) diff --git a/modules/wikis/app/components/wikis/page_link_component.rb b/modules/wikis/app/components/wikis/page_link_component.rb index 1da9dfdce3b..c3305c65b79 100644 --- a/modules/wikis/app/components/wikis/page_link_component.rb +++ b/modules/wikis/app/components/wikis/page_link_component.rb @@ -69,6 +69,10 @@ module Wikis page_info_result.value!.page_link end + def project + page_link.linkable.project + end + def deletion_action_item(menu) href = url_helpers.confirm_delete_dialog_relation_wiki_page_link_path(page_link) @@ -76,9 +80,14 @@ module Wikis scheme: :danger, tag: :a, href:, + disabled: !user_allowed_to_delete?, content_arguments: { data: { controller: "async-dialog" } }) do |item| item.with_leading_visual_icon(icon: :trash) end end + + def user_allowed_to_delete? + helpers.current_user.allowed_in_project?(:manage_wiki_page_links, project) + end end end diff --git a/modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb b/modules/wikis/app/controllers/wikis/page_link_macro_controller.rb similarity index 97% rename from modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb rename to modules/wikis/app/controllers/wikis/page_link_macro_controller.rb index 16720fb21f5..35101548749 100644 --- a/modules/wikis/app/controllers/wikis/inline_page_link_macro_controller.rb +++ b/modules/wikis/app/controllers/wikis/page_link_macro_controller.rb @@ -29,7 +29,7 @@ #++ module Wikis - class InlinePageLinkMacroController < ApplicationController + class PageLinkMacroController < ApplicationController include Dry::Monads[:result] # The view component shown in `load` will be rendered regardless of the current user's authorization status. diff --git a/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb b/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb similarity index 91% rename from modules/wikis/app/controllers/wikis/relation_page_link_controller.rb rename to modules/wikis/app/controllers/wikis/relation_page_links_controller.rb index 629400eeea6..a3c2c9207bc 100644 --- a/modules/wikis/app/controllers/wikis/relation_page_link_controller.rb +++ b/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb @@ -29,7 +29,7 @@ #++ module Wikis - class RelationPageLinkController < ApplicationController + class RelationPageLinksController < ApplicationController include OpTurbo::ComponentStream before_action :find_page_link @@ -42,7 +42,7 @@ module Wikis end def confirm_delete_dialog - respond_with_dialog(DeletePageLinkConfirmationDialogComponent.new(page_link: @page_link)) + respond_with_dialog(DeleteRelationPageLinkConfirmationDialog.new(page_link: @page_link)) end private diff --git a/modules/wikis/app/views/wikis/admin/wiki_providers/edit.html.erb b/modules/wikis/app/views/wikis/admin/wiki_providers/edit.html.erb index 2802c6400f4..8c9a161588b 100644 --- a/modules/wikis/app/views/wikis/admin/wiki_providers/edit.html.erb +++ b/modules/wikis/app/views/wikis/admin/wiki_providers/edit.html.erb @@ -35,11 +35,13 @@ See COPYRIGHT and LICENSE files for more details. <% header.with_title { page_title } %> <% - breadcrumbs = [{ href: admin_index_path, text: t(:label_administration) }, - { href: admin_settings_wiki_providers_path, text: t(:project_module_wiki_platforms) }, - page_title] - - header.with_breadcrumbs(breadcrumbs) + header.with_breadcrumbs( + [ + { href: admin_index_path, text: t(:label_administration) }, + { href: admin_settings_wiki_providers_path, text: t(:project_module_wiki_platforms) }, + page_title + ] + ) %> <%# TODO: temp — move to a dedicated per-user connection status component once designed %> diff --git a/modules/wikis/config/locales/en.yml b/modules/wikis/config/locales/en.yml index b742d5ca55b..6584f37749b 100644 --- a/modules/wikis/config/locales/en.yml +++ b/modules/wikis/config/locales/en.yml @@ -37,7 +37,7 @@ en: done_continue: Done, continue save_and_continue: Save and continue wiki_page: Wiki page - delete_page_link_confirmation_dialog_component: + delete_relation_page_link_confirmation_dialog: title: Delete related wiki page link heading: Delete related wiki page link? health_checks: diff --git a/modules/wikis/config/routes.rb b/modules/wikis/config/routes.rb index 0c0f91e9616..4a8ac57407f 100644 --- a/modules/wikis/config/routes.rb +++ b/modules/wikis/config/routes.rb @@ -49,11 +49,11 @@ Rails.application.routes.draw do end end - resource :wiki_page_link_macro, controller: "wikis/inline_page_link_macro", only: [] do + resource :wiki_page_link_macro, controller: "wikis/page_link_macro", only: [] do get :load end - resources :relation_wiki_page_links, only: %i[destroy], controller: "wikis/relation_page_link" do + resources :relation_wiki_page_links, only: %i[destroy], controller: "wikis/relation_page_links" do member do get :confirm_delete_dialog end From e9c7a8e51222931e8e523b8540f8d7cc2948dd6c Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Wed, 20 May 2026 18:20:09 +0200 Subject: [PATCH 012/381] [#73354] introduced page link aggregate - revert page link addition to page info result --- .../components/wikis/page_link_component.rb | 13 ++++---- .../relation_page_links_component.html.erb | 27 +++++++-------- .../wikis/relation_page_links_component.rb | 4 +-- .../wikis/adapters/results/page_info.rb | 6 +--- .../adapters/results/page_link_aggregate.rb | 33 +++++++++++++++++++ .../internal/queries/relation_page_links.rb | 15 ++++----- .../xwiki/queries/relation_page_links.rb | 24 +++++--------- .../app/services/wikis/page_link_service.rb | 10 +++--- .../wikis/lib/open_project/wikis/engine.rb | 4 +-- 9 files changed, 78 insertions(+), 58 deletions(-) create mode 100644 modules/wikis/app/models/wikis/adapters/results/page_link_aggregate.rb diff --git a/modules/wikis/app/components/wikis/page_link_component.rb b/modules/wikis/app/components/wikis/page_link_component.rb index c3305c65b79..17f5570ced6 100644 --- a/modules/wikis/app/components/wikis/page_link_component.rb +++ b/modules/wikis/app/components/wikis/page_link_component.rb @@ -37,8 +37,9 @@ module Wikis attr_reader :actions - def initialize(model = nil, actions: [], **) + def initialize(model = nil, actions: [], page_link: nil, **) @actions = actions + @page_link = page_link super(model, **) end @@ -65,16 +66,14 @@ module Wikis private - def page_link - page_info_result.value!.page_link - end - def project - page_link.linkable.project + @page_link&.linkable&.project end def deletion_action_item(menu) - href = url_helpers.confirm_delete_dialog_relation_wiki_page_link_path(page_link) + return if @page_link.nil? + + href = url_helpers.confirm_delete_dialog_relation_wiki_page_link_path(@page_link) menu.with_item(label: t(".remove"), scheme: :danger, diff --git a/modules/wikis/app/components/wikis/relation_page_links_component.html.erb b/modules/wikis/app/components/wikis/relation_page_links_component.html.erb index 183fbb6b45c..60fb4d2480b 100644 --- a/modules/wikis/app/components/wikis/relation_page_links_component.html.erb +++ b/modules/wikis/app/components/wikis/relation_page_links_component.html.erb @@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details. flex_layout(align_items: :center, justify_content: :space_between) do |header| header.with_column do concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 2)) { provider.name }) - concat(render(Primer::Beta::Counter.new(count: page_link_infos.count, round: true, scheme: :primary))) + concat(render(Primer::Beta::Counter.new(count: page_links.count, round: true, scheme: :primary))) end header.with_column do render(Primer::Alpha::ActionMenu.new) do |menu| @@ -52,12 +52,9 @@ See COPYRIGHT and LICENSE files for more details. if !user_connected? box.with_row do - render(Wikis::OAuthLoginComponent.new( - provider, - return_url: work_package_url(@work_package, tab: :wikis) - )) + render(Wikis::OAuthLoginComponent.new(provider, return_url: work_package_url(@work_package, tab: :wikis))) end - elsif page_link_infos.empty? + elsif page_links.empty? box.with_row do if user_connected? render(Primer::Beta::Blankslate.new(border: false)) do |blankslate| @@ -65,17 +62,21 @@ See COPYRIGHT and LICENSE files for more details. blankslate.with_description { t(".empty_text") } end else - render(Wikis::OAuthLoginComponent.new( - provider, - return_url: work_package_url(@work_package, tab: :wikis) + render(Wikis::OAuthLoginComponent.new(provider, return_url: work_package_url(@work_package, tab: :wikis))) + end + end + else + page_links.each do |page_link_aggregate| + box.with_row do + render( + Wikis::PageLinkComponent.new( + page_link_aggregate.page_info_result, + actions: [:remove], + page_link: page_link_aggregate.page_link ) ) end end - else - page_link_infos.each do |info| - box.with_row { render(Wikis::PageLinkComponent.new(info, actions: [:remove])) } - end end end %> diff --git a/modules/wikis/app/components/wikis/relation_page_links_component.rb b/modules/wikis/app/components/wikis/relation_page_links_component.rb index 7baa2f950f4..02686e72414 100644 --- a/modules/wikis/app/components/wikis/relation_page_links_component.rb +++ b/modules/wikis/app/components/wikis/relation_page_links_component.rb @@ -40,8 +40,8 @@ module Wikis super(model, **) end - def page_link_infos - @page_link_infos ||= page_link_service.relation_page_link_infos_for(provider:, linkable: @work_package) + def page_links + @page_links ||= page_link_service.relation_page_links_for(provider:, linkable: @work_package) end def user_connected? diff --git a/modules/wikis/app/models/wikis/adapters/results/page_info.rb b/modules/wikis/app/models/wikis/adapters/results/page_info.rb index d6acceaf444..e887846e240 100644 --- a/modules/wikis/app/models/wikis/adapters/results/page_info.rb +++ b/modules/wikis/app/models/wikis/adapters/results/page_info.rb @@ -29,9 +29,5 @@ #++ module Wikis::Adapters::Results - PageInfo = Data.define(:identifier, :provider, :title, :href, :page_link) do - def initialize(identifier:, provider:, title:, href:, page_link: nil) - super - end - end + PageInfo = Data.define(:identifier, :provider, :title, :href) end diff --git a/modules/wikis/app/models/wikis/adapters/results/page_link_aggregate.rb b/modules/wikis/app/models/wikis/adapters/results/page_link_aggregate.rb new file mode 100644 index 00000000000..7cb17c2cf45 --- /dev/null +++ b/modules/wikis/app/models/wikis/adapters/results/page_link_aggregate.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis::Adapters::Results + PageLinkAggregate = Data.define(:page_info_result, :page_link) +end diff --git a/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb b/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb index 23350823a43..bce9ae21159 100644 --- a/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb +++ b/modules/wikis/app/services/wikis/adapters/providers/internal/queries/relation_page_links.rb @@ -35,16 +35,15 @@ module Wikis module Queries class RelationPageLinks < BaseQuery def call(input_data:, auth_strategy:) - page_link_infos = provider.page_links - .merge(RelationPageLink.all) - .where(linkable: input_data.linkable) - .map do |page_link| - page_info(identifier: page_link.identifier, auth_strategy:).fmap do |page_info| - page_info.with(page_link:) - end + page_links = provider.page_links + .merge(RelationPageLink.all) + .where(linkable: input_data.linkable) + .map do |page_link| + page_info_result = page_info(identifier: page_link.identifier, auth_strategy:) + Results::PageLinkAggregate.new(page_info_result:, page_link:) end - success(page_link_infos) + success(page_links) end end end diff --git a/modules/wikis/app/services/wikis/adapters/providers/xwiki/queries/relation_page_links.rb b/modules/wikis/app/services/wikis/adapters/providers/xwiki/queries/relation_page_links.rb index ba56bc9cf98..519bd537c88 100644 --- a/modules/wikis/app/services/wikis/adapters/providers/xwiki/queries/relation_page_links.rb +++ b/modules/wikis/app/services/wikis/adapters/providers/xwiki/queries/relation_page_links.rb @@ -34,24 +34,16 @@ module Wikis module XWiki module Queries class RelationPageLinks < BaseQuery - def call(input_data:, **) # rubocop:disable Metrics/AbcSize - # TODO: use real API endpoints once available - - title = [ - "What makes XWiki special?", - "API documentation", - "A brief introduction on configuring your own XWiki instance and connect it to OpenProject." - ] - - results = [] - - if input_data.linkable.id % 2 == 1 - results << Success(Results::PageInfo.new(identifier: "1337", provider:, title: title.sample, href: "#")) - results << Success(Results::PageInfo.new(identifier: "1338", provider:, title: title.sample, href: "#")) - results << Success(Results::PageInfo.new(identifier: "1338", provider:, title: title.sample, href: "#")) + def call(input_data:, auth_strategy:) + page_links = provider.page_links + .merge(RelationPageLink.all) + .where(linkable: input_data.linkable) + .map do |page_link| + page_info_result = page_info(identifier: page_link.identifier, auth_strategy:) + Results::PageLinkAggregate.new(page_info_result:, page_link:) end - success(results) + success(page_links) end end end diff --git a/modules/wikis/app/services/wikis/page_link_service.rb b/modules/wikis/app/services/wikis/page_link_service.rb index d4616369fc7..e029f3b34d7 100644 --- a/modules/wikis/app/services/wikis/page_link_service.rb +++ b/modules/wikis/app/services/wikis/page_link_service.rb @@ -33,20 +33,20 @@ module Wikis include Dry::Monads[:result] def count(linkable) - relation_page_links = Provider.enabled.sum { |provider| relation_page_link_infos_for(provider:, linkable:).size } + relation_page_links = Provider.enabled.sum { |provider| relation_page_links_for(provider:, linkable:).size } relation_page_links + inline_page_link_infos_for(linkable:).size + referencing_wiki_page_infos_for(linkable:).size end - def relation_page_link_infos_for(provider:, linkable:) - Adapters::Input::RelationPageLinks.build(linkable:).bind do |input| + def relation_page_links_for(provider:, linkable:) + Adapters::Input::RelationPageLinks.build(linkable:).bind do |input_data| provider.auth_strategy_for(User.current).bind do |auth_strategy| provider.resolve("queries.relation_page_links") - .call(input_data: input, auth_strategy:) + .call(input_data:, auth_strategy:) .either( - ->(page_link_infos) { page_link_infos }, + ->(page_links) { page_links }, -> { [] } ) end diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index 137d3301f63..ab1ebbab1e8 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -72,7 +72,7 @@ module OpenProject::Wikis register "openproject-wikis", author_url: "https://openproject.org" do project_module :work_package_tracking do permission :manage_wiki_page_links, - { "wikis/relation_page_link": %i[destroy] }, + { "wikis/relation_page_links": %i[destroy] }, permissible_on: :project, dependencies: %i[edit_work_packages], contract_actions: { wiki_page_links: %i[manage] } @@ -94,7 +94,7 @@ module OpenProject::Wikis { controller: "/wikis/admin/wiki_providers", action: :index }, if: ->(_) { OpenProject::FeatureDecisions.wiki_enhancements_active? }, caption: :project_module_wiki_platforms, - icon: "book" + icon: :book end patch_with_namespace :WikiPages, :CreateService From 3cd25da49afe9fec6bf76ff5c2a894d4e11658ce Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Wed, 20 May 2026 17:47:35 +0300 Subject: [PATCH 013/381] [#74773] Closed work packages are still considered to be part of the bucket. https://community.openproject.org/wp/74773 Add backlog neighbours scope Use the with_backlogs_neighbours in the work package card menu. --- .../work_package_card_menu_component.rb | 41 ++++--- .../backlogs/work_packages_controller.rb | 7 +- .../scopes/with_backlogs_neighbours.rb | 49 ++++++++ .../backlogs/patches/work_package_patch.rb | 1 + .../work_package_card_menu_component_spec.rb | 109 +++++++++++------- .../scopes/with_backlogs_neighbours_spec.rb | 99 ++++++++++++++++ 6 files changed, 250 insertions(+), 56 deletions(-) create mode 100644 modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb create mode 100644 modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb diff --git a/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb b/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb index eb1c05a6cb2..a312e3dedd1 100644 --- a/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb +++ b/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb @@ -35,14 +35,13 @@ module Backlogs include OpPrimer::ComponentHelpers include CommonHelper - attr_reader :work_package, :project, :max_position, :current_user, :open_sprints_exist + attr_reader :work_package, :project, :open_sprints_exist, :current_user - def initialize(work_package:, project:, max_position:, open_sprints_exist:, current_user: User.current) + def initialize(work_package:, project:, open_sprints_exist:, current_user: User.current) super() @work_package = work_package @project = project - @max_position = max_position @open_sprints_exist = open_sprints_exist @current_user = current_user end @@ -72,33 +71,49 @@ module Backlogs def build_move_menu(menu) unless first_item? - build_move_item(menu, label: I18n.t(:label_sort_highest), direction: "highest", icon: :"move-to-top") - build_move_item(menu, label: I18n.t(:label_sort_higher), direction: "higher", icon: :"chevron-up") + build_move_item(menu, label: :label_sort_highest, direction: "highest", icon: :"move-to-top") + build_move_item(menu, label: :label_sort_higher, prev_id: work_package.prev_prev_id, icon: :"chevron-up") end unless last_item? - build_move_item(menu, label: I18n.t(:label_sort_lower), direction: "lower", icon: :"chevron-down") - build_move_item(menu, label: I18n.t(:label_sort_lowest), direction: "lowest", icon: :"move-to-bottom") + build_move_item(menu, label: :label_sort_lower, prev_id: work_package.next_id, icon: :"chevron-down") + build_move_item(menu, label: :label_sort_lowest, direction: "lowest", icon: :"move-to-bottom") end end - def build_move_item(menu, label:, direction:, icon:) + def build_move_item(menu, label:, icon:, direction: nil, prev_id: nil) + inputs = if direction + [{ name: "direction", value: direction }] + else + [{ name: "target_id", value: move_target_id }, { name: "prev_id", value: prev_id }] + end + menu.with_item( - id: dom_target(work_package, :menu, direction), - label:, + id: dom_target(work_package, :menu, label), + label: I18n.t(label), tag: :button, href: move_project_backlogs_work_package_path(project, work_package, all_backlogs_params), - form_arguments: { method: :put, inputs: [{ name: "direction", value: direction }] } + form_arguments: { method: :put, inputs: } ) do |item| item.with_leading_visual_icon(icon:) end end def first_item? - work_package.position == 1 + work_package.prev_id.nil? end def last_item? - work_package.position == max_position + work_package.next_id.nil? + end + + def move_target_id + @move_target_id ||= if work_package.backlog_bucket_id? + "backlog_bucket:#{work_package.backlog_bucket_id}" + elsif work_package.sprint_id? + "sprint:#{work_package.sprint_id}" + else + "inbox" + end end end end diff --git a/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb b/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb index d571d78b14c..e8bfdc6c632 100644 --- a/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb +++ b/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb @@ -36,7 +36,7 @@ module Backlogs # Deferred ActionMenu items (Primer include-fragment). def menu - max_position = displayed_work_packages.maximum(:position) || 0 + work_package = displayed_work_packages.with_backlogs_neighbours.find(@work_package.id) open_sprints_exist = Sprint.for_project(@project) .visible @@ -45,9 +45,8 @@ module Backlogs .exists? render(Backlogs::WorkPackageCardMenuComponent.new( - work_package: @work_package, project: @project, - max_position:, + work_package:, open_sprints_exist:, current_user: ), @@ -112,7 +111,7 @@ module Backlogs end def load_work_package - @work_packages = WorkPackage.visible.where(project: @project) + @work_packages = WorkPackage.visible.where(project: @project).order_by_position @work_package = @work_packages.find(params.expect(:id)) end diff --git a/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb b/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb new file mode 100644 index 00000000000..5dd505406d2 --- /dev/null +++ b/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +module WorkPackages::Scopes::WithBacklogsNeighbours + extend ActiveSupport::Concern + + class_methods do + def with_backlogs_neighbours + # The subquery is required because window functions run before WHERE clauses. + # Chaining .find(id) directly would filter rows first, leaving the window function + # with a single row and returning nil for all neighbours. Wrapping in a subquery + # lets the window function see the full scope, then the outer query filters to the + # requested record. + subquery = order_by_position.select( + "*, LAG(id) OVER (ORDER BY position) AS prev_id, + LAG(id, 2) OVER (ORDER BY position) AS prev_prev_id, + LEAD(id) OVER (ORDER BY position) AS next_id" + ) + WorkPackage.from(subquery, :work_packages) + end + end +end diff --git a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb index a8ea7cdec22..cccac28c5f4 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb @@ -49,6 +49,7 @@ module OpenProject::Backlogs::Patches::WorkPackagePatch include OpenProject::Backlogs::List scopes :backlogs_inbox_for + scopes :with_backlogs_neighbours scopes :without_status_considered_closed scopes :without_excluded_type end diff --git a/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb b/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb index c9d5bf6fce9..ab246d09763 100644 --- a/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb +++ b/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb @@ -40,27 +40,36 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do let(:project) { create(:project, types: [type_feature, type_task]) } let(:sprint) { create(:sprint, project:, name: "Sprint 1", start_date: Date.yesterday, finish_date: Date.tomorrow) } - let(:position) { 2 } - let(:max_position) { 3 } - let(:work_package) do + let!(:first_story) { create_story(position: 1) } + let!(:second_story) { create_story(position: 2) } + let!(:third_story) { create_story(position: 3) } + let!(:fourth_story) { create_story(position: 4) } + let(:displayed_work_packages) { WorkPackage.where(sprint:).order_by_position } + let(:work_package) { enrich_with_neighbours(second_story) } + + def enrich_with_neighbours(work_package, scope: displayed_work_packages) + scope.with_backlogs_neighbours.find(work_package.id) + end + + def create_story(position:, subject: "Test Story", story_points: 5) create(:work_package, - subject: "Test Story", + subject:, project:, type: type_feature, status: default_status, priority: default_priority, - story_points: 5, + story_points:, position:, sprint:) end - def render_component(position: 2, max_position: 3, open_sprints_exist: true) - work_package.update!(position:) - render_inline(described_class.new(work_package:, - project:, - max_position:, - open_sprints_exist:, - current_user: user)) + def render_component(work_package: self.work_package, open_sprints_exist: true) + render_inline(described_class.new( + work_package:, + project:, + open_sprints_exist:, + current_user: user + )) end describe "standard items" do @@ -204,55 +213,80 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do expect(page).to have_text(I18n.t(:label_sort_lowest)) expect(page).to have_octicon(:"move-to-bottom") end - end - describe "position logic" do - context "when item is first (position=1)" do + context "when item is first" do + let(:work_package) { enrich_with_neighbours(first_story) } + it "hides Move to top and Move up" do - render_component(position: 1, max_position: 3) + render_component expect(page).to have_no_text(I18n.t(:label_sort_highest)) expect(page).to have_no_text(I18n.t(:label_sort_higher)) end - it "shows Move down and Move to bottom" do - render_component(position: 1, max_position: 3) + it "shows Move down and Move to bottom, sending next_id as prev_id" do + render_component expect(page).to have_text(I18n.t(:label_sort_lower)) expect(page).to have_text(I18n.t(:label_sort_lowest)) + expect(page).to have_field("prev_id", type: :hidden, count: 1) + expect(page).to have_field("prev_id", type: :hidden, with: second_story.id.to_s) end end - context "when item is last (position=max)" do + context "when item is in the middle with one predecessor" do + it "shows all move options, sending nil prev_id for Move up and next_id as prev_id for Move down" do + render_component + + expect(page).to have_text(I18n.t(:label_sort_highest)) + expect(page).to have_text(I18n.t(:label_sort_higher)) + expect(page).to have_text(I18n.t(:label_sort_lower)) + expect(page).to have_text(I18n.t(:label_sort_lowest)) + expect(page).to have_field("prev_id", type: :hidden, count: 2) + expect(page).to have_field("prev_id", type: :hidden, with: third_story.id.to_s) + end + end + + context "when item is in the middle with two predecessors" do + let(:work_package) { enrich_with_neighbours(third_story) } + + it "shows all move options, sending prev_prev_id and next_id as prev_id" do + render_component + + expect(page).to have_text(I18n.t(:label_sort_highest)) + expect(page).to have_text(I18n.t(:label_sort_higher)) + expect(page).to have_text(I18n.t(:label_sort_lower)) + expect(page).to have_text(I18n.t(:label_sort_lowest)) + expect(page).to have_field("prev_id", type: :hidden, with: first_story.id.to_s) + expect(page).to have_field("prev_id", type: :hidden, with: fourth_story.id.to_s) + end + end + + context "when item is last" do + let(:work_package) { enrich_with_neighbours(fourth_story) } + it "hides Move down and Move to bottom" do - render_component(position: 3, max_position: 3) + render_component expect(page).to have_no_text(I18n.t(:label_sort_lower)) expect(page).to have_no_text(I18n.t(:label_sort_lowest)) end - it "shows Move to top and Move up" do - render_component(position: 3, max_position: 3) + it "shows Move to top and Move up, sending prev_prev_id as prev_id" do + render_component expect(page).to have_text(I18n.t(:label_sort_highest)) expect(page).to have_text(I18n.t(:label_sort_higher)) + expect(page).to have_field("prev_id", type: :hidden, count: 1) + expect(page).to have_field("prev_id", type: :hidden, with: second_story.id.to_s) end end - context "when item is in the middle" do - it "shows all move options" do - render_component(position: 2, max_position: 3) + context "when there is only one item" do + let(:displayed_work_packages) { WorkPackage.where(id: second_story.id).order_by_position } - expect(page).to have_text(I18n.t(:label_sort_highest)) - expect(page).to have_text(I18n.t(:label_sort_higher)) - expect(page).to have_text(I18n.t(:label_sort_lower)) - expect(page).to have_text(I18n.t(:label_sort_lowest)) - end - end - - context "when there is only one item (position=1, max=1)" do it "hides all move options" do - render_component(position: 1, max_position: 1) + render_component expect(page).to have_no_text(I18n.t(:label_sort_highest)) expect(page).to have_no_text(I18n.t(:label_sort_higher)) @@ -261,12 +295,9 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do end it "hides the Move submenu when no other open sprints exist" do - render_component(position: 1, max_position: 1, open_sprints_exist: false) + render_component(open_sprints_exist: false) - expect(page).to have_no_selector( - :menuitem, - text: "Move" - ) + expect(page).to have_no_selector(:menuitem, text: "Move") end end end diff --git a/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb b/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb new file mode 100644 index 00000000000..1f4b5c776e1 --- /dev/null +++ b/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +require "spec_helper" + +RSpec.describe WorkPackages::Scopes::WithBacklogsNeighbours do + let(:project) { create(:project) } + let(:open_status) { create(:status, is_closed: false) } + let(:closed_status) { create(:status, is_closed: true) } + + def neighbours(work_package, scope: WorkPackage.where(project:).order_by_position) + scope.with_backlogs_neighbours.find(work_package.id) + end + + describe ".with_backlogs_neighbours" do + context "with four items" do + # Created in scrambled order so id sequence is not the same as the position + let!(:wp1) { create(:work_package, project:, status: open_status, position: 1) } + let!(:wp4) { create(:work_package, project:, status: open_status, position: 4) } + let!(:wp2) { create(:work_package, project:, status: open_status, position: 2) } + let!(:wp3) { create(:work_package, project:, status: open_status, position: 3) } + + context "for the first item" do + subject { neighbours(wp1) } + + it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: nil, next_id: wp2.id) } + end + + context "for the second item" do + subject { neighbours(wp2) } + + it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: wp1.id, next_id: wp3.id) } + end + + context "for a middle item with two predecessors" do + subject { neighbours(wp3) } + + it { is_expected.to have_attributes(prev_prev_id: wp1.id, prev_id: wp2.id, next_id: wp4.id) } + end + + context "for the last item" do + subject { neighbours(wp4) } + + it { is_expected.to have_attributes(prev_prev_id: wp2.id, prev_id: wp3.id, next_id: nil) } + end + end + + context "when the scope excludes closed work packages" do + let(:project) { create(:project) } + let!(:first_open) { create(:work_package, project:, status: open_status, position: 1) } + let!(:closed_wp) { create(:work_package, project:, status: closed_status, position: 2) } + let!(:last_open) { create(:work_package, project:, status: open_status, position: 3) } + + subject { neighbours(last_open, scope: WorkPackage.where(project:, status: open_status).order_by_position) } + + it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: first_open.id, next_id: nil) } + end + + context "when the scope excludes work packages of an excluded type" do + let(:project) { create(:project) } + let(:included_type) { create(:type_feature) } + let(:excluded_type) { create(:type_task) } + let!(:first_included) { create(:work_package, project:, status: open_status, type: included_type, position: 1) } + let!(:excluded_wp) { create(:work_package, project:, status: open_status, type: excluded_type, position: 2) } + let!(:last_included) { create(:work_package, project:, status: open_status, type: included_type, position: 3) } + + subject { neighbours(last_included, scope: WorkPackage.where(project:, type: included_type).order_by_position) } + + it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: first_included.id, next_id: nil) } + end + end +end From 82f20d49698ebc5a0fe87e748c760978628fd777 Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Wed, 20 May 2026 22:18:18 +0300 Subject: [PATCH 014/381] Remove unnecessary includes, the engine already includes the patch. --- .../open_project/backlogs/patches/permitted_params_patch.rb | 3 ++- .../lib/open_project/backlogs/patches/project_patch.rb | 2 -- .../lib/open_project/backlogs/patches/work_package_patch.rb | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb index ac4c649ebbb..f6f0dd8a7d3 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -42,4 +44,3 @@ module OpenProject::Backlogs::Patches::PermittedParamsPatch end end end -PermittedParams.include OpenProject::Backlogs::Patches::PermittedParamsPatch diff --git a/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb index a79313cd75c..57a6684d711 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb @@ -45,5 +45,3 @@ module OpenProject::Backlogs::Patches::ProjectPatch module_enabled? "backlogs" end end - -Project.include OpenProject::Backlogs::Patches::ProjectPatch diff --git a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb index cccac28c5f4..ffa558e7cd8 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb @@ -66,5 +66,3 @@ module OpenProject::Backlogs::Patches::WorkPackagePatch end end end - -WorkPackage.include OpenProject::Backlogs::Patches::WorkPackagePatch From 4a07d490d0c5e4ed9efd2e6b3adaed050b49fc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 21 May 2026 06:55:20 +0200 Subject: [PATCH 015/381] Bumped version to 17.6.0 [ci skip] --- lib/open_project/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_project/version.rb b/lib/open_project/version.rb index a8220c747f3..c8ee1f9d4fb 100644 --- a/lib/open_project/version.rb +++ b/lib/open_project/version.rb @@ -32,7 +32,7 @@ require "open3" module OpenProject module VERSION # :nodoc: MAJOR = 17 - MINOR = 5 + MINOR = 6 PATCH = 0 class << self From 50b1a986c6b605e98cd1b9241a0d6cd0ba27ae87 Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Thu, 23 Apr 2026 12:21:25 +0300 Subject: [PATCH 016/381] Add screen-reader hint for external links in BlockNote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VoiceOver and NVDA do not announce aria-describedby on links inside contenteditable regions — both screen readers switch to edit mode and ignore supplementary ARIA there. Even moving the attribute to the itself does not help. Add an ExternalLinkA11yExtension that injects a sr-only, contenteditable="false" span as a child of each external via a ProseMirror widget decoration wrapped in the link mark. The span text becomes part of the link's accessible name, which screen readers announce in every mode. - Widget uses marks: [linkMark] + side: -1 so it renders inside the anchor and stays attached to the preceding link run on insertion. - sameLinkContinues coalesces runs split across inline nodes (e.g. link text with a nested bold mark) so each link gets exactly one hint. - readDescription warns once if #open-blank-target-link-description is missing, surfacing silent empty-hint regressions. - Extracts isHrefExternal from isLinkExternal so the extension can check ProseMirror mark attrs (URL strings) directly. - Decorations never mutate the document model — no DOMObserver mutation loop, no Yjs/collaboration side effects, no persistence. References https://community.openproject.org/wp/73721 --- frontend/src/elements/block-note-element.ts | 6 - .../react/components/OpBlockNoteEditor.tsx | 10 +- .../react/extensions/external-link-a11y.ts | 172 ++++++++++++++++++ .../stimulus/helpers/external-link-helpers.ts | 27 ++- .../external_links_in_block_note_spec.rb | 35 +++- 5 files changed, 227 insertions(+), 23 deletions(-) create mode 100644 frontend/src/react/extensions/external-link-a11y.ts diff --git a/frontend/src/elements/block-note-element.ts b/frontend/src/elements/block-note-element.ts index 6ba9a5e5c2e..2dddfcee99c 100644 --- a/frontend/src/elements/block-note-element.ts +++ b/frontend/src/elements/block-note-element.ts @@ -53,12 +53,6 @@ class BlockNoteElement extends HTMLElement { if (browserSpecificClasses.length > 0) { this.editorRoot.classList.add(...browserSpecificClasses); } - // Clone the blank-target link description into the shadow DOM - // so aria-describedby references resolve for links inside the editor - const blankLinkDesc = document.getElementById('open-blank-target-link-description'); - if (blankLinkDesc) { - this.editorRoot.appendChild(blankLinkDesc.cloneNode(true)); - } this.editorMount = document.createElement('div'); this.editorRoot.appendChild(this.editorMount); diff --git a/frontend/src/react/components/OpBlockNoteEditor.tsx b/frontend/src/react/components/OpBlockNoteEditor.tsx index 420745b4caf..0a501906f96 100644 --- a/frontend/src/react/components/OpBlockNoteEditor.tsx +++ b/frontend/src/react/components/OpBlockNoteEditor.tsx @@ -29,6 +29,7 @@ */ import { BlockNoteEditorOptions, BlockNoteSchema } from '@blocknote/core'; +import { ExternalLinkA11yExtension } from '../extensions/external-link-a11y'; import { ExternalLinkCaptureExtension } from '../extensions/external-link-capture'; import { User } from '@blocknote/core/comments'; import { filterSuggestionItems } from '@blocknote/core/extensions'; @@ -114,11 +115,10 @@ export function OpBlockNoteEditor({ }, dictionary: localeDictionary, ...(attachmentsEnabled && { uploadFile }), - // When external link capture is enabled, intercept clicks on external - // links via a ProseMirror plugin and route through /external_redirect. - ...(captureExternalLinks && { - extensions: [ExternalLinkCaptureExtension], - }), + extensions: [ + ExternalLinkA11yExtension, + ...(captureExternalLinks ? [ExternalLinkCaptureExtension] : []), + ], }; }, [hocuspocusProvider, doc, activeUser, localeDictionary, attachmentsEnabled, uploadFile, captureExternalLinks]); diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts new file mode 100644 index 00000000000..c4dc8aadb51 --- /dev/null +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -0,0 +1,172 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { createExtension } from '@blocknote/core'; +import { Plugin, PluginKey } from 'prosemirror-state'; +import { Decoration, DecorationSet } from 'prosemirror-view'; +import type { Node as PmNode, Mark } from 'prosemirror-model'; +import { isHrefExternal } from 'core-stimulus/helpers/external-link-helpers'; + +const pluginKey = new PluginKey('externalLinkA11y'); +const DESCRIPTION_ID = 'open-blank-target-link-description'; + +function findExternalLinkMark(node:PmNode):Mark|null { + for (const mark of node.marks) { + if (mark.type.name === 'link' && isHrefExternal(String(mark.attrs.href ?? ''))) { + return mark; + } + } + return null; +} + +// Detects whether the next inline node belongs to the same contiguous link +// run. Assumes every inline node inside a link carries the link mark. This +// holds for the current BlockNote schema, which has no inline custom nodes +// that opt out of marks. If a mention/inline-embed node is ever added that +// permits a link mark to wrap it without inheriting, revisit this — you will +// need to walk link runs explicitly instead of relying on nodeAfter. +function sameLinkContinues(next:PmNode|null|undefined, href:string):boolean { + if (!next) return false; + return next.marks.some( + (m) => m.type.name === 'link' && String(m.attrs.href ?? '') === href, + ); +} + +let missingDescriptionWarned = false; + +function readDescription():string { + const source = document.getElementById(DESCRIPTION_ID); + const text = source?.textContent?.trim() ?? ''; + if (!text && !missingDescriptionWarned) { + missingDescriptionWarned = true; + // The sr-only span is rendered in base.html.erb and also referenced by + // ExternalLinksController. If it goes missing, external-link hints silently + // become empty — warn once so the regression surfaces during development. + console.warn( + `[ExternalLinkA11yExtension] #${DESCRIPTION_ID} not found; external-link hints will be empty.`, + ); + } + return text; +} + +function buildWidget():HTMLElement { + const span = document.createElement('span'); + span.className = 'sr-only'; + // contenteditable=false keeps the hint inert inside ProseMirror's editable + // region, so users cannot place their caret inside it or delete it. + span.setAttribute('contenteditable', 'false'); + // Reuse the same translated string the body-level ExternalLinksController + // references via aria-describedby, keeping i18n centralised in Rails. + span.textContent = readDescription(); + return span; +} + +function buildDecorations(doc:PmNode):DecorationSet { + const decorations:Decoration[] = []; + + doc.descendants((node, pos) => { + const linkMark = findExternalLinkMark(node); + if (!linkMark) return; + + const href = String(linkMark.attrs.href ?? ''); + const end = pos + node.nodeSize; + const next = doc.resolve(end).nodeAfter; + + // Only emit the hint at the end of a contiguous link run. Adjacent inline + // nodes (e.g. text with an extra bold mark) carrying the same href are + // rendered as one , so we emit a single hint per link, not per node. + if (sameLinkContinues(next, href)) return; + + decorations.push( + Decoration.widget(end, buildWidget, { + // Wrap the widget in the link mark so the sr-only span is rendered + // INSIDE the tag. This makes the hint part of the link's + // accessible name — the only approach that is reliably announced by + // VoiceOver/NVDA in a contenteditable context, where aria-describedby + // is widely ignored. + marks: [linkMark], + // Negative side keeps the widget attached to the preceding link run + // when content is inserted at the same position. + side: -1, + ignoreSelection: true, + }), + ); + }); + + return DecorationSet.create(doc, decorations); +} + +/** + * BlockNote extension that adds a screen-reader-only "opens in new tab" hint + * to external links inside the editor. + * + * The hint is injected as a ProseMirror widget decoration wrapped in the link + * mark, so the resulting DOM looks like: + * + * + * Link text + * Open link in a new tab + * + * + * Putting the text inside the anchor makes it part of the link's accessible + * name, which screen readers announce in every mode — including the edit mode + * they switch into inside contenteditable regions. The previous approach of + * using `aria-describedby` on an inline decoration span did not work in + * contenteditable: VoiceOver and NVDA ignore aria-describedby there, and the + * inline decoration landed the attribute on a generic span rather than the + * anchor anyway. + * + * Decorations never mutate the document model, so ProseMirror does not + * re-render and there is no DOMObserver mutation loop (the reason direct DOM + * rewriting was abandoned for this attribute). + */ +export const ExternalLinkA11yExtension = createExtension({ + key: 'externalLinkA11y', + + prosemirrorPlugins: [ + new Plugin({ + key: pluginKey, + state: { + init(_, { doc }) { + return buildDecorations(doc); + }, + apply(tr, oldDecos) { + if (tr.docChanged) { + return buildDecorations(tr.doc); + } + return oldDecos.map(tr.mapping, tr.doc); + }, + }, + props: { + decorations(state) { + return pluginKey.getState(state) as DecorationSet; + }, + }, + }), + ], +}); diff --git a/frontend/src/stimulus/helpers/external-link-helpers.ts b/frontend/src/stimulus/helpers/external-link-helpers.ts index ef3ff20dce5..d0fa9d33d1f 100644 --- a/frontend/src/stimulus/helpers/external-link-helpers.ts +++ b/frontend/src/stimulus/helpers/external-link-helpers.ts @@ -29,7 +29,7 @@ /** * Shared utilities for external link handling. Used by both * ExternalLinksController (DOM rewriting for server-rendered pages) and - * ProseMirrorExternalLinksController (click interception for BlockNote editors). + * BlockNote editor extensions (click interception and accessibility). */ /** @@ -42,18 +42,17 @@ export function isLinkBlank(link:HTMLAnchorElement) { } /** - * Returns true when the link points to a different origin than the current page. - * External links receive special treatment for security (noopener/noreferrer) - * and, when capture is enabled, are routed through `/external_redirect` for - * phishing prevention. + * Returns true when the given href string points to a different origin than + * the current page. Works with plain URL strings (e.g. from ProseMirror mark + * attrs) where no HTMLAnchorElement is available. * * Only considers http/https URLs — non-web protocols (mailto:, tel:, * javascript:, etc.) return false because they don't navigate to an * external origin. */ -export function isLinkExternal(link:HTMLAnchorElement) { +export function isHrefExternal(href:string):boolean { try { - const linkUrl = new URL(link.href, window.location.origin); + const linkUrl = new URL(href, window.location.origin); if (!linkUrl.protocol.startsWith('http')) return false; return linkUrl.origin !== window.location.origin; } catch { @@ -61,6 +60,16 @@ export function isLinkExternal(link:HTMLAnchorElement) { } } +/** + * Returns true when the link points to a different origin than the current page. + * External links receive special treatment for security (noopener/noreferrer) + * and, when capture is enabled, are routed through `/external_redirect` for + * phishing prevention. + */ +export function isLinkExternal(link:HTMLAnchorElement) { + return isHrefExternal(link.href); +} + /** * Returns true when the link is eligible for external-link processing. * Links with empty hrefs (e.g. anchor-only), download links, and non-web @@ -76,8 +85,8 @@ export function isExternalLinkCandidate(link:HTMLAnchorElement) { /** * Builds the `/external_redirect` URL that the server uses for external link * capture. The ExternalLinksController rewrites hrefs directly; the - * ProseMirrorExternalLinksController passes this URL to `window.open` on click - * to avoid corrupting the ProseMirror document model. + * ExternalLinkCaptureExtension passes this URL to `window.open` on click + * to avoid corrupting the BlockNote/ProseMirror document model. */ export function buildExternalRedirectUrl(href:string):string { const basePath = window.appBasePath ?? ''; diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index e8ec5b8b27d..cfb15c72746 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -78,20 +78,49 @@ RSpec.describe "External links in BlockNote editor", expect(link[:rel]).to include("noreferrer") end - it "does not set aria-describedby inside contenteditable to avoid ProseMirror re-render loop" do + it "embeds the 'opens in new tab' hint inside external links for screen readers" do editor.paste_links(text: "Accessible Link", url: "https://example.com") + # The hint is a ProseMirror widget decoration wrapped in the link mark, so + # it is rendered as a sr-only child of the . This makes it part of the + # link's accessible name, which screen readers announce reliably even + # inside contenteditable — unlike aria-describedby, which VoiceOver/NVDA + # ignore in edit mode. link = editor.shadow_root.find("a[target='_blank']", text: "Accessible Link", wait: 5) - expect(link[:"aria-describedby"]).to be_nil.or eq("") + hint = link.find("span.sr-only", visible: :all) + expect(hint.text(:all)).to eq(I18n.t(:open_link_in_a_new_tab)) + end + + it "emits exactly one hint when a link spans multiple inline nodes" do + # Paste HTML with a nested mark so the resulting contains two adjacent + # text nodes ("hello " with only the link mark, "world" with link+bold). + # This exercises the sameLinkContinues coalescing path — without it we'd + # get a spurious hint after "hello " mid-link. + el = editor.element + el.click + page.execute_script(<<~JS, el.native) + const el = arguments[0]; + const dt = new DataTransfer(); + dt.setData('text/html', 'hello world'); + dt.setData('text/plain', 'hello world'); + el.dispatchEvent(new ClipboardEvent('paste', { clipboardData: dt, bubbles: true, cancelable: true })); + JS + + link = editor.shadow_root.find("a[target='_blank']", text: /hello\s*world/, wait: 5) + hints = link.all("span.sr-only", visible: :all) + expect(hints.size).to eq(1) + expect(hints.first.text(:all)).to eq(I18n.t(:open_link_in_a_new_tab)) end it_behaves_like "does not freeze when pasting multiple external links" - it "does not rewrite internal links" do + it "does not rewrite internal links or attach the sr-only hint" do editor.paste_links(text: "Internal Link", url: root_url) link = editor.shadow_root.find("a", text: "Internal Link", wait: 5) expect(link.native.property("href")).not_to include("/external_redirect") + # Internal links should not receive the "opens in new tab" hint. + expect(link).to have_no_css("span.sr-only", visible: :all) end context "with capture enabled", From ba43a5ac83f516535f8fb04bb160373776e22a1b Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Sat, 2 May 2026 09:01:33 +0300 Subject: [PATCH 017/381] Rebuild link decorations only when link structure changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously buildDecorations walked the entire doc on every docChanged transaction. For documents with many links and large node counts, this became per-keystroke O(N) work. Split the per-transaction work into a hot path and a gated rebuild: - apply() now just maps existing decorations forward through the transaction's mapping. No doc walk. O(decoration count). - appendTransaction() inspects the batch's steps and rebuilds the DecorationSet only when at least one step actually changes the set of link runs (mark steps for link, replace steps whose slice or replaced range carries link marks). Synchronous appendTransaction was chosen over a view.update + rAF debounce so we don't have to guard against the editor unmounting between scheduling and firing — Turbo navigation and React teardown can both trigger that race. Covers local typing, remote y-prosemirror updates, and Hocuspocus reconnect backlogs uniformly through the same gate. Adds a primer comment block introducing the relevant ProseMirror concepts (transaction, step, slice, mapping, decoration set, meta) since plugin internals are unfamiliar to most contributors. --- .../react/extensions/external-link-a11y.ts | 124 +++++++++++++++++- 1 file changed, 120 insertions(+), 4 deletions(-) diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts index c4dc8aadb51..8c51364e1ea 100644 --- a/frontend/src/react/extensions/external-link-a11y.ts +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -29,7 +29,14 @@ import { createExtension } from '@blocknote/core'; import { Plugin, PluginKey } from 'prosemirror-state'; import { Decoration, DecorationSet } from 'prosemirror-view'; -import type { Node as PmNode, Mark } from 'prosemirror-model'; +import { + AddMarkStep, + RemoveMarkStep, + ReplaceStep, + ReplaceAroundStep, +} from 'prosemirror-transform'; +import type { Step } from 'prosemirror-transform'; +import type { Node as PmNode, Mark, Slice } from 'prosemirror-model'; import { isHrefExternal } from 'core-stimulus/helpers/external-link-helpers'; const pluginKey = new PluginKey('externalLinkA11y'); @@ -86,6 +93,80 @@ function buildWidget():HTMLElement { return span; } +// ProseMirror primer for the gating logic below +// ---------------------------------------------- +// • Transaction (`tr`): an immutable description of an edit. Editor state +// moves forward by applying transactions, not by direct DOM mutation. +// • Step: the atomic operation a transaction is built from. Relevant ones +// are ReplaceStep (replace a range with a Slice of content) and +// AddMarkStep / RemoveMarkStep (toggle a mark like `link` on a range). +// • Slice: the chunk of content carried by a ReplaceStep — what is being +// pasted, typed, or otherwise inserted. +// • Mapping (`tr.mapping`): ProseMirror's position translator. After an +// insert of N characters at position 10, mapping rewrites later +// positions to account for the shift. Decorations can be mapped through +// it to stay in sync without being rebuilt. +// • Decoration / DecorationSet: non-mutating overlays (widgets, attrs) +// rendered alongside the document. The sr-only hint here is a widget +// decoration — invisible to the model, visible (audible) in the DOM. +// • `tr.setMeta(key, value)`: stash arbitrary data on a transaction +// without producing a doc edit. Used here to hand a freshly-built +// DecorationSet from the post-batch hook back into plugin state. + +function sliceContainsLinkMark(slice:Slice):boolean { + let found = false; + slice.content.descendants((node) => { + if (found) return false; + if (node.marks.some((m) => m.type.name === 'link')) { + found = true; + return false; + } + return true; + }); + return found; +} + +function rangeContainsLinkMark(doc:PmNode, from:number, to:number):boolean { + if (from >= to) return false; + let found = false; + doc.nodesBetween(from, to, (node) => { + if (found) return false; + if (node.marks.some((m) => m.type.name === 'link')) { + found = true; + return false; + } + return true; + }); + return found; +} + +/** + * Decides whether a transaction's steps actually change the *set* of link + * runs in the doc, vs. just shifting their positions. + * + * Plain typing or moving content around merely shifts link runs — the + * existing widget at the end of each run rides along correctly via + * decoration mapping. The expensive doc walk is only needed when the set + * of links changes: paste with linked content, toolbar mark application, + * or deletion of marked content. + * + * For ReplaceStep we have to inspect both ends. The inserted Slice may + * carry link marks INTO the doc; the range being replaced may carry link + * marks OUT of it (e.g. deleting a whole link). Missing the second check + * would leave the link's widget stranded at a position that no longer has + * a link. + */ +function stepAffectsLinks(step:Step, oldDoc:PmNode):boolean { + if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) { + return step.mark.type.name === 'link'; + } + if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep) { + if (sliceContainsLinkMark(step.slice)) return true; + return rangeContainsLinkMark(oldDoc, step.from, step.to); + } + return false; +} + function buildDecorations(doc:PmNode):DecorationSet { const decorations:Decoration[] = []; @@ -155,13 +236,48 @@ export const ExternalLinkA11yExtension = createExtension({ init(_, { doc }) { return buildDecorations(doc); }, + // `apply` runs once per transaction to advance plugin state. It is + // the hot path during typing — must stay cheap. + // 1. If a transaction carries a meta payload from us, install it + // verbatim. That's how the post-batch hook below hands a freshly + // rebuilt DecorationSet back into state. + // 2. If the doc didn't change, decorations are still valid as-is. + // 3. Otherwise, just shift existing decorations forward through the + // transaction's position mapping. No doc walk, O(decoration count). apply(tr, oldDecos) { - if (tr.docChanged) { - return buildDecorations(tr.doc); - } + const meta = tr.getMeta(pluginKey) as DecorationSet | undefined; + if (meta instanceof DecorationSet) return meta; + if (!tr.docChanged) return oldDecos; return oldDecos.map(tr.mapping, tr.doc); }, }, + // `appendTransaction` is a ProseMirror plugin hook that runs after a + // batch of transactions has been applied but before the view re-renders. + // It receives the array of dispatched transactions and may return one + // additional transaction to chain. We use it as the gate for the + // expensive rebuild: only when at least one step in the batch actually + // changes which link runs exist do we walk the doc and dispatch a + // meta-only transaction with the fresh DecorationSet (picked up by + // `apply` above). + // + // Why here and not in `view.update` with rAF (`requestAnimationFrame`, + // a browser API that defers a callback to the next paint, ~16ms): + // `appendTransaction` is synchronous and lifecycle-safe. An rAF callback + // can fire after the editor has unmounted (Turbo navigation, React + // teardown), at which point dispatching into a destroyed view throws. + // Running this hook synchronously sidesteps that class of bug entirely. + // + // This path covers all edit sources uniformly: local typing, remote + // y-prosemirror updates from collaborators, and Hocuspocus reconnect + // backlogs all flow through the same transaction pipeline. + appendTransaction(trs, oldState, newState) { + const linkAffecting = trs.some((tr) => + tr.docChanged + && tr.steps.some((step) => stepAffectsLinks(step, oldState.doc)), + ); + if (!linkAffecting) return null; + return newState.tr.setMeta(pluginKey, buildDecorations(newState.doc)); + }, props: { decorations(state) { return pluginKey.getState(state) as DecorationSet; From dd5a5c00d9c6fb55fed2f7223b0c702230d7664d Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Sat, 2 May 2026 09:15:48 +0300 Subject: [PATCH 018/381] Move link-decoration gating from appendTransaction to apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit gated the expensive rebuild via a synchronous appendTransaction hook that dispatched a meta-only transaction with the fresh DecorationSet, picked up by apply through tr.getMeta. The feature spec at modules/documents/spec/features/external_links_in_block_note_spec.rb revealed this interferes with y-prosemirror's PM<->Y.Doc sync on paste: paste transactions were applied locally, but the chained meta-only tx caused their content to never reach the rendered view (7/8 paste-based examples failed; bisecting confirmed the regression was specific to the appendTransaction return value). Switching the gate inline into apply removes the chained tx entirely. Same optimization shape — typing outside a link only maps existing decorations forward; only steps that touch link marks rebuild. Trade-off: deleting a whole link's text leaves an orphan widget because the slice-only check can't see the deleted range's marks. The widget gets cleaned up on the next link-affecting transaction. Visible cost: a sr-only span without a link wrapper between events — invisible to sighted users, briefly noisy for screen readers if they navigate before the next rebuild. Also drops the rangeContainsLinkMark helper (no longer needed) and the tr.setMeta bullet from the primer block. 8/8 examples pass. --- .../react/extensions/external-link-a11y.ts | 186 +++++++----------- 1 file changed, 75 insertions(+), 111 deletions(-) diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts index 8c51364e1ea..e1aed591476 100644 --- a/frontend/src/react/extensions/external-link-a11y.ts +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -39,9 +39,28 @@ import type { Step } from 'prosemirror-transform'; import type { Node as PmNode, Mark, Slice } from 'prosemirror-model'; import { isHrefExternal } from 'core-stimulus/helpers/external-link-helpers'; +// ProseMirror primer +// ------------------ +// • Transaction (`tr`): an immutable description of an edit. Editor state +// moves forward by applying transactions, not by direct DOM mutation. +// • Step: the atomic operation a transaction is built from. Relevant ones +// are ReplaceStep (replace a range with a Slice of content) and +// AddMarkStep / RemoveMarkStep (toggle a mark like `link` on a range). +// • Slice: the chunk of content carried by a ReplaceStep — what is being +// pasted, typed, or otherwise inserted. +// • Mapping (`tr.mapping`): ProseMirror's position translator. After an +// insert of N characters at position 10, mapping rewrites later +// positions to account for the shift. Decorations can be mapped through +// it to stay in sync without being rebuilt. +// • Decoration / DecorationSet: non-mutating overlays (widgets, attrs) +// rendered alongside the document. The sr-only hint here is a widget +// decoration — invisible to the model, visible (audible) in the DOM. + const pluginKey = new PluginKey('externalLinkA11y'); const DESCRIPTION_ID = 'open-blank-target-link-description'; +// --- Decoration construction ------------------------------------------------ + function findExternalLinkMark(node:PmNode):Mark|null { for (const mark of node.marks) { if (mark.type.name === 'link' && isHrefExternal(String(mark.attrs.href ?? ''))) { @@ -93,80 +112,6 @@ function buildWidget():HTMLElement { return span; } -// ProseMirror primer for the gating logic below -// ---------------------------------------------- -// • Transaction (`tr`): an immutable description of an edit. Editor state -// moves forward by applying transactions, not by direct DOM mutation. -// • Step: the atomic operation a transaction is built from. Relevant ones -// are ReplaceStep (replace a range with a Slice of content) and -// AddMarkStep / RemoveMarkStep (toggle a mark like `link` on a range). -// • Slice: the chunk of content carried by a ReplaceStep — what is being -// pasted, typed, or otherwise inserted. -// • Mapping (`tr.mapping`): ProseMirror's position translator. After an -// insert of N characters at position 10, mapping rewrites later -// positions to account for the shift. Decorations can be mapped through -// it to stay in sync without being rebuilt. -// • Decoration / DecorationSet: non-mutating overlays (widgets, attrs) -// rendered alongside the document. The sr-only hint here is a widget -// decoration — invisible to the model, visible (audible) in the DOM. -// • `tr.setMeta(key, value)`: stash arbitrary data on a transaction -// without producing a doc edit. Used here to hand a freshly-built -// DecorationSet from the post-batch hook back into plugin state. - -function sliceContainsLinkMark(slice:Slice):boolean { - let found = false; - slice.content.descendants((node) => { - if (found) return false; - if (node.marks.some((m) => m.type.name === 'link')) { - found = true; - return false; - } - return true; - }); - return found; -} - -function rangeContainsLinkMark(doc:PmNode, from:number, to:number):boolean { - if (from >= to) return false; - let found = false; - doc.nodesBetween(from, to, (node) => { - if (found) return false; - if (node.marks.some((m) => m.type.name === 'link')) { - found = true; - return false; - } - return true; - }); - return found; -} - -/** - * Decides whether a transaction's steps actually change the *set* of link - * runs in the doc, vs. just shifting their positions. - * - * Plain typing or moving content around merely shifts link runs — the - * existing widget at the end of each run rides along correctly via - * decoration mapping. The expensive doc walk is only needed when the set - * of links changes: paste with linked content, toolbar mark application, - * or deletion of marked content. - * - * For ReplaceStep we have to inspect both ends. The inserted Slice may - * carry link marks INTO the doc; the range being replaced may carry link - * marks OUT of it (e.g. deleting a whole link). Missing the second check - * would leave the link's widget stranded at a position that no longer has - * a link. - */ -function stepAffectsLinks(step:Step, oldDoc:PmNode):boolean { - if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) { - return step.mark.type.name === 'link'; - } - if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep) { - if (sliceContainsLinkMark(step.slice)) return true; - return rangeContainsLinkMark(oldDoc, step.from, step.to); - } - return false; -} - function buildDecorations(doc:PmNode):DecorationSet { const decorations:Decoration[] = []; @@ -202,6 +147,49 @@ function buildDecorations(doc:PmNode):DecorationSet { return DecorationSet.create(doc, decorations); } +// --- Transaction gating ----------------------------------------------------- + +function sliceContainsLinkMark(slice:Slice):boolean { + let found = false; + slice.content.descendants((node) => { + if (found) return false; + if (node.marks.some((m) => m.type.name === 'link')) { + found = true; + return false; + } + return true; + }); + return found; +} + +/** + * Decides whether a step warrants rebuilding the widget set, vs. just + * shifting existing decorations forward. + * + * Plain typing or moving content around merely shifts link runs — the + * widget at the end of each run rides along correctly via decoration + * mapping. The expensive doc walk is only needed when a step adds, + * removes, or moves a link mark. + * + * Limitation: deleting a whole link's text leaves the slice empty, and + * we don't have cheap access to the old range here to detect that the + * removed range carried a link mark. The orphaned widget gets cleaned + * up by the next link-affecting transaction (e.g. typing nearby with a + * stored link mark, or any subsequent paste). The visible cost between + * those events is a sr-only span at a position that no longer has a + * link wrapper around it — invisible to sighted users, briefly noisy + * for screen readers if they navigate before the next rebuild. + */ +function stepAffectsLinks(step:Step):boolean { + if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) { + return step.mark.type.name === 'link'; + } + if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep) { + return sliceContainsLinkMark(step.slice); + } + return false; +} + /** * BlockNote extension that adds a screen-reader-only "opens in new tab" hint * to external links inside the editor. @@ -236,48 +224,24 @@ export const ExternalLinkA11yExtension = createExtension({ init(_, { doc }) { return buildDecorations(doc); }, - // `apply` runs once per transaction to advance plugin state. It is - // the hot path during typing — must stay cheap. - // 1. If a transaction carries a meta payload from us, install it - // verbatim. That's how the post-batch hook below hands a freshly - // rebuilt DecorationSet back into state. - // 2. If the doc didn't change, decorations are still valid as-is. - // 3. Otherwise, just shift existing decorations forward through the - // transaction's position mapping. No doc walk, O(decoration count). + // `apply` runs once per transaction to advance plugin state and is + // the hot path during typing. Three branches: + // 1. Doc unchanged: decorations are still valid as-is. + // 2. Doc changed but no step affects link runs: shift existing + // decorations forward through the transaction's position + // mapping. O(decoration count); no doc walk. + // 3. A step adds, removes, or moves a link mark: rebuild. + // + // The rebuild lives here in `apply` rather than in `appendTransaction` + // because dispatching a chained meta-only tx from there interferes + // with y-prosemirror's PM↔Y.Doc sync — paste content gets applied + // locally but never reaches the rendered view. apply(tr, oldDecos) { - const meta = tr.getMeta(pluginKey) as DecorationSet | undefined; - if (meta instanceof DecorationSet) return meta; if (!tr.docChanged) return oldDecos; + if (tr.steps.some(stepAffectsLinks)) return buildDecorations(tr.doc); return oldDecos.map(tr.mapping, tr.doc); }, }, - // `appendTransaction` is a ProseMirror plugin hook that runs after a - // batch of transactions has been applied but before the view re-renders. - // It receives the array of dispatched transactions and may return one - // additional transaction to chain. We use it as the gate for the - // expensive rebuild: only when at least one step in the batch actually - // changes which link runs exist do we walk the doc and dispatch a - // meta-only transaction with the fresh DecorationSet (picked up by - // `apply` above). - // - // Why here and not in `view.update` with rAF (`requestAnimationFrame`, - // a browser API that defers a callback to the next paint, ~16ms): - // `appendTransaction` is synchronous and lifecycle-safe. An rAF callback - // can fire after the editor has unmounted (Turbo navigation, React - // teardown), at which point dispatching into a destroyed view throws. - // Running this hook synchronously sidesteps that class of bug entirely. - // - // This path covers all edit sources uniformly: local typing, remote - // y-prosemirror updates from collaborators, and Hocuspocus reconnect - // backlogs all flow through the same transaction pipeline. - appendTransaction(trs, oldState, newState) { - const linkAffecting = trs.some((tr) => - tr.docChanged - && tr.steps.some((step) => stepAffectsLinks(step, oldState.doc)), - ); - if (!linkAffecting) return null; - return newState.tr.setMeta(pluginKey, buildDecorations(newState.doc)); - }, props: { decorations(state) { return pluginKey.getState(state) as DecorationSet; From cd735c01ded83d278693f8705e63e44c5bf3c71a Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Mon, 4 May 2026 20:53:01 +0300 Subject: [PATCH 019/381] Separate sr-only link hint from preceding link text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sr-only "Open link in a new tab" hint becomes part of the link's computed accessible name. Without a separator between the link text and the hint, AT can announce them as a single concatenated word — descendant text-node concatenation isn't guaranteed to insert whitespace, especially in contenteditable. Prefix the widget text with an NBSP and relax the feature spec to use `include` so the separator detail stays an implementation concern of the extension. --- frontend/src/react/extensions/external-link-a11y.ts | 8 +++++++- .../spec/features/external_links_in_block_note_spec.rb | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts index e1aed591476..29ee0f1601b 100644 --- a/frontend/src/react/extensions/external-link-a11y.ts +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -108,7 +108,13 @@ function buildWidget():HTMLElement { span.setAttribute('contenteditable', 'false'); // Reuse the same translated string the body-level ExternalLinksController // references via aria-describedby, keeping i18n centralised in Rails. - span.textContent = readDescription(); + // Captured at decoration-creation time, so a mid-session locale change + // keeps stale text until the next rebuild. Leading NBSP is a separator + // for the link's computed accessible name — without it, AT can announce + // "Link textOpen link in a new tab" because descendant text-node + // concatenation isn't guaranteed to insert whitespace, especially in + // contenteditable. + span.textContent = `\u00A0${readDescription()}`; return span; } diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index cfb15c72746..ea3c642d4cd 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -88,7 +88,11 @@ RSpec.describe "External links in BlockNote editor", # ignore in edit mode. link = editor.shadow_root.find("a[target='_blank']", text: "Accessible Link", wait: 5) hint = link.find("span.sr-only", visible: :all) - expect(hint.text(:all)).to eq(I18n.t(:open_link_in_a_new_tab)) + # The widget text is prefixed with a separator (NBSP) so the link's + # computed accessible name doesn't concatenate as "Accessible LinkOpen…". + # We assert containment rather than equality so the separator detail + # stays an implementation concern of the extension, not the spec. + expect(hint.text(:all)).to include(I18n.t(:open_link_in_a_new_tab)) end it "emits exactly one hint when a link spans multiple inline nodes" do @@ -109,7 +113,7 @@ RSpec.describe "External links in BlockNote editor", link = editor.shadow_root.find("a[target='_blank']", text: /hello\s*world/, wait: 5) hints = link.all("span.sr-only", visible: :all) expect(hints.size).to eq(1) - expect(hints.first.text(:all)).to eq(I18n.t(:open_link_in_a_new_tab)) + expect(hints.first.text(:all)).to include(I18n.t(:open_link_in_a_new_tab)) end it_behaves_like "does not freeze when pasting multiple external links" From ee4dfdeb19415fb1133c23f9a176d5d16df801ff Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Tue, 5 May 2026 09:55:43 +0300 Subject: [PATCH 020/381] Drop "Limitation" doc, codify deletion invariant in spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The orphan-widget concern Copilot raised on the apply gate isn't reachable. Forcing the gate's slice check off and deleting a whole linked range still produces a clean DOM — PM's WidgetType.map resolves the widget's position with assoc=-1 (which the widget's side: -1 enforces), finds the anchor inside the deleted content, and reports deleted: true. PM drops the decoration on its own. Replacing the "Limitation" JSDoc paragraph (which described a mental model that doesn't match WidgetType.map's rules) with a feature spec that exercises a single-tx delete via DOM Range + W3C actions Delete. The spec fails if side, the apply gate, or buildDecorations ever stops preserving the invariant — serving the disclosure purpose the JSDoc tried to, but mechanically. --- .../react/extensions/external-link-a11y.ts | 9 ----- .../external_links_in_block_note_spec.rb | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts index 29ee0f1601b..d726f4a7277 100644 --- a/frontend/src/react/extensions/external-link-a11y.ts +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -176,15 +176,6 @@ function sliceContainsLinkMark(slice:Slice):boolean { * widget at the end of each run rides along correctly via decoration * mapping. The expensive doc walk is only needed when a step adds, * removes, or moves a link mark. - * - * Limitation: deleting a whole link's text leaves the slice empty, and - * we don't have cheap access to the old range here to detect that the - * removed range carried a link mark. The orphaned widget gets cleaned - * up by the next link-affecting transaction (e.g. typing nearby with a - * stored link mark, or any subsequent paste). The visible cost between - * those events is a sr-only span at a position that no longer has a - * link wrapper around it — invisible to sighted users, briefly noisy - * for screen readers if they navigate before the next rebuild. */ function stepAffectsLinks(step:Step):boolean { if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) { diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index ea3c642d4cd..4f16205afa2 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -118,6 +118,46 @@ RSpec.describe "External links in BlockNote editor", it_behaves_like "does not freeze when pasting multiple external links" + it "leaves no orphan hint when a linked range is deleted in one transaction" do + editor.paste_links(text: "Doomed Link", url: "https://example.com") + link = editor.shadow_root.find("a[target='_blank']", text: "Doomed Link", wait: 5) + expect(link).to have_css("span.sr-only", visible: :all) + + # Regression: a single-transaction delete of a linked range must + # leave no orphan widget. The widget is registered with `side: -1`, + # so PM's `WidgetType.map` resolves its position with `assoc = -1` + # when the link is replaced with an empty slice, finds the anchor + # inside the deleted content, and reports `deleted: true`. PM drops + # the decoration automatically — no rebuild in this plugin is + # needed. + # + # If `side`, the apply gate, or buildDecorations ever stops + # preserving this, a phantom empty with the sr-only hint would + # survive at the deletion seam and screen readers would announce a + # link to nowhere. This test fails before that ships. + # + # Selection uses a DOM Range over the link's text node (the widget + # span is contenteditable=false and excluded). Delete goes through + # the W3C actions API because Selenium's send_keys doesn't + # propagate Backspace/Delete to PM's editable in this shadow-DOM + # setup. + page.execute_script(<<~JS) + const root = document.querySelector('op-block-note').shadowRoot; + const a = root.querySelector('a[target="_blank"]'); + const textNode = [...a.childNodes].find((n) => n.nodeType === 3); + const range = document.createRange(); + range.setStart(textNode, 0); + range.setEnd(textNode, textNode.textContent.length); + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + JS + page.driver.browser.action.send_keys(:delete).perform + + expect(editor.element).to have_no_css("a[target='_blank']", visible: :all) + expect(editor.element).to have_no_css("span.sr-only", visible: :all) + end + it "does not rewrite internal links or attach the sr-only hint" do editor.paste_links(text: "Internal Link", url: root_url) From 4113a2c382ace55a0328416a794232589086861b Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Thu, 21 May 2026 11:20:31 +0300 Subject: [PATCH 021/381] Add spec for editing tail of surviving external link Locks in the invariant that editing inside an existing link routes through decoration mapping rather than a rebuild: the ReplaceStep slice carries no link mark, so the apply gate maps the existing widget set instead of recomputing it. The screen-reader hint must shrink with the link run from the right and stay anchored to the new tail, leaving exactly one hint on the surviving link. --- .../external_links_in_block_note_spec.rb | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index 4f16205afa2..7a0cc8e10a1 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -158,6 +158,38 @@ RSpec.describe "External links in BlockNote editor", expect(editor.element).to have_no_css("span.sr-only", visible: :all) end + it "preserves the hint when text is deleted from the end of a surviving link" do + editor.paste_links(text: "Trim Me Tail", url: "https://example.com/tail") + link = editor.shadow_root.find("a[target='_blank']", text: "Trim Me Tail", wait: 5) + expect(link).to have_css("span.sr-only", visible: :all) + + # Edits inside an existing link produce a ReplaceStep whose slice carries + # no link mark (the mark is inherited from stored marks, not the slice), + # so the apply gate routes through decoration mapping rather than a + # rebuild. The widget sits at the end of the link run with `side: -1`; + # the mapping must shrink the run from the right and keep the widget + # attached to the new tail. If that ever regresses, the hint either + # disappears or ends up orphaned at a stale position. + page.execute_script(<<~JS) + const root = document.querySelector('op-block-note').shadowRoot; + const a = root.querySelector('a[target="_blank"]'); + const textNode = [...a.childNodes].find((n) => n.nodeType === 3); + const len = textNode.textContent.length; + const range = document.createRange(); + range.setStart(textNode, len - 4); + range.setEnd(textNode, len); + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + JS + page.driver.browser.action.send_keys(:delete).perform + + surviving = editor.shadow_root.find("a[target='_blank']", text: "Trim Me", wait: 5) + hints = surviving.all("span.sr-only", visible: :all) + expect(hints.size).to eq(1) + expect(hints.first.text(:all)).to include(I18n.t(:open_link_in_a_new_tab)) + end + it "does not rewrite internal links or attach the sr-only hint" do editor.paste_links(text: "Internal Link", url: root_url) From 6c8c8af771d1952b81ebf8b9efa69651ed623f77 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Thu, 21 May 2026 10:47:50 +0200 Subject: [PATCH 022/381] [#73354] hide delete action instead of disabling - add authorisation check for deletion action --- modules/wikis/app/components/wikis/page_link_component.rb | 2 +- .../app/controllers/wikis/relation_page_links_controller.rb | 4 +--- modules/wikis/lib/open_project/wikis/engine.rb | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/wikis/app/components/wikis/page_link_component.rb b/modules/wikis/app/components/wikis/page_link_component.rb index 17f5570ced6..a94c3ffa76d 100644 --- a/modules/wikis/app/components/wikis/page_link_component.rb +++ b/modules/wikis/app/components/wikis/page_link_component.rb @@ -72,6 +72,7 @@ module Wikis def deletion_action_item(menu) return if @page_link.nil? + return unless user_allowed_to_delete? href = url_helpers.confirm_delete_dialog_relation_wiki_page_link_path(@page_link) @@ -79,7 +80,6 @@ module Wikis scheme: :danger, tag: :a, href:, - disabled: !user_allowed_to_delete?, content_arguments: { data: { controller: "async-dialog" } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb b/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb index a3c2c9207bc..895499df76a 100644 --- a/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb +++ b/modules/wikis/app/controllers/wikis/relation_page_links_controller.rb @@ -33,9 +33,7 @@ module Wikis include OpTurbo::ComponentStream before_action :find_page_link - before_action :authorize, except: %i[confirm_delete_dialog] - - no_authorization_required! :confirm_delete_dialog + before_action :authorize def destroy # TODO: implement delete service diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index ab1ebbab1e8..5d70952d9aa 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -72,7 +72,7 @@ module OpenProject::Wikis register "openproject-wikis", author_url: "https://openproject.org" do project_module :work_package_tracking do permission :manage_wiki_page_links, - { "wikis/relation_page_links": %i[destroy] }, + { "wikis/relation_page_links": %i[destroy confirm_delete_dialog] }, permissible_on: :project, dependencies: %i[edit_work_packages], contract_actions: { wiki_page_links: %i[manage] } From 4d61d1d325a91e3daf8b2669b43d2fbddd7d6ed4 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Thu, 21 May 2026 10:51:37 +0200 Subject: [PATCH 023/381] [#73354] removed unused test setup --- .../spec/components/wikis/relation_page_links_component_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb index 073878b625f..bbc4f394334 100644 --- a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb +++ b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb @@ -87,7 +87,6 @@ RSpec.describe Wikis::RelationPageLinksComponent, type: :component do end context "when the user has a token and there are page links" do - let(:page_link) { create(:relation_wiki_page_link, linkable: work_package, provider:) } let(:page_info) do Wikis::Adapters::Results::PageInfo.new( identifier: "MyPage", From 78e99c6bc419db7004cb951e016b57f66ddfd767 Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Thu, 21 May 2026 11:58:17 +0300 Subject: [PATCH 024/381] Rebuild link decorations on any range deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The widget decorating each external link sits at the link's right edge with `side: -1`. ProseMirror's `WidgetType.map` flagged it as deleted whenever a `ReplaceStep`'s right edge coincided with that position — PM's mapping forces `side=1` at the deletion boundary, which clashes with the widget's `assoc=-1`. The result: editing the tail of a link silently dropped its screen-reader hint until something else triggered a rebuild. `stepAffectsLinks` now treats any `ReplaceStep`/`ReplaceAroundStep` with `from != to` as link-affecting. Pure insertions (`from == to`) still take the cheap mapping path, so typing performance is unchanged. --- .../src/react/extensions/external-link-a11y.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/react/extensions/external-link-a11y.ts b/frontend/src/react/extensions/external-link-a11y.ts index d726f4a7277..48b05b394ff 100644 --- a/frontend/src/react/extensions/external-link-a11y.ts +++ b/frontend/src/react/extensions/external-link-a11y.ts @@ -172,16 +172,23 @@ function sliceContainsLinkMark(slice:Slice):boolean { * Decides whether a step warrants rebuilding the widget set, vs. just * shifting existing decorations forward. * - * Plain typing or moving content around merely shifts link runs — the - * widget at the end of each run rides along correctly via decoration - * mapping. The expensive doc walk is only needed when a step adds, - * removes, or moves a link mark. + * Pure typing inserts content without touching link boundaries; the widget + * at the end of each run rides along correctly via decoration mapping, so + * the doc walk can be skipped. A rebuild is needed when: + * - a link mark is added, removed, or moved by a mark step; + * - an inserted slice itself carries a link mark (paste of linked HTML); + * - any range is deleted or replaced. Deletions whose right edge meets a + * link's trailing widget make `WidgetType.map` report the widget as + * deleted (PM's mapping forces `side=1` at the deletion's right edge, + * which clashes with our `assoc=-1`). The simplest robust answer is to + * reseat the widget set whenever a range is removed. */ function stepAffectsLinks(step:Step):boolean { if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) { return step.mark.type.name === 'link'; } if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep) { + if (step.from !== step.to) return true; return sliceContainsLinkMark(step.slice); } return false; From 28c94cfb461561a160bace99c02ca80a5112418f Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Thu, 21 May 2026 11:58:36 +0300 Subject: [PATCH 025/381] Extract browser-action helpers in external-link spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two delete-path tests and the multi-inline-node paste test each inlined a slab of `page.execute_script` to drive the editor's contenteditable inside its shadow root, with significant duplication around DOM Range setup and ClipboardEvent construction. Pull these into a `BlockNoteEditorBrowserActions` module: - `select_text_in_external_link(start_offset:, end_offset:)` — selects a substring of the first link's text node, with String-slicing semantics for the offsets (negatives count from the end). - `send_forward_delete` — forward Delete via the W3C actions API, needed because Capybara's send_keys does not reach PM's editable in this setup. - `paste_clipboard_into(element, html:, plain:)` — fires a paste ClipboardEvent on the given editor element. The deletion-test comments are also tightened to describe the current invariant (apply gate reseats the widget on any range deletion) rather than the pre-rebuild mapping mechanics they used to enumerate. --- .../external_links_in_block_note_spec.rb | 131 ++++++++++-------- 1 file changed, 72 insertions(+), 59 deletions(-) diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index 7a0cc8e10a1..f496b5d30a9 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -30,11 +30,64 @@ require "rails_helper" +# Low-level browser actions for driving the BlockNote editor's contenteditable +# inside its shadow root. Capybara cannot enter the shadow root for selection, +# nor does its `send_keys` propagate Delete/Backspace into ProseMirror's +# editable in this setup, so each helper drops to the Selenium driver: either +# running JS via `execute_script` or issuing raw keystrokes via the W3C +# actions API. +module BlockNoteEditorBrowserActions + # Selects a text range inside the first external link in the editor. + # `start_offset` and `end_offset` follow String-slicing conventions: a + # non-negative integer is an absolute offset from the start of the link's + # text node; a negative integer counts back from the end; `nil` maps to the + # text length. Default arguments select the entire link text. + def select_text_in_external_link(start_offset: 0, end_offset: nil) + page.execute_script(<<~JS, start_offset, end_offset) + const root = document.querySelector('op-block-note').shadowRoot; + const a = root.querySelector('a[target="_blank"]'); + const textNode = [...a.childNodes].find((n) => n.nodeType === 3); + const len = textNode.textContent.length; + const resolve = (v) => (v == null ? len : (v < 0 ? len + v : v)); + const range = document.createRange(); + range.setStart(textNode, resolve(arguments[0])); + range.setEnd(textNode, resolve(arguments[1])); + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + JS + end + + # Forward Delete via the W3C actions API; pair with a selection helper. + def send_forward_delete + page.driver.browser.action.send_keys(:delete).perform + end + + # Fires a paste ClipboardEvent on the editor with both HTML and plain-text + # payloads. Exercises ProseMirror's `transformPasted` path, which behaves + # differently from typed input. + def paste_clipboard_into(editor_element, html:, plain:) + editor_element.click + page.execute_script(<<~JS, editor_element.native, html, plain) + const target = arguments[0]; + const dt = new DataTransfer(); + dt.setData('text/html', arguments[1]); + dt.setData('text/plain', arguments[2]); + target.dispatchEvent(new ClipboardEvent('paste', { + clipboardData: dt, + bubbles: true, + cancelable: true, + })); + JS + end +end + RSpec.describe "External links in BlockNote editor", :js, :selenium, with_settings: { real_time_text_collaboration_enabled: true } do include_context "with hocuspocus" + include BlockNoteEditorBrowserActions let(:admin) { create(:admin) } let(:document) { create(:document, :collaborative) } @@ -100,15 +153,11 @@ RSpec.describe "External links in BlockNote editor", # text nodes ("hello " with only the link mark, "world" with link+bold). # This exercises the sameLinkContinues coalescing path — without it we'd # get a spurious hint after "hello " mid-link. - el = editor.element - el.click - page.execute_script(<<~JS, el.native) - const el = arguments[0]; - const dt = new DataTransfer(); - dt.setData('text/html', 'hello world'); - dt.setData('text/plain', 'hello world'); - el.dispatchEvent(new ClipboardEvent('paste', { clipboardData: dt, bubbles: true, cancelable: true })); - JS + paste_clipboard_into( + editor.element, + html: 'hello world', + plain: "hello world" + ) link = editor.shadow_root.find("a[target='_blank']", text: /hello\s*world/, wait: 5) hints = link.all("span.sr-only", visible: :all) @@ -123,36 +172,13 @@ RSpec.describe "External links in BlockNote editor", link = editor.shadow_root.find("a[target='_blank']", text: "Doomed Link", wait: 5) expect(link).to have_css("span.sr-only", visible: :all) - # Regression: a single-transaction delete of a linked range must - # leave no orphan widget. The widget is registered with `side: -1`, - # so PM's `WidgetType.map` resolves its position with `assoc = -1` - # when the link is replaced with an empty slice, finds the anchor - # inside the deleted content, and reports `deleted: true`. PM drops - # the decoration automatically — no rebuild in this plugin is - # needed. - # - # If `side`, the apply gate, or buildDecorations ever stops - # preserving this, a phantom empty with the sr-only hint would - # survive at the deletion seam and screen readers would announce a - # link to nowhere. This test fails before that ships. - # - # Selection uses a DOM Range over the link's text node (the widget - # span is contenteditable=false and excluded). Delete goes through - # the W3C actions API because Selenium's send_keys doesn't - # propagate Backspace/Delete to PM's editable in this shadow-DOM - # setup. - page.execute_script(<<~JS) - const root = document.querySelector('op-block-note').shadowRoot; - const a = root.querySelector('a[target="_blank"]'); - const textNode = [...a.childNodes].find((n) => n.nodeType === 3); - const range = document.createRange(); - range.setStart(textNode, 0); - range.setEnd(textNode, textNode.textContent.length); - const sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - JS - page.driver.browser.action.send_keys(:delete).perform + # Deleting an entire link must leave no orphan widget at the deletion + # seam. The apply gate reseats the widget set on any range deletion, so + # buildDecorations runs on the post-delete doc, finds no link, and emits + # no widget. A regression here would render a phantom empty hosting + # the sr-only hint, and screen readers would announce a link to nowhere. + select_text_in_external_link + send_forward_delete expect(editor.element).to have_no_css("a[target='_blank']", visible: :all) expect(editor.element).to have_no_css("span.sr-only", visible: :all) @@ -163,26 +189,13 @@ RSpec.describe "External links in BlockNote editor", link = editor.shadow_root.find("a[target='_blank']", text: "Trim Me Tail", wait: 5) expect(link).to have_css("span.sr-only", visible: :all) - # Edits inside an existing link produce a ReplaceStep whose slice carries - # no link mark (the mark is inherited from stored marks, not the slice), - # so the apply gate routes through decoration mapping rather than a - # rebuild. The widget sits at the end of the link run with `side: -1`; - # the mapping must shrink the run from the right and keep the widget - # attached to the new tail. If that ever regresses, the hint either - # disappears or ends up orphaned at a stale position. - page.execute_script(<<~JS) - const root = document.querySelector('op-block-note').shadowRoot; - const a = root.querySelector('a[target="_blank"]'); - const textNode = [...a.childNodes].find((n) => n.nodeType === 3); - const len = textNode.textContent.length; - const range = document.createRange(); - range.setStart(textNode, len - 4); - range.setEnd(textNode, len); - const sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - JS - page.driver.browser.action.send_keys(:delete).perform + # Tail-deletion inside a link must leave exactly one hint at the new + # link end. Mapping the existing widget through the deletion is unsafe: + # PM treats the widget's position as deleted when it coincides with the + # deletion's right edge. The apply gate's deletion rule reseats the + # widget on the post-delete doc instead. + select_text_in_external_link(start_offset: -4) + send_forward_delete surviving = editor.shadow_root.find("a[target='_blank']", text: "Trim Me", wait: 5) hints = surviving.all("span.sr-only", visible: :all) From cada809a24f4f959b58ad9eab33a6e9bb65e4906 Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Thu, 21 May 2026 11:59:51 +0200 Subject: [PATCH 026/381] [#73354] fixed current unit tests --- .../relation_page_links_component_spec.rb | 9 ++++--- .../queries/relation_page_links_query_spec.rb | 25 +++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb index bbc4f394334..38f4e54c6c3 100644 --- a/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb +++ b/modules/wikis/spec/components/wikis/relation_page_links_component_spec.rb @@ -37,7 +37,7 @@ RSpec.describe Wikis::RelationPageLinksComponent, type: :component do let(:provider) { create(:xwiki_provider) } let(:oauth_client) { create(:oauth_client, integration: provider) } - let(:page_link_service) { instance_double(Wikis::PageLinkService, relation_page_link_infos_for: []) } + let(:page_link_service) { instance_double(Wikis::PageLinkService, relation_page_links_for: []) } subject(:render_component) { render_inline(described_class.new(provider, work_package:)) } @@ -87,6 +87,7 @@ RSpec.describe Wikis::RelationPageLinksComponent, type: :component do end context "when the user has a token and there are page links" do + let(:page_link) { create(:relation_wiki_page_link, provider:, linkable: work_package) } let(:page_info) do Wikis::Adapters::Results::PageInfo.new( identifier: "MyPage", @@ -95,11 +96,13 @@ RSpec.describe Wikis::RelationPageLinksComponent, type: :component do provider: ) end + let(:page_link_aggregate) do + Wikis::Adapters::Results::PageLinkAggregate.new(page_link:, page_info_result: Dry::Monads::Success(page_info)) + end before do allow(provider).to receive(:user_connected?).and_return(true) - allow(page_link_service).to receive(:relation_page_link_infos_for) - .and_return([Dry::Monads::Success(page_info)]) + allow(page_link_service).to receive(:relation_page_links_for).and_return([page_link_aggregate]) render_component end diff --git a/modules/wikis/spec/services/wikis/adapters/providers/internal/queries/relation_page_links_query_spec.rb b/modules/wikis/spec/services/wikis/adapters/providers/internal/queries/relation_page_links_query_spec.rb index 2127c5ac8b0..694f9763867 100644 --- a/modules/wikis/spec/services/wikis/adapters/providers/internal/queries/relation_page_links_query_spec.rb +++ b/modules/wikis/spec/services/wikis/adapters/providers/internal/queries/relation_page_links_query_spec.rb @@ -59,15 +59,18 @@ RSpec.describe Wikis::Adapters::Providers::Internal::Queries::RelationPageLinks it { is_expected.to be_success } - it "returns the page info results of the wiki pages" do + it "returns aggregates with the page info results of the wiki pages and the page links" do result = subject.value! expect(result.size).to eq(2) - expect(result[0]).to be_success - expect(result[0].value!.title).to eq(wiki_page.title) - expect(result[0].value!.href).to eq("/projects/#{project.identifier}/wiki/#{wiki_page.slug}") + expect(result[0]).to be_a(Wikis::Adapters::Results::PageLinkAggregate) + expect(result[0].page_info_result.value!.title).to eq(wiki_page.title) + expect(result[0].page_info_result.value!.href).to eq("/projects/#{project.identifier}/wiki/#{wiki_page.slug}") + expect(result[0].page_link).to eq(link_to_existing_page) - expect(result[1]).to be_failure - expect(result[1].failure.code).to eq(:not_found) + expect(result[1]).to be_a(Wikis::Adapters::Results::PageLinkAggregate) + expect(result[1].page_info_result).to be_failure + expect(result[1].page_info_result.failure.code).to eq(:not_found) + expect(result[1].page_link).to eq(link_to_non_existing_page) end context "when user can't see wiki pages" do @@ -77,10 +80,12 @@ RSpec.describe Wikis::Adapters::Providers::Internal::Queries::RelationPageLinks result = subject.value! expect(result.size).to eq(2) - expect(result[0]).to be_failure - expect(result[0].failure.code).to eq(:not_found) - expect(result[1]).to be_failure - expect(result[1].failure.code).to eq(:not_found) + expect(result[0].page_info_result).to be_failure + expect(result[0].page_info_result.failure.code).to eq(:not_found) + expect(result[0].page_link).to eq(link_to_existing_page) + expect(result[1].page_info_result).to be_failure + expect(result[1].page_info_result.failure.code).to eq(:not_found) + expect(result[1].page_link).to eq(link_to_non_existing_page) end end end From d6f9ce457eb188d7a38661bfa82c06aaa3d58c33 Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Thu, 21 May 2026 13:26:49 +0300 Subject: [PATCH 027/381] Revert "Bug/74773 closed work packages are still considered to be part of the bucket" --- .../work_package_card_menu_component.rb | 41 +++---- .../backlogs/work_packages_controller.rb | 7 +- .../scopes/with_backlogs_neighbours.rb | 49 -------- .../patches/permitted_params_patch.rb | 3 +- .../backlogs/patches/project_patch.rb | 2 + .../backlogs/patches/work_package_patch.rb | 3 +- .../work_package_card_menu_component_spec.rb | 109 +++++++----------- .../scopes/with_backlogs_neighbours_spec.rb | 99 ---------------- 8 files changed, 61 insertions(+), 252 deletions(-) delete mode 100644 modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb delete mode 100644 modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb diff --git a/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb b/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb index a312e3dedd1..eb1c05a6cb2 100644 --- a/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb +++ b/modules/backlogs/app/components/backlogs/work_package_card_menu_component.rb @@ -35,13 +35,14 @@ module Backlogs include OpPrimer::ComponentHelpers include CommonHelper - attr_reader :work_package, :project, :open_sprints_exist, :current_user + attr_reader :work_package, :project, :max_position, :current_user, :open_sprints_exist - def initialize(work_package:, project:, open_sprints_exist:, current_user: User.current) + def initialize(work_package:, project:, max_position:, open_sprints_exist:, current_user: User.current) super() @work_package = work_package @project = project + @max_position = max_position @open_sprints_exist = open_sprints_exist @current_user = current_user end @@ -71,49 +72,33 @@ module Backlogs def build_move_menu(menu) unless first_item? - build_move_item(menu, label: :label_sort_highest, direction: "highest", icon: :"move-to-top") - build_move_item(menu, label: :label_sort_higher, prev_id: work_package.prev_prev_id, icon: :"chevron-up") + build_move_item(menu, label: I18n.t(:label_sort_highest), direction: "highest", icon: :"move-to-top") + build_move_item(menu, label: I18n.t(:label_sort_higher), direction: "higher", icon: :"chevron-up") end unless last_item? - build_move_item(menu, label: :label_sort_lower, prev_id: work_package.next_id, icon: :"chevron-down") - build_move_item(menu, label: :label_sort_lowest, direction: "lowest", icon: :"move-to-bottom") + build_move_item(menu, label: I18n.t(:label_sort_lower), direction: "lower", icon: :"chevron-down") + build_move_item(menu, label: I18n.t(:label_sort_lowest), direction: "lowest", icon: :"move-to-bottom") end end - def build_move_item(menu, label:, icon:, direction: nil, prev_id: nil) - inputs = if direction - [{ name: "direction", value: direction }] - else - [{ name: "target_id", value: move_target_id }, { name: "prev_id", value: prev_id }] - end - + def build_move_item(menu, label:, direction:, icon:) menu.with_item( - id: dom_target(work_package, :menu, label), - label: I18n.t(label), + id: dom_target(work_package, :menu, direction), + label:, tag: :button, href: move_project_backlogs_work_package_path(project, work_package, all_backlogs_params), - form_arguments: { method: :put, inputs: } + form_arguments: { method: :put, inputs: [{ name: "direction", value: direction }] } ) do |item| item.with_leading_visual_icon(icon:) end end def first_item? - work_package.prev_id.nil? + work_package.position == 1 end def last_item? - work_package.next_id.nil? - end - - def move_target_id - @move_target_id ||= if work_package.backlog_bucket_id? - "backlog_bucket:#{work_package.backlog_bucket_id}" - elsif work_package.sprint_id? - "sprint:#{work_package.sprint_id}" - else - "inbox" - end + work_package.position == max_position end end end diff --git a/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb b/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb index e8bfdc6c632..d571d78b14c 100644 --- a/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb +++ b/modules/backlogs/app/controllers/backlogs/work_packages_controller.rb @@ -36,7 +36,7 @@ module Backlogs # Deferred ActionMenu items (Primer include-fragment). def menu - work_package = displayed_work_packages.with_backlogs_neighbours.find(@work_package.id) + max_position = displayed_work_packages.maximum(:position) || 0 open_sprints_exist = Sprint.for_project(@project) .visible @@ -45,8 +45,9 @@ module Backlogs .exists? render(Backlogs::WorkPackageCardMenuComponent.new( + work_package: @work_package, project: @project, - work_package:, + max_position:, open_sprints_exist:, current_user: ), @@ -111,7 +112,7 @@ module Backlogs end def load_work_package - @work_packages = WorkPackage.visible.where(project: @project).order_by_position + @work_packages = WorkPackage.visible.where(project: @project) @work_package = @work_packages.find(params.expect(:id)) end diff --git a/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb b/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb deleted file mode 100644 index 5dd505406d2..00000000000 --- a/modules/backlogs/app/models/work_packages/scopes/with_backlogs_neighbours.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# -- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -# ++ - -module WorkPackages::Scopes::WithBacklogsNeighbours - extend ActiveSupport::Concern - - class_methods do - def with_backlogs_neighbours - # The subquery is required because window functions run before WHERE clauses. - # Chaining .find(id) directly would filter rows first, leaving the window function - # with a single row and returning nil for all neighbours. Wrapping in a subquery - # lets the window function see the full scope, then the outer query filters to the - # requested record. - subquery = order_by_position.select( - "*, LAG(id) OVER (ORDER BY position) AS prev_id, - LAG(id, 2) OVER (ORDER BY position) AS prev_prev_id, - LEAD(id) OVER (ORDER BY position) AS next_id" - ) - WorkPackage.from(subquery, :work_packages) - end - end -end diff --git a/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb index f6f0dd8a7d3..ac4c649ebbb 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/permitted_params_patch.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -44,3 +42,4 @@ module OpenProject::Backlogs::Patches::PermittedParamsPatch end end end +PermittedParams.include OpenProject::Backlogs::Patches::PermittedParamsPatch diff --git a/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb index 57a6684d711..a79313cd75c 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/project_patch.rb @@ -45,3 +45,5 @@ module OpenProject::Backlogs::Patches::ProjectPatch module_enabled? "backlogs" end end + +Project.include OpenProject::Backlogs::Patches::ProjectPatch diff --git a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb index ffa558e7cd8..a8ea7cdec22 100644 --- a/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb +++ b/modules/backlogs/lib/open_project/backlogs/patches/work_package_patch.rb @@ -49,7 +49,6 @@ module OpenProject::Backlogs::Patches::WorkPackagePatch include OpenProject::Backlogs::List scopes :backlogs_inbox_for - scopes :with_backlogs_neighbours scopes :without_status_considered_closed scopes :without_excluded_type end @@ -66,3 +65,5 @@ module OpenProject::Backlogs::Patches::WorkPackagePatch end end end + +WorkPackage.include OpenProject::Backlogs::Patches::WorkPackagePatch diff --git a/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb b/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb index ab246d09763..c9d5bf6fce9 100644 --- a/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb +++ b/modules/backlogs/spec/components/backlogs/work_package_card_menu_component_spec.rb @@ -40,36 +40,27 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do let(:project) { create(:project, types: [type_feature, type_task]) } let(:sprint) { create(:sprint, project:, name: "Sprint 1", start_date: Date.yesterday, finish_date: Date.tomorrow) } - let!(:first_story) { create_story(position: 1) } - let!(:second_story) { create_story(position: 2) } - let!(:third_story) { create_story(position: 3) } - let!(:fourth_story) { create_story(position: 4) } - let(:displayed_work_packages) { WorkPackage.where(sprint:).order_by_position } - let(:work_package) { enrich_with_neighbours(second_story) } - - def enrich_with_neighbours(work_package, scope: displayed_work_packages) - scope.with_backlogs_neighbours.find(work_package.id) - end - - def create_story(position:, subject: "Test Story", story_points: 5) + let(:position) { 2 } + let(:max_position) { 3 } + let(:work_package) do create(:work_package, - subject:, + subject: "Test Story", project:, type: type_feature, status: default_status, priority: default_priority, - story_points:, + story_points: 5, position:, sprint:) end - def render_component(work_package: self.work_package, open_sprints_exist: true) - render_inline(described_class.new( - work_package:, - project:, - open_sprints_exist:, - current_user: user - )) + def render_component(position: 2, max_position: 3, open_sprints_exist: true) + work_package.update!(position:) + render_inline(described_class.new(work_package:, + project:, + max_position:, + open_sprints_exist:, + current_user: user)) end describe "standard items" do @@ -213,80 +204,55 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do expect(page).to have_text(I18n.t(:label_sort_lowest)) expect(page).to have_octicon(:"move-to-bottom") end + end - context "when item is first" do - let(:work_package) { enrich_with_neighbours(first_story) } - + describe "position logic" do + context "when item is first (position=1)" do it "hides Move to top and Move up" do - render_component + render_component(position: 1, max_position: 3) expect(page).to have_no_text(I18n.t(:label_sort_highest)) expect(page).to have_no_text(I18n.t(:label_sort_higher)) end - it "shows Move down and Move to bottom, sending next_id as prev_id" do - render_component + it "shows Move down and Move to bottom" do + render_component(position: 1, max_position: 3) expect(page).to have_text(I18n.t(:label_sort_lower)) expect(page).to have_text(I18n.t(:label_sort_lowest)) - expect(page).to have_field("prev_id", type: :hidden, count: 1) - expect(page).to have_field("prev_id", type: :hidden, with: second_story.id.to_s) end end - context "when item is in the middle with one predecessor" do - it "shows all move options, sending nil prev_id for Move up and next_id as prev_id for Move down" do - render_component - - expect(page).to have_text(I18n.t(:label_sort_highest)) - expect(page).to have_text(I18n.t(:label_sort_higher)) - expect(page).to have_text(I18n.t(:label_sort_lower)) - expect(page).to have_text(I18n.t(:label_sort_lowest)) - expect(page).to have_field("prev_id", type: :hidden, count: 2) - expect(page).to have_field("prev_id", type: :hidden, with: third_story.id.to_s) - end - end - - context "when item is in the middle with two predecessors" do - let(:work_package) { enrich_with_neighbours(third_story) } - - it "shows all move options, sending prev_prev_id and next_id as prev_id" do - render_component - - expect(page).to have_text(I18n.t(:label_sort_highest)) - expect(page).to have_text(I18n.t(:label_sort_higher)) - expect(page).to have_text(I18n.t(:label_sort_lower)) - expect(page).to have_text(I18n.t(:label_sort_lowest)) - expect(page).to have_field("prev_id", type: :hidden, with: first_story.id.to_s) - expect(page).to have_field("prev_id", type: :hidden, with: fourth_story.id.to_s) - end - end - - context "when item is last" do - let(:work_package) { enrich_with_neighbours(fourth_story) } - + context "when item is last (position=max)" do it "hides Move down and Move to bottom" do - render_component + render_component(position: 3, max_position: 3) expect(page).to have_no_text(I18n.t(:label_sort_lower)) expect(page).to have_no_text(I18n.t(:label_sort_lowest)) end - it "shows Move to top and Move up, sending prev_prev_id as prev_id" do - render_component + it "shows Move to top and Move up" do + render_component(position: 3, max_position: 3) expect(page).to have_text(I18n.t(:label_sort_highest)) expect(page).to have_text(I18n.t(:label_sort_higher)) - expect(page).to have_field("prev_id", type: :hidden, count: 1) - expect(page).to have_field("prev_id", type: :hidden, with: second_story.id.to_s) end end - context "when there is only one item" do - let(:displayed_work_packages) { WorkPackage.where(id: second_story.id).order_by_position } + context "when item is in the middle" do + it "shows all move options" do + render_component(position: 2, max_position: 3) + expect(page).to have_text(I18n.t(:label_sort_highest)) + expect(page).to have_text(I18n.t(:label_sort_higher)) + expect(page).to have_text(I18n.t(:label_sort_lower)) + expect(page).to have_text(I18n.t(:label_sort_lowest)) + end + end + + context "when there is only one item (position=1, max=1)" do it "hides all move options" do - render_component + render_component(position: 1, max_position: 1) expect(page).to have_no_text(I18n.t(:label_sort_highest)) expect(page).to have_no_text(I18n.t(:label_sort_higher)) @@ -295,9 +261,12 @@ RSpec.describe Backlogs::WorkPackageCardMenuComponent, type: :component do end it "hides the Move submenu when no other open sprints exist" do - render_component(open_sprints_exist: false) + render_component(position: 1, max_position: 1, open_sprints_exist: false) - expect(page).to have_no_selector(:menuitem, text: "Move") + expect(page).to have_no_selector( + :menuitem, + text: "Move" + ) end end end diff --git a/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb b/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb deleted file mode 100644 index 1f4b5c776e1..00000000000 --- a/modules/backlogs/spec/models/work_packages/scopes/with_backlogs_neighbours_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# -- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -# ++ - -require "spec_helper" - -RSpec.describe WorkPackages::Scopes::WithBacklogsNeighbours do - let(:project) { create(:project) } - let(:open_status) { create(:status, is_closed: false) } - let(:closed_status) { create(:status, is_closed: true) } - - def neighbours(work_package, scope: WorkPackage.where(project:).order_by_position) - scope.with_backlogs_neighbours.find(work_package.id) - end - - describe ".with_backlogs_neighbours" do - context "with four items" do - # Created in scrambled order so id sequence is not the same as the position - let!(:wp1) { create(:work_package, project:, status: open_status, position: 1) } - let!(:wp4) { create(:work_package, project:, status: open_status, position: 4) } - let!(:wp2) { create(:work_package, project:, status: open_status, position: 2) } - let!(:wp3) { create(:work_package, project:, status: open_status, position: 3) } - - context "for the first item" do - subject { neighbours(wp1) } - - it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: nil, next_id: wp2.id) } - end - - context "for the second item" do - subject { neighbours(wp2) } - - it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: wp1.id, next_id: wp3.id) } - end - - context "for a middle item with two predecessors" do - subject { neighbours(wp3) } - - it { is_expected.to have_attributes(prev_prev_id: wp1.id, prev_id: wp2.id, next_id: wp4.id) } - end - - context "for the last item" do - subject { neighbours(wp4) } - - it { is_expected.to have_attributes(prev_prev_id: wp2.id, prev_id: wp3.id, next_id: nil) } - end - end - - context "when the scope excludes closed work packages" do - let(:project) { create(:project) } - let!(:first_open) { create(:work_package, project:, status: open_status, position: 1) } - let!(:closed_wp) { create(:work_package, project:, status: closed_status, position: 2) } - let!(:last_open) { create(:work_package, project:, status: open_status, position: 3) } - - subject { neighbours(last_open, scope: WorkPackage.where(project:, status: open_status).order_by_position) } - - it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: first_open.id, next_id: nil) } - end - - context "when the scope excludes work packages of an excluded type" do - let(:project) { create(:project) } - let(:included_type) { create(:type_feature) } - let(:excluded_type) { create(:type_task) } - let!(:first_included) { create(:work_package, project:, status: open_status, type: included_type, position: 1) } - let!(:excluded_wp) { create(:work_package, project:, status: open_status, type: excluded_type, position: 2) } - let!(:last_included) { create(:work_package, project:, status: open_status, type: included_type, position: 3) } - - subject { neighbours(last_included, scope: WorkPackage.where(project:, type: included_type).order_by_position) } - - it { is_expected.to have_attributes(prev_prev_id: nil, prev_id: first_included.id, next_id: nil) } - end - end -end From d3547a1ff02fb80a76c9d6c546ad04c9393a6118 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 18 May 2026 17:25:14 +0200 Subject: [PATCH 028/381] [#75029] Document Border Box List in Lookbook Updates Border Box references to point to higher-level Border Box List component. Also removes old Border Box examples. https://community.openproject.org/wp/75029 --- .../docs/components/border-box-list.md.erb | 173 ++++++++++++++++++ lookbook/docs/components/border-box.md.erb | 56 ------ lookbook/docs/components/inset-box.md.erb | 6 +- .../components/tables/border-box-table.md.erb | 3 +- .../op_primer/border_box_component_preview.rb | 50 ----- .../collapsible.html.erb | 64 ------- .../border_box_list_component_preview.rb | 1 + 7 files changed, 180 insertions(+), 173 deletions(-) create mode 100644 lookbook/docs/components/border-box-list.md.erb delete mode 100644 lookbook/docs/components/border-box.md.erb delete mode 100644 lookbook/previews/op_primer/border_box_component_preview.rb delete mode 100644 lookbook/previews/op_primer/border_box_component_preview/collapsible.html.erb diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb new file mode 100644 index 00000000000..711799100c9 --- /dev/null +++ b/lookbook/docs/components/border-box-list.md.erb @@ -0,0 +1,173 @@ +The Border Box List component displays compact, structured list items with +optional section headers, item actions, empty states, and a footer. + +## Overview + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :default %> + +## Anatomy + +The list is structured in up to four parts: + +**Header** *(optional)* +Names the list section. It can show a count, description, action buttons, an +action menu, and an optional collapse toggle. In static headers, the description +renders below the heading line. In collapsible headers, the description is part +of the collapsible header and is hidden when the list is collapsed. + +**Items** +The list rows. Items can render generic row content or a work package card. + +**Empty state** *(optional)* +Shown when the list has no items. + +**Footer** *(optional)* +Shown below the items. Use it for summary or follow-up content. + +If a page shows multiple Border Box Lists and one list has a header, all +comparable lists should use headers. + +## Parameters + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `container` | `String`, `Symbol`, `Class`, `Object` | required | Seed used to derive stable DOM ids for the list, header, and footer | +| `scheme` | `Symbol` | `:default` | Visual scheme. Use `:transparent` for list containers that should blend into their surrounding surface | +| `padding` | `Symbol` | `:default` | Row padding forwarded to the underlying `Primer::Beta::BorderBox`. Supports Primer BorderBox padding values such as `:condensed`, `:default`, and `:spacious` | +| `header_padding` | `Symbol` | `:inherit` | Header-only vertical padding override. Supports `:inherit`, `:condensed`, `:default`, and `:spacious` | +| `interactive` | `Boolean` | `false` | Announces counter and configured empty-state updates politely to assistive technologies | +| `collapsible` | `Boolean` | `false` | Renders the header as a collapsible toggle when a header is present | +| `current_user` | `User` | `User.current` | User context forwarded to work package item rows | +| `system_arguments` | `Hash` | `{}` | Forwarded to the underlying `Primer::Beta::BorderBox` | + +## Slots + +| Slot | Description | +|---|---| +| `with_header` | Optional section header with title, count, description, action buttons, and menu. Pass `title_arguments:` to customize the heading | +| `with_item` | Generic list row that renders the provided block content | +| `with_work_package_item` | Work package row that renders a work package card | +| `with_empty_state` | Empty-state content rendered when no items are present | +| `with_footer` | Optional footer row below the list items | + +## Header + +Collapsible headers add: + +- an **arrow indicator** next to the title to show whether the section is + collapsed or expanded. +- an optional **header description** that gives more context to the section and + is hidden when the list is collapsed. +- an optional **counter** that displays the number of items in the section. + +When collapsed, the bottom border is slightly thicker to indicate that content +is hidden. + +Both static and collapsible headers can include additional actions. For example, +a menu button can offer contextual actions such as edit, delete, move up, or +move down. + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :default, params: { collapsible: true } %> + +## Variants + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :playground, panels: %i[params source] %> + +### Transparent scheme + +Use the transparent scheme for list containers that should not render a visible +header background or separator, such as Backlogs sprint and inbox containers. + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :transparent, panels: %i[params source] %> + +### Work package items + +Use `with_work_package_item` for rows that should render a work package card. +It renders `OpenProject::Common::WorkPackageCardComponent` by default. See the +[Work Package Card documentation](/lookbook/pages/components/work_packages/card) +for card-specific layout, parameters, and slots. + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :with_work_package_items, panels: %i[source] %> + +### Empty state + +Use `with_empty_state` when the list can be rendered without items. + +<%= embed OpenProject::Common::BorderBoxListComponentPreview, :empty_state, panels: %i[source] %> + +## Uses + +Use the Border Box List for compact item collections such as: + +- meeting agenda items. +- project attributes in project settings. +- configured OAuth applications. +- work package lists with card-style rows. + +If the content needs table structure with columns and column headers, use the +[Border Box Table](./tables/border_box_table) component instead. + +## Best practices + +**Do** + +- Use section headers when the items have logical categories, such as open and + planned meetings. +- Use the built-in header actions and item menus instead of composing raw + BorderBox rows by hand. +- Make headers and items draggable when users need to reorder sections or move + items between sections. + +**Don't** + +- Don't mix sections with and without headers. If one section has a header, they must all have headers. +- Don't make sections collapsible when users benefit from seeing all content at + once. +- Don't use the Border Box List for data that needs column alignment, sorting, + or column headers. + +## Technical notes + +Use `OpenProject::Common::BorderBoxListComponent` instead of composing +`Primer::Beta::BorderBox` directly when rendering OpenProject lists. +Header descriptions are wrapped in `Primer::Beta::Text` with muted text color by +default, and can receive Primer system arguments through `with_description`. + +## Code structure + +```ruby +render OpenProject::Common::BorderBoxListComponent.new( + container: "project-attributes", + scheme: :transparent, + header_padding: :default, + padding: :condensed, + collapsible: true +) do |list| + list.with_header( + title: "Project attributes", + title_arguments: { aria: { describedby: "project-attributes-description" } }, + count: true + ) do |header| + header.with_description(id: "project-attributes-description", font_size: :small) do + "Visible in the project overview" + end + header.with_menu(button_aria_label: "Project attribute actions") do |menu| + menu.with_item(label: "Edit", href: edit_project_path(@project)) + end + end + + @project_attributes.each do |attribute| + list.with_item { attribute.name } + end + + list.with_empty_state( + title: "No attributes yet", + description: "Add attributes to describe this project." + ) + + list.with_footer { "Last updated: #{format_date(@project.updated_at)}" } +end +``` + +For lower-level details, see the [Primer BorderBox preview examples](/lookbook/inspect/primer/beta/border_box/playground) +or the [collapsible header preview examples](/lookbook/inspect/primer/open_project/border_box/collapsible_header/playground). diff --git a/lookbook/docs/components/border-box.md.erb b/lookbook/docs/components/border-box.md.erb deleted file mode 100644 index 6cbd9852c16..00000000000 --- a/lookbook/docs/components/border-box.md.erb +++ /dev/null @@ -1,56 +0,0 @@ -The Border Box element is used to display structured items in a list, each with a set of actions. - -<%= embed OpPrimer::BorderBoxComponentPreview, :default %> - -## Anatomy - -The Border Box element is made up of - -1. The **header**, which acts as a container for the items below and helps distinguish between sections. It is optional. -2. Individual **items** below can vary in what information they show. - -If a page uses a Border Box with a header, all sections must use headers. - -## Header - -The header can either be static or collapsible. - -The CollapsibleHeader brings additional functionality: - -- an **arrow indicator** next to the title indicates if the section is collapsed or expanded. -- a **header description** (optional) to give additional context to the content of that section. Hidden when collapsed. -- a **counter** (optional) displays the number of items that that particular section contains. - -When collapsed, the bottom border is slightly thicker to indicate something is hidden. - -Both the collapsible and static headers can accept additional actions. For example, a **more button** can offer additional contextual actions such as edit, delete and move (move up, move to top, move down, move to the end). - -<%= embed OpPrimer::BorderBoxComponentPreview, :collapsible %> - -## Uses - -Some places in which we already use the Border Box: - -- to display individual meeting agenda items in a meeting -- to display the a list of project attributes in Project settings -- to display a list of configured OAuth applications - -If the content needs to be more structured (with columns and column headers), please use the [Border Box Table](./tables/border_box_table) component instead. - -## Best practices - -**Do** - -- Use sections (with headers) to better organise content if they have logical categories (eg. Open and Planned meetings). -- Do make the header and items draggable if the user should be able to drag individual items up and down and into other sections. The sections themselves can also be dragged up and down to change order. - -**Don't** - -- Don't mix sections with and without headers. If one section has a header, they must all have headers. -- Don't make sections collapsible if they do not need to be. - -## Technical notes - -<%= embed OpPrimer::BorderBoxComponentPreview, :collapsible, panels: %i[source] %> - -For detailed examples have a look at the other [border box preview examples](/lookbook/inspect/primer/beta/border_box/playground) or the [collapsible header preview examples](/lookbook/inspect/primer/open_project/border_box/collapsible_header/playground). diff --git a/lookbook/docs/components/inset-box.md.erb b/lookbook/docs/components/inset-box.md.erb index b78f65b95d6..a359b7b7469 100644 --- a/lookbook/docs/components/inset-box.md.erb +++ b/lookbook/docs/components/inset-box.md.erb @@ -38,7 +38,8 @@ Some places where we already use the Inset Box: It is useful whenever content should stand out from the page background while staying lightweight. -If content needs more structure (e.g., with headers, actions, or multiple items), consider using the Border Box component instead. +If content needs more structure, such as headers, actions, or multiple items, +consider using the Border Box List component instead. ## Best practices @@ -51,7 +52,8 @@ If content needs more structure (e.g., with headers, actions, or multiple items) - Don’t apply arbitrary custom background colors in CSS — use the component’s options. - Don’t duplicate "grey box" styles manually; always use the Inset Box. -- Don’t use Inset Box if a more structured component (like Border Box) is better suited. +- Don’t use Inset Box if a more structured component, such as Border Box List, + is better suited. ## Technical notes diff --git a/lookbook/docs/components/tables/border-box-table.md.erb b/lookbook/docs/components/tables/border-box-table.md.erb index 43bf49740bd..a45846deec8 100644 --- a/lookbook/docs/components/tables/border-box-table.md.erb +++ b/lookbook/docs/components/tables/border-box-table.md.erb @@ -31,7 +31,8 @@ Some examples of where we already use the Border Box table: - to display a list of configured OpenID providers - to display a list of configured SCIM clients -If the content does not need a table structure with column headers and grids, please use the simpler [Border Box](../border_box) component instead. +If the content does not need a table structure with column headers and grids, +please use the simpler [Border Box List](../border_box_list) component instead. ## Technical notes diff --git a/lookbook/previews/op_primer/border_box_component_preview.rb b/lookbook/previews/op_primer/border_box_component_preview.rb deleted file mode 100644 index 66aea786f70..00000000000 --- a/lookbook/previews/op_primer/border_box_component_preview.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -#-- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -#++ - -module OpPrimer - # @hidden - # @display min_height 400px - class BorderBoxComponentPreview < Lookbook::Preview - def default - render(Primer::Beta::BorderBox.new) do |component| - component.with_header { "Header" } - component.with_body { "Body" } - component.with_row { "Row one" } - component.with_row { "Row two" } - component.with_row { "Row three" } - component.with_footer { "Footer" } - end - end - - def collapsible - render_with_template - end - end -end diff --git a/lookbook/previews/op_primer/border_box_component_preview/collapsible.html.erb b/lookbook/previews/op_primer/border_box_component_preview/collapsible.html.erb deleted file mode 100644 index 6ce78e50a6d..00000000000 --- a/lookbook/previews/op_primer/border_box_component_preview/collapsible.html.erb +++ /dev/null @@ -1,64 +0,0 @@ -<%= render(Primer::Beta::BorderBox.new(list_id: "border-box-list")) do |component| %> - <% component.with_header do %> - <%= render(Primer::OpenProject::FlexLayout.new(align_items: :flex_start)) do |flex| %> - <%= flex.with_column(flex: 1, pt: 1) do %> - <%= render(Primer::OpenProject::BorderBox::CollapsibleHeader.new(collapsible_id: "border-box-list")) do |header| - header.with_count(count: 3) - header.with_title { "Collapsible title" } - header.with_description { "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor" } - end %> - <% end %> - <%= flex.with_column do %> - <%= render(Primer::Alpha::ActionMenu.new) do |menu| - menu.with_show_button(icon: "kebab-horizontal", scheme: :invisible, "aria-label": "Header actions") - menu.with_item( - tag: :a, - label: "Edit", - href: "#" - ) do |item| - item.with_leading_visual_icon(icon: :pencil) - "foo" - end - end %> - <% end %> - <% end %> - <% end %> - <% component.with_body { "Body" } %> - <% component.with_row do %> - <%= render(Primer::OpenProject::FlexLayout.new(justify_content: :space_between, align_items: :center)) do |flex| %> - <%= flex.with_column { "Row 1" } %> - <%= flex.with_column do %> - <%= render(Primer::Alpha::ActionMenu.new) do |menu| - menu.with_show_button(icon: "kebab-horizontal", "aria-label": "More", scheme: :invisible) - menu.with_item( - tag: :a, - label: "Edit", - href: "#" - ) do |item| - item.with_leading_visual_icon(icon: :pencil) - "foo" - end - end %> - <% end %> - <% end %> - <% end %> - <% component.with_row do %> - <%= render(Primer::OpenProject::FlexLayout.new(justify_content: :space_between, align_items: :center)) do |flex| %> - <%= flex.with_column { "Row 2" } %> - <%= flex.with_column do %> - <%= render(Primer::Alpha::ActionMenu.new) do |menu| - menu.with_show_button(icon: "kebab-horizontal", "aria-label": "More", scheme: :invisible) - menu.with_item( - tag: :a, - label: "Edit", - href: "#" - ) do |item| - item.with_leading_visual_icon(icon: :pencil) - "foo" - end - end %> - <% end %> - <% end %> - <% end %> - <% component.with_footer { "Footer" } %> -<% end %> diff --git a/lookbook/previews/open_project/common/border_box_list_component_preview.rb b/lookbook/previews/open_project/common/border_box_list_component_preview.rb index a8cdee75ff4..ee60452bc9b 100644 --- a/lookbook/previews/open_project/common/border_box_list_component_preview.rb +++ b/lookbook/previews/open_project/common/border_box_list_component_preview.rb @@ -31,6 +31,7 @@ module OpenProject module Common # @logical_path OpenProject/Common + # @display min_height 400px class BorderBoxListComponentPreview < ViewComponent::Preview DEFAULT_DESCRIPTION = "Coordinate launch work and keep stakeholders aligned." TRANSPARENT_DESCRIPTION = "Sprint goals, scope, and timing for the next iteration." From 5642c2998689c9ae547022c5e4115e0f15e720fe Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Wed, 20 May 2026 20:19:28 +0200 Subject: [PATCH 029/381] [#75029] Document header parameters and slots Surfaces the keywords accepted by `with_header` and its sub-slots (`with_description`, `with_action_button`, `with_menu`) in dedicated tables so readers do not need to inspect the component source. https://community.openproject.org/wp/75029 --- .../docs/components/border-box-list.md.erb | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index 711799100c9..f0bf434534f 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -44,7 +44,7 @@ comparable lists should use headers. | Slot | Description | |---|---| -| `with_header` | Optional section header with title, count, description, action buttons, and menu. Pass `title_arguments:` to customize the heading | +| `with_header` | Optional section header. See [Header parameters](#header-parameters) and [Header slots](#header-slots) below | | `with_item` | Generic list row that renders the provided block content | | `with_work_package_item` | Work package row that renders a work package card | | `with_empty_state` | Empty-state content rendered when no items are present | @@ -52,6 +52,27 @@ comparable lists should use headers. ## Header +### Header parameters + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `title` | `String` | required | Header title | +| `title_tag` | `Symbol` | `:h4` | HTML tag for the title heading | +| `title_arguments` | `Hash` | `{}` | Forwarded to the title heading element | +| `count` | `Integer`, `Boolean`, `nil` | `nil` | Pass `true` to infer the rendered item count, an integer for an explicit value, or `nil`/`false` to hide it | +| `count_arguments` | `Hash` | `{}` | Forwarded to `Primer::Beta::Counter`. Merged over defaults (`scheme: :primary`, `hide_if_zero: true`) | +| `collapsed` | `Boolean` | `false` | Whether a collapsible header starts closed | + +### Header slots + +| Slot | Description | +|---|---| +| `with_description` | Secondary content below the title, wrapped in `Primer::Beta::Text` with muted color by default. Accepts Primer system arguments | +| `with_action_button` | Button rendered in the header actions area | +| `with_menu` | Action menu rendered in the header actions area. Pass `button_aria_label:` for the trigger button | + +### Collapsible headers + Collapsible headers add: - an **arrow indicator** next to the title to show whether the section is From 986dc16e7736c81403aa37dd681fd97f2710a9ff Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Wed, 20 May 2026 20:19:57 +0200 Subject: [PATCH 030/381] Simplify code structure example Drops the `title_arguments:` forward-reference to an `id` defined later in the block. The `aria-describedby` wiring is an advanced pattern that cluttered an introductory example. --- lookbook/docs/components/border-box-list.md.erb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index f0bf434534f..d4f079b3dd3 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -164,11 +164,7 @@ render OpenProject::Common::BorderBoxListComponent.new( padding: :condensed, collapsible: true ) do |list| - list.with_header( - title: "Project attributes", - title_arguments: { aria: { describedby: "project-attributes-description" } }, - count: true - ) do |header| + list.with_header(title: "Project attributes", count: true) do |header| header.with_description(id: "project-attributes-description", font_size: :small) do "Visible in the project overview" end From ff22ca77b92f3b20ea94ceddbbea511491a32156 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Wed, 20 May 2026 20:20:14 +0200 Subject: [PATCH 031/381] Note Blankslate in empty state docs, show 3 WPs Mentions that `with_empty_state` renders a `Primer::Beta::Blankslate` and accepts `title:`, `description:`, and `icon:` keywords. Bumps the work-package preview from 2 to 3 items for visual consistency with the other preview scenarios. --- lookbook/docs/components/border-box-list.md.erb | 4 +++- .../open_project/common/border_box_list_component_preview.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index d4f079b3dd3..024cb0641af 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -112,7 +112,9 @@ for card-specific layout, parameters, and slots. ### Empty state -Use `with_empty_state` when the list can be rendered without items. +Use `with_empty_state` when the list can be rendered without items. It renders a +`Primer::Beta::Blankslate` under the hood, accepting `title:`, `description:`, +and `icon:` keywords. <%= embed OpenProject::Common::BorderBoxListComponentPreview, :empty_state, panels: %i[source] %> diff --git a/lookbook/previews/open_project/common/border_box_list_component_preview.rb b/lookbook/previews/open_project/common/border_box_list_component_preview.rb index ee60452bc9b..0c96017149f 100644 --- a/lookbook/previews/open_project/common/border_box_list_component_preview.rb +++ b/lookbook/previews/open_project/common/border_box_list_component_preview.rb @@ -129,7 +129,7 @@ module OpenProject interactive: false, collapsible: false ) - work_packages = WorkPackage.includes(:project).limit(2).to_a + work_packages = WorkPackage.includes(:project).limit(3).to_a return preview_message("No work packages in the database.") if work_packages.empty? render OpenProject::Common::BorderBoxListComponent.new( From 86831fc4f28d0cb5ede1b40f8620b55a71f113cf Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Thu, 21 May 2026 13:14:38 +0200 Subject: [PATCH 032/381] Revert "Switch tests back to initial expectations" This reverts commit 5fabc7d687a9ae1588a1dd45d46e9b64b3e88ebb. Blindly testing whether this fixes the test failures after the last MCP update. --- spec/requests/mcp/mcp_tools/search_portfolios_spec.rb | 2 +- spec/requests/mcp/mcp_tools/search_programs_spec.rb | 2 +- spec/requests/mcp/mcp_tools/search_projects_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/requests/mcp/mcp_tools/search_portfolios_spec.rb b/spec/requests/mcp/mcp_tools/search_portfolios_spec.rb index 5dbdb0d672f..3dc32185a5e 100644 --- a/spec/requests/mcp/mcp_tools/search_portfolios_spec.rb +++ b/spec/requests/mcp/mcp_tools/search_portfolios_spec.rb @@ -179,7 +179,7 @@ RSpec.describe McpTools::SearchPortfolios do context "when passing an invalid portfolio status" do let(:call_args) { { status_code: "blubb" } } - it_behaves_like "MCP error response" + it_behaves_like "MCP tool execution error response" end context "when user can't see portfolios" do diff --git a/spec/requests/mcp/mcp_tools/search_programs_spec.rb b/spec/requests/mcp/mcp_tools/search_programs_spec.rb index 710e48843e5..6550fd1e933 100644 --- a/spec/requests/mcp/mcp_tools/search_programs_spec.rb +++ b/spec/requests/mcp/mcp_tools/search_programs_spec.rb @@ -179,7 +179,7 @@ RSpec.describe McpTools::SearchPrograms do context "when passing an invalid program status" do let(:call_args) { { status_code: "blubb" } } - it_behaves_like "MCP error response" + it_behaves_like "MCP tool execution error response" end context "when user can't see programs" do diff --git a/spec/requests/mcp/mcp_tools/search_projects_spec.rb b/spec/requests/mcp/mcp_tools/search_projects_spec.rb index cd440f65064..56a6435590a 100644 --- a/spec/requests/mcp/mcp_tools/search_projects_spec.rb +++ b/spec/requests/mcp/mcp_tools/search_projects_spec.rb @@ -178,7 +178,7 @@ RSpec.describe McpTools::SearchProjects do context "when passing an invalid project status" do let(:call_args) { { status_code: "blubb" } } - it_behaves_like "MCP error response" + it_behaves_like "MCP tool execution error response" end context "when user can't see projects" do From 8a213e2c0341a9ff3088628bc4bbcc1588ee01f7 Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Thu, 21 May 2026 15:36:39 +0300 Subject: [PATCH 033/381] Move browser-action helpers to spec/support sibling file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Park BlockNoteEditorBrowserActions next to BlockNoteEditorInput in spec/support/form_fields/primerized/. spec/support/**/*.rb is autoloaded by rails_helper, so the spec file just `include`s the qualified module name. Keeps raw-driver concerns (DOM Range selection, paste ClipboardEvent dispatch, W3C-action Delete) out of the high-level page object — that one stays focused on semantic actions like paste_links and attach_file — and avoids the test-file fatigue of a 50-line helper module inside the describe scope. --- .../external_links_in_block_note_spec.rb | 54 +--------------- .../block_note_editor_browser_actions.rb | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+), 53 deletions(-) create mode 100644 spec/support/form_fields/primerized/block_note_editor_browser_actions.rb diff --git a/modules/documents/spec/features/external_links_in_block_note_spec.rb b/modules/documents/spec/features/external_links_in_block_note_spec.rb index f496b5d30a9..215fd5c5b2a 100644 --- a/modules/documents/spec/features/external_links_in_block_note_spec.rb +++ b/modules/documents/spec/features/external_links_in_block_note_spec.rb @@ -30,64 +30,12 @@ require "rails_helper" -# Low-level browser actions for driving the BlockNote editor's contenteditable -# inside its shadow root. Capybara cannot enter the shadow root for selection, -# nor does its `send_keys` propagate Delete/Backspace into ProseMirror's -# editable in this setup, so each helper drops to the Selenium driver: either -# running JS via `execute_script` or issuing raw keystrokes via the W3C -# actions API. -module BlockNoteEditorBrowserActions - # Selects a text range inside the first external link in the editor. - # `start_offset` and `end_offset` follow String-slicing conventions: a - # non-negative integer is an absolute offset from the start of the link's - # text node; a negative integer counts back from the end; `nil` maps to the - # text length. Default arguments select the entire link text. - def select_text_in_external_link(start_offset: 0, end_offset: nil) - page.execute_script(<<~JS, start_offset, end_offset) - const root = document.querySelector('op-block-note').shadowRoot; - const a = root.querySelector('a[target="_blank"]'); - const textNode = [...a.childNodes].find((n) => n.nodeType === 3); - const len = textNode.textContent.length; - const resolve = (v) => (v == null ? len : (v < 0 ? len + v : v)); - const range = document.createRange(); - range.setStart(textNode, resolve(arguments[0])); - range.setEnd(textNode, resolve(arguments[1])); - const sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - JS - end - - # Forward Delete via the W3C actions API; pair with a selection helper. - def send_forward_delete - page.driver.browser.action.send_keys(:delete).perform - end - - # Fires a paste ClipboardEvent on the editor with both HTML and plain-text - # payloads. Exercises ProseMirror's `transformPasted` path, which behaves - # differently from typed input. - def paste_clipboard_into(editor_element, html:, plain:) - editor_element.click - page.execute_script(<<~JS, editor_element.native, html, plain) - const target = arguments[0]; - const dt = new DataTransfer(); - dt.setData('text/html', arguments[1]); - dt.setData('text/plain', arguments[2]); - target.dispatchEvent(new ClipboardEvent('paste', { - clipboardData: dt, - bubbles: true, - cancelable: true, - })); - JS - end -end - RSpec.describe "External links in BlockNote editor", :js, :selenium, with_settings: { real_time_text_collaboration_enabled: true } do include_context "with hocuspocus" - include BlockNoteEditorBrowserActions + include FormFields::Primerized::BlockNoteEditorBrowserActions let(:admin) { create(:admin) } let(:document) { create(:document, :collaborative) } diff --git a/spec/support/form_fields/primerized/block_note_editor_browser_actions.rb b/spec/support/form_fields/primerized/block_note_editor_browser_actions.rb new file mode 100644 index 00000000000..6404bfa51ed --- /dev/null +++ b/spec/support/form_fields/primerized/block_note_editor_browser_actions.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module FormFields + module Primerized + # Low-level browser actions for driving the BlockNote editor's + # contenteditable inside its shadow root. Capybara cannot enter the shadow + # root for selection, nor does its `send_keys` propagate Delete/Backspace + # into ProseMirror's editable in this setup, so each helper drops to the + # Selenium driver: either running JS via `execute_script` or issuing raw + # keystrokes via the W3C actions API. + # + # Sibling to BlockNoteEditorInput (the high-level page object): keep + # raw-driver concerns here so the page object stays focused on semantic + # actions like `paste_links` or `attach_file`. + module BlockNoteEditorBrowserActions + # Selects a text range inside the first external link in the editor. + # `start_offset` and `end_offset` follow String-slicing conventions: a + # non-negative integer is an absolute offset from the start of the + # link's text node; a negative integer counts back from the end; `nil` + # maps to the text length. Default arguments select the entire link + # text. + def select_text_in_external_link(start_offset: 0, end_offset: nil) + page.execute_script(<<~JS, start_offset, end_offset) + const root = document.querySelector('op-block-note').shadowRoot; + const a = root.querySelector('a[target="_blank"]'); + const textNode = [...a.childNodes].find((n) => n.nodeType === 3); + const len = textNode.textContent.length; + const resolve = (v) => (v == null ? len : (v < 0 ? len + v : v)); + const range = document.createRange(); + range.setStart(textNode, resolve(arguments[0])); + range.setEnd(textNode, resolve(arguments[1])); + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + JS + end + + # Forward Delete via the W3C actions API; pair with a selection helper. + def send_forward_delete + page.driver.browser.action.send_keys(:delete).perform + end + + # Fires a paste ClipboardEvent on the editor with both HTML and + # plain-text payloads. Exercises ProseMirror's `transformPasted` path, + # which behaves differently from typed input. + def paste_clipboard_into(editor_element, html:, plain:) + editor_element.click + page.execute_script(<<~JS, editor_element.native, html, plain) + const target = arguments[0]; + const dt = new DataTransfer(); + dt.setData('text/html', arguments[1]); + dt.setData('text/plain', arguments[2]); + target.dispatchEvent(new ClipboardEvent('paste', { + clipboardData: dt, + bubbles: true, + cancelable: true, + })); + JS + end + end + end +end From 87b93732706a9da5054c9f0ba1a4ba010327c7f4 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Thu, 21 May 2026 15:04:37 +0200 Subject: [PATCH 034/381] Remove link to low-level CollapsibleHeader docs --- lookbook/docs/components/border-box-list.md.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index 024cb0641af..1be2a97a23e 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -188,5 +188,4 @@ render OpenProject::Common::BorderBoxListComponent.new( end ``` -For lower-level details, see the [Primer BorderBox preview examples](/lookbook/inspect/primer/beta/border_box/playground) -or the [collapsible header preview examples](/lookbook/inspect/primer/open_project/border_box/collapsible_header/playground). +For lower-level details, see the [Primer BorderBox preview examples](/lookbook/inspect/primer/beta/border_box/playground). From 1c386ffa74f6db384f4e35614e4d9edf8ad0c71b Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Thu, 21 May 2026 15:11:10 +0200 Subject: [PATCH 035/381] Refine Border Box List docs Address follow-up review comments by using the component name, clarifying interactive ARIA behavior, and grouping usage guidance. --- lookbook/docs/components/border-box-list.md.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lookbook/docs/components/border-box-list.md.erb b/lookbook/docs/components/border-box-list.md.erb index 1be2a97a23e..c72cf4c8d23 100644 --- a/lookbook/docs/components/border-box-list.md.erb +++ b/lookbook/docs/components/border-box-list.md.erb @@ -1,4 +1,4 @@ -The Border Box List component displays compact, structured list items with +The `BorderBoxListComponent` displays compact, structured list items with optional section headers, item actions, empty states, and a footer. ## Overview @@ -35,7 +35,7 @@ comparable lists should use headers. | `scheme` | `Symbol` | `:default` | Visual scheme. Use `:transparent` for list containers that should blend into their surrounding surface | | `padding` | `Symbol` | `:default` | Row padding forwarded to the underlying `Primer::Beta::BorderBox`. Supports Primer BorderBox padding values such as `:condensed`, `:default`, and `:spacious` | | `header_padding` | `Symbol` | `:inherit` | Header-only vertical padding override. Supports `:inherit`, `:condensed`, `:default`, and `:spacious` | -| `interactive` | `Boolean` | `false` | Announces counter and configured empty-state updates politely to assistive technologies | +| `interactive` | `Boolean` | `false` | Enables polite ARIA live-region announcements for counter and configured empty-state updates | | `collapsible` | `Boolean` | `false` | Renders the header as a collapsible toggle when a header is present | | `current_user` | `User` | `User.current` | User context forwarded to work package item rows | | `system_arguments` | `Hash` | `{}` | Forwarded to the underlying `Primer::Beta::BorderBox` | @@ -118,7 +118,7 @@ and `icon:` keywords. <%= embed OpenProject::Common::BorderBoxListComponentPreview, :empty_state, panels: %i[source] %> -## Uses +## Usage guidelines Use the Border Box List for compact item collections such as: @@ -130,7 +130,7 @@ Use the Border Box List for compact item collections such as: If the content needs table structure with columns and column headers, use the [Border Box Table](./tables/border_box_table) component instead. -## Best practices +### Best practices **Do** From d63662816136bd920b8bf6f1d51f108bbb8d7129 Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Thu, 21 May 2026 14:04:07 +0000 Subject: [PATCH 036/381] update locales from crowdin [ci skip] --- config/locales/crowdin/js-hy.yml | 2 +- .../avatars/config/locales/crowdin/js-hy.yml | 18 +++++++++--------- modules/backlogs/config/locales/crowdin/af.yml | 3 --- modules/backlogs/config/locales/crowdin/ar.yml | 3 --- modules/backlogs/config/locales/crowdin/az.yml | 3 --- modules/backlogs/config/locales/crowdin/be.yml | 3 --- modules/backlogs/config/locales/crowdin/bg.yml | 3 --- modules/backlogs/config/locales/crowdin/ca.yml | 3 --- .../backlogs/config/locales/crowdin/ckb-IR.yml | 3 --- modules/backlogs/config/locales/crowdin/cs.yml | 3 --- modules/backlogs/config/locales/crowdin/da.yml | 3 --- modules/backlogs/config/locales/crowdin/de.yml | 3 --- modules/backlogs/config/locales/crowdin/el.yml | 3 --- modules/backlogs/config/locales/crowdin/eo.yml | 3 --- modules/backlogs/config/locales/crowdin/es.yml | 3 --- modules/backlogs/config/locales/crowdin/et.yml | 3 --- modules/backlogs/config/locales/crowdin/eu.yml | 3 --- modules/backlogs/config/locales/crowdin/fa.yml | 3 --- modules/backlogs/config/locales/crowdin/fi.yml | 3 --- .../backlogs/config/locales/crowdin/fil.yml | 3 --- modules/backlogs/config/locales/crowdin/fr.yml | 3 --- modules/backlogs/config/locales/crowdin/he.yml | 3 --- modules/backlogs/config/locales/crowdin/hi.yml | 3 --- modules/backlogs/config/locales/crowdin/hr.yml | 3 --- modules/backlogs/config/locales/crowdin/hu.yml | 3 --- modules/backlogs/config/locales/crowdin/hy.yml | 3 --- modules/backlogs/config/locales/crowdin/id.yml | 3 --- modules/backlogs/config/locales/crowdin/it.yml | 3 --- modules/backlogs/config/locales/crowdin/ja.yml | 3 --- modules/backlogs/config/locales/crowdin/ka.yml | 3 --- modules/backlogs/config/locales/crowdin/kk.yml | 3 --- modules/backlogs/config/locales/crowdin/ko.yml | 3 --- modules/backlogs/config/locales/crowdin/lt.yml | 3 --- modules/backlogs/config/locales/crowdin/lv.yml | 3 --- modules/backlogs/config/locales/crowdin/mn.yml | 3 --- modules/backlogs/config/locales/crowdin/ms.yml | 3 --- modules/backlogs/config/locales/crowdin/ne.yml | 3 --- modules/backlogs/config/locales/crowdin/nl.yml | 3 --- modules/backlogs/config/locales/crowdin/no.yml | 3 --- modules/backlogs/config/locales/crowdin/pl.yml | 3 --- .../backlogs/config/locales/crowdin/pt-BR.yml | 3 --- .../backlogs/config/locales/crowdin/pt-PT.yml | 3 --- modules/backlogs/config/locales/crowdin/ro.yml | 3 --- modules/backlogs/config/locales/crowdin/ru.yml | 3 --- modules/backlogs/config/locales/crowdin/rw.yml | 3 --- modules/backlogs/config/locales/crowdin/si.yml | 3 --- modules/backlogs/config/locales/crowdin/sk.yml | 3 --- modules/backlogs/config/locales/crowdin/sl.yml | 3 --- modules/backlogs/config/locales/crowdin/sr.yml | 3 --- modules/backlogs/config/locales/crowdin/sv.yml | 3 --- modules/backlogs/config/locales/crowdin/th.yml | 3 --- modules/backlogs/config/locales/crowdin/tr.yml | 3 --- modules/backlogs/config/locales/crowdin/uk.yml | 3 --- modules/backlogs/config/locales/crowdin/uz.yml | 3 --- modules/backlogs/config/locales/crowdin/vi.yml | 3 --- .../backlogs/config/locales/crowdin/zh-CN.yml | 3 --- .../backlogs/config/locales/crowdin/zh-TW.yml | 3 --- 57 files changed, 10 insertions(+), 175 deletions(-) diff --git a/config/locales/crowdin/js-hy.yml b/config/locales/crowdin/js-hy.yml index 5aead332475..b797f9ac30f 100644 --- a/config/locales/crowdin/js-hy.yml +++ b/config/locales/crowdin/js-hy.yml @@ -109,7 +109,7 @@ hy: button_save: Save button_settings: Settings button_uncheck_all: Uncheck all - button_update: Update + button_update: Թարմացնել button_export-atom: Download Atom button_generate_pdf: Generate PDF button_create: Create diff --git a/modules/avatars/config/locales/crowdin/js-hy.yml b/modules/avatars/config/locales/crowdin/js-hy.yml index 3d38b48a702..670380f5ecb 100644 --- a/modules/avatars/config/locales/crowdin/js-hy.yml +++ b/modules/avatars/config/locales/crowdin/js-hy.yml @@ -2,14 +2,14 @@ --- hy: js: - label_preview: Preview - button_update: Update + label_preview: Նախադիտել + button_update: Թարմացնել avatars: - label_choose_avatar: Choose Avatar from file - uploading_avatar: Uploading your avatar. + label_choose_avatar: Ընտրեք ավատարը նիշքից + uploading_avatar: Ձեր ավատարը վերբեռնվում է։ text_upload_instructions: | - Upload your own custom avatar of 128 by 128 pixels. Larger files will be resized and cropped to match. - A preview of your avatar will be shown before uploading, once you selected an image. - error_image_too_large: Image is too large. - wrong_file_format: Allowed formats are jpg, png, gif - empty_file_error: Please upload a valid image (jpg, png, gif) + Բեռնեք Ձեր անհատական ավատարը՝ 128 x 128 պիքսել չափով։ Ավելի մեծ նիշքերի չափերը կփոխվեն և կկտրվեն՝ համապատասխանեցվելու համար։ + Պատկերն ընտրելուց հետո, նախքան բեռնելը, կցուցադրվի Ձեր ավատարի նախադիտումը։ + error_image_too_large: 'Պատկերը չափազանց մեծ է։ ' + wrong_file_format: Թույլատրելի ձևաչափերն են՝ jpg, png, gif։ + empty_file_error: 'Խնդրում ենք վերբեռնել վավեր պատկեր (jpg, png, gif)։ ' diff --git a/modules/backlogs/config/locales/crowdin/af.yml b/modules/backlogs/config/locales/crowdin/af.yml index 9c5abe752a3..07a3cc5cdac 100644 --- a/modules/backlogs/config/locales/crowdin/af.yml +++ b/modules/backlogs/config/locales/crowdin/af.yml @@ -40,8 +40,6 @@ af: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Agterstand tipe @@ -102,7 +100,6 @@ af: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ar.yml b/modules/backlogs/config/locales/crowdin/ar.yml index 44d59984311..d591156a94a 100644 --- a/modules/backlogs/config/locales/crowdin/ar.yml +++ b/modules/backlogs/config/locales/crowdin/ar.yml @@ -40,8 +40,6 @@ ar: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: نوع الأعمال المتراكمة غير المنجزة @@ -106,7 +104,6 @@ ar: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/az.yml b/modules/backlogs/config/locales/crowdin/az.yml index 33feef5abd7..3c5c57c3714 100644 --- a/modules/backlogs/config/locales/crowdin/az.yml +++ b/modules/backlogs/config/locales/crowdin/az.yml @@ -40,8 +40,6 @@ az: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: '' @@ -102,7 +100,6 @@ az: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/be.yml b/modules/backlogs/config/locales/crowdin/be.yml index 543c562d737..7b348f01476 100644 --- a/modules/backlogs/config/locales/crowdin/be.yml +++ b/modules/backlogs/config/locales/crowdin/be.yml @@ -40,8 +40,6 @@ be: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Тып бэклогу @@ -104,7 +102,6 @@ be: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/bg.yml b/modules/backlogs/config/locales/crowdin/bg.yml index 4f96b8cd720..756b38b480f 100644 --- a/modules/backlogs/config/locales/crowdin/bg.yml +++ b/modules/backlogs/config/locales/crowdin/bg.yml @@ -40,8 +40,6 @@ bg: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ bg: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ca.yml b/modules/backlogs/config/locales/crowdin/ca.yml index e25e5cbdff5..dafff29a187 100644 --- a/modules/backlogs/config/locales/crowdin/ca.yml +++ b/modules/backlogs/config/locales/crowdin/ca.yml @@ -40,8 +40,6 @@ ca: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Tipus de backlog @@ -102,7 +100,6 @@ ca: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ckb-IR.yml b/modules/backlogs/config/locales/crowdin/ckb-IR.yml index 3b0544ab8aa..15d0c11537b 100644 --- a/modules/backlogs/config/locales/crowdin/ckb-IR.yml +++ b/modules/backlogs/config/locales/crowdin/ckb-IR.yml @@ -40,8 +40,6 @@ ckb-IR: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: جۆری Backlog @@ -102,7 +100,6 @@ ckb-IR: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/cs.yml b/modules/backlogs/config/locales/crowdin/cs.yml index b6ed3b82270..ab9c83355a8 100644 --- a/modules/backlogs/config/locales/crowdin/cs.yml +++ b/modules/backlogs/config/locales/crowdin/cs.yml @@ -40,8 +40,6 @@ cs: in_planning: V plánování active: Aktivní completed: Dokončen - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Typ nevyřízené položky @@ -104,7 +102,6 @@ cs: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/da.yml b/modules/backlogs/config/locales/crowdin/da.yml index 9b21f4bd923..bdd46d7236e 100644 --- a/modules/backlogs/config/locales/crowdin/da.yml +++ b/modules/backlogs/config/locales/crowdin/da.yml @@ -40,8 +40,6 @@ da: in_planning: Under planlægning active: Aktiv completed: Færdiggjort - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog-type @@ -102,7 +100,6 @@ da: show: blankslate_title: Ingen burndown-data tilgængelige blankslate_description: Angiv start- og slutdato for sprinten for at generere et burndown-diagram. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/de.yml b/modules/backlogs/config/locales/crowdin/de.yml index 369325caa64..462bfa47cdd 100644 --- a/modules/backlogs/config/locales/crowdin/de.yml +++ b/modules/backlogs/config/locales/crowdin/de.yml @@ -40,8 +40,6 @@ de: in_planning: In Planung active: Aktiv completed: Abgeschlossen - user_preference: - backlogs_versions_default_fold_state: Zeige Versionen eingeklappt work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog Typ @@ -102,7 +100,6 @@ de: show: blankslate_title: Keine Burndown-Daten verfügbar blankslate_description: Legen Sie Start- und Enddatum für den Sprint fest, um ein Burndown-Diagramm zu erstellen. - caption_sprints_default_fold_state: Versionen werden beim Anzeigen des Backlogs standardmäßig nicht aufgeklappt. Sie müssen manuell geöffnet werden. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/el.yml b/modules/backlogs/config/locales/crowdin/el.yml index e0a46e44e17..a3880da7f6b 100644 --- a/modules/backlogs/config/locales/crowdin/el.yml +++ b/modules/backlogs/config/locales/crowdin/el.yml @@ -40,8 +40,6 @@ el: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Τύπος backlog @@ -102,7 +100,6 @@ el: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/eo.yml b/modules/backlogs/config/locales/crowdin/eo.yml index d3a8a688acd..1d12bd1bfe0 100644 --- a/modules/backlogs/config/locales/crowdin/eo.yml +++ b/modules/backlogs/config/locales/crowdin/eo.yml @@ -40,8 +40,6 @@ eo: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ eo: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/es.yml b/modules/backlogs/config/locales/crowdin/es.yml index 2f692537356..1c234bba293 100644 --- a/modules/backlogs/config/locales/crowdin/es.yml +++ b/modules/backlogs/config/locales/crowdin/es.yml @@ -40,8 +40,6 @@ es: in_planning: En planificación active: Activo completed: Completado - user_preference: - backlogs_versions_default_fold_state: Mostrar sprints colapsados work_package: backlog_bucket: Buckets de backlog backlogs_work_package_type: Tipo de Backlog @@ -102,7 +100,6 @@ es: show: blankslate_title: No hay datos de trabajo pendiente disponibles blankslate_description: Establezca la fecha de inicio y finalización del sprint para generar un gráfico de trabajo pendiente. - caption_sprints_default_fold_state: Los sprints no se mostrarán expandidos por defecto al ver la página «Backlog y sprints». Hay que expandir cada uno manualmente. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/et.yml b/modules/backlogs/config/locales/crowdin/et.yml index 815672db880..463e5930940 100644 --- a/modules/backlogs/config/locales/crowdin/et.yml +++ b/modules/backlogs/config/locales/crowdin/et.yml @@ -40,8 +40,6 @@ et: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ et: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/eu.yml b/modules/backlogs/config/locales/crowdin/eu.yml index 02e11f8b1c7..5e186d74e8a 100644 --- a/modules/backlogs/config/locales/crowdin/eu.yml +++ b/modules/backlogs/config/locales/crowdin/eu.yml @@ -40,8 +40,6 @@ eu: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ eu: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/fa.yml b/modules/backlogs/config/locales/crowdin/fa.yml index 86bd8491894..5edee49ee7b 100644 --- a/modules/backlogs/config/locales/crowdin/fa.yml +++ b/modules/backlogs/config/locales/crowdin/fa.yml @@ -40,8 +40,6 @@ fa: in_planning: در حال برنامه ریزی active: فعال completed: تکمیل شده - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ fa: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/fi.yml b/modules/backlogs/config/locales/crowdin/fi.yml index d2b4c9669c7..4a071deebdc 100644 --- a/modules/backlogs/config/locales/crowdin/fi.yml +++ b/modules/backlogs/config/locales/crowdin/fi.yml @@ -40,8 +40,6 @@ fi: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Työjonon tyyppi @@ -102,7 +100,6 @@ fi: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/fil.yml b/modules/backlogs/config/locales/crowdin/fil.yml index 3561be5c353..05f68101fd9 100644 --- a/modules/backlogs/config/locales/crowdin/fil.yml +++ b/modules/backlogs/config/locales/crowdin/fil.yml @@ -40,8 +40,6 @@ fil: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ fil: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/fr.yml b/modules/backlogs/config/locales/crowdin/fr.yml index 533cfc33b2a..0c16afd9299 100644 --- a/modules/backlogs/config/locales/crowdin/fr.yml +++ b/modules/backlogs/config/locales/crowdin/fr.yml @@ -40,8 +40,6 @@ fr: in_planning: En cours de planification active: Actif completed: Terminé - user_preference: - backlogs_versions_default_fold_state: Afficher les sprints repliés work_package: backlog_bucket: Bucket de backlog backlogs_work_package_type: Type de backlog @@ -102,7 +100,6 @@ fr: show: blankslate_title: Aucune donnée de burndown disponible blankslate_description: Définissez les dates de début et de fin du sprint afin de générer un graphique burndown. - caption_sprints_default_fold_state: Les sprints ne sont pas développés par défaut lorsque vous consultez la page « Backlog et sprints ». Chacun d'entre eux doit être développé manuellement. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/he.yml b/modules/backlogs/config/locales/crowdin/he.yml index e545b6d4d26..aa89d567a5c 100644 --- a/modules/backlogs/config/locales/crowdin/he.yml +++ b/modules/backlogs/config/locales/crowdin/he.yml @@ -40,8 +40,6 @@ he: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -104,7 +102,6 @@ he: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/hi.yml b/modules/backlogs/config/locales/crowdin/hi.yml index 8a79bf25a5f..bf33a94ce62 100644 --- a/modules/backlogs/config/locales/crowdin/hi.yml +++ b/modules/backlogs/config/locales/crowdin/hi.yml @@ -40,8 +40,6 @@ hi: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: बैकलॉग प्रकार @@ -102,7 +100,6 @@ hi: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/hr.yml b/modules/backlogs/config/locales/crowdin/hr.yml index 34f1853593a..8454829f62d 100644 --- a/modules/backlogs/config/locales/crowdin/hr.yml +++ b/modules/backlogs/config/locales/crowdin/hr.yml @@ -40,8 +40,6 @@ hr: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog tip @@ -103,7 +101,6 @@ hr: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/hu.yml b/modules/backlogs/config/locales/crowdin/hu.yml index eb7ddaa696b..076afe2144b 100644 --- a/modules/backlogs/config/locales/crowdin/hu.yml +++ b/modules/backlogs/config/locales/crowdin/hu.yml @@ -40,8 +40,6 @@ hu: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog típus @@ -102,7 +100,6 @@ hu: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/hy.yml b/modules/backlogs/config/locales/crowdin/hy.yml index c26a97e96de..ea39d933d78 100644 --- a/modules/backlogs/config/locales/crowdin/hy.yml +++ b/modules/backlogs/config/locales/crowdin/hy.yml @@ -40,8 +40,6 @@ hy: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ hy: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/id.yml b/modules/backlogs/config/locales/crowdin/id.yml index 29e42dfd8b2..a3117e1cc6c 100644 --- a/modules/backlogs/config/locales/crowdin/id.yml +++ b/modules/backlogs/config/locales/crowdin/id.yml @@ -40,8 +40,6 @@ id: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Jenis jaminan tersimpan @@ -101,7 +99,6 @@ id: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/it.yml b/modules/backlogs/config/locales/crowdin/it.yml index feb2a0048b5..13ea2b99ea8 100644 --- a/modules/backlogs/config/locales/crowdin/it.yml +++ b/modules/backlogs/config/locales/crowdin/it.yml @@ -40,8 +40,6 @@ it: in_planning: In pianificazione active: Attivo completed: Completato - user_preference: - backlogs_versions_default_fold_state: Mostra gli sprint compressi work_package: backlog_bucket: Bucket del backlog backlogs_work_package_type: Tipo di backlog @@ -102,7 +100,6 @@ it: show: blankslate_title: Non sono disponibili dati di burndown blankslate_description: Imposta la data di inizio e di fine dello sprint per generare un grafico di burndown. - caption_sprints_default_fold_state: Gli sprint non verranno espansi automaticamente nella pagina "Backlog e sprint". Ognuno dovrà essere espanso manualmente. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ja.yml b/modules/backlogs/config/locales/crowdin/ja.yml index 7bee20b9420..394e9cb7f00 100644 --- a/modules/backlogs/config/locales/crowdin/ja.yml +++ b/modules/backlogs/config/locales/crowdin/ja.yml @@ -40,8 +40,6 @@ ja: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: バックログの種類 @@ -101,7 +99,6 @@ ja: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ka.yml b/modules/backlogs/config/locales/crowdin/ka.yml index d0f5900fe44..d176e4e4e9a 100644 --- a/modules/backlogs/config/locales/crowdin/ka.yml +++ b/modules/backlogs/config/locales/crowdin/ka.yml @@ -40,8 +40,6 @@ ka: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: ჩამორჩენის ტიპი @@ -102,7 +100,6 @@ ka: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/kk.yml b/modules/backlogs/config/locales/crowdin/kk.yml index 873da7705c8..620d4541569 100644 --- a/modules/backlogs/config/locales/crowdin/kk.yml +++ b/modules/backlogs/config/locales/crowdin/kk.yml @@ -40,8 +40,6 @@ kk: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ kk: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ko.yml b/modules/backlogs/config/locales/crowdin/ko.yml index 0480ff81ce8..c0b2f0e15ef 100644 --- a/modules/backlogs/config/locales/crowdin/ko.yml +++ b/modules/backlogs/config/locales/crowdin/ko.yml @@ -40,8 +40,6 @@ ko: in_planning: 계획 중 active: 활성 completed: 완료됨 - user_preference: - backlogs_versions_default_fold_state: 접힌 스프린트 표시 work_package: backlog_bucket: 백로그 버킷 backlogs_work_package_type: 백로그 유형 @@ -101,7 +99,6 @@ ko: show: blankslate_title: 사용 가능한 번다운 데이터 없음 blankslate_description: 스프린트의 시작 날짜와 종료 날짜를 설정하여 번다운 차트를 생성합니다. - caption_sprints_default_fold_state: "'백로그 및 스프린트' 페이지를 볼 때 스프린트는 기본적으로 확장되지 않습니다. 각각을 수동으로 확장해야 합니다." excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/lt.yml b/modules/backlogs/config/locales/crowdin/lt.yml index 5f50aef03f2..22d5ab326c6 100644 --- a/modules/backlogs/config/locales/crowdin/lt.yml +++ b/modules/backlogs/config/locales/crowdin/lt.yml @@ -40,8 +40,6 @@ lt: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Darbų sąrašo tipas @@ -104,7 +102,6 @@ lt: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/lv.yml b/modules/backlogs/config/locales/crowdin/lv.yml index 19faf507c93..6e969f73455 100644 --- a/modules/backlogs/config/locales/crowdin/lv.yml +++ b/modules/backlogs/config/locales/crowdin/lv.yml @@ -40,8 +40,6 @@ lv: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Produkta darbu krātuves tips @@ -103,7 +101,6 @@ lv: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/mn.yml b/modules/backlogs/config/locales/crowdin/mn.yml index 816eba42fa7..549686ea5a3 100644 --- a/modules/backlogs/config/locales/crowdin/mn.yml +++ b/modules/backlogs/config/locales/crowdin/mn.yml @@ -40,8 +40,6 @@ mn: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ mn: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ms.yml b/modules/backlogs/config/locales/crowdin/ms.yml index 94dd3f124b2..2e032a47cce 100644 --- a/modules/backlogs/config/locales/crowdin/ms.yml +++ b/modules/backlogs/config/locales/crowdin/ms.yml @@ -40,8 +40,6 @@ ms: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Jenis tunggakan kerja @@ -101,7 +99,6 @@ ms: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ne.yml b/modules/backlogs/config/locales/crowdin/ne.yml index 35264d26335..b2e835a739b 100644 --- a/modules/backlogs/config/locales/crowdin/ne.yml +++ b/modules/backlogs/config/locales/crowdin/ne.yml @@ -40,8 +40,6 @@ ne: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ ne: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/nl.yml b/modules/backlogs/config/locales/crowdin/nl.yml index f7bab806457..496dd7b411b 100644 --- a/modules/backlogs/config/locales/crowdin/nl.yml +++ b/modules/backlogs/config/locales/crowdin/nl.yml @@ -40,8 +40,6 @@ nl: in_planning: Wordt gepland active: Actief completed: Voltooid - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ nl: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/no.yml b/modules/backlogs/config/locales/crowdin/no.yml index b283728762e..6be155a02f7 100644 --- a/modules/backlogs/config/locales/crowdin/no.yml +++ b/modules/backlogs/config/locales/crowdin/no.yml @@ -40,8 +40,6 @@ in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Forsinkelser type @@ -102,7 +100,6 @@ show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/pl.yml b/modules/backlogs/config/locales/crowdin/pl.yml index f62e309d20e..b9724004bdd 100644 --- a/modules/backlogs/config/locales/crowdin/pl.yml +++ b/modules/backlogs/config/locales/crowdin/pl.yml @@ -40,8 +40,6 @@ pl: in_planning: W planowaniu active: Aktywne completed: Ukończone - user_preference: - backlogs_versions_default_fold_state: Pokaż zwinięte sprinty work_package: backlog_bucket: Kategoria backlogu backlogs_work_package_type: Typ backlogu @@ -104,7 +102,6 @@ pl: show: blankslate_title: Brak dostępnych danych spalania blankslate_description: Ustaw datę rozpoczęcia i zakończenia sprintu, aby wygenerować wykres spalania. - caption_sprints_default_fold_state: Sprinty nie będą domyślnie rozwijane podczas przeglądania strony „Backlog i sprinty”. Każdy z nich trzeba będzie rozwinąć ręcznie. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/pt-BR.yml b/modules/backlogs/config/locales/crowdin/pt-BR.yml index 7b9b53eb1ca..6642b832b03 100644 --- a/modules/backlogs/config/locales/crowdin/pt-BR.yml +++ b/modules/backlogs/config/locales/crowdin/pt-BR.yml @@ -40,8 +40,6 @@ pt-BR: in_planning: Em planejamento active: Ativa completed: Concluída - user_preference: - backlogs_versions_default_fold_state: Exibir sprints recolhidas work_package: backlog_bucket: Grupo de backlog backlogs_work_package_type: Tipo de backlog @@ -102,7 +100,6 @@ pt-BR: show: blankslate_title: Nenhum dado de burndown disponível blankslate_description: Defina a data de início e término da sprint para gerar o gráfico de burndown. - caption_sprints_default_fold_state: As sprints não serão expandidas por padrão ao visualizar a página “Backlog e sprints”. Cada uma deve ser expandida manualmente. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/pt-PT.yml b/modules/backlogs/config/locales/crowdin/pt-PT.yml index 590e790e129..cfdc861b5f1 100644 --- a/modules/backlogs/config/locales/crowdin/pt-PT.yml +++ b/modules/backlogs/config/locales/crowdin/pt-PT.yml @@ -40,8 +40,6 @@ pt-PT: in_planning: Em planeamento active: Ativo completed: Concluído - user_preference: - backlogs_versions_default_fold_state: Mostrar sprints dobrados work_package: backlog_bucket: Grupo de backlog backlogs_work_package_type: Tipo de backlog @@ -102,7 +100,6 @@ pt-PT: show: blankslate_title: Não há dados de burndown disponíveis blankslate_description: Defina a data de início e de fim do sprint para gerar um gráfico de burndown. - caption_sprints_default_fold_state: Os sprints não serão expandidos por defeito quando visualizar a página "Backlog e sprints". Cada um deles tem de ser expandido manualmente. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ro.yml b/modules/backlogs/config/locales/crowdin/ro.yml index 9ef80ee5ffa..85973aa9490 100644 --- a/modules/backlogs/config/locales/crowdin/ro.yml +++ b/modules/backlogs/config/locales/crowdin/ro.yml @@ -40,8 +40,6 @@ ro: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Tip restanță @@ -103,7 +101,6 @@ ro: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/ru.yml b/modules/backlogs/config/locales/crowdin/ru.yml index 13bc29fa720..928c726eec7 100644 --- a/modules/backlogs/config/locales/crowdin/ru.yml +++ b/modules/backlogs/config/locales/crowdin/ru.yml @@ -40,8 +40,6 @@ ru: in_planning: В планировании active: Активен completed: Завершён - user_preference: - backlogs_versions_default_fold_state: Покажите спринты в свернутом виде work_package: backlog_bucket: Раздел бэклога backlogs_work_package_type: Тип невыполненной работы @@ -104,7 +102,6 @@ ru: show: blankslate_title: Нет данных о выгорании blankslate_description: Установите дату начала и окончания для спринта для создания графика выгорания. - caption_sprints_default_fold_state: Спринты не будут раскрываться по умолчанию при просмотре страницы 'Бэклог и спринты'. Каждый из них должен быть развернут вручную. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/rw.yml b/modules/backlogs/config/locales/crowdin/rw.yml index a5c92b361f4..b3737115b0d 100644 --- a/modules/backlogs/config/locales/crowdin/rw.yml +++ b/modules/backlogs/config/locales/crowdin/rw.yml @@ -40,8 +40,6 @@ rw: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ rw: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/si.yml b/modules/backlogs/config/locales/crowdin/si.yml index 7c15172f12d..98c253ca5a4 100644 --- a/modules/backlogs/config/locales/crowdin/si.yml +++ b/modules/backlogs/config/locales/crowdin/si.yml @@ -40,8 +40,6 @@ si: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: බැක්ලොග් වර්ගය @@ -102,7 +100,6 @@ si: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/sk.yml b/modules/backlogs/config/locales/crowdin/sk.yml index 783763d163f..b5b756f0034 100644 --- a/modules/backlogs/config/locales/crowdin/sk.yml +++ b/modules/backlogs/config/locales/crowdin/sk.yml @@ -40,8 +40,6 @@ sk: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Typ oneskorenia @@ -104,7 +102,6 @@ sk: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/sl.yml b/modules/backlogs/config/locales/crowdin/sl.yml index 79f5bbf7c7c..6dd8d1924c2 100644 --- a/modules/backlogs/config/locales/crowdin/sl.yml +++ b/modules/backlogs/config/locales/crowdin/sl.yml @@ -40,8 +40,6 @@ sl: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Tip opravila na čakanju @@ -104,7 +102,6 @@ sl: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/sr.yml b/modules/backlogs/config/locales/crowdin/sr.yml index 6f5aefe2a43..cca0d8f5120 100644 --- a/modules/backlogs/config/locales/crowdin/sr.yml +++ b/modules/backlogs/config/locales/crowdin/sr.yml @@ -40,8 +40,6 @@ sr: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Tip backlog-a @@ -103,7 +101,6 @@ sr: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/sv.yml b/modules/backlogs/config/locales/crowdin/sv.yml index b39c70d691f..b1e6f160535 100644 --- a/modules/backlogs/config/locales/crowdin/sv.yml +++ b/modules/backlogs/config/locales/crowdin/sv.yml @@ -40,8 +40,6 @@ sv: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Typ av backlogg @@ -102,7 +100,6 @@ sv: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/th.yml b/modules/backlogs/config/locales/crowdin/th.yml index d306089d754..ffb2caab3f9 100644 --- a/modules/backlogs/config/locales/crowdin/th.yml +++ b/modules/backlogs/config/locales/crowdin/th.yml @@ -40,8 +40,6 @@ th: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: ประเภทงานค้าง @@ -101,7 +99,6 @@ th: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/tr.yml b/modules/backlogs/config/locales/crowdin/tr.yml index 102280d4d87..05ce951662f 100644 --- a/modules/backlogs/config/locales/crowdin/tr.yml +++ b/modules/backlogs/config/locales/crowdin/tr.yml @@ -40,8 +40,6 @@ tr: in_planning: Planlanıyor active: Aktif completed: Tamamlandı - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Birikmiş İş Havuzu backlogs_work_package_type: Bekleme listesi türü @@ -102,7 +100,6 @@ tr: show: blankslate_title: Burndown verisi yok blankslate_description: Bir burndown grafiği oluşturmak için sprint için başlangıç ve bitiş tarihi belirleyin. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/uk.yml b/modules/backlogs/config/locales/crowdin/uk.yml index 96cbf8a853c..8d920e8f88d 100644 --- a/modules/backlogs/config/locales/crowdin/uk.yml +++ b/modules/backlogs/config/locales/crowdin/uk.yml @@ -40,8 +40,6 @@ uk: in_planning: На етапі планування active: Активний completed: Завершений - user_preference: - backlogs_versions_default_fold_state: Показувати спринти згорнутими work_package: backlog_bucket: Сегмент беклогу backlogs_work_package_type: Тип Backlog-у @@ -104,7 +102,6 @@ uk: show: blankslate_title: Немає даних про згорання завдань blankslate_description: Визначте дату початку й завершення спринту, щоб згенерувати діаграму згорання завдань. - caption_sprints_default_fold_state: Спринти не розгортатимуться за замовчуванням при перегляді сторінки «Беклог і спринти». Кожен спринт потрібно буде розгортати вручну. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/uz.yml b/modules/backlogs/config/locales/crowdin/uz.yml index 66aecf50328..3b1a8c00cc6 100644 --- a/modules/backlogs/config/locales/crowdin/uz.yml +++ b/modules/backlogs/config/locales/crowdin/uz.yml @@ -40,8 +40,6 @@ uz: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Backlog type @@ -102,7 +100,6 @@ uz: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/vi.yml b/modules/backlogs/config/locales/crowdin/vi.yml index 5860d8cd940..5bb47c3e137 100644 --- a/modules/backlogs/config/locales/crowdin/vi.yml +++ b/modules/backlogs/config/locales/crowdin/vi.yml @@ -40,8 +40,6 @@ vi: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: Loại Backlog @@ -103,7 +101,6 @@ vi: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/zh-CN.yml b/modules/backlogs/config/locales/crowdin/zh-CN.yml index 004b13d99fd..c400c3897b0 100644 --- a/modules/backlogs/config/locales/crowdin/zh-CN.yml +++ b/modules/backlogs/config/locales/crowdin/zh-CN.yml @@ -40,8 +40,6 @@ zh-CN: in_planning: 计划中 active: 激活 completed: 已完成 - user_preference: - backlogs_versions_default_fold_state: 以折叠形式显示冲刺 work_package: backlog_bucket: 积压工作存储桶 backlogs_work_package_type: 待办清单类型 @@ -101,7 +99,6 @@ zh-CN: show: blankslate_title: 没有可用的燃尽数据 blankslate_description: 设置冲刺的开始和结束日期,以生成燃尽图。 - caption_sprints_default_fold_state: 查看“积压工作和冲刺”页面时,默认情况下不会展开冲刺。每个冲刺都必须手动展开。 excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' diff --git a/modules/backlogs/config/locales/crowdin/zh-TW.yml b/modules/backlogs/config/locales/crowdin/zh-TW.yml index 18b23f07e81..10a4474311b 100644 --- a/modules/backlogs/config/locales/crowdin/zh-TW.yml +++ b/modules/backlogs/config/locales/crowdin/zh-TW.yml @@ -40,8 +40,6 @@ zh-TW: in_planning: In planning active: Active completed: Completed - user_preference: - backlogs_versions_default_fold_state: Show sprints folded work_package: backlog_bucket: Backlog Bucket backlogs_work_package_type: 待辦事項類型 @@ -101,7 +99,6 @@ zh-TW: show: blankslate_title: No burndown data available blankslate_description: Set start and end date for the sprint to generate a burndown chart. - caption_sprints_default_fold_state: Sprints will not be expanded by default when viewing the 'Backlog and sprints' page. Each one has to be manually expanded. excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. ' From 6bac672e6044c5597e7f0c62ccb1c2f1a0f45c92 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 2 Apr 2026 20:56:31 +0200 Subject: [PATCH 037/381] use textarea for possibly multiline texts/commands --- .../git-actions-menu.component.spec.ts | 2 - .../git-actions-menu.component.ts | 13 +-- .../git-actions-menu.template.html | 6 +- .../styles/git-actions-menu.sass | 1 - .../module/git-actions/git-actions.service.ts | 4 - .../module/state/github-pull-request.model.ts | 4 +- .../git-actions-menu.component.spec.ts | 105 ++++++++++++++++++ .../git-actions-menu.component.ts | 13 +-- .../git-actions-menu.template.html | 6 +- .../styles/git-actions-menu.sass | 1 - .../module/git-actions/git-actions.service.ts | 6 +- .../frontend/module/typings.d.ts | 4 +- 12 files changed, 132 insertions(+), 33 deletions(-) create mode 100644 modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.spec.ts diff --git a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.spec.ts b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.spec.ts index 571ae4e9a18..ed17a77b610 100644 --- a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.spec.ts +++ b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.spec.ts @@ -7,7 +7,6 @@ import { OpIconComponent } from 'core-app/shared/components/icon/icon.component' import { I18nService } from 'core-app/core/i18n/i18n.service'; import { OpContextMenuLocalsToken } from 'core-app/shared/components/op-context-menu/op-context-menu.types'; - describe('GitActionsMenuComponent', () => { let component:GitActionsMenuComponent; let fixture:ComponentFixture; @@ -34,7 +33,6 @@ describe('GitActionsMenuComponent', () => { const gitActionsServiceSpy = { gitCommand: vi.fn().mockName('GitActionsService.gitCommand'), commitMessage: vi.fn().mockName('GitActionsService.commitMessage'), - commitMessageDisplayText: vi.fn().mockName('GitActionsService.commitMessageDisplayText'), branchName: vi.fn().mockName('GitActionsService.branchName') }; diff --git a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts index aaa7b9275a8..b6fc1326303 100644 --- a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts +++ b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts @@ -68,20 +68,19 @@ export class GitActionsMenuComponent extends OPContextMenuComponent { { id: 'branch', name: this.I18n.t('js.github_integration.tab_header.git_actions.branch_name'), - textToDisplay: () => this.gitActions.branchName(this.workPackage), - textToCopy: () => this.gitActions.branchName(this.workPackage), + text: () => this.gitActions.branchName(this.workPackage), }, { id: 'message', name: this.I18n.t('js.github_integration.tab_header.git_actions.commit_message'), - textToDisplay: () => this.gitActions.commitMessageDisplayText(this.workPackage), - textToCopy: () => this.gitActions.commitMessage(this.workPackage), + multiline: true, + text: () => this.gitActions.commitMessage(this.workPackage), }, { id: 'command', name: this.I18n.t('js.github_integration.tab_header.git_actions.cmd'), - textToDisplay: () => this.gitActions.gitCommand(this.workPackage), - textToCopy: () => this.gitActions.gitCommand(this.workPackage), + multiline: true, + text: () => this.gitActions.gitCommand(this.workPackage), }, ]; @@ -91,7 +90,7 @@ export class GitActionsMenuComponent extends OPContextMenuComponent { } public onCopyButtonClick(snippet:ISnippet):void { - const success = copy(snippet.textToCopy()); + const success = copy(snippet.text()); if (success) { this.lastCopyResult = this.text.copyResult.success; diff --git a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.template.html b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.template.html index d236ad4f0c5..ea892ed21a2 100644 --- a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.template.html +++ b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.template.html @@ -6,7 +6,11 @@ podrobnosti o odběru. language_name_being_default: "%{language_name} (výchozí)" notifications: - events_explanation: Určuje, pro kterou událost je odeslán e-mail. Pracovní balíčky jsou z tohoto seznamu vyloučeny, protože notifikace pro ně mohou být nastavena speciálně pro každého uživatele. + events_explanation: Určuje, pro kterou událost je odeslán e-mail. Pracovní balíčky jsou z tohoto seznamu vyloučeny, protože oznámení pro ně mohou být nastavena speciálně pro každého uživatele. delay_minutes_explanation: Odesílání e-mailu může být pozdrženo, aby bylo uživatelům s nakonfigurovaným v oznámení aplikace před odesláním pošty potvrzeno oznámení. Uživatelé, kteří si přečtou oznámení v aplikaci, nedostanou e-mail pro již přečtené oznámení. other: Ostatní passwords: Hesla @@ -5771,7 +5771,7 @@ cs: text_destroy_what_to_do: Co chcete udělat? text_diff_truncated: "... Toto rozlišení bylo zkráceno, protože přesahuje maximální velikost, kterou lze zobrazit." text_email_delivery_not_configured: |- - Doručení e-mailu není nakonfigurováno a notifikace jsou zakázány. + Doručení e-mailu není nakonfigurováno a oznámení jsou zakázána. Nakonfigurujte váš SMTP server pro jejich povolení. text_enumeration_category_reassign_to: 'Přiřadit je k této hodnotě:' text_enumeration_destroy_question: "%{count} objektů je přiřazeno k této hodnotě." diff --git a/config/locales/crowdin/de.yml b/config/locales/crowdin/de.yml index 7d835e15b6b..f8197f65789 100644 --- a/config/locales/crowdin/de.yml +++ b/config/locales/crowdin/de.yml @@ -106,11 +106,11 @@ de: type_token_text: Ihr Enterprise-Token-Text token_placeholder: Enterprise-Token Text hier einfügen token_caption: Weitere Informationen über die Aktivierung der Enterprise Edition finden Sie in unserer [Dokumentation](docs_url). - add_token: Enterprise-Edition Support Token hochladen + add_token: Enterprise edition Support Token hochladen replace_token: Aktuellen Enterprise edition Support Token ersetzen order: Enterprise on-premises bestellen - paste: Enterprise-Edition Support Token hier einfügen - required_for_feature: Dieses Add-on ist nur mit einem aktiven Enterprise-Edition Support-Token verfügbar. + paste: Enterprise edition Support Token hier einfügen + required_for_feature: Dieses Add-on ist nur mit einem aktiven Enterprise edition Support-Token verfügbar. enterprise_link: Klicken Sie hier für weitere Informationen. start_trial: Kostenlose Testversion starten book_now: Jetzt buchen @@ -1407,10 +1407,10 @@ de: tab: Titel konfigurieren manually_editable_subjects: label: Manuell bearbeitbare Titel - caption: Nutzer:innen können die Titel der Arbeitspakete ohne Einschränkungen manuell eingeben und bearbeiten. + caption: Benutzer können die Titel der Arbeitspakete ohne Einschränkungen manuell eingeben und bearbeiten. automatically_generated_subjects: label: Automatisch generierte Titel - caption: Definieren Sie ein Schema aus referenzierten Attributen und Freitext für die automatische Generierung von Arbeitspakettiteln. Nutzer:innen können diese nicht manuell editieren. + caption: Definieren Sie ein Schema aus referenzierten Attributen und Freitext für die automatische Generierung von Arbeitspakettiteln. Nutzer können diese nicht manuell editieren. token: label_with_context: "%{attribute_context}: %{attribute_label}" context: @@ -1511,7 +1511,7 @@ de: manual_with_children: Hat Unteraufgaben aber ihre Startdaten werden ignoriert. title: automatic_mobile: Automatisch geplant. - automatic_with_children: Unteraufgaben bestimmen Termine. + automatic_with_children: Die Termine sind durch untergeordnete Arbeitspakete bestimmt. automatic_with_predecessor: Der Anfangstermin wird von einem Vorgänger festgelegt. manual_mobile: Manuell geplant. manually_scheduled: Manuell geplant – Daten unabhängig von Beziehungen. @@ -1614,7 +1614,7 @@ de: label_child_plural: Unteraufgaben new_child: Neue Unteraufgabe new_child_description: Erstellt ein zugehöriges Arbeitspaket als Unteraufgabe des aktuellen (übergeordneten) Arbeitspakets - child: Unteraufgabe + child: Kind child_description: Macht das zugehörige Arbeitspaket zu einer Unteraufgabe des aktuellen (übergeordneten) Arbeitspakets parent: Übergeordnetes Arbeitspaket parent_description: Wandelt das verknüpfte in ein übergeordnetes Arbeitspaket dieses Arbeitspakets um @@ -1874,7 +1874,7 @@ de: column_names: Spalten relations_to_type_column: Beziehungen zu %{type} relations_of_type_column: 'Beziehungen der Art: %{type}' - child_work_packages: Unteraufgaben + child_work_packages: Kinder group_by: Gruppiere Ergebnisse nach sort_by: Ergebnisse sortieren nach filters: Filter @@ -2443,7 +2443,7 @@ de: status_transition_invalid: ist ungültig, da kein valider Übergang vom alten zum neuen Status für die aktuelle Rolle des Nutzers existiert. status_invalid_in_type: ist ungültig, da der aktuelle Status nicht in diesem Typ vorhanden ist. type: - cannot_be_milestone_due_to_children: kann kein Meilenstein werden, da dieses Arbeitspaket Unteraufgaben besitzt. + cannot_be_milestone_due_to_children: kann kein Meilenstein werden, da dieses Arbeitspaket Unterelemente besitzt. priority_id: only_active_priorities_allowed: muss aktiv sein. category: @@ -3264,7 +3264,7 @@ de: error_custom_option_not_found: Option ist nicht vorhanden. error_enterprise_plan_needed: Sie benötigen den Enterprise-Plan %{plan}, um diese Aktion durchzuführen. error_enterprise_activation_user_limit: Ihr Konto konnte nicht aktiviert werden (Nutzerlimit erreicht). Bitte kontaktieren Sie Ihren Administrator um Zugriff zu erhalten. - error_enterprise_token_invalid_domain: Die Enterprise-Edition ist nicht aktiv. Die aktuelle Domain (%{actual}) entspricht nicht dem erwarteten Hostnamen (%{expected}). + error_enterprise_token_invalid_domain: Die Enterprise edition ist nicht aktiv. Die aktuelle Domain (%{actual}) entspricht nicht dem erwarteten Hostnamen (%{expected}). error_failed_to_delete_entry: Fehler beim Löschen dieses Eintrags. error_in_dependent: 'Fehler beim Versuch, abhängiges Objekt zu ändern: %{dependent_class} #%{related_id} - %{related_subject}: %{error}' error_in_new_dependent: 'Fehler beim Versuch, abhängiges Objekt zu erstellen: %{dependent_class} - %{related_subject}: %{error}' @@ -3571,7 +3571,7 @@ de: dates: working: "%{date} ist jetzt ein Arbeitstag" non_working: "%{date} ist jetzt ein arbeitsfreier Tag" - progress_mode_changed_to_status_based: Fortschrittberechnung wurde auf Status-bezogen gesetzt + progress_mode_changed_to_status_based: Fortschrittberechnung wurde auf Status-basiert gesetzt status_excluded_from_totals_set_to_false_message: jetzt in den Gesamtwerten der Hierarchie enthalten status_excluded_from_totals_set_to_true_message: jetzt von den Hierarchie-Gesamtwerten ausgeschlossen status_percent_complete_changed: "% abgeschlossen von %{old_value}% auf %{new_value} % geändert" @@ -3975,7 +3975,7 @@ de: label_enumerations: Aufzählungen label_enterprise: Enterprise label_enterprise_active_users: "%{current}/%{limit} gebuchte aktive Nutzer" - label_enterprise_edition: Enterprise Edition + label_enterprise_edition: Enterprise edition label_enterprise_support: Enterprise Support label_environment: Umgebung label_estimates_and_progress: Schätzungen und Fortschritt @@ -5098,7 +5098,7 @@ de: Erhöhen Sie diesen Wert zur Verbesserung der Performance, da die Erfassung des genutzten Festplattenspeichers Ressourcen-intensiv ist. oauth_application_details_html: 'Der Client Geheimcode wird nach dem Schließen dieses Fensters nicht mehr zugänglich sein. Bitte kopieren Sie diese Werte in die Nextcloud OpenProject Integrationseinstellungen:' oauth_application_details_link_text: Zu den Einstellungen gehen - setup_documentation_details: 'Wenn Sie Hilfe bei der Konfiguration eines neuen Dateispeichers benötigen, konsultieren Sie bitte die Dokumentation: ' + setup_documentation_details: 'Wenn Sie Hilfe bei der Konfiguration eines neuen Datei-Speichers benötigen, konsultieren Sie bitte die Dokumentation: ' setup_documentation_details_link_text: Dateispeicher einrichten show_warning_details: Um diesen Dateispeicher nutzen zu können, müssen Sie das Modul und den spezifischen Speicher in den Projekteinstellungen jedes gewünschten Projekts aktivieren. subversion: @@ -5812,7 +5812,7 @@ de: warning_user_limit_reached_admin_html: 'Das Hinzufügen zusätzlicher Benutzer überschreitet das aktuelle Benutzerlimit. Bitte [aktualisieren Sie Ihr Abonnement](upgrade_url) um sicherzustellen, dass externe Benutzer auf diese Instanz zugreifen können. ' - warning_user_limit_reached_instructions: 'Du hast dein Nutzerlimit erreicht (%{current}/%{max} active users). Bitte kontaktiere sales@openproject.com um deinen Enterprise Edition Plan upzugraden und weitere Nutzer hinzuzufügen. + warning_user_limit_reached_instructions: 'Du hast dein Nutzerlimit erreicht (%{current}/%{max} active users). Bitte kontaktiere sales@openproject.com um deinen Enterprise edition Plan upzugraden und weitere Nutzer hinzuzufügen. ' warning_protocol_mismatch_html: '' diff --git a/config/locales/crowdin/es.yml b/config/locales/crowdin/es.yml index f826bcf0333..b3d6259c4c3 100644 --- a/config/locales/crowdin/es.yml +++ b/config/locales/crowdin/es.yml @@ -1513,7 +1513,7 @@ es: automatic_with_children: Fechas determinadas por paquetes de trabajo secundarios. automatic_with_predecessor: La fecha de inicio la fija un predecesor. manual_mobile: Programado manualmente. - manually_scheduled: Programado manualmente. No afectadas por relaciones. + manually_scheduled: Programado manualmente. Fechas no afectadas por relaciones. blankslate: title: Sin predecesores description: Para activar la programación automática, este paquete de trabajo debe tener al menos un predecesor. Entonces se programará automáticamente para que comience después del predecesor más cercano. diff --git a/config/locales/crowdin/ja.yml b/config/locales/crowdin/ja.yml index b4637da4f6c..8820abe7c08 100644 --- a/config/locales/crowdin/ja.yml +++ b/config/locales/crowdin/ja.yml @@ -364,13 +364,13 @@ ja: success: MCP configuration was updated successfully. scim_clients: authentication_methods: - sso: IDプロバイダーからのJWT - oauth2_client: OAuth 2.0クライアント認証情報 + sso: アイデンティティプロバイダからのJWT + oauth2_client: OAuth 2.0 クライアント資格情報 oauth2_token: 静的アクセストークン created_client_credentials_dialog_component: - title: クライアント認証情報の作成 - heading: クライアント認証情報が生成されました - one_time_hint: クライアント・シークレットが表示されるのはこの時だけです。必ずコピーしてください。 + title: クライアントの資格情報が作成されました + heading: クライアントの資格情報が生成されました + one_time_hint: クライアントのシークレットが表示される唯一の時間です。今すぐコピーしてください。 created_token_dialog_component: title: トークンを作成しました heading: トークンが生成されました @@ -383,21 +383,21 @@ ja: edit: label_delete_scim_client: SCIM クライアントを削除 form: - auth_provider_description: これは、SCIM プロバイダによって追加されたユーザが OpenProject で認証するために使用するサービスです。 - authentication_method_description_html: これは SCIM クライアントが OpenProject で認証する方法です。OAuth トークンにscim_v2スコープが含まれていることを確認してください。 - description: これらの設定オプションの詳細については、[SCIMクライアントの設定に関する文書](docs_url)を参照してください。 + auth_provider_description: これは、SCIMプロバイダが追加したユーザーがOpenProjectでの認証に使用するサービスです。 + authentication_method_description_html: これは SCIM クライアントが OpenProject で認証する方法です。OAuth トークンに scim_v2 スコープが含まれていることを確認してください。 + description: 設定オプションの詳細については、[SCIM クライアントの設定に関するドキュメント](docs_url)を参照してください。 jwt_sub_description: 例えば、Keycloakの場合、これはSCIMクライアントに関連付けられたサービスアカウントのUUIDです。あなたのユースケースにあった Subject claim を見つける方法については [ドキュメント](docs_url) を参照してください。 - name_description: このクライアントが設定された理由を他の管理者が理解しやすい名前を選んでください。 + name_description: 他の管理者がこのクライアントが設定された理由を理解するのに役立つ名前を選択してください。 index: - description: ここで設定された SCIM クライアントは、OpenProject SCIM サーバ API と対話し、ユーザアカウントやグループのプロビジョニング、更新、デプロビジョニングを行うことができます。 - label_create_button: SCIMクライアントの追加 + description: ここで設定されたSCIMクライアントは、OpenProjectのSCIMサーバー APIと相互作用して、ユーザーアカウントとグループのプロビジョニング、更新、およびデプロビジョニングを行うことができます。 + label_create_button: SCIMクライアントを追加 new: title: 新しいSCIMクライアント revoke_static_token_dialog_component: confirm_button: 取り消す - title: 静的トークンの失効 - heading: このトークンを本当に取り消しますか? - description: このトークンを使っている SCIM クライアントは、OpenProject の SCIM サーバ API にアクセスできなくなります。 + title: 静的トークンを取り消す + heading: このトークンを取り消してもよろしいですか? + description: このトークンを使用する SCIM クライアントは、OpenProject の SCIM サーバ API にアクセスできなくなります。 table_component: blank_slate: title: SCIMクライアントがまだ設定されていません @@ -1074,26 +1074,26 @@ ja: other: また、 %{shared_work_packages_link} はこのユーザーと共有されています。 remove_project_membership_or_work_package_shares_too: 直接のメンバーとしてのユーザーだけを削除したい(および共有を維持したい)、またはワークパッケージの共有も削除しますか? will_remove_all_user_access_priveleges: このメンバーを削除すると、プロジェクトへのユーザーのすべてのアクセス権が削除されます。ユーザーはまだサイトの一部として存在します。 - will_remove_all_group_access_priveleges: このメンバを削除すると、プロジェクトに対するグループのすべてのアクセス権が削除されます。グループはサイトの一部としてまだ存在します。 - cannot_delete_inherited_membership: このプロジェクトのメンバーであるグループに所属しているため、このメンバーを削除することはできません。 - cannot_delete_inherited_membership_note_admin_html: "%{administration_settings_link}で、プロジェクトのメンバーとしてグループを削除することも、特定のメンバーをグループから削除することもできます。" - cannot_delete_inherited_membership_note_non_admin: プロジェクトのメンバーとしてグループを削除するか、管理者に連絡してこの特定のメンバーをグループから削除することができます。 + will_remove_all_group_access_priveleges: このメンバーを削除すると、グループのすべてのアクセス権がプロジェクトに削除されます。グループはサイトの一部として存在します。 + cannot_delete_inherited_membership: このメンバーはこのプロジェクトのメンバーであるグループに属しているため、削除できません。 + cannot_delete_inherited_membership_note_admin_html: プロジェクトのメンバーとしてグループを削除するか、 %{administration_settings_link} のグループからこの特定のメンバーを削除することができます。 + cannot_delete_inherited_membership_note_non_admin: プロジェクトのメンバーとしてグループを削除するか、管理者に問い合わせてグループから特定のメンバーを削除することができます。 delete_work_package_shares_dialog: - title: ワーク・パッケージ・シェアの破棄 + title: ワークパッケージの共有の取り消し shared_with_this_user_html: other: "%{all_shared_work_packages_link} はこのユーザーと共有されています。" shared_with_this_group_html: other: "%{all_shared_work_packages_link} はこのグループと共有されています。" shared_with_permission_html: other: "%{shared_work_packages_link} のみが %{shared_role_name} 権限と共有されています。" - revoke_all_or_with_role: すべての共有ワークパッケージ、または %{shared_role_name} 権限を持つワークパッケージのみへのアクセス権を剥奪しますか? - will_not_affect_inherited_shares: "(これは、そのグループと共有しているワークパッケージには影響しません)。" - cannot_remove_inherited: グループで共有されたワークパッケージの共有は削除できません。 - cannot_remove_inherited_with_role: ロール %{shared_role_name} で共有されるワークパッケージは、グループを介して共有され、削除することはできません。 - cannot_remove_inherited_note_admin_html: "%{administration_settings_link}、グループへの共有を取り消すか、グループからこの特定のメンバーを削除することができます。" - cannot_remove_inherited_note_non_admin: グループへの共有を取り消すか、管理者に連絡して特定のメンバーをグループから削除することができます。 - will_revoke_directly_granted_access: このアクションは、グループと共有されているワークパッケージ以外の、すべてのワークパッケージへのアクセス権を剥奪する。 - will_revoke_access_to_all: このアクションは、すべてのアクセス権を剥奪する。 + revoke_all_or_with_role: 共有されたワークパッケージ、または %{shared_role_name} 権限を持つワークパッケージのみへのアクセスを取り消しますか? + will_not_affect_inherited_shares: "(これはグループと共有されているワークパッケージには影響しません)。" + cannot_remove_inherited: グループ間で共有されるワークパッケージは削除できません。 + cannot_remove_inherited_with_role: ワークパッケージとロール %{shared_role_name} が共有されているため、削除できません。 + cannot_remove_inherited_note_admin_html: あなたは、グループへの共有を取り消すか、 %{administration_settings_link} のグループからこの特定のメンバーを削除することができます。 + cannot_remove_inherited_note_non_admin: 共有をグループに取り消すか、管理者に問い合わせてグループから特定のメンバーを削除することができます。 + will_revoke_directly_granted_access: このアクションは、すべてのユーザーへのアクセスを取り消しますが、グループと共有されているワークパッケージです。 + will_revoke_access_to_all: このアクションは、すべてのユーザーへのアクセスを取り消します。 my: access_token: dialog: @@ -1117,7 +1117,7 @@ ja: no_results_title_text: 現在、有効なアクセス トークンはありません。 notice_api_token_revoked: APIトークンが削除されました。新しいトークンを作成するには、APIセクションの作成ボタンを使用してください。 notice_rss_token_revoked: RSSトークンが削除されました。新しいトークンを作成するには、RSSセクションのリンクを使用してください。 - notice_ical_token_revoked: プロジェクト "%{project_name}" のカレンダー "%{calendar_name}" の iCalendar トークン "%{token_name}" が失効しました。このトークンを持つiCalendar URLは無効になりました。 + notice_ical_token_revoked: プロジェクト "%{token_name}" のカレンダー "%{calendar_name}" の iCalendar トークン "%{project_name}" が取り消されました。 このトークンのiCalendar URLは無効です。 password_confirmation_dialog: confirmation_required: You need to enter your account password to confirm this change. title: Confirm your password to continue @@ -1142,7 +1142,7 @@ ja: force_password_change_hint: The user must set a new password on their next login. Automatically enabled when sending credentials via email. send_information_hint: Emails the password in plain text. When checked, the user will be required to change their password on first login. autologins: - prompt: ログインしたまま %{num_days} + prompt: "%{num_days} のログインを維持" sessions: session_name: "%{browser_name} %{browser_version} の %{os_name}" browser: ブラウザ @@ -1156,17 +1156,17 @@ ja: current: Current (this device) title: セッション管理 instructions: You are logged in to your account through the following devices. Revoke sessions that you do not recognise or from devices you do not control. - may_not_delete_current: 現在のセッションを削除することはできません。 + may_not_delete_current: 現在のセッションは削除できません。 deletion_warning: Are you sure you want to revoke this session? You will be logged out on this device. groups: member_in_these_groups: このユーザーは現在以下のグループのメンバーです: no_results_title_text: このユーザーは現在どのグループのメンバーでもありません。 summary_with_more_html: Member of %{names} and %{count_link}. - more: "%{count} もっと見る" + more: "%{count} 以上" summary_html: Member of %{names}. memberships: no_results_title_text: このユーザは現在プロジェクトのメンバーではありません。 - open_profile: プロフィール + open_profile: プロファイルを開く invite_user_modal: invite: 招待 title: @@ -1283,7 +1283,7 @@ ja: right_to_manage_members_missing: 'プレースホルダーユーザを削除する権限がありません。 プレースホルダー ユーザーがメンバーであるすべてのプロジェクトのメンバーを管理する権利はありません。 ' - delete_tooltip: プレースホルダー・ユーザーの削除 + delete_tooltip: プレースホルダー ユーザーを削除 deletion_info: heading_html: Delete placeholder user %{name} data_consequences: 'プレースホルダー ユーザのすべての発生(担当者、担当者、その他のユーザ値など)は、「削除されたユーザー」というアカウントに再割り当てられます。 削除されたすべてのアカウントのデータがこのアカウントに再割り当てられるため、ユーザーが作成したデータと別の削除されたアカウントのデータを区別することはできません。 @@ -1302,11 +1302,11 @@ ja: reactions: action_title: リアクト add_reaction: リアクションを追加 - react_with: "%{reaction} と リアクト" - and_user: および %{user} + react_with: "%{reaction} で反応する" + and_user: と %{user} and_others: other: と %{count} その他 - reaction_by: "%{reaction} によって" + reaction_by: "%{reaction} による" reportings: index: no_results_title_text: 現在、ステータス報告はありません。 @@ -1316,19 +1316,20 @@ ja: status_color_text: | このステータスの色を割り当てたり変更する場合にクリックします。 ステータスボタンに表示され、テーブル内のワークパッケージを強調表示するために使用できます。 - status_default_text: 新しいワークパッケージは、デフォルトでこのタイプに設定される。読み取り専用にはできない。 + status_default_text: 新しいワークパッケージはデフォルトでこのタイプに設定されています。読み取り専用にすることはできません。 status_excluded_from_totals_text: |- - このステータスを持つワークパッケージを、階層内の「作業」、「 - 残作業」、「完了率」の合計から除外するには、このオプションをオンにします。 + このオプションをオンにすると、このステータスのワークパッケージを合計作業量、 + 残作業量、および階層構造で完了させることができます。 status_percent_complete_text_html: |- In [status-based progress calculation mode](setting_url), the % Complete of a work package is automatically set to this value when this status is selected. Ignored in work-based mode. status_readonly_html: | - このステータスを持つワークパッケージを読み取り専用としてマークするには、このオプションをチェックする。 - ステータス以外の属性は変更できません。 + ワークパッケージを読み取り専用としてマークするには、このオプションをオンにしてください。 + ステータスを除いて変更することはできません。 +
- 注意: 継承された値 (子やリレーションなど) は適用されます。 + メモ: 継承された値 (例えば、子や関連) が適用されます。 index: no_results_title_text: 現在、ワークパッケージのステータスはありません。 no_results_content_text: 新しいステータスを追加 @@ -1338,7 +1339,7 @@ ja: is_readonly: 読み取り専用 excluded_from_totals: 合計から除外 themes: - dark: 暗い + dark: ダーク light: ライト sync_with_os: 自動(OSのテーマ設定に追従) types: @@ -1532,15 +1533,15 @@ ja: could_not_be_saved: '次のワークパッケージを保存できませんでした:' none_could_be_saved: "%{total} ワークパッケージのどれも更新できませんでした。" x_out_of_y_could_be_saved: "%{failing} の %{total} ワークパッケージのうち、 %{success} を更新できませんでした。" - selected_because_descendants: "%{selected} のワークパッケージが選択されたが、合計 %{total} のワークパッケージが影響を受け、その中には子孫も含まれる。" - descendant: 選択された子孫 + selected_because_descendants: "%{selected} ワークパッケージが選択されている間、合計で %{total} ワークパッケージが子孫を含む影響を受けます。" + descendant: 選択された子孫です move: no_common_statuses_exists: 選択されたすべてのワークパッケージに利用できるステータスはありません。 それらの状態は変更できません。 unsupported_for_multiple_projects: 複数のプロジェクトからのワークパッケージの一括移動 / コピーはサポートされていません - current_type_not_available_in_target_project: 'ワークパッケージの現在のタイプがターゲットプロジェクトで有効になっていません。変更しない場合は、ターゲットプロジェクトでタイプを有効にしてください。そうでない場合は、リストからターゲットプロジェクトで使用可能なタイプを選択してください。 + current_type_not_available_in_target_project: 'ターゲット プロジェクトで現在のワークパッケージのタイプが有効になっていません。 変更を行わないようにしたい場合は、対象プロジェクトのタイプを有効にしてください。 それ以外の場合は、リストからターゲット プロジェクトで使用可能なタイプを選択します。 ' - bulk_current_type_not_available_in_target_project: 'ワークパッケージの現在のタイプがターゲットプロジェクトで有効になっていません。変更しない場合は、ターゲットプロジェクトでタイプを有効にしてください。そうでない場合は、リストからターゲットプロジェクトで使用可能なタイプを選択してください。 + bulk_current_type_not_available_in_target_project: '現在のタイプのワークパッケージはターゲット プロジェクトで有効になっていません。 変更を行わないようにしたい場合は、対象プロジェクトのタイプを有効にしてください。 それ以外の場合は、リストからターゲット プロジェクトで使用可能なタイプを選択します。 ' sharing: @@ -1566,9 +1567,9 @@ ja: no_results_title_text: 現在、有効なバージョンはありません。 work_package_relations_tab: index: - action_bar_title: 他のワークパッケージとのリレーションを追加して、それらの間にリンクを作成する。 - no_results_title_text: 現在、利用可能な関係はない。 - blankslate_heading: 関係なし + action_bar_title: 他のワークパッケージにリレーションを追加して、その間にリンクを作成します。 + no_results_title_text: 現在利用可能なリレーションはありません。 + blankslate_heading: リレーションなし blankslate_description: このワークパッケージにはまだリレーションがありません。 label_add_child_button: 子要素 label_add_x: "%{x} を追加" diff --git a/config/locales/crowdin/js-ca.yml b/config/locales/crowdin/js-ca.yml index 9a23089491d..640f6e26dd1 100644 --- a/config/locales/crowdin/js-ca.yml +++ b/config/locales/crowdin/js-ca.yml @@ -109,7 +109,7 @@ ca: button_save: Desa button_settings: Configuració button_uncheck_all: Desmarca-ho tot - button_update: Actualitzar + button_update: Actualitza button_export-atom: Descarregar Atom button_generate_pdf: Generate PDF button_create: Crear diff --git a/config/locales/crowdin/js-da.yml b/config/locales/crowdin/js-da.yml index aba5d64bc66..e5932ee36d2 100644 --- a/config/locales/crowdin/js-da.yml +++ b/config/locales/crowdin/js-da.yml @@ -109,7 +109,7 @@ da: button_save: Gem button_settings: Indstillinger button_uncheck_all: Fjern alle markeringer - button_update: Opdatér + button_update: Opdater button_export-atom: Download Atom button_generate_pdf: Generate PDF button_create: Opret diff --git a/config/locales/crowdin/js-de.yml b/config/locales/crowdin/js-de.yml index da592c1c126..0cc1627c537 100644 --- a/config/locales/crowdin/js-de.yml +++ b/config/locales/crowdin/js-de.yml @@ -143,7 +143,7 @@ de: description_available_columns: Verfügbare Spalten description_current_position: 'Sie sind hier: ' description_select_work_package: 'Arbeitspaket #%{id} auswählen' - description_subwork_package: 'Unteraufgabe von Arbeitspaket #%{id}' + description_subwork_package: 'Kind von Arbeitspaket #%{id}' editor: revisions: Lokale Änderungen anzeigen no_revisions: Keine lokalen Änderungen gefunden @@ -451,7 +451,7 @@ de: label_total_progress: "%{percent}% Gesamtfortschritt" label_total_amount: 'Gesamt: %{amount}' label_updated_on: aktualisiert am - label_value_derived_from_children: "(aggregierter Wert von Unteraufgaben)" + label_value_derived_from_children: "(aggregierter Wert von Kindelementen)" label_children_derived_duration: Aggregierte Dauer der Unteraufgaben label_warning: Warnung label_work_package: Arbeitspaket @@ -769,7 +769,7 @@ de: title: Neues Arbeitspaket header: 'Neu: %{type}' header_no_type: Neues Arbeitspaket (Typ noch nicht gesetzt) - header_with_parent: 'Neu: %{type} (Unteraufgabe von %{parent_type} #%{id})' + header_with_parent: 'Neu: %{type} (Kind von %{parent_type} #%{id})' button: Erstellen duplicate: title: Arbeitspaket duplizieren diff --git a/config/locales/crowdin/js-ja.yml b/config/locales/crowdin/js-ja.yml index 31d8faf28d5..9393c58aefe 100644 --- a/config/locales/crowdin/js-ja.yml +++ b/config/locales/crowdin/js-ja.yml @@ -34,12 +34,12 @@ ja: draggable_hint: | 埋め込み画像または添付ファイルをエディタにドラッグします。 ドラッグしつづけると閉じているエディタ領域が開きます。 - quarantined_hint: ウイルスが発見されたように、ファイルは隔離されています。ダウンロードできません。 + quarantined_hint: ウイルスが発見されたため,ファイルは隔離されています。ダウンロードできません。 autocomplete_ng_select: - add_tag: アイテムを追加 + add_tag: 項目を追加 clear_all: すべてクリア loading: 読み込み中... - not_found: アイテムが見つかりません + not_found: 見つかりませんでした type_to_search: 検索キーワードを入力 autocomplete_select: placeholder: @@ -71,7 +71,7 @@ ja: button_back_to_list_view: リスト表示に戻る button_cancel: キャンセル button_close: 閉じる - button_change_project: 別のプロジェクトに移動 + button_change_project: 他のプロジェクトに移る button_check_all: 全てを選択 button_configure-form: フォームを設定 button_confirm: 確認 @@ -79,7 +79,7 @@ ja: button_copy: コピー button_copy_to_clipboard: クリップボードにコピー button_copy_link_to_clipboard: クリップボードにリンクをコピー - button_copy_to_other_project: 別のプロジェクトで複製 + button_copy_to_other_project: 別のプロジェクトで複製する button_custom-fields: カスタムフィールド button_delete: 削除 button_delete_watcher: ウォッチャーを削除 @@ -101,7 +101,7 @@ ja: button_open_fullscreen: 全画面表示を開く button_show_cards: カードビュー表示 button_show_list: リストビュー表示 - button_show_table: テーブルビューを表示 + button_show_table: テーブル表示 button_show_gantt: ガントビューを表示 button_show_fullscreen: 全画面表示 button_more_actions: その他の操作 @@ -111,7 +111,7 @@ ja: button_uncheck_all: 全てを選択解除 button_update: 更新 button_export-atom: Atomをダウンロード - button_generate_pdf: PDFを生成 + button_generate_pdf: PDF作成 button_create: 作成 card: add_new: 新規カード追加 @@ -145,8 +145,8 @@ ja: description_select_work_package: 'ワークパッケージを選択 #%{id}' description_subwork_package: 'ワークパッケージの子 #%{id}' editor: - revisions: ローカルの変更を表示 - no_revisions: ローカルの変更は見つかりませんでした + revisions: ローカルの修正を表示 + no_revisions: ローカルでの修正は見つからず preview: プレビューモードの切り替え source_code: Markdown ソースモードの切り替え error_saving_failed: '次のエラーで文書を保存するのに失敗しました: %{error}' @@ -159,7 +159,7 @@ ja: attribute_reference: macro_help_tooltip: このテキストセグメントはマクロによって動的にレンダリングされています。 not_found: 要求されたリソースが見つかりませんでした - nested_macro: このマクロは %{model} %{id} を再帰的に参照しています。 + nested_macro: このマクロは %{model} %{id}を再帰的に参照している。 invalid_attribute: 選択した属性 '%{name}' は存在しません。 child_pages: button: 子ページへのリンク @@ -207,10 +207,10 @@ ja: calendar: empty_state_header: 休業日 empty_state_description: 休業日が定義されていません。「休業日を追加」ボタンをクリックして日付を追加してください。 - new_date: "(新規)" + new_date: "(新)" add_non_working_day: 休業日を追加 - already_added_error: この日付の非作業日はすでに存在します。それぞれの日付に1つの非作業日が作成されます。 - change_button: 保存してスケジュールを変更 + already_added_error: この日付の非営業日はすでに存在します。一意の日付に対して作成できる非営業日は1つだけです。 + change_button: 保存して再スケジュール change_title: 営業日を変更する removed_title: 以下の日を非稼働日リストから削除します: change_description: 営業日とみなす曜日を変更すると、このサイト内のすべてのプロジェクトのすべてのワークパッケージの開始日と終了日に影響を与える可能性があります。 @@ -292,14 +292,14 @@ ja: ical_sharing_modal: title: カレンダーを購読する inital_setup_error_message: データ取得中にエラーが発生しました。 - description: URL(iCalendar)を使って外部クライアントでこのカレンダーを購読し、そこから最新のワークパッケージ情報を見ることができます。 - warning: このURLを他のユーザーと共有しないでください。このリンクがあれば、誰でもアカウントやパスワードなしでワークパッケージの詳細を見ることができます。 - token_name_label: どこで使うのですか? + description: URL(iCalendar)を使用して、外部クライアントでこのカレンダーを購読し、そこから最新のワークパッケージ情報を表示することができます。 + warning: このURLを他のユーザーと共有しないでください。このリンクを持つ誰でもアカウントやパスワードなしでワークパッケージの詳細を表示することができます。 + token_name_label: どこで使うのですか?? token_name_placeholder: 名前を入力してください。例:"電話" token_name_description_text: If you subscribe to this calendar from multiple devices, this name will help you distinguish between them in your access tokens list. copy_url_label: URLをコピー - ical_generation_error_text: カレンダー URL の生成中にエラーが発生しました。 - success_message: URL "%{name}" は正常にクリップボードにコピーされました。サブスクリプションを完了するためにカレンダークライアントに貼り付けてください。 + ical_generation_error_text: カレンダーのURL生成時にエラーが発生しました。 + success_message: URL "%{name}" がクリップボードにコピーされました。カレンダークライアントに貼り付けて購読を完了してください。 label_activate: 有効にする label_assignee: 担当者 label_assignee_alt_text: This work package is assigned to %{name} @@ -312,7 +312,7 @@ ja: label_add_row_before: 前に行を追加 label_add_selected_columns: 選択した列を追加 label_added_by: 追加した人 - label_added_time_by: %{author} が %{age} に追加しました + label_added_time_by: 追加 %{author} %{age} label_ago: "○日前" label_all: 全て label_all_projects: すべてのプロジェクト @@ -423,7 +423,7 @@ ja: label_repository_plural: リポジトリ label_resize_project_menu: Resize project menu label_save_as: 名前をつけて保存 - label_search_columns: 列を検索 + label_search_columns: 列を検索する label_select_watcher: ウォッチャーを選択... label_selected_filter_list: 選択されたフィルタ label_show_attributes: すべての属性を表示 @@ -461,8 +461,8 @@ ja: label_watch_work_package: ワークパッケージをウォッチ label_watcher_added_successfully: ウォッチャーが正常に追加されました ! label_watcher_deleted_successfully: ウォッチャーが正常に削除されました ! - label_work_package_details_you_are_here: あなたは %{tab} %{type} %{subject} のタブにいます。 - label_work_package_context_menu: ワークパッケージのコンテキスト メニュー + label_work_package_details_you_are_here: あなたは %{type} %{subject}の %{tab} タブを表示しています。 + label_work_package_context_menu: ワークパッケージのコンテキストメニュー label_unwatch: ウォッチしない label_unwatch_work_package: ワークパッケージのウォッチを削除 label_uploaded_by: アップロードした人 @@ -493,7 +493,7 @@ ja: label_version_plural: バージョン label_view_has_changed: このビューには未保存の変更があります。 クリックすると保存します。 help_texts: - show_modal: ヘルプテキストを表示 + show_modal: ヘルプテキストを表示する onboarding: buttons: skip: スキップ @@ -501,7 +501,7 @@ ja: got_it: 了承 steps: help_menu: ヘルプ(?)メニューは、その他のヘルプリソースを提供します。ここでは、ユーザーガイド、役立つハウツービデオなどを見つけることができます。
OpenProjectでの作業をお楽しみください! - members: 新しい メンバー をプロジェクトに招待します。 + members: 新しいメンバーをプロジェクトに招待する。 quick_add_button: ヘッダーナビゲーションにあるプラス(+)アイコンをクリックして、新規プロジェクトを作成したり、同僚を招待したりできます。 sidebar_arrow: プロジェクトのメインメニューに戻るには、左上の矢印を使います。 welcome: 3分間のイントロダクションツアーで、最も重要な機能を学びましょう。
最後までステップを完了することをお勧めします。ツアーはいつでも再開できます。 @@ -578,12 +578,12 @@ ja: title: 通知設定 pagination: no_other_page: このページだけです。 - pages_skipped: ページがスキップされました。 + pages_skipped: ページスキップ。 page_navigation: ページネーション・ナビゲーション per_page_navigation: ページ毎のアイテム選択 pages: page_number: ページ %{number} - show_per_page: ページあたり %{number} を表示 + show_per_page: ページごとに %{number} placeholders: default: "-" subject: ここにタイトルを入力します @@ -593,7 +593,7 @@ ja: project: autocompleter: label: プロジェクト名の入力補完 - click_to_switch_to_project: 'プロジェクト: %{projectname}' + click_to_switch_to_project: プロジェクト: %{projectname} context: プロジェクトのコンテキスト not_available: プロジェクトなし required_outside_context: 'ワークパッケージを作成するプロジェクトを選択して、すべての属性を確認してください。 上記で有効になっているタイプのプロジェクトのみ選択できます。 @@ -1066,7 +1066,7 @@ ja: toggle_title: ベースライン clear: クリア apply: 適用 - header_description: 過去のいずれかの時点からこのリストに加えられた変更を強調する。 + header_description: 過去の選択した時点からこのリストに加えられた変更をハイライト show_changes_since: 以降の変更を表示する help_description: ベースラインの基準タイムゾーン。 time_description: '現地時間: %{datetime}' diff --git a/config/locales/crowdin/js-no.yml b/config/locales/crowdin/js-no.yml index b9f871b9392..7bf04e6a5af 100644 --- a/config/locales/crowdin/js-no.yml +++ b/config/locales/crowdin/js-no.yml @@ -109,7 +109,7 @@ button_save: Lagre button_settings: Innstillinger button_uncheck_all: Avmerk alle - button_update: Oppdater + button_update: Oppdatèr button_export-atom: Last ned Atom button_generate_pdf: Generate PDF button_create: Opprett diff --git a/config/locales/crowdin/js-ro.yml b/config/locales/crowdin/js-ro.yml index d1ed58b8699..46f0c3973ff 100644 --- a/config/locales/crowdin/js-ro.yml +++ b/config/locales/crowdin/js-ro.yml @@ -109,7 +109,7 @@ ro: button_save: Salvează button_settings: Setări button_uncheck_all: Deselectează tot - button_update: Actualizează + button_update: Actualizare button_export-atom: Descarcă Atom button_generate_pdf: Generează PDF button_create: Creează diff --git a/config/locales/crowdin/js-ru.yml b/config/locales/crowdin/js-ru.yml index 25032b4e9a7..76f0dfabfc1 100644 --- a/config/locales/crowdin/js-ru.yml +++ b/config/locales/crowdin/js-ru.yml @@ -109,7 +109,7 @@ ru: button_save: Сохранить button_settings: Настройки button_uncheck_all: Снять все отметки - button_update: Обновить + button_update: Обновление button_export-atom: Скачать Atom button_generate_pdf: Создать PDF button_create: Создать diff --git a/config/locales/crowdin/js-vi.yml b/config/locales/crowdin/js-vi.yml index 52f2a912497..af19690a54a 100644 --- a/config/locales/crowdin/js-vi.yml +++ b/config/locales/crowdin/js-vi.yml @@ -109,7 +109,7 @@ vi: button_save: lưu lại button_settings: cài đặt button_uncheck_all: Bỏ chọn tất cả - button_update: cập nhật + button_update: Cập Nhật button_export-atom: Tải xuống nguyên tử button_generate_pdf: Tạo PDF button_create: Tạo mới diff --git a/config/locales/crowdin/ro.yml b/config/locales/crowdin/ro.yml index 7771ed3de16..4ad40084690 100644 --- a/config/locales/crowdin/ro.yml +++ b/config/locales/crowdin/ro.yml @@ -4031,7 +4031,7 @@ ro: label_duplicated_by: dublat de label_duplicate: duplicat label_duplicates: dublează - label_edit: Editează + label_edit: Editare label_edit_x: 'Editare: %{x}' label_view_x: 'View: %{x}' label_enable_multi_select: Comutare selecție multiplă @@ -4088,7 +4088,7 @@ ro: label_global_roles: Roluri globale label_git_path: Calea catre directorul .git label_greater_or_equal: ">=" - label_group_by: Grupează după + label_group_by: Grupare după label_group_new: Grupare nouă label_group: Grup label_group_named: Grup %{name} diff --git a/config/locales/crowdin/sl.yml b/config/locales/crowdin/sl.yml index 37506b51745..e3ddcd5c171 100644 --- a/config/locales/crowdin/sl.yml +++ b/config/locales/crowdin/sl.yml @@ -3070,8 +3070,8 @@ sl: - avgust - september - oktober - - november - - december + - November + - December order: - :leto - :mesec diff --git a/config/locales/crowdin/uk.yml b/config/locales/crowdin/uk.yml index e7322dd4189..b099801e660 100644 --- a/config/locales/crowdin/uk.yml +++ b/config/locales/crowdin/uk.yml @@ -4179,7 +4179,7 @@ uk: label_index_by_title: Індекс за назвою label_information: Інформація label_information_plural: Інформація - label_installation_guides: Інструкції із встановлення + label_installation_guides: Інструкції зі встановлення label_integer: Ціле число label_interface: Інтерфейс label_internal: Власне diff --git a/config/locales/crowdin/vi.yml b/config/locales/crowdin/vi.yml index 7b750a8207d..e9635e7cfdd 100644 --- a/config/locales/crowdin/vi.yml +++ b/config/locales/crowdin/vi.yml @@ -2626,7 +2626,7 @@ vi: base: 'Lỗi tổng quan:' body: cơ thể category: thể loại - comment: bình luận + comment: Nhận xét comments: bình luận content: Nội dung color: màu sắc @@ -4344,7 +4344,7 @@ vi: label_used_by: Được dùng bởi label_used_by_types: Được sử dụng bởi các loại label_used_in_projects: Được sử dụng trong các dự án - label_user: người dùng + label_user: Người dùng label_user_and_permission: Người dùng và quyền label_user_named: Người dùng %{name} label_user_activity_html: "%{value}'s activity" diff --git a/config/locales/crowdin/zh-CN.seeders.yml b/config/locales/crowdin/zh-CN.seeders.yml index 30e63f026bc..212a0e3692c 100644 --- a/config/locales/crowdin/zh-CN.seeders.yml +++ b/config/locales/crowdin/zh-CN.seeders.yml @@ -97,7 +97,7 @@ zh-CN: demo-project: name: 演示项目 status_explanation: 所有任务都按计划进行。相关人员均知晓各自任务。系统已完全建立。 - description: 这是对此演示 Scrum 项目目标的简短摘要。 + description: 这是对此演示项目目标的简短摘要。 news: item_0: title: 欢迎来到您的演示项目 @@ -201,7 +201,7 @@ zh-CN: scrum-project: name: Scrum 项目 status_explanation: 所有任务都按计划进行。相关人员均知晓各自任务。系统已完全建立。 - description: 这是对此演示 Scrum 项目目标的简短摘要。 + description: 这是对此演示Scrum项目目标的简短摘要。 news: item_0: title: 欢迎来到您的 Scrum 演示项目 diff --git a/config/locales/crowdin/zh-CN.yml b/config/locales/crowdin/zh-CN.yml index 706e0d6c36e..b5600133381 100644 --- a/config/locales/crowdin/zh-CN.yml +++ b/config/locales/crowdin/zh-CN.yml @@ -108,7 +108,7 @@ zh-CN: token_caption: 要详细了解如何激活企业版,请查阅我们的[文档](docs_url)。 add_token: 上传企业版支持令牌 replace_token: 替换您当前的支持令牌 - order: 订购本地部署版的 Enterprise edition + order: 订购本地部署的 Enterprise edition paste: 粘贴您企业版的支持令牌 required_for_feature: 此功能仅限具激活的企业版支持令牌的订阅者使用。 enterprise_link: 如需了解详细信息,请单击此处。 @@ -1763,7 +1763,7 @@ zh-CN: page: 页 row_count: 行数 column_count: 列数 - widgets: 微件 + widgets: 小部件 journal: notes: 备注 cause_type: Cause 类型 @@ -4257,7 +4257,7 @@ zh-CN: label_revision_id: 修订版本 %{value} label_revision_plural: 修订 label_roadmap: 路线图 - label_roadmap_edit: 编辑路线图%{name} + label_roadmap_edit: 编辑路线图 %{name} label_roadmap_due_in: "%{value} 到期" label_roadmap_no_work_packages: 该版本没有工作包。 label_roadmap_overdue: "%{value} 超时" @@ -5021,7 +5021,7 @@ zh-CN: managed: 在 OpenProject 中创建新的存储库 storage: not_available: 磁盘存储开销不可用于此存储库。 - update_timeout: 在 N 分钟内保留存储库最后所需的磁盘空间信息。由于计算存储库所需的磁盘空间可能增加系统开销,增加该值可以减少性能影响。 + update_timeout: 在 N 分钟内保留存储库最后所需磁盘空间的信息。由于计算存储库所需的磁盘空间可能增加系统开销,增加该值可以减少性能影响。 oauth_application_details_html: 关闭此窗口后,将无法再次访问客户端密钥值。请将这些值复制到 Nextcloud OpenProject 集成设置中: oauth_application_details_link_text: 转到设置页面 setup_documentation_details: 如果您在配置新文件存储方面需要帮助,请查看文档: @@ -5252,7 +5252,7 @@ zh-CN: setting_session_ttl_hint: 当设置的值低于5时,其作用类似于禁用。 setting_session_ttl_enabled: 会话过期 setting_start_of_week: 一周起始日 - setting_sys_api_enabled: 启用存储库管理网页服务 + setting_sys_api_enabled: 启用版本库管理 web 服务 setting_sys_api_description: 存储库管理网页服务提供了集成的,用户授权的存储库访问。 setting_time_format: 时间 setting_total_percent_complete_mode: 计算 完成% 层次结构总数 @@ -5739,7 +5739,7 @@ zh-CN: warning_user_limit_reached_admin_html: '添加额外的用户将超出当前限值。请[升级您的方案](upgrade_url),以确保外部用户能够访问此实例。 ' - warning_user_limit_reached_instructions: '您已达到用户限制(%{current}/%{max} 活跃用户)。请联系 sales@openproject.com 升级您的企业版计划以添加额外用户。 + warning_user_limit_reached_instructions: '您达到了用户限制(%{current}/%{max}活跃用户)。 请联系sales@openproject.com以升级您的Enterprise edition计划并添加其他用户。 ' warning_protocol_mismatch_html: '' diff --git a/config/locales/crowdin/zh-TW.yml b/config/locales/crowdin/zh-TW.yml index ccf2ea2095e..17425305050 100644 --- a/config/locales/crowdin/zh-TW.yml +++ b/config/locales/crowdin/zh-TW.yml @@ -3939,7 +3939,7 @@ zh-TW: label_filter_add: 新增條件 label_filter_by: 篩選條件: label_filter_any_name_attribute: 名稱屬性 - label_filter_plural: 篩選條件 + label_filter_plural: 篩選器 label_filters_toggle: 顯示/隱藏篩選條件 label_float: 浮點數 label_folder: 資料夾 @@ -3953,8 +3953,8 @@ zh-TW: label_global_modules: 全域模組 label_global_roles: 全域角色 label_git_path: ".git 目錄的路徑" - label_greater_or_equal: 之前 - label_group_by: 分類 + label_greater_or_equal: ">=" + label_group_by: 分組依據 label_group_new: 新增群組 label_group: 群組 label_group_named: 群組名稱 %{name} @@ -3966,7 +3966,7 @@ zh-TW: label_hierarchy: 階層 label_hierarchy_leaf: 頁面結構頁 label_home: Home - label_subject_or_id: 名稱或 id + label_subject_or_id: 主旨或 id label_calendar_subscriptions: 訂閱行事曆 label_identifier: 識別碼 label_project_identifier: Project identifier @@ -4018,7 +4018,7 @@ zh-TW: label_latest_revision_plural: 最新版本 label_ldap_authentication: LDAP 認證 label_learn_more: 了解更多 - label_less_or_equal: 之後 + label_less_or_equal: "<=" label_less_than_ago: 幾天內 label_link_url: 連結(URL) label_list: 清單 diff --git a/modules/backlogs/config/locales/crowdin/ro.yml b/modules/backlogs/config/locales/crowdin/ro.yml index 4fe09d03959..85973aa9490 100644 --- a/modules/backlogs/config/locales/crowdin/ro.yml +++ b/modules/backlogs/config/locales/crowdin/ro.yml @@ -42,7 +42,7 @@ ro: completed: Completed work_package: backlog_bucket: Backlog Bucket - backlogs_work_package_type: Tipul de restante + backlogs_work_package_type: Tip restanță position: Poziție sprint: Sprint story_points: Puncte diff --git a/modules/backlogs/config/locales/crowdin/zh-TW.yml b/modules/backlogs/config/locales/crowdin/zh-TW.yml index 97b6cf28ec8..10a4474311b 100644 --- a/modules/backlogs/config/locales/crowdin/zh-TW.yml +++ b/modules/backlogs/config/locales/crowdin/zh-TW.yml @@ -22,7 +22,7 @@ --- zh-TW: plugin_openproject_backlogs: - name: OpenProject待辦事項 + name: OpenProject代辦事項 description: 此模組新增了讓敏捷團隊能夠在 Scrum 專案中使用 OpenProject 的功能。 activerecord: attributes: diff --git a/modules/bim/config/locales/crowdin/fr.yml b/modules/bim/config/locales/crowdin/fr.yml index 529f2ca740e..1ade8938eb1 100644 --- a/modules/bim/config/locales/crowdin/fr.yml +++ b/modules/bim/config/locales/crowdin/fr.yml @@ -61,7 +61,7 @@ fr: perform_description: Voulez-vous importer ou mettre à jour les problèmes repris ci-dessus ? replace_with_system_user: Les remplacer par l'utilisateur "Système" import_as_system_user: Les importer comme utilisateur "Système". - what_to_do: Que voulez-vous faire ? + what_to_do: Que voulez-vous faire? work_package_has_newer_changes: Obsolète ! Ce sujet n'a pas été mis à jour, car les derniers changements sur le serveur étaient plus récents que la "ModifiedDate" du sujet importé. Toutefois, les commentaires sur le sujet ont été importés. bcf_file_not_found: Impossible de localiser le fichier BCF. Veuillez recommencer le processus de téléversement. export: diff --git a/modules/budgets/config/locales/crowdin/cs.yml b/modules/budgets/config/locales/crowdin/cs.yml index e240588db21..12dc81fd057 100644 --- a/modules/budgets/config/locales/crowdin/cs.yml +++ b/modules/budgets/config/locales/crowdin/cs.yml @@ -28,7 +28,7 @@ cs: budget: author: Autor available: Dostupné - budget: Plánované + budget: Rozpočet budget_ratio: Stráveno (poměr) description: Popis spent: Strávený čas diff --git a/modules/costs/config/locales/crowdin/de.yml b/modules/costs/config/locales/crowdin/de.yml index 4b7c160a5f7..32cd4c72138 100644 --- a/modules/costs/config/locales/crowdin/de.yml +++ b/modules/costs/config/locales/crowdin/de.yml @@ -210,7 +210,7 @@ de: setting_costs_currency_format_prefix: Vor der Zahl (z.B. EUR 100) setting_costs_currency_format_suffix: Nach der Zahl (z.B. 100 EUR) setting_enforce_tracking_start_and_end_times: Start- und Endzeiten erforderlich - setting_enforce_without_allow: Start- und Endzeiten können nicht verpflichtend erfasst werden, ohne die Erfassung zu erlauben + setting_enforce_without_allow: Start und Endzeiten können nur erforderlich sein, wenn ihre Angabe erlaubt ist setting_allow_tracking_start_and_end_times_caption: Erlaubt es bei der Zeitbuchung die genaue Start- und Endzeiten der Buchung zu erfassen. setting_enforce_tracking_start_and_end_times_caption: Erfordert, dass bei Zeitbuchungen genaue Start- und Endzeiten erfasst werden. text_assign_time_and_cost_entries_to_project: Gebuchte Aufwände dem Projekt zuweisen diff --git a/modules/costs/config/locales/crowdin/ja.yml b/modules/costs/config/locales/crowdin/ja.yml index f1a7bca669d..8b331f5b24c 100644 --- a/modules/costs/config/locales/crowdin/ja.yml +++ b/modules/costs/config/locales/crowdin/ja.yml @@ -208,7 +208,7 @@ ja: setting_enforce_tracking_start_and_end_times: 開始/終了時間を必須とする setting_enforce_without_allow: 開始時間と終了時間を要求することは許可されていないとできません setting_allow_tracking_start_and_end_times_caption: 時間を記録する際に、開始時間と終了時間を入力できるようにする。 - setting_enforce_tracking_start_and_end_times_caption: 時間を記録する際、開始時間と終了時間の入力を必須にします。 + setting_enforce_tracking_start_and_end_times_caption: 時間を記録する際、開始時間と終了時間の入力が必須となる。 text_assign_time_and_cost_entries_to_project: 報告された時間とコストをプロジェクトに割り当てる text_destroy_cost_entries_question: 削除しようとしているワークパッケージが%{cost_entries} 件報告されました。どうしますか? text_destroy_time_and_cost_entries: 報告された時間とコストを削除する diff --git a/modules/ldap_groups/config/locales/crowdin/zh-CN.yml b/modules/ldap_groups/config/locales/crowdin/zh-CN.yml index 9063cf1400d..24da65b9bc8 100644 --- a/modules/ldap_groups/config/locales/crowdin/zh-CN.yml +++ b/modules/ldap_groups/config/locales/crowdin/zh-CN.yml @@ -7,7 +7,7 @@ zh-CN: description: 与 OpenProject 组同步 LDAP 组以管理用户,更改他们的权限以便不同组的用户管理。 plugin_openproject_ldap_groups: name: OpenProject LDAP 组 - description: LDAP组成员同步。 + description: LDAP 组成员同步。 activerecord: attributes: ldap_groups/synchronized_group: diff --git a/modules/ldap_groups/config/locales/crowdin/zh-TW.yml b/modules/ldap_groups/config/locales/crowdin/zh-TW.yml index c54e53b8c8e..83c91011b08 100644 --- a/modules/ldap_groups/config/locales/crowdin/zh-TW.yml +++ b/modules/ldap_groups/config/locales/crowdin/zh-TW.yml @@ -16,7 +16,7 @@ zh-TW: ldap_auth_source: LDAP 連線 sync_users: 同步使用者 ldap_groups/synchronized_filter: - filter_string: LDAP篩選條件 + filter_string: 簡約登入目錄制約(LDAP)篩選 auth_source: 驗證來源 ldap_auth_source: LDAP 連線 group_name_attribute: 群組名字屬性 diff --git a/modules/meeting/config/locales/crowdin/cs.yml b/modules/meeting/config/locales/crowdin/cs.yml index 561b8e13119..3476a4a2e9e 100644 --- a/modules/meeting/config/locales/crowdin/cs.yml +++ b/modules/meeting/config/locales/crowdin/cs.yml @@ -593,7 +593,7 @@ cs: ' permission_edit_meetings: Upravit schůzku - permission_delete_meetings: Odstranit schůzky + permission_delete_meetings: Smazat schůzku permission_view_meetings: Zobrazit schůzky permission_manage_agendas: Správa zápisů permission_manage_agendas_explanation: Allows creating, editing and removing agenda items diff --git a/modules/meeting/config/locales/crowdin/de.yml b/modules/meeting/config/locales/crowdin/de.yml index bff41687ec1..2512590c3a5 100644 --- a/modules/meeting/config/locales/crowdin/de.yml +++ b/modules/meeting/config/locales/crowdin/de.yml @@ -23,8 +23,8 @@ --- de: plugin_openproject_meeting: - name: OpenProject Besprechung - description: Besprechungen für OpenProject + name: OpenProject Besprechungen + description: Dieses Modul fügt Funktionen zur Unterstützung von Besprechungen zu OpenProject hinzu. Sie können Besprechungen planen und dabei Teilnehmende aus demselben Projekt auswählen, die an der Besprechung teilnehmen sollen. Es kann eine Tagesordnung erstellt und an die Eingeladenen gesendet werden. Nach der Besprechung können die Teilnehmenden ausgewählt und Protokolle auf der Grundlage der Tagesordnung erstellt werden. Schließlich kann das Protokoll an alle Teilnehmenden und Eingeladenen gesendet werden. activerecord: attributes: meeting: @@ -93,7 +93,7 @@ de: section_not_belong_to_meeting: Die Sektion gehört nicht zur gleichen Besprechung. user_invalid: ist kein gültiger Teilnehmer. recurring_meeting_interim_response: - not_an_occurrence: ist keine gültige Uhrzeit für diese wiederkehrende Besprechung + not_an_occurrence: ist keine gültige Uhrzeit für dieses wiederkehrende Treffen recurring_meeting: must_cover_existing_meetings: one: Es gibt eine offene Besprechung in der Terminserie, die nicht durch den neuen Zeitplan abgedeckt ist. Passen Sie den Zeitplan an, um alle bestehenden Meetings einzuschließen. diff --git a/modules/meeting/config/locales/crowdin/ja.yml b/modules/meeting/config/locales/crowdin/ja.yml index 749f964f3cf..7cdd3fc9b59 100644 --- a/modules/meeting/config/locales/crowdin/ja.yml +++ b/modules/meeting/config/locales/crowdin/ja.yml @@ -272,7 +272,7 @@ ja: summary_occurrence: An occurrence of '%{title}' has been cancelled by %{actor}, or you have been removed as a participant summary_series: Meeting series '%{title}' has been cancelled by %{actor}, or you have been removed as a participant summary: "'%{title}' has been cancelled by %{actor}, or you have been removed as a participant" - date_time: 予定日時 + date_time: スケジュールされた日時 ended: header_series: 'Ended: Meeting series ''%{title}''' summary_series: Meeting series '%{title}' has been ended by %{actor} @@ -312,7 +312,7 @@ ja: occurrence: title: 会議のキャンセル heading: この会議をキャンセルしますか? - confirmation_message_html: 'テンプレートにない会議情報は失われます。 続行しますか? + confirmation_message_html: 'テンプレートにない会議情報は失われます。 続けますか? ' confirm_button: 発生をキャンセル @@ -555,7 +555,7 @@ ja: confirm_button: この予定をキャンセル end_series_dialog: title: 一連の会議を終了 - notice_successful_notification: 参加者全員にカレンダー更新の電子メールを送信 + notice_successful_notification: すべての出席者にカレンダーの更新をメールしました notice_meeting_template_created: Template successfully created notice_timezone_missing: タイムゾーンが設定されていない場合、%{zone} が使用されます。タイムゾーンを選択するには、ここをクリックしてください。 notice_meeting_updated: このページは他の誰かによって更新されました。変更を表示するには再読み込みしてください。 @@ -640,7 +640,7 @@ ja: ' label_agenda_backlog_clear_title: 議題のバックログをクリアしますか? - text_agenda_backlog_clear_description: '現在アジェンダバックログにあるすべての項目を削除してもよろしいですか?このアクションは元に戻せません。 + text_agenda_backlog_clear_description: '議題のバックログ内のすべての項目を削除してもよろしいですか?この操作は取り消せません。 ' label_series_backlog: シリーズバックログ @@ -676,7 +676,7 @@ ja: text_meeting_closed_description: この会議は終了しています。これ以上、議題項目の追加/削除はできません。 text_meeting_in_progress_description: 議題を変更したり、各項目のアウトカムを記録したり、参加者の出席を追跡することができます。 会議が完了すると、会議をクローズとしてマークしてロックできます。 text_meeting_open_dropdown_description: 既存の結果は残りますが、ユーザーは新しい結果を追加することはできません。 - text_meeting_in_progress_dropdown_description: 会議中に必要な情報や決定事項などの成果を文書化する。 + text_meeting_in_progress_dropdown_description: 会議中に取られた情報のニーズや意思決定などの成果を記録します。 text_meeting_closed_dropdown_description: この会議は終了しました。これ以上、議題や結果を変更することはできません。 text_meeting_draft_banner: 現在下書きモードです。 会議の詳細を変更したり出席者を追加/削除したりしても,この会議はカレンダーの更新や招待状を送信しません。 text_onetime_meeting_template_banner: You are currently editing a meeting template. You can use this template to create one-time meetings with a predefined agenda. Changes will not affect already-created meetings. diff --git a/modules/reporting/config/locales/crowdin/ro.yml b/modules/reporting/config/locales/crowdin/ro.yml index 44c763a7a16..6948e28b90a 100644 --- a/modules/reporting/config/locales/crowdin/ro.yml +++ b/modules/reporting/config/locales/crowdin/ro.yml @@ -71,7 +71,7 @@ ro: label_filter: Filtrează label_filter_add: Adaugă filtru label_filter_plural: Filtre - label_group_by: Grupează după + label_group_by: Grupare după label_group_by_add: Adaugă atributul Grupează-după label_inactive: Inactiv label_no: Nu diff --git a/modules/reporting/config/locales/crowdin/vi.yml b/modules/reporting/config/locales/crowdin/vi.yml index 96f207fdf55..3e12aa977f0 100644 --- a/modules/reporting/config/locales/crowdin/vi.yml +++ b/modules/reporting/config/locales/crowdin/vi.yml @@ -74,7 +74,7 @@ vi: label_group_by: Nhóm theo label_group_by_add: Thêm thuộc tính theo nhóm label_inactive: "«không hoạt động»" - label_no: không + label_no: Không label_none: "(không có dữ liệu)" label_no_reports: Chưa có báo cáo chi phí. label_report: Báo cáo diff --git a/modules/reporting/config/locales/crowdin/zh-TW.yml b/modules/reporting/config/locales/crowdin/zh-TW.yml index 3bfe7515afd..232cc7de50e 100644 --- a/modules/reporting/config/locales/crowdin/zh-TW.yml +++ b/modules/reporting/config/locales/crowdin/zh-TW.yml @@ -54,7 +54,7 @@ zh-TW: label_money: 金額 label_month_reporting: 月 label_new_report: 新建成本報表 - label_open: 開啟 + label_open: 開啟中 label_operator: 操作員 label_private_report_plural: 私密成本報告 label_progress_bar_explanation: 產生報告中... @@ -71,7 +71,7 @@ zh-TW: label_filter: 篩選條件 label_filter_add: 新增篩選條件 label_filter_plural: 篩選條件 - label_group_by: 分類 + label_group_by: 分組依據 label_group_by_add: 新增群組欄位 label_inactive: "«不活動»" label_no: 否 diff --git a/modules/storages/config/locales/crowdin/ja.yml b/modules/storages/config/locales/crowdin/ja.yml index 6292761c541..a4f132a63da 100644 --- a/modules/storages/config/locales/crowdin/ja.yml +++ b/modules/storages/config/locales/crowdin/ja.yml @@ -19,7 +19,7 @@ ja: token_exchange_scope: ストレージスコープ storages/project_storage: project_folder: プロジェクトフォルダ - project_folder_mode: プロジェクトフォルダーモード + project_folder_mode: プロジェクトフォルダモード storage: ストレージ storage_url: ストレージURL storages/sharepoint_storage: @@ -30,53 +30,53 @@ ja: storages/storage: authentication_method: 認証方法 creator: 作成者 - drive: ドライブID + drive: ドライブ ID host: ホスト name: 名称 password: アプリケーションのパスワード - provider_type: プロバイダー・タイプ - tenant: ディレクトリ(テナント)ID + provider_type: プロバイダーの種類 + tenant: ディレクトリ (テナント) ID errors: messages: invalid_host_url: は有効な URL ではありません。 - invalid_sharepoint_url: は有効なSharePointサイト、ライブラリ、ドキュメントのURLではありません。 - not_linked_to_project: はプロジェクトにリンクされていない。 + invalid_sharepoint_url: は有効なSharePointサイト、ライブラリ、またはドキュメントのURLではありません。 + not_linked_to_project: はプロジェクトにリンクされていません。 models: storages/file_link: attributes: origin_id: - only_numeric_or_uuid: には数値かuuidしか指定できない。 + only_numeric_or_uuid: は数値またはuuidのみとなります。 storages/project_storage: attributes: project_folder_id: blank: フォルダーを選択してください。 project_folder_mode: - mode_unavailable: はこのストレージでは使用できない。 + mode_unavailable: このストレージでは使用できません。 project_ids: blank: プロジェクトを選択してください。 storages/storage: attributes: host: - authorization_header_missing: が完全にセットアップされていません。APIリクエストのベアラートークンベースの認証に必要な "Authorization "ヘッダーをNextcloudインスタンスが受け取っていません。HTTPサーバーの設定を再度ご確認ください。 - cannot_be_connected_to: に到達できませんでした。ホストに到達可能で、OpenProject 統合アプリがインストールされていることを確認してください。 - minimal_nextcloud_version_unmet: 最小バージョン要件を満たしていない(Nextcloud 23以上である必要があります。) - not_nextcloud_server: はNextcloudサーバーではありません。 - op_application_not_installed: は、アプリ「OpenProject integration」がインストールされていないようです。インストールしてからもう一度お試しください。 + authorization_header_missing: 完全には設定されていません。 Nextcloudインスタンスは、APIリクエストのベアラートークンベースの認可に必要な「Authorization」ヘッダーを受け取りません。 HTTPサーバーの設定を再確認してください。 + cannot_be_connected_to: に到達できませんでした。ホストが到達可能で、OpenProject 統合アプリがインストールされていることを確認してください。 + minimal_nextcloud_version_unmet: 最小バージョン要件を満たしていません(Nextcloud23以上でなければなりません) + not_nextcloud_server: はNextcloudサーバーではありません + op_application_not_installed: アプリ「OpenProject統合」がインストールされていません。最初にインストールしてからもう一度お試しください。 password: - invalid_password: は無効である。 + invalid_password: は無効です。 unknown_error: could not be validated with the file storage provider. Please verify that the connection is functioning properly. models: file_link: ファイル storages/storage: ストレージ api_v3: errors: - too_many_elements_created_at_once: 一度に作成される要素が多すぎる。最大でも %{max} 、 %{actual}。 + too_many_elements_created_at_once: 一度に作成された要素が多すぎます。 %{max} の期待値は %{actual} です。 external_file_storages: 外部ファイルストレージ permission_create_files: '自動的に管理されたプロジェクトフォルダ: ファイルの作成' permission_create_files_explanation: この権限はNextcloudストレージでのみ利用できます permission_delete_files: '自動的に管理されたプロジェクトフォルダ: ファイルの削除' permission_delete_files_explanation: この権限はNextcloudストレージでのみ利用できます - permission_header_for_project_module_storages: 自動的に管理されるプロジェクトフォルダ + permission_header_for_project_module_storages: 自動的に管理されたプロジェクトフォルダ permission_manage_file_links: ファイルへのリンク管理 permission_manage_files_in_project: プロジェクト内のファイル管理 permission_read_files: '自動的に管理されたプロジェクトフォルダ: ファイルの読み込み' @@ -87,16 +87,16 @@ ja: project_module_storages: ファイルを添付する project_storages: edit_project_folder: - label: プロジェクトフォルダの編集 + label: プロジェクトフォルダを編集 open: - contact_admin: このエラーを解決するには、管理者に連絡してください。 - remote_identity_error: ストレージへの接続中に予期せぬエラーが発生しました。 + contact_admin: このエラーを解決するには管理者に問い合わせてください。 + remote_identity_error: ストレージへの接続中に予期しないエラーが発生しました。 project_folder_mode: - automatic: 自動的に管理される - inactive: 特定のフォルダなし + automatic: 自動的に管理 + inactive: 特定のフォルダがありません manual: 既存のフォルダを手動で管理 remove_project: - deletion_failure_flash: ストレージからのプロジェクトの削除に失敗しました。 %{error} + deletion_failure_flash: プロジェクトをストレージから削除できませんでした。 %{error} label: プロジェクトを削除 services: attributes: @@ -111,7 +111,7 @@ ja: one_drive_sync_service: create_folder: プロジェクトフォルダの作成を管理: ensure_root_folder_permissions: ベースフォルダの権限を設定: - hide_inactive_folders: 非アクティブフォルダを隠す ステップ: + hide_inactive_folders: 非アクティブフォルダを隠す ステップ remote_folders: 'Read contents of the drive root folder:' rename_project_folder: 管理プロジェクトフォルダの名前を変更します: sharepoint_sync_service: @@ -122,16 +122,16 @@ ja: rename_project_folder: 管理プロジェクトフォルダの名前を変更します: errors: messages: - error: 予期しないエラーが発生しました。OpenProject のログを確認するか、管理者に連絡してください + error: 予期しないエラーが発生しました。OpenProject のログを確認するか、管理者に連絡してください。 forbidden: OpenProject could not access the requested resource. Please check your permissions configuration on the Storage Provider. unauthorized: OpenProjectはストレージプロバイダと認証できませんでした。アクセスできることを確認してください。 models: copy_project_folders_service: conflict: フォルダ %{destination_path} は既に存在する。上書きを避けるために処理を中断しています。 - error: 予期しないエラーが発生しました。OpenProject のログを確認するか、管理者に連絡してください - forbidden: OpenProject はソースフォルダにアクセスできませんでした。ストレージ・プロバイダの権限設定を確認してください + error: 予期しないエラーが発生しました。OpenProject のログを確認するか、管理者に連絡してください。 + forbidden: OpenProject はソースフォルダにアクセスできませんでした。ストレージ・プロバイダの権限設定を確認してください。 not_found: ソース・テンプレートの場所 %{source_path} が見つかりませんでした。 - unauthorized: OpenProject はストレージプロバイダと認証できませんでした。ストレージの設定を確認してください + unauthorized: OpenProject はストレージプロバイダと認証できませんでした。ストレージの設定を確認してください。 nextcloud_sync_service: attributes: add_user_to_group: @@ -152,31 +152,31 @@ ja: conflict: 以下の理由により、 %{user} のユーザーを %{group} グループから削除できませんでした: %{reason} failed_to_remove: 以下の理由により、 %{user} のユーザーを %{group} グループから削除できませんでした: %{reason} rename_project_folder: - conflict: OpenProjectは、同じ名前のフォルダが既に存在するため、プロジェクトフォルダの名前を %{current_path} に変更できませんでした - forbidden: OpenProject ユーザーは %{current_path} フォルダにアクセスできません。 - not_found: "%{current_path} は見つからなかった。" + conflict: OpenProjectは、同じ名前のフォルダが既に存在するため、プロジェクトフォルダの名前を %{current_path} に変更できませんでした。 + forbidden: OpenProjectユーザーは %{current_path} フォルダにアクセスできません。 + not_found: "%{current_path} は見つかりませんでした。" set_folders_permissions: - permission_not_set: "%{path}にパーミッションを設定できなかった。" - error: 予期しないエラーが発生しました。Nextcloud インスタンスに到達可能であることを確認し、OpenProject ワーカーのログを確認してください + permission_not_set: "%{path} に権限を設定できませんでした。" + error: 予期しないエラーが発生しました。Nextcloudインスタンスがアクセス可能であることを確認し、詳細についてはOpenProjectワーカーログを確認してください。 group_does_not_exist: "%{group} は存在しません。Nextcloudインスタンスの設定を確認してください。" - insufficient_privileges: OpenProjectには、 %{group}に %{user} を追加するのに十分な権限がありません。Nextcloudのグループ設定を確認してください。 - not_allowed: ネクストクラウドはリクエストをブロックする。 + insufficient_privileges: OpenProjectには %{user} を %{group}に追加するための十分な権限がありません。Nextcloudでグループ設定を確認してください。 + not_allowed: Nextcloudはリクエストをブロックします。 not_found: OpenProject could not find the file on the Nextcloud Storage Provider. Please check if it wasn't deleted. unauthorized: OpenProjectがNextcloudと同期できませんでした。ストレージとNextcloudの設定を確認してください。 - user_does_not_exist: "%{user} はNextcloudには存在しません。" + user_does_not_exist: Nextcloudには%{user} は存在しません。 one_drive_sync_service: attributes: create_folder: - conflict: "%{folder_name} はすでに %{parent_location}に存在している。" - not_found: "%{parent_location} は見つからなかった。" + conflict: "%{folder_name} は %{parent_location} に既に存在します。" + not_found: "%{parent_location} は見つかりませんでした。" hide_inactive_folders: - permission_not_set: "%{path}にパーミッションを設定できなかった。" + permission_not_set: "%{path} に権限を設定できませんでした。" remote_folders: - request_error: OpenProject は %{drive_id}ドライブにアクセスできませんでした。ストレージの設定が正しいかどうか確認してください。 + request_error: OpenProjectがドライブ %{drive_id}にアクセスできませんでした。ストレージの設定が正しいか確認してください。 rename_project_folder: conflict: OpenProject could not rename the folder %{current_path} to %{project_folder_name} as a folder with the same name already exists. - forbidden: OpenProject は、 %{current_path} にアクセスできず、名前を変更できません。 - not_found: "%{current_path} は見つからなかった。" + forbidden: OpenProject は名前を変更するために %{current_path} にアクセスできません。 + not_found: "%{current_path} は見つかりませんでした。" set_folders_permissions: permission_not_set: "%{path} に権限を設定できませんでした。" error: An unexpected error occurred. Please ensure that OneDrive is reachable and check OpenProject worker logs for more information. @@ -311,9 +311,9 @@ ja: drive_id_format: ドライブIDフォーマット header: 構成 host: ホスト URL - host_url_accessible: アクセス可能なホストURL + host_url_accessible: ホスト URL アクセス storage_configured: 設定完了 - tenant_id: テナントID + tenant_id: Tenant ID errors: client_id_invalid: The configured OAuth 2 client id is invalid. Please check the configuration. client_secret_invalid: The configured OAuth 2 client secret is invalid. Please check the configuration. @@ -361,51 +361,51 @@ ja: label_error: エラー label_healthy: 健康的 label_pending: 保留中 - no_report: 報告書なし - no_report_description: 今すぐチェックを実行し、このファイル・ストレージの完全な健全性ステータスをレポートする。 + no_report: 利用可能なレポートがありません + no_report_description: 今すぐこのファイルストレージの完全な健康状態レポートを確認します。 open_report: 完全な健康報告を開く project_folders: subtitle: 自動的に管理されるプロジェクトフォルダ - since: "%{datetime}より" + since: "%{datetime} 以降" synced: 'Last sync: %{datetime}' - title: 健康状態報告 + title: 健康状態レポート health_email_notifications: description_disabled: 管理者は、重要なアップデートがあった場合、メールでアップデートを受け取ることはできません。 description_enabled: 管理者は、重要なアップデートがあった場合、メールで最新情報を受け取ります。 - error_could_not_be_saved: 電子メール通知の設定を保存できませんでした。もう一度お試しください。 + error_could_not_be_saved: メール通知設定を保存できませんでした。もう一度やり直してください。 title: 管理者にメールで更新する help_texts: - project_folder: プロジェクトフォルダは、このプロジェクトのファイルアップロード用のデフォルトフォルダです。それでも、ユーザーは他の場所にファイルをアップロードすることができます。 - project_folder_bulk: プロジェクトフォルダは、選択したすべてのプロジェクトのファイルアップロード用のデフォルトフォルダです。これは、各プロジェクト設定で個別に変更できます。それでも、ユーザーは他の場所にファイルをアップロードすることができます。 + project_folder: プロジェクトフォルダは、このプロジェクトのファイルアップロードのデフォルトフォルダです。ただし、ユーザーは他の場所にファイルをアップロードすることができます。 + project_folder_bulk: プロジェクトフォルダは、選択したすべてのプロジェクトのファイルアップロードのデフォルトフォルダです。 プロジェクトごとの設定で個別に変更することができますが、ユーザーは別の場所にファイルをアップロードすることもできます。 instructions: - all_available_storages_already_added: 利用可能なすべてのストレージはすでにプロジェクトに追加されている。 - authentication_method: OpenProject とストレージ間のリクエストの認証方法。 - automatic_folder: これにより、このプロジェクトのルート・フォルダーが自動的に作成され、各プロジェクト・メンバーのアクセス権が管理されます。 - empty_project_folder_validation: 続行するには、フォルダの選択が必須です。 - existing_manual_folder: 既存のフォルダをこのプロジェクトのルートフォルダとして指定することができます。ただし、パーミッションは自動的に管理されないため、管理者は関連するユーザーがアクセスできることを手動で確認する必要があります。選択したフォルダは、複数のプロジェクトで使用できます。 - host: https:// を含むストレージのホスト・アドレスを追加してください。255文字以内にしてください。 - managed_project_folders_application_password_caption: "%{provider_type_link}からこの値をコピーして、自動管理フォルダを有効にする。" - name: ユーザーが複数のストレージを区別できるように、ストレージに名前を付ける。 + all_available_storages_already_added: 利用可能なすべてのストレージが既にプロジェクトに追加されています。 + authentication_method: OpenProjectとストレージ間のリクエストは認証されます。 + automatic_folder: これにより、このプロジェクトのルートフォルダが自動的に作成され、各プロジェクトメンバーのアクセス権限が管理されます。 + empty_project_folder_validation: フォルダの選択は必須です。 + existing_manual_folder: このプロジェクトのルートフォルダとして既存のフォルダを指定できます。 ただし、権限は自動的に管理されておらず、管理者は関連するユーザーに手動でアクセス権があることを確認する必要があります。 選択したフォルダは複数のプロジェクトで使用できます。 + host: https://を含むストレージのホストアドレスを追加してください。255文字以内にしてください。 + managed_project_folders_application_password_caption: "%{provider_type_link} からこの値をコピーすることで、自動管理フォルダを有効にします。" + name: ユーザーが複数のストレージを区別できるように、ストレージに名前を付けます。 new_storage_html: Read our documentation on [setting up a %{provider_name} file storage](docs_url) integration for more information. nextcloud: application_link_text: アプリケーション "Integration OpenProject" - integration: ネクストクラウド管理 / OpenProject + integration: Nextcloudの管理 / OpenProject oauth_configuration: "%{application_link_text} からこれらの値をコピーします。" - provider_configuration: セットアップを行う前に、Nextcloudインスタンスの管理者権限があり、 %{application_link_text} がインストールされていることを確認してください。 - storage_audience: Nextcloud インスタンスが ID プロバイダとの通信に使用するクライアント ID。 - storage_audience_placeholder: 例:ネクストクラウド - token_exchange_scope: トークン交換時に要求するスコープを、それぞれスペースで区切って指定する。 - no_specific_folder: デフォルトでは、ファイルをアップロードすると、各ユーザーは自分のホームフォルダから開始します。 - no_storage_set_up: ファイルストレージはまだ設定されていない。 - not_logged_into_storage: プロジェクトフォルダを選択するには、まずログインしてください。 + provider_configuration: Nextcloudインスタンスに管理権限があり、設定を行う前に %{application_link_text} がインストールされていることを確認してください。 + storage_audience: NextcloudインスタンスがIDプロバイダーと通信するために使用するクライアントID。 + storage_audience_placeholder: 例:nextcloud + token_exchange_scope: トークン交換中に要求されるべきスコープは、それぞれスペースで区切られています。 + no_specific_folder: デフォルトでは、各ユーザーはファイルをアップロードしたときに自分のホームフォルダから開始します。 + no_storage_set_up: まだ設定されているファイルストレージがありません。 + not_logged_into_storage: プロジェクトフォルダを選択するには、最初にログインしてください oauth_application_details_html: The client secret value will not be accessible again after you close this window. Please copy these values into the [Nextcloud OpenProject Integration settings](oauth_application_details_link). one_drive: application_link_text: Azure Portal copy_redirect_uri: リダイレクトURIをコピーする documentation_link_text: OneDriveファイルストレージのドキュメント drive_id: "%{drive_id_link_text} の手順に従って、目的のドライブからIDをコピーしてください。" - integration: ワンドライブ - missing_client_id_for_redirect_uri: OAuthの値を入力してURIを生成してください。 + integration: OneDrive + missing_client_id_for_redirect_uri: OAuthの値を入力してURIを生成してください oauth_client_redirect_uri: この値を「リダイレクト URIs」にある新しい Web リダイレクト URI にコピーしてください。 oauth_client_secret: Client 資格情報にアプリケーション クライアント シークレットがない場合は、新しいシークレットを作成してください。 oauth_configuration: "%{application_link_text}、目的のアプリケーションからこれらの値をコピーします。" @@ -477,13 +477,13 @@ ja: login_button_aria_label: "%{storage} にログイン" login_button_label: "%{provider_type} ログイン" project_settings: - description: プロジェクトフォルダにアクセスするには、 %{storage}にログインする必要があります。 + description: プロジェクトフォルダにアクセスするには、 %{storage} にログインする必要があります。 requesting_access_to: "%{storage} へのアクセスをリクエストしています" storage_admin: description: このストレージにプロジェクトを追加するには、 %{provider_type}にログインする必要があります。ログインしてもう一度やり直してください。 open_project_storage_modal: success: - subtitle: リダイレクトされます + subtitle: リダイレクトしています title: 連携のセットアップが完了しました timeout: link_text: ファイルストレージセットアップの状態の状態 @@ -502,8 +502,8 @@ ja: subtitle_short: OpenProjectにプロジェクトごとにフォルダを自動的に作成させます。 title: 自動的に管理されるプロジェクトフォルダ project_settings: - edit: このプロジェクトのファイル・ストレージを編集する - members_connection_status: メンバーの接続状況 + edit: このプロジェクトのファイルストレージを編集 + members_connection_status: 会員の接続状況 new: このプロジェクトにファイルストレージを追加する project_storage_members: subtitle_html: Check the connection status for the storage %{storage_name_link} of all project members. @@ -514,14 +514,14 @@ ja: provider_types: label: プロバイダー・タイプ nextcloud: - label_oauth_client_id: NextcloudのOAuthクライアントID - label_oauth_client_secret: NextcloudOAuthクライアントシークレット + label_oauth_client_id: Nextcloud OAuthクライアントID + label_oauth_client_secret: Nextcloud OAuth クライアントシークレット name: ネクストクラウド name_placeholder: 例:ネクストクラウド one_drive: - label_oauth_client_id: Azure OAuthアプリケーション(クライアント)ID + label_oauth_client_id: Azure OAuth アプリケーション (クライアント) ID label_oauth_client_secret: Azure OAuth クライアントの秘密値 - name: ワンドライブ + name: OneDrive name_placeholder: '例: OneDrive' sharepoint: drive_description: OpenProject access-managed document library @@ -531,18 +531,18 @@ ja: name_placeholder: 例:シェアポイント show_attachments_toggle: description: このオプションを無効にすると、ワークパッケージのファイルタブの添付ファイルリストが非表示になります。ワークパッケージの説明に添付されたファイルは、内部添付ファイルストレージにアップロードされます。 - label: ワークパッケージのファイルタブに添付ファイルを表示 + label: ワークパッケージファイルタブに添付ファイルを表示 storage_audience: - documentation_intro: 以下のオプションと ID プロバイダの設定の詳細については、当社のドキュメントをお読みください。 + documentation_intro: アイデンティティプロバイダの以下のオプションと設定については、当社のドキュメントをお読みください。 idp: - helptext: OpenProjectは、ストレージへのリクエストを認証するために、ログイン時にIDプロバイダから受け取ったアクセストークンを使用します。別のトークンを取得しようとすることはありません。 - label: ユーザーログイン時に取得したアクセストークンを使用する + helptext: OpenProjectはログイン中にIDプロバイダーが受け取ったアクセストークンを使用して、ストレージへのリクエストを認証します。 別のトークンを取得しようとしません。 + label: ログイン中に取得したアクセストークンを使用する manual: - helptext: OpenProjectは、指定されたオーディエンスのIDプロバイダとトークンを交換します。 + helptext: OpenProject は、特定のオーディエンスの ID プロバイダーとトークンを交換します。 label: Manually specify audience for which to exchange access token (Recommended) storage_list_blank_slate: - description: ストレージを追加して、ここで見ることができる。 - heading: あなたはまだ倉庫を持っていない。 + description: ここにそれらを見るためにストレージを追加します。 + heading: まだストレージがありません。 successful_storage_connection: ストレージが正常に接続されました! 使用する各プロジェクトの「プロジェクト」タブでストレージをアクティブにすることを忘れないでください。 upsell: one_drive: diff --git a/modules/storages/config/locales/crowdin/js-ja.yml b/modules/storages/config/locales/crowdin/js-ja.yml index 35975efb28f..ff94c1e0485 100644 --- a/modules/storages/config/locales/crowdin/js-ja.yml +++ b/modules/storages/config/locales/crowdin/js-ja.yml @@ -4,14 +4,14 @@ ja: js: storages: authentication_error: "%{storageType} での認証に失敗しました" - link_files_in_storage: リンクファイル %{storageType} - link_existing_files: 既存のファイルをリンク - upload_files: ファイルのアップロード + link_files_in_storage: "%{storageType}のファイルをリンクする" + link_existing_files: 既存のファイルをリンクする + upload_files: ログファイル drop_files: ここにファイルをドロップして、 %{name} にアップロードします。 drop_or_click_files: ここにファイルをドロップするか、クリックして %{name} にアップロードします。 login: "%{storageType} ログイン" login_to: "%{storageType}にログイン" - no_connection: "%{storageType} 接続がありません" + no_connection: "%{storageType} 接続なし" open_storage: "%{storageType} を開く" select_location: 場所を選択 choose_location: 場所を選ぶ @@ -24,7 +24,7 @@ ja: information: authentication_error: "%{storageType} へのリクエストを認証できませんでした。これはエラーです。" connection_error: "%{storageType} の設定が一部機能していません。 %{storageType} 管理者にお問い合わせください。\n" - live_data_error: ファイルの詳細の取得に失敗しました + live_data_error: ファイル詳細の取得エラー live_data_error_description: '一部の %{storageType} データを取得できませんでした。このページを再読み込みするか、 %{storageType} 管理者にお問い合わせください。 ' @@ -35,7 +35,7 @@ ja: suggest_logout: ログアウトしてログインし直すと、この問題が解決するかどうか試してみてください。 suggest_relink: 以下のログインボタンからアカウントを再リンクすると、この問題が解決するかどうか試してみてください。 files: - already_existing_header: このファイルはすでに存在する + already_existing_header: このファイルは既に存在します already_existing_body: 'このファイルをアップロードしようとしている場所に、"%{fileName}"という名前のファイルがすでに存在します。どうしますか? ' @@ -44,7 +44,7 @@ ja: dragging_folder: "%{storageType} へのアップロードはフォルダをサポートしていません。" empty_folder: このフォルダは空です。 empty_folder_location_hint: 下のボタンをクリックして、この場所にファイルをアップロードしてください。 - file_not_selectable_location: 場所を選択する過程でファイルを選択することはできない。 + file_not_selectable_location: ファイルを選択することは、場所を選択する過程ではできません。 project_folder_no_access: 'プロジェクトフォルダにアクセスできません。管理者に連絡してアクセス権を取得するか、別の場所にファイルをアップロードしてください。 ' @@ -90,10 +90,10 @@ ja: ' detail: - nextcloud: '最新版のNextcloudアプリ「OpenProject Integration」がインストールされていることを確認し、管理者にお問い合わせください。 + nextcloud: 'Nextcloudアプリ「OpenProject統合」の最新バージョンがインストールされていることを確認し、詳細については管理者にお問い合わせください。 ' - link_uploaded_file_error: '最近アップロードされたファイル ''%{fileName}'' をワークパッケージ %{workPackageId}にリンクするエラーが発生しました。 + link_uploaded_file_error: '最近アップロードされたファイル ''%{fileName}'' をワークパッケージ %{workPackageId} にリンクしてエラーが発生しました。 ' tooltip: diff --git a/modules/two_factor_authentication/config/locales/crowdin/ro.yml b/modules/two_factor_authentication/config/locales/crowdin/ro.yml index 87aa2ce067e..29a5a924db5 100644 --- a/modules/two_factor_authentication/config/locales/crowdin/ro.yml +++ b/modules/two_factor_authentication/config/locales/crowdin/ro.yml @@ -170,7 +170,7 @@ ro: notice_account_otp_send_failed: Parola dvs. unică nu a putut fi trimisă. notice_account_has_no_phone: Nici un număr de telefon mobil nu este asociat contului dvs. label_confirmed: Confirmat - button_continue: Continuă + button_continue: Continuaţi button_make_default: Marcați ca implicit notice_phone_number_format: 'Te rog să introduci numărul în următorul format: +XX XXXXXXXX.' text_otp_not_receive: Alte metode de verificare diff --git a/modules/two_factor_authentication/config/locales/crowdin/ru.yml b/modules/two_factor_authentication/config/locales/crowdin/ru.yml index 3725f47949d..f65da4da418 100644 --- a/modules/two_factor_authentication/config/locales/crowdin/ru.yml +++ b/modules/two_factor_authentication/config/locales/crowdin/ru.yml @@ -170,7 +170,7 @@ ru: notice_account_otp_send_failed: Не удается отправить одноразовый пароль. notice_account_has_no_phone: К вашей учетной записи не привязан номер сотового телефона. label_confirmed: Подтвержден - button_continue: Продолжить + button_continue: Далее button_make_default: Задать по умолчанию notice_phone_number_format: 'Введите номер в следующем формате: +XX XXXXXXXX.' text_otp_not_receive: Другие способы проверки diff --git a/modules/xls_export/config/locales/crowdin/zh-CN.yml b/modules/xls_export/config/locales/crowdin/zh-CN.yml index 8048888f698..b6de4f90804 100644 --- a/modules/xls_export/config/locales/crowdin/zh-CN.yml +++ b/modules/xls_export/config/locales/crowdin/zh-CN.yml @@ -14,4 +14,4 @@ zh-CN: xls_with_relations: 带关系的 XLS xls_export: child_of: 此项的子项 - parent_of: 此项的父级 + parent_of: 此项的父项 From dfa8e645037ebe00984ce4cbd21b1355aa901027 Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Sun, 24 May 2026 04:30:49 +0000 Subject: [PATCH 070/381] update locales from crowdin [ci skip] --- modules/backlogs/config/locales/crowdin/tr.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/backlogs/config/locales/crowdin/tr.yml b/modules/backlogs/config/locales/crowdin/tr.yml index 05ce951662f..7dbe060c6ef 100644 --- a/modules/backlogs/config/locales/crowdin/tr.yml +++ b/modules/backlogs/config/locales/crowdin/tr.yml @@ -28,8 +28,8 @@ tr: attributes: project: sprint_sharing: Koşu paylaşımı - backlog_excluded_types: Excluded work package types - statuses_considered_closed: Statuses considered closed + backlog_excluded_types: Hariç tutulan iş paketi türleri + statuses_considered_closed: Kapatılmış sayılan durumlar sprint: duration: Süre finish_date: Bitiş tarihi @@ -62,11 +62,11 @@ tr: attributes: base: unfinished_work_packages: - one: There is one work package that was not completed in this sprint. + one: Bu sprintte tamamlanmayan bir iş paketi var. other: Bu sprint bünyesinde tamamlanmamış %{count} adet iş paketi bulunmaktadır. format: "%{message}" status: - not_active: is not active so it cannot be closed. + not_active: etkin değil, bu yüzden kapatılamaz. work_package: backlog_bucket_xor_sprint: cannot be assigned to both a sprint and a backlog bucket. attributes: @@ -114,7 +114,7 @@ tr: select_sprint_label: Select sprint button_complete_sprint: Complete sprint inbox_component: - title: Inbox + title: Gelen kutusu blankslate_title: Backlog inbox is empty blankslate_description: Bu projedeki tüm açık iş paketleri otomatik olarak burada görünecektir. show_more: @@ -150,7 +150,7 @@ tr: sprints_component: blankslate: title: No sprints present yet - settings_link_text: project settings + settings_link_text: proje ayarları receive_and_manage_description_html: This project receives sprints from a different project. Manage this in the %{settings_link}. receive_description_text: This project receives shared sprints from a different project, but none are available right now. create_and_manage_description_html: To start planning your sprint, create one here or go to the %{settings_link} to receive sprints from a different project. @@ -163,7 +163,7 @@ tr: statuses_considered_closed_caption: 'Choose the statuses that represent a closed or finished state in your workflow. These will be treated as the "Closed" state across reporting (e.g. burndown) and sprint planning. For example, statuses like Done, Resolved, or Won''t Fix may all represent a closed work item in your process. ' - types_and_statuses: Types and statuses + types_and_statuses: Türler ve durumlar unassigned: Atanmamış user_preference: header_backlogs: Birikmiş İşler Modülü From 9f7af7608ab099a90541e4130008b007cfac8c63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 07:21:30 +0000 Subject: [PATCH 071/381] Bump benc-uk/workflow-dispatch from 1.3.1 to 1.3.2 Bumps [benc-uk/workflow-dispatch](https://github.com/benc-uk/workflow-dispatch) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/benc-uk/workflow-dispatch/releases) - [Commits](https://github.com/benc-uk/workflow-dispatch/compare/7a027648b88c2413826b6ddd6c76114894dc5ec4...31e2b3319479a63f0ab15bf800eff9e913504e26) --- updated-dependencies: - dependency-name: benc-uk/workflow-dispatch dependency-version: 1.3.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/hocuspocus-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hocuspocus-docker.yml b/.github/workflows/hocuspocus-docker.yml index 4a6e78b286f..8fb802dc2b8 100644 --- a/.github/workflows/hocuspocus-docker.yml +++ b/.github/workflows/hocuspocus-docker.yml @@ -161,7 +161,7 @@ jobs: - name: Deploy EDGE if: github.ref == 'refs/heads/dev' && github.repository == 'opf/openproject' - uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 + uses: benc-uk/workflow-dispatch@31e2b3319479a63f0ab15bf800eff9e913504e26 with: workflow: edge-deploy-shards.yml repo: opf/saas-deploy @@ -172,7 +172,7 @@ jobs: - name: Deploy STAGE # make sure to always use the latest release branch here if: github.ref == 'refs/heads/release/17.5' && github.repository == 'opf/openproject' - uses: benc-uk/workflow-dispatch@7a027648b88c2413826b6ddd6c76114894dc5ec4 + uses: benc-uk/workflow-dispatch@31e2b3319479a63f0ab15bf800eff9e913504e26 with: workflow: stage-deploy-shards.yml repo: opf/saas-deploy From f8d3488bcede333e02998c7479fb388d15b3fd95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 12:42:23 +0200 Subject: [PATCH 072/381] Bump rubocop-rails from 2.35.1 to 2.35.2 (#23330) Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.35.1 to 2.35.2. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.35.1...v2.35.2) --- updated-dependencies: - dependency-name: rubocop-rails dependency-version: 2.35.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 289fa0503a6..38c60ff925f 100644 --- a/Gemfile +++ b/Gemfile @@ -366,7 +366,7 @@ group :development, :test do gem "rubocop-factory_bot", require: false gem "rubocop-openproject", require: false gem "rubocop-performance", require: false - gem "rubocop-rails", "~> 2.35.1" + gem "rubocop-rails", "~> 2.35.2" gem "rubocop-rspec", require: false gem "rubocop-rspec_rails", require: false diff --git a/Gemfile.lock b/Gemfile.lock index fb73def6f4c..a032f13d47c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1361,7 +1361,7 @@ GEM lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) - rubocop-rails (2.35.1) + rubocop-rails (2.35.2) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) @@ -1746,7 +1746,7 @@ DEPENDENCIES rubocop-factory_bot rubocop-openproject rubocop-performance - rubocop-rails (~> 2.35.1) + rubocop-rails (~> 2.35.2) rubocop-rspec rubocop-rspec_rails ruby-duration (~> 3.2.0) @@ -1849,7 +1849,7 @@ CHECKSUMS browser (6.2.0) sha256=281d5295788825c9396427c292c2d2be0a5c91875c93c390fde6e5d61a5ace2d budgets (1.0.0) builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f - bundler (4.0.11) sha256=5bcec0fb78302e48d02ee46f10ee6e6942be647ba5b44a6d1ddfda9a240ce785 + bundler (4.0.12) sha256=7f8b757d28dfb636e7b24fba2344ac6dd13b5b24f4b46d62573d483f211825ac byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d capybara (3.40.0) sha256=42dba720578ea1ca65fd7a41d163dd368502c191804558f6e0f71b391054aeef capybara-screenshot (1.0.27) sha256=afa1896cc23df77be1774e8d3b3ce3953bf060aeaa04ff87607b5daf689174f2 @@ -2237,7 +2237,7 @@ CHECKSUMS rubocop-factory_bot (2.28.0) sha256=4b17fc02124444173317e131759d195b0d762844a71a29fe8139c1105d92f0cb rubocop-openproject (0.4.0) sha256=ce56d9e591f9be5a4d98125b10a73564b0557a5e408f97918f9630fb15ae66ae rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834 - rubocop-rails (2.35.1) sha256=4ad270f5fb968ce86ac19f53c4b97354e4f91bc5334177478238674f51568377 + rubocop-rails (2.35.2) sha256=088865be9675922a5c8f13c00055a71ab768ea5eed211437cffd2a8b46b64ac2 rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2 rubocop-rspec_rails (2.32.0) sha256=4a0d641c72f6ebb957534f539d9d0a62c47abd8ce0d0aeee1ef4701e892a9100 ruby-duration (3.2.3) sha256=eb3d13b1df85067a015a8fb2ed8f1eec842a3b721e47c9b6fd74d2f356069784 From 5dec26a16c1fc04fd5be92295114f83387fa7c41 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 14:19:57 +0200 Subject: [PATCH 073/381] Revert "bump parallel_tests & turbo_tests" This update broke logging of RSpec seed/shard/processes, critical for reproducing and debugging CI failures locally. Example: Process 3: TEST_ENV_NUMBER=3 RUBYOPT=-I/usr/local/bundle/bundler/gems/turbo_tests-c1c4707f536a/lib -r/usr/local/bundle/gems/bundler-4.0.9/lib/bundler/setup -W0 RSPEC_SILENCE_FILTER_ANNOUNCEMENTS=1 /usr/local/bundle/gems/bundler-4.0.9/exe/bundle exec rspec --seed 31239 --format TurboTests::JsonRowsFormatter --out tmp/test-pipes/subprocess-3 --format ParallelTests::RSpec::RuntimeLogger --out spec/support/runtime-logs/turbo_runtime_features.log modules/bim/spec/features/bcf/api_authorization_spec.rb modules/bim/spec/features/model_management_spec.rb modules/budgets/spec/features/budgets/attachment_upload_spec.rb modules/meeting/spec/features/structured_meetings/work_package_meetings_tab_spec.rb modules/my_page/spec/features/my/my_page_spec.rb modules/storages/spec/features/delete_project_storage_and_file_links_spec.rb modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb spec/features/admin/custom_fields/projects/format_fields/boolean_spec.rb spec/features/admin/custom_fields/projects/format_fields/version_spec.rb spec/features/auth/consent_auth_stage_spec.rb spec/features/auth/lost_password_spec.rb spec/features/global_roles/global_role_assignment_spec.rb spec/features/my/disable_keyboard_shortcuts_spec.rb spec/features/projects/project_autocomplete_spec.rb spec/features/projects/project_custom_fields/overview_page/widget_spec.rb spec/features/security/session_ttl_spec.rb spec/features/wiki/attachment_upload_spec.rb spec/features/work_packages/share/enterprise_restriction_spec.rb spec/features/work_packages/table/scheduling/manual_scheduling_spec.rb spec/features/work_packages/work_package_workflow_form_spec.rb This reverts commit 3ee9107ff5a1d4a179fe2e0bcf3bba75c2dc4a3b. --- Gemfile | 5 +++-- Gemfile.lock | 17 ++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 38c60ff925f..e6e5fc892d5 100644 --- a/Gemfile +++ b/Gemfile @@ -265,11 +265,10 @@ group :test do gem "rack-test", "~> 2.2.0" gem "shoulda-context", "~> 2.0" - gem "parallel_tests", "~> 5.7" # Test prof provides factories from code # and other niceties gem "test-prof", "~> 1.6.0" - gem "turbo_tests", github: "opf/turbo_tests", ref: "2_2_5_with_patches" + gem "turbo_tests", github: "opf/turbo_tests", ref: "with-patches" gem "rack_session_access" gem "rspec", "~> 3.13.2" @@ -318,6 +317,8 @@ group :test do gem "equivalent-xml", "~> 0.6" gem "json_spec", "~> 1.1.4" gem "shoulda-matchers", "~> 7.0", require: nil + + gem "parallel_tests", "~> 4.0" end group :ldap do diff --git a/Gemfile.lock b/Gemfile.lock index a032f13d47c..bebd7abe9e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,11 +54,11 @@ GIT GIT remote: https://github.com/opf/turbo_tests.git - revision: 4208e7372a7987c972dda634eb4f29ad9f1448e1 - ref: 2_2_5_with_patches + revision: c1c4707f536a5642a168650d273d714dfb62d842 + ref: with-patches specs: - turbo_tests (2.2.5) - parallel_tests (>= 3.3.0, < 6) + turbo_tests (2.2.0) + parallel_tests (>= 3.3.0, < 5) rspec (>= 3.10) GIT @@ -1107,7 +1107,7 @@ GEM activerecord (>= 7.1) request_store (~> 1.4) parallel (2.1.0) - parallel_tests (5.7.0) + parallel_tests (4.10.1) parallel parser (3.3.11.1) ast (~> 2.4.1) @@ -1706,7 +1706,7 @@ DEPENDENCIES ox pagy paper_trail (~> 17.0.0) - parallel_tests (~> 5.7) + parallel_tests (~> 4.0) pdf-inspector (~> 1.2) pg (~> 1.6.2) plaintext (~> 0.3.7) @@ -1849,7 +1849,6 @@ CHECKSUMS browser (6.2.0) sha256=281d5295788825c9396427c292c2d2be0a5c91875c93c390fde6e5d61a5ace2d budgets (1.0.0) builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f - bundler (4.0.12) sha256=7f8b757d28dfb636e7b24fba2344ac6dd13b5b24f4b46d62573d483f211825ac byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d capybara (3.40.0) sha256=42dba720578ea1ca65fd7a41d163dd368502c191804558f6e0f71b391054aeef capybara-screenshot (1.0.27) sha256=afa1896cc23df77be1774e8d3b3ce3953bf060aeaa04ff87607b5daf689174f2 @@ -2146,7 +2145,7 @@ CHECKSUMS pagy (43.5.4) sha256=2bdf3fa6b1e0cac5bbafe5d077fb24eb971f72f3194f8c6863a0f3867261ce59 paper_trail (17.0.0) sha256=1c2842061d3874ca7015908e821e2aa14f9b982af2acb2a7974713bf79021c85 parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356 - parallel_tests (5.7.0) sha256=3f1762c46ca2c223b8af8ef877217f9d76974e191bfa934f2580b58bcf1d005c + parallel_tests (4.10.1) sha256=df05458c691462b210f7a41fc2651d4e4e8a881e8190e6d1e122c92c07735d70 parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54 pdf-core (0.9.0) sha256=4f368b2f12b57ec979872d4bf4bd1a67e8648e0c81ab89801431d2fc89f4e0bb pdf-inspector (1.3.0) sha256=fc107579d6f29b636e2da3d6743479b2624d9e390bf2d84beef8fd4ebe1a05bd @@ -2292,7 +2291,7 @@ CHECKSUMS ttfunk (1.7.0) sha256=2370ba484b1891c70bdcafd3448cfd82a32dd794802d81d720a64c15d3ef2a96 turbo-rails (2.0.23) sha256=ee0d90733aafff056cf51ff11e803d65e43cae258cc55f6492020ec1f9f9315f turbo_power (0.7.0) sha256=ad95d147e0fa761d0023ad9ca00528c7b7ddf6bba8ca2e23755d5b21b290d967 - turbo_tests (2.2.5) + turbo_tests (2.2.0) tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b tzinfo-data (1.2026.2) sha256=7db0d3d3d53b8d7601fc183fccc8c6d056a3004e14eb59ea995bf6aec4ae10bc uber (0.1.0) sha256=5beeb407ff807b5db994f82fa9ee07cfceaa561dad8af20be880bc67eba935dc From 18dc4b081ab7418d0ebd326dcb9eec627b7a6f99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 23:48:44 +0200 Subject: [PATCH 074/381] Bump @mantine/core from 8.3.13 to 9.0.1 in /frontend (#23096) Bumps [@mantine/core](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/core) from 8.3.13 to 9.0.1. - [Release notes](https://github.com/mantinedev/mantine/releases) - [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md) - [Commits](https://github.com/mantinedev/mantine/commits/9.0.1/packages/@mantine/core) --- updated-dependencies: - dependency-name: "@mantine/core" dependency-version: 9.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 309 ++++++++++++++++--------------------- frontend/package.json | 2 +- 2 files changed, 133 insertions(+), 178 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aae82c080cc..2659ba49bfb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -50,7 +50,7 @@ "@hotwired/turbo-rails": "^8.0.20", "@knowledgecode/delegate": "^0.10.3", "@kolkov/ngx-gallery": "^2.0.1", - "@mantine/core": "^8.3.13", + "@mantine/core": "^9.0.1", "@mantine/hooks": "^9.0.1", "@mantine/utils": "^6.0.22", "@ng-select/ng-option-highlight": "^21.8.2", @@ -4975,30 +4975,39 @@ } }, "node_modules/@floating-ui/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", - "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz", + "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==", "dependencies": { - "@floating-ui/utils": "^0.2.10" + "@floating-ui/utils": "^0.2.11" } }, + "node_modules/@floating-ui/core/node_modules/@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + }, "node_modules/@floating-ui/dom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", - "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz", + "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==", "dependencies": { - "@floating-ui/core": "^1.7.3", - "@floating-ui/utils": "^0.2.10" + "@floating-ui/core": "^1.7.5", + "@floating-ui/utils": "^0.2.11" } }, + "node_modules/@floating-ui/dom/node_modules/@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + }, "node_modules/@floating-ui/react": { - "version": "0.27.16", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.16.tgz", - "integrity": "sha512-9O8N4SeG2z++TSM8QA/KTeKFBVCNEz/AGS7gWPJf6KFRzmRWixFRnCnkPHRDwSVZW6QPDO6uT0P2SpWNKCc9/g==", - "license": "MIT", + "version": "0.27.19", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.19.tgz", + "integrity": "sha512-31B8h5mm8YxotlE7/AU/PhNAl8eWxAmjL/v2QOxroDNkTFLk3Uu82u63N3b6TXa4EGJeeZLVcd/9AlNlVqzeog==", "dependencies": { - "@floating-ui/react-dom": "^2.1.6", - "@floating-ui/utils": "^0.2.10", + "@floating-ui/react-dom": "^2.1.8", + "@floating-ui/utils": "^0.2.11", "tabbable": "^6.0.0" }, "peerDependencies": { @@ -5007,18 +5016,22 @@ } }, "node_modules/@floating-ui/react-dom": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.6.tgz", - "integrity": "sha512-4JX6rEatQEvlmgU80wZyq9RT96HZJa88q8hp0pBd+LrczeDI4o6uA2M+uvxngVHo4Ihr8uibXxH6+70zhAFrVw==", - "license": "MIT", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz", + "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==", "dependencies": { - "@floating-ui/dom": "^1.7.4" + "@floating-ui/dom": "^1.7.6" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, + "node_modules/@floating-ui/react/node_modules/@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + }, "node_modules/@floating-ui/utils": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", @@ -6642,21 +6655,20 @@ } }, "node_modules/@mantine/core": { - "version": "8.3.13", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-8.3.13.tgz", - "integrity": "sha512-ZgW4vqN4meaPyIMxzAufBvsgmJRfYZdTpsrAOcS8pWy7m9e8i685E7XsAxnwJCOIHudpvpvt+7Bx7VaIjEsYEw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-9.0.1.tgz", + "integrity": "sha512-kSYm8g7p8FTDysOsz9BN14TSqp10O0yAmo9HOZfwe6c08gGKQSytnSCPgnTe2h5DMfpbhTg+krROrT8WQy37fA==", "dependencies": { - "@floating-ui/react": "^0.27.16", + "@floating-ui/react": "^0.27.19", "clsx": "^2.1.1", - "react-number-format": "^5.4.4", - "react-remove-scroll": "^2.7.1", - "react-textarea-autosize": "8.5.9", - "type-fest": "^4.41.0" + "react-number-format": "^5.4.5", + "react-remove-scroll": "^2.7.2", + "type-fest": "^5.5.0" }, "peerDependencies": { - "@mantine/hooks": "8.3.13", - "react": "^18.x || ^19.x", - "react-dom": "^18.x || ^19.x" + "@mantine/hooks": "9.0.1", + "react": "^19.2.0", + "react-dom": "^19.2.0" } }, "node_modules/@mantine/hooks": { @@ -14155,8 +14167,7 @@ "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "license": "MIT" + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==" }, "node_modules/devlop": { "version": "1.1.0", @@ -15873,7 +15884,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", - "license": "MIT", "engines": { "node": ">=6" } @@ -21991,20 +22001,18 @@ "license": "MIT" }, "node_modules/react-number-format": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.4.tgz", - "integrity": "sha512-wOmoNZoOpvMminhifQYiYSTCLUDOiUbBunrMrMjA+dV52sY+vck1S4UhR6PkgnoCquvvMSeJjErXZ4qSaWCliA==", - "license": "MIT", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.5.tgz", + "integrity": "sha512-y8O2yHHj3w0aE9XO8d2BCcUOOdQTRSVq+WIuMlLVucAm5XNjJAy+BoOJiuQMldVYVOKTMyvVNfnbl2Oqp+YxGw==", "peerDependencies": { "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/react-remove-scroll": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.1.tgz", - "integrity": "sha512-HpMh8+oahmIdOuS5aFKKY6Pyog+FNaZV/XyJOq7b4YFwsFHe5yYfdbIalI4k3vU2nSDql7YskmUseHsRrJqIPA==", - "license": "MIT", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", + "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", @@ -22029,7 +22037,6 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", - "license": "MIT", "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" @@ -22051,7 +22058,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", - "license": "MIT", "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" @@ -22069,23 +22075,6 @@ } } }, - "node_modules/react-textarea-autosize": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.9.tgz", - "integrity": "sha512-U1DGlIQN5AwgjTyOEnI1oCcMuEr1pv1qOtklB2l4nyMGbHzWrI0eFsYK0zos2YWqAolJyG0IWJaqWmWj5ETh0A==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.20.13", - "use-composed-ref": "^1.3.0", - "use-latest": "^1.2.1" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, "node_modules/read": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/read/-/read-4.1.0.tgz", @@ -24011,6 +24000,17 @@ "jquery": ">=1.2.6" } }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tapable": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", @@ -24565,12 +24565,14 @@ } }, "node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "license": "(MIT OR CC0-1.0)", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.6.0.tgz", + "integrity": "sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==", + "dependencies": { + "tagged-tag": "^1.0.0" + }, "engines": { - "node": ">=16" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -25226,7 +25228,6 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", - "license": "MIT", "dependencies": { "tslib": "^2.0.0" }, @@ -25243,56 +25244,10 @@ } } }, - "node_modules/use-composed-ref": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.4.0.tgz", - "integrity": "sha512-djviaxuOOh7wkj0paeO1Q/4wMZ8Zrnag5H6yBvzN7AKKe8beOaED9SF5/ByLqsku8NP4zQqsvM2u3ew/tJK8/w==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-isomorphic-layout-effect": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz", - "integrity": "sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/use-latest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.3.0.tgz", - "integrity": "sha512-mhg3xdm9NaM8q+gLT8KryJPnRFOz1/5XPBhmDEVZK1webPzDjrPk7f/mbpeLqTgB9msytYWANxgALOCJKnLvcQ==", - "license": "MIT", - "dependencies": { - "use-isomorphic-layout-effect": "^1.1.1" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/use-sidecar": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", - "license": "MIT", "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" @@ -29473,38 +29428,59 @@ "dev": true }, "@floating-ui/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", - "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz", + "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==", "requires": { - "@floating-ui/utils": "^0.2.10" + "@floating-ui/utils": "^0.2.11" + }, + "dependencies": { + "@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + } } }, "@floating-ui/dom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", - "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz", + "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==", "requires": { - "@floating-ui/core": "^1.7.3", - "@floating-ui/utils": "^0.2.10" + "@floating-ui/core": "^1.7.5", + "@floating-ui/utils": "^0.2.11" + }, + "dependencies": { + "@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + } } }, "@floating-ui/react": { - "version": "0.27.16", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.16.tgz", - "integrity": "sha512-9O8N4SeG2z++TSM8QA/KTeKFBVCNEz/AGS7gWPJf6KFRzmRWixFRnCnkPHRDwSVZW6QPDO6uT0P2SpWNKCc9/g==", + "version": "0.27.19", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.19.tgz", + "integrity": "sha512-31B8h5mm8YxotlE7/AU/PhNAl8eWxAmjL/v2QOxroDNkTFLk3Uu82u63N3b6TXa4EGJeeZLVcd/9AlNlVqzeog==", "requires": { - "@floating-ui/react-dom": "^2.1.6", - "@floating-ui/utils": "^0.2.10", + "@floating-ui/react-dom": "^2.1.8", + "@floating-ui/utils": "^0.2.11", "tabbable": "^6.0.0" + }, + "dependencies": { + "@floating-ui/utils": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz", + "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==" + } } }, "@floating-ui/react-dom": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.6.tgz", - "integrity": "sha512-4JX6rEatQEvlmgU80wZyq9RT96HZJa88q8hp0pBd+LrczeDI4o6uA2M+uvxngVHo4Ihr8uibXxH6+70zhAFrVw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz", + "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==", "requires": { - "@floating-ui/dom": "^1.7.4" + "@floating-ui/dom": "^1.7.6" } }, "@floating-ui/utils": { @@ -30521,16 +30497,15 @@ "integrity": "sha512-EbsszrASgT85GH3B7jkx7YXfQyIYo/rlobwMx6V3ewETapPUwdSAInv+89flnk5n2eu2Lpdeh+2zS6PvqbL2RA==" }, "@mantine/core": { - "version": "8.3.13", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-8.3.13.tgz", - "integrity": "sha512-ZgW4vqN4meaPyIMxzAufBvsgmJRfYZdTpsrAOcS8pWy7m9e8i685E7XsAxnwJCOIHudpvpvt+7Bx7VaIjEsYEw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-9.0.1.tgz", + "integrity": "sha512-kSYm8g7p8FTDysOsz9BN14TSqp10O0yAmo9HOZfwe6c08gGKQSytnSCPgnTe2h5DMfpbhTg+krROrT8WQy37fA==", "requires": { - "@floating-ui/react": "^0.27.16", + "@floating-ui/react": "^0.27.19", "clsx": "^2.1.1", - "react-number-format": "^5.4.4", - "react-remove-scroll": "^2.7.1", - "react-textarea-autosize": "8.5.9", - "type-fest": "^4.41.0" + "react-number-format": "^5.4.5", + "react-remove-scroll": "^2.7.2", + "type-fest": "^5.5.0" } }, "@mantine/hooks": { @@ -40825,14 +40800,14 @@ "dev": true }, "react-number-format": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.4.tgz", - "integrity": "sha512-wOmoNZoOpvMminhifQYiYSTCLUDOiUbBunrMrMjA+dV52sY+vck1S4UhR6PkgnoCquvvMSeJjErXZ4qSaWCliA==" + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.5.tgz", + "integrity": "sha512-y8O2yHHj3w0aE9XO8d2BCcUOOdQTRSVq+WIuMlLVucAm5XNjJAy+BoOJiuQMldVYVOKTMyvVNfnbl2Oqp+YxGw==" }, "react-remove-scroll": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.1.tgz", - "integrity": "sha512-HpMh8+oahmIdOuS5aFKKY6Pyog+FNaZV/XyJOq7b4YFwsFHe5yYfdbIalI4k3vU2nSDql7YskmUseHsRrJqIPA==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz", + "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==", "requires": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", @@ -40859,16 +40834,6 @@ "tslib": "^2.0.0" } }, - "react-textarea-autosize": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.9.tgz", - "integrity": "sha512-U1DGlIQN5AwgjTyOEnI1oCcMuEr1pv1qOtklB2l4nyMGbHzWrI0eFsYK0zos2YWqAolJyG0IWJaqWmWj5ETh0A==", - "requires": { - "@babel/runtime": "^7.20.13", - "use-composed-ref": "^1.3.0", - "use-latest": "^1.2.1" - } - }, "read": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/read/-/read-4.1.0.tgz", @@ -42236,6 +42201,11 @@ "jquery": ">=1.2.6" } }, + "tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==" + }, "tapable": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", @@ -42600,9 +42570,12 @@ } }, "type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==" + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.6.0.tgz", + "integrity": "sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==", + "requires": { + "tagged-tag": "^1.0.0" + } }, "type-func": { "version": "1.0.3", @@ -43019,24 +42992,6 @@ "tslib": "^2.0.0" } }, - "use-composed-ref": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.4.0.tgz", - "integrity": "sha512-djviaxuOOh7wkj0paeO1Q/4wMZ8Zrnag5H6yBvzN7AKKe8beOaED9SF5/ByLqsku8NP4zQqsvM2u3ew/tJK8/w==" - }, - "use-isomorphic-layout-effect": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz", - "integrity": "sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==" - }, - "use-latest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.3.0.tgz", - "integrity": "sha512-mhg3xdm9NaM8q+gLT8KryJPnRFOz1/5XPBhmDEVZK1webPzDjrPk7f/mbpeLqTgB9msytYWANxgALOCJKnLvcQ==", - "requires": { - "use-isomorphic-layout-effect": "^1.1.1" - } - }, "use-sidecar": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 329d8cd17ed..dc2a22bf8e2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -101,7 +101,7 @@ "@hotwired/turbo-rails": "^8.0.20", "@knowledgecode/delegate": "^0.10.3", "@kolkov/ngx-gallery": "^2.0.1", - "@mantine/core": "^8.3.13", + "@mantine/core": "^9.0.1", "@mantine/hooks": "^9.0.1", "@mantine/utils": "^6.0.22", "@ng-select/ng-option-highlight": "^21.8.2", From 2198440d4e1c419c60812db28564b66a20a63574 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 00:10:52 +0200 Subject: [PATCH 075/381] Bump fast-uri from 3.0.6 to 3.1.2 in /frontend (#23145) Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.0.6 to 3.1.2. - [Release notes](https://github.com/fastify/fast-uri/releases) - [Commits](https://github.com/fastify/fast-uri/compare/v3.0.6...v3.1.2) --- updated-dependencies: - dependency-name: fast-uri dependency-version: 3.1.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2659ba49bfb..363663b3bb5 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -15551,9 +15551,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", "funding": [ { "type": "github", @@ -36462,9 +36462,9 @@ "dev": true }, "fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==" }, "faye-websocket": { "version": "0.11.4", From 2ca3951887842aa9c1d34ca02f25143ea61233c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 00:11:15 +0200 Subject: [PATCH 076/381] Bump @typescript-eslint/eslint-plugin from 8.53.0 to 8.59.3 in /frontend (#23056) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.53.0 to 8.59.3. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.59.3/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.59.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 823 ++++++++++++------------------------- frontend/package.json | 2 +- 2 files changed, 273 insertions(+), 552 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 363663b3bb5..a7d9135074b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -159,7 +159,7 @@ "@types/urijs": "^1.19.26", "@types/uuid": "^11.0.0", "@types/webpack-env": "^1.16.0", - "@typescript-eslint/eslint-plugin": "8.53.0", + "@typescript-eslint/eslint-plugin": "8.59.3", "@typescript-eslint/parser": "8.53.1", "@vitest/browser-playwright": "^4.1.6", "@vitest/coverage-v8": "^4.1.6", @@ -2650,23 +2650,6 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@babel/helper-globals": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", @@ -6811,22 +6794,6 @@ "node": ">=6.6.0" } }, - "node_modules/@modelcontextprotocol/sdk/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@modelcontextprotocol/sdk/node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", @@ -10145,19 +10112,19 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.0.tgz", - "integrity": "sha512-eEXsVvLPu8Z4PkFibtuFJLJOTAV/nPdgtSjkGoPpddpFk3/ym2oy97jynY6ic2m6+nc5M8SE1e9v/mHKsulcJg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz", + "integrity": "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/type-utils": "8.53.0", - "@typescript-eslint/utils": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/type-utils": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10167,19 +10134,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.53.0", - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "@typescript-eslint/parser": "^8.59.3", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/project-service": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.0.tgz", - "integrity": "sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.53.0", - "@typescript-eslint/types": "^8.53.0", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "engines": { @@ -10190,17 +10157,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz", - "integrity": "sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10211,9 +10178,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz", - "integrity": "sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10223,13 +10190,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.0.tgz", - "integrity": "sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10240,20 +10207,20 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz", - "integrity": "sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "dependencies": { - "@typescript-eslint/project-service": "8.53.0", - "@typescript-eslint/tsconfig-utils": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10263,19 +10230,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.0.tgz", - "integrity": "sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10285,18 +10252,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz", - "integrity": "sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.53.0", - "eslint-visitor-keys": "^4.2.1" + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10306,39 +10273,34 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": "18 || 20 || >=22" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "dependencies": { - "ms": "^2.1.3" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": "18 || 20 || >=22" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" @@ -10354,15 +10316,15 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.2" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -10392,23 +10354,6 @@ "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/project-service": { "version": "8.53.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.1.tgz", @@ -10430,23 +10375,6 @@ "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/@typescript-eslint/project-service/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.53.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.1.tgz", @@ -10481,16 +10409,16 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.53.0.tgz", - "integrity": "sha512-BBAUhlx7g4SmcLhn8cnbxoxtmS7hcq39xKCgiutL3oNx1TaIp+cny51s8ewnKMpVUKQUGb41RAUWZ9kxYdovuw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz", + "integrity": "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0", - "@typescript-eslint/utils": "8.53.0", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3", "debug": "^4.4.3", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10500,18 +10428,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/project-service": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.0.tgz", - "integrity": "sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.53.0", - "@typescript-eslint/types": "^8.53.0", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "engines": { @@ -10522,17 +10450,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz", - "integrity": "sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10543,9 +10471,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz", - "integrity": "sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10555,13 +10483,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.0.tgz", - "integrity": "sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10572,20 +10500,20 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz", - "integrity": "sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "dependencies": { - "@typescript-eslint/project-service": "8.53.0", - "@typescript-eslint/tsconfig-utils": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10595,19 +10523,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.0.tgz", - "integrity": "sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10617,18 +10545,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <6.0.0" + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz", - "integrity": "sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.53.0", - "eslint-visitor-keys": "^4.2.1" + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10638,54 +10566,49 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "node_modules/@typescript-eslint/type-utils/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": "18 || 20 || >=22" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/@typescript-eslint/type-utils/node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "dependencies": { - "ms": "^2.1.3" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": "18 || 20 || >=22" } }, "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.2" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -10740,23 +10663,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "9.0.9", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", @@ -10927,23 +10833,6 @@ "node": "18 || 20 || >=22" } }, - "node_modules/@typescript-eslint/utils/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -11334,24 +11223,6 @@ "node": "18 || 20 || >=22" } }, - "node_modules/@vitest/eslint-plugin/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@vitest/eslint-plugin/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -14005,9 +13876,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dependencies": { "ms": "^2.1.3" }, @@ -22622,22 +22493,6 @@ "node": ">= 18" } }, - "node_modules/router/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/router/node_modules/path-to-regexp": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.0.tgz", @@ -24522,22 +24377,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/tuf-js/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/turbo_power": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/turbo_power/-/turbo_power-0.7.1.tgz", @@ -24929,23 +24768,6 @@ "node": "18 || 20 || >=22" } }, - "node_modules/typescript-eslint/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -28020,17 +27842,6 @@ "debug": "^4.4.3", "lodash.debounce": "^4.0.8", "resolve": "^1.22.11" - }, - "dependencies": { - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - } } }, "@babel/helper-globals": { @@ -30598,14 +30409,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==" }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "requires": { - "ms": "^2.1.3" - } - }, "encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", @@ -32741,115 +32544,112 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.0.tgz", - "integrity": "sha512-eEXsVvLPu8Z4PkFibtuFJLJOTAV/nPdgtSjkGoPpddpFk3/ym2oy97jynY6ic2m6+nc5M8SE1e9v/mHKsulcJg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz", + "integrity": "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/type-utils": "8.53.0", - "@typescript-eslint/utils": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/type-utils": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "dependencies": { "@typescript-eslint/project-service": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.0.tgz", - "integrity": "sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "requires": { - "@typescript-eslint/tsconfig-utils": "^8.53.0", - "@typescript-eslint/types": "^8.53.0", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" } }, "@typescript-eslint/scope-manager": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz", - "integrity": "sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "requires": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" } }, "@typescript-eslint/tsconfig-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz", - "integrity": "sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true }, "@typescript-eslint/types": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.0.tgz", - "integrity": "sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz", - "integrity": "sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "requires": { - "@typescript-eslint/project-service": "8.53.0", - "@typescript-eslint/tsconfig-utils": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" } }, "@typescript-eslint/utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.0.tgz", - "integrity": "sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" } }, "@typescript-eslint/visitor-keys": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz", - "integrity": "sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.53.0", - "eslint-visitor-keys": "^4.2.1" + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" } }, + "balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true + }, "brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "requires": { - "balanced-match": "^1.0.0" - } - }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" + "balanced-match": "^4.0.2" } }, "eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true }, "ignore": { @@ -32859,12 +32659,12 @@ "dev": true }, "minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "requires": { - "brace-expansion": "^2.0.2" + "brace-expansion": "^5.0.5" } } } @@ -32880,17 +32680,6 @@ "@typescript-eslint/typescript-estree": "8.53.1", "@typescript-eslint/visitor-keys": "8.53.1", "debug": "^4.4.3" - }, - "dependencies": { - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - } } }, "@typescript-eslint/project-service": { @@ -32902,17 +32691,6 @@ "@typescript-eslint/tsconfig-utils": "^8.53.1", "@typescript-eslint/types": "^8.53.1", "debug": "^4.4.3" - }, - "dependencies": { - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - } } }, "@typescript-eslint/scope-manager": { @@ -32932,121 +32710,118 @@ "dev": true }, "@typescript-eslint/type-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.53.0.tgz", - "integrity": "sha512-BBAUhlx7g4SmcLhn8cnbxoxtmS7hcq39xKCgiutL3oNx1TaIp+cny51s8ewnKMpVUKQUGb41RAUWZ9kxYdovuw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz", + "integrity": "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==", "dev": true, "requires": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0", - "@typescript-eslint/utils": "8.53.0", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3", "debug": "^4.4.3", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "dependencies": { "@typescript-eslint/project-service": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.0.tgz", - "integrity": "sha512-Bl6Gdr7NqkqIP5yP9z1JU///Nmes4Eose6L1HwpuVHwScgDPPuEWbUVhvlZmb8hy0vX9syLk5EGNL700WcBlbg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "requires": { - "@typescript-eslint/tsconfig-utils": "^8.53.0", - "@typescript-eslint/types": "^8.53.0", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" } }, "@typescript-eslint/scope-manager": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.0.tgz", - "integrity": "sha512-kWNj3l01eOGSdVBnfAF2K1BTh06WS0Yet6JUgb9Cmkqaz3Jlu0fdVUjj9UI8gPidBWSMqDIglmEXifSgDT/D0g==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "requires": { - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" } }, "@typescript-eslint/tsconfig-utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.0.tgz", - "integrity": "sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true }, "@typescript-eslint/types": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.0.tgz", - "integrity": "sha512-Bmh9KX31Vlxa13+PqPvt4RzKRN1XORYSLlAE+sO1i28NkisGbTtSLFVB3l7PWdHtR3E0mVMuC7JilWJ99m2HxQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.0.tgz", - "integrity": "sha512-pw0c0Gdo7Z4xOG987u3nJ8akL9093yEEKv8QTJ+Bhkghj1xyj8cgPaavlr9rq8h7+s6plUJ4QJYw2gCZodqmGw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "requires": { - "@typescript-eslint/project-service": "8.53.0", - "@typescript-eslint/tsconfig-utils": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/visitor-keys": "8.53.0", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" } }, "@typescript-eslint/utils": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.0.tgz", - "integrity": "sha512-XDY4mXTez3Z1iRDI5mbRhH4DFSt46oaIFsLg+Zn97+sYrXACziXSQcSelMybnVZ5pa1P6xYkPr5cMJyunM1ZDA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.53.0", - "@typescript-eslint/types": "8.53.0", - "@typescript-eslint/typescript-estree": "8.53.0" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" } }, "@typescript-eslint/visitor-keys": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.0.tgz", - "integrity": "sha512-LZ2NqIHFhvFwxG0qZeLL9DvdNAHPGCY5dIRwBhyYeU+LfLhcStE1ImjsuTG/WaVh3XysGaeLW8Rqq7cGkPCFvw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.53.0", - "eslint-visitor-keys": "^4.2.1" + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" } }, + "balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true + }, "brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "requires": { - "balanced-match": "^1.0.0" - } - }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" + "balanced-match": "^4.0.2" } }, "eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true }, "minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "requires": { - "brace-expansion": "^2.0.2" + "brace-expansion": "^5.0.5" } } } @@ -33083,15 +32858,6 @@ "balanced-match": "^1.0.0" } }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "minimatch": { "version": "9.0.9", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", @@ -33190,15 +32956,6 @@ "balanced-match": "^4.0.2" } }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -33416,15 +33173,6 @@ "balanced-match": "^4.0.2" } }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -35278,9 +35026,9 @@ } }, "debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "requires": { "ms": "^2.1.3" } @@ -41228,14 +40976,6 @@ "path-to-regexp": "^8.0.0" }, "dependencies": { - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "requires": { - "ms": "^2.1.3" - } - }, "path-to-regexp": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.0.tgz", @@ -42538,16 +42278,6 @@ "@tufjs/models": "4.1.0", "debug": "^4.4.3", "make-fetch-happen": "^15.0.1" - }, - "dependencies": { - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "requires": { - "ms": "^2.1.3" - } - } } }, "turbo_power": { @@ -42794,15 +42524,6 @@ "balanced-match": "^4.0.2" } }, - "debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "requires": { - "ms": "^2.1.3" - } - }, "eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index dc2a22bf8e2..1f83c2f1ff0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -37,7 +37,7 @@ "@types/urijs": "^1.19.26", "@types/uuid": "^11.0.0", "@types/webpack-env": "^1.16.0", - "@typescript-eslint/eslint-plugin": "8.53.0", + "@typescript-eslint/eslint-plugin": "8.59.3", "@typescript-eslint/parser": "8.53.1", "@vitest/browser-playwright": "^4.1.6", "@vitest/coverage-v8": "^4.1.6", From 4dd37920af8204bdc2c7efa9dcb1069f267c5820 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 00:12:46 +0200 Subject: [PATCH 077/381] Bump protobufjs from 7.5.4 to 7.5.5 (#22805) Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.5.4 to 7.5.5. - [Release notes](https://github.com/protobufjs/protobuf.js/releases) - [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.4...protobufjs-v7.5.5) --- updated-dependencies: - dependency-name: protobufjs dependency-version: 7.5.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a27a9ab135..91d34ac3fca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1759,12 +1759,11 @@ } }, "node_modules/protobufjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", - "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz", + "integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==", "dev": true, "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", From 4303ff08315d948f23c040257859b6bd31426e68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 00:34:58 +0200 Subject: [PATCH 078/381] Bump @babel/plugin-transform-modules-systemjs from 7.29.0 to 7.29.4 in /frontend (#23147) Bump @babel/plugin-transform-modules-systemjs in /frontend Bumps [@babel/plugin-transform-modules-systemjs](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-modules-systemjs) from 7.29.0 to 7.29.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.4/packages/babel-plugin-transform-modules-systemjs) --- updated-dependencies: - dependency-name: "@babel/plugin-transform-modules-systemjs" dependency-version: 7.29.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index a7d9135074b..3a4f7183cab 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -3385,9 +3385,9 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.0.tgz", - "integrity": "sha512-PrujnVFbOdUpw4UHiVwKvKRLMMic8+eC0CuNlxjsyZUiBjhFdPsewdXCkveh2KqBA9/waD0W1b4hXSOBQJezpQ==", + "version": "7.29.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.4.tgz", + "integrity": "sha512-N7QmZ0xRZfjHOfZeQLJjwgX2zS9pdGHSVl/cjSGlo4dXMqvurfxXDMKY4RqEKzPozV78VMcd0lxyG13mlbKc4w==", "dev": true, "dependencies": { "@babel/helper-module-transforms": "^7.28.6", @@ -28307,9 +28307,9 @@ } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.0.tgz", - "integrity": "sha512-PrujnVFbOdUpw4UHiVwKvKRLMMic8+eC0CuNlxjsyZUiBjhFdPsewdXCkveh2KqBA9/waD0W1b4hXSOBQJezpQ==", + "version": "7.29.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.4.tgz", + "integrity": "sha512-N7QmZ0xRZfjHOfZeQLJjwgX2zS9pdGHSVl/cjSGlo4dXMqvurfxXDMKY4RqEKzPozV78VMcd0lxyG13mlbKc4w==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.28.6", From 0f23a644acd3ea74d9dc26d91f995cac0d9e0aed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 00:35:40 +0200 Subject: [PATCH 079/381] Bump typescript-eslint from 8.56.1 to 8.59.3 in /frontend (#23155) Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.56.1 to 8.59.3. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.59.3/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-version: 8.59.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- frontend/package-lock.json | 931 ++++++++----------------------------- frontend/package.json | 2 +- 2 files changed, 191 insertions(+), 742 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 3a4f7183cab..33ad29cb669 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -177,7 +177,7 @@ "source-map-explorer": "^2.5.2", "ts-node": "~10.9.2", "typescript": "^5.9.3", - "typescript-eslint": "^8.56.1", + "typescript-eslint": "^8.59.3", "vitest": "^4.1.6", "wscat": "^6.1.0" }, @@ -10139,27 +10139,6 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/project-service": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", - "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", - "dev": true, - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.59.3", - "@typescript-eslint/types": "^8.59.3", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", @@ -10177,22 +10156,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", - "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", @@ -10206,56 +10169,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", - "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", - "dev": true, - "dependencies": { - "@typescript-eslint/project-service": "8.59.3", - "@typescript-eslint/tsconfig-utils": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/visitor-keys": "8.59.3", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", - "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/typescript-estree": "8.59.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", @@ -10273,27 +10186,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", - "dev": true, - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -10315,21 +10207,6 @@ "node": ">= 4" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@typescript-eslint/parser": { "version": "8.53.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.53.1.tgz", @@ -10453,23 +10330,6 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", - "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/visitor-keys": "8.59.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/tsconfig-utils": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", @@ -10526,29 +10386,6 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", - "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/typescript-estree": "8.59.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", @@ -10679,15 +10516,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz", - "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10698,17 +10535,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/project-service": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", - "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.56.1", - "@typescript-eslint/types": "^8.56.1", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "engines": { @@ -10719,17 +10556,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", - "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10740,9 +10577,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", - "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10752,13 +10589,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", - "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10769,20 +10606,20 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", - "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "dependencies": { - "@typescript-eslint/project-service": "8.56.1", - "@typescript-eslint/tsconfig-utils": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -10792,16 +10629,16 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", - "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -10822,9 +10659,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "dependencies": { "balanced-match": "^4.0.2" @@ -10846,12 +10683,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "dependencies": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.5" }, "engines": { "node": "18 || 20 || >=22" @@ -11059,28 +10896,6 @@ } } }, - "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/project-service": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.2.tgz", - "integrity": "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.59.2", - "@typescript-eslint/types": "^8.59.2", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.2.tgz", @@ -11099,23 +10914,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.2.tgz", - "integrity": "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/types": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.2.tgz", @@ -11130,58 +10928,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.2.tgz", - "integrity": "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.59.2", - "@typescript-eslint/tsconfig-utils": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.2.tgz", - "integrity": "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" - } - }, "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.2.tgz", @@ -11200,29 +10946,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vitest/eslint-plugin/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@vitest/eslint-plugin/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, "node_modules/@vitest/eslint-plugin/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -11236,22 +10959,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@vitest/eslint-plugin/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@vitest/expect": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.6.tgz", @@ -24538,15 +24245,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.1.tgz", - "integrity": "sha512-U4lM6pjmBX7J5wk4szltF7I1cGBHXZopnAXCMXb3+fZ3B/0Z3hq3wS/CCUB2NZBNAExK92mCU2tEohWuwVMsDQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.3.tgz", + "integrity": "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.56.1", - "@typescript-eslint/parser": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/utils": "8.56.1" + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -24557,47 +24264,19 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz", - "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/type-utils": "8.56.1", - "@typescript-eslint/utils": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", - "ignore": "^7.0.5", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.4.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.56.1", - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz", - "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.3.tgz", + "integrity": "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3" }, "engines": { @@ -24609,17 +24288,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/project-service": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", - "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.56.1", - "@typescript-eslint/types": "^8.56.1", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" }, "engines": { @@ -24630,17 +24309,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", - "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -24651,9 +24330,9 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", - "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -24663,37 +24342,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" - } - }, - "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz", - "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/utils": "8.56.1", - "debug": "^4.4.3", - "ts-api-utils": "^2.4.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", - "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -24704,20 +24359,20 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", - "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "dependencies": { - "@typescript-eslint/project-service": "8.56.1", - "@typescript-eslint/tsconfig-utils": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -24727,16 +24382,16 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <6.0.0" + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", - "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -24757,9 +24412,9 @@ } }, "node_modules/typescript-eslint/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "dependencies": { "balanced-match": "^4.0.2" @@ -24780,22 +24435,13 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/typescript-eslint/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/typescript-eslint/node_modules/minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "dependencies": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.5" }, "engines": { "node": "18 || 20 || >=22" @@ -32559,17 +32205,6 @@ "ts-api-utils": "^2.5.0" }, "dependencies": { - "@typescript-eslint/project-service": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", - "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", - "dev": true, - "requires": { - "@typescript-eslint/tsconfig-utils": "^8.59.3", - "@typescript-eslint/types": "^8.59.3", - "debug": "^4.4.3" - } - }, "@typescript-eslint/scope-manager": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", @@ -32580,47 +32215,12 @@ "@typescript-eslint/visitor-keys": "8.59.3" } }, - "@typescript-eslint/tsconfig-utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", - "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", - "dev": true - }, "@typescript-eslint/types": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true }, - "@typescript-eslint/typescript-estree": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", - "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", - "dev": true, - "requires": { - "@typescript-eslint/project-service": "8.59.3", - "@typescript-eslint/tsconfig-utils": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/visitor-keys": "8.59.3", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - } - }, - "@typescript-eslint/utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", - "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/typescript-estree": "8.59.3" - } - }, "@typescript-eslint/visitor-keys": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", @@ -32631,21 +32231,6 @@ "eslint-visitor-keys": "^5.0.0" } }, - "balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true - }, - "brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", - "dev": true, - "requires": { - "balanced-match": "^4.0.2" - } - }, "eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -32657,15 +32242,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true - }, - "minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "requires": { - "brace-expansion": "^5.0.5" - } } } }, @@ -32733,16 +32309,6 @@ "debug": "^4.4.3" } }, - "@typescript-eslint/scope-manager": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", - "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/visitor-keys": "8.59.3" - } - }, "@typescript-eslint/tsconfig-utils": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", @@ -32772,18 +32338,6 @@ "ts-api-utils": "^2.5.0" } }, - "@typescript-eslint/utils": { - "version": "8.59.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", - "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.3", - "@typescript-eslint/types": "8.59.3", - "@typescript-eslint/typescript-estree": "8.59.3" - } - }, "@typescript-eslint/visitor-keys": { "version": "8.59.3", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", @@ -32870,74 +32424,74 @@ } }, "@typescript-eslint/utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz", - "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1" + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" }, "dependencies": { "@typescript-eslint/project-service": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", - "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "requires": { - "@typescript-eslint/tsconfig-utils": "^8.56.1", - "@typescript-eslint/types": "^8.56.1", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" } }, "@typescript-eslint/scope-manager": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", - "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "requires": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" } }, "@typescript-eslint/tsconfig-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", - "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true }, "@typescript-eslint/types": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", - "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", - "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "requires": { - "@typescript-eslint/project-service": "8.56.1", - "@typescript-eslint/tsconfig-utils": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" } }, "@typescript-eslint/visitor-keys": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", - "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" } }, @@ -32948,9 +32502,9 @@ "dev": true }, "brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "requires": { "balanced-match": "^4.0.2" @@ -32963,12 +32517,12 @@ "dev": true }, "minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "requires": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.5" } } } @@ -33086,17 +32640,6 @@ "@typescript-eslint/utils": "^8.58.0" }, "dependencies": { - "@typescript-eslint/project-service": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.2.tgz", - "integrity": "sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw==", - "dev": true, - "requires": { - "@typescript-eslint/tsconfig-utils": "^8.59.2", - "@typescript-eslint/types": "^8.59.2", - "debug": "^4.4.3" - } - }, "@typescript-eslint/scope-manager": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.2.tgz", @@ -33107,47 +32650,12 @@ "@typescript-eslint/visitor-keys": "8.59.2" } }, - "@typescript-eslint/tsconfig-utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.2.tgz", - "integrity": "sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw==", - "dev": true - }, "@typescript-eslint/types": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.2.tgz", "integrity": "sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q==", "dev": true }, - "@typescript-eslint/typescript-estree": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.2.tgz", - "integrity": "sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg==", - "dev": true, - "requires": { - "@typescript-eslint/project-service": "8.59.2", - "@typescript-eslint/tsconfig-utils": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/visitor-keys": "8.59.2", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - } - }, - "@typescript-eslint/utils": { - "version": "8.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.2.tgz", - "integrity": "sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.59.2", - "@typescript-eslint/types": "8.59.2", - "@typescript-eslint/typescript-estree": "8.59.2" - } - }, "@typescript-eslint/visitor-keys": { "version": "8.59.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.2.tgz", @@ -33158,35 +32666,11 @@ "eslint-visitor-keys": "^5.0.0" } }, - "balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true - }, - "brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", - "dev": true, - "requires": { - "balanced-match": "^4.0.2" - } - }, "eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true - }, - "minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "requires": { - "brace-expansion": "^5.0.5" - } } } }, @@ -42396,116 +41880,87 @@ "dev": true }, "typescript-eslint": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.1.tgz", - "integrity": "sha512-U4lM6pjmBX7J5wk4szltF7I1cGBHXZopnAXCMXb3+fZ3B/0Z3hq3wS/CCUB2NZBNAExK92mCU2tEohWuwVMsDQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.59.3.tgz", + "integrity": "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "8.56.1", - "@typescript-eslint/parser": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/utils": "8.56.1" + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3" }, "dependencies": { - "@typescript-eslint/eslint-plugin": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz", - "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==", - "dev": true, - "requires": { - "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/type-utils": "8.56.1", - "@typescript-eslint/utils": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", - "ignore": "^7.0.5", - "natural-compare": "^1.4.0", - "ts-api-utils": "^2.4.0" - } - }, "@typescript-eslint/parser": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz", - "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.3.tgz", + "integrity": "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3" } }, "@typescript-eslint/project-service": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", - "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", "dev": true, "requires": { - "@typescript-eslint/tsconfig-utils": "^8.56.1", - "@typescript-eslint/types": "^8.56.1", + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", "debug": "^4.4.3" } }, "@typescript-eslint/scope-manager": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", - "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", "dev": true, "requires": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1" + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" } }, "@typescript-eslint/tsconfig-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", - "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", "dev": true }, - "@typescript-eslint/type-utils": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz", - "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/typescript-estree": "8.56.1", - "@typescript-eslint/utils": "8.56.1", - "debug": "^4.4.3", - "ts-api-utils": "^2.4.0" - } - }, "@typescript-eslint/types": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", - "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", - "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", "dev": true, "requires": { - "@typescript-eslint/project-service": "8.56.1", - "@typescript-eslint/tsconfig-utils": "8.56.1", - "@typescript-eslint/types": "8.56.1", - "@typescript-eslint/visitor-keys": "8.56.1", + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.4.0" + "ts-api-utils": "^2.5.0" } }, "@typescript-eslint/visitor-keys": { - "version": "8.56.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", - "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "^5.0.0" } }, @@ -42516,9 +41971,9 @@ "dev": true }, "brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "requires": { "balanced-match": "^4.0.2" @@ -42530,19 +41985,13 @@ "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true }, - "ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true - }, "minimatch": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", - "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "requires": { - "brace-expansion": "^5.0.2" + "brace-expansion": "^5.0.5" } } } diff --git a/frontend/package.json b/frontend/package.json index 1f83c2f1ff0..acd1c25ea03 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -55,7 +55,7 @@ "source-map-explorer": "^2.5.2", "ts-node": "~10.9.2", "typescript": "^5.9.3", - "typescript-eslint": "^8.56.1", + "typescript-eslint": "^8.59.3", "vitest": "^4.1.6", "wscat": "^6.1.0" }, From 3ca0c4d36118706e54c74e313451806c5b49238e Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Tue, 26 May 2026 04:28:22 +0000 Subject: [PATCH 080/381] update locales from crowdin [ci skip] --- config/locales/crowdin/vi.seeders.yml | 20 +-- config/locales/crowdin/vi.yml | 148 +++++++++--------- .../auth_saml/config/locales/crowdin/vi.yml | 4 +- .../backlogs/config/locales/crowdin/vi.yml | 136 ++++++++-------- modules/boards/config/locales/crowdin/vi.yml | 2 +- modules/costs/config/locales/crowdin/vi.yml | 2 +- .../config/locales/crowdin/vi.yml | 2 +- .../config/locales/crowdin/vi.yml | 2 +- modules/meeting/config/locales/crowdin/ru.yml | 2 +- modules/meeting/config/locales/crowdin/vi.yml | 38 ++--- .../reporting/config/locales/crowdin/vi.yml | 2 +- .../config/locales/crowdin/vi.yml | 20 +-- .../storages/config/locales/crowdin/vi.yml | 30 ++-- .../webhooks/config/locales/crowdin/vi.yml | 4 +- modules/wikis/config/locales/crowdin/vi.yml | 12 +- 15 files changed, 212 insertions(+), 212 deletions(-) diff --git a/config/locales/crowdin/vi.seeders.yml b/config/locales/crowdin/vi.seeders.yml index 92d9b9b1015..d92158342ec 100644 --- a/config/locales/crowdin/vi.seeders.yml +++ b/config/locales/crowdin/vi.seeders.yml @@ -224,9 +224,9 @@ vi: Trong mô-đun này, bạn có thể truyền đạt tin tức dự án cho các thành viên trong nhóm của mình. versions: item_0: - name: Tồn đọng lỗi + name: Backlog lỗi item_1: - name: Tồn đọng sản phẩm + name: Backlog sản phẩm item_2: name: Chạy nước rút 1 wiki: @@ -242,7 +242,7 @@ vi: * Chia làm 2 ô thời gian bổ sung 4h: - * Chủ sản phẩm trình bày [Product Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và các ưu tiên cho nhóm, đồng thời giải thích Mục tiêu Sprint mà nhóm phải đồng ý. Họ cùng nhau ưu tiên các chủ đề trong Product Backlog mà nhóm sẽ xử lý trong lần chạy nước rút tiếp theo. Nhóm cam kết thực hiện việc giao hàng đã thảo luận. + * Chủ sản phẩm trình bày [Product Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và các ưu tiên cho nhóm, đồng thời giải thích Mục tiêu Sprint mà nhóm phải đồng ý. Họ cùng nhau ưu tiên các chủ đề trong Product Backlog mà nhóm sẽ xử lý trong lần Sprint tiếp theo. Nhóm cam kết thực hiện việc giao hàng đã thảo luận. * Nhóm lập kế hoạch một cách tự động (không có Chủ sở hữu sản phẩm) một cách chi tiết và chia nhỏ các nhiệm vụ từ các yêu cầu đã thảo luận để hợp nhất [Sprint Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs). @@ -264,7 +264,7 @@ vi: * Thời gian đóng hộp (4 h). * Thời gian chuẩn bị tối đa một giờ cho mỗi người. - * Nhóm cho chủ sở hữu sản phẩm và những người quan tâm khác thấy những gì đã đạt được trong lần chạy nước rút này. + * Nhóm cho chủ sở hữu sản phẩm và những người quan tâm khác thấy những gì đã đạt được trong lần Sprint này. * Quan trọng: không có hình nộm và không có PowerPoint! Chức năng của sản phẩm vừa hoàn thiện (Tăng dần) phải được thể hiện. * Phản hồi từ Chủ sở hữu sản phẩm, các bên liên quan và những người khác là mong muốn và sẽ được đưa vào công việc tiếp theo. * Dựa trên các chức năng đã được chứng minh, Chủ sở hữu sản phẩm quyết định đưa phần tăng trưởng này vào hoạt động hoặc phát triển thêm. Khả năng này cho phép ROI sớm. @@ -276,7 +276,7 @@ vi: * Thời gian đóng khung (3 h). * Sau Sprint Review, sẽ được Scrum Master kiểm duyệt. - * Nhóm thảo luận về lần chạy nước rút: điều gì đã diễn ra tốt đẹp, điều gì cần được cải thiện để đạt năng suất cao hơn cho lần chạy nước rút tiếp theo hoặc thậm chí có nhiều niềm vui hơn. + * Nhóm thảo luận về lần Sprint: điều gì đã diễn ra tốt đẹp, điều gì cần được cải thiện để đạt năng suất cao hơn cho lần Sprint tiếp theo hoặc thậm chí có nhiều niềm vui hơn. item_3: name: Chạy nước rút 2 categories: @@ -285,7 +285,7 @@ vi: item_0: name: kế hoạch dự án item_1: - name: Sản phẩm tồn đọng + name: Sản phẩm Backlog item_2: name: Chạy nước rút 1 item_3: @@ -322,7 +322,7 @@ vi: 3. *Xem bảng Nhiệm vụ của bạn*: → Đi tới [Backlogs]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) → Nhấp vào mũi tên phải trên Sprint → Chọn [Task Board](##sprint:scrum_project__version__sprint_1). 4. *Tạo gói công việc mới*: → Đi tới [Work packages → Create]({{opSetting:base_url}}/projects/your-scrum-project/work_packages/new). 5. *Tạo và cập nhật kế hoạch dự án*: → Đi tới [Project plan](##query:scrum_project__query__project_plan) trong điều hướng dự án. - 6. *Tạo một wiki Sprint*: → Đi tới [Backlogs]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và mở wiki chạy nước rút từ menu thả xuống bên phải trong một lần chạy nước rút. Bạn có thể chỉnh sửa [wiki template]({{opSetting:base_url}}/projects/your-scrum-project/wiki/) tùy theo nhu cầu của mình. + 6. *Tạo một wiki Sprint*: → Đi tới [Backlogs]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và mở wiki Sprint từ menu thả xuống bên phải trong một lần Sprint. Bạn có thể chỉnh sửa [wiki template]({{opSetting:base_url}}/projects/your-scrum-project/wiki/) tùy theo nhu cầu của mình. 7. *Kích hoạt thêm các mô-đun*: → Đi tới [Project settings → Modules]({{opSetting:base_url}}/projects/your-scrum-project/settings/modules). Tại đây bạn sẽ tìm thấy [User Guides](https://www.openproject.org/docs/user-guide/) của chúng tôi. @@ -395,7 +395,7 @@ vi: * Chia làm 2 ô thời gian bổ sung 4h: - * Chủ sản phẩm trình bày [Product Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và các ưu tiên cho nhóm, đồng thời giải thích Mục tiêu Sprint mà nhóm phải đồng ý. Họ cùng nhau ưu tiên các chủ đề trong Product Backlog mà nhóm sẽ xử lý trong lần chạy nước rút tiếp theo. Nhóm cam kết thực hiện việc giao hàng đã thảo luận. + * Chủ sản phẩm trình bày [Product Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs) và các ưu tiên cho nhóm, đồng thời giải thích Mục tiêu Sprint mà nhóm phải đồng ý. Họ cùng nhau ưu tiên các chủ đề trong Product Backlog mà nhóm sẽ xử lý trong lần Sprint tiếp theo. Nhóm cam kết thực hiện việc giao hàng đã thảo luận. * Nhóm lập kế hoạch một cách tự động (không có Chủ sở hữu sản phẩm) một cách chi tiết và chia nhỏ các nhiệm vụ từ các yêu cầu đã thảo luận để hợp nhất [Sprint Backlog]({{opSetting:base_url}}/projects/your-scrum-project/backlogs). @@ -417,7 +417,7 @@ vi: * Thời gian đóng hộp (4 h). * Thời gian chuẩn bị tối đa một giờ cho mỗi người. - * Nhóm cho chủ sở hữu sản phẩm và những người quan tâm khác thấy những gì đã đạt được trong lần chạy nước rút này. + * Nhóm cho chủ sở hữu sản phẩm và những người quan tâm khác thấy những gì đã đạt được trong lần Sprint này. * Quan trọng: không có hình nộm và không có PowerPoint! Chức năng của sản phẩm vừa hoàn thiện (Tăng dần) phải được thể hiện. * Phản hồi từ Chủ sở hữu sản phẩm, các bên liên quan và những người khác là mong muốn và sẽ được đưa vào công việc tiếp theo. * Dựa trên các chức năng đã được chứng minh, Chủ sở hữu sản phẩm quyết định đưa phần tăng trưởng này vào hoạt động hoặc phát triển thêm. Khả năng này cho phép ROI sớm. @@ -429,7 +429,7 @@ vi: * Thời gian đóng khung (3 h). * Sau Sprint Review, sẽ được Scrum Master kiểm duyệt. - * Nhóm thảo luận về lần chạy nước rút: điều gì đã diễn ra tốt đẹp, điều gì cần được cải thiện để đạt năng suất cao hơn cho lần chạy nước rút tiếp theo hoặc thậm chí có nhiều niềm vui hơn. + * Nhóm thảo luận về lần Sprint: điều gì đã diễn ra tốt đẹp, điều gì cần được cải thiện để đạt năng suất cao hơn cho lần Sprint tiếp theo hoặc thậm chí có nhiều niềm vui hơn. statuses: item_0: name: Mới diff --git a/config/locales/crowdin/vi.yml b/config/locales/crowdin/vi.yml index e9635e7cfdd..d932daf2c81 100644 --- a/config/locales/crowdin/vi.yml +++ b/config/locales/crowdin/vi.yml @@ -127,7 +127,7 @@ vi: trial: thử nghiệm jemalloc_allocator: Bộ cấp phát bộ nhớ Jemalloc journal_aggregation: - caption: 'User actions on a work package (changing description, status, values, or writing comments) are grouped if performed within this period. It also controls notification and [webhook](webhook_link) delays. + caption: 'User actions on a gói công việc (work package) (changing description, status, values, or writing comments) are grouped if performed within this period. It also controls notification and [webhook](webhook_link) delays. ' import: @@ -145,8 +145,8 @@ vi: title: No Jira hosts configured yet description: Configure a Jira host to start importing items from Jira to this OpenProject instance. configuration: - title: Jira configuration - new: New configuration + title: Jira cấu hình + new: New cấu hình banner: title: Beta - Try it out! description: This Jira Migrator is currently in beta. We currently only support Jira Server/Data Center versions 10.x and 11.x. Cloud instances are not supported at this time. @@ -159,12 +159,12 @@ vi: name: Name url: Jira Server/Data Center URL personal_access_token: Personal Access Token - button_add: Add configuration - button_save: Save configuration - button_test: Test configuration + button_add: Add cấu hình + button_save: Save cấu hình + button_test: Test cấu hình button_delete_token: Delete token delete_token_confirm: Are you sure you want to delete the token? This will disable the Jira connection. - label_testing: Testing configuration... + label_testing: Testing cấu hình... token_deleted: Token was successfully deleted. test: success: Successfully connected to %{server} (version %{version}) @@ -173,7 +173,7 @@ vi: connection_error: 'Connection error: %{message}' parse_error: Failed to parse the response from the server. The server may not be a valid Jira instance. api_error: Jira API returned error status %{status}. Please check your Jira instance URL and API token. - token_error: Invalid API token. Please check your credentials in the configuration. + token_error: Invalid API token. Please check your credentials in the cấu hình. missing_credentials: Please provide both URL and Personal Access Token to test the connection invalid_url: Please provide a valid URL client: @@ -202,7 +202,7 @@ vi: index: description: You can import different sets of data with each import run. It is possible to undo an import run immediately after in review mode but not after finalizing. button_import_run: Import run - button_edit_configuration: Edit configuration + button_edit_configuration: Edit cấu hình status: initial: Start instance_meta_fetching: Fetching meta data @@ -223,7 +223,7 @@ vi: reverted: Reverted finalizing: Finalizing finalizing_error: Error during finalizing - finalizing_done: Completed + finalizing_done: Đã hoàn thành wizard: button_retry: Retry parts: @@ -232,7 +232,7 @@ vi: issues: other: "%{count} issues" work_packages: - other: "%{count} work packages" + other: "%{count} gói công việc (work package)s" types: other: "%{count} types" statuses: @@ -253,7 +253,7 @@ vi: sections: fetch_data: title: Fetch instance meta data - caption_done: Completed + caption_done: Đã hoàn thành description: Check what data is available for import in the host Jira instance. button_fetch: Check available data label_progress: Fetching data from Jira... @@ -262,7 +262,7 @@ vi: import_scope: title: Import scope caption: Choose what you want to import into OpenProject - caption_done: Completed + caption_done: Đã hoàn thành label_info: Please note that this import tool is in beta and cannot import all types of data. Here is a summary of what the host Jira instance offers for import and what this tool is able to import right now. description: Select what data you want to import from the available data fetched from the host Jira instance. label_supported_data: Supported data @@ -290,12 +290,12 @@ vi: users: Involved users and groups confirm_import: title: Import data - caption: Review your import settings and start the import - caption_done: Completed + caption: Review your import thiết lập and start the import + caption_done: Đã hoàn thành label_available_data: Data to be imported label_users_import_explanation: Users that are involved in selected projects (group memberships included) button_start: Start import - description: You are about to start an import run with the following settings. + description: You are about to start an import run with the following thiết lập. label_progress: Import in progress... label_import_data: Currently importing import_result: @@ -317,7 +317,7 @@ vi: import_dialog: title: Please make sure you have a backup! confirm_button: Start import - description: 'Imports change your OpenProject configuration. After the import you will have the opportunity to review the changes. While in review, you have an option to revert or approve the import. After approving the import reverting will no longer be possible. Therefore, please, make sure that you have [a backup of your OpenProject instance](link) before proceeding. + description: 'Imports change your OpenProject cấu hình. After the import you will have the opportunity to review the changes. While in review, you have an option to revert or approve the import. After approving the import reverting will no longer be possible. Therefore, please, make sure that you have [a backup of your OpenProject instance](link) before proceeding. ' confirm: I understand and have a backup @@ -421,7 +421,7 @@ vi: notification_text_default: "

Xin chào,

Một dự án mới đã được tạo: projectValue:name

Thank you

\n" work_packages_identifier: page_header: - description: Choose between classic numerical work package IDs or semantic project-specific ones that prepend the project identifier to the work package ID. + description: Choose between classic numerical gói công việc (work package) IDs or semantic project-specific ones that prepend the project identifier to the gói công việc (work package) ID. banner: existing_identifiers_notice: 'Existing identifiers for %{project_count} projects don''t meet requirements for project-based semantic identifiers. OpenProject can automatically update these so that they are valid as in the examples below. Click on ''Convert identifiers'' to update identifiers for all projects in this manner and enable project-based semantic identifiers. @@ -430,7 +430,7 @@ vi: label_project: Project label_previous_identifier: Previous identifier label_autofixed_suggestion: Future identifier - label_example_work_package_id: Example work package ID + label_example_work_package_id: Example gói công việc (work package) ID autofix_preview: error_too_long: Has to be 10 characters or fewer error_numerical: Cannot be purely numerical @@ -446,14 +446,14 @@ vi: button_autofix: Convert identifiers button_save: Convert identifiers dialog: - title: Change work package identifiers - heading: Enable project-based work package IDs? - description: 'This will change IDs for all work packages in all projects in this instance. Previous identifiers and URLs will continue to redirect properly. This change will take some time to complete. + title: Change gói công việc (work package) identifiers + heading: Enable project-based gói công việc (work package) IDs? + description: 'This will change IDs for all gói công việc (work package)s in all projects in this instance. Previous identifiers and URLs will continue to redirect properly. This change will take some time to complete. ' confirm_button: Change identifiers - checkbox_label: I understand that this will permanently change all work package IDs - success_banner: Successfully updated work package identifier format. + checkbox_label: I understand that this will permanently change all gói công việc (work package) IDs + success_banner: Successfully updated gói công việc (work package) identifier format. in_progress: header_semantic: Converting to project-based identifiers header_classic: Converting to numeric identifiers @@ -927,7 +927,7 @@ vi: change_identifier_dialog_title: Change project identifier change_identifier_format_hint_semantic: Only uppercase letters (A–Z), numbers or underscores. Max 10 characters. Must start with a letter. change_identifier_format_hint_legacy: Only lowercase letters (a–z), numbers, dashes or underscores. - change_identifier_warning: 'This will permanently change identifiers and URLs of all work packages in this project. The previous identifier and URLs will nevertheless continue to redirect properly. + change_identifier_warning: 'This will permanently change identifiers and URLs of all gói công việc (work package)s in this project. The previous identifier and URLs will nevertheless continue to redirect properly. ' subitems: @@ -1000,8 +1000,8 @@ vi: new_label: Ưu tiên mới creation_wizard: errors: - no_work_package_type: Failed to enable project initiation request because it requires at least one active work package type and this project has none. Please add at least one work package type to this project. - no_status_when_submitted: Failed to enable project initiation request because work package type %{type} requires at least one status associated with it. Please enable at least one status workflow for this work package type. + no_work_package_type: Failed to enable project initiation request because it requires at least one active gói công việc (work package) type and this project has none. Please add at least one gói công việc (work package) type to this project. + no_status_when_submitted: Failed to enable project initiation request because gói công việc (work package) type %{type} requires at least one status associated with it. Please enable at least one status workflow for this gói công việc (work package) type. export: description_attachment_export: Tạo tác được tạo sẽ được lưu dưới dạng tệp đính kèm PDF vào gói tác phẩm tạo tác. description_file_link_export: Gói công việc tạo tác sẽ có liên kết tệp tới tệp PDF được lưu trữ trong bộ lưu trữ tệp bên ngoài. Yêu cầu lưu trữ tệp đang hoạt động với các thư mục dự án được quản lý tự động cho dự án này. Hiện tại chỉ hỗ trợ lưu trữ tệp Nextcloud. @@ -1353,7 +1353,7 @@ vi: label_group: Group reset_to_defaults: Reset to defaults add_attribute_group: Add attribute group - add_query_group: Add table of related work packages + add_query_group: Add table of related gói công việc (work package)s delete_group: Delete group remove_attribute: Remove from group drag_to_activate: Drag fields from here to activate them @@ -1370,14 +1370,14 @@ vi: confirm_delete_group: Are you sure you want to delete this group? This action cannot be automatically reversed. group_name_label: Group name row_actions: Row actions - query_group_label: Work packages table + query_group_label: Gói công việc (Work Package)s table empty_group_hint: Drag attributes here - invalid_attribute_groups: The form configuration payload is invalid. - invalid_query: The embedded query configuration is invalid. - not_found: The requested form configuration item could not be found. + invalid_attribute_groups: The form cấu hình payload không hợp lệ. + invalid_query: The embedded query cấu hình không hợp lệ. + not_found: The requested form cấu hình item could not be found. untitled_group: Untitled group - reset_title: Reset form configuration - confirm_reset: Are you sure you want to reset the form configuration? + reset_title: Reset form cấu hình + confirm_reset: Are you sure you want to reset the form cấu hình? reset_description: 'This will reset the attributes to their default group and disable ALL custom fields. ' @@ -1437,10 +1437,10 @@ vi: mode: from_role: label: Copy to other roles - caption: Copy the current workflow to one or more roles inside the same work package type. If the selected role already has a workflow the current one will be overwritten. + caption: Copy the current workflow to one or more roles inside the same gói công việc (work package) type. If the selected role already has a workflow the current one will be overwritten. from_type: label: Copy to another type - caption: Copy the current workflow to another work packages type. If the selected type already has a workflow the current one will be overwritten. This affects all roles. + caption: Copy the current workflow to another gói công việc (work package)s type. If the selected type already has a workflow the current one will be overwritten. This affects all roles. from_roles: create: notice: @@ -1465,24 +1465,24 @@ vi: label: Filter by type name… page_headers: index_component: - description: Configure status transitions for each work package type. + description: Configure status transitions for each gói công việc (work package) type. work_flows: index: no_results_title_text: Hiện tại không có quy trình làm việc nào. work_packages: delete_dialog: - title: Delete work package - heading: Permanently delete this work package? - description: Are you sure you want to delete the work package "%{name}"? - confirm_descendants_deletion: I acknowledge that ALL descendants of this work package will be recursively removed. - cross_project_warning: 'Work packages from the following projects will be deleted: %{projects}' + title: Delete gói công việc (work package) + heading: Permanently delete this gói công việc (work package)? + description: Are you sure you want to delete the gói công việc (work package) "%{name}"? + confirm_descendants_deletion: I acknowledge that ALL descendants of this gói công việc (work package) will be recursively removed. + cross_project_warning: 'Gói công việc (Work Package)s from the following projects will be deleted: %{projects}' bulk_delete_dialog: - title: Delete %{count} work packages - heading: Permanently delete these %{count} work packages? - description: 'The following work packages and all associated data will be permanently deleted:' - description_with_children: 'The following work packages, including children and all associated data, will be permanently deleted:' - confirm_children_deletion: I acknowledge that all selected work packages and their children will be permanently deleted. - cross_project_warning: 'These work packages span multiple projects: %{projects}' + title: Delete %{count} gói công việc (work package)s + heading: Permanently delete these %{count} gói công việc (work package)s? + description: 'The following gói công việc (work package)s and all associated data will be permanently deleted:' + description_with_children: 'The following gói công việc (work package)s, including children and all associated data, will be permanently deleted:' + confirm_children_deletion: I acknowledge that all selected gói công việc (work package)s and their children will be permanently deleted. + cross_project_warning: 'These gói công việc (work package)s span multiple projects: %{projects}' children_label: 'The following children will also be deleted:' datepicker_modal: banner: @@ -1680,7 +1680,7 @@ vi: attributes: work_package_semantic_alias: identifier: Identifier - work_package: Work package + work_package: Gói công việc (Work Package) jira_import: projects: Projects import/jira: @@ -3458,10 +3458,10 @@ vi: ' new_features_list: line_0: Jira Migrator with support for basic custom fields. - line_1: Backlog buckets for structuring and prioritizing work packages during backlog refinement. + line_1: Backlog buckets for structuring and prioritizing gói công việc (work package)s during backlog refinement. line_2: Easier drag and drop and improved move options in the Backlogs module. line_3: Sprint Start and Complete buttons in the sprint header. - line_4: Copy workflow settings between roles. + line_4: Copy workflow thiết lập between roles. line_5: "'My Meetings' widget on the Home and Project Overview pages." links: upgrade_enterprise_edition: Nâng cấp lên phiên bản Enterprise @@ -3550,7 +3550,7 @@ vi: notifications_and_email: title: Notification and email tabs: - notifications: Notification settings + notifications: Notification thiết lập email_reminders: Email reminders access_tokens: description: Mã thông báo của nhà cung cấp được OpenProject phát hành, cho phép các ứng dụng khác truy cập vào nó. Mã thông báo của khách hàng được phát hành bởi các ứng dụng khác, cho phép OpenProject truy cập chúng. @@ -3634,8 +3634,8 @@ vi: enabled: Temporarily pause daily email reminders date_range: Pause period email_alerts: - title: Email alerts for other items that are not work packages - description: Notifications today are limited to work packages. You can choose to continue receiving email alerts for these events until they are included in notifications. + title: Email alerts for other items that are not gói công việc (work package)s + description: Notifications today are limited to gói công việc (work package)s. You can choose to continue receiving email alerts for these events until they are included in notifications. news_added: News added news_commented: Comment on a news item document_added: Document added @@ -3648,7 +3648,7 @@ vi: notifications: participating: title: Participating - description: Notifications for all activities in work packages you are involved in (assignee, accountable or watcher). + description: Notifications for all activities in gói công việc (work package)s you are involved in (assignee, accountable or watcher). submit_button: Update preferences mentioned: Mentioned watched: Watching @@ -3657,10 +3657,10 @@ vi: shared: Shared with me date_alerts: title: Date alerts - description: Automatic notifications when important dates are approaching for open work packages you are involved in (assignee, accountable or watcher). + description: Automatic notifications when important dates are approaching for open gói công việc (work package)s you are involved in (assignee, accountable or watcher). submit_button: Update date alerts start_date: Start date - due_date: Finish date + due_date: Ngày kết thúc overdue: Overdue times: same_day: On the same day @@ -3674,14 +3674,14 @@ vi: title: Non-participating description: Additional notifications for activities in all projects. submit_button: Update preferences - work_package_created: New work packages + work_package_created: New gói công việc (work package)s work_package_commented: All new comments work_package_processed: All status changes work_package_prioritized: All priority changes work_package_scheduled: All date changes project_specific_settings: - title: Project-specific notification settings - description: These project-specific settings override default settings above. + title: Project-specific notification thiết lập + description: These project-specific thiết lập override default thiết lập above. add_button: Add project-specific notifications dialog_title: Add project-specific notifications list_header: Projects with specific notifications @@ -4461,7 +4461,7 @@ vi: button_edit_non_working_time: Edit time off label_continued_from_previous_year: continued from previous year label_continues_into_next_year: continues into next year - label_end_date: Finish date + label_end_date: Ngày kết thúc label_working_days: Working days label_non_working_times_with_count: "%{year} time off (%{count})" label_non_working_times_summary: "%{year} summary" @@ -4531,10 +4531,10 @@ vi: note: 'Lưu ý: “%{note}”' sharing: work_packages: - allowed_actions_html: 'You have the following permissions on this work package: %{allowed_actions}. This can change depending on your project role and permissions.' + allowed_actions_html: 'You have the following permissions on this gói công việc (work package): %{allowed_actions}. This can change depending on your project role and permissions.' create_account: Để truy cập gói công việc này, bạn cần tạo và kích hoạt tài khoản trên %{instance}. open_work_package: Mở gói công việc - subject: Work package %{id} was shared with you + subject: Gói công việc (Work Package) %{id} was shared with you enterprise_text: Chia sẻ các gói công việc với người dùng không phải là thành viên của dự án. summary: user: "%{user} đã chia sẻ gói công việc với bạn với quyền %{role_rights}" @@ -4757,7 +4757,7 @@ vi: drag_handle: label: Drag to reorder menu: - label_actions: Work package actions + label_actions: Gói công việc (Work Package) actions parent: Parent permission_add_work_package_comments: Thêm nhận xét permission_add_work_packages: Thêm mới Gói công việc @@ -5039,7 +5039,7 @@ vi: update_timeout: |- Giữ thông tin dung lượng ổ đĩa cần thiết cuối cùng cho kho lưu trữ trong N phút. Vì việc tính dung lượng đĩa cần thiết của kho lưu trữ có thể tốn kém nên hãy tăng giá trị này để giảm tác động đến hiệu suất. - oauth_application_details_html: 'The client secret value will not be accessible again after you close this window. Please copy these values into the Nextcloud OpenProject Integration settings:' + oauth_application_details_html: 'The client secret value will not be accessible again after you close this window. Please copy these values into the Nextcloud OpenProject Integration thiết lập:' oauth_application_details_link_text: Đi tới trang cài đặt setup_documentation_details: 'Nếu bạn cần trợ giúp định cấu hình bộ lưu trữ tệp mới, vui lòng kiểm tra tài liệu:' setup_documentation_details_link_text: Thiết lập kho lưu trữ tập tin @@ -5133,7 +5133,7 @@ vi: setting_smtp_domain: Tên miền SMTP HELO setting_activity_days_default: Ngày hiển thị trên hoạt động dự án setting_api_tokens_enabled: Enable API tokens - setting_api_tokens_enabled_caption: 'Decide whether users can create personal API tokens in their account settings. These tokens can be used to access the different APIs of OpenProject, such as APIv3 and MCP. + setting_api_tokens_enabled_caption: 'Decide whether users can create personal API tokens in their account thiết lập. These tokens can be used to access the different APIs of OpenProject, such as APIv3 and MCP. ' setting_app_subtitle: phụ đề ứng dụng @@ -5214,7 +5214,7 @@ vi: setting_mail_handler_body_delimiter_regex: Xén các email phù hợp với biểu thức này setting_mail_handler_ignore_filenames: Tập tin đính kèm mail bị bỏ qua setting_new_project_user_role_id: Vai trò được cấp cho người dùng không phải quản trị viên tạo dự án - setting_new_project_user_role_id_caption: 'Only roles that include the permissions to edit project attributes and to manage members are listed, so that the creator can complete the project setup. + setting_new_project_user_role_id_caption: 'Only roles that include the permissions to edit thuộc tính dự án and to manage members are listed, so that the creator can complete the project setup. ' setting_new_project_send_confirmation_email: Gửi thông báo cho tác giả khi tạo dự án mới @@ -5288,11 +5288,11 @@ vi: setting_welcome_title: Tiêu đề khối chào mừng setting_welcome_on_homescreen: Hiển thị khối chào mừng trên màn hình chính setting_work_packages_identifier_classic: Instance-wide numerical sequence (default) - setting_work_packages_identifier_classic_caption: 'Every work package gets a sequential number starting with 1 and incremented with every new one. The numbers are unique within this instance so they remain the same even if work packages are moved between projects. + setting_work_packages_identifier_classic_caption: 'Every gói công việc (work package) gets a sequential number starting with 1 and incremented with every new one. The numbers are unique within this instance so they remain the same even if gói công việc (work package)s are moved between projects. ' setting_work_packages_identifier_semantic: Project-based semantic identifiers - setting_work_packages_identifier_semantic_caption: 'Every project has a unique identifier that is prefixed to the work package ID. If a work package moved to another project, a new identifier is generated but the old one continues to function. + setting_work_packages_identifier_semantic_caption: 'Every project has a unique identifier that is prefixed to the gói công việc (work package) ID. If a gói công việc (work package) moved to another project, a new identifier is generated but the old one continues to function. ' setting_work_package_list_default_highlighting_mode: Chế độ đánh dấu mặc định @@ -5478,7 +5478,7 @@ vi: section_work_week: tuần làm việc section_holidays_and_closures: Ngày lễ và đóng cửa work_packages: - work_package_identifier: Work package identifier + work_package_identifier: Gói công việc (Work Package) identifier not_allowed_text: Bạn không có quyền cần thiết để xem trang này. activities: enable_internal_comments: Bật nhận xét nội bộ @@ -5570,7 +5570,7 @@ vi: text_default_administrator_account_changed: Tài khoản quản trị viên mặc định đã thay đổi text_default_encoding: 'Mặc định: UTF-8' text_destroy: xóa - text_destroy_with_associated: 'There are additional objects associated with the work package(s) that are to be deleted. Those objects are of the following types:' + text_destroy_with_associated: 'There are additional objects associated with the gói công việc (work package)(s) that are to be deleted. Those objects are of the following types:' text_destroy_what_to_do: Bạn muốn làm gì? text_diff_truncated: "... Sự khác biệt này đã bị cắt bớt vì nó vượt quá kích thước tối đa có thể được hiển thị." text_email_delivery_not_configured: |- @@ -5629,7 +5629,7 @@ vi: text_plugin_assets_writable: Thư mục nội dung plugin có thể ghi text_powered_by: Được cung cấp bởi %{link} text_project_identifier_info: Chỉ cho phép chữ cái viết thường (a-z), số, dấu gạch ngang và dấu gạch dưới, phải bắt đầu bằng chữ cái viết thường. - text_project_identifier_description: The project identifier is prepended to all work package IDs. If the identifier is "PROJ" for example, the work package identifier will be "PROJ-12" or "PROJ-246". + text_project_identifier_description: The project identifier is prepended to all gói công việc (work package) IDs. If the identifier is "PROJ" for example, the gói công việc (work package) identifier will be "PROJ-12" or "PROJ-246". text_project_identifier_url_description: The project identifier is included in the URL of the project. text_project_identifier_handle_format: Must start with a letter and contain only uppercase letters, numbers, and underscores (max 10 characters). text_project_identifier_format: Must start with a lowercase letter. Only lowercase letters (a-z), numbers, dashes and underscores are allowed. @@ -5745,7 +5745,7 @@ vi: version_status_locked: bị khóa version_status_open: mở note: Lưu ý - note_password_login_disabled_link: Password login has been disabled through a [configuration setting](configuration_url). + note_password_login_disabled_link: Password login has been disabled through a [cấu hình setting](cấu hình_url). warning: Cảnh báo warning_attachments_not_saved: "%{count} tệp không thể lưu được." warning_imminent_user_limit_html: 'You invited more users than are supported by your current plan. Invited users may not be able to join your OpenProject environment. Please [upgrade your plan](upgrade_url) or block existing users in order to allow invited and registered users to join. @@ -5825,7 +5825,7 @@ vi: reminders: label_remind_at: ngày note_placeholder: Tại sao bạn đặt lời nhắc này? - create_success_message_html: Reminder set successfully. You will receive a notification for this work package %{reminder_time}. + create_success_message_html: Reminder set successfully. You will receive a notification for this gói công việc (work package) %{reminder_time}. success_update_message: Đã cập nhật lời nhắc thành công. success_deletion_message: Đã xóa lời nhắc thành công. sharing: diff --git a/modules/auth_saml/config/locales/crowdin/vi.yml b/modules/auth_saml/config/locales/crowdin/vi.yml index 320281b1569..3221522c751 100644 --- a/modules/auth_saml/config/locales/crowdin/vi.yml +++ b/modules/auth_saml/config/locales/crowdin/vi.yml @@ -50,13 +50,13 @@ vi: label_automatic_configuration: Cấu hình tự động label_metadata: Siêu dữ liệu label_metadata_endpoint: Điểm cuối siêu dữ liệu OpenProject - label_openproject_information: Thông tin dự án mở + label_openproject_information: Thông tin OpenProject label_configuration_details: Điểm cuối và chứng chỉ của nhà cung cấp danh tính label_configuration_encryption: Chữ ký và mã hóa label_add_new: Nhà cung cấp danh tính SAML mới label_edit: Chỉnh sửa nhà cung cấp danh tính SAML %{name} label_uid: Id người dùng nội bộ - label_mapping: lập bản đồ + label_mapping: Ánh xạ label_requested_attribute_for: 'Thuộc tính được yêu cầu cho: %{attribute}' no_results_table: Chưa có nhà cung cấp danh tính SAML nào được xác định. notice_created: Nhà cung cấp danh tính SAML mới đã được tạo thành công. diff --git a/modules/backlogs/config/locales/crowdin/vi.yml b/modules/backlogs/config/locales/crowdin/vi.yml index 5bb47c3e137..ccf9a15b4d1 100644 --- a/modules/backlogs/config/locales/crowdin/vi.yml +++ b/modules/backlogs/config/locales/crowdin/vi.yml @@ -27,50 +27,50 @@ vi: activerecord: attributes: project: - sprint_sharing: Sprint sharing - backlog_excluded_types: Excluded work package types - statuses_considered_closed: Statuses considered closed + sprint_sharing: Chia sẻ Sprint + backlog_excluded_types: Các loại gói công việc bị loại trừ khỏi Backlog + statuses_considered_closed: Các trạng thái được xem là đã đóng sprint: - duration: Duration - finish_date: Finish date - goal: Sprint goal - name: Sprint name - sharing: Sharing + duration: Thời lượng + finish_date: Ngày kết thúc + goal: Mục tiêu Sprint + name: Tên Sprint + sharing: Chia sẻ statuses: - in_planning: In planning - active: Active - completed: Completed + in_planning: Đang lập kế hoạch + active: Đang hoạt động + completed: Đã hoàn thành work_package: - backlog_bucket: Backlog Bucket + backlog_bucket: Nhóm Backlog (Bucket) backlogs_work_package_type: Loại Backlog position: Vị trí sprint: Sprint story_points: Điểm cốt truyện errors: messages: - must_be_in_planning: must be in planning to start. - only_one_active_sprint_allowed: only one active sprint is allowed per project. - dates_required: Start and finish dates are required in order to start the sprint. + must_be_in_planning: phải ở trạng thái đang lập kế hoạch để bắt đầu. + only_one_active_sprint_allowed: mỗi dự án chỉ được phép có một Sprint hoạt động tại một thời điểm. + dates_required: Bắt buộc phải có ngày bắt đầu và ngày kết thúc để bắt đầu Sprint. models: project: - receiving_sprints: is receiving shared sprints. Own sprints cannot be created. + receiving_sprints: đang nhận các Sprint được chia sẻ. Không thể tạo Sprint riêng. attributes: sprint_sharing: - share_all_projects_already_taken: cannot be set because project "%{name}" is already sharing with all projects. - share_all_projects_already_taken_anonymous: cannot be set because another project is already sharing with all projects. + share_all_projects_already_taken: không thể thiết lập vì dự án "%{name}" đã được chia sẻ với tất cả các dự án. + share_all_projects_already_taken_anonymous: không thể thiết lập vì một dự án khác đã được chia sẻ với tất cả các dự án. sprint: attributes: base: unfinished_work_packages: - other: There are %{count} work packages that were not completed in this sprint. + other: Có %{count} gói công việc chưa hoàn thành trong Sprint này. format: "%{message}" status: - not_active: is not active so it cannot be closed. + not_active: không hoạt động nên không thể đóng. work_package: - backlog_bucket_xor_sprint: cannot be assigned to both a sprint and a backlog bucket. + backlog_bucket_xor_sprint: không thể gán đồng thời cho cả một Sprint và một nhóm Backlog (bucket). attributes: backlog_bucket: - backlog_bucket_from_another_project: must belong to the same project as the work package. + backlog_bucket_from_another_project: phải thuộc cùng một dự án với gói công việc. blocks_ids: can_only_contain_work_packages_of_current_sprint: 'chỉ có thể chứa ID của các gói công việc trong sprint hiện tại. @@ -79,77 +79,77 @@ vi: version_id: task_version_must_be_the_same_as_story_version: phải giống với phiên bản của bảng cha. sprint: - not_assignable: is not assignable since it is either not shared with the project or already finished. - not_eligible_for_moving: is not an active sprint in the project which holds the sprint the work package is moved out of. + not_assignable: không thể gán vì nó chưa được chia sẻ với dự án hoặc đã kết thúc. + not_eligible_for_moving: không phải là một Sprint hoạt động trong dự án chứa Sprint mà gói công việc bị chuyển đi. models: sprint: Sprint backlogs: administration_blankslate: - title: Backlog admin settings are evolving - text: We are currently redesigning the Backlogs module. Admin settings for sprints and backlogs will be visible here in the near future. Project-level settings remain available. + title: Các thiết lập quản trị Backlog đang được phát triển + text: Chúng tôi hiện đang thiết kế lại mô-đun Backlogs. Các thiết lập quản trị cho Sprint và Backlog sẽ hiển thị ở đây trong thời gian tới. Các thiết lập ở cấp độ dự án vẫn khả dụng. bucket_destroy_modal_component: - title: Delete backlog bucket? + title: Xóa nhóm Backlog (bucket)? details: The backlog bucket '%{name}' will be deleted and all work packages will be moved to the backlog inbox. No work package will be deleted. bucket_component: - blankslate_title: Backlog bucket is empty - blankslate_description: Drag items here to add them. - label_actions: Backlog bucket actions + blankslate_title: Nhóm Backlog đang trống + blankslate_description: Kéo các mục vào đây để thêm. + label_actions: Thao tác với nhóm Backlog action_menu: - edit_backlog_bucket: Edit backlog bucket - delete_backlog_bucket: Delete backlog bucket + edit_backlog_bucket: Chỉnh sửa nhóm Backlog + delete_backlog_bucket: Xóa nhóm Backlog burndown_chart: show: - blankslate_title: No burndown data available - blankslate_description: Set start and end date for the sprint to generate a burndown chart. - excluded_work_package_types_caption: 'Choose which work package types to hide from the backlog. Items of the selected types will not appear in the backlog automatically, keeping it focused on the work that matters to your team. For example, types like Epics or Milestones that are managed at a higher level can be hidden to keep the backlog focused on actionable items. + blankslate_title: Không có dữ liệu biểu đồ burndown + blankslate_description: Thiết lập ngày bắt đầu và kết thúc cho Sprint để tạo biểu đồ burndown. + excluded_work_package_types_caption: 'Chọn các loại gói công việc muốn ẩn khỏi Backlog. Các mục thuộc loại được chọn sẽ không tự động xuất hiện trong Backlog, giúp đội ngũ tập trung vào những phần việc quan trọng hơn. Ví dụ: các loại như Epic hoặc Milestone được quản lý ở cấp cao hơn có thể được ẩn đi để giữ Backlog tập trung vào các hạng mục có thể thực hiện ngay. ' finish_sprint_dialog_component: - title: There are work in progress items + title: Có các hạng mục đang được thực hiện (Work in Progress) body: "%{message} What would you like to do with these?" - legend: Action for unfinished work packages + legend: Hành động cho các gói công việc chưa hoàn thành trong Sprint actions: - move_to_top_of_backlog: Move them to the top of the backlog - move_to_bottom_of_backlog: Move them to the bottom of the backlog - move_to_sprint: Move them to another sprint - select_sprint_label: Select sprint - button_complete_sprint: Complete sprint + move_to_top_of_backlog: Di chuyển chúng lên đầu Backlog + move_to_bottom_of_backlog: Di chuyển chúng xuống cuối Backlog + move_to_sprint: Di chuyển chúng sang một Sprint khác + select_sprint_label: Chọn Sprint + button_complete_sprint: Hoàn thành Sprint inbox_component: - title: Inbox - blankslate_title: Backlog inbox is empty - blankslate_description: All open work packages in this project will automatically appear here. + title: Hộp thư đến + blankslate_title: Hộp thư đến Backlog đang trống + blankslate_description: Tất cả các gói công việc đang mở trong dự án này sẽ tự động xuất hiện ở đây. show_more: - other: Show %{count} more items - label_burndown_chart: Burndown chart + other: Hiển thị thêm %{count} mục + label_burndown_chart: Biểu đồ Burndown label_is_done_status: Trạng thái %{status_name} nghĩa là đã xong - label_sprint_board: Sprint board + label_sprint_board: Bảng Sprint move_to_sprint_dialog_component: - title: Move to sprint + title: Di chuyển sang Sprint label_sprint: Sprint points_label: - other: points + other: điểm (points) positions_could_not_be_rebuilt: Không thể tạo lại vị trí. positions_rebuilt_successfully: Tạo lại vị trí thành công. rebuild: Dựng lại rebuild_positions: Xây dựng lại vị trí remaining_hours: Công việc còn lại - sharing: Sharing - show_burndown_chart: Burndown chart + sharing: Chia sẻ + show_burndown_chart: Biểu đồ Burndown sprint_component: blankslate_title: "%{name} is empty" blankslate_description: No items planned yet. Drag items here to add them. label_actions: Sprint actions label_start_sprint: Start sprint - label_complete_sprint: Complete sprint + label_complete_sprint: Hoàn thành Sprint start_sprint_disabled_reason_active_sprint: Another sprint is already active. - start_sprint_disabled_reason_missing_dates: Start and finish dates are required in order to start the sprint. + start_sprint_disabled_reason_missing_dates: Bắt buộc phải có ngày bắt đầu và ngày kết thúc để bắt đầu Sprint. action_menu: edit_sprint: Edit sprint - add_work_package: Add work package + add_work_package: Add gói công việc (work package) sprints_component: blankslate: title: No sprints present yet - settings_link_text: project settings + settings_link_text: project thiết lập receive_and_manage_description_html: This project receives sprints from a different project. Manage this in the %{settings_link}. receive_description_text: This project receives shared sprints from a different project, but none are available right now. create_and_manage_description_html: To start planning your sprint, create one here or go to the %{settings_link} to receive sprints from a different project. @@ -164,8 +164,8 @@ vi: types_and_statuses: Types and statuses unassigned: Chưa được chỉ định user_preference: - header_backlogs: Mô-đun tồn đọng - button_update_backlogs: Cập nhật mô-đun tồn đọng + header_backlogs: Mô-đun Backlogs + button_update_backlogs: Cập nhật Mô-đun Backlogs stories: update_service: missing_target: target_id or direction must be present. @@ -175,26 +175,26 @@ vi: work_package_card_menu_component: action_menu: copy_url_to_clipboard: Copy URL to clipboard - copy_work_package_id: Copy work package ID + copy_work_package_id: Copy gói công việc (work package) ID move_menu: Move - move_to_sprint: Move to sprint + move_to_sprint: Di chuyển sang Sprint work_package_is_closed: Gói công việc được thực hiện, khi burndown: story_points: Story points story_points_ideal: Story points (ideal) ee: features: - sprint_sharing: Sprint sharing + sprint_sharing: Chia sẻ Sprint upsell: sprint_sharing: description: Share sprints across projects to align teams and coordinate work in scaled agile setups (SAFe). label_backlog: Backlog - label_backlog_bucket_edit: Edit backlog bucket + label_backlog_bucket_edit: Chỉnh sửa nhóm Backlog label_backlog_bucket_new: New backlog bucket - label_inbox: Inbox - label_backlogs: tồn đọng - label_burndown_chart: Burndown chart - label_sprint_board: Sprint board + label_inbox: Hộp thư đến + label_backlogs: Backlog + label_burndown_chart: Biểu đồ Burndown + label_sprint_board: Bảng Sprint label_points_burn_down: Xuống label_points_burn_up: lên label_sprint_edit: Edit sprint @@ -210,13 +210,13 @@ vi: permission_create_sprints: Create sprints permission_manage_sprint_items: Manage sprint items permission_select_backlog_types_and_statuses: Select backlog types and statuses - permission_select_backlog_types_and_statuses_explanation: 'Allows choosing which work package types to hide from the backlog. Also allows defining which statuses represent a closed or finished state in the project''s workflow. + permission_select_backlog_types_and_statuses_explanation: 'Allows choosing which gói công việc (work package) types to hide from the backlog. Also allows defining which statuses represent a closed or finished state in the project''s workflow. ' permission_share_sprint: Share sprint permission_start_complete_sprint: Start/complete sprint permission_view_sprints: View sprints - project_module_backlogs: tồn đọng + project_module_backlogs: Backlog projects: settings: backlog_sharing: diff --git a/modules/boards/config/locales/crowdin/vi.yml b/modules/boards/config/locales/crowdin/vi.yml index 92c1ee617be..bf764eb5906 100644 --- a/modules/boards/config/locales/crowdin/vi.yml +++ b/modules/boards/config/locales/crowdin/vi.yml @@ -2,7 +2,7 @@ --- vi: plugin_openproject_boards: - name: Ban dự án mở + name: Ban OpenProject description: Cung cấp chế độ xem bảng. permission_show_board_views: Xem bảng permission_manage_board_views: Quản lý bảng diff --git a/modules/costs/config/locales/crowdin/vi.yml b/modules/costs/config/locales/crowdin/vi.yml index b784291446b..ba43a18bb2f 100644 --- a/modules/costs/config/locales/crowdin/vi.yml +++ b/modules/costs/config/locales/crowdin/vi.yml @@ -231,7 +231,7 @@ vi: title: Actual costs by month blankslate: heading: Start tracking your time and costs - description: Get an overview of your costs and logged time to monitor progress of your project. Make sure that work packages are associated with the correct budget. + description: Get an overview of your costs and logged time to monitor progress of your project. Make sure that gói công việc (work package)s are associated with the correct budget. action: Log time view_details: View actual costs details ee: diff --git a/modules/github_integration/config/locales/crowdin/vi.yml b/modules/github_integration/config/locales/crowdin/vi.yml index e2de98f450b..06131ad02a0 100644 --- a/modules/github_integration/config/locales/crowdin/vi.yml +++ b/modules/github_integration/config/locales/crowdin/vi.yml @@ -45,7 +45,7 @@ vi: notice_deploy_target_destroyed: Đã xóa mục tiêu triển khai label_github_comment_user: GitHub actor label_github_webhook_secret: Webhook secret - text_github_comment_user_info: 'The OpenProject user whose API key must be used to authenticate incoming webhook requests. When set, requests authenticated with any other user''s credentials are rejected. This user also posts automated deploy-status comments on work packages. Defaults to the system user when not set. + text_github_comment_user_info: 'The OpenProject user whose API key must be used to authenticate incoming webhook requests. When set, requests authenticated with any other user''s credentials are rejected. This user also posts automated deploy-status comments on gói công việc (work package)s. Defaults to the system user when not set. ' text_github_webhook_secret_missing_warning: 'No webhook secret is configured. Any request to the GitHub webhook endpoint will be accepted without verification, which may allow unauthorized actors to forge events. It is strongly recommended to set a secret. diff --git a/modules/gitlab_integration/config/locales/crowdin/vi.yml b/modules/gitlab_integration/config/locales/crowdin/vi.yml index f0925911060..fce85d37334 100644 --- a/modules/gitlab_integration/config/locales/crowdin/vi.yml +++ b/modules/gitlab_integration/config/locales/crowdin/vi.yml @@ -52,7 +52,7 @@ vi: label_gitlab_integration: GitLab Integration label_gitlab_actor: GitLab actor label_gitlab_webhook_secret: Webhook secret - text_gitlab_actor_info: 'The OpenProject user whose API key must be used to authenticate incoming webhook requests. When set, requests authenticated with any other user''s credentials are rejected. This user also posts automated comments on work packages. Defaults to the system user when not set. + text_gitlab_actor_info: 'The OpenProject user whose API key must be used to authenticate incoming webhook requests. When set, requests authenticated with any other user''s credentials are rejected. This user also posts automated comments on gói công việc (work package)s. Defaults to the system user when not set. ' text_gitlab_webhook_secret_info: 'A secret token shared with GitLab when configuring the webhook. When set, OpenProject verifies the X-Gitlab-Token header on every incoming request, rejecting payloads that do not match. Leave blank to skip verification (not recommended). diff --git a/modules/meeting/config/locales/crowdin/ru.yml b/modules/meeting/config/locales/crowdin/ru.yml index 72fdc4a1868..6886da11d35 100644 --- a/modules/meeting/config/locales/crowdin/ru.yml +++ b/modules/meeting/config/locales/crowdin/ru.yml @@ -438,7 +438,7 @@ ru: ' presentation_mode: title: Режим презентации - button_present: Текущий + button_present: Презентация exit: Выйти из презентации current_item: Текущий элемент total_items: "%{current} из %{total}" diff --git a/modules/meeting/config/locales/crowdin/vi.yml b/modules/meeting/config/locales/crowdin/vi.yml index 023128da5a5..467bc312a36 100644 --- a/modules/meeting/config/locales/crowdin/vi.yml +++ b/modules/meeting/config/locales/crowdin/vi.yml @@ -47,7 +47,7 @@ vi: end_time: End time template: Template notify: Send notifications - sharing: Sharing + sharing: Chia sẻ meeting_agenda_item: title: tiêu đề author: tác giả @@ -76,7 +76,7 @@ vi: iterations: lần xuất hiện time_zone: Time zone location: Location - duration: Duration + duration: Thời lượng notify: Send notifications recurring_meeting_interim_response: start_time: Start time @@ -359,8 +359,8 @@ vi: label: Bao gồm danh sách các tệp đính kèm caption: Một danh sách chứa tên tệp đính kèm sẽ được thêm vào cuối. include_backlog: - label: Bao gồm tồn đọng - caption: Các thành phần tồn đọng thường không được coi là một phần của cuộc họp nhưng bạn có thể chọn đưa chúng vào. + label: Bao gồm Backlog + caption: Các các hạng mục Backlog thường không được coi là một phần của cuộc họp nhưng bạn có thể chọn đưa chúng vào. include_outcomes: label: Bao gồm các kết quả chương trình nghị sự caption: Nếu kết quả chương trình nghị sự của bạn chứa thông tin bí mật, bạn có thể chọn không đưa chúng vào khi xuất. @@ -611,14 +611,14 @@ vi: label_agenda_items_reordered: sắp xếp lại label_agenda_item_add: Thêm mục chương trình nghị sự label_agenda_item_remove_from_agenda: Xóa khỏi chương trình nghị sự - label_agenda_item_remove_from_backlog: Xóa khỏi hồ sơ tồn đọng + label_agenda_item_remove_from_backlog: Xóa khỏi Backlog label_agenda_item_undisclosed_wp: 'Gói công việc #%{id} không hiển thị' label_agenda_item_deleted_wp: Đã xóa tham chiếu gói công việc label_agenda_item_actions: Hành động của mục chương trình nghị sự label_agenda_item_move_to_next_title: Chuyển sang cuộc họp tiếp theo? label_agenda_item_move: Di chuyển label_agenda_item_move_to_next: Chuyển sang cuộc họp tiếp theo - label_agenda_item_move_to_backlog: Chuyển sang tồn đọng + label_agenda_item_move_to_backlog: Chuyển sang Backlog label_agenda_item_move_to_current_meeting: Di chuyển đến cuộc họp hiện tại label_agenda_item_move_to_section: Di chuyển đến phần label_agenda_item_move_to_top: Di chuyển lên trên cùng @@ -643,23 +643,23 @@ vi: label_existing_work_package: Gói công việc hiện có text_outcome_not_editable_anymore: Kết quả này không thể chỉnh sửa được nữa. text_outcome_cannot_be_added: Một kết quả không còn có thể được thêm vào. - label_backlog_clear: Xóa tồn đọng + label_backlog_clear: Xóa Backlog label_backlog_clear_button: Xóa tất cả - text_backlog_clear_error: Đã xảy ra một hoặc nhiều lỗi khi cố gắng xóa hồ sơ tồn đọng. - label_agenda_backlog: tồn đọng chương trình làm việc - text_agenda_backlog: 'Việc tồn đọng này là duy nhất cho cuộc họp một lần này. Bạn có thể kéo các mục vào và ra để thêm hoặc xóa chúng khỏi chương trình cuộc họp. + text_backlog_clear_error: Đã xảy ra một hoặc nhiều lỗi khi cố gắng xóa Backlog. + label_agenda_backlog: Backlog chương trình họp + text_agenda_backlog: 'Backlog này là duy nhất cho cuộc họp một lần này. Bạn có thể kéo các mục vào và ra để thêm hoặc xóa chúng khỏi chương trình cuộc họp. ' - label_agenda_backlog_clear_title: Xóa lịch trình tồn đọng? - text_agenda_backlog_clear_description: 'Bạn có chắc chắn muốn xóa tất cả các mục hiện có trong lịch trình tồn đọng không? Hành động này không thể đảo ngược. + label_agenda_backlog_clear_title: Xóa Backlog cuộc họp? + text_agenda_backlog_clear_description: 'Bạn có chắc chắn muốn xóa tất cả các mục hiện có trong Backlog cuộc họp không? Hành động này không thể đảo ngược. ' - label_series_backlog: tồn đọng hàng loạt - text_series_backlog: 'Việc tồn đọng được chia sẻ với tất cả các lần xuất hiện của loạt bài này. Bạn có thể kéo các mục vào và ra để thêm hoặc xóa chúng khỏi một cuộc họp cụ thể. + label_series_backlog: Backlog của chuỗi cuộc họp + text_series_backlog: 'Backlog được chia sẻ với tất cả các lần xuất hiện của loạt bài này. Bạn có thể kéo các mục vào và ra để thêm hoặc xóa chúng khỏi một cuộc họp cụ thể. ' - label_series_backlog_clear_title: Xóa số tồn đọng của loạt phim? - text_series_backlog_clear_description: 'Thao tác này sẽ xóa tất cả các mục trong chuỗi tồn đọng, được chia sẻ với tất cả các cuộc họp trong chuỗi. Bạn có chắc chắn muốn tiếp tục không? Hành động này không thể đảo ngược. + label_series_backlog_clear_title: Xóa Backlog của chuỗi cuộc họp? + text_series_backlog_clear_description: 'Thao tác này sẽ xóa tất cả các mục trong Backlog của chuỗi cuộc họp, được chia sẻ với tất cả các cuộc họp trong chuỗi. Bạn có chắc chắn muốn tiếp tục không? Hành động này không thể đảo ngược. ' text_agenda_item_title: Mục chương trình nghị sự "%{title}" @@ -697,7 +697,7 @@ vi: text_exit_draft_mode_dialog_subtitle: Bạn không thể quay lại chế độ nháp sau khi lên lịch cuộc họp. text_exit_draft_mode_dialog_template_title: Mở lần xuất hiện đầu tiên của chuỗi cuộc họp này? text_exit_draft_mode_dialog_template_subtitle: Bạn không thể quay lại chế độ nháp sau này. - label_meeting_template_sharing: Sharing + label_meeting_template_sharing: Chia sẻ label_meeting_template_sharing_none: Only with this project label_meeting_template_sharing_descendants: With subprojects label_meeting_template_sharing_system: With all projects @@ -708,9 +708,9 @@ vi: label_add_work_package_to_meeting_section_label: phần label_add_work_package_to_meeting_dialog_button: Thêm vào cuộc họp label_meeting_selection_caption: Chỉ có thể thêm gói công việc này vào cuộc họp sắp tới hoặc đang diễn ra. - label_section_selection_caption: Chọn một phần cụ thể của chương trình nghị sự hoặc thêm nó vào hồ sơ tồn đọng. + label_section_selection_caption: Chọn một phần cụ thể của chương trình nghị sự hoặc thêm nó vào Backlog. placeholder_section_select_meeting_first: Lựa chọn cuộc họp là bắt buộc trước tiên - text_add_work_package_to_meeting_form: Gói công việc sẽ được thêm vào cuộc họp đã chọn hoặc hồ sơ tồn đọng dưới dạng mục chương trình nghị sự. + text_add_work_package_to_meeting_form: Gói công việc sẽ được thêm vào cuộc họp đã chọn hoặc Backlog dưới dạng mục chương trình nghị sự. text_add_work_package_to_meeting_description: Một gói công việc có thể được thêm vào một hoặc nhiều cuộc họp để thảo luận. Bất kỳ ghi chú nào liên quan đến nó cũng có thể nhìn thấy ở đây. text_agenda_item_no_notes: Không có ghi chú nào được cung cấp text_agenda_item_not_editable_anymore: Mục chương trình nghị sự này không thể chỉnh sửa được nữa. diff --git a/modules/reporting/config/locales/crowdin/vi.yml b/modules/reporting/config/locales/crowdin/vi.yml index 3e12aa977f0..b64d64cd638 100644 --- a/modules/reporting/config/locales/crowdin/vi.yml +++ b/modules/reporting/config/locales/crowdin/vi.yml @@ -22,7 +22,7 @@ --- vi: plugin_openproject_reporting: - name: Báo cáo dự án mở + name: Báo cáo OpenProject description: Plugin này cho phép tạo báo cáo chi phí tùy chỉnh với tính năng lọc và nhóm được tạo bởi plugin Thời gian và chi phí OpenProject. button_save_report_as: Lưu báo cáo dưới dạng... comments: bình luận diff --git a/modules/resource_management/config/locales/crowdin/vi.yml b/modules/resource_management/config/locales/crowdin/vi.yml index f8b6065854a..5e6ee20cafe 100644 --- a/modules/resource_management/config/locales/crowdin/vi.yml +++ b/modules/resource_management/config/locales/crowdin/vi.yml @@ -5,7 +5,7 @@ vi: resource_planner: name: Name start_date: Start date - end_date: Finish date + end_date: Ngày kết thúc default_view_class_name: Default view public: Public favorite: Favorite @@ -14,7 +14,7 @@ vi: principal: Assignee state: State start_date: Start date - end_date: Finish date + end_date: Ngày kết thúc allocated_time: Allocated time user_filter: User filter errors: @@ -29,8 +29,8 @@ vi: greater_than_start_date: must be after the start date. plugin_openproject_resource_management: name: OpenProject Resource Management - description: Provides resource management and capacity planning. - project_module_resource_management: Resource management + description: Provides quản lý tài nguyên (resource management) and capacity planning. + project_module_resource_management: Quản lý tài nguyên (Resource Management) permission_view_resource_planners: View resource planners permission_view_resource_planners_explanation: 'Allows users to access resource planners. It allows them to create and manage their own resource planners and view public resource planners. It does not allow users to view resource planners created by other users that are not shared publicly. @@ -46,10 +46,10 @@ vi: label_resource_management: Resource planning button_next: Save resource_management: - label_resource_planner: Resource planner - label_resource_planner_plural: Resource planners + label_resource_planner: Resource Planner + label_resource_planner_plural: Resource Planners label_new_resource_planner: New resource planner - public_caption: 'Make this view public to all members of the project. This does not affect the visibility of work packages which still depends on each user permission. + public_caption: 'Make this view public to all members of the project. This does not affect the visibility of gói công việc (work package)s which still depends on each user permission. ' favorite_caption: 'Make this view a favorite to add it on the top section of the sidebar menu. @@ -67,7 +67,7 @@ vi: public: Public private: Private blankslate: - title: No resource planners yet - desc: Create a resource planner to start planning capacity for this project. + title: Chưa có kế hoạch tài nguyên (Resource Planner) nào + desc: Tạo một Resource Planner để bắt đầu lập kế hoạch năng suất cho dự án này. show: - placeholder: The detailed view for this resource planner is coming soon. + placeholder: Chế độ xem chi tiết cho Resource Planner này sẽ sớm ra mắt. diff --git a/modules/storages/config/locales/crowdin/vi.yml b/modules/storages/config/locales/crowdin/vi.yml index d9c1b4876ec..24f2e5bb661 100644 --- a/modules/storages/config/locales/crowdin/vi.yml +++ b/modules/storages/config/locales/crowdin/vi.yml @@ -262,7 +262,7 @@ vi: manual_management: Chỉ cho phép truy cập và thư mục được quản lý thủ công manual_management_description: Các dự án sử dụng bộ lưu trữ này sẽ không được cung cấp tùy chọn phương pháp quản lý tự động. Các thư mục và quyền truy cập phải được quản lý thủ công. one_drive_oauth: Azure OAuth - openproject_oauth: OAuth dự án mở + openproject_oauth: OAuth OpenProject project_folders: Thư mục dự án redirect_uri: URI chuyển hướng sharepoint_oauth: Azure OAuth @@ -315,11 +315,11 @@ vi: storage_configured: Cấu hình hoàn tất tenant_id: ID người thuê errors: - client_id_invalid: The configured OAuth 2 client id is invalid. Please check the configuration. - client_secret_invalid: The configured OAuth 2 client secret is invalid. Please check the configuration. + client_id_invalid: The configured OAuth 2 client id không hợp lệ. Please check the cấu hình. + client_secret_invalid: The configured OAuth 2 client secret không hợp lệ. Please check the cấu hình. nc_dependency_missing: 'A required dependency is missing on the file storage. Please add the following dependency: %{dependency}.' nc_dependency_version_mismatch: The %{dependency} app version is not supported. Please update your Nextcloud server. - nc_host_not_found: No Nextcloud server found at the configured host url. Please check the configuration. + nc_host_not_found: No Nextcloud server found at the configured host url. Please check the cấu hình. nc_oauth_request_not_found: The endpoint to fetch the currently connected user was not found. Please check the server logs for further information. nc_oauth_request_unauthorized: The current user isn't authorized to access the remote file storage. Please check the server logs for further information. nc_oauth_token_missing: OpenProject cannot test the user level communication with Nextcloud as the user did not yet link their Nextcloud account. @@ -327,16 +327,16 @@ vi: nc_team_folder_not_found: The team folder could not be found. nc_unexpected_files: 'Unexpected files found in the managed team folder. For example: %{sample}' nc_unlinked_project_folders: Not all project folders have been created yet (%{actual} / %{expected}). This can indicate errors during the AMPF background synchronization. - nc_userless_access_denied: The configured app password is invalid. - not_configured: The connection could not be validated. Please finish configuration first. + nc_userless_access_denied: The configured app password không hợp lệ. + not_configured: The connection could not be validated. Please finish cấu hình first. od_client_cant_delete_folder: The client is having trouble deleting folders. Please check the setup documentation for your storage. od_client_write_permission_missing: The client seems to have write permissions missing. Please check the setup documentation for your storage. - od_drive_id_invalid: The configured drive id seems invalid. Please check the configuration. - od_drive_id_not_found: The configured drive id could not be found. Please check the configuration. + od_drive_id_invalid: The configured drive id seems invalid. Please check the cấu hình. + od_drive_id_not_found: The configured drive id could not be found. Please check the cấu hình. od_oauth_request_not_found: The endpoint to fetch the currently connected user was not found. Please check the server logs for further information. od_oauth_request_unauthorized: The current user isn't authorized to access the remote file storage. Please check the server logs for further information. od_oauth_token_missing: OpenProject cannot test the user level communication with OneDrive as the user did not yet link their Microsoft account. - od_tenant_id_wrong: The configured directory (tenant) id is invalid. Please check the configuration. + od_tenant_id_wrong: The configured directory (tenant) id không hợp lệ. Please check the cấu hình. od_test_folder_exists: The folder %{folder_name} needed for testing already exists. Please delete it and try again. od_unexpected_content: Unexpected content found in the drive. offline_access_scope_missing: It is recommended to configure the OpenID Connect provider to request the offline_access scope. The integration may still work anyways, but make sure that refresh tokens do not expire. @@ -345,17 +345,17 @@ vi: oidc_non_provisioned_user: The current user isn't provided by an OpenID Connect Identity Provider. Please re-run the check with a provided user. oidc_provider_cant_exchange: The OpenID Connect provider does not seem to support token exchange, but token exchange was configured for the storage. oidc_token_acquisition_failed: Your OpenID Connect setup doesn't provide the necessary audience, nor does it provide token exchange capabilities. Please check out our documentation for more information. - oidc_token_exchange_failed: There seems to be a problem with the Token Exchange setup on your OpenID Connect Provider. Please check its configuration and try again. + oidc_token_exchange_failed: There seems to be a problem with the Token Exchange setup on your OpenID Connect Provider. Please check its cấu hình and try again. oidc_token_refresh_failed: There was an error while trying to check your access to the storage. Please check the server logs for further information. sp_client_cant_delete_folder: The client is having trouble deleting folders in SharePoint. Please check the setup documentation for your storage. - sp_client_id_missing: The configured OAuth 2 client id is missing for SharePoint. Please check the configuration. - sp_client_secret_missing: The configured OAuth 2 client secret is missing for SharePoint. Please check the configuration. + sp_client_id_missing: The configured OAuth 2 client id is missing for SharePoint. Please check the cấu hình. + sp_client_secret_missing: The configured OAuth 2 client secret is missing for SharePoint. Please check the cấu hình. sp_client_write_permission_missing: The client seems to have write permissions missing in SharePoint. Please check the setup documentation for your storage. sp_existing_test_folder: The folder %{folder_name} needed for testing already exists in SharePoint. Please delete it and try again. sp_oauth_request_error: The user-bound request to SharePoint failed. Please check the server logs for further information. sp_oauth_request_unauthorized: The current user isn't authorized to access the remote file storage. Please check the server logs for further information. sp_oauth_token_missing: OpenProject cannot test the user level communication with SharePoint as the user did not yet link their SharePoint account. - sp_tenant_id_missing: The configured directory (tenant) id is missing for SharePoint. Please check the configuration. + sp_tenant_id_missing: The configured directory (tenant) id is missing for SharePoint. Please check the cấu hình. sp_unexpected_content: Unexpected content found in the SharePoint Document Library. unknown_error: The connection could not be validated. An unknown error occurred. Please check the server logs for further information. label_error: lỗi @@ -398,7 +398,7 @@ vi: no_specific_folder: Theo mặc định, mỗi người dùng sẽ bắt đầu tại thư mục chính của riêng họ khi họ tải tệp lên. no_storage_set_up: Chưa có kho lưu trữ tập tin nào được thiết lập. not_logged_into_storage: Để chọn thư mục dự án, vui lòng đăng nhập trước - oauth_application_details_html: The client secret value will not be accessible again after you close this window. Please copy these values into the [Nextcloud OpenProject Integration settings](oauth_application_details_link). + oauth_application_details_html: The client secret value will not be accessible again after you close this window. Please copy these values into the [Nextcloud OpenProject Integration thiết lập](oauth_application_details_link). one_drive: application_link_text: Cổng thông tin Azure copy_redirect_uri: Sao chép URI chuyển hướng @@ -422,7 +422,7 @@ vi: oauth_configuration: Sao chép các giá trị này từ ứng dụng mong muốn trong %{application_link_text}. provider_configuration: Vui lòng đảm bảo rằng bạn có đặc quyền quản trị trong %{application_link_text} hoặc liên hệ với quản trị viên Microsoft của bạn trước khi thực hiện thiết lập. Trong cổng thông tin, bạn cũng cần đăng ký ứng dụng Azure hoặc sử dụng ứng dụng hiện có để xác thực. type: 'Vui lòng đảm bảo rằng bạn có đặc quyền quản trị trong phiên bản Nextcloud của mình và cài đặt ứng dụng sau trước khi thực hiện thiết lập:' - type_link_text: "“Dự án mở tích hợp”" + type_link_text: "“OpenProject tích hợp”" label_active: Đang hoạt động label_add_new_storage: Thêm bộ nhớ mới label_automatic_folder: Thư mục mới với quyền được quản lý tự động diff --git a/modules/webhooks/config/locales/crowdin/vi.yml b/modules/webhooks/config/locales/crowdin/vi.yml index a59919d8662..5ec26292e61 100644 --- a/modules/webhooks/config/locales/crowdin/vi.yml +++ b/modules/webhooks/config/locales/crowdin/vi.yml @@ -1,7 +1,7 @@ --- vi: plugin_openproject_webhooks: - name: Webhooks dự án mở + name: Webhooks OpenProject description: Cung cấp API plug-in để hỗ trợ webhooks OpenProject để tích hợp bên thứ 3 tốt hơn. activerecord: attributes: @@ -37,7 +37,7 @@ vi: updated: đã cập nhật comment: bình luận internal_comment: Bình luận nội bộ - explanation_html: 'Upon the occurrence of an event like the creation of a work package or an update on a project, OpenProject will send a POST request to the configured web endpoints. Oftentimes, the event is sent after the [configured aggregation period](aggregation_path) has passed. + explanation_html: 'Upon the occurrence of an event like the creation of a gói công việc (work package) or an update on a project, OpenProject will send a POST request to the configured web endpoints. Oftentimes, the event is sent after the [configured aggregation period](aggregation_path) has passed. ' status: diff --git a/modules/wikis/config/locales/crowdin/vi.yml b/modules/wikis/config/locales/crowdin/vi.yml index db728c32831..9073f758cb3 100644 --- a/modules/wikis/config/locales/crowdin/vi.yml +++ b/modules/wikis/config/locales/crowdin/vi.yml @@ -42,10 +42,10 @@ vi: header: Authentication user_bound_request: User-based request authentication base_configuration: - header: Configuration - provider_configured: Configuration complete + header: Cấu hình + provider_configured: Cấu hình complete errors: - not_configured: The connection could not be validated. Please finish configuration first. + not_configured: The connection could not be validated. Please finish cấu hình first. xwiki_oauth_connection_error: OpenProject could not connect to the configured XWiki instance. xwiki_oauth_request_error: An unexpected error occured when trying to communicate with the XWiki instance. xwiki_oauth_token_missing: OpenProject cannot test the user-level communication with XWiki as the user did not yet connect their XWiki account. @@ -106,7 +106,7 @@ vi: no_results_description: Add a wiki provider to see them here. no_results_title: You don't have any wiki providers set up yet. wiki_providers: - index_description: Add an external wiki service to link work packages to existing wiki pages or create new ones directly from OpenProject. + index_description: Add an external wiki service to link gói công việc (work package)s to existing wiki pages or create new ones directly from OpenProject. label_add_new: Add new wiki provider label_edit: Edit XWiki provider label_new_xwiki_instance: New XWiki provider @@ -118,14 +118,14 @@ vi: openproject_oauth: OpenProject OAuth sections: general_information: Basic details - oauth_configuration: OAuth configuration + oauth_configuration: OAuth cấu hình url_caption: Please add the host address of your wiki platform including the https://. It should not be longer than 255 characters. xwiki_instance: XWiki Instance xwiki: oauth: openproject_oauth_description: Allow XWiki to access OpenProject data using an OAuth application. Copy the credentials below into your XWiki instance. provider_oauth: XWiki OAuth - provider_oauth_description: Allow OpenProject to access XWiki data using OAuth. A client ID is automatically generated to identify OpenProject to XWiki — no manual configuration is needed on the XWiki side. + provider_oauth_description: Allow OpenProject to access XWiki data using OAuth. A client ID is automatically generated to identify OpenProject to XWiki — no manual cấu hình is needed on the XWiki side. openproject_oauth_description: Allow XWiki to access OpenProject data using an OAuth. xwiki_oauth: XWiki OAuth xwiki_oauth_description: Allow OpenProject to access XWiki data using an OAuth. From 59014b33eadce1694194ceb63c36a5df3cb114fd Mon Sep 17 00:00:00 2001 From: Mir Bhatia Date: Fri, 22 May 2026 17:03:19 +0200 Subject: [PATCH 081/381] Update one time templates to require create_meetings permission --- modules/meeting/app/menus/meetings/menu.rb | 9 ++++++ .../lib/open_project/meeting/engine.rb | 5 ++-- .../onetime_template_crud_spec.rb | 30 ++++++++++++------- .../spec/requests/meeting_templates_spec.rb | 26 ++++++++++++++-- 4 files changed, 54 insertions(+), 16 deletions(-) diff --git a/modules/meeting/app/menus/meetings/menu.rb b/modules/meeting/app/menus/meetings/menu.rb index 10acf25a218..457a6303318 100644 --- a/modules/meeting/app/menus/meetings/menu.rb +++ b/modules/meeting/app/menus/meetings/menu.rb @@ -62,6 +62,7 @@ module Meetings def templates_menu_item return unless User.current.logged? + return unless can_create_meetings? templates_href = if project templates_project_meetings_path(project) @@ -186,5 +187,13 @@ module Meetings selected: params[:filters].to_s.include?("author_id") ) end + + def can_create_meetings? + if project + User.current.allowed_in_project?(:create_meetings, project) + else + User.current.allowed_in_any_project?(:create_meetings) + end + end end end diff --git a/modules/meeting/lib/open_project/meeting/engine.rb b/modules/meeting/lib/open_project/meeting/engine.rb index 9d3cb5ccb1a..959dd05bd0c 100644 --- a/modules/meeting/lib/open_project/meeting/engine.rb +++ b/modules/meeting/lib/open_project/meeting/engine.rb @@ -47,8 +47,7 @@ module OpenProject::Meeting presentation generate_pdf_dialog history], "meetings/menus": %i[show], work_package_meetings_tab: %i[index count], - recurring_meetings: %i[index show new create download_ics], - meeting_templates: %i[index] + recurring_meetings: %i[index show new create download_ics] }, permissible_on: :project permission :create_meetings, @@ -57,7 +56,7 @@ module OpenProject::Meeting recurring_meetings: %i[new create copy init template_completed], "recurring_meetings/schedule": %i[update_text], "meetings/menus": %i[show], - meeting_templates: %i[new create new_dialog] + meeting_templates: %i[index new create new_dialog] }, dependencies: :view_meetings, permissible_on: :project, diff --git a/modules/meeting/spec/features/meeting_templates/onetime_template_crud_spec.rb b/modules/meeting/spec/features/meeting_templates/onetime_template_crud_spec.rb index 706902ed8e0..d82cbec53ae 100644 --- a/modules/meeting/spec/features/meeting_templates/onetime_template_crud_spec.rb +++ b/modules/meeting/spec/features/meeting_templates/onetime_template_crud_spec.rb @@ -212,20 +212,30 @@ RSpec.describe "Onetime templates CRUD", :js do visit templates_meetings_path end - it "can view templates but cannot see create button or action menu" do + it "sees a 403 error" do + expect(page).to have_text("You are not authorized to access this page.") + end + end + + context "as user with create_meetings permission" do + let(:user_with_create) do + create(:user, member_with_permissions: { project => %i[view_meetings create_meetings] }) + end + + before do + logout + login_as(user_with_create) + visit templates_meetings_path + end + + it "can access templates page and see templates" do expect(page).to have_text("Permission test template") - - expect(page).to have_no_css("#add-template-button") - - within_row("Permission test template") do - expect(page).to have_no_css('[data-test-selector="more-button"]') - end end end context "as user with edit_meetings permission" do let(:user_with_edit) do - create(:user, member_with_permissions: { project => %i[view_meetings edit_meetings] }) + create(:user, member_with_permissions: { project => %i[view_meetings create_meetings edit_meetings] }) end before do @@ -248,7 +258,7 @@ RSpec.describe "Onetime templates CRUD", :js do context "as user with delete_meetings permission" do let(:user_with_delete) do - create(:user, member_with_permissions: { project => %i[view_meetings delete_meetings] }) + create(:user, member_with_permissions: { project => %i[view_meetings create_meetings delete_meetings] }) end before do @@ -271,7 +281,7 @@ RSpec.describe "Onetime templates CRUD", :js do context "as user with both edit and delete permissions" do let(:user_with_both) do - create(:user, member_with_permissions: { project => %i[view_meetings edit_meetings delete_meetings] }) + create(:user, member_with_permissions: { project => %i[view_meetings create_meetings edit_meetings delete_meetings] }) end before do diff --git a/modules/meeting/spec/requests/meeting_templates_spec.rb b/modules/meeting/spec/requests/meeting_templates_spec.rb index 0c0c9b1cc75..71dd7dfa6cf 100644 --- a/modules/meeting/spec/requests/meeting_templates_spec.rb +++ b/modules/meeting/spec/requests/meeting_templates_spec.rb @@ -78,7 +78,27 @@ RSpec.describe "Meeting templates requests", end end - context "without view_meetings permission" do + context "with view_meetings permission only" do + shared_let(:user_view_only) do + create(:user, member_with_permissions: { project => %i[view_meetings] }) + end + + before { login_as user_view_only } + + it "returns 403" do + get templates_project_meetings_path(project) + + expect(response).to have_http_status(:forbidden) + end + + it "returns 403 for global templates path" do + get templates_meetings_path + + expect(response).to have_http_status(:forbidden) + end + end + + context "without any permission" do before { login_as user_without_permissions } it "returns 403" do @@ -212,7 +232,7 @@ RSpec.describe "Meeting templates requests", shared_let(:unrelated_project) { create(:project, enabled_module_names: %i[meetings]) } shared_let(:user) do - create(:user, member_with_permissions: { current_project => %i[view_meetings] }) + create(:user, member_with_permissions: { current_project => %i[view_meetings create_meetings] }) end shared_let(:own_template) { create(:onetime_template, project: current_project, title: "Own template") } @@ -248,7 +268,7 @@ RSpec.describe "Meeting templates requests", shared_let(:inaccessible_project) { create(:project, enabled_module_names: %i[meetings]) } shared_let(:user) do - create(:user, member_with_permissions: { accessible_project => %i[view_meetings] }) + create(:user, member_with_permissions: { accessible_project => %i[view_meetings create_meetings] }) end shared_let(:own_template) { create(:onetime_template, project: accessible_project, title: "Own template") } From 1ce489a2e035d9dd1139b6012d03158ebe176ddf Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 5 May 2026 08:28:36 +0200 Subject: [PATCH 082/381] Turn partials into form components. wp/74380 --- .../filter/filter_component.html.erb | 141 +++--------------- app/components/filter/filter_component.rb | 57 ++++--- app/components/filter/filters_component.sass | 16 -- app/forms/filters/inputs/add_filter_form.rb | 58 +++++++ app/forms/filters/inputs/autocomplete_form.rb | 52 +++++++ app/forms/filters/inputs/base_filter_form.rb | 110 ++++++++++++++ app/forms/filters/inputs/boolean_form.rb | 49 ++++++ app/forms/filters/inputs/date_form.rb | 114 ++++++++++++++ app/forms/filters/inputs/list_form.rb | 69 +++++++++ .../select_with_toggle_component.html.erb | 12 ++ .../inputs/select_with_toggle_component.rb | 40 +++++ .../inputs/select_with_toggle_input.rb | 52 +++++++ app/forms/filters/inputs/text_form.rb | 50 +++++++ config/initializers/primer_forms.rb | 1 + .../basic-range-date-picker.component.html | 2 + .../content/_advanced_filters.sass | 6 + .../src/global_styles/openproject/_forms.sass | 3 + .../src/global_styles/primer/_overrides.sass | 3 +- .../dynamic/filter/filters-form.controller.ts | 119 +++++++++------ .../open_project/forms/date_picker.html.erb | 4 + .../open_project/forms/dsl/input_methods.rb | 4 + spec/features/projects/lists/columns_spec.rb | 4 +- spec/features/projects/lists/filters_spec.rb | 6 +- spec/support/components/common/filters.rb | 19 ++- spec/support/pages/projects/index.rb | 12 +- 25 files changed, 778 insertions(+), 225 deletions(-) create mode 100644 app/forms/filters/inputs/add_filter_form.rb create mode 100644 app/forms/filters/inputs/autocomplete_form.rb create mode 100644 app/forms/filters/inputs/base_filter_form.rb create mode 100644 app/forms/filters/inputs/boolean_form.rb create mode 100644 app/forms/filters/inputs/date_form.rb create mode 100644 app/forms/filters/inputs/list_form.rb create mode 100644 app/forms/filters/inputs/select_with_toggle_component.html.erb create mode 100644 app/forms/filters/inputs/select_with_toggle_component.rb create mode 100644 app/forms/filters/inputs/select_with_toggle_input.rb create mode 100644 app/forms/filters/inputs/text_form.rb diff --git a/app/components/filter/filter_component.html.erb b/app/components/filter/filter_component.html.erb index 21a8d9e0475..f3e06530bc2 100644 --- a/app/components/filter/filter_component.html.erb +++ b/app/components/filter/filter_component.html.erb @@ -26,134 +26,29 @@ <% else %> <%= helpers.turbo_frame_tag TURBO_FRAME_ID do %> - <%= form_tag( - {}, + <%= primer_form_with( + url: {}, method: :get, data: { action: "submit->filter--filters-form#sendForm:prevent" } - ) do %> -
- <%= - render( - Primer::Beta::IconButton.new( - icon: :x, - scheme: :invisible, - classes: "advanced-filters--close", - tooltip_direction: :se, - aria: { label: t("js.close_form_title") }, - data: { action: "filter--filters-form#toggleDisplayFilters" } - ) + ) do |f| %> + <%= + render( + Primer::Beta::IconButton.new( + icon: :x, + scheme: :invisible, + classes: "advanced-filters--close", + tooltip_direction: :se, + aria: { label: t("js.close_form_title") }, + data: { action: "filter--filters-form#toggleDisplayFilters" } ) - %> - <%= t(:label_filter_plural) %> -
    - <% each_filter do |filter, filter_active, additional_options| %> - <% filter_boolean = filter.is_a?(Queries::Filters::Shared::BooleanFilter) %> - <% autocomplete_filter = additional_options.key?(:autocomplete_options) %> - -
  • " - data-filter-name="<%= filter.name %>" - data-filter-type="<%= filter.type %>" - data-filter--filters-form-target="filter"> - - <% selected_operator = filter.operator || filter.default_operator.symbol %> - <%= content_tag :div, class: "advanced-filters--filter-operator", style: filter_boolean ? "display:none" : "" do %> - <%= select_tag :operator, - options_from_collection_for_select( - filter.available_operators, - :symbol, - :human_name, - selected_operator - ), - class: "advanced-filters--select", - data: { - action: "change->filter--filters-form#setValueVisibility", - "filter--filters-form-filter-name-param": filter.name, - "filter--filters-form-target": "operator", - "filter-name": filter.name - } %> - <% end %> - <% if autocomplete_filter %> - <%= render partial: "filters/autocomplete", - locals: { value_visibility: value_hidden_class(selected_operator), - filter: filter, - autocomplete_options: additional_options[:autocomplete_options] } %> - <% elsif filter_boolean %> - <%= render partial: "filters/boolean", - locals: { value_visibility: value_hidden_class(selected_operator), - filter: filter } %> - <% elsif %i(list list_optional list_all).include? filter.type %> - <%= render partial: "filters/list/input_options", - locals: { value_visibility: value_hidden_class(selected_operator), - filter: filter } %> - <% elsif [:datetime_past, :date].include? filter.type %> - <%= render partial: "filters/date/input_options", - locals: { value_visibility: value_hidden_class(selected_operator), - filter: filter, - selected_operator: selected_operator } %> - <% else %> - <%# All other simple types %> - <%= render partial: "filters/text", - locals: { value_visibility: value_hidden_class(selected_operator), - filter: filter } %> - <% end %> - - -
  • - <% end %> - -
  • " - data-filter--filters-form-target="spacer">
  • - -
  • - - - - -
    - <%= select_tag "add_filter_select", - options_from_collection_for_select( - allowed_filters, - :name, - :human_name, - disabled: query.filters.map(&:name) - ), - prompt: t(:actionview_instancetag_blank_option), - class: "advanced-filters--select", - focus: "false", - "aria-invalid": "false", - data: { - "filter--filters-form-target": "addFilterSelect", - action: "change->filter--filters-form#addFilter:prevent" - } %> -
    -
  • - - <% unless turbo_requests? %> -
  • - <%= submit_tag t("button_apply"), class: "button -small -primary", name: nil %> -
  • - <% end %> - -
-
+ ) + %> + <%= render(Primer::Forms::FormList.new(*inputs(f))) %> + <% unless turbo_requests? %> + <%= render(Primer::Beta::Button.new(type: :submit, scheme: :primary)) { t("button_apply") } %> + <% end %> <% end %> <% end %> <% end %> diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index 9654b3b706c..61f534c724b 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -29,7 +29,6 @@ # ++ module Filter class FilterComponent < ApplicationComponent - OPERATORS_WITHOUT_VALUES = %w[* !* t w].freeze TURBO_FRAME_ID = "filter_component" options :query @@ -38,10 +37,22 @@ module Filter options lazy_loaded_path: false options initially_expanded: false - # Returns filters, active and inactive. + def inputs(form) + filter_forms = map_filter do |filter, active, additional_attributes| + filter_form_class(filter, additional_attributes).new(form, filter:, additional_attributes:, active:) + end + + filter_forms << Filters::Inputs::AddFilterForm.new( + form, + allowed_filters:, + active_filter_names: query.filters.map(&:name) + ) + end + + # Maps over all filters (active and inactive). # In case a filter is active, the active one will be preferred over the inactive one. - def each_filter - allowed_filters.each do |allowed_filter| + def map_filter + allowed_filters.map do |allowed_filter| active_filter = query.find_active_filter(allowed_filter.name) filter = active_filter || allowed_filter @@ -53,14 +64,6 @@ module Filter query.available_advanced_filters end - def value_hidden_class(selected_operator) - operator_without_value?(selected_operator) ? "hidden" : "" - end - - def operator_without_value?(operator) - OPERATORS_WITHOUT_VALUES.include?(operator) - end - def lazy_loaded? = !!lazy_loaded_path def initially_expanded? = initially_expanded @@ -90,7 +93,7 @@ module Filter # When the method is overwritten in a subclass, the subclass should call super(filter) to get the default attributes. # # @param filter [QueryFilter] the filter for which we want to pass additional attributes - # @return [Hash] the additional attributes for the filter, that will be yielded in the each_filter method + # @return [Hash] the additional attributes for the filter, yielded in map_filter def additional_filter_attributes(filter) case filter when Queries::Filters::Shared::ProjectFilter::Required, @@ -110,18 +113,36 @@ module Filter end end + def filter_form_class(filter, additional_attributes) + if filter.is_a?(Queries::Filters::Shared::BooleanFilter) + Filters::Inputs::BooleanForm + elsif additional_attributes.key?(:autocomplete_options) + Filters::Inputs::AutocompleteForm + elsif filter.type.in? %i[list list_optional list_all] + Filters::Inputs::ListForm + elsif filter.type.in? %i[datetime_past date] + Filters::Inputs::DateForm + else + Filters::Inputs::TextForm + end + end + def custom_field_list_autocomplete_options(filter) - all_items = if filter.custom_field.version? - filter.allowed_values.map { |name, id, project_name| { name:, id:, project_name: } } - else - filter.allowed_values.map { |name, id| { name:, id: } } - end + all_items = custom_field_allowed_items(filter) selected = filter.values options = { items: all_items } options[:groupBy] = "project_name" if filter.custom_field.version? autocomplete_options.merge(options).merge(model: all_items.select { |item| selected.include?(item[:id]) }) end + def custom_field_allowed_items(filter) + if filter.custom_field.version? + filter.allowed_values.map { |name, id, project_name| { name:, id:, project_name: } } + else + filter.allowed_values.map { |name, id| { name:, id: } } + end + end + def custom_field_hierarchy_autocomplete_options(filter) items = filter.allowed_values.map do |name, id| path = name.split(" / ") diff --git a/app/components/filter/filters_component.sass b/app/components/filter/filters_component.sass index 6e7856e6301..a424079927e 100644 --- a/app/components/filter/filters_component.sass +++ b/app/components/filter/filters_component.sass @@ -4,22 +4,6 @@ &.-expanded display: block .advanced-filters--filter-value - // visibility based on operator type - &.hidden - visibility: hidden - height: 55px - - // visibility for list value selectors - .multi-select - display: none - .single-select - display: block - &.multi-value - .multi-select - display: block - .single-select - display: none - // visibility for datetime_past value selectors &.between-dates >.on-date, diff --git a/app/forms/filters/inputs/add_filter_form.rb b/app/forms/filters/inputs/add_filter_form.rb new file mode 100644 index 00000000000..6f35b761ee8 --- /dev/null +++ b/app/forms/filters/inputs/add_filter_form.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::AddFilterForm < ApplicationForm + def initialize(allowed_filters:, active_filter_names:) + super() + @allowed_filters = allowed_filters + @active_filter_names = active_filter_names + end + + form do |form| + form.select_list( + name: :add_filter_select, + label: I18n.t(:label_filter_add), + scope_name_to_model: false, + prompt: I18n.t(:actionview_instancetag_blank_option), + data: { + "filter--filters-form-target": "addFilterSelect", + action: "change->filter--filters-form#addFilter:prevent" + } + ) do |select| + @allowed_filters.each do |filter| + select.option( + label: filter.human_name, + value: filter.name, + disabled: @active_filter_names.include?(filter.name) + ) + end + end + end +end diff --git a/app/forms/filters/inputs/autocomplete_form.rb b/app/forms/filters/inputs/autocomplete_form.rb new file mode 100644 index 00000000000..e1daa0791b2 --- /dev/null +++ b/app/forms/filters/inputs/autocomplete_form.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm + def add_operand(group) + group.autocompleter( + name: "v-#{@filter.class.key}", + label: @filter.human_name, + visually_hide_label: true, + required: true, + include_blank: false, + wrapper_data_attributes: { + "filter--filters-form-target": "filterValueContainer", + "filter-name": @filter.name, + "filter-autocomplete": "true" + }, + autocomplete_options: @additional_attributes[:autocomplete_options].merge( + multiple: true, + multipleAsSeparateInputs: false, + inputName: "value", + inputValue: @filter.values + ) + ) + end +end diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb new file mode 100644 index 00000000000..48f7f0bcc48 --- /dev/null +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::BaseFilterForm < ApplicationForm + def initialize(filter:, additional_attributes:, active:) + super() + @filter = filter + @additional_attributes = additional_attributes + @active = active + end + + def self.inherited(subclass) + super + subclass.form do |form| + form.group(**filter_row_arguments) do |group| + add_operator(group) + add_operand(group) + add_delete_button(group) + end + end + end + + protected + + def add_operand(_group) + raise SubclassResponsibilityError + end + + def filter_row_arguments + args = { + layout: :horizontal, + classes: "advanced-filters--filter", + data: { + "filter--filters-form-target": "filter", + "filter-name": @filter.name, + "filter-type": @filter.type + } + } + args[:hidden] = "hidden" unless @active + args + end + + private + + def add_operator(group) + selected_operator = @filter.operator || @filter.default_operator.symbol + + group.select_list( + name: :"operator_#{@filter.name}", + label: @filter.human_name, + scope_name_to_model: false, + hidden: @filter.is_a?(Queries::Filters::Shared::BooleanFilter), + data: { + action: "change->filter--filters-form#setValueVisibility", + "filter--filters-form-filter-name-param": @filter.name, + "filter--filters-form-target": "operator", + "filter-name": @filter.name + } + ) do |select| + @filter.available_operators.each do |op| + select.option( + label: op.human_name, + value: op.symbol, + selected: op.symbol == selected_operator + ) + end + end + end + + def add_delete_button(group) + group.button( + name: :remove_filter, + label: I18n.t("button_delete"), + scheme: :danger, + data: { + action: "click->filter--filters-form#removeFilter", + "filter--filters-form-filter-name-param": @filter.name + } + ) do |button| + button.with_leading_visual_icon(icon: :trash) + end + end +end diff --git a/app/forms/filters/inputs/boolean_form.rb b/app/forms/filters/inputs/boolean_form.rb new file mode 100644 index 00000000000..5e5e2e20e5a --- /dev/null +++ b/app/forms/filters/inputs/boolean_form.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::BooleanForm < Filters::Inputs::BaseFilterForm + def add_operand(group) + group.check_box( + label: @filter.human_name, + name: "v-#{@filter.class.key}", + value: "t", + unchecked_value: "f", + checked: @filter.values.first == "t" + ) + end + + private + + def filter_row_arguments + super.tap do |args| + args[:data][:"filter--filters-form-target"] = "filter filterValueContainer" + end + end +end diff --git a/app/forms/filters/inputs/date_form.rb b/app/forms/filters/inputs/date_form.rb new file mode 100644 index 00000000000..cb156cf5a36 --- /dev/null +++ b/app/forms/filters/inputs/date_form.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm + DAYS_OPERATORS = %w[>t- t+ t+].freeze + + def add_operand(group) + filter_name = @filter.name + filter_values = @filter.values + fmt = date_format + + days_value = fmt == "days" ? filter_values.fetch(0, "") : nil + on_date_value = fmt == "on-date" ? filter_values.fetch(0, "") : nil + from_value = fmt == "between-dates" ? filter_values.fetch(0, "") : nil + to_value = fmt == "between-dates" ? filter_values.fetch(1, "") : nil + + group.multi(name: filter_name, label: filter_name, visually_hide_label: true, + class: ["advanced-filters--filter-value"], + data: { + "filter--filters-form-target": "filterValueContainer", + "filter-name": filter_name + }) do |builder| + days_div(builder, filter_name, days_value) + on_date_div(builder, filter_name, on_date_value) + between_dates_div(builder, filter_name, from_value, to_value) + end + end + + private + + def date_format + op = @filter.operator || @filter.default_operator.symbol + @date_format ||= if DAYS_OPERATORS.include?(op) + "days" + elsif op == "=d" + "on-date" + elsif op == "<>d" + "between-dates" + end + end + + def days_div(builder, filter_name, value) + field_arguments = { + id: "#{filter_name}_value", + name: :days, + label: I18n.t("datetime.units.day.other"), + visually_hide_label: true, + trailing_visual: { text: { text: I18n.t("datetime.units.day.other") } }, + scope_name_to_model: false, + value:, + hidden: value.nil?, + data: { + "filter--filters-form-target": "days", + "filter-name": filter_name + } + } + + builder.text_field(**field_arguments, type: :number, step: "any", class: "days") + end + + def on_date_div(builder, filter_name, value) + builder.single_date_picker( + name: :singleDay, + label: :singleDay, + hidden: value.nil?, + leading_visual: { icon: :calendar }, + value:, + data: { + "filter-name": filter_name + } + ) + end + + def between_dates_div(builder, filter_name, from_value, to_value) + value = [from_value, to_value].compact.join(" - ").presence + builder.range_date_picker( + name: :dateRange, + label: :dateRange, + hidden: value.nil?, + leading_visual: { icon: :calendar }, + value:, + data: { + "filter-name": filter_name + } + ) + end +end diff --git a/app/forms/filters/inputs/list_form.rb b/app/forms/filters/inputs/list_form.rb new file mode 100644 index 00000000000..ac2f2b9e158 --- /dev/null +++ b/app/forms/filters/inputs/list_form.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::ListForm < Filters::Inputs::BaseFilterForm + def add_operand(group) + filter_name = @filter.name + filter_values = @filter.values || [] + allowed_values = @filter.allowed_values + multi_value = filter_values.size > 1 + + group.multi(name: :value, label: :value, visually_hide_label: true, + class: ["advanced-filters--filter-value"], + data: { + "filter--filters-form-target": "filterValueContainer", + "filter-name": filter_name, + "multi-value": multi_value.to_s + }) do |builder| + builder.select_with_toggle( + name: :single, label: :single, + allowed_values:, + selected_values: [filter_values.first].compact, + multiple: false, collapse: false, filter_name:, + hidden: multi_value, + data: { + "filter--filters-form-target": "filterValueSelect", + "filter-name": filter_name + } + ) + builder.select_with_toggle( + name: :multi, label: :multi, + allowed_values:, + selected_values: filter_values, + multiple: true, collapse: true, filter_name:, + hidden: !multi_value, + data: { + "filter--filters-form-target": "filterValueSelect", + "filter-name": filter_name + } + ) + end + end +end diff --git a/app/forms/filters/inputs/select_with_toggle_component.html.erb b/app/forms/filters/inputs/select_with_toggle_component.html.erb new file mode 100644 index 00000000000..dfb3df04a80 --- /dev/null +++ b/app/forms/filters/inputs/select_with_toggle_component.html.erb @@ -0,0 +1,12 @@ +<%= render(FormControl.new(input: @input)) do %> + <%= content_tag(:div, **@field_wrap_arguments) do %> + <%= builder.select(@input.name, options, + { selected: @input.selected_values }.merge(@input.select_arguments), + **@input.input_arguments) %> + <%= render(Primer::Beta::Button.new(scheme: :invisible, type: :button, + aria: { label: I18n.t(:label_enable_multi_select) }, + data: button_data)) do |btn| %> + <% btn.with_leading_visual_icon(icon: @input.collapse? ? :dash : :plus) %> + <% end %> + <% end %> +<% end %> diff --git a/app/forms/filters/inputs/select_with_toggle_component.rb b/app/forms/filters/inputs/select_with_toggle_component.rb new file mode 100644 index 00000000000..6f35a2aa9e1 --- /dev/null +++ b/app/forms/filters/inputs/select_with_toggle_component.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::SelectWithToggleComponent < Primer::Forms::Select + def button_data + { + action: "click->filter--filters-form#toggleMultiSelect", + "filter--filters-form-filter-name-param": @input.filter_name, + "filter-name": @input.filter_name, + collapse: @input.collapse?.to_s + } + end +end diff --git a/app/forms/filters/inputs/select_with_toggle_input.rb b/app/forms/filters/inputs/select_with_toggle_input.rb new file mode 100644 index 00000000000..852336e28fa --- /dev/null +++ b/app/forms/filters/inputs/select_with_toggle_input.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::SelectWithToggleInput < Primer::Forms::Dsl::SelectInput + attr_reader :selected_values, :filter_name + + def initialize(name:, label:, allowed_values:, selected_values:, collapse:, filter_name:, **system_arguments) + @selected_values = Array(selected_values) + @collapse = collapse + @filter_name = filter_name + super(name:, label:, **system_arguments) do |select| + allowed_values.each { |opt_label, opt_value| select.option(label: opt_label, value: opt_value) } + end + end + + def collapse? = @collapse + + def to_component + Filters::Inputs::SelectWithToggleComponent.new(input: self) + end + + def type + :select_with_toggle + end +end diff --git a/app/forms/filters/inputs/text_form.rb b/app/forms/filters/inputs/text_form.rb new file mode 100644 index 00000000000..ba2efbc2072 --- /dev/null +++ b/app/forms/filters/inputs/text_form.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Filters::Inputs::TextForm < Filters::Inputs::BaseFilterForm + def add_operand(group) + field_arguments = { + name: :"v-#{@filter.class.key}", + label: @filter.human_name, + visually_hide_label: true, + scope_name_to_model: false, + value: @filter.values.first, + data: { + "filter--filters-form-target": "filterValueContainer simpleValue", + "filter-name": @filter.name + } + } + if @filter.type.in? %i[integer float] + group.text_field(**field_arguments, type: :number, step: "any") + else + group.text_field(**field_arguments) + end + end +end diff --git a/config/initializers/primer_forms.rb b/config/initializers/primer_forms.rb index 9aad976cd49..b3dec93ff21 100644 --- a/config/initializers/primer_forms.rb +++ b/config/initializers/primer_forms.rb @@ -31,4 +31,5 @@ Rails.application.config.to_prepare do Primer::Forms::Dsl::FormObject.include(Primer::OpenProject::Forms::Dsl::InputMethods) Primer::Forms::Dsl::InputGroup.include(Primer::OpenProject::Forms::Dsl::InputMethods) + Primer::Forms::Dsl::MultiInput.include(Primer::OpenProject::Forms::Dsl::InputMethods) end diff --git a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html index 8c320747278..5803a08cd1d 100644 --- a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html +++ b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html @@ -4,6 +4,7 @@ type="text" autocomplete="off" class="spot-input op-basic-range-datepicker--input" + data-filter--filters-form-target="dateRange" data-test-selector="op-basic-range-date-picker" [ngClass]="inputClassNames" [attr.data-value]="value" @@ -50,6 +51,7 @@ /> option background-color: var(--body-background) diff --git a/frontend/src/global_styles/primer/_overrides.sass b/frontend/src/global_styles/primer/_overrides.sass index f9f3869f6c0..3215f428457 100644 --- a/frontend/src/global_styles/primer/_overrides.sass +++ b/frontend/src/global_styles/primer/_overrides.sass @@ -38,7 +38,8 @@ &-input-wrap[invalid='true'] input:not(:focus) border-color: var(--control-borderColor-danger) - &-spacingWrapper > :empty + &-spacingWrapper > :empty, + &-spacingWrapper:not(:has(> :not([hidden]))) display: none .UnderlineNav diff --git a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts index 7250e3cbcdc..3384243b358 100644 --- a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts @@ -36,6 +36,7 @@ import { hideElement, showElement, } from 'core-app/shared/helpers/dom-helpers'; +import { PrimerMultiInputElement } from '@primer/view-components/app/lib/primer/forms/primer_multi_input'; interface PrimerTextFieldElement extends HTMLElement { inputElement:HTMLInputElement; @@ -56,12 +57,12 @@ export default class FiltersFormController extends Controller { 'simpleFilter', 'filter', 'addFilterSelect', - 'spacer', 'operator', 'filterValueContainer', 'filterValueSelect', 'days', 'singleDay', + 'dateRange', 'simpleValue', ]; @@ -70,12 +71,12 @@ export default class FiltersFormController extends Controller { declare readonly simpleFilterTargets:HTMLElement[]; declare readonly filterTargets:HTMLElement[]; declare readonly addFilterSelectTarget:HTMLSelectElement; - declare readonly spacerTarget:HTMLElement; declare readonly operatorTargets:HTMLSelectElement[]; declare readonly filterValueContainerTargets:HTMLElement[]; declare readonly filterValueSelectTargets:HTMLSelectElement[]; declare readonly daysTargets:HTMLInputElement[]; declare readonly singleDayTargets:HTMLInputElement[]; + declare readonly dateRangeTargets:HTMLInputElement[]; declare readonly simpleValueTargets:HTMLInputElement[]; declare readonly hasFilterFormToggleTarget:boolean; @@ -140,6 +141,13 @@ export default class FiltersFormController extends Controller { filterValueContainerTargetConnected(target:HTMLElement) { this.addChangeListener(target); + const filterName = target.getAttribute('data-filter-name'); + if (filterName) { + const operator = this.findTargetByName(filterName, this.operatorTargets); + if (operator && this.noValueOperators.includes(operator.value)) { + target.setAttribute('hidden', ''); + } + } } filterValueSelectTargetConnected(target:HTMLElement) { @@ -152,6 +160,31 @@ export default class FiltersFormController extends Controller { singleDayTargetConnected(target:HTMLElement) { this.addChangeListener(target); + this.registerAngularPickerWithMultiInput(target, 'opce-basic-single-date-picker'); + } + + dateRangeTargetConnected(target:HTMLElement) { + this.addChangeListener(target); + this.registerAngularPickerWithMultiInput(target, 'opce-range-date-picker'); + } + + // angular_component_tag serialises @Input() bindings as JSON in data-* attributes, so the + // Angular date picker wrapper's data-name holds a JSON-encoded value that primer-multi-input + // cannot use to identify its child fields. date_picker.html.erb therefore also sets + // data-multi-input-name as a plain string with the intended field name. + // This method is called when the Stimulus target connects, i.e. after Angular has already + // bootstrapped the component and consumed its data-* attributes, so we can safely overwrite + // data-name with the plain string from data-multi-input-name without interfering with Angular. + // primer-multi-input.activateField() then uses data-name to show/hide the correct picker + // when the filter operator changes. + private registerAngularPickerWithMultiInput(target:HTMLElement, tagName:string) { + const wrapper = target.closest(tagName); + if (wrapper?.closest('primer-multi-input')) { + const multiInputName = wrapper.getAttribute('data-multi-input-name'); + if (multiInputName) { + wrapper.setAttribute('data-name', multiInputName); + } + } } simpleValueTargetDisconnected(target:HTMLElement) { @@ -178,6 +211,10 @@ export default class FiltersFormController extends Controller { this.removeChangeListener(target); } + dateRangeTargetDisconnected(target:HTMLElement) { + this.removeChangeListener(target); + } + filterFormTargetConnected() { // Didn't really change, but we need to ensure that the visibility of the target is correct. // This is caused by there first being a skeleton form, which allows the user to already @@ -217,17 +254,22 @@ export default class FiltersFormController extends Controller { toggleMultiSelect({ params: { filterName } }:{ params:{ filterName:string } }) { const valueContainer = this.findTargetByName(filterName, this.filterValueContainerTargets); - const singleSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (selectField) => !selectField.multiple); - const multiSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (selectField) => selectField.multiple); - if (valueContainer && singleSelect && multiSelect) { - if (valueContainer.classList.contains('multi-value')) { - const valueToSelect = this.getValueToSelect(multiSelect); - this.setSelectOptions(singleSelect, valueToSelect); + const singleSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (s) => !s.multiple); + const multiSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (s) => s.multiple); + const multiInput = valueContainer?.querySelector('primer-multi-input'); + + if (valueContainer && singleSelect && multiSelect && multiInput) { + const isMultiMode = valueContainer.dataset.multiValue === 'true'; + + if (isMultiMode) { + this.setSelectOptions(singleSelect, this.getValueToSelect(multiSelect)); + multiInput.activateField('single'); } else { - const valueToSelect = this.getValueToSelect(singleSelect); - this.setSelectOptions(multiSelect, valueToSelect); + this.setSelectOptions(multiSelect, this.getValueToSelect(singleSelect)); + multiInput.activateField('multi'); } - valueContainer.classList.toggle('multi-value'); + + valueContainer.dataset.multiValue = isMultiMode ? 'false' : 'true'; } } @@ -269,11 +311,10 @@ export default class FiltersFormController extends Controller { addFilterByName(filterName:string) { const selectedFilter = this.findTargetByName(filterName, this.filterTargets); if (selectedFilter) { - selectedFilter.classList.remove('hidden'); + selectedFilter.removeAttribute('hidden'); } this.addFilterSelectTarget.selectedOptions[0].disabled = true; this.addFilterSelectTarget.selectedIndex = 0; - this.setSpacerVisibility(); this.focusFilterValueIfPossible(selectedFilter); @@ -313,12 +354,11 @@ export default class FiltersFormController extends Controller { removeFilter({ params: { filterName } }:{ params:{ filterName:string } }) { const filterToRemove = this.findTargetByName(filterName, this.filterTargets); - filterToRemove?.classList.add('hidden'); + filterToRemove?.setAttribute('hidden', ''); const selectOptions = Array.from(this.addFilterSelectTarget.options); const removedFilterOption = selectOptions.find((option) => option.value === filterName); removedFilterOption?.removeAttribute('disabled'); - this.setSpacerVisibility(); if (this.performTurboRequestsValue) { this.sendForm(); @@ -340,18 +380,6 @@ export default class FiltersFormController extends Controller { inputElement.dispatchEvent(inputEvent); } - private setSpacerVisibility() { - if (this.anyFiltersStillVisible()) { - this.spacerTarget.classList.remove('hidden'); - } else { - this.spacerTarget.classList.add('hidden'); - } - } - - private anyFiltersStillVisible() { - return this.filterTargets.some((filter) => !filter.classList.contains('hidden')); - } - private readonly noValueOperators = ['*', '!*', 't', 'w']; private readonly daysOperators = ['>t-', 't+', 't+']; private readonly onDateOperator = '=d'; @@ -362,23 +390,18 @@ export default class FiltersFormController extends Controller { const valueContainer = this.findTargetByName(filterName, this.filterValueContainerTargets); if (valueContainer) { if (this.noValueOperators.includes(selectedOperator)) { - valueContainer.classList.add('hidden'); + valueContainer.setAttribute('hidden', ''); } else { - valueContainer.classList.remove('hidden'); + valueContainer.removeAttribute('hidden'); } + const multiInput = valueContainer.querySelector('primer-multi-input'); if (this.daysOperators.includes(selectedOperator)) { - valueContainer.classList.add('days'); - valueContainer.classList.remove('on-date'); - valueContainer.classList.remove('between-dates'); + multiInput?.activateField('days'); } else if (selectedOperator === this.onDateOperator) { - valueContainer.classList.add('on-date'); - valueContainer.classList.remove('days'); - valueContainer.classList.remove('between-dates'); + multiInput?.activateField('singleDay'); } else if (selectedOperator === this.betweenDatesOperator) { - valueContainer.classList.add('between-dates'); - valueContainer.classList.remove('days'); - valueContainer.classList.remove('on-date'); + multiInput?.activateField('dateRange'); } } } @@ -455,7 +478,7 @@ export default class FiltersFormController extends Controller { } private parseAdvancedFilters():InternalFilterValue[] { - const advancedFilters = this.filterTargets.filter((filter) => !filter.classList.contains('hidden')); + const advancedFilters = this.filterTargets.filter((filter) => !filter.hasAttribute('hidden')); const filters:InternalFilterValue[] = []; advancedFilters.forEach((filter) => { @@ -533,9 +556,10 @@ export default class FiltersFormController extends Controller { } private parseSelectFilterValue(valueContainer:HTMLElement, filterName:string) { + const isMultiMode = valueContainer.dataset.multiValue === 'true'; let selectFields; - if (valueContainer.classList.contains('multi-value')) { + if (isMultiMode) { selectFields = this.filterValueSelectTargets.filter((selectField) => selectField.multiple && selectField.getAttribute('data-filter-name') === filterName); } else { selectFields = this.filterValueSelectTargets.filter((selectField) => !selectField.multiple && selectField.getAttribute('data-filter-name') === filterName); @@ -550,20 +574,21 @@ export default class FiltersFormController extends Controller { return null; } - private parseDateFilterValue(valueContainer:HTMLElement, filterName:string) { + private parseDateFilterValue(_valueContainer:HTMLElement, filterName:string) { let value; + const operator = this.findTargetByName(filterName, this.operatorTargets)?.value; - if (valueContainer.classList.contains('days')) { + if (operator && this.daysOperators.includes(operator)) { const dateValue = this.findTargetByName(filterName, this.daysTargets)?.value; value = _.without([dateValue], ''); - } else if (valueContainer.classList.contains('on-date')) { - const dateValue = this.findTargetById(`on-date-value-${filterName}`, this.singleDayTargets)?.value; + } else if (operator === this.onDateOperator) { + const dateValue = this.findTargetById(filterName, this.singleDayTargets)?.value; value = _.without([dateValue], ''); - } else if (valueContainer.classList.contains('between-dates')) { - const fromValue = this.findTargetById(`between-dates-from-value-${filterName}`, this.singleDayTargets)?.value; - const toValue = this.findTargetById(`between-dates-to-value-${filterName}`, this.singleDayTargets)?.value; + } else if (operator === this.betweenDatesOperator) { + const rangeValue = this.findTargetById(filterName, this.dateRangeTargets)?.value; + const [fromValue, toValue] = rangeValue?.split(' - ') ?? []; value = [fromValue, toValue]; } diff --git a/lib/primer/open_project/forms/date_picker.html.erb b/lib/primer/open_project/forms/date_picker.html.erb index a9cd1e8f6b0..46cf8dcd796 100644 --- a/lib/primer/open_project/forms/date_picker.html.erb +++ b/lib/primer/open_project/forms/date_picker.html.erb @@ -40,6 +40,10 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <%= render Primer::ConditionalWrapper.new(condition: @input.auto_check_src, tag: "auto-check", csrf: auto_check_authenticity_token, src: @input.auto_check_src) do %> <%= angular_component_tag @datepicker_options.fetch(:component), + data: { + targets: @input.input_arguments.dig(:data, :targets), + "multi-input-name": @input.input_arguments.dig(:data, :name) + }.compact, inputs: @datepicker_options.merge( id: @datepicker_options.fetch(:id) { builder.field_id(@input.name) }, name: @datepicker_options.fetch(:name) { builder.field_name(@input.name) }, diff --git a/lib/primer/open_project/forms/dsl/input_methods.rb b/lib/primer/open_project/forms/dsl/input_methods.rb index 1ecdb76798b..aa2dbb3d8ee 100644 --- a/lib/primer/open_project/forms/dsl/input_methods.rb +++ b/lib/primer/open_project/forms/dsl/input_methods.rb @@ -11,6 +11,10 @@ module Primer super(**decorate_options(**), &) end + def select_with_toggle(**, &) + add_input Filters::Inputs::SelectWithToggleInput.new(builder:, form:, **decorate_options(**), &) + end + def check_box(**, &) super(**decorate_options(**), &) end diff --git a/spec/features/projects/lists/columns_spec.rb b/spec/features/projects/lists/columns_spec.rb index 048f0efe1ea..4389d24765c 100644 --- a/spec/features/projects/lists/columns_spec.rb +++ b/spec/features/projects/lists/columns_spec.rb @@ -224,7 +224,7 @@ RSpec.describe "Projects lists columns", :js, with_settings: { login_required?: # Filter component is visible expect(page).to have_select("add_filter_select") # Filter for column is visible and can now be specified by the user - expect(page).to have_css(".advanced-filters--filter-name[for='created_at']") + expect(page).to have_css(".advanced-filters--filter[data-filter-name='created_at']") # The correct filter input field has focus expect(page.has_focus_on?(".advanced-filters--filter-value input#created_at_value")).to be(true) @@ -238,7 +238,7 @@ RSpec.describe "Projects lists columns", :js, with_settings: { login_required?: # Filter component is visible expect(page).to have_select("add_filter_select") # Filter for column is visible. Note that the filter name is different from the column attribute! - expect(page).to have_css(".advanced-filters--filter-name[for='project_status_code']") + expect(page).to have_css(".advanced-filters--filter[data-filter-name='project_status_code']") end it "does not offer to filter if the column has no associated filter" do diff --git a/spec/features/projects/lists/filters_spec.rb b/spec/features/projects/lists/filters_spec.rb index 441356c85af..f09208905a9 100644 --- a/spec/features/projects/lists/filters_spec.rb +++ b/spec/features/projects/lists/filters_spec.rb @@ -142,7 +142,7 @@ RSpec.describe "Projects list filters", :js, with_settings: { login_required?: f load_and_open_filters admin # value selection defaults to "active"' - expect(page).to have_css('li[data-filter-name="active"]') + expect(page).to have_css('.advanced-filters--filter[data-filter-name="active"]') projects_page.expect_projects_listed(parent_project, child_project, @@ -601,7 +601,7 @@ RSpec.describe "Projects list filters", :js, with_settings: { login_required?: f projects_page.expect_projects_listed(project) # switching to multiselect keeps the current selection - cf_filter = page.find("li[data-filter-name='#{list_custom_field.column_name}']") + cf_filter = page.find(".advanced-filters--filter[data-filter-name='#{list_custom_field.column_name}']") select_value_id = "#{list_custom_field.column_name}_value" @@ -614,7 +614,7 @@ RSpec.describe "Projects list filters", :js, with_settings: { login_required?: f projects_page.expect_projects_not_listed(development_project) projects_page.expect_projects_listed(project) - cf_filter = page.find("li[data-filter-name='#{list_custom_field.column_name}']") + cf_filter = page.find(".advanced-filters--filter[data-filter-name='#{list_custom_field.column_name}']") within(cf_filter) do # Query has two values for that filter. projects_page.expect_ng_value_label(select_value_id, diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index 93a946a0cf9..e5f73e23ea0 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -43,12 +43,12 @@ module Components if filter_name == "name_and_identifier" expect(page.find_by_id(filter_name).value).not_to be_empty elsif value - within("li[data-filter-name='#{filter_name}']") do + within(".advanced-filters--filter[data-filter-name='#{filter_name}']") do expect(page).to have_css(".advanced-filters--filter-value", text: value, visible: :all) end else expect(page) - .to have_css("li[data-filter-name='#{filter_name}']") + .to have_css(".advanced-filters--filter[data-filter-name='#{filter_name}']") end end @@ -119,29 +119,28 @@ module Components def select_filter(name, human_name) select human_name, from: "add_filter_select" - page.find("li[data-filter-name='#{name}']") + page.find(".advanced-filters--filter[data-filter-name='#{name}']") end def remove_filter(name) if name == "name_and_identifier" page.find_by_id("name_and_identifier").find(:xpath, "following-sibling::button").click else - page.find("li[data-filter-name='#{name}'] .filter_rem").click + page.find(".advanced-filters--filter[data-filter-name='#{name}'] .advanced-filters--remove-filter").click end end def set_toggle_filter(values) should_active = values.first == "yes" - is_active = page.has_selector? '[data-test-selector="spot-switch-handle"][data-qa-active]' + checkbox = page.find('input[type="checkbox"]') + is_active = checkbox.checked? - if should_active != is_active - page.find('[data-test-selector="spot-switch-handle"]').click - end + checkbox.click if should_active != is_active if should_active - expect(page).to have_css('[data-test-selector="spot-switch-handle"][data-qa-active]') + expect(page).to have_field(type: :checkbox, checked: true) else - expect(page).to have_css('[data-test-selector="spot-switch-handle"]:not([data-qa-active])') + expect(page).to have_field(type: :checkbox, checked: false) end end diff --git a/spec/support/pages/projects/index.rb b/spec/support/pages/projects/index.rb index 727c3094473..653f3f0c4ed 100644 --- a/spec/support/pages/projects/index.rb +++ b/spec/support/pages/projects/index.rb @@ -238,10 +238,12 @@ module Pages end def set_advanced_filter(name, human_name, human_operator = nil, values = [], send_keys: false) - selected_filter = select_filter(name, human_name) + select_filter(name, human_name) + + # Re-find after select_filter, as adding the filter triggers DOM updates + # that make the returned reference immediately stale (ObsoleteNode) + selected_filter = page.find(".advanced-filters--filter[data-filter-name='#{name}']") - # Detect filter type before apply_operator, which may trigger Turbo stream - # updates that make the selected_filter node reference stale (ObsoleteNode) is_autocomplete = autocomplete_filter?(selected_filter) is_date_or_datetime = date_filter?(selected_filter) || date_time_filter?(selected_filter) @@ -251,8 +253,8 @@ module Pages return unless values.any? - # Re-find element as apply_operator may have triggered DOM updates - selected_filter = page.find("li[data-filter-name='#{name}']") + # Re-find again as apply_operator may have triggered further DOM updates + selected_filter = page.find(".advanced-filters--filter[data-filter-name='#{name}']") within(selected_filter) do if boolean_filter?(name) From 715bc9f0033ad99838ccae8031a8a3e9cb7645ba Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 5 May 2026 10:56:28 +0200 Subject: [PATCH 083/381] =?UTF-8?q?Improve=20Primer=E2=80=99s=20filters=20?= =?UTF-8?q?UI=20alignment.=20wp/74380?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/filters/inputs/base_filter_form.rb | 22 ++++++++------- .../content/_advanced_filters.sass | 28 +++++++++++++++++++ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb index 48f7f0bcc48..200eefef5fd 100644 --- a/app/forms/filters/inputs/base_filter_form.rb +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -95,16 +95,18 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm end def add_delete_button(group) - group.button( - name: :remove_filter, - label: I18n.t("button_delete"), - scheme: :danger, - data: { - action: "click->filter--filters-form#removeFilter", - "filter--filters-form-filter-name-param": @filter.name - } - ) do |button| - button.with_leading_visual_icon(icon: :trash) + filter_name = @filter.name + group.html_content do + render(Primer::Beta::IconButton.new( + icon: :trash, + scheme: :invisible, + classes: "advanced-filters--remove-filter", + aria: { label: I18n.t("button_delete") }, + data: { + action: "click->filter--filters-form#removeFilter", + "filter--filters-form-filter-name-param": filter_name + } + )) end end end diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index e57677df661..fa726dd84e4 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -142,6 +142,34 @@ $advanced-filters--grid-gap: 10px .op-filters-form .FormControl:has([data-filter--filters-form-target~="filterValueContainer"].hidden) display: none !important +.op-filters-form + padding-top: $advanced-filters--close-icon-size + position: relative + + .advanced-filters--close + position: absolute + top: 0 + right: 0 + + .FormControl-horizontalGroup.advanced-filters--filter + align-items: flex-end + justify-content: space-between + + > .FormControl:first-child + flex: 0 0 $advanced-filters--operator-size + + > .FormControl.advanced-filters--filter-value + flex: 1 1 auto + min-width: 0 + + .advanced-filters--filter-value .FormControl-select-wrap + display: flex + align-items: center + gap: var(--base-size-4) + + .FormControl-select + flex: 1 1 auto + .work-packages-embedded-view--container .advanced-filters--container margin: 0 0 1rem 0 From fe39ccec977434f5f8ed95e2d18dce3037ccc8e0 Mon Sep 17 00:00:00 2001 From: David F Date: Mon, 11 May 2026 14:39:05 +0200 Subject: [PATCH 084/381] Improve input group markup for advanced filters. wp/74380 --- app/components/filter/filter_component.rb | 3 ++- app/components/filter/filters_component.sass | 20 ------------------- app/forms/filters/inputs/autocomplete_form.rb | 5 +++-- app/forms/filters/inputs/base_filter_form.rb | 18 +++++++++++++++++ app/forms/filters/inputs/boolean_form.rb | 7 +++++++ .../content/_advanced_filters.sass | 8 +++++++- .../open_project/forms/autocompleter.html.erb | 2 +- .../open_project/forms/autocompleter.rb | 3 ++- .../forms/dsl/autocompleter_input.rb | 7 ++++--- lib/primer/open_project/forms/html_content.rb | 2 ++ spec/support/components/common/filters.rb | 6 +++--- 11 files changed, 49 insertions(+), 32 deletions(-) diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index 61f534c724b..493562e395c 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -167,7 +167,8 @@ module Filter component: "opce-autocompleter", bindValue: "id", bindLabel: "name", - hideSelected: true + hideSelected: true, + defaultData: false } end diff --git a/app/components/filter/filters_component.sass b/app/components/filter/filters_component.sass index a424079927e..67bb6929f31 100644 --- a/app/components/filter/filters_component.sass +++ b/app/components/filter/filters_component.sass @@ -3,26 +3,6 @@ display: none &.-expanded display: block - .advanced-filters--filter-value - // visibility for datetime_past value selectors - &.between-dates - >.on-date, - >.days - display: none - &.on-date - >.between-dates, - >.days - display: none - &.days - >.on-date, - >.between-dates - display: none - - // Special input field styles - &.between-dates - input[type="text"] - display: inline-block - max-width: 6rem .advanced-filters--controls margin-top: 1rem diff --git a/app/forms/filters/inputs/autocomplete_form.rb b/app/forms/filters/inputs/autocomplete_form.rb index e1daa0791b2..3fbe6347b31 100644 --- a/app/forms/filters/inputs/autocomplete_form.rb +++ b/app/forms/filters/inputs/autocomplete_form.rb @@ -35,7 +35,7 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm label: @filter.human_name, visually_hide_label: true, required: true, - include_blank: false, + wrapper_classes: ["advanced-filters--filter-value"], wrapper_data_attributes: { "filter--filters-form-target": "filterValueContainer", "filter-name": @filter.name, @@ -45,7 +45,8 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm multiple: true, multipleAsSeparateInputs: false, inputName: "value", - inputValue: @filter.values + inputValue: @filter.values, + hiddenFieldAction: "change->filter--filters-form#autocompleteSendForm" ) ) end diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb index 200eefef5fd..7733b01912b 100644 --- a/app/forms/filters/inputs/base_filter_form.rb +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -40,6 +40,7 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm super subclass.form do |form| form.group(**filter_row_arguments) do |group| + add_label(group) add_operator(group) add_operand(group) add_delete_button(group) @@ -49,6 +50,22 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm protected + def add_label(group) + filter_human_name = @filter.human_name + for_id = operator_hidden? ? operand_input_id : "operator_#{@filter.name}" + group.html_content do + content_tag(:label, filter_human_name, class: "advanced-filters--filter-name", for: for_id) + end + end + + def operator_hidden? + @filter.is_a?(Queries::Filters::Shared::BooleanFilter) + end + + def operand_input_id + nil + end + def add_operand(_group) raise SubclassResponsibilityError end @@ -75,6 +92,7 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm group.select_list( name: :"operator_#{@filter.name}", label: @filter.human_name, + visually_hide_label: true, scope_name_to_model: false, hidden: @filter.is_a?(Queries::Filters::Shared::BooleanFilter), data: { diff --git a/app/forms/filters/inputs/boolean_form.rb b/app/forms/filters/inputs/boolean_form.rb index 5e5e2e20e5a..cb71dae2862 100644 --- a/app/forms/filters/inputs/boolean_form.rb +++ b/app/forms/filters/inputs/boolean_form.rb @@ -32,6 +32,7 @@ class Filters::Inputs::BooleanForm < Filters::Inputs::BaseFilterForm def add_operand(group) group.check_box( label: @filter.human_name, + visually_hide_label: true, name: "v-#{@filter.class.key}", value: "t", unchecked_value: "f", @@ -39,6 +40,12 @@ class Filters::Inputs::BooleanForm < Filters::Inputs::BaseFilterForm ) end + protected + + def operand_input_id + "v-#{@filter.class.key}" + end + private def filter_row_arguments diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index fa726dd84e4..cfe2e72280d 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -155,7 +155,13 @@ $advanced-filters--grid-gap: 10px align-items: flex-end justify-content: space-between - > .FormControl:first-child + > .advanced-filters--filter-name + flex: 0 0 $advanced-filters--label-size + overflow: hidden + text-overflow: ellipsis + white-space: nowrap + + > .FormControl:not(.advanced-filters--filter-value) flex: 0 0 $advanced-filters--operator-size > .FormControl.advanced-filters--filter-value diff --git a/lib/primer/open_project/forms/autocompleter.html.erb b/lib/primer/open_project/forms/autocompleter.html.erb index 4d35bdeb290..cd77d6dccc3 100644 --- a/lib/primer/open_project/forms/autocompleter.html.erb +++ b/lib/primer/open_project/forms/autocompleter.html.erb @@ -1,4 +1,4 @@ -<%= render(FormControl.new(input: @input, data: @wrapper_data_attributes)) do %> +<%= render(FormControl.new(input: @input, class: @wrapper_classes, data: @wrapper_data_attributes)) do %> <%= content_tag(:div, **@field_wrap_arguments) do %> <%= content_tag(:div, class: ["form-autocompleter-container", ("projects-autocomplete-with-search-icon" if @with_search_icon)]) do %> <%= angular_component_tag( diff --git a/lib/primer/open_project/forms/autocompleter.rb b/lib/primer/open_project/forms/autocompleter.rb index 43440e24ed7..55a0865cd5f 100644 --- a/lib/primer/open_project/forms/autocompleter.rb +++ b/lib/primer/open_project/forms/autocompleter.rb @@ -10,7 +10,7 @@ module Primer delegate :builder, :form, to: :@input - def initialize(input:, autocomplete_options:, wrapper_data_attributes: {}) + def initialize(input:, autocomplete_options:, wrapper_data_attributes: {}, wrapper_classes: []) super() @input = input @with_search_icon = autocomplete_options.delete(:with_search_icon) { false } @@ -18,6 +18,7 @@ module Primer @autocomplete_data = autocomplete_options.delete(:data) { {} } @autocomplete_inputs = extend_autocomplete_inputs(autocomplete_options) @wrapper_data_attributes = wrapper_data_attributes + @wrapper_classes = wrapper_classes end def extend_autocomplete_inputs(inputs) diff --git a/lib/primer/open_project/forms/dsl/autocompleter_input.rb b/lib/primer/open_project/forms/dsl/autocompleter_input.rb index 6f004f29d4d..fe08f993e8d 100644 --- a/lib/primer/open_project/forms/dsl/autocompleter_input.rb +++ b/lib/primer/open_project/forms/dsl/autocompleter_input.rb @@ -5,7 +5,7 @@ module Primer module Forms module Dsl class AutocompleterInput < Primer::Forms::Dsl::Input - attr_reader :name, :label, :autocomplete_options, :select_options, :wrapper_data_attributes + attr_reader :name, :label, :autocomplete_options, :select_options, :wrapper_data_attributes, :wrapper_classes class Option attr_reader :label, :value, :selected, :classes, :group_by, :disabled @@ -24,11 +24,12 @@ module Primer end end - def initialize(name:, label:, autocomplete_options:, wrapper_data_attributes: {}, **system_arguments) + def initialize(name:, label:, autocomplete_options:, wrapper_data_attributes: {}, wrapper_classes: [], **system_arguments) @name = name @label = label @autocomplete_options = derive_autocompleter_options(autocomplete_options) @wrapper_data_attributes = wrapper_data_attributes + @wrapper_classes = wrapper_classes @select_options = [] super(**system_arguments) @@ -47,7 +48,7 @@ module Primer end def to_component - Autocompleter.new(input: self, autocomplete_options:, wrapper_data_attributes:) + Autocompleter.new(input: self, autocomplete_options:, wrapper_data_attributes:, wrapper_classes:) end def type diff --git a/lib/primer/open_project/forms/html_content.rb b/lib/primer/open_project/forms/html_content.rb index 66b3e4b6eee..0d70a311346 100644 --- a/lib/primer/open_project/forms/html_content.rb +++ b/lib/primer/open_project/forms/html_content.rb @@ -10,6 +10,8 @@ module Primer @html_block = html_block end + def hidden? = false + def perform_render(&) super(&@html_block) end diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index e5f73e23ea0..3e3af2314f7 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -80,10 +80,10 @@ module Components if boolean_filter?(name) set_toggle_filter(values) elsif autocomplete_filter?(selected_filter) - select(human_operator, from: "operator") + select(human_operator, from: "operator_#{name}") set_autocomplete_filter(values) elsif name == "created_at" - select(human_operator, from: "operator") + select(human_operator, from: "operator_#{name}") set_created_at_filter(human_operator, values, send_keys:) elsif date_filter?(selected_filter) && human_operator == "on" set_date_filter(values, send_keys) @@ -114,7 +114,7 @@ module Components end def apply_operator(name, human_operator) - select(human_operator, from: "operator") unless boolean_filter?(name) + select(human_operator, from: "operator_#{name}") unless boolean_filter?(name) end def select_filter(name, human_name) From 46b22766fc398a049393431f5ebe282997f4167d Mon Sep 17 00:00:00 2001 From: David F Date: Mon, 11 May 2026 15:11:16 +0200 Subject: [PATCH 085/381] =?UTF-8?q?Improve=20Primer=E2=80=99s=20filters=20?= =?UTF-8?q?UI=20alignment.=20wp/74380?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/global_styles/content/_advanced_filters.sass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index cfe2e72280d..0ec28c51590 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -152,11 +152,12 @@ $advanced-filters--grid-gap: 10px right: 0 .FormControl-horizontalGroup.advanced-filters--filter - align-items: flex-end - justify-content: space-between + align-items: center + gap: $advanced-filters--grid-gap > .advanced-filters--filter-name flex: 0 0 $advanced-filters--label-size + text-align: right overflow: hidden text-overflow: ellipsis white-space: nowrap @@ -168,6 +169,10 @@ $advanced-filters--grid-gap: 10px flex: 1 1 auto min-width: 0 + > .advanced-filters--remove-filter + margin-left: auto + flex-shrink: 0 + .advanced-filters--filter-value .FormControl-select-wrap display: flex align-items: center From 527379c9a299113c77d85674d5d522da309ea59d Mon Sep 17 00:00:00 2001 From: David F Date: Mon, 11 May 2026 18:19:43 +0200 Subject: [PATCH 086/381] Fix most tests for advanced filters. wp/74380 --- spec/support/components/common/filters.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index 3e3af2314f7..5f67d157ede 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -156,17 +156,16 @@ module Components case human_operator when "on", "less than days ago", "more than days ago", "days ago" if send_keys - find_field("value").send_keys values.first + find_field("created_at").send_keys values.first else - fill_in "value", with: values.first + fill_in "created_at", with: values.first end when "between" + value = values.join(" - ") if send_keys - find_field("from_value").send_keys values.first - find_field("to_value").send_keys values.second + find_field("created_at").send_keys value else - fill_in "from_value", with: values.first - fill_in "to_value", with: values.second + fill_in "created_at", with: value end end end From 0f1daad3ee972cc8d15021c103f9bcb4fd3127d9 Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 12 May 2026 11:33:11 +0200 Subject: [PATCH 087/381] Fix advanced filters specs with date range picker. wp/74380 --- app/forms/filters/inputs/date_form.rb | 2 +- spec/support/components/common/filters.rb | 7 +++++-- spec/support/components/datepicker/datepicker.rb | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/forms/filters/inputs/date_form.rb b/app/forms/filters/inputs/date_form.rb index cb156cf5a36..7a8e0bee977 100644 --- a/app/forms/filters/inputs/date_form.rb +++ b/app/forms/filters/inputs/date_form.rb @@ -105,7 +105,7 @@ class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm label: :dateRange, hidden: value.nil?, leading_visual: { icon: :calendar }, - value:, + value: value || "-", data: { "filter-name": filter_name } diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index 5f67d157ede..c3d66881786 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -161,11 +161,14 @@ module Components fill_in "created_at", with: values.first end when "between" - value = values.join(" - ") if send_keys + value = values.join(" - ") find_field("created_at").send_keys value else - fill_in "created_at", with: value + find_field("created_at").click + datepicker = ::Components::RangeDatepicker.new + datepicker.set_date values.first + datepicker.set_date values.last end end end diff --git a/spec/support/components/datepicker/datepicker.rb b/spec/support/components/datepicker/datepicker.rb index bf28493b7c3..321f713051b 100644 --- a/spec/support/components/datepicker/datepicker.rb +++ b/spec/support/components/datepicker/datepicker.rb @@ -32,7 +32,7 @@ module Components end def container - page.find(context_selector) + page.document.find(context_selector) end def flatpickr_container From f22771f5fcdc2b01f797c6c1c9ba5018dc46b053 Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 12 May 2026 14:50:04 +0200 Subject: [PATCH 088/381] Replace old select with toggle with autocompleter. wp/74380 --- app/forms/filters/inputs/autocomplete_form.rb | 5 +- app/forms/filters/inputs/list_form.rb | 60 ++++++++--------- .../select_with_toggle_component.html.erb | 12 ---- .../inputs/select_with_toggle_component.rb | 40 ------------ .../inputs/select_with_toggle_input.rb | 52 --------------- .../src/global_styles/openproject/_forms.sass | 3 - .../dynamic/filter/filters-form.controller.ts | 65 ------------------- .../open_project/forms/dsl/input_methods.rb | 4 -- 8 files changed, 32 insertions(+), 209 deletions(-) delete mode 100644 app/forms/filters/inputs/select_with_toggle_component.html.erb delete mode 100644 app/forms/filters/inputs/select_with_toggle_component.rb delete mode 100644 app/forms/filters/inputs/select_with_toggle_input.rb diff --git a/app/forms/filters/inputs/autocomplete_form.rb b/app/forms/filters/inputs/autocomplete_form.rb index 3fbe6347b31..7e13a25caea 100644 --- a/app/forms/filters/inputs/autocomplete_form.rb +++ b/app/forms/filters/inputs/autocomplete_form.rb @@ -30,8 +30,10 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm def add_operand(group) + field_id = "#{@filter.name}_value" + group.autocompleter( - name: "v-#{@filter.class.key}", + name: field_id, label: @filter.human_name, visually_hide_label: true, required: true, @@ -42,6 +44,7 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm "filter-autocomplete": "true" }, autocomplete_options: @additional_attributes[:autocomplete_options].merge( + id: field_id, multiple: true, multipleAsSeparateInputs: false, inputName: "value", diff --git a/app/forms/filters/inputs/list_form.rb b/app/forms/filters/inputs/list_form.rb index ac2f2b9e158..c50effb3551 100644 --- a/app/forms/filters/inputs/list_form.rb +++ b/app/forms/filters/inputs/list_form.rb @@ -32,38 +32,34 @@ class Filters::Inputs::ListForm < Filters::Inputs::BaseFilterForm def add_operand(group) filter_name = @filter.name filter_values = @filter.values || [] - allowed_values = @filter.allowed_values - multi_value = filter_values.size > 1 + items = @filter.allowed_values.map { |name, id| { name:, id: } } + field_id = "#{filter_name}_value" - group.multi(name: :value, label: :value, visually_hide_label: true, - class: ["advanced-filters--filter-value"], - data: { - "filter--filters-form-target": "filterValueContainer", - "filter-name": filter_name, - "multi-value": multi_value.to_s - }) do |builder| - builder.select_with_toggle( - name: :single, label: :single, - allowed_values:, - selected_values: [filter_values.first].compact, - multiple: false, collapse: false, filter_name:, - hidden: multi_value, - data: { - "filter--filters-form-target": "filterValueSelect", - "filter-name": filter_name - } - ) - builder.select_with_toggle( - name: :multi, label: :multi, - allowed_values:, - selected_values: filter_values, - multiple: true, collapse: true, filter_name:, - hidden: !multi_value, - data: { - "filter--filters-form-target": "filterValueSelect", - "filter-name": filter_name - } - ) - end + group.autocompleter( + name: field_id, + label: :value, + visually_hide_label: true, + wrapper_classes: ["advanced-filters--filter-value"], + wrapper_data_attributes: { + "filter--filters-form-target": "filterValueContainer", + "filter-name": filter_name, + "filter-autocomplete": "true" + }, + autocomplete_options: { + component: "opce-autocompleter", + id: field_id, + multiple: true, + multipleAsSeparateInputs: false, + inputName: "value", + inputValue: filter_values, + items:, + model: items.select { |item| filter_values.include?(item[:id]) }, + bindLabel: "name", + bindValue: "id", + hideSelected: true, + defaultData: false, + hiddenFieldAction: "change->filter--filters-form#autocompleteSendForm" + } + ) end end diff --git a/app/forms/filters/inputs/select_with_toggle_component.html.erb b/app/forms/filters/inputs/select_with_toggle_component.html.erb deleted file mode 100644 index dfb3df04a80..00000000000 --- a/app/forms/filters/inputs/select_with_toggle_component.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= render(FormControl.new(input: @input)) do %> - <%= content_tag(:div, **@field_wrap_arguments) do %> - <%= builder.select(@input.name, options, - { selected: @input.selected_values }.merge(@input.select_arguments), - **@input.input_arguments) %> - <%= render(Primer::Beta::Button.new(scheme: :invisible, type: :button, - aria: { label: I18n.t(:label_enable_multi_select) }, - data: button_data)) do |btn| %> - <% btn.with_leading_visual_icon(icon: @input.collapse? ? :dash : :plus) %> - <% end %> - <% end %> -<% end %> diff --git a/app/forms/filters/inputs/select_with_toggle_component.rb b/app/forms/filters/inputs/select_with_toggle_component.rb deleted file mode 100644 index 6f35a2aa9e1..00000000000 --- a/app/forms/filters/inputs/select_with_toggle_component.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -#-- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -#++ - -class Filters::Inputs::SelectWithToggleComponent < Primer::Forms::Select - def button_data - { - action: "click->filter--filters-form#toggleMultiSelect", - "filter--filters-form-filter-name-param": @input.filter_name, - "filter-name": @input.filter_name, - collapse: @input.collapse?.to_s - } - end -end diff --git a/app/forms/filters/inputs/select_with_toggle_input.rb b/app/forms/filters/inputs/select_with_toggle_input.rb deleted file mode 100644 index 852336e28fa..00000000000 --- a/app/forms/filters/inputs/select_with_toggle_input.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -#-- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -#++ - -class Filters::Inputs::SelectWithToggleInput < Primer::Forms::Dsl::SelectInput - attr_reader :selected_values, :filter_name - - def initialize(name:, label:, allowed_values:, selected_values:, collapse:, filter_name:, **system_arguments) - @selected_values = Array(selected_values) - @collapse = collapse - @filter_name = filter_name - super(name:, label:, **system_arguments) do |select| - allowed_values.each { |opt_label, opt_value| select.option(label: opt_label, value: opt_value) } - end - end - - def collapse? = @collapse - - def to_component - Filters::Inputs::SelectWithToggleComponent.new(input: self) - end - - def type - :select_with_toggle - end -end diff --git a/frontend/src/global_styles/openproject/_forms.sass b/frontend/src/global_styles/openproject/_forms.sass index a00d3b91075..38c0f64a858 100644 --- a/frontend/src/global_styles/openproject/_forms.sass +++ b/frontend/src/global_styles/openproject/_forms.sass @@ -161,9 +161,6 @@ select background-position: right !important background-image: var(--select-arrow-bg-color-url) !important - &[multiple=multiple] - height: $height * 2 - &>option background-color: var(--body-background) diff --git a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts index 3384243b358..b4a227cf1d7 100644 --- a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts @@ -59,7 +59,6 @@ export default class FiltersFormController extends Controller { 'addFilterSelect', 'operator', 'filterValueContainer', - 'filterValueSelect', 'days', 'singleDay', 'dateRange', @@ -73,7 +72,6 @@ export default class FiltersFormController extends Controller { declare readonly addFilterSelectTarget:HTMLSelectElement; declare readonly operatorTargets:HTMLSelectElement[]; declare readonly filterValueContainerTargets:HTMLElement[]; - declare readonly filterValueSelectTargets:HTMLSelectElement[]; declare readonly daysTargets:HTMLInputElement[]; declare readonly singleDayTargets:HTMLInputElement[]; declare readonly dateRangeTargets:HTMLInputElement[]; @@ -150,10 +148,6 @@ export default class FiltersFormController extends Controller { } } - filterValueSelectTargetConnected(target:HTMLElement) { - this.addChangeListener(target); - } - daysTargetConnected(target:HTMLElement) { this.addChangeListener(target); } @@ -199,10 +193,6 @@ export default class FiltersFormController extends Controller { this.removeChangeListener(target); } - filterValueSelectTargetDisconnected(target:HTMLElement) { - this.removeChangeListener(target); - } - daysTargetDisconnected(target:HTMLElement) { this.removeChangeListener(target); } @@ -252,27 +242,6 @@ export default class FiltersFormController extends Controller { } } - toggleMultiSelect({ params: { filterName } }:{ params:{ filterName:string } }) { - const valueContainer = this.findTargetByName(filterName, this.filterValueContainerTargets); - const singleSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (s) => !s.multiple); - const multiSelect = this.findTargetByName(filterName, this.filterValueSelectTargets, (s) => s.multiple); - const multiInput = valueContainer?.querySelector('primer-multi-input'); - - if (valueContainer && singleSelect && multiSelect && multiInput) { - const isMultiMode = valueContainer.dataset.multiValue === 'true'; - - if (isMultiMode) { - this.setSelectOptions(singleSelect, this.getValueToSelect(multiSelect)); - multiInput.activateField('single'); - } else { - this.setSelectOptions(multiSelect, this.getValueToSelect(singleSelect)); - multiInput.activateField('multi'); - } - - valueContainer.dataset.multiValue = isMultiMode ? 'false' : 'true'; - } - } - private addChangeListener(target:HTMLElement) { if (!this.performTurboRequestsValue) { return; } @@ -293,16 +262,6 @@ export default class FiltersFormController extends Controller { } } - private getValueToSelect(selectElement:HTMLSelectElement) { - return selectElement.selectedOptions[0]?.value; - } - - private setSelectOptions(selectElement:HTMLSelectElement, selectedValue:string) { - Array.from(selectElement.options).forEach((option) => { - option.selected = option.value === selectedValue; - }); - } - addFilter(event:Event) { const filterName = (event.target as HTMLSelectElement).value; this.addFilterByName(filterName); @@ -521,7 +480,6 @@ export default class FiltersFormController extends Controller { } private readonly operatorsWithoutValues = ['*', '!*', 't', 'w']; - private readonly selectFilterTypes = ['list', 'list_all', 'list_optional']; private readonly dateFilterTypes = ['datetime_past', 'date']; private parseFilterValue(valueContainer:HTMLElement, filterName:string, filterType:string, operator:string) { @@ -539,10 +497,6 @@ export default class FiltersFormController extends Controller { return []; } - if (this.selectFilterTypes.includes(filterType)) { - return this.parseSelectFilterValue(valueContainer, filterName); - } - if (this.dateFilterTypes.includes(filterType)) { return this.parseDateFilterValue(valueContainer, filterName); } @@ -555,25 +509,6 @@ export default class FiltersFormController extends Controller { return null; } - private parseSelectFilterValue(valueContainer:HTMLElement, filterName:string) { - const isMultiMode = valueContainer.dataset.multiValue === 'true'; - let selectFields; - - if (isMultiMode) { - selectFields = this.filterValueSelectTargets.filter((selectField) => selectField.multiple && selectField.getAttribute('data-filter-name') === filterName); - } else { - selectFields = this.filterValueSelectTargets.filter((selectField) => !selectField.multiple && selectField.getAttribute('data-filter-name') === filterName); - } - - const selectedValues = _.flatten(Array.from(selectFields).map((selectField) => Array.from(selectField.selectedOptions).map((option) => option.value))); - - if (selectedValues.length > 0) { - return selectedValues; - } - - return null; - } - private parseDateFilterValue(_valueContainer:HTMLElement, filterName:string) { let value; const operator = this.findTargetByName(filterName, this.operatorTargets)?.value; diff --git a/lib/primer/open_project/forms/dsl/input_methods.rb b/lib/primer/open_project/forms/dsl/input_methods.rb index aa2dbb3d8ee..1ecdb76798b 100644 --- a/lib/primer/open_project/forms/dsl/input_methods.rb +++ b/lib/primer/open_project/forms/dsl/input_methods.rb @@ -11,10 +11,6 @@ module Primer super(**decorate_options(**), &) end - def select_with_toggle(**, &) - add_input Filters::Inputs::SelectWithToggleInput.new(builder:, form:, **decorate_options(**), &) - end - def check_box(**, &) super(**decorate_options(**), &) end From 8403bb74f29e6bda7da796744f2d61f1a9ea4b7b Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 12 May 2026 15:14:05 +0200 Subject: [PATCH 089/381] Generalize datetime helper for advanced filters. wp/74380 --- app/forms/filters/inputs/date_form.rb | 1 - .../open_project/forms/dsl/autocompleter_input.rb | 3 ++- spec/features/projects/lists/columns_spec.rb | 2 +- spec/support/components/common/filters.rb | 12 ++++++------ spec/support/pages/projects/index.rb | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/forms/filters/inputs/date_form.rb b/app/forms/filters/inputs/date_form.rb index 7a8e0bee977..6cba1791b13 100644 --- a/app/forms/filters/inputs/date_form.rb +++ b/app/forms/filters/inputs/date_form.rb @@ -68,7 +68,6 @@ class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm def days_div(builder, filter_name, value) field_arguments = { - id: "#{filter_name}_value", name: :days, label: I18n.t("datetime.units.day.other"), visually_hide_label: true, diff --git a/lib/primer/open_project/forms/dsl/autocompleter_input.rb b/lib/primer/open_project/forms/dsl/autocompleter_input.rb index fe08f993e8d..ef7c582ffd7 100644 --- a/lib/primer/open_project/forms/dsl/autocompleter_input.rb +++ b/lib/primer/open_project/forms/dsl/autocompleter_input.rb @@ -24,7 +24,8 @@ module Primer end end - def initialize(name:, label:, autocomplete_options:, wrapper_data_attributes: {}, wrapper_classes: [], **system_arguments) + def initialize(name:, label:, autocomplete_options:, wrapper_data_attributes: {}, wrapper_classes: [], + **system_arguments) @name = name @label = label @autocomplete_options = derive_autocompleter_options(autocomplete_options) diff --git a/spec/features/projects/lists/columns_spec.rb b/spec/features/projects/lists/columns_spec.rb index 4389d24765c..0fe8377b906 100644 --- a/spec/features/projects/lists/columns_spec.rb +++ b/spec/features/projects/lists/columns_spec.rb @@ -227,7 +227,7 @@ RSpec.describe "Projects lists columns", :js, with_settings: { login_required?: expect(page).to have_css(".advanced-filters--filter[data-filter-name='created_at']") # The correct filter input field has focus - expect(page.has_focus_on?(".advanced-filters--filter-value input#created_at_value")).to be(true) + expect(page.has_focus_on?(".advanced-filters--filter-value input#created_at_days")).to be(true) end it "adds the filter for a selected column that has a different filter mapped to its column" do diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index c3d66881786..65a1a301397 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -84,7 +84,7 @@ module Components set_autocomplete_filter(values) elsif name == "created_at" select(human_operator, from: "operator_#{name}") - set_created_at_filter(human_operator, values, send_keys:) + set_datetime_filter(name, human_operator, values, send_keys:) elsif date_filter?(selected_filter) && human_operator == "on" set_date_filter(values, send_keys) end @@ -152,20 +152,20 @@ module Components end end - def set_created_at_filter(human_operator, values, send_keys: false) + def set_datetime_filter(filter_name, human_operator, values, send_keys: false) case human_operator when "on", "less than days ago", "more than days ago", "days ago" if send_keys - find_field("created_at").send_keys values.first + find_field(filter_name).send_keys values.first else - fill_in "created_at", with: values.first + fill_in filter_name, with: values.first end when "between" if send_keys value = values.join(" - ") - find_field("created_at").send_keys value + find_field(filter_name).send_keys value else - find_field("created_at").click + find_field(filter_name).click datepicker = ::Components::RangeDatepicker.new datepicker.set_date values.first datepicker.set_date values.last diff --git a/spec/support/pages/projects/index.rb b/spec/support/pages/projects/index.rb index 653f3f0c4ed..f6b05111cff 100644 --- a/spec/support/pages/projects/index.rb +++ b/spec/support/pages/projects/index.rb @@ -263,7 +263,7 @@ module Pages set_autocomplete_filter(values) elsif is_date_or_datetime wait_for_network_idle - set_created_at_filter(human_operator, values, send_keys:) + set_datetime_filter(name, human_operator, values, send_keys:) end end end From 1d1a31f86aa901d0d45912d67542a53199db61ca Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 12 May 2026 18:30:12 +0200 Subject: [PATCH 090/381] Clean up eventually useless code for advanced filters. wp/74380 --- app/components/_index.sass | 3 +- app/components/filter/filters_component.sass | 11 ----- app/views/filters/_autocomplete.html.erb | 22 --------- app/views/filters/_boolean.html.erb | 12 ----- app/views/filters/_text.html.erb | 47 ------------------- .../filters/date/_between_dates.html.erb | 16 ------- app/views/filters/date/_days.html.erb | 15 ------ .../filters/date/_input_options.html.erb | 24 ---------- app/views/filters/date/_on_date.html.erb | 10 ---- .../filters/list/_input_options.html.erb | 8 ---- app/views/filters/list/_select.html.erb | 30 ------------ .../content/_advanced_filters.sass | 5 ++ 12 files changed, 6 insertions(+), 197 deletions(-) delete mode 100644 app/components/filter/filters_component.sass delete mode 100644 app/views/filters/_autocomplete.html.erb delete mode 100644 app/views/filters/_boolean.html.erb delete mode 100644 app/views/filters/_text.html.erb delete mode 100644 app/views/filters/date/_between_dates.html.erb delete mode 100644 app/views/filters/date/_days.html.erb delete mode 100644 app/views/filters/date/_input_options.html.erb delete mode 100644 app/views/filters/date/_on_date.html.erb delete mode 100644 app/views/filters/list/_input_options.html.erb delete mode 100644 app/views/filters/list/_select.html.erb diff --git a/app/components/_index.sass b/app/components/_index.sass index db76bc961b5..cb2242e9956 100644 --- a/app/components/_index.sass +++ b/app/components/_index.sass @@ -1,6 +1,4 @@ @import "enterprise_edition/banner_component" -@import "filter/filters_component" -@import "open_project/common/border_box_list_component" @import "op_primer/border_box_table_component" @import "op_primer/full_page_prompt_component" @import "op_primer/form_helpers" @@ -9,6 +7,7 @@ @import "open_project/common/attribute_help_text_component" @import "open_project/common/attribute_help_text_caption_component" @import "open_project/common/attribute_label_component" +@import "open_project/common/border_box_list_component" @import "open_project/common/inplace_edit_fields/index" @import "open_project/common/submenu_component" @import "open_project/common/main_menu_toggle_component" diff --git a/app/components/filter/filters_component.sass b/app/components/filter/filters_component.sass deleted file mode 100644 index 67bb6929f31..00000000000 --- a/app/components/filter/filters_component.sass +++ /dev/null @@ -1,11 +0,0 @@ -.op-filters - &-form - display: none - &.-expanded - display: block - - .advanced-filters--controls - margin-top: 1rem - - &_top-margin - margin-top: 1rem diff --git a/app/views/filters/_autocomplete.html.erb b/app/views/filters/_autocomplete.html.erb deleted file mode 100644 index 9335b98483f..00000000000 --- a/app/views/filters/_autocomplete.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= content_tag :div, - class: "advanced-filters--filter-value #{value_visibility}", - data: { - filter_autocomplete: true, - filter__filters_form_target: "filterValueContainer", - filter_name: filter.name - } do %> - <%= angular_component_tag autocomplete_options[:component], - inputs: { - inputName: "value", - multiple: true, - multipleAsSeparateInputs: false, - inputValue: filter.values, - id: "#{filter.name}_value", - hiddenFieldAction: "change->filter--filters-form#autocompleteSendForm" - # Set on the template as there is a timing issue where the - # angular component is not yet ready in the DOM and hence - # the action can't be registered on the input field at the time - # of the #connect lifecycle hook of the filter--filters-form - # Stimulus controller. - }.merge(autocomplete_options.except(:component)) %> -<% end %> diff --git a/app/views/filters/_boolean.html.erb b/app/views/filters/_boolean.html.erb deleted file mode 100644 index 4fe5e8f0af9..00000000000 --- a/app/views/filters/_boolean.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/app/views/filters/_text.html.erb b/app/views/filters/_text.html.erb deleted file mode 100644 index 79b49bde366..00000000000 --- a/app/views/filters/_text.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -
- <% if filter.type == :string %> -
- <%= text_field_tag :value, - filter.values.first, - class: "advanced-filters--text-field -slim", - data: { - "filter--filters-form-target": "simpleValue", - "filter-name": filter.name - } %> -
- <% elsif filter.type == :text %> -
- <%= text_field_tag :value, - filter.values.first, - class: "advanced-filters--text-field -slim", - data: { - "filter--filters-form-target": "simpleValue", - "filter-name": filter.name - } %> -
- <% elsif filter.type == :integer %> -
- <%= number_field_tag :value, - filter.values.first, - class: "advanced-filters--text-field -slim", - step: "any", - data: { - "filter--filters-form-target": "simpleValue", - "filter-name": filter.name - } %> -
- <% elsif filter.type == :float %> -
- <%= number_field_tag :value, - filter.values.first, - class: "advanced-filters--text-field -slim", - step: "any", - data: { - "filter--filters-form-target": "simpleValue", - "filter-name": filter.name - } %> -
- <% end %> -
diff --git a/app/views/filters/date/_between_dates.html.erb b/app/views/filters/date/_between_dates.html.erb deleted file mode 100644 index 014f8e6129b..00000000000 --- a/app/views/filters/date/_between_dates.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -
- <%= t(:label_date_from) %>: - <%= angular_component_tag "opce-basic-single-date-picker", - inputs: { - value: from_value, - id: "between-dates-from-value-#{filter.name}", - name: "from_value" - } %> - <%= t(:label_date_to) %>: - <%= angular_component_tag "opce-basic-single-date-picker", - inputs: { - value: to_value, - id: "between-dates-to-value-#{filter.name}", - name: "to_value" - } %> -
diff --git a/app/views/filters/date/_days.html.erb b/app/views/filters/date/_days.html.erb deleted file mode 100644 index b2da731890a..00000000000 --- a/app/views/filters/date/_days.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -
-
-
- - <%= number_field_tag :value, - value, - id: "#{filter.name}_value", - class: "advanced-filters--text-field -slim", - "data-filter--filters-form-target": "days", - "data-filter-name": filter.name %> - - -
-
-
diff --git a/app/views/filters/date/_input_options.html.erb b/app/views/filters/date/_input_options.html.erb deleted file mode 100644 index 7a3c89a69c5..00000000000 --- a/app/views/filters/date/_input_options.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<% - value_format = "" - if [">t-", "t+", "t+"].include? selected_operator - value_format = "days" - elsif selected_operator == "=d" - value_format = "on-date" - elsif selected_operator == "<>d" - value_format = "between-dates" - end -%> -
- <%= render partial: "filters/date/days", - locals: { filter: filter, - value: value_format == "days" ? filter.values.first : "" } %> - <%= render partial: "filters/date/on_date", - locals: { filter: filter, - value: value_format == "on-date" ? filter.values.first : "" } %> - <%= render partial: "filters/date/between_dates", - locals: { filter: filter, - from_value: value_format == "between-dates" ? filter.values.first : "", - to_value: value_format == "between-dates" ? filter.values.second : "" } %> -
diff --git a/app/views/filters/date/_on_date.html.erb b/app/views/filters/date/_on_date.html.erb deleted file mode 100644 index a6b8706de10..00000000000 --- a/app/views/filters/date/_on_date.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
-
- <%= angular_component_tag "opce-basic-single-date-picker", - inputs: { - value: value, - id: "on-date-value-#{filter.name}", - name: "value" - } %> -
-
diff --git a/app/views/filters/list/_input_options.html.erb b/app/views/filters/list/_input_options.html.erb deleted file mode 100644 index 2035de12277..00000000000 --- a/app/views/filters/list/_input_options.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% filter_values = filter.values || [] %> - -
" - data-filter--filters-form-target="filterValueContainer" - data-filter-name="<%= filter.name %>"> - <%= render partial: "filters/list/select", locals: { filter: filter, selected_values: filter_values.first, multi_value: false } %> - <%= render partial: "filters/list/select", locals: { filter: filter, selected_values: filter_values, multi_value: true } %> -
diff --git a/app/views/filters/list/_select.html.erb b/app/views/filters/list/_select.html.erb deleted file mode 100644 index da65efe09c1..00000000000 --- a/app/views/filters/list/_select.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -
"> - - <% select_options = [:value, - options_from_collection_for_select( - filter.allowed_values, - :second, - :first, - selected_values - ), - { - class: "form--select -slim", - "data-filter--filters-form-target": "filterValueSelect", - "data-filter-name": filter.name, - id: "#{filter.name}_value" - }] - if multi_value - select_options.third[:multiple] = true - end %> - <%= select_tag *select_options %> - - icon4"> - <%= t(:label_enable_multi_select) %> - - - -
diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index 0ec28c51590..63999086835 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -143,9 +143,14 @@ $advanced-filters--grid-gap: 10px display: none !important .op-filters-form + display: none + margin-top: 1rem padding-top: $advanced-filters--close-icon-size position: relative + &.-expanded + display: block + .advanced-filters--close position: absolute top: 0 From 2fa7ce3ae8adfef2a036e558a37fa5e83a03b551 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 15 May 2026 08:48:20 +0200 Subject: [PATCH 091/381] Remove filters specific-attributes from date pickers. wp/74380 --- app/forms/filters/inputs/date_form.rb | 10 ++++------ .../basic-range-date-picker.component.html | 2 -- .../basic-range-date-picker.component.ts | 16 ++++++++++++++++ .../basic-single-date-picker.component.html | 2 -- .../basic-single-date-picker.component.ts | 16 ++++++++++++++++ .../open_project/forms/date_picker.html.erb | 1 + 6 files changed, 37 insertions(+), 10 deletions(-) diff --git a/app/forms/filters/inputs/date_form.rb b/app/forms/filters/inputs/date_form.rb index 6cba1791b13..b83297cbb64 100644 --- a/app/forms/filters/inputs/date_form.rb +++ b/app/forms/filters/inputs/date_form.rb @@ -91,9 +91,8 @@ class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm hidden: value.nil?, leading_visual: { icon: :calendar }, value:, - data: { - "filter-name": filter_name - } + datepicker_options: { input_attributes: { "data-filter--filters-form-target" => "singleDay" } }, + data: { "filter-name": filter_name } ) end @@ -105,9 +104,8 @@ class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm hidden: value.nil?, leading_visual: { icon: :calendar }, value: value || "-", - data: { - "filter-name": filter_name - } + datepicker_options: { input_attributes: { "data-filter--filters-form-target" => "dateRange" } }, + data: { "filter-name": filter_name } ) end end diff --git a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html index 5803a08cd1d..8c320747278 100644 --- a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html +++ b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.html @@ -4,7 +4,6 @@ type="text" autocomplete="off" class="spot-input op-basic-range-datepicker--input" - data-filter--filters-form-target="dateRange" data-test-selector="op-basic-range-date-picker" [ngClass]="inputClassNames" [attr.data-value]="value" @@ -51,7 +50,6 @@ /> ) { + this._inputAttrs = attrs; + this.applyInputAttrs(); + } + + private _inputAttrs:Record = {}; + @ViewChild('input') input:ElementRef; stringValue = ''; @@ -137,6 +144,15 @@ export class OpBasicRangeDatePickerComponent implements OnInit, ControlValueAcce if (!this.mobile) { this.initializeDatePicker(); } + this.applyInputAttrs(); + } + + private applyInputAttrs():void { + const el = (this.input?.nativeElement as HTMLInputElement | null) + ?? (this.elementRef.nativeElement as HTMLElement).querySelector(`input[id="${this.id}"]`); + if (el) { + Object.entries(this._inputAttrs).forEach(([key, val]) => el.setAttribute(key, val)); + } } changeValueFromInputDebounced = debounce(this.changeValueFromInput.bind(this), 16); diff --git a/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.html b/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.html index 737283ecbb2..b864e0c9f91 100644 --- a/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.html +++ b/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.html @@ -4,7 +4,6 @@ type="text" autocomplete="off" class="spot-input" - data-filter--filters-form-target="singleDay" [ngClass]="inputClassNames" [ngModel]="value" [attr.data-value]="value" @@ -26,7 +25,6 @@ ) { + this._inputAttrs = attrs; + this.applyInputAttrs(); + } + + private _inputAttrs:Record = {}; + @ViewChild('input') input:ElementRef; mobile = false; @@ -116,6 +123,15 @@ export class OpBasicSingleDatePickerComponent implements ControlValueAccessor, O if (!this.mobile) { this.initializeDatePicker(); } + this.applyInputAttrs(); + } + + private applyInputAttrs():void { + const el = (this.input?.nativeElement as HTMLInputElement | null) + ?? (this.elementRef.nativeElement as HTMLElement).querySelector(`input[id="${this.id}"]`); + if (el) { + Object.entries(this._inputAttrs).forEach(([key, val]) => el.setAttribute(key, val)); + } } ngOnDestroy():void { diff --git a/lib/primer/open_project/forms/date_picker.html.erb b/lib/primer/open_project/forms/date_picker.html.erb index 46cf8dcd796..e2e54991c38 100644 --- a/lib/primer/open_project/forms/date_picker.html.erb +++ b/lib/primer/open_project/forms/date_picker.html.erb @@ -50,6 +50,7 @@ See COPYRIGHT and LICENSE files for more details. value: @datepicker_options.fetch(:value) { @input.input_arguments[:value] || builder.object&.send(@input.name) }, inputClassNames: @datepicker_options.fetch(:class) { @input.input_arguments[:class] }, dataAction: @datepicker_options.fetch(:data, {}).fetch(:action, nil), + inputAttrs: @datepicker_options.fetch(:input_attributes, nil), placeholder: @input.input_arguments.fetch(:placeholder, "") ) %> <% end %> From af60b3f2b8a1a9d4cbe93655f76d2868a42a36fe Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 15 May 2026 11:47:22 +0200 Subject: [PATCH 092/381] Align advanced filters with last mockups version. wp/74380 --- .../filter/filter_component.html.erb | 29 ++++++++-------- app/components/filter/filter_component.rb | 7 +++- app/forms/filters/inputs/base_filter_form.rb | 2 +- .../content/_advanced_filters.sass | 34 +++++++++++++++---- 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/app/components/filter/filter_component.html.erb b/app/components/filter/filter_component.html.erb index f3e06530bc2..ad5f8878036 100644 --- a/app/components/filter/filter_component.html.erb +++ b/app/components/filter/filter_component.html.erb @@ -33,21 +33,20 @@ action: "submit->filter--filters-form#sendForm:prevent" } ) do |f| %> - <%= - render( - Primer::Beta::IconButton.new( - icon: :x, - scheme: :invisible, - classes: "advanced-filters--close", - tooltip_direction: :se, - aria: { label: t("js.close_form_title") }, - data: { action: "filter--filters-form#toggleDisplayFilters" } - ) - ) - %> - <%= render(Primer::Forms::FormList.new(*inputs(f))) %> - <% unless turbo_requests? %> - <%= render(Primer::Beta::Button.new(type: :submit, scheme: :primary)) { t("button_apply") } %> + <%= render(Primer::Beta::BorderBox.new) do |box| %> + <% box.with_body do %> + <%= render(Primer::Forms::FormList.new(*inputs(f))) %> + <% unless turbo_requests? %> +
+ <%= render(Primer::Beta::Button.new( + scheme: :secondary, + type: :button, + data: { action: "filter--filters-form#toggleDisplayFilters" } + )) { t("js.close_form_title") } %> + <%= render(Primer::Beta::Button.new(type: :submit, scheme: :primary)) { t("button_apply") } %> +
+ <% end %> + <% end %> <% end %> <% end %> <% end %> diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index 493562e395c..d96e744172d 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -78,7 +78,12 @@ module Filter end def filter_classes - "op-filters-form op-filters-form_top-margin #{'-expanded' if initially_expanded?}" + [ + "op-filters-form", + "op-filters-form_top-margin", + ("-expanded" if initially_expanded?), + ("op-filters-form--with-footer" unless turbo_requests?) + ].compact.join(" ") end def lazy_turbo_frame_src diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb index 7733b01912b..0a82b4b6856 100644 --- a/app/forms/filters/inputs/base_filter_form.rb +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -117,7 +117,7 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm group.html_content do render(Primer::Beta::IconButton.new( icon: :trash, - scheme: :invisible, + scheme: :danger, classes: "advanced-filters--remove-filter", aria: { label: I18n.t("button_delete") }, data: { diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index 63999086835..9450fb3546b 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -151,33 +151,53 @@ $advanced-filters--grid-gap: 10px &.-expanded display: block - .advanced-filters--close - position: absolute - top: 0 - right: 0 + &--with-footer + padding-top: 0 + + .advanced-filters--actions + display: flex + justify-content: flex-end + align-items: center + gap: var(--base-size-8) + margin-top: var(--base-size-16) .FormControl-horizontalGroup.advanced-filters--filter + max-width: 752px align-items: center gap: $advanced-filters--grid-gap + &:not([data-filter-type="boolean"]) + flex-wrap: wrap + > .advanced-filters--filter-name - flex: 0 0 $advanced-filters--label-size - text-align: right + text-align: left overflow: hidden text-overflow: ellipsis white-space: nowrap + &:not([data-filter-type="boolean"]) > .advanced-filters--filter-name + flex: 0 0 100% + + &[data-filter-type="boolean"] > .advanced-filters--filter-name + flex: 0 0 $advanced-filters--label-size + > .FormControl:not(.advanced-filters--filter-value) flex: 0 0 $advanced-filters--operator-size > .FormControl.advanced-filters--filter-value - flex: 1 1 auto + flex: 1 1 0 min-width: 0 > .advanced-filters--remove-filter margin-left: auto flex-shrink: 0 + .FormControl:has([data-filter--filters-form-target="addFilterSelect"]) + border-top: 1px solid var(--borderColor-muted) + margin-top: var(--base-size-8) + padding-top: var(--base-size-16) + max-width: 752px + .advanced-filters--filter-value .FormControl-select-wrap display: flex align-items: center From ebb76038b481698c5e9765014869a9a3759d36f7 Mon Sep 17 00:00:00 2001 From: David F Date: Mon, 18 May 2026 17:28:36 +0200 Subject: [PATCH 093/381] Turn Meetings filters into lazy-loaded auto-submitted ones. wp/74380 --- app/components/filter/filter_component.rb | 2 +- .../content/_advanced_filters.sass | 1 - .../meetings/delete_dialog_component.html.erb | 2 +- .../grouped_meetings_component.html.erb | 7 +++ .../meetings/grouped_meetings_component.rb | 52 ++++++++++++++++ .../meetings/index_results_component.html.erb | 3 + .../meetings/index_results_component.rb | 51 ++++++++++++++++ .../index_sub_header_component.html.erb | 2 + .../meetings/meeting_filters_component.rb | 2 + .../delete_dialog_component.html.erb | 2 +- .../concerns/meetings/query_loading.rb | 60 +++++++++++++++++++ .../meetings/filters_controller.rb | 43 +++++++++++++ .../app/controllers/meetings_controller.rb | 60 +++++++++---------- .../app/services/group_meetings_service.rb | 2 + .../views/meetings/_grouped_meetings.html.erb | 49 --------------- .../meeting/app/views/meetings/index.html.erb | 17 ++---- modules/meeting/config/routes.rb | 4 ++ .../lib/open_project/meeting/engine.rb | 1 + .../spec/features/meetings_index_spec.rb | 1 - 19 files changed, 264 insertions(+), 97 deletions(-) create mode 100644 modules/meeting/app/components/meetings/grouped_meetings_component.html.erb create mode 100644 modules/meeting/app/components/meetings/grouped_meetings_component.rb create mode 100644 modules/meeting/app/components/meetings/index_results_component.html.erb create mode 100644 modules/meeting/app/components/meetings/index_results_component.rb create mode 100644 modules/meeting/app/controllers/concerns/meetings/query_loading.rb create mode 100644 modules/meeting/app/controllers/meetings/filters_controller.rb delete mode 100644 modules/meeting/app/views/meetings/_grouped_meetings.html.erb diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index d96e744172d..39543c0b41e 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -87,7 +87,7 @@ module Filter end def lazy_turbo_frame_src - public_send(lazy_loaded_path, **params.permit(:filters, :columns, :sortBy, :id, :query_id)) + public_send(lazy_loaded_path, **params.permit(:filters, :columns, :sortBy, :id, :query_id, :project_id)) end protected diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index 9450fb3546b..264e61d87b0 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -145,7 +145,6 @@ $advanced-filters--grid-gap: 10px .op-filters-form display: none margin-top: 1rem - padding-top: $advanced-filters--close-icon-size position: relative &.-expanded diff --git a/modules/meeting/app/components/meetings/delete_dialog_component.html.erb b/modules/meeting/app/components/meetings/delete_dialog_component.html.erb index 5ec7fddc639..662c2900f75 100644 --- a/modules/meeting/app/components/meetings/delete_dialog_component.html.erb +++ b/modules/meeting/app/components/meetings/delete_dialog_component.html.erb @@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details. form_arguments: { action: project_meeting_path(@project, @meeting, back_url: @back_url), method: :delete, - data: { turbo: true } + data: { turbo: false } } ) ) do |dialog| diff --git a/modules/meeting/app/components/meetings/grouped_meetings_component.html.erb b/modules/meeting/app/components/meetings/grouped_meetings_component.html.erb new file mode 100644 index 00000000000..e90d8d6d426 --- /dev/null +++ b/modules/meeting/app/components/meetings/grouped_meetings_component.html.erb @@ -0,0 +1,7 @@ +<% if blank_slate? %> + <%= render Meetings::BlankSlateComponent.new(project: @project) %> +<% end %> +<% each_present_group do |key, meetings, mt| %> + <%= render(Primer::OpenProject::Heading.new(tag: :h3, mb: 3, mt:)) { I18n.t("label_meeting_index_#{key}") } %> + <%= render Meetings::TableComponent.new(rows: meetings, current_project: @project, test_selector: "meetings-table-#{key}") %> +<% end %> diff --git a/modules/meeting/app/components/meetings/grouped_meetings_component.rb b/modules/meeting/app/components/meetings/grouped_meetings_component.rb new file mode 100644 index 00000000000..a1ff18932c4 --- /dev/null +++ b/modules/meeting/app/components/meetings/grouped_meetings_component.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +module Meetings + class GroupedMeetingsComponent < ApplicationComponent + def initialize(grouped_meetings:, project:) + super() + @grouped_meetings = grouped_meetings + @project = project + end + + def blank_slate? + @grouped_meetings.empty? || @grouped_meetings.values.all?(&:empty?) + end + + def each_present_group + GroupMeetingsService::GROUPS.each_with_index do |key, index| + group = @grouped_meetings[key] + next if group.blank? + + yield key, group, index == 0 ? 0 : 3 + end + end + end +end diff --git a/modules/meeting/app/components/meetings/index_results_component.html.erb b/modules/meeting/app/components/meetings/index_results_component.html.erb new file mode 100644 index 00000000000..d64f44a9088 --- /dev/null +++ b/modules/meeting/app/components/meetings/index_results_component.html.erb @@ -0,0 +1,3 @@ +<%= helpers.turbo_frame_tag "meetings-index-results" do %> + <%= render content_component %> +<% end %> diff --git a/modules/meeting/app/components/meetings/index_results_component.rb b/modules/meeting/app/components/meetings/index_results_component.rb new file mode 100644 index 00000000000..baa891a69f6 --- /dev/null +++ b/modules/meeting/app/components/meetings/index_results_component.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +module Meetings + class IndexResultsComponent < ApplicationComponent + def initialize(grouped_meetings:, meetings:, project:, upcoming:) + super() + @grouped_meetings = grouped_meetings + @meetings = meetings + @project = project + @upcoming = upcoming + end + + def content_component + if @grouped_meetings + Meetings::GroupedMeetingsComponent.new(grouped_meetings: @grouped_meetings, project: @project) + elsif @meetings.empty? + Meetings::BlankSlateComponent.new(project: @project) + else + Meetings::TableComponent.new(rows: @meetings, current_project: @project, upcoming: @upcoming) + end + end + end +end diff --git a/modules/meeting/app/components/meetings/index_sub_header_component.html.erb b/modules/meeting/app/components/meetings/index_sub_header_component.html.erb index 54339876c0d..d27d4e2c4cb 100644 --- a/modules/meeting/app/components/meetings/index_sub_header_component.html.erb +++ b/modules/meeting/app/components/meetings/index_sub_header_component.html.erb @@ -4,6 +4,7 @@ data: { controller: "filter--filters-form", "filter--filters-form-output-format-value": "json", + "filter--filters-form-perform-turbo-requests-value": true, "filter--filters-form-display-filters-value": filters_expanded? } ) @@ -66,6 +67,7 @@ Meetings::MeetingFiltersComponent.new( query: @query, project: @project, + lazy_loaded_path: :meetings_filters_path, initially_expanded: filters_expanded? ) ) diff --git a/modules/meeting/app/components/meetings/meeting_filters_component.rb b/modules/meeting/app/components/meetings/meeting_filters_component.rb index 697198d5656..9c672b3cab9 100644 --- a/modules/meeting/app/components/meetings/meeting_filters_component.rb +++ b/modules/meeting/app/components/meetings/meeting_filters_component.rb @@ -33,6 +33,8 @@ module Meetings # rubocop:enable OpenProject/AddPreviewForViewComponent options :project + def turbo_requests? = true + def allowed_filters super .select { |f| allowed_filter?(f) } diff --git a/modules/meeting/app/components/recurring_meetings/delete_dialog_component.html.erb b/modules/meeting/app/components/recurring_meetings/delete_dialog_component.html.erb index 9a96b25fad1..e9d4429cddf 100644 --- a/modules/meeting/app/components/recurring_meetings/delete_dialog_component.html.erb +++ b/modules/meeting/app/components/recurring_meetings/delete_dialog_component.html.erb @@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details. form_arguments: { action: project_recurring_meeting_path(@project, @recurring_meeting), method: :delete, - data: { turbo: true } + data: { turbo: false } } ) ) do |dialog| diff --git a/modules/meeting/app/controllers/concerns/meetings/query_loading.rb b/modules/meeting/app/controllers/concerns/meetings/query_loading.rb new file mode 100644 index 00000000000..6be19632a0b --- /dev/null +++ b/modules/meeting/app/controllers/concerns/meetings/query_loading.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +module Meetings + module QueryLoading + private + + def build_meeting_query + query = ParamsToQueryService.new(Meeting, current_user).call(params) + query.where("project_id", "=", @project.id) if @project + apply_default_filter_if_none_given(query) + apply_default_time_filter_and_sort(query) + query + end + + def apply_default_time_filter_and_sort(query) + time_filter = query.filters.find { |f| f.name == :time } + + if time_filter.nil? + query.where("time", "=", Queries::Meetings::Filters::TimeFilter::FUTURE_VALUE) + query.order(start_time: :asc) + elsif time_filter.past? && query.orders.none? + query.order(start_time: :desc) + end + end + + def apply_default_filter_if_none_given(query) + return if params.key?(:filters) + + query.where("invited_user_id", "=", [User.current.id.to_s]) + end + end +end diff --git a/modules/meeting/app/controllers/meetings/filters_controller.rb b/modules/meeting/app/controllers/meetings/filters_controller.rb new file mode 100644 index 00000000000..ffb0583269f --- /dev/null +++ b/modules/meeting/app/controllers/meetings/filters_controller.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +class Meetings::FiltersController < ApplicationController + include Meetings::QueryLoading + + before_action :load_and_authorize_in_optional_project + + def show + render Meetings::MeetingFiltersComponent.new(query: load_query, project: @project), layout: false + end + + private + + def load_query = build_meeting_query +end diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb index 9c5e783082f..01f00e31ed3 100644 --- a/modules/meeting/app/controllers/meetings_controller.rb +++ b/modules/meeting/app/controllers/meetings_controller.rb @@ -43,6 +43,7 @@ class MeetingsController < ApplicationController before_action :check_for_enterprise_token, only: %i[create new_dialog fetch_templates] helper :watchers + include Meetings::QueryLoading include MeetingsHelper include Layout include WatchersHelper @@ -56,11 +57,34 @@ class MeetingsController < ApplicationController menu_item :new_meeting, only: %i[new create] - def index + def index # rubocop:disable Metrics/AbcSize load_meetings - render "index", - locals: { menu_name: project_or_global_menu } + respond_to do |format| + format.html do + render "index", locals: { menu_name: project_or_global_menu } + end + + format.turbo_stream do + update_via_turbo_stream( + component: Filter::FilterButtonComponent.new(query: @query, disable_buttons: false) + ) + + current_url = url_for(params.permit(:controller, :action, :filters, :project_id, :sortBy)) + turbo_streams << turbo_stream.replace( + "meetings-index-results", + Meetings::IndexResultsComponent.new( + grouped_meetings: @grouped_meetings, + meetings: @meetings, + project: @project, + upcoming: params[:upcoming] + ) + ) + turbo_streams << turbo_stream.push_state(current_url) + + render turbo_stream: turbo_streams + end + end end current_menu_item :index do @@ -438,35 +462,7 @@ class MeetingsController < ApplicationController end end - def load_query - query = ParamsToQueryService.new( - Meeting, - current_user - ).call(params) - - apply_default_filter_if_none_given(query) - apply_default_time_filter_and_sort(query) - query.where("project_id", "=", @project.id) if @project - - query - end - - def apply_default_time_filter_and_sort(query) - time_filter = query.filters.find { |f| f.name == :time } - - if time_filter.nil? - query.where("time", "=", Queries::Meetings::Filters::TimeFilter::FUTURE_VALUE) - query.order(start_time: :asc) - elsif time_filter.past? && query.orders.none? - query.order(start_time: :desc) - end - end - - def apply_default_filter_if_none_given(query) - return if params.key?(:filters) - - query.where("invited_user_id", "=", [User.current.id.to_s]) - end + def load_query = build_meeting_query def load_meetings @query = load_query diff --git a/modules/meeting/app/services/group_meetings_service.rb b/modules/meeting/app/services/group_meetings_service.rb index 95635204d71..34cb8183fa9 100644 --- a/modules/meeting/app/services/group_meetings_service.rb +++ b/modules/meeting/app/services/group_meetings_service.rb @@ -32,6 +32,8 @@ class GroupMeetingsService include Redmine::I18n include PaginationHelper + GROUPS = %i[today tomorrow this_week later].freeze + def initialize(all_meetings, as_options: false, limit: nil) @all_meetings = all_meetings @as_options = as_options diff --git a/modules/meeting/app/views/meetings/_grouped_meetings.html.erb b/modules/meeting/app/views/meetings/_grouped_meetings.html.erb deleted file mode 100644 index 882c14928a5..00000000000 --- a/modules/meeting/app/views/meetings/_grouped_meetings.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -<%#-- copyright -OpenProject is an open source project management software. -Copyright (C) the OpenProject GmbH - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 3. - -OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -Copyright (C) 2006-2013 Jean-Philippe Lang -Copyright (C) 2010-2013 the ChiliProject Team - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -See COPYRIGHT and LICENSE files for more details. - -++#%> - -<% if @grouped_meetings.empty? || @grouped_meetings.values.all?(&:empty?) -%> - <%= render Meetings::BlankSlateComponent.new(project: @project) %> -<% end %> -<% %i[today tomorrow this_week later].each_with_index do |key, i| %> - <% group = @grouped_meetings[key] %> - <% if group.present? %> - <%= render( - Primer::OpenProject::Heading.new( - tag: :h3, - mb: 3, - mt: i == 0 ? 0 : 3 - ) - ) { I18n.t("label_meeting_index_#{key}") } %> - <%= render Meetings::TableComponent.new( - rows: group, - current_project: @project, - test_selector: "meetings-table-#{key}" - ) %> - <% end %> -<% end %> diff --git a/modules/meeting/app/views/meetings/index.html.erb b/modules/meeting/app/views/meetings/index.html.erb index 25b8c0efe32..f6d76e73531 100644 --- a/modules/meeting/app/views/meetings/index.html.erb +++ b/modules/meeting/app/views/meetings/index.html.erb @@ -31,14 +31,9 @@ See COPYRIGHT and LICENSE files for more details. <%= render(Meetings::IndexPageHeaderComponent.new(project: @project)) %> <%= render(Meetings::IndexSubHeaderComponent.new(query: @query, project: @project, params:)) %> -<% if @grouped_meetings -%> - <%= render partial: "grouped_meetings" %> -<% elsif @meetings.empty? -%> - <%= render Meetings::BlankSlateComponent.new(project: @project) %> -<% else %> - <%= render Meetings::TableComponent.new( - rows: @meetings, - current_project: @project, - upcoming: params[:upcoming] - ) %> -<% end -%> +<%= render Meetings::IndexResultsComponent.new( + grouped_meetings: @grouped_meetings, + meetings: @meetings, + project: @project, + upcoming: params[:upcoming] + ) %> diff --git a/modules/meeting/config/routes.rb b/modules/meeting/config/routes.rb index 643d67aa74d..c2037ab40c6 100644 --- a/modules/meeting/config/routes.rb +++ b/modules/meeting/config/routes.rb @@ -36,6 +36,10 @@ Rails.application.routes.draw do end end + namespace :meetings do + resource :filters, only: %i[show] + end + # Global route to show meetings over all projects and create form from the global view resources :meetings, only: %i[index show new create] do collection do diff --git a/modules/meeting/lib/open_project/meeting/engine.rb b/modules/meeting/lib/open_project/meeting/engine.rb index 959dd05bd0c..2da1ac11dbd 100644 --- a/modules/meeting/lib/open_project/meeting/engine.rb +++ b/modules/meeting/lib/open_project/meeting/engine.rb @@ -45,6 +45,7 @@ module OpenProject::Meeting { meetings: %i[index show check_for_updates download_ics presentation generate_pdf_dialog history], + "meetings/filters": %i[show], "meetings/menus": %i[show], work_package_meetings_tab: %i[index count], recurring_meetings: %i[index show new create download_ics] diff --git a/modules/meeting/spec/features/meetings_index_spec.rb b/modules/meeting/spec/features/meetings_index_spec.rb index 072db60a5ff..06b6b9c14f1 100644 --- a/modules/meeting/spec/features/meetings_index_spec.rb +++ b/modules/meeting/spec/features/meetings_index_spec.rb @@ -188,7 +188,6 @@ RSpec.describe "Meetings", "Index", :js do # keeps the past filter selected when changing advanced filters (Regression #61875)" do meetings_page.open_filters meetings_page.remove_filter "invited_user_id" - click_on "Apply" wait_for_network_idle From 683bda80b4197afaf94c764aa32f9d37de8d07ff Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 19 May 2026 10:49:54 +0200 Subject: [PATCH 094/381] =?UTF-8?q?Clean=20up=20some=20CSS=E2=80=AFand=20J?= =?UTF-8?q?S.=20wp/74380?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/global_styles/content/_advanced_filters.sass | 3 --- .../dynamic/filter/filters-form.controller.ts | 6 ++++-- spec/support/components/common/filters.rb | 2 ++ spec/support/pages/admin/users/index.rb | 10 ++++------ spec/support/pages/portfolios/index.rb | 1 - spec/support/pages/projects/index.rb | 1 - 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index 264e61d87b0..36425df07fa 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -139,9 +139,6 @@ $advanced-filters--grid-gap: 10px .op-filters-form .hidden display: none !important -.op-filters-form .FormControl:has([data-filter--filters-form-target~="filterValueContainer"].hidden) - display: none !important - .op-filters-form display: none margin-top: 1rem diff --git a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts index b4a227cf1d7..aba9ab1065a 100644 --- a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts @@ -101,20 +101,22 @@ export default class FiltersFormController extends Controller { }); private boundListener:() => void; + private boundClearListener:(event:MouseEvent) => void; initialize() { // Initialize runs anytime an element with a controller connected to the DOM for the first time this.boundListener = debounce(this.sendForm.bind(this), 300); + this.boundClearListener = (event:MouseEvent) => this.clearInputWithButton(event); } connect() { const clearButton = document.getElementById(this.clearButtonIdValue); - clearButton?.addEventListener('click', (event:MouseEvent) => this.clearInputWithButton(event)); + clearButton?.addEventListener('click', this.boundClearListener); } disconnect() { const clearButton = document.getElementById(this.clearButtonIdValue); - clearButton?.removeEventListener('click', (event:MouseEvent) => this.clearInputWithButton(event)); + clearButton?.removeEventListener('click', this.boundClearListener); } addFilterSelectTargetConnected() { diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index 65a1a301397..7e671f1636e 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -31,6 +31,8 @@ module Components module Common module Filters + include ::Components::Autocompleter::NgSelectAutocompleteHelpers + def expect_filters_container_toggled expect(page).to have_css(".op-filters-form") end diff --git a/spec/support/pages/admin/users/index.rb b/spec/support/pages/admin/users/index.rb index 711d06fccb8..65731e2914c 100644 --- a/spec/support/pages/admin/users/index.rb +++ b/spec/support/pages/admin/users/index.rb @@ -34,7 +34,7 @@ module Pages module Admin module Users class Index < ::Pages::Page - include ::Components::Autocompleter::NgSelectAutocompleteHelpers + include ::Components::Common::Filters def path "/users" @@ -75,13 +75,11 @@ module Pages def filter_by_status(value) open_filter_panel - unless page.has_css?("li.advanced-filters--filter[data-filter-name='status']:not(.hidden)") + unless page.has_css?(".advanced-filters--filter[data-filter-name='status']") select "Status", from: "add_filter_select" end - # Status renders a single-select and a hidden multi-select side by side; - # both share id="status_value". Scope to the visible single-select to disambiguate. - within("li.advanced-filters--filter[data-filter-name='status']:not(.hidden) .single-select") do - select value, from: "status_value" + within(".advanced-filters--filter[data-filter-name='status']") do + set_autocomplete_filter([value]) end wait_for_network_idle diff --git a/spec/support/pages/portfolios/index.rb b/spec/support/pages/portfolios/index.rb index 2da4b50a0a2..fc47bf032ca 100644 --- a/spec/support/pages/portfolios/index.rb +++ b/spec/support/pages/portfolios/index.rb @@ -34,7 +34,6 @@ module Pages module Portfolios class Index < ::Pages::Page include ::Components::Common::Filters - include ::Components::Autocompleter::NgSelectAutocompleteHelpers def path(*) "/portfolios" diff --git a/spec/support/pages/projects/index.rb b/spec/support/pages/projects/index.rb index f6b05111cff..f5b799c6d5d 100644 --- a/spec/support/pages/projects/index.rb +++ b/spec/support/pages/projects/index.rb @@ -34,7 +34,6 @@ module Pages module Projects class Index < ::Pages::Page include ::Components::Common::Filters - include ::Components::Autocompleter::NgSelectAutocompleteHelpers def path(*) "/projects" From 88a29a0aff103f2b2224f606ea91be59a8a774f2 Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 19 May 2026 14:59:09 +0200 Subject: [PATCH 095/381] Turn checkbox filters into toggle switch. wp/74380 --- app/forms/filters/inputs/boolean_form.rb | 30 ++++------- .../dynamic/filter/filters-form.controller.ts | 6 +++ .../filter/segmented-control.controller.ts | 51 +++++++++++++++++++ .../open_project/forms/dsl/input_methods.rb | 4 ++ .../forms/dsl/segmented_control_input.rb | 37 ++++++++++++++ .../forms/segmented_control.html.erb | 18 +++++++ .../open_project/forms/segmented_control.rb | 19 +++++++ spec/support/components/common/filters.rb | 14 +++-- 8 files changed, 152 insertions(+), 27 deletions(-) create mode 100644 frontend/src/stimulus/controllers/dynamic/filter/segmented-control.controller.ts create mode 100644 lib/primer/open_project/forms/dsl/segmented_control_input.rb create mode 100644 lib/primer/open_project/forms/segmented_control.html.erb create mode 100644 lib/primer/open_project/forms/segmented_control.rb diff --git a/app/forms/filters/inputs/boolean_form.rb b/app/forms/filters/inputs/boolean_form.rb index cb71dae2862..c482a0d00b7 100644 --- a/app/forms/filters/inputs/boolean_form.rb +++ b/app/forms/filters/inputs/boolean_form.rb @@ -30,27 +30,19 @@ class Filters::Inputs::BooleanForm < Filters::Inputs::BaseFilterForm def add_operand(group) - group.check_box( + group.segmented_control( + name: "#{@filter.name}_value", label: @filter.human_name, visually_hide_label: true, - name: "v-#{@filter.class.key}", - value: "t", - unchecked_value: "f", - checked: @filter.values.first == "t" + value: @filter.values.first, + items: [ + { value: "f", label: I18n.t("general_text_No") }, + { value: "t", label: I18n.t("general_text_Yes") } + ], + wrapper_data_attributes: { + "filter--filters-form-target": "filterValueContainer", + "filter-name": @filter.name + } ) end - - protected - - def operand_input_id - "v-#{@filter.class.key}" - end - - private - - def filter_row_arguments - super.tap do |args| - args[:data][:"filter--filters-form-target"] = "filter filterValueContainer" - end - end end diff --git a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts index aba9ab1065a..32e0d3ed7a9 100644 --- a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts @@ -503,6 +503,12 @@ export default class FiltersFormController extends Controller { return this.parseDateFilterValue(valueContainer, filterName); } + const hiddenField = valueContainer.querySelector('input[type="hidden"]'); + + if (hiddenField) { + return hiddenField.value ? [hiddenField.value] : null; + } + const value = this.findTargetByName(filterName, this.simpleValueTargets)?.value; if (value && value.length > 0) { diff --git a/frontend/src/stimulus/controllers/dynamic/filter/segmented-control.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/segmented-control.controller.ts new file mode 100644 index 00000000000..8e02a7ead55 --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/filter/segmented-control.controller.ts @@ -0,0 +1,51 @@ +/* + * -- copyright + * OpenProject is an open source project management software. + * Copyright (C) the OpenProject GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 3. + * + * OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: + * Copyright (C) 2006-2013 Jean-Philippe Lang + * Copyright (C) 2010-2013 the ChiliProject Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * See COPYRIGHT and LICENSE files for more details. + * ++ + * + */ + +import { Controller } from '@hotwired/stimulus'; + +export default class SegmentedControlController extends Controller { + static targets = ['field']; + + declare readonly fieldTarget:HTMLInputElement; + + // Reacts to Primer's itemActivated event (bubbled from segmented-control#select), + // which has already updated aria-current visually. Sets the backing hidden field + // value and bubbles a change event for filter--filters-form auto-submit. + activate(event:CustomEvent<{ item:HTMLButtonElement }>) { + const button = event.detail.item; + const value = button.dataset.value; + + if (value !== undefined) { + this.fieldTarget.value = value; + this.fieldTarget.dispatchEvent(new Event('change', { bubbles: true })); + } + } +} diff --git a/lib/primer/open_project/forms/dsl/input_methods.rb b/lib/primer/open_project/forms/dsl/input_methods.rb index 1ecdb76798b..79650763ba1 100644 --- a/lib/primer/open_project/forms/dsl/input_methods.rb +++ b/lib/primer/open_project/forms/dsl/input_methods.rb @@ -36,6 +36,10 @@ module Primer add_input AutocompleterInput.new(builder:, form:, **decorate_options(**), &) end + def segmented_control(**, &) + add_input SegmentedControlInput.new(builder:, form:, **decorate_options(**), &) + end + def block_note_editor(**, &) add_input BlockNoteEditorInput.new(builder:, form:, **decorate_options(**), &) end diff --git a/lib/primer/open_project/forms/dsl/segmented_control_input.rb b/lib/primer/open_project/forms/dsl/segmented_control_input.rb new file mode 100644 index 00000000000..73b32082cb3 --- /dev/null +++ b/lib/primer/open_project/forms/dsl/segmented_control_input.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Primer + module OpenProject + module Forms + module Dsl + class SegmentedControlInput < Primer::Forms::Dsl::Input + Item = Data.define(:value, :label) + + attr_reader :name, :label, :current_value, :items, :wrapper_data_attributes + + def initialize(name:, label:, value:, items:, wrapper_data_attributes: {}, **system_arguments) + @name = name + @label = label + @items = items.map { |item| Item.new(value: item[:value], label: item[:label]) } + @current_value = value.presence || @items.first&.value + @wrapper_data_attributes = wrapper_data_attributes + + super(**system_arguments) + end + + def to_component + SegmentedControl.new(input: self) + end + + def type + :segmented_control + end + + def focusable? + true + end + end + end + end + end +end diff --git a/lib/primer/open_project/forms/segmented_control.html.erb b/lib/primer/open_project/forms/segmented_control.html.erb new file mode 100644 index 00000000000..0d7ec322270 --- /dev/null +++ b/lib/primer/open_project/forms/segmented_control.html.erb @@ -0,0 +1,18 @@ +<%= render(FormControl.new(input: @input, data: @input.wrapper_data_attributes)) do %> +
+ <%= content_tag(:input, nil, + type: "hidden", + id: builder.field_id(@input.name), + name: builder.field_name(@input.name), + value: @input.current_value, + data: { "filter--segmented-control-target": "field" }) %> + <%= render(Primer::Alpha::SegmentedControl.new("aria-label": @input.label)) do |control| %> + <% @input.items.each do |item| %> + <% control.with_item(label: item.label, + selected: item.value == @input.current_value, + data: { value: item.value }) %> + <% end %> + <% end %> +
+<% end %> diff --git a/lib/primer/open_project/forms/segmented_control.rb b/lib/primer/open_project/forms/segmented_control.rb new file mode 100644 index 00000000000..3f01700e554 --- /dev/null +++ b/lib/primer/open_project/forms/segmented_control.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Primer + module OpenProject + module Forms + # :nodoc: + class SegmentedControl < Primer::Forms::BaseComponent + prepend WrappedInput + + delegate :builder, :form, to: :@input + + def initialize(input:) + super() + @input = input + end + end + end + end +end diff --git a/spec/support/components/common/filters.rb b/spec/support/components/common/filters.rb index 7e671f1636e..2d550684b0b 100644 --- a/spec/support/components/common/filters.rb +++ b/spec/support/components/common/filters.rb @@ -134,16 +134,14 @@ module Components def set_toggle_filter(values) should_active = values.first == "yes" - checkbox = page.find('input[type="checkbox"]') - is_active = checkbox.checked? + label = should_active ? I18n.t("general_text_Yes") : I18n.t("general_text_No") + hidden = page.find('input[type="hidden"]', visible: :all) + is_active = hidden.value == "t" - checkbox.click if should_active != is_active + click_button(label, exact: true) unless should_active == is_active - if should_active - expect(page).to have_field(type: :checkbox, checked: true) - else - expect(page).to have_field(type: :checkbox, checked: false) - end + expected_value = should_active ? "t" : "f" + expect(page).to have_field(hidden["name"], with: expected_value, type: :hidden) end def set_name_and_identifier_filter(values, send_keys: false) From 69c5b4f210b79f0e1d6ac860524f36032554247e Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 19 May 2026 15:21:18 +0200 Subject: [PATCH 096/381] Prevent naming collisions for advanced filters. wp/74380 --- app/forms/filters/inputs/autocomplete_form.rb | 6 ++---- app/forms/filters/inputs/base_filter_form.rb | 4 ++++ app/forms/filters/inputs/boolean_form.rb | 2 +- app/forms/filters/inputs/list_form.rb | 5 ++--- app/forms/filters/inputs/text_form.rb | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/forms/filters/inputs/autocomplete_form.rb b/app/forms/filters/inputs/autocomplete_form.rb index 7e13a25caea..0303efae19e 100644 --- a/app/forms/filters/inputs/autocomplete_form.rb +++ b/app/forms/filters/inputs/autocomplete_form.rb @@ -30,10 +30,8 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm def add_operand(group) - field_id = "#{@filter.name}_value" - group.autocompleter( - name: field_id, + name: operand_name, label: @filter.human_name, visually_hide_label: true, required: true, @@ -44,7 +42,7 @@ class Filters::Inputs::AutocompleteForm < Filters::Inputs::BaseFilterForm "filter-autocomplete": "true" }, autocomplete_options: @additional_attributes[:autocomplete_options].merge( - id: field_id, + id: operand_name, multiple: true, multipleAsSeparateInputs: false, inputName: "value", diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb index 0a82b4b6856..e3dc33e9501 100644 --- a/app/forms/filters/inputs/base_filter_form.rb +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -84,6 +84,10 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm args end + def operand_name + "#{@filter.name}_value" + end + private def add_operator(group) diff --git a/app/forms/filters/inputs/boolean_form.rb b/app/forms/filters/inputs/boolean_form.rb index c482a0d00b7..8cb564b997d 100644 --- a/app/forms/filters/inputs/boolean_form.rb +++ b/app/forms/filters/inputs/boolean_form.rb @@ -31,7 +31,7 @@ class Filters::Inputs::BooleanForm < Filters::Inputs::BaseFilterForm def add_operand(group) group.segmented_control( - name: "#{@filter.name}_value", + name: operand_name, label: @filter.human_name, visually_hide_label: true, value: @filter.values.first, diff --git a/app/forms/filters/inputs/list_form.rb b/app/forms/filters/inputs/list_form.rb index c50effb3551..cf6533f8d07 100644 --- a/app/forms/filters/inputs/list_form.rb +++ b/app/forms/filters/inputs/list_form.rb @@ -33,10 +33,9 @@ class Filters::Inputs::ListForm < Filters::Inputs::BaseFilterForm filter_name = @filter.name filter_values = @filter.values || [] items = @filter.allowed_values.map { |name, id| { name:, id: } } - field_id = "#{filter_name}_value" group.autocompleter( - name: field_id, + name: operand_name, label: :value, visually_hide_label: true, wrapper_classes: ["advanced-filters--filter-value"], @@ -47,7 +46,7 @@ class Filters::Inputs::ListForm < Filters::Inputs::BaseFilterForm }, autocomplete_options: { component: "opce-autocompleter", - id: field_id, + id: operand_name, multiple: true, multipleAsSeparateInputs: false, inputName: "value", diff --git a/app/forms/filters/inputs/text_form.rb b/app/forms/filters/inputs/text_form.rb index ba2efbc2072..1db8ada4fc1 100644 --- a/app/forms/filters/inputs/text_form.rb +++ b/app/forms/filters/inputs/text_form.rb @@ -31,7 +31,7 @@ class Filters::Inputs::TextForm < Filters::Inputs::BaseFilterForm def add_operand(group) field_arguments = { - name: :"v-#{@filter.class.key}", + name: operand_name, label: @filter.human_name, visually_hide_label: true, scope_name_to_model: false, From fd32b7b7651ec4f86e0140bab89862cf6952e122 Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 19 May 2026 16:55:06 +0200 Subject: [PATCH 097/381] Add some documentation for advanced filters. wp/74380 --- app/forms/filters/inputs/date_form.rb | 5 ++++ .../common/advanced_form_inputs_preview.rb | 24 +++++++++++++++++++ .../segmented_control_input_boolean.html.erb | 21 ++++++++++++++++ .../segmented_control_input_multi.html.erb | 22 +++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_boolean.html.erb create mode 100644 lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_multi.html.erb diff --git a/app/forms/filters/inputs/date_form.rb b/app/forms/filters/inputs/date_form.rb index b83297cbb64..9ed1d93ef18 100644 --- a/app/forms/filters/inputs/date_form.rb +++ b/app/forms/filters/inputs/date_form.rb @@ -41,6 +41,11 @@ class Filters::Inputs::DateForm < Filters::Inputs::BaseFilterForm from_value = fmt == "between-dates" ? filter_values.fetch(0, "") : nil to_value = fmt == "between-dates" ? filter_values.fetch(1, "") : nil + # The multi name intentionally uses @filter.name (not operand_name) because + # parseDateFilterValue in filters-form.controller.ts locates the datepicker + # inputs via findTargetById(filterName, …), which matches the id derived from + # the multi name. Switching to operand_name would require migrating that + # lookup to findTargetByName and adding data-filter-name to the picker inputs. group.multi(name: filter_name, label: filter_name, visually_hide_label: true, class: ["advanced-filters--filter-value"], data: { diff --git a/lookbook/previews/open_project/common/advanced_form_inputs_preview.rb b/lookbook/previews/open_project/common/advanced_form_inputs_preview.rb index 5797a60f267..cfc889a69fe 100644 --- a/lookbook/previews/open_project/common/advanced_form_inputs_preview.rb +++ b/lookbook/previews/open_project/common/advanced_form_inputs_preview.rb @@ -55,6 +55,30 @@ module OpenProject def check_box_group_with_include_hidden render_with_template end + + # **SegmentedControlInput** + # + # A Primer `SegmentedControl` backed by a plain ``. + # The hidden field is the source of truth for form submission: when the + # user selects a segment, the `filter--segmented-control` Stimulus + # controller reacts to Primer's `itemActivated` event, writes the chosen + # `data-value` into the hidden field, and dispatches a `change` event so + # that any ancestor change listener (e.g. `filter--filters-form`) can + # react without knowing about the segmented control at all. + # + # The first item is selected by default when `value:` is nil or absent. + def segmented_control_input_multi + render_with_template + end + + # **SegmentedControlInput — boolean toggle** + # + # A special case of `SegmentedControlInput` with exactly two items + # mimicking a toggle switch. Used for boolean filters where the backing + # values are `"t"` (yes) and `"f"` (no). + def segmented_control_input_boolean + render_with_template + end end end end diff --git a/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_boolean.html.erb b/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_boolean.html.erb new file mode 100644 index 00000000000..be19b7fa1ab --- /dev/null +++ b/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_boolean.html.erb @@ -0,0 +1,21 @@ +<% + the_form = Class.new(ApplicationForm) do + form do |f| + f.segmented_control( + name: :recurring, + label: "Part of a meeting series", + value: "f", + items: [ + { value: "f", label: I18n.t("general_text_No") }, + { value: "t", label: I18n.t("general_text_Yes") } + ] + ) + + f.submit(name: "submit", label: "Save") + end + end +%> + +<%= primer_form_with(url: "/abc", method: :post) do |f| + render(the_form.new(f)) +end %> diff --git a/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_multi.html.erb b/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_multi.html.erb new file mode 100644 index 00000000000..968ac1f30ab --- /dev/null +++ b/lookbook/previews/open_project/common/advanced_form_inputs_preview/segmented_control_input_multi.html.erb @@ -0,0 +1,22 @@ +<% + the_form = Class.new(ApplicationForm) do + form do |f| + f.segmented_control( + name: :priority, + label: "Priority", + value: "normal", + items: [ + { value: "low", label: "Low" }, + { value: "normal", label: "Normal" }, + { value: "high", label: "High" } + ] + ) + + f.submit(name: "submit", label: "Save") + end + end +%> + +<%= primer_form_with(url: "/abc", method: :post) do |f| + render(the_form.new(f)) +end %> From 9ff9f0f792d9c8717127ee05fb425c493f364477 Mon Sep 17 00:00:00 2001 From: David F Date: Tue, 19 May 2026 22:23:27 +0200 Subject: [PATCH 098/381] Update Meeting time quick filter on filter update. wp/74380 --- .../quick_filter/segmented_component.html.erb | 18 ++++---- .../quick_filter/segmented_component.rb | 7 +-- .../index_sub_header_component.html.erb | 13 +----- .../meetings/meeting_time_filter_component.rb | 46 +++++++++++++++++++ .../app/controllers/meetings_controller.rb | 5 +- 5 files changed, 65 insertions(+), 24 deletions(-) create mode 100644 modules/meeting/app/components/meetings/meeting_time_filter_component.rb diff --git a/app/components/op_primer/quick_filter/segmented_component.html.erb b/app/components/op_primer/quick_filter/segmented_component.html.erb index ba86fe5e682..52bc488c178 100644 --- a/app/components/op_primer/quick_filter/segmented_component.html.erb +++ b/app/components/op_primer/quick_filter/segmented_component.html.erb @@ -27,13 +27,15 @@ See COPYRIGHT and LICENSE files for more details. ++#%> -<%= render(Primer::Alpha::SegmentedControl.new("aria-label": @name, full_width: false)) do |control| %> - <% items.each do |item| %> - <% control.with_item( - tag: :a, - href: href_for(item.value), - label: item.label, - selected: current_value == item.value - ) %> +<%= component_wrapper do %> + <%= render(Primer::Alpha::SegmentedControl.new("aria-label": @name, full_width: false)) do |control| %> + <% items.each do |item| %> + <% control.with_item( + tag: :a, + href: href_for(item.value), + label: item.label, + selected: current_value == item.value + ) %> + <% end %> <% end %> <% end %> diff --git a/app/components/op_primer/quick_filter/segmented_component.rb b/app/components/op_primer/quick_filter/segmented_component.rb index 3ad3752ebec..0ead8fbb7fc 100644 --- a/app/components/op_primer/quick_filter/segmented_component.rb +++ b/app/components/op_primer/quick_filter/segmented_component.rb @@ -32,6 +32,7 @@ module OpPrimer module QuickFilter class SegmentedComponent < ApplicationComponent include ApplicationHelper + include OpTurbo::Streamable renders_many :items, Item @@ -45,9 +46,9 @@ module OpPrimer @orders = orders end - def render? - items.any? - end + def wrapper_key = "quick-filter-#{@filter_key}" + + def render? = items.any? private diff --git a/modules/meeting/app/components/meetings/index_sub_header_component.html.erb b/modules/meeting/app/components/meetings/index_sub_header_component.html.erb index d27d4e2c4cb..09a288aec64 100644 --- a/modules/meeting/app/components/meetings/index_sub_header_component.html.erb +++ b/modules/meeting/app/components/meetings/index_sub_header_component.html.erb @@ -10,18 +10,7 @@ ) ) do |subheader| subheader.with_quick_filter do - render( - OpPrimer::QuickFilter::SegmentedComponent.new( - name: I18n.t(:label_meeting_date_time), - query: @query, - filter_key: :time, - orders: { "future" => { start_time: :asc }, "past" => { start_time: :desc } }, - path_args: [@project, :meetings] - ) - ) do |component| - component.with_item(label: I18n.t(:label_upcoming_meetings_short), value: "future") - component.with_item(label: I18n.t(:label_past_meetings_short), value: "past") - end + render(Meetings::MeetingTimeFilterComponent.new(query: @query, project: @project)) end subheader.with_filter_component do diff --git a/modules/meeting/app/components/meetings/meeting_time_filter_component.rb b/modules/meeting/app/components/meetings/meeting_time_filter_component.rb new file mode 100644 index 00000000000..96896d8e4ac --- /dev/null +++ b/modules/meeting/app/components/meetings/meeting_time_filter_component.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +# ++ + +module Meetings + class MeetingTimeFilterComponent < OpPrimer::QuickFilter::SegmentedComponent + def initialize(query:, project: nil) + super( + name: I18n.t(:label_meeting_date_time), + query:, + filter_key: :time, + orders: { "future" => { start_time: :asc }, "past" => { start_time: :desc } }, + path_args: [project, :meetings].compact + ) + + with_item(label: I18n.t(:label_upcoming_meetings_short), value: "future") + with_item(label: I18n.t(:label_past_meetings_short), value: "past") + end + end +end diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb index 01f00e31ed3..8ed676b50cc 100644 --- a/modules/meeting/app/controllers/meetings_controller.rb +++ b/modules/meeting/app/controllers/meetings_controller.rb @@ -67,7 +67,10 @@ class MeetingsController < ApplicationController format.turbo_stream do update_via_turbo_stream( - component: Filter::FilterButtonComponent.new(query: @query, disable_buttons: false) + component: Meetings::MeetingTimeFilterComponent.new(query: @query, project: @project) + ) + update_via_turbo_stream( + component: Meetings::MeetingFilterButtonComponent.new(query: @query, project: @project, disable_buttons: false) ) current_url = url_for(params.permit(:controller, :action, :filters, :project_id, :sortBy)) From af4aa983a5eb89d797a367332849e8b3b911b73b Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 12:14:47 +0200 Subject: [PATCH 099/381] Use x icon with invisible scheme for filter delete button. wp/74380 As per review feedback from oliverguenther. --- app/forms/filters/inputs/base_filter_form.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/forms/filters/inputs/base_filter_form.rb b/app/forms/filters/inputs/base_filter_form.rb index e3dc33e9501..b10c9e952fb 100644 --- a/app/forms/filters/inputs/base_filter_form.rb +++ b/app/forms/filters/inputs/base_filter_form.rb @@ -120,8 +120,8 @@ class Filters::Inputs::BaseFilterForm < ApplicationForm filter_name = @filter.name group.html_content do render(Primer::Beta::IconButton.new( - icon: :trash, - scheme: :danger, + icon: :x, + scheme: :invisible, classes: "advanced-filters--remove-filter", aria: { label: I18n.t("button_delete") }, data: { From 7f07a793d96bdef0755225fac0b18e40cc01fc00 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 12:15:51 +0200 Subject: [PATCH 100/381] Guard inputAttrs setter against null in datepicker components. wp/74380 Rails serializes nil to null, so the setter must handle null safely. As per review feedback from Copilot. --- .../basic-range-date-picker.component.ts | 4 ++-- .../basic-single-date-picker.component.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts index 6324860fa78..2652ca4eb0e 100644 --- a/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts +++ b/frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts @@ -113,8 +113,8 @@ export class OpBasicRangeDatePickerComponent implements OnInit, ControlValueAcce @Input() dataAction = ''; - @Input() set inputAttrs(attrs:Record) { - this._inputAttrs = attrs; + @Input() set inputAttrs(attrs:Record | null) { + this._inputAttrs = attrs ?? {}; this.applyInputAttrs(); } diff --git a/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.ts b/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.ts index 46fe0fc4cab..ec008a482a8 100644 --- a/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.ts +++ b/frontend/src/app/shared/components/datepicker/basic-single-date-picker/basic-single-date-picker.component.ts @@ -93,8 +93,8 @@ export class OpBasicSingleDatePickerComponent implements ControlValueAccessor, O @Input() dataAction = ''; - @Input() set inputAttrs(attrs:Record) { - this._inputAttrs = attrs; + @Input() set inputAttrs(attrs:Record | null) { + this._inputAttrs = attrs ?? {}; this.applyInputAttrs(); } From cac6fa0a404159a89237f91a42ccc94bcd83d596 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 12:17:26 +0200 Subject: [PATCH 101/381] Preserve :upcoming param in push_state URL for meetings index. wp/74380 Without it, the upcoming/past view state is dropped from the URL after an auto-submit filter update. As per review feedback from Copilot. --- modules/meeting/app/controllers/meetings_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb index 8ed676b50cc..078a116ac45 100644 --- a/modules/meeting/app/controllers/meetings_controller.rb +++ b/modules/meeting/app/controllers/meetings_controller.rb @@ -73,7 +73,7 @@ class MeetingsController < ApplicationController component: Meetings::MeetingFilterButtonComponent.new(query: @query, project: @project, disable_buttons: false) ) - current_url = url_for(params.permit(:controller, :action, :filters, :project_id, :sortBy)) + current_url = url_for(params.permit(:controller, :action, :filters, :project_id, :sortBy, :upcoming)) turbo_streams << turbo_stream.replace( "meetings-index-results", Meetings::IndexResultsComponent.new( From 542792764e60b204ae3e28f9f75837f44bcd0049 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 12:19:38 +0200 Subject: [PATCH 102/381] Add input_methods spec for segmented_control. wp/74380 As per review feedback from myabc. --- .../primer/open_project/forms/dsl/input_methods_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb b/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb index 66fefe5292e..597129b85e3 100644 --- a/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb +++ b/spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb @@ -278,5 +278,14 @@ RSpec.describe Primer::OpenProject::Forms::Dsl::InputMethods, type: :forms do include_examples "input class", Primer::OpenProject::Forms::Dsl::SelectPanelInput it_behaves_like "supporting help texts" end + + describe "#segmented_control" do + let(:field_group) do + form_dsl.segmented_control(name:, label:, value: "a", items: [{ value: "a", label: "A" }], **options) + end + + include_examples "input class", Primer::OpenProject::Forms::Dsl::SegmentedControlInput + it_behaves_like "supporting help texts" + end end end From 81275741eea8a87a0ea841b39f57373de482d5d7 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 12:44:39 +0200 Subject: [PATCH 103/381] Remove dead .hidden CSS rules from advanced filters. wp/74380 The old Angular filter used class="hidden" on inactive filter rows. The new Primer form uses the HTML hidden attribute exclusively, which browsers handle natively. The .hidden class rules are dead code. --- frontend/src/global_styles/content/_advanced_filters.sass | 7 ------- 1 file changed, 7 deletions(-) diff --git a/frontend/src/global_styles/content/_advanced_filters.sass b/frontend/src/global_styles/content/_advanced_filters.sass index 36425df07fa..78b64d09d60 100644 --- a/frontend/src/global_styles/content/_advanced_filters.sass +++ b/frontend/src/global_styles/content/_advanced_filters.sass @@ -131,13 +131,6 @@ $advanced-filters--grid-gap: 10px height: 1px margin: 0.75rem 0 -.advanced-filters--spacer, -.advanced-filters--filter - &.hidden - display: none !important - -.op-filters-form .hidden - display: none !important .op-filters-form display: none From 3897c25139bbdcc5e1046d9bc59aff34303fc3c8 Mon Sep 17 00:00:00 2001 From: David F Date: Fri, 22 May 2026 13:59:16 +0200 Subject: [PATCH 104/381] Move autocomplete_options from FilterComponent to filter classes. wp/74380 As per review feedback from oliverguenther. --- app/components/filter/filter_component.rb | 89 +------------------ .../users/user_filters_component.rb | 23 ----- app/models/queries/filters/base.rb | 4 + .../filters/shared/custom_fields/hierarchy.rb | 17 ++++ .../shared/custom_fields/list_optional.rb | 21 ++++- .../filters/shared/custom_fields/user.rb | 16 ++++ .../filters/shared/project_filter/optional.rb | 8 ++ .../filters/shared/project_filter/required.rb | 8 ++ .../projects/filters/project_status_filter.rb | 13 +++ .../queries/projects/filters/type_filter.rb | 13 +++ .../queries/users/filters/group_filter.rb | 12 +++ .../meetings/meeting_filters_component.rb | 20 ----- .../meetings/filters/attended_user_filter.rb | 5 ++ .../queries/meetings/filters/author_filter.rb | 5 ++ .../meetings/filters/invited_user_filter.rb | 5 ++ spec/support/pages/admin/users/index.rb | 4 +- 16 files changed, 129 insertions(+), 134 deletions(-) diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index 39543c0b41e..7d401cb053b 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -100,22 +100,8 @@ module Filter # @param filter [QueryFilter] the filter for which we want to pass additional attributes # @return [Hash] the additional attributes for the filter, yielded in map_filter def additional_filter_attributes(filter) - case filter - when Queries::Filters::Shared::ProjectFilter::Required, - Queries::Filters::Shared::ProjectFilter::Optional - { autocomplete_options: project_autocomplete_options } - when Queries::Filters::Shared::CustomFields::User - { autocomplete_options: user_autocomplete_options } - when Queries::Filters::Shared::CustomFields::ListOptional - { autocomplete_options: custom_field_list_autocomplete_options(filter) } - when Queries::Filters::Shared::CustomFields::Hierarchy - { autocomplete_options: custom_field_hierarchy_autocomplete_options(filter) } - when Queries::Projects::Filters::ProjectStatusFilter, - Queries::Projects::Filters::TypeFilter - { autocomplete_options: list_autocomplete_options(filter) } - else - {} - end + opts = filter.autocomplete_options + opts.any? ? { autocomplete_options: opts } : {} end def filter_form_class(filter, additional_attributes) @@ -131,76 +117,5 @@ module Filter Filters::Inputs::TextForm end end - - def custom_field_list_autocomplete_options(filter) - all_items = custom_field_allowed_items(filter) - selected = filter.values - options = { items: all_items } - options[:groupBy] = "project_name" if filter.custom_field.version? - autocomplete_options.merge(options).merge(model: all_items.select { |item| selected.include?(item[:id]) }) - end - - def custom_field_allowed_items(filter) - if filter.custom_field.version? - filter.allowed_values.map { |name, id, project_name| { name:, id:, project_name: } } - else - filter.allowed_values.map { |name, id| { name:, id: } } - end - end - - def custom_field_hierarchy_autocomplete_options(filter) - items = filter.allowed_values.map do |name, id| - path = name.split(" / ") - { name: path.last, id:, depth: path.length - 1 } - end - selected = filter.values - - autocomplete_options.merge({ items: }).merge(model: items.select { |item| selected.include?(item[:id]) }) - end - - def list_autocomplete_options(filter) - all_items = filter.allowed_values.map { |name, id| { name:, id: } } - selected = filter.values - autocomplete_options.merge( - items: all_items, - model: all_items.select { |item| selected.include?(item[:id]) } - ) - end - - def autocomplete_options - { - component: "opce-autocompleter", - bindValue: "id", - bindLabel: "name", - hideSelected: true, - defaultData: false - } - end - - def project_autocomplete_options - { - component: "opce-project-autocompleter", - resource: "projects", - filters: [ - { name: "active", operator: "=", values: ["t"] } - ] - } - end - - def user_autocomplete_options - { - component: "opce-user-autocompleter", - hideSelected: true, - defaultData: false, - placeholder: I18n.t(:label_user_search), - resource: "principals", - url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals, - filters: [ - { name: "status", operator: "!", values: [Principal.statuses["locked"].to_s] } - ], - searchKey: "any_name_attribute", - focusDirectly: false - } - end end end diff --git a/app/components/users/user_filters_component.rb b/app/components/users/user_filters_component.rb index eb923be1ffa..710c9994a17 100644 --- a/app/components/users/user_filters_component.rb +++ b/app/components/users/user_filters_component.rb @@ -38,28 +38,5 @@ module Users .grep_v(Queries::Users::Filters::BlockedFilter) .sort_by(&:human_name) end - - protected - - def additional_filter_attributes(filter) - case filter - when Queries::Users::Filters::GroupFilter - { - autocomplete_options: { - component: "opce-user-autocompleter", - resource: "principals", - url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals, - filters: [ - { name: "type", operator: "=", values: %w[Group] } - ], - searchKey: "any_name_attribute", - inputValue: filter.values, - bindValue: "id" - } - } - else - super - end - end end end diff --git a/app/models/queries/filters/base.rb b/app/models/queries/filters/base.rb index 1b049ce549a..58d7140aa4a 100644 --- a/app/models/queries/filters/base.rb +++ b/app/models/queries/filters/base.rb @@ -182,6 +182,10 @@ class Queries::Filters::Base errors.full_message(human_name, messages) end + def autocomplete_options + {} + end + protected def type_strategy diff --git a/app/models/queries/filters/shared/custom_fields/hierarchy.rb b/app/models/queries/filters/shared/custom_fields/hierarchy.rb index c29e545b9be..2c927879812 100644 --- a/app/models/queries/filters/shared/custom_fields/hierarchy.rb +++ b/app/models/queries/filters/shared/custom_fields/hierarchy.rb @@ -37,6 +37,23 @@ module Queries true end + def autocomplete_options + items = allowed_values.map do |name, id| + path = name.split(" / ") + { name: path.last, id:, depth: path.length - 1 } + end + + { + component: "opce-autocompleter", + bindValue: "id", + bindLabel: "name", + hideSelected: true, + defaultData: false, + items:, + model: items.select { |item| values.include?(item[:id]) } + } + end + def value_objects CustomField::Hierarchy::Item .where(id: @values) diff --git a/app/models/queries/filters/shared/custom_fields/list_optional.rb b/app/models/queries/filters/shared/custom_fields/list_optional.rb index ea5a0f1db68..94ad7cdc889 100644 --- a/app/models/queries/filters/shared/custom_fields/list_optional.rb +++ b/app/models/queries/filters/shared/custom_fields/list_optional.rb @@ -59,6 +59,24 @@ module Queries::Filters::Shared :list_optional end + def autocomplete_options # rubocop:disable Metrics/AbcSize + all_items = if custom_field.version? + allowed_values.map { |name, id, project_name| { name:, id:, project_name: } } + else + allowed_values.map { |name, id| { name:, id: } } + end + options = { items: all_items } + options[:groupBy] = "project_name" if custom_field.version? + + { + component: "opce-autocompleter", + bindValue: "id", + bindLabel: "name", + hideSelected: true, + defaultData: false + }.merge(options).merge(model: all_items.select { |item| values.include?(item[:id]) }) + end + protected def condition @@ -75,8 +93,7 @@ module Queries::Filters::Shared end def customized_strategy? - operator_strategy == Queries::Operators::CustomFields::EqualsAll || - operator_strategy == Queries::Operators::CustomFields::NotEqualsAll + [Queries::Operators::CustomFields::EqualsAll, Queries::Operators::CustomFields::NotEqualsAll].include?(operator_strategy) end def type_strategy_class diff --git a/app/models/queries/filters/shared/custom_fields/user.rb b/app/models/queries/filters/shared/custom_fields/user.rb index 907f5eafcc0..89e87f85afa 100644 --- a/app/models/queries/filters/shared/custom_fields/user.rb +++ b/app/models/queries/filters/shared/custom_fields/user.rb @@ -48,6 +48,22 @@ module Queries::Filters::Shared vals + user_groups_added(vals) end + def autocomplete_options + { + component: "opce-user-autocompleter", + hideSelected: true, + defaultData: false, + placeholder: I18n.t(:label_user_search), + resource: "principals", + url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals, + filters: [ + { name: "status", operator: "!", values: [Principal.statuses["locked"].to_s] } + ], + searchKey: "any_name_attribute", + focusDirectly: false + } + end + private def group_members_added(vals) diff --git a/app/models/queries/filters/shared/project_filter/optional.rb b/app/models/queries/filters/shared/project_filter/optional.rb index ba92e84d8e9..95de9205222 100644 --- a/app/models/queries/filters/shared/project_filter/optional.rb +++ b/app/models/queries/filters/shared/project_filter/optional.rb @@ -51,6 +51,14 @@ module Queries::Filters::Shared::ProjectFilter::Optional # harm. @type_strategy ||= ::Queries::Filters::Strategies::IntegerListOptional.new(self) end + + def autocomplete_options + { + component: "opce-project-autocompleter", + resource: "projects", + filters: [{ name: "active", operator: "=", values: ["t"] }] + } + end end module ClassMethods diff --git a/app/models/queries/filters/shared/project_filter/required.rb b/app/models/queries/filters/shared/project_filter/required.rb index 951b2919c47..6ac038e857f 100644 --- a/app/models/queries/filters/shared/project_filter/required.rb +++ b/app/models/queries/filters/shared/project_filter/required.rb @@ -51,6 +51,14 @@ module Queries::Filters::Shared::ProjectFilter::Required # harm. @type_strategy ||= ::Queries::Filters::Strategies::IntegerList.new(self) end + + def autocomplete_options + { + component: "opce-project-autocompleter", + resource: "projects", + filters: [{ name: "active", operator: "=", values: ["t"] }] + } + end end module ClassMethods diff --git a/app/models/queries/projects/filters/project_status_filter.rb b/app/models/queries/projects/filters/project_status_filter.rb index 99fe4da849b..d23d264bf43 100644 --- a/app/models/queries/projects/filters/project_status_filter.rb +++ b/app/models/queries/projects/filters/project_status_filter.rb @@ -41,6 +41,19 @@ class Queries::Projects::Filters::ProjectStatusFilter < Queries::Projects::Filte :list_optional end + def autocomplete_options + all_items = allowed_values.map { |name, id| { name:, id: } } + { + component: "opce-autocompleter", + bindValue: "id", + bindLabel: "name", + hideSelected: true, + defaultData: false, + items: all_items, + model: all_items.select { |item| values.include?(item[:id]) } + } + end + def where operator_strategy.sql_for_field(values, model.table_name, :status_code) end diff --git a/app/models/queries/projects/filters/type_filter.rb b/app/models/queries/projects/filters/type_filter.rb index b5bbb363b02..05ceb9467e4 100644 --- a/app/models/queries/projects/filters/type_filter.rb +++ b/app/models/queries/projects/filters/type_filter.rb @@ -45,6 +45,19 @@ class Queries::Projects::Filters::TypeFilter < Queries::Projects::Filters::Base :list end + def autocomplete_options + all_items = allowed_values.map { |name, id| { name:, id: } } + { + component: "opce-autocompleter", + bindValue: "id", + bindLabel: "name", + hideSelected: true, + defaultData: false, + items: all_items, + model: all_items.select { |item| values.include?(item[:id]) } + } + end + def self.key :type_id end diff --git a/app/models/queries/users/filters/group_filter.rb b/app/models/queries/users/filters/group_filter.rb index 92ed4ad7a3e..e19be215199 100644 --- a/app/models/queries/users/filters/group_filter.rb +++ b/app/models/queries/users/filters/group_filter.rb @@ -34,4 +34,16 @@ class Queries::Users::Filters::GroupFilter < Queries::Users::Filters::UserFilter def human_name I18n.t(:label_group) end + + def autocomplete_options + { + component: "opce-user-autocompleter", + resource: "principals", + url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals, + filters: [{ name: "type", operator: "=", values: %w[Group] }], + searchKey: "any_name_attribute", + inputValue: values, + bindValue: "id" + } + end end diff --git a/modules/meeting/app/components/meetings/meeting_filters_component.rb b/modules/meeting/app/components/meetings/meeting_filters_component.rb index 9c672b3cab9..d6459cff7d5 100644 --- a/modules/meeting/app/components/meetings/meeting_filters_component.rb +++ b/modules/meeting/app/components/meetings/meeting_filters_component.rb @@ -28,9 +28,7 @@ # See COPYRIGHT and LICENSE files for more details. # ++ module Meetings - # rubocop:disable OpenProject/AddPreviewForViewComponent class MeetingFiltersComponent < Filter::FilterComponent - # rubocop:enable OpenProject/AddPreviewForViewComponent options :project def turbo_requests? = true @@ -41,24 +39,6 @@ module Meetings .sort_by(&:human_name) end - protected - - def additional_filter_attributes(filter) - case filter - when Queries::Meetings::Filters::AuthorFilter, - Queries::Meetings::Filters::AttendedUserFilter, - Queries::Meetings::Filters::InvitedUserFilter - { - autocomplete_options: { - component: "opce-user-autocompleter", - resource: "principals" - } - } - else - super - end - end - private def allowed_filter?(filter) diff --git a/modules/meeting/app/models/queries/meetings/filters/attended_user_filter.rb b/modules/meeting/app/models/queries/meetings/filters/attended_user_filter.rb index f73b77393c1..ce24bd7e8c1 100644 --- a/modules/meeting/app/models/queries/meetings/filters/attended_user_filter.rb +++ b/modules/meeting/app/models/queries/meetings/filters/attended_user_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -76,6 +77,10 @@ class Queries::Meetings::Filters::AttendedUserFilter < Queries::Meetings::Filter :participants end + def autocomplete_options + { component: "opce-user-autocompleter", resource: "principals" } + end + def self.key :attended_user_id end diff --git a/modules/meeting/app/models/queries/meetings/filters/author_filter.rb b/modules/meeting/app/models/queries/meetings/filters/author_filter.rb index 6ef4363145f..42b639fd2c2 100644 --- a/modules/meeting/app/models/queries/meetings/filters/author_filter.rb +++ b/modules/meeting/app/models/queries/meetings/filters/author_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -38,6 +39,10 @@ class Queries::Meetings::Filters::AuthorFilter < Queries::Meetings::Filters::Mee @type_strategy ||= ::Queries::Filters::Strategies::IntegerListOptional.new(self) end + def autocomplete_options + { component: "opce-user-autocompleter", resource: "principals" } + end + def self.key :author_id end diff --git a/modules/meeting/app/models/queries/meetings/filters/invited_user_filter.rb b/modules/meeting/app/models/queries/meetings/filters/invited_user_filter.rb index 0dc00eceee3..425848d0946 100644 --- a/modules/meeting/app/models/queries/meetings/filters/invited_user_filter.rb +++ b/modules/meeting/app/models/queries/meetings/filters/invited_user_filter.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -76,6 +77,10 @@ class Queries::Meetings::Filters::InvitedUserFilter < Queries::Meetings::Filters :participants end + def autocomplete_options + { component: "opce-user-autocompleter", resource: "principals" } + end + def self.key :invited_user_id end diff --git a/spec/support/pages/admin/users/index.rb b/spec/support/pages/admin/users/index.rb index 65731e2914c..d5158c43fc6 100644 --- a/spec/support/pages/admin/users/index.rb +++ b/spec/support/pages/admin/users/index.rb @@ -93,7 +93,7 @@ module Pages def filter_by_group(value) open_filter_panel - unless page.has_css?("li.advanced-filters--filter[data-filter-name='group']:not(.hidden)") + unless page.has_css?(".advanced-filters--filter[data-filter-name='group']:not([hidden])") select "Group", from: "add_filter_select" end @@ -134,7 +134,7 @@ module Pages end def within_filter(name, &) - within("li.advanced-filters--filter[data-filter-name='#{name}']:not(.hidden)", &) + within(".advanced-filters--filter[data-filter-name='#{name}']:not([hidden])", &) end def order_by(key) From 344cb1799427830513434d8f95c1d53c46d167f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 26 May 2026 07:08:53 +0200 Subject: [PATCH 105/381] Remove component identifier op-git-actions-menu They are being used as dropdown components, and referenced by class anyway --- .../module/git-actions-menu/git-actions-menu.component.ts | 1 - .../module/git-actions-menu/git-actions-menu.component.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts index b6fc1326303..8c79b5657f9 100644 --- a/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts +++ b/modules/github_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts @@ -36,7 +36,6 @@ import { ISnippet } from 'core-app/features/plugins/linked/openproject-github_in @Component({ - selector: 'op-git-actions-menu', templateUrl: './git-actions-menu.template.html', styleUrls: [ './styles/git-actions-menu.sass', diff --git a/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts index 90f87122bdb..3221a8e4b99 100644 --- a/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts +++ b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts @@ -37,7 +37,6 @@ import { I18nService } from "core-app/core/i18n/i18n.service"; @Component({ - selector: 'op-git-actions-menu', templateUrl: './git-actions-menu.template.html', styleUrls: [ './styles/git-actions-menu.sass' From 99a4b32bcfa94edd17d28164b209904b1886f5f4 Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Tue, 26 May 2026 10:26:49 +0200 Subject: [PATCH 106/381] Creates the PageLinks::CreateService (#23270) * Creates CreateContract and SetAttributesService * Rename the contract for clarity * Adds the actual create service * Adds subclass methods to InexistentProvider * Simplyfy validation methods and adds extra presence checks. --- .../relation_page_link_create_contract.rb | 66 ++++++++++++++ .../app/models/wikis/inexistent_provider.rb | 41 +++++++++ .../wikis/page_links/create_service.rb | 39 ++++++++ .../page_links/set_attributes_service.rb | 36 ++++++++ ...relation_page_link_create_contract_spec.rb | 64 +++++++++++++ .../wikis/page_links/create_service_spec.rb | 51 +++++++++++ .../page_links/set_attributes_service_spec.rb | 89 +++++++++++++++++++ 7 files changed, 386 insertions(+) create mode 100644 modules/wikis/app/contracts/wikis/page_links/relation_page_link_create_contract.rb create mode 100644 modules/wikis/app/models/wikis/inexistent_provider.rb create mode 100644 modules/wikis/app/services/wikis/page_links/create_service.rb create mode 100644 modules/wikis/app/services/wikis/page_links/set_attributes_service.rb create mode 100644 modules/wikis/spec/contracts/wikis/page_links/relation_page_link_create_contract_spec.rb create mode 100644 modules/wikis/spec/services/wikis/page_links/create_service_spec.rb create mode 100644 modules/wikis/spec/services/wikis/page_links/set_attributes_service_spec.rb diff --git a/modules/wikis/app/contracts/wikis/page_links/relation_page_link_create_contract.rb b/modules/wikis/app/contracts/wikis/page_links/relation_page_link_create_contract.rb new file mode 100644 index 00000000000..a15c5ff5a07 --- /dev/null +++ b/modules/wikis/app/contracts/wikis/page_links/relation_page_link_create_contract.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + module PageLinks + class RelationPageLinkCreateContract < ::ModelContract + attribute :author + attribute :identifier + attribute :linkable + attribute :provider + + validates :identifier, presence: true + validates :linkable, presence: true + validates :provider, presence: true + + validate :provider_exists? + validate :author_must_be_user + validate :validate_user_allowed_to_manage + + private + + def author_must_be_user + errors.add(:author, :invalid) unless author == user + end + + def validate_user_allowed_to_manage + linkable = model.linkable + + if linkable.present? && !user.allowed_in_project?(:manage_wiki_page_links, linkable.project) + errors.add(:base, :error_unauthorized) + end + end + + def provider_exists? + errors.add(:provider, :does_not_exist) if model.provider.is_a?(InexistentProvider) + end + end + end +end diff --git a/modules/wikis/app/models/wikis/inexistent_provider.rb b/modules/wikis/app/models/wikis/inexistent_provider.rb new file mode 100644 index 00000000000..084619d2b4f --- /dev/null +++ b/modules/wikis/app/models/wikis/inexistent_provider.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + class InexistentProvider < Wikis::Provider + include InexistentModel + + def self.visible? = false + + def self.registry_prefix = :inexistent + + def user_connected?(_user) = false + end +end diff --git a/modules/wikis/app/services/wikis/page_links/create_service.rb b/modules/wikis/app/services/wikis/page_links/create_service.rb new file mode 100644 index 00000000000..eb9371246f6 --- /dev/null +++ b/modules/wikis/app/services/wikis/page_links/create_service.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + module PageLinks + class CreateService < ::BaseServices::Create + private + + def default_contract_class = RelationPageLinkCreateContract + end + end +end diff --git a/modules/wikis/app/services/wikis/page_links/set_attributes_service.rb b/modules/wikis/app/services/wikis/page_links/set_attributes_service.rb new file mode 100644 index 00000000000..1e3b0d5e045 --- /dev/null +++ b/modules/wikis/app/services/wikis/page_links/set_attributes_service.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Wikis + module PageLinks + class SetAttributesService < ::BaseServices::SetAttributes + end + end +end diff --git a/modules/wikis/spec/contracts/wikis/page_links/relation_page_link_create_contract_spec.rb b/modules/wikis/spec/contracts/wikis/page_links/relation_page_link_create_contract_spec.rb new file mode 100644 index 00000000000..09c6107b63c --- /dev/null +++ b/modules/wikis/spec/contracts/wikis/page_links/relation_page_link_create_contract_spec.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require "spec_helper" +require "contracts/shared/model_contract_shared_context" +require_module_spec_helper + +module Wikis + module PageLinks + RSpec.describe RelationPageLinkCreateContract do + include_context "ModelContract shared context" + let(:linkable) { create(:work_package) } + let(:project) { linkable.project } + let(:current_user) { create(:user, member_with_permissions: { project => %i(manage_wiki_page_links view_work_packages) }) } + let(:relation_page_link) { build_stubbed(:relation_wiki_page_link, author: current_user, linkable:) } + + subject(:contract) { described_class.new(relation_page_link, current_user) } + + it_behaves_like "contract is valid" + + context "when creator is not the current user" do + let(:author) { create(:user, member_with_permissions: { project => %i(manage_wiki_page_links view_work_packages) }) } + let(:relation_page_link) { build_stubbed(:relation_wiki_page_link, author:, linkable:) } + + include_examples "contract is invalid", author: :invalid + end + + context "when the provider is inexistent" do + let(:provider) { InexistentProvider.new } + + before { relation_page_link.provider = provider } + + include_examples "contract is invalid", provider: :does_not_exist + end + end + end +end diff --git a/modules/wikis/spec/services/wikis/page_links/create_service_spec.rb b/modules/wikis/spec/services/wikis/page_links/create_service_spec.rb new file mode 100644 index 00000000000..91ac63bc390 --- /dev/null +++ b/modules/wikis/spec/services/wikis/page_links/create_service_spec.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require "spec_helper" +require "services/base_services/behaves_like_create_service" + +require_module_spec_helper + +module Wikis + module PageLinks + RSpec.describe CreateService do + it_behaves_like "BaseServices create service" do + let(:contract_class) { RelationPageLinkCreateContract } + let(:factory) { :relation_wiki_page_link } + end + + it "defaults to the RelationPageLinkCreateContract" do + service = described_class.new(user: nil) + + expect(service.contract_class).to eq(RelationPageLinkCreateContract) + end + end + end +end diff --git a/modules/wikis/spec/services/wikis/page_links/set_attributes_service_spec.rb b/modules/wikis/spec/services/wikis/page_links/set_attributes_service_spec.rb new file mode 100644 index 00000000000..201aed78e69 --- /dev/null +++ b/modules/wikis/spec/services/wikis/page_links/set_attributes_service_spec.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require "spec_helper" +require_module_spec_helper + +module Wikis + module PageLinks + RSpec.describe SetAttributesService do + let(:model_instance) { RelationPageLink.new } + let(:contract_instance) do + instance_double(RelationPageLinkCreateContract, validate: contract_valid, errors: contract_errors) + end + + let(:contract_class) do + class_double(RelationPageLinkCreateContract, new: contract_instance) + end + + let(:contract_errors) { instance_double(ActiveModel::Errors) } + let(:contract_valid) { true } + + let(:current_user) { build(:user) } + + let(:service) do + described_class.new(user: current_user, model: model_instance, contract_class:, contract_options: {}) + end + + let(:params) { {} } + + subject(:result) { service.call(params) } + + it "returns the instance as the result" do + expect(subject.result).to eql model_instance + end + + it "is a success" do + expect(subject).to be_success + end + + context "with params" do + let(:params) { { identifier: "Foobar" } } + + it "assigns the params" do + service.call(params) + expect(model_instance.identifier).to eq "Foobar" + end + end + + context "with an invalid contract" do + let(:contract_valid) { false } + + it "returns failure" do + expect(subject).to be_failure + end + + it "returns the contract's errors" do + expect(subject.errors).to eql(contract_errors) + end + end + end + end +end From 5e306a2eae13f7dd4fe33b7c70600893886b8843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 13 May 2026 16:19:45 +0200 Subject: [PATCH 107/381] Project specific cost types --- app/models/project.rb | 5 +- config/initializers/menus.rb | 12 +- ...20000_add_project_scoping_to_cost_types.rb | 43 +++++ ...ype_projects_form_modal_component.html.erb | 56 +++++++ ...cost_type_projects_form_modal_component.rb | 71 ++++++++ ...ost_type_projects_modal_component.html.erb | 46 +++++ .../new_cost_type_projects_modal_component.rb | 66 ++++++++ .../cost_type_projects/row_component.html.erb | 41 +++++ .../cost_type_projects/row_component.rb | 67 ++++++++ .../cost_type_projects/table_component.rb | 51 ++++++ .../edit_form_header_component.html.erb | 36 ++++ .../cost_types/edit_form_header_component.rb | 77 +++++++++ .../page_header_component.html.erb | 42 +++++ .../time_and_costs/page_header_component.rb | 70 ++++++++ .../cost_type_projects/base_contract.rb | 72 ++++++++ .../cost_type_projects/update_contract.rb | 36 ++++ .../cost_type_projects_controller.rb | 157 ++++++++++++++++++ .../admin/cost_types_controller.rb | 37 +++-- .../app/controllers/costlog_controller.rb | 8 +- .../settings/cost_types_controller.rb | 68 ++++++++ .../time_entry_activities_controller.rb | 2 +- .../cost_type_mapping_form.rb | 85 ++++++++++ modules/costs/app/models/cost_type.rb | 15 ++ .../costs/app/models/cost_types_project.rb | 36 ++++ .../projects/scopes/available_cost_types.rb | 52 ++++++ .../available_cost_types_projects_filter.rb | 66 ++++++++ .../cost_type_projects/bulk_create_service.rb | 49 ++++++ .../cost_type_projects/delete_service.rb | 37 +++++ .../set_attributes_service.rb | 36 ++++ .../cost_type_projects/index.html.erb | 70 ++++++++ .../app/views/admin/cost_types/edit.html.erb | 18 +- .../settings/cost_types/index.html.erb | 77 +++++++++ .../time_entry_activities/show.html.erb | 12 +- modules/costs/config/locales/en.yml | 20 +++ modules/costs/config/routes.rb | 8 + modules/costs/lib/costs/engine.rb | 10 +- .../costs/patches/permitted_params_patch.rb | 1 + .../costs/lib/costs/patches/project_patch.rb | 4 + .../controllers/costlog_controller_spec.rb | 53 ++++++ .../spec/features/costs_context_menu_spec.rb | 1 + .../spec/features/time_entry/activity_spec.rb | 2 +- .../work_package_representer_spec.rb | 37 +++++ modules/costs/spec/models/cost_type_spec.rb | 76 +++++++-- .../spec/models/cost_types_project_spec.rb | 58 +++++++ .../project_cost_types_available_spec.rb | 58 +++++++ ...ailable_cost_types_projects_filter_spec.rb | 94 +++++++++++ .../settings/cost_types_controller_spec.rb | 89 ++++++++++ .../bulk_create_service_spec.rb | 43 +++++ .../cost_type_projects/delete_service_spec.rb | 72 ++++++++ 49 files changed, 2183 insertions(+), 59 deletions(-) create mode 100644 db/migrate/20260513120000_add_project_scoping_to_cost_types.rb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/cost_type_projects/table_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/edit_form_header_component.rb create mode 100644 modules/costs/app/components/projects/settings/time_and_costs/page_header_component.html.erb create mode 100644 modules/costs/app/components/projects/settings/time_and_costs/page_header_component.rb create mode 100644 modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb create mode 100644 modules/costs/app/contracts/cost_types/cost_type_projects/update_contract.rb create mode 100644 modules/costs/app/controllers/admin/cost_types/cost_type_projects_controller.rb create mode 100644 modules/costs/app/controllers/projects/settings/cost_types_controller.rb create mode 100644 modules/costs/app/forms/cost_types/cost_type_projects/cost_type_mapping_form.rb create mode 100644 modules/costs/app/models/cost_types_project.rb create mode 100644 modules/costs/app/models/projects/scopes/available_cost_types.rb create mode 100644 modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb create mode 100644 modules/costs/app/services/cost_types/cost_type_projects/bulk_create_service.rb create mode 100644 modules/costs/app/services/cost_types/cost_type_projects/delete_service.rb create mode 100644 modules/costs/app/services/cost_types/cost_type_projects/set_attributes_service.rb create mode 100644 modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb create mode 100644 modules/costs/app/views/projects/settings/cost_types/index.html.erb create mode 100644 modules/costs/spec/models/cost_types_project_spec.rb create mode 100644 modules/costs/spec/models/project_cost_types_available_spec.rb create mode 100644 modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb create mode 100644 modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb create mode 100644 modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb create mode 100644 modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb diff --git a/app/models/project.rb b/app/models/project.rb index 8d01e969e0c..ef5be9571b3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -85,6 +85,8 @@ class Project < ApplicationRecord }, dependent: :destroy has_many :time_entries, dependent: :delete_all has_many :time_entry_activities_projects, dependent: :delete_all + has_many :cost_types_projects, dependent: :delete_all + has_many :cost_types, through: :cost_types_projects has_many :queries, dependent: :destroy has_many :news, -> { includes(:author) }, dependent: :destroy has_many :categories, -> { order("#{Category.table_name}.name") }, dependent: :delete_all @@ -193,7 +195,8 @@ class Project < ApplicationRecord scope :templated, -> { where(templated: true) } scopes :activated_time_activity, - :visible_with_activated_time_activity + :visible_with_activated_time_activity, + :available_cost_types enum :status_code, { on_track: 0, diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb index c1dff6e8bf4..e63541cb182 100644 --- a/config/initializers/menus.rb +++ b/config/initializers/menus.rb @@ -784,15 +784,21 @@ Redmine::MenuManager.map :project_menu do |menu| }, versions: { caption: :label_version_plural }, repository: { caption: :label_repository }, - time_entry_activities: { caption: :enumeration_activities }, + time_and_costs: { + caption: :"cost_types.settings.time_and_costs", + controller: "/projects/settings/time_entry_activities" + }, storage: { caption: :label_required_disk_storage } } project_menu_items.each do |key, options| menu.push :"settings_#{key}", - { controller: "/projects/settings/#{key}", action: "show" }.merge(options.slice(:action)), + { + controller: options[:controller] || "/projects/settings/#{key}", + action: options[:action] || "show" + }, parent: :settings, - **options.except(:action) + **options.except(:action, :controller) end end diff --git a/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb b/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb new file mode 100644 index 00000000000..c640faa34f6 --- /dev/null +++ b/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class AddProjectScopingToCostTypes < ActiveRecord::Migration[8.0] + def change + add_column :cost_types, :is_for_all, :boolean, default: true, null: false + + create_table :cost_types_projects do |t| + t.references :cost_type, null: false, foreign_key: true + t.references :project, null: false, foreign_key: true + t.timestamps + end + + add_index :cost_types_projects, %i[cost_type_id project_id], unique: true + end +end diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb new file mode 100644 index 00000000000..3cd24755d16 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb @@ -0,0 +1,56 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= + component_wrapper do + primer_form_with( + model: @cost_type_project_mapping, + url:, + data: { turbo: true }, + method: :post + ) do |form| + concat( + render( + Primer::Alpha::Dialog::Body.new( + id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title }, + classes: "Overlay-body_autocomplete_height" + ) + ) do + render(::CostTypes::CostTypeProjects::CostTypeMappingForm.new(form, project_mapping: @cost_type_project_mapping)) + end + ) + + concat( + render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do + concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text }) + concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit)) { submit_button_text }) + end + ) + end + end +%> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb new file mode 100644 index 00000000000..7ccc1b5c68a --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + module CostTypeProjects + class NewCostTypeProjectsFormModalComponent < ApplicationComponent + include OpTurbo::Streamable + + DIALOG_ID = "new-cost-type-projects-modal" + DIALOG_BODY_ID = "new-cost-type-projects-modal-body" + + def initialize(cost_type_project_mapping:, cost_type:, **) + @cost_type_project_mapping = cost_type_project_mapping + @cost_type = cost_type + super(@cost_type_project_mapping, **) + end + + private + + def url + url_helpers.admin_cost_type_projects_path(@cost_type) + end + + def dialog_id = DIALOG_ID + def dialog_body_id = DIALOG_BODY_ID + + attr_reader :cost_type_project_mapping, :cost_type + + def title + I18n.t(:label_add_projects) + end + + def cancel_button_text + I18n.t("button_cancel") + end + + def submit_button_text + I18n.t("button_add") + end + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb new file mode 100644 index 00000000000..6c45cd543eb --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb @@ -0,0 +1,46 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= + render( + Primer::Alpha::Dialog.new( + id: dialog_id, + title:, + test_selector: dialog_id, + size: :large + ) + ) do |dialog| + dialog.with_header( + show_divider: false, + visually_hide_title: false, + variant: :large + ) + + render(form_modal_component) + end +%> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb new file mode 100644 index 00000000000..ed8bcb69b85 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + module CostTypeProjects + class NewCostTypeProjectsModalComponent < ApplicationComponent + include OpTurbo::Streamable + + def initialize(cost_type_project_mapping:, cost_type:, **) + @cost_type_project_mapping = cost_type_project_mapping + @cost_type = cost_type + super(@cost_type_project_mapping, **) + end + + def render? + !cost_type.is_for_all? + end + + private + + attr_reader :cost_type_project_mapping, :cost_type + + def dialog_id = NewCostTypeProjectsFormModalComponent::DIALOG_ID + def dialog_body_id = NewCostTypeProjectsFormModalComponent::DIALOG_BODY_ID + + def title + I18n.t(:label_add_projects) + end + + def form_modal_component + Admin::CostTypes::CostTypeProjects::NewCostTypeProjectsFormModalComponent.new( + cost_type_project_mapping:, cost_type: + ) + end + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb new file mode 100644 index 00000000000..c492d478b6c --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb @@ -0,0 +1,41 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= component_wrapper(tag: "tr", class: row_css_class, data: { turbo: true }) do %> + <% columns.each do |column| %> + + <%= column_value(column) %> + + <% end %> + + + <% button_links.each do |link| %> + <%= link %> + <% end %> + +<% end %> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.rb new file mode 100644 index 00000000000..6fdf303b13a --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + module CostTypeProjects + class RowComponent < ::Projects::RowComponent + include OpTurbo::Streamable + + def wrapper_uniq_by + "project-#{project.id}" + end + + def more_menu_items + @more_menu_items ||= [more_menu_detach_project].compact + end + + private + + def more_menu_detach_project + { + scheme: :default, + icon: nil, + label: I18n.t("projects.settings.project_custom_fields.actions.remove_from_project"), + href: detach_from_project_url, + data: { turbo_method: :delete } + } + end + + def detach_from_project_url + url_helpers.admin_cost_type_project_path( + cost_type_id: @table.params[:cost_type].id, + cost_types_project: { project_id: project.id }, + page: current_page + ) + end + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/table_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/table_component.rb new file mode 100644 index 00000000000..cae9780d842 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/table_component.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + module CostTypeProjects + class TableComponent < ::Projects::TableComponent + include ::Projects::Concerns::TableComponent::StreamablePaginationLinksConstraints + + def columns + @columns ||= query.selects.grep_v(Queries::Selects::NotExistingSelect) + end + + def sortable? + false + end + + def use_quick_action_table_headers? + false + end + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb b/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb new file mode 100644 index 00000000000..4bc09708f8f --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb @@ -0,0 +1,36 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= + render(Primer::OpenProject::PageHeader.new(test_selector: "cost-types--page-header")) do |header| + header.with_title { page_title } + header.with_breadcrumbs(breadcrumbs_items, selected_item_font_weight: :normal) + + helpers.render_tab_header_nav(header, tabs, test_selector: :cost_type_detail_header) + end +%> diff --git a/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb b/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb new file mode 100644 index 00000000000..905695a8dd2 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class EditFormHeaderComponent < ApplicationComponent + def initialize(cost_type:, selected:, **) + @cost_type = cost_type + @selected = selected + super(cost_type, **) + end + + def tabs + return [] unless @cost_type.persisted? + + [ + { + name: "edit", + path: edit_admin_cost_type_path(@cost_type), + label: t(:label_details) + }, + { + name: "rates", + path: rates_admin_cost_type_path(@cost_type), + label: t("cost_types.admin.rates.title") + }, + { + name: "cost_type_projects", + path: admin_cost_type_projects_path(@cost_type), + label: t(:label_project_plural) + } + ] + end + + private + + def page_title + @cost_type.persisted? ? @cost_type.name : "#{t(:label_new)} #{::CostType.model_name.human}" + end + + def breadcrumbs_items + [ + { href: admin_index_path, text: t(:label_administration) }, + { href: admin_cost_types_path, text: t(:label_cost_type_plural) }, + page_title + ] + end + end + end +end diff --git a/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.html.erb b/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.html.erb new file mode 100644 index 00000000000..8a35672b0f4 --- /dev/null +++ b/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.html.erb @@ -0,0 +1,42 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= + render(Primer::OpenProject::PageHeader.new(test_selector: "time-and-costs--page-header")) do |header| + header.with_title { page_title } + header.with_breadcrumbs(breadcrumbs_items, selected_item_font_weight: :normal) + + header.with_tab_nav(label: I18n.t("cost_types.settings.time_and_costs"), test_selector: :time_and_costs_tabs) do |tab_nav| + tabs.each do |tab| + tab_nav.with_tab(selected: tab[:name] == @selected, href: tab[:path]) do |t| + t.with_text { tab[:label] } + end + end + end + end +%> diff --git a/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.rb b/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.rb new file mode 100644 index 00000000000..325aaeb0935 --- /dev/null +++ b/modules/costs/app/components/projects/settings/time_and_costs/page_header_component.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Projects + module Settings + module TimeAndCosts + class PageHeaderComponent < ApplicationComponent + def initialize(project:, selected:, **) + @project = project + @selected = selected + super(project, **) + end + + def tabs + [ + { + name: :time_entry_activities, + path: helpers.project_settings_time_entry_activities_path(@project), + label: I18n.t(:enumeration_activities) + }, + { + name: :cost_types, + path: helpers.project_settings_cost_types_path(@project), + label: I18n.t("cost_types.settings.cost_types.heading") + } + ] + end + + def page_title + I18n.t("cost_types.settings.time_and_costs") + end + + def breadcrumbs_items + [ + { href: helpers.project_overview_path(@project.id), text: @project.name }, + { href: helpers.project_settings_general_path(@project.id), text: I18n.t(:label_project_settings) }, + page_title + ] + end + end + end + end +end diff --git a/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb b/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb new file mode 100644 index 00000000000..993250ea1ae --- /dev/null +++ b/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class BaseContract < ::ModelContract + include UnchangedProject + + MANAGE_PERMISSION = :manage_project_activities + + attribute :project_id + attribute :cost_type_id + + validate :validate_manage_allowed_in_source_project + validate :validate_manage_allowed_in_destination_project + validate :not_for_all + + def validate_manage_allowed_in_source_project + if model.new_record? + errors.add :base, :error_unauthorized unless user.allowed_in_project?(MANAGE_PERMISSION, model.project) + return + end + + with_unchanged_project_id do + errors.add :base, :error_unauthorized unless user.allowed_in_project?(MANAGE_PERMISSION, model.project) + end + end + + def validate_manage_allowed_in_destination_project + return if model.new_record? + return unless model.project_id_changed? + + unless user.allowed_in_project?(MANAGE_PERMISSION, model.project) + errors.add :base, :error_unauthorized + end + end + + def not_for_all + return if model.cost_type.nil? || !model.cost_type.is_for_all? + + errors.add :cost_type_id, :is_for_all_cannot_modify + end + end + end +end diff --git a/modules/costs/app/contracts/cost_types/cost_type_projects/update_contract.rb b/modules/costs/app/contracts/cost_types/cost_type_projects/update_contract.rb new file mode 100644 index 00000000000..dbe035b2a83 --- /dev/null +++ b/modules/costs/app/contracts/cost_types/cost_type_projects/update_contract.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class UpdateContract < BaseContract + end + end +end diff --git a/modules/costs/app/controllers/admin/cost_types/cost_type_projects_controller.rb b/modules/costs/app/controllers/admin/cost_types/cost_type_projects_controller.rb new file mode 100644 index 00000000000..c3a6160eb67 --- /dev/null +++ b/modules/costs/app/controllers/admin/cost_types/cost_type_projects_controller.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Admin::CostTypes::CostTypeProjectsController < ApplicationController + include OpTurbo::ComponentStream + include FlashMessagesOutputSafetyHelper + + layout "admin" + + before_action :require_admin + before_action :find_cost_type + + before_action :available_cost_types_projects_query, only: %i[index destroy] + before_action :initialize_cost_type_project, only: :new + before_action :find_projects_to_activate_for_cost_type, only: :create + before_action :find_cost_type_project_to_destroy, only: :destroy + + menu_item :cost_types + + def index; end + + def new + respond_with_dialog Admin::CostTypes::CostTypeProjects::NewCostTypeProjectsModalComponent.new( + cost_type_project_mapping: @cost_type_project, + cost_type: @cost_type + ) + end + + def create + create_service = ::CostTypes::CostTypeProjects::BulkCreateService + .new(user: current_user, projects: @projects, model: @cost_type, + include_sub_projects: include_sub_projects?) + .call + + create_service.on_success { render_project_list(url_for_action: :index) } + + create_service.on_failure do + render_error_flash_message_via_turbo_stream( + message: join_flash_messages(create_service.errors) + ) + end + + respond_to_with_turbo_streams(status: create_service.success? ? :ok : :unprocessable_entity) + end + + def destroy + delete_service = ::CostTypes::CostTypeProjects::DeleteService + .new(user: current_user, model: @cost_type_project) + .call + + delete_service.on_success { render_project_list(url_for_action: :index) } + + delete_service.on_failure do + render_error_flash_message_via_turbo_stream( + message: join_flash_messages(delete_service.errors.full_messages) + ) + end + + respond_to_with_turbo_streams(status: delete_service.success? ? :ok : :unprocessable_entity) + end + + private + + def render_project_list(url_for_action: action_name) + update_via_turbo_stream( + component: Admin::CostTypes::CostTypeProjects::TableComponent.new( + query: available_cost_types_projects_query, + params: params.merge({ cost_type: @cost_type, url_for_action: }) + ) + ) + end + + def find_cost_type + @cost_type = CostType.find(params.expect(:cost_type_id)) + end + + def find_projects_to_activate_for_cost_type + if (project_ids = params.to_unsafe_h.dig(:cost_types_project, :project_ids)).present? + @projects = Project.visible.find(project_ids) + else + initialize_cost_type_project + @cost_type_project.errors.add(:project_ids, :blank) + update_via_turbo_stream( + component: Admin::CostTypes::CostTypeProjects::NewCostTypeProjectsFormModalComponent.new( + cost_type_project_mapping: @cost_type_project, + cost_type: @cost_type + ), + status: :bad_request + ) + respond_with_turbo_streams + end + rescue ActiveRecord::RecordNotFound + respond_with_project_not_found_turbo_streams + end + + def find_cost_type_project_to_destroy + project_id = params.expect(cost_types_project: [:project_id]).fetch(:project_id) + @cost_type_project = CostTypesProject.find_by!(cost_type: @cost_type, project: project_id) + rescue ActiveRecord::RecordNotFound + respond_with_project_not_found_turbo_streams + end + + def available_cost_types_projects_query + @available_cost_types_projects_query = ProjectQuery.new( + name: "cost-types-projects-#{@cost_type.id}" + ) do |query| + query.where(:available_cost_types_projects, "=", [@cost_type.id]) + query.select(:name) + query.order("lft" => "asc") + end + end + + def initialize_cost_type_project + @cost_type_project = ::CostTypes::CostTypeProjects::SetAttributesService + .new(user: current_user, model: CostTypesProject.new, contract_class: EmptyContract) + .call(cost_type: @cost_type) + .result + end + + def respond_with_project_not_found_turbo_streams + render_error_flash_message_via_turbo_stream message: t(:notice_project_not_found) + render_project_list(url_for_action: :index) + + respond_with_turbo_streams + end + + def include_sub_projects? + ActiveRecord::Type::Boolean.new.cast(params.to_unsafe_h.dig(:cost_types_project, :include_sub_projects)) + end +end diff --git a/modules/costs/app/controllers/admin/cost_types_controller.rb b/modules/costs/app/controllers/admin/cost_types_controller.rb index 384efe9e95f..72087d81f28 100644 --- a/modules/costs/app/controllers/admin/cost_types_controller.rb +++ b/modules/costs/app/controllers/admin/cost_types_controller.rb @@ -38,6 +38,7 @@ module Admin helper :sort include SortHelper + helper :cost_types include CostTypesHelper @@ -65,24 +66,6 @@ module Admin render action: "index", layout: !request.xhr? end - def edit - render action: :edit, layout: !request.xhr? - end - - def update - @cost_type.attributes = permitted_params.cost_type - - if @cost_type.save - flash[:notice] = t(:notice_successful_update) - redirect_back_or_default({ action: "index" }) - else - render action: :edit, status: :unprocessable_entity, layout: !request.xhr? - end - rescue ActiveRecord::StaleObjectError - # Optimistic locking exception - flash.now[:error] = t(:notice_locking_conflict) - end - def new @cost_type = CostType.new @@ -91,6 +74,10 @@ module Admin render action: :edit, layout: !request.xhr? end + def edit + render action: :edit, layout: !request.xhr? + end + def create # rubocop:disable Metrics/AbcSize @cost_type = CostType.new(permitted_params.cost_type) @@ -106,6 +93,20 @@ module Admin flash.now[:error] = t(:notice_locking_conflict) end + def update # rubocop:disable Metrics/AbcSize + @cost_type.attributes = permitted_params.cost_type + + if @cost_type.save + flash[:notice] = t(:notice_successful_update) + redirect_to edit_admin_cost_type_path(@cost_type) + else + render action: :edit, status: :unprocessable_entity, layout: !request.xhr? + end + rescue ActiveRecord::StaleObjectError + # Optimistic locking exception + flash.now[:error] = t(:notice_locking_conflict) + end + def destroy @cost_type.deleted_at = DateTime.now @cost_type.default = false diff --git a/modules/costs/app/controllers/costlog_controller.rb b/modules/costs/app/controllers/costlog_controller.rb index 0eea746cb9d..31c6b2ce323 100644 --- a/modules/costs/app/controllers/costlog_controller.rb +++ b/modules/costs/app/controllers/costlog_controller.rb @@ -37,6 +37,12 @@ class CostlogController < ApplicationController include CostlogHelper def new + unless @project&.cost_types_available? + flash[:error] = I18n.t("cost_types.errors.no_cost_types_available") # rubocop:disable Rails/ActionControllerFlashBeforeRender + redirect_back_or_default(@work_package ? polymorphic_path(@work_package) : project_path(@project)) + return + end + new_default_cost_entry render action: "edit" @@ -140,7 +146,7 @@ class CostlogController < ApplicationController ce.entity = @work_package ce.user = User.current ce.spent_on = Time.zone.today - # notice that cost_type is set to default cost_type in the model + ce.cost_type = CostType.default_for_project(@project) if @project end end diff --git a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb new file mode 100644 index 00000000000..2e222bc7eb8 --- /dev/null +++ b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Projects::Settings::CostTypesController < Projects::SettingsController + menu_item :settings_time_and_costs + + before_action :find_cost_type, only: :toggle + + def index + @cost_types = CostType.active.order(:name) + end + + def toggle + if @cost_type.is_for_all? + respond_redirect(error: I18n.t("activerecord.errors.messages.is_for_all_cannot_modify")) + return + end + + mapping = CostTypesProject.find_or_initialize_by(project_id: @project.id, cost_type_id: @cost_type.id) + + if mapping.persisted? + mapping.destroy! + else + mapping.save! + end + + respond_redirect + end + + private + + def find_cost_type + @cost_type = CostType.active.find(params.expect(:id)) + end + + def respond_redirect(error: nil) + flash[:error] = error if error + flash[:notice] = I18n.t(:notice_successful_update) unless error + redirect_to project_settings_cost_types_path(@project) + end +end diff --git a/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb b/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb index 0a877c0a1f7..352b579df03 100644 --- a/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb +++ b/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb @@ -29,7 +29,7 @@ #++ class Projects::Settings::TimeEntryActivitiesController < Projects::SettingsController - menu_item :settings_time_entry_activities + menu_item :settings_time_and_costs def update TimeEntryActivitiesProject.upsert_all(update_params, unique_by: %i[project_id activity_id]) diff --git a/modules/costs/app/forms/cost_types/cost_type_projects/cost_type_mapping_form.rb b/modules/costs/app/forms/cost_types/cost_type_projects/cost_type_mapping_form.rb new file mode 100644 index 00000000000..b8d447740d5 --- /dev/null +++ b/modules/costs/app/forms/cost_types/cost_type_projects/cost_type_mapping_form.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class CostTypeMappingForm < ApplicationForm + include OpPrimer::ComponentHelpers + + form do |form| + form.project_autocompleter( + name: :id, + label: Project.model_name.human, + visually_hide_label: true, + validation_message: project_ids_error_message, + autocomplete_options: { + appendTo: "##{Admin::CostTypes::CostTypeProjects::NewCostTypeProjectsFormModalComponent::DIALOG_ID}", + with_search_icon: true, + openDirectly: false, + focusDirectly: false, + multiple: true, + dropdownPosition: "bottom", + disabledProjects: projects_with_cost_type_mapping, + inputName: "cost_types_project[project_ids]" + } + ) + + form.check_box( + name: :include_sub_projects, + label: I18n.t(:label_include_sub_projects), + checked: false, + label_arguments: { class: "no-wrap" } + ) + end + + def initialize(project_mapping:) + super() + @project_mapping = project_mapping + end + + private + + def project_ids_error_message + @project_mapping + .errors + .messages_for(:project_ids) + .to_sentence + .presence + end + + def projects_with_cost_type_mapping + CostTypesProject + .where(cost_type_id: @project_mapping.cost_type_id) + .pluck(:project_id) + .to_h { |id| [id, id] } + end + end + end +end diff --git a/modules/costs/app/models/cost_type.rb b/modules/costs/app/models/cost_type.rb index 06f76be8280..01903cd5cda 100644 --- a/modules/costs/app/models/cost_type.rb +++ b/modules/costs/app/models/cost_type.rb @@ -30,6 +30,8 @@ class CostType < ApplicationRecord has_many :material_budget_items has_many :cost_entries, dependent: :destroy has_many :rates, class_name: "CostRate", dependent: :destroy + has_many :cost_types_projects, dependent: :destroy + has_many :projects, through: :cost_types_projects validates :unit, :unit_plural, presence: true validates :name, presence: true, uniqueness: { case_sensitive: false } @@ -39,12 +41,25 @@ class CostType < ApplicationRecord include ActiveModel::ForbiddenAttributesProtection scope :active, -> { where(deleted_at: nil) } + scope :for_all, -> { where(is_for_all: true) } + scope :available_for_project, ->(project) { + project_id = project.is_a?(Project) ? project.id : project + where(is_for_all: true) + .or(where(id: CostTypesProject.where(project_id:).select(:cost_type_id))) + } # finds the default CostType def self.default CostType.find_by(default: true) || CostType.first end + # Returns the default cost type for the given project, falling back to the first + # cost type available in that project when the global default is not available there. + def self.default_for_project(project) + available = available_for_project(project).active + available.find_by(default: true) || available.first + end + def is_default? default end diff --git a/modules/costs/app/models/cost_types_project.rb b/modules/costs/app/models/cost_types_project.rb new file mode 100644 index 00000000000..018f4a95c12 --- /dev/null +++ b/modules/costs/app/models/cost_types_project.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +# Join table for cost types on projects, used when CostType#is_for_all is not set +# to find which cost types are activated. +class CostTypesProject < ApplicationRecord + belongs_to :cost_type + belongs_to :project +end diff --git a/modules/costs/app/models/projects/scopes/available_cost_types.rb b/modules/costs/app/models/projects/scopes/available_cost_types.rb new file mode 100644 index 00000000000..d283c80d3a3 --- /dev/null +++ b/modules/costs/app/models/projects/scopes/available_cost_types.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Projects::Scopes + module AvailableCostTypes + extend ActiveSupport::Concern + + class_methods do + def with_available_cost_types(cost_type_ids) + where(id: cost_types_projects_subquery(cost_type_ids:)) + end + + def without_available_cost_types(cost_type_ids) + where.not(id: cost_types_projects_subquery(cost_type_ids:)) + end + + private + + def cost_types_projects_subquery(cost_type_ids:) + CostTypesProject.select(:project_id) + .where(cost_type_id: cost_type_ids) + end + end + end +end diff --git a/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb b/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb new file mode 100644 index 00000000000..13918576df9 --- /dev/null +++ b/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Queries::Projects::Filters::AvailableCostTypesProjectsFilter < Queries::Projects::Filters::Base + def self.key + :available_cost_types_projects + end + + def type + :list + end + + def allowed_values + @allowed_values ||= CostType.where(is_for_all: false).pluck(:name, :id) + end + + def available? + User.current.admin? + end + + def apply_to(_query_scope) + case operator + when "=" + super.with_available_cost_types(values) + when "!" + super.without_available_cost_types(values) + else + raise "unsupported operator" + end + end + + def where + nil + end + + def human_name + I18n.t(:label_available_cost_types_projects) + end +end diff --git a/modules/costs/app/services/cost_types/cost_type_projects/bulk_create_service.rb b/modules/costs/app/services/cost_types/cost_type_projects/bulk_create_service.rb new file mode 100644 index 00000000000..7cdeaa7e528 --- /dev/null +++ b/modules/costs/app/services/cost_types/cost_type_projects/bulk_create_service.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class BulkCreateService < ::BulkServices::ProjectMappings::BaseCreateService + def initialize(user:, projects:, model:, include_sub_projects: false) + mapping_context = ::BulkServices::ProjectMappings::MappingContext.new( + mapping_model_class: CostTypesProject, + model:, + projects:, + model_foreign_key_id:, + include_sub_projects: + ) + super(user:, mapping_context:) + end + + def permission = :manage_project_activities + def model_foreign_key_id = :cost_type_id + end + end +end diff --git a/modules/costs/app/services/cost_types/cost_type_projects/delete_service.rb b/modules/costs/app/services/cost_types/cost_type_projects/delete_service.rb new file mode 100644 index 00000000000..7a6d7e9b2c9 --- /dev/null +++ b/modules/costs/app/services/cost_types/cost_type_projects/delete_service.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class DeleteService < ::BaseServices::Delete + def default_contract_class = CostTypes::CostTypeProjects::UpdateContract + end + end +end diff --git a/modules/costs/app/services/cost_types/cost_type_projects/set_attributes_service.rb b/modules/costs/app/services/cost_types/cost_type_projects/set_attributes_service.rb new file mode 100644 index 00000000000..7397e372e36 --- /dev/null +++ b/modules/costs/app/services/cost_types/cost_type_projects/set_attributes_service.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module CostTypes + module CostTypeProjects + class SetAttributesService < ::BaseServices::SetAttributes + end + end +end diff --git a/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb b/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb new file mode 100644 index 00000000000..43d5a1887a8 --- /dev/null +++ b/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb @@ -0,0 +1,70 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<% html_title t(:label_administration), "#{CostType.model_name.human} #{h @cost_type.name}", t(:label_project_plural) %> + +<%= + render( + Admin::CostTypes::EditFormHeaderComponent.new( + cost_type: @cost_type, + selected: :cost_type_projects + ) + ) +%> + +<%= + unless @cost_type.is_for_all? + render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component| + component.with_action_button(scheme: :primary, + leading_icon: :"op-include-projects", + label: I18n.t(:label_add_projects), + tag: :a, + href: new_admin_cost_type_project_path(@cost_type), + data: { controller: "async-dialog" }) do + I18n.t(:label_add_projects) + end + end + end +%> + +<%= + if @cost_type.is_for_all? + render Primer::Beta::Blankslate.new(border: true) do |component| + component.with_visual_icon(icon: :checklist) + component.with_heading(tag: :h2).with_content(I18n.t("cost_types.admin.cost_type_projects.is_for_all_blank_slate.heading")) + component.with_description { I18n.t("cost_types.admin.cost_type_projects.is_for_all_blank_slate.description") } + end + else + render( + Admin::CostTypes::CostTypeProjects::TableComponent.new( + query: @available_cost_types_projects_query, + params: params.merge({ cost_type: @cost_type }) + ) + ) + end +%> diff --git a/modules/costs/app/views/admin/cost_types/edit.html.erb b/modules/costs/app/views/admin/cost_types/edit.html.erb index 7675ce934bb..d540009caad 100644 --- a/modules/costs/app/views/admin/cost_types/edit.html.erb +++ b/modules/costs/app/views/admin/cost_types/edit.html.erb @@ -36,17 +36,12 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <%= - render(Primer::OpenProject::PageHeader.new) do |header| - header.with_title { title } - header.with_breadcrumbs( - [ - { href: admin_index_path, text: t("label_administration") }, - { href: admin_time_settings_path, text: t(:project_module_costs) }, - { href: admin_cost_types_path, text: t(:label_cost_type_plural) }, - title - ] + render( + Admin::CostTypes::EditFormHeaderComponent.new( + cost_type: @cost_type, + selected: :edit ) - end + ) %> <%= labelled_tabular_form_for @cost_type, @@ -67,6 +62,9 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.check_box :default %>
+
+ <%= f.check_box :is_for_all %> +

<%= t :caption_rate_history %>

diff --git a/modules/costs/app/views/projects/settings/cost_types/index.html.erb b/modules/costs/app/views/projects/settings/cost_types/index.html.erb new file mode 100644 index 00000000000..cc8a2930862 --- /dev/null +++ b/modules/costs/app/views/projects/settings/cost_types/index.html.erb @@ -0,0 +1,77 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= + render( + Projects::Settings::TimeAndCosts::PageHeaderComponent.new( + project: @project, + selected: :cost_types + ) + ) +%> + +<% enabled_ids = CostTypesProject.where(project_id: @project.id).pluck(:cost_type_id).to_set %> + +<% if @cost_types.empty? %> + <%= + render Primer::Beta::Blankslate.new(border: true) do |c| + c.with_visual_icon(icon: :checklist) + c.with_heading(tag: :h2).with_content(I18n.t("cost_types.settings.cost_types.heading")) + c.with_description { I18n.t("cost_types.admin.cost_type_projects.no_projects.description") } + end + %> +<% else %> + + + + + + + + + <% @cost_types.each do |cost_type| %> + + + + + <% end %> + +
<%= CostType.model_name.human %>
<%= h cost_type.name %> + <% if cost_type.is_for_all? %> + <%= t(:label_for_all) rescue "For all projects" %> + <% else %> + <%= button_to( + enabled_ids.include?(cost_type.id) ? t(:button_disable) : t(:button_enable), + toggle_project_settings_cost_type_path(@project, cost_type), + method: :put, + class: "button", + form: { data: { turbo: false } } + ) %> + <% end %> +
+<% end %> diff --git a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb index 2a5237bea48..3582d7e9aff 100644 --- a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb +++ b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb @@ -28,14 +28,12 @@ See COPYRIGHT and LICENSE files for more details. ++#%> <%= - render Primer::OpenProject::PageHeader.new do |header| - header.with_title { t(:enumeration_activities) } - header.with_breadcrumbs( - [{ href: project_overview_path(@project.id), text: @project.name }, - { href: project_settings_general_path(@project.id), text: I18n.t(:label_project_settings) }, - t(:enumeration_activities)] + render( + Projects::Settings::TimeAndCosts::PageHeaderComponent.new( + project: @project, + selected: :time_entry_activities ) - end + ) %> <% if TimeEntryActivity.any? %> diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml index cd8642843f3..f4e8385ed95 100644 --- a/modules/costs/config/locales/en.yml +++ b/modules/costs/config/locales/en.yml @@ -47,6 +47,8 @@ en: unit: "Unit name" unit_plural: "Pluralized unit name" default: "Cost type by default" + is_for_all: "For all projects" + rates: "Rates" work_package: costs_by_type: "Spent units" labor_costs: "Labor costs" @@ -252,6 +254,24 @@ en: validation: start_time_different_date: "Date part of startTime (%{start_time}) must be the same as the spentOn (%{spent_on}) date." + label_available_cost_types_projects: "Available cost types projects" + cost_types: + errors: + no_cost_types_available: "No cost types are available in this project. Please contact an administrator." + admin: + cost_type_projects: + is_for_all_blank_slate: + heading: "This cost type is enabled in all projects" + description: "Uncheck \"For all projects\" on the details tab to limit this cost type to specific projects." + no_projects: + heading: "No projects assigned" + description: "Add projects so this cost type can be used in them." + settings: + time_and_costs: "Time & Costs" + cost_types: + heading: "Cost types" + none_active: "No cost types are currently active in this project." + costs: widgets: actual_costs: diff --git a/modules/costs/config/routes.rb b/modules/costs/config/routes.rb index e3eea05aa91..5fb911cbefd 100644 --- a/modules/costs/config/routes.rb +++ b/modules/costs/config/routes.rb @@ -62,6 +62,9 @@ Rails.application.routes.draw do scope "projects/:project_id", as: "project", module: "projects" do namespace "settings" do resource :time_entry_activities, only: %i[show update] + resources :cost_types, only: %i[index] do + member { put :toggle } + end end end @@ -93,6 +96,11 @@ Rails.application.routes.draw do put :set_rate patch :restore end + + scope module: :cost_types do + resources :projects, controller: :cost_type_projects, only: %i[index new create] + resource :project, controller: :cost_type_projects, only: :destroy + end end resource :costs, diff --git a/modules/costs/lib/costs/engine.rb b/modules/costs/lib/costs/engine.rb index 1fe57a590fd..ec6f54e3856 100644 --- a/modules/costs/lib/costs/engine.rb +++ b/modules/costs/lib/costs/engine.rb @@ -67,7 +67,10 @@ module Costs require: :member permission :manage_project_activities, - { "projects/settings/time_entry_activities": %i[show update] }, + { + "projects/settings/time_entry_activities": %i[show update], + "projects/settings/cost_types": %i[index toggle] + }, permissible_on: :project, require: :member @@ -222,6 +225,7 @@ module Costs current_user.allowed_in_project?(:log_own_costs, represented.project) } do next unless represented.costs_enabled? && represented.persisted? + next unless represented.project&.cost_types_available? { href: new_work_packages_cost_entry_path(represented), @@ -349,6 +353,10 @@ module Costs ::Queries::Register.register(::Query) do select Costs::QueryCurrencySelect end + + ::Queries::Register.register(::ProjectQuery) do + filter ::Queries::Projects::Filters::AvailableCostTypesProjectsFilter + end end end end diff --git a/modules/costs/lib/costs/patches/permitted_params_patch.rb b/modules/costs/lib/costs/patches/permitted_params_patch.rb index 5f5d9f9dd30..b414babec7f 100644 --- a/modules/costs/lib/costs/patches/permitted_params_patch.rb +++ b/modules/costs/lib/costs/patches/permitted_params_patch.rb @@ -56,6 +56,7 @@ module Costs::Patches::PermittedParamsPatch :unit, :unit_plural, :default, + :is_for_all, { new_rate_attributes: %i[valid_from rate] }, existing_rate_attributes: %i[valid_from rate]) end diff --git a/modules/costs/lib/costs/patches/project_patch.rb b/modules/costs/lib/costs/patches/project_patch.rb index b0b1402e338..aa0f32a1bb7 100644 --- a/modules/costs/lib/costs/patches/project_patch.rb +++ b/modules/costs/lib/costs/patches/project_patch.rb @@ -49,5 +49,9 @@ module Costs::Patches::ProjectPatch def costs_enabled? module_enabled?(:costs) end + + def cost_types_available? + CostType.available_for_project(self).active.exists? + end end end diff --git a/modules/costs/spec/controllers/costlog_controller_spec.rb b/modules/costs/spec/controllers/costlog_controller_spec.rb index c6b7f11b81c..c194024171b 100644 --- a/modules/costs/spec/controllers/costlog_controller_spec.rb +++ b/modules/costs/spec/controllers/costlog_controller_spec.rb @@ -132,7 +132,10 @@ RSpec.describe CostlogController do end describe "WHEN user allowed to create new cost_entry" do + let(:expected_cost_type) { cost_type } + before do + cost_type.save! grant_current_user_permissions user, %i[view_project view_work_packages log_costs] end @@ -154,7 +157,10 @@ RSpec.describe CostlogController do end describe "WHEN user is allowed to create new own cost_entry" do + let(:expected_cost_type) { cost_type } + before do + cost_type.save! grant_current_user_permissions user, %i[view_project view_work_packages log_own_costs] end @@ -172,6 +178,53 @@ RSpec.describe CostlogController do describe "WHEN user is not a project member" do it_behaves_like "not_found new" end + + describe "WHEN no cost type is available in the project" do + let(:scoped_cost_type) { create(:cost_type, is_for_all: false) } + + before do + CostType.destroy_all + scoped_cost_type # only project-scoped cost type, not mapped to this project + grant_current_user_permissions user, %i[view_project view_work_packages log_costs] + get :new, params: + end + + it "redirects with an error flash explaining no cost types are available" do + expect(response).to be_redirect + expect(flash[:error]).to eq(I18n.t("cost_types.errors.no_cost_types_available")) + end + end + + describe "WHEN the project's default cost type is global" do + let(:expected_cost_type) { cost_type } + + before do + CostType.destroy_all + cost_type.is_for_all = true + cost_type.default = true + cost_type.save! + grant_current_user_permissions user, %i[view_project view_work_packages log_costs] + end + + it_behaves_like "successful new" + end + + describe "WHEN the global default cost type is unavailable in the project, " \ + "but another non-global cost type is enabled" do + let(:scoped_cost_type) { create(:cost_type, is_for_all: false) } + let(:global_default) { create(:cost_type, is_for_all: false, default: true) } + let(:expected_cost_type) { scoped_cost_type } + + before do + CostType.destroy_all + global_default + scoped_cost_type + CostTypesProject.create!(project:, cost_type: scoped_cost_type) + grant_current_user_permissions user, %i[view_project view_work_packages log_costs] + end + + it_behaves_like "successful new" + end end describe "GET edit" do diff --git a/modules/costs/spec/features/costs_context_menu_spec.rb b/modules/costs/spec/features/costs_context_menu_spec.rb index f075b3d1484..77780e0faaf 100644 --- a/modules/costs/spec/features/costs_context_menu_spec.rb +++ b/modules/costs/spec/features/costs_context_menu_spec.rb @@ -3,6 +3,7 @@ require "spec_helper" RSpec.describe "Work package table log unit costs", :js do let(:user) { create(:admin) } let(:work_package) { create(:work_package) } + let!(:cost_type) { create(:cost_type, is_for_all: true) } let(:wp_table) { Pages::WorkPackagesTable.new } let(:menu) { Components::WorkPackages::ContextMenu.new } diff --git a/modules/costs/spec/features/time_entry/activity_spec.rb b/modules/costs/spec/features/time_entry/activity_spec.rb index 5cbf6029139..833cf1e8323 100644 --- a/modules/costs/spec/features/time_entry/activity_spec.rb +++ b/modules/costs/spec/features/time_entry/activity_spec.rb @@ -62,7 +62,7 @@ RSpec.describe "Time entry activity", :js do visit project_settings_general_path(project) - click_on "Time tracking activities" + click_on "Time & Costs" expect(page).to have_field("Development", checked: true) diff --git a/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb index 1e742c017bb..1cdba742a74 100644 --- a/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb +++ b/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb @@ -73,6 +73,11 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do embed_links: true) end + # Create a cost type that enables the log unit cost paths + let!(:cost_type) do + create(:cost_type, is_for_all: true) + end + before do allow(User).to receive(:current).and_return user end @@ -301,6 +306,38 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do end end end + + describe "logCosts gating by available cost types" do + let(:additional_permissions) { %i[log_costs view_time_entries view_cost_entries view_cost_rates] } + + before { CostType.destroy_all } + + context "when at least one cost type is available in the project" do + before { create(:cost_type, is_for_all: true) } + + it "has the logCosts link" do + expect(subject).to have_json_path("_links/logCosts/href") + end + end + + context "when no cost type is available in the project" do + before { create(:cost_type, is_for_all: false) } + + it "omits the logCosts link" do + expect(subject).not_to have_json_path("_links/logCosts/href") + end + end + + context "when a non-global cost type is explicitly enabled in the project" do + let!(:scoped_cost_type) { create(:cost_type, is_for_all: false) } + + before { CostTypesProject.create!(project:, cost_type: scoped_cost_type) } + + it "has the logCosts link" do + expect(subject).to have_json_path("_links/logCosts/href") + end + end + end end describe "costs module disabled" do diff --git a/modules/costs/spec/models/cost_type_spec.rb b/modules/costs/spec/models/cost_type_spec.rb index 2c3b2e5879e..4ff8542910c 100644 --- a/modules/costs/spec/models/cost_type_spec.rb +++ b/modules/costs/spec/models/cost_type_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. # Copyright (C) the OpenProject GmbH @@ -29,30 +31,21 @@ require_relative "../spec_helper" RSpec.describe CostType do - let(:klass) { CostType } let(:cost_type) do - klass.new name: "ct1", - unit: "singular", - unit_plural: "plural" - end - - before do - # as the spec_helper loads fixtures and they are probably needed by other tests - # we delete them here so they do not interfere. - # on the long run, fixtures should be removed - - CostType.destroy_all + described_class.new name: "ct1", + unit: "singular", + unit_plural: "plural" end describe "class" do describe "active" do describe "WHEN a CostType instance is deleted" do before do - cost_type.deleted_at = Time.now + cost_type.deleted_at = Time.zone.now cost_type.save! end - it { expect(klass.active.size).to eq(0) } + it { expect(described_class.active.size).to eq(0) } end describe "WHEN a CostType instance is not deleted" do @@ -60,8 +53,59 @@ RSpec.describe CostType do cost_type.save! end - it { expect(klass.active.size).to eq(1) } - it { expect(klass.active[0]).to eq(cost_type) } + it { expect(described_class.active.size).to eq(1) } + it { expect(described_class.active[0]).to eq(cost_type) } + end + end + end + + describe ".available_for_project" do + let(:project) { create(:project) } + let(:other_project) { create(:project) } + let!(:global_ct) { create(:cost_type, is_for_all: true) } + let!(:scoped_ct) { create(:cost_type, is_for_all: false) } + let!(:unrelated_ct) { create(:cost_type, is_for_all: false) } + + before do + CostTypesProject.create!(cost_type: scoped_ct, project: project) + CostTypesProject.create!(cost_type: unrelated_ct, project: other_project) + end + + it "returns global cost types plus those explicitly mapped to the project" do + expect(described_class.available_for_project(project)).to contain_exactly(global_ct, scoped_ct) + end + + it "accepts a project_id integer too" do + expect(described_class.available_for_project(project.id)).to contain_exactly(global_ct, scoped_ct) + end + end + + describe ".default_for_project" do + let(:project) { create(:project) } + + context "when the global default is available in the project" do + let!(:default_ct) { create(:cost_type, is_for_all: true, default: true) } + let!(:_other) { create(:cost_type, is_for_all: true) } + + it "returns the default" do + expect(described_class.default_for_project(project)).to eq(default_ct) + end + end + + context "when no default cost type is available in the project" do + let!(:default_ct) { create(:cost_type, for_all_projects: false, default: true) } + let!(:available) { create(:cost_type, for_all_projects: true) } + + it "falls back to the first available cost type" do + expect(described_class.default_for_project(project)).to eq(available) + end + end + + context "when no cost type is available in the project" do + let!(:_unrelated) { create(:cost_type, is_for_all: false) } + + it "returns nil" do + expect(described_class.default_for_project(project)).to be_nil end end end diff --git a/modules/costs/spec/models/cost_types_project_spec.rb b/modules/costs/spec/models/cost_types_project_spec.rb new file mode 100644 index 00000000000..5248e6e5f39 --- /dev/null +++ b/modules/costs/spec/models/cost_types_project_spec.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../spec_helper" + +RSpec.describe CostTypesProject do + let(:project) { create(:project) } + let(:cost_type) { create(:cost_type, is_for_all: false) } + + it "creates a mapping with both belongs_to associations" do + mapping = described_class.create!(project:, cost_type:) + expect(mapping.project).to eq(project) + expect(mapping.cost_type).to eq(cost_type) + end + + it "is destroyed when the cost type is destroyed" do + described_class.create!(project:, cost_type:) + expect { cost_type.destroy }.to change(described_class, :count).by(-1) + end + + it "is deleted when the project is destroyed" do + described_class.create!(project:, cost_type:) + expect { project.destroy }.to change(described_class, :count).by(-1) + end + + it "enforces uniqueness of (project_id, cost_type_id) at the DB level" do + described_class.create!(project:, cost_type:) + expect { described_class.create!(project:, cost_type:) } + .to raise_error(ActiveRecord::RecordNotUnique) + end +end diff --git a/modules/costs/spec/models/project_cost_types_available_spec.rb b/modules/costs/spec/models/project_cost_types_available_spec.rb new file mode 100644 index 00000000000..83ccadc2af3 --- /dev/null +++ b/modules/costs/spec/models/project_cost_types_available_spec.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../spec_helper" + +RSpec.describe Project, "#cost_types_available?" do + let(:project) { create(:project) } + + before { CostType.destroy_all } + + it "is true when at least one cost type is for all projects" do + create(:cost_type, is_for_all: true) + expect(project.cost_types_available?).to be true + end + + it "is true when a cost type is explicitly enabled in the project" do + cost_type = create(:cost_type, is_for_all: false) + CostTypesProject.create!(project:, cost_type:) + expect(project.cost_types_available?).to be true + end + + it "is false when there are no cost types enabled in the project" do + create(:cost_type, is_for_all: false) + expect(project.cost_types_available?).to be false + end + + it "ignores soft-deleted cost types" do + create(:cost_type, :deleted, is_for_all: true) + expect(project.cost_types_available?).to be false + end +end diff --git a/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb b/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb new file mode 100644 index 00000000000..d994a639309 --- /dev/null +++ b/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../../../../spec_helper" + +RSpec.describe Queries::Projects::Filters::AvailableCostTypesProjectsFilter do + let(:instance) { described_class.create!(name: described_class.key) } + + describe ".key" do + it { expect(described_class.key).to eq(:available_cost_types_projects) } + end + + describe "#allowed_values" do + before { CostType.destroy_all } + + let!(:scoped_a) { create(:cost_type, is_for_all: false, name: "Disk") } + let!(:scoped_b) { create(:cost_type, is_for_all: false, name: "License") } + let!(:_global) { create(:cost_type, is_for_all: true, name: "Travel") } + + it "lists only non-global cost types (so filter validates even before any mapping exists)" do + expect(instance.allowed_values).to contain_exactly( + ["Disk", scoped_a.id], + ["License", scoped_b.id] + ) + end + end + + describe "filter is registered with ProjectQuery" do + it "is in the ProjectQuery filter registry" do + expect(Queries::Register.filters[ProjectQuery]).to include(described_class) + end + end + + describe "applying the filter via ProjectQuery" do + let(:admin) { create(:admin) } + let!(:cost_type) { create(:cost_type, is_for_all: false) } + let!(:mapped_project) { create(:project) } + let!(:unmapped_project) { create(:project) } + + before do + login_as(admin) + CostTypesProject.create!(cost_type:, project: mapped_project) + end + + it "returns only projects mapped to the given cost type" do + query = ProjectQuery.new(name: "t") do |q| + q.where(:available_cost_types_projects, "=", [cost_type.id]) + q.select(:name) + end + + expect(query).to be_valid + expect(query.results.pluck(:id)).to contain_exactly(mapped_project.id) + end + + it "returns no projects when the cost type has no mappings (and query stays valid)" do + cost_type_without_mappings = create(:cost_type, is_for_all: false) + + query = ProjectQuery.new(name: "t2") do |q| + q.where(:available_cost_types_projects, "=", [cost_type_without_mappings.id]) + q.select(:name) + end + + expect(query).to be_valid + expect(query.results).to be_empty + end + end +end diff --git a/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb new file mode 100644 index 00000000000..466a094ed03 --- /dev/null +++ b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../../../spec_helper" + +RSpec.describe Projects::Settings::CostTypesController, :skip_csrf, type: :rails_request do + shared_let(:project) { create(:project, enabled_module_names: %i[costs]) } + + let(:permissions) { %i[manage_project_activities] } + let(:user) { create(:user, member_with_permissions: { project => permissions }) } + + let!(:global_ct) { create(:cost_type, is_for_all: true) } + let!(:scoped_ct) { create(:cost_type, is_for_all: false) } + + before { login_as(user) } + + describe "GET #index" do + it "renders the list of cost types" do + get project_settings_cost_types_path(project) + expect(response).to have_http_status(:ok) + end + end + + describe "PUT #toggle" do + context "with a non-global cost type not yet enabled in the project" do + it "creates the mapping" do + expect do + put toggle_project_settings_cost_type_path(project, scoped_ct) + end.to change { CostTypesProject.where(project:, cost_type: scoped_ct).count }.from(0).to(1) + expect(response).to redirect_to(project_settings_cost_types_path(project)) + end + end + + context "with a non-global cost type already enabled" do + before { CostTypesProject.create!(project:, cost_type: scoped_ct) } + + it "removes the mapping" do + expect do + put toggle_project_settings_cost_type_path(project, scoped_ct) + end.to change { CostTypesProject.where(project:, cost_type: scoped_ct).count }.from(1).to(0) + end + end + + context "with a global cost type" do + it "rejects toggling" do + expect do + put toggle_project_settings_cost_type_path(project, global_ct) + end.not_to change(CostTypesProject, :count) + expect(flash[:error]).to be_present + end + end + end + + context "when user lacks :manage_project_activities" do + let(:permissions) { %i[view_work_packages] } + + it "blocks index" do + get project_settings_cost_types_path(project) + expect(response).to have_http_status(:forbidden) + end + end +end diff --git a/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb b/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb new file mode 100644 index 00000000000..52034023767 --- /dev/null +++ b/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../../../spec_helper" +require Rails.root.join("spec/services/bulk_services/project_mappings/behaves_like_bulk_project_mapping_create_service") + +RSpec.describe CostTypes::CostTypeProjects::BulkCreateService do + shared_let(:cost_type) { create(:cost_type, is_for_all: false) } + + it_behaves_like "BulkServices project mappings create service" do + let(:model) { cost_type } + let(:model_mapping_class) { CostTypesProject } + let(:model_foreign_key_id) { :cost_type_id } + let(:required_permission) { :manage_project_activities } + end +end diff --git a/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb b/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb new file mode 100644 index 00000000000..2c0d8e4ecb7 --- /dev/null +++ b/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require_relative "../../../spec_helper" + +RSpec.describe CostTypes::CostTypeProjects::DeleteService do + shared_let(:project) { create(:project) } + shared_let(:cost_type) { create(:cost_type, is_for_all: false) } + + let!(:mapping) { CostTypesProject.create!(project:, cost_type:) } + + context "with an admin user" do + let(:user) { create(:admin) } + + it "removes the mapping" do + expect { described_class.new(user:, model: mapping).call } + .to change(CostTypesProject, :count).by(-1) + end + end + + context "with a user lacking permissions" do + let(:user) { create(:user, member_with_permissions: { project => %i[view_work_packages] }) } + + it "does not remove the mapping" do + result = described_class.new(user:, model: mapping).call + + expect(result).to be_failure + expect(CostTypesProject.where(id: mapping.id)).to exist + end + end + + context "when the cost type is is_for_all" do + let(:user) { create(:admin) } + + before { cost_type.update!(is_for_all: true) } + + it "refuses to delete the mapping" do + result = described_class.new(user:, model: mapping).call + + expect(result).to be_failure + expect(result.errors.symbols_for(:cost_type_id)).to include(:is_for_all_cannot_modify) + expect(CostTypesProject.where(id: mapping.id)).to exist + end + end +end From 6f3763652f0accebf1729695c3c49396e90d05c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 13 May 2026 22:00:44 +0200 Subject: [PATCH 108/381] Primerize cost types --- .../cost_types/details_component.html.erb | 47 ++++++++ .../admin/cost_types/details_component.rb | 49 +++++++++ .../edit_form_header_component.html.erb | 2 +- .../cost_types/edit_form_header_component.rb | 2 - .../admin/cost_types/rates_component.html.erb | 87 +++++++++++++++ .../admin/cost_types/rates_component.rb | 55 +++++++++ .../admin/cost_types/row_component.rb | 89 +++++++++++++++ .../admin/cost_types/table_component.rb | 61 ++++++++++ .../cost_types/index_component.html.erb | 98 +++++++++++++++++ .../settings/cost_types/index_component.rb | 85 ++++++++++++++ .../admin/cost_types_controller.rb | 24 +++- .../settings/cost_types_controller.rb | 17 ++- .../forms/admin/cost_types/details_form.rb | 84 ++++++++++++++ modules/costs/app/models/cost_type.rb | 27 ++++- .../app/views/admin/cost_types/edit.html.erb | 104 +----------------- .../app/views/admin/cost_types/index.html.erb | 3 +- .../app/views/admin/cost_types/rates.html.erb | 40 +++++++ .../settings/cost_types/index.html.erb | 48 ++------ modules/costs/config/locales/en.yml | 3 + modules/costs/config/routes.rb | 3 +- .../costs/patches/permitted_params_patch.rb | 1 + .../cost_types/create_cost_type_spec.rb | 8 +- .../cost_types/delete_cost_type_spec.rb | 8 +- .../settings/cost_types_controller_spec.rb | 8 +- 24 files changed, 786 insertions(+), 167 deletions(-) create mode 100644 modules/costs/app/components/admin/cost_types/details_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/details_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/rates_component.html.erb create mode 100644 modules/costs/app/components/admin/cost_types/rates_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/row_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/table_component.rb create mode 100644 modules/costs/app/components/projects/settings/cost_types/index_component.html.erb create mode 100644 modules/costs/app/components/projects/settings/cost_types/index_component.rb create mode 100644 modules/costs/app/forms/admin/cost_types/details_form.rb create mode 100644 modules/costs/app/views/admin/cost_types/rates.html.erb diff --git a/modules/costs/app/components/admin/cost_types/details_component.html.erb b/modules/costs/app/components/admin/cost_types/details_component.html.erb new file mode 100644 index 00000000000..91345a54404 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/details_component.html.erb @@ -0,0 +1,47 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= settings_primer_form_with( + model: cost_type, + url: form_url, + method: form_method + ) do |f| %> + <%= helpers.error_messages_for "cost_type" %> + <%= helpers.back_url_hidden_field_tag %> + + <%= render(Admin::CostTypes::DetailsForm.new(f)) %> + + <%= render( + Primer::Beta::Button.new( + scheme: :primary, + type: :submit, + mt: 3, + test_selector: "op-cost-type-form--submit" + ) + ) { t(:button_save) } %> +<% end %> diff --git a/modules/costs/app/components/admin/cost_types/details_component.rb b/modules/costs/app/components/admin/cost_types/details_component.rb new file mode 100644 index 00000000000..03d91a355d5 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/details_component.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class DetailsComponent < ApplicationComponent + include ApplicationHelper + include OpPrimer::ComponentHelpers + include OpPrimer::FormHelpers + + alias_method :cost_type, :model + + def form_url + cost_type.persisted? ? admin_cost_type_path(cost_type) : admin_cost_types_path + end + + def form_method + cost_type.persisted? ? :put : :post + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb b/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb index 4bc09708f8f..49fcdfbf6a1 100644 --- a/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb +++ b/modules/costs/app/components/admin/cost_types/edit_form_header_component.html.erb @@ -31,6 +31,6 @@ See COPYRIGHT and LICENSE files for more details. header.with_title { page_title } header.with_breadcrumbs(breadcrumbs_items, selected_item_font_weight: :normal) - helpers.render_tab_header_nav(header, tabs, test_selector: :cost_type_detail_header) + helpers.render_tab_header_nav(header, tabs, test_selector: :cost_type_detail_header) if @cost_type.persisted? end %> diff --git a/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb b/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb index 905695a8dd2..ac07de48eb9 100644 --- a/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb +++ b/modules/costs/app/components/admin/cost_types/edit_form_header_component.rb @@ -38,8 +38,6 @@ module Admin end def tabs - return [] unless @cost_type.persisted? - [ { name: "edit", diff --git a/modules/costs/app/components/admin/cost_types/rates_component.html.erb b/modules/costs/app/components/admin/cost_types/rates_component.html.erb new file mode 100644 index 00000000000..5c662461a4d --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/rates_component.html.erb @@ -0,0 +1,87 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<%= settings_primer_form_with( + model: cost_type, + url: admin_cost_type_path(cost_type), + method: :put, + data: { controller: "subform" } + ) do |f| %> + <%= helpers.error_messages_for "cost_type" %> + +
+
+ + + + + + + + + + + + + + + <%= render partial: "admin/cost_types/rate", + object: CostRate.new(valid_from: Date.current), + locals: { templated: true } %> + <% sorted_rates.each_with_index do |rate, index| %> + <%= render partial: "admin/cost_types/rate", object: rate, locals: { index: index } %> + <% end %> + +
<%= Rate.human_attribute_name(:valid_from) %><%= Rate.model_name.human %>
+
+
+ +
+ + <%= render( + Primer::Beta::IconButton.new( + icon: :plus, + id: "add_rate_date", + scheme: :invisible, + type: :button, + classes: "add-row-button wp-inline-create--add-link", + aria: { label: t(:button_add_rate) }, + data: { action: "subform#addRow" } + ) + ) %> +
+ + <%= render( + Primer::Beta::Button.new( + scheme: :primary, + type: :submit, + mt: 3, + test_selector: "op-cost-type-rates--submit" + ) + ) { t(:button_save) } %> +<% end %> diff --git a/modules/costs/app/components/admin/cost_types/rates_component.rb b/modules/costs/app/components/admin/cost_types/rates_component.rb new file mode 100644 index 00000000000..b3923e3fe3b --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/rates_component.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class RatesComponent < ApplicationComponent + include ApplicationHelper + include OpPrimer::ComponentHelpers + include OpPrimer::FormHelpers + + alias_method :cost_type, :model + + def sorted_rates + cost_type.rates.sort do |a, b| + if !a.valid? && !b.valid? + 0 + elsif !a.valid? + -1 + elsif !b.valid? + 1 + else + b.valid_from <=> a.valid_from + end + end + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/row_component.rb b/modules/costs/app/components/admin/cost_types/row_component.rb new file mode 100644 index 00000000000..d875400acef --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/row_component.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class RowComponent < ::RowComponent + def cost_type + model + end + + def name + helpers.link_to(cost_type.name, helpers.edit_admin_cost_type_path(cost_type)) + end + + def unit + cost_type.unit + end + + def unit_plural + cost_type.unit_plural + end + + def current_rate + helpers.to_currency_with_empty(cost_type.rate_at(table.fixed_date)) + end + + def default + checkmark(cost_type.is_default?) + end + + def column_css_class(column) + column == :current_rate ? "currency" : super + end + + def row_css_id + "cost_type_#{cost_type.id}" + end + + def button_links + [lock_link] + end + + def lock_link + render( + Primer::Beta::IconButton.new( + icon: :lock, + scheme: :invisible, + tag: :a, + href: helpers.admin_cost_type_path(cost_type), + "aria-label": t(:button_lock), + tooltip_direction: :w, + test_selector: "op-admin-cost-type-#{cost_type.id}-lock", + data: { + turbo_method: :delete, + turbo_confirm: t(:text_are_you_sure) + } + ) + ) + end + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/table_component.rb b/modules/costs/app/components/admin/cost_types/table_component.rb new file mode 100644 index 00000000000..1c04d381fa5 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/table_component.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class TableComponent < ::TableComponent + columns :name, :unit, :unit_plural, :current_rate, :default + sortable_columns :name, :unit, :unit_plural + options :fixed_date + + def initial_sort + %i[name asc] + end + + def headers + [ + ["name", { caption: CostType.model_name.human }], + ["unit", { caption: CostType.human_attribute_name(:unit) }], + ["unit_plural", { caption: CostType.human_attribute_name(:unit_plural) }], + ["current_rate", { caption: CostType.human_attribute_name(:current_rate) }], + ["default", { caption: I18n.t(:caption_default) }] + ] + end + + def sortable? + true + end + + def fixed_date + options.fetch(:fixed_date) { Date.current } + end + end + end +end diff --git a/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb b/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb new file mode 100644 index 00000000000..fa52650792d --- /dev/null +++ b/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb @@ -0,0 +1,98 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<% if empty? %> + <%= + render Primer::Beta::Blankslate.new(border: true) do |c| + c.with_visual_icon(icon: :checklist) + c.with_heading(tag: :h2).with_content(I18n.t("cost_types.settings.cost_types.heading")) + c.with_description { I18n.t("cost_types.admin.cost_type_projects.no_projects.description") } + end + %> +<% else %> + <%= render(Primer::Beta::BorderBox.new(test_selector: "op-project-settings-cost-types")) do |box| %> + <% box.with_header do %> + <%= render(Primer::Beta::Text.new(font_weight: :bold)) { CostType.model_name.human(count: 2) } %> + <% end %> + + <% cost_types.each do |cost_type| %> + <% box.with_row do %> + <%= + flex_layout( + align_items: :center, justify_content: :space_between, + classes: "op-project-cost-type", + data: { test_selector: "project-cost-type-#{cost_type.id}" } + ) do |row| + row.with_column(flex: 1) do + if User.current.admin? + render(Primer::Beta::Link.new(font_weight: :bold, + href: edit_admin_cost_type_path(cost_type))) { cost_type.name } + else + render(Primer::Beta::Text.new) { cost_type.name } + end + end + + row.with_column(py: 1, mr: 2) do + concat( + render( + Primer::Alpha::ToggleSwitch.new( + src: toggle_path(cost_type), + csrf_token: form_authenticity_token, + data: toggle_data_attributes(cost_type), + checked: toggle_checked?(cost_type), + enabled: !toggle_disabled?(cost_type), + size: :small, + status_label_position: :start, + classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator" + ) + ) + ) + + if toggle_disabled?(cost_type) + concat( + content_tag(:template, id: unique_hovercard_id(cost_type)) do + flex_layout( + classes: "op-project-cost-type--popover", + data: { test_selector: "op-project-cost-type--hover-card-#{cost_type.id}" } + ) do |hover_card| + hover_card.with_column do + render(Primer::Beta::Text.new) do + t("cost_types.settings.cost_types.is_for_all_hint") + end + end + end + end + ) + end + end + end + %> + <% end %> + <% end %> + <% end %> +<% end %> diff --git a/modules/costs/app/components/projects/settings/cost_types/index_component.rb b/modules/costs/app/components/projects/settings/cost_types/index_component.rb new file mode 100644 index 00000000000..76c0d309791 --- /dev/null +++ b/modules/costs/app/components/projects/settings/cost_types/index_component.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Projects + module Settings + module CostTypes + class IndexComponent < ApplicationComponent + include ApplicationHelper + include OpPrimer::ComponentHelpers + + def initialize(project:, cost_types:) + super() + @project = project + @cost_types = cost_types + end + + attr_reader :project, :cost_types + + delegate :empty?, to: :cost_types + + def enabled_cost_type_ids + @enabled_cost_type_ids ||= ::CostTypesProject.where(project_id: project.id).pluck(:cost_type_id).to_set + end + + def enabled?(cost_type) + enabled_cost_type_ids.include?(cost_type.id) + end + + def toggle_path(cost_type) + toggle_project_settings_cost_type_path(project, cost_type) + end + + def toggle_checked?(cost_type) + cost_type.is_for_all? || enabled?(cost_type) + end + + def toggle_disabled?(cost_type) + cost_type.is_for_all? + end + + def toggle_data_attributes(cost_type) + { + test_selector: "toggle-project-cost-type-mapping-#{cost_type.id}" + }.tap do |data| + if toggle_disabled?(cost_type) + data[:hover_card_trigger_target] = "trigger" + data[:hover_card_popover_template_id] = unique_hovercard_id(cost_type) + end + end + end + + def unique_hovercard_id(cost_type) + "project-cost-type-#{cost_type.id}-disabled-reason" + end + end + end + end +end diff --git a/modules/costs/app/controllers/admin/cost_types_controller.rb b/modules/costs/app/controllers/admin/cost_types_controller.rb index 72087d81f28..a232b36892e 100644 --- a/modules/costs/app/controllers/admin/cost_types_controller.rb +++ b/modules/costs/app/controllers/admin/cost_types_controller.rb @@ -32,7 +32,7 @@ module Admin class CostTypesController < ApplicationController # Allow only admins here before_action :require_admin - before_action :find_cost_type, only: %i[edit update set_rate destroy restore] + before_action :find_cost_type, only: %i[edit update set_rate destroy restore rates] layout "admin" menu_item :cost_types @@ -49,6 +49,7 @@ module Admin "unit_plural" => "#{CostType.table_name}.unit_plural" } sort_update sort_columns + @active_cost_types = CostType.active @cost_types = CostType.order(sort_clause) if params[:clear_filter] @@ -78,6 +79,10 @@ module Admin render action: :edit, layout: !request.xhr? end + def rates + render action: :rates, layout: !request.xhr? + end + def create # rubocop:disable Metrics/AbcSize @cost_type = CostType.new(permitted_params.cost_type) @@ -98,9 +103,9 @@ module Admin if @cost_type.save flash[:notice] = t(:notice_successful_update) - redirect_to edit_admin_cost_type_path(@cost_type) + redirect_to redirect_target_after_update else - render action: :edit, status: :unprocessable_entity, layout: !request.xhr? + render action: render_action_for_failed_update, status: :unprocessable_entity, layout: !request.xhr? end rescue ActiveRecord::StaleObjectError # Optimistic locking exception @@ -153,5 +158,18 @@ module Admin def find_cost_type @cost_type = CostType.find(params[:id]) end + + def rates_submission? + params.dig(:cost_type, :new_rate_attributes).present? || + params.dig(:cost_type, :existing_rate_attributes).present? + end + + def redirect_target_after_update + rates_submission? ? rates_admin_cost_type_path(@cost_type) : edit_admin_cost_type_path(@cost_type) + end + + def render_action_for_failed_update + rates_submission? ? :rates : :edit + end end end diff --git a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb index 2e222bc7eb8..a4779d9d8e9 100644 --- a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb +++ b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb @@ -39,7 +39,7 @@ class Projects::Settings::CostTypesController < Projects::SettingsController def toggle if @cost_type.is_for_all? - respond_redirect(error: I18n.t("activerecord.errors.messages.is_for_all_cannot_modify")) + respond_with_status(:unprocessable_entity) return end @@ -51,7 +51,7 @@ class Projects::Settings::CostTypesController < Projects::SettingsController mapping.save! end - respond_redirect + respond_with_status(:ok) end private @@ -60,9 +60,14 @@ class Projects::Settings::CostTypesController < Projects::SettingsController @cost_type = CostType.active.find(params.expect(:id)) end - def respond_redirect(error: nil) - flash[:error] = error if error - flash[:notice] = I18n.t(:notice_successful_update) unless error - redirect_to project_settings_cost_types_path(@project) + def respond_with_status(status) + respond_to do |format| + format.json { render json: {}, status: } + format.html do + flash[:notice] = I18n.t(:notice_successful_update) if status == :ok + flash[:error] = I18n.t("activerecord.errors.messages.is_for_all_cannot_modify") if status != :ok + redirect_to project_settings_cost_types_path(@project) + end + end end end diff --git a/modules/costs/app/forms/admin/cost_types/details_form.rb b/modules/costs/app/forms/admin/cost_types/details_form.rb new file mode 100644 index 00000000000..5408c8fd7ed --- /dev/null +++ b/modules/costs/app/forms/admin/cost_types/details_form.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module CostTypes + class DetailsForm < ApplicationForm + form do |f| + f.text_field( + name: :name, + label: ::CostType.human_attribute_name(:name), + required: true, + input_width: :large + ) + + f.text_field( + name: :unit, + label: ::CostType.human_attribute_name(:unit), + required: true, + input_width: :medium + ) + + f.text_field( + name: :unit_plural, + label: ::CostType.human_attribute_name(:unit_plural), + required: true, + input_width: :medium + ) + + f.text_field( + name: :current_rate, + label: ::CostType.human_attribute_name(:current_rate), + input_width: :small, + inputmode: :decimal, + value: current_rate_value, + trailing_visual: { text: { text: Setting.costs_currency } } + ) + + f.check_box( + name: :default, + label: ::CostType.human_attribute_name(:default) + ) + + f.check_box( + name: :is_for_all, + label: ::CostType.human_attribute_name(:is_for_all) + ) + end + + def current_rate_value + rate = model.rate_at(Date.current) + return "" unless rate + + helpers.unitless_currency_number(rate.rate.round(2)) + end + end + end +end diff --git a/modules/costs/app/models/cost_type.rb b/modules/costs/app/models/cost_type.rb index 01903cd5cda..892969b2a0b 100644 --- a/modules/costs/app/models/cost_type.rb +++ b/modules/costs/app/models/cost_type.rb @@ -37,6 +37,7 @@ class CostType < ApplicationRecord validates :name, presence: true, uniqueness: { case_sensitive: false } after_update :save_rates + after_save :persist_current_rate_input include ActiveModel::ForbiddenAttributesProtection @@ -68,8 +69,12 @@ class CostType < ApplicationRecord name.downcase <=> other.name.downcase end + attr_writer :current_rate + def current_rate - rate_at(Date.today) + return @current_rate if instance_variable_defined?(:@current_rate) + + rate_at(Date.current)&.rate end def rate_at(date) @@ -114,4 +119,24 @@ class CostType < ApplicationRecord def save_rates rates.each(&:save!) end + + def persist_current_rate_input + return unless instance_variable_defined?(:@current_rate) + + amount = parse_current_rate_amount(remove_instance_variable(:@current_rate)) + return if amount.nil? + + today = Time.zone.today + if (rate = rate_at(today)) + rate.update!(rate: amount) + else + rates.create!(valid_from: today, rate: amount) + end + end + + def parse_current_rate_amount(value) + return if value.to_s.strip.empty? + + CostRate.parse_number_string_to_number(value.to_s) + end end diff --git a/modules/costs/app/views/admin/cost_types/edit.html.erb b/modules/costs/app/views/admin/cost_types/edit.html.erb index d540009caad..3d9ccdaa310 100644 --- a/modules/costs/app/views/admin/cost_types/edit.html.erb +++ b/modules/costs/app/views/admin/cost_types/edit.html.erb @@ -1,4 +1,4 @@ -<%# -- copyright +<%#-- copyright OpenProject is an open source project management software. Copyright (C) the OpenProject GmbH @@ -21,18 +21,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. +++#%> -++# %> - -<% if(@cost_type.id) %> +<% if @cost_type.id %> <% html_title t(:label_cost_type_specific, id: @cost_type.id, name: @cost_type.name) %> - <% title = @cost_type.name %> <% else %> <% html_title t(:label_administration), t(:label_cost_type_plural) %> - <% title = "#{t(:label_new)} #{I18n.t('activerecord.models.cost_type.one')}" %> <% end %> <%= @@ -44,95 +41,4 @@ See COPYRIGHT and LICENSE files for more details. ) %> -<%= labelled_tabular_form_for @cost_type, - url: @cost_type.persisted? ? admin_cost_type_path(@cost_type) : admin_cost_types_path, - data: { controller: "subform" } do |f| %> - <%= error_messages_for "cost_type" %> - <%= back_url_hidden_field_tag %> - -
- <%= f.text_field :name, required: true, container_class: "-wide" %> -
-
- <%= f.text_field :unit, required: true, container_class: "-middle" %> -
-
- <%= f.text_field :unit_plural, required: true, container_class: "-middle" %> -
-
- <%= f.check_box :default %> -
-
- <%= f.check_box :is_for_all %> -
- -

<%= t :caption_rate_history %>

-
-
- - - - - - - - - - - - - - - <%= render partial: "rate", object: CostRate.new(valid_from: Date.current), locals: { templated: true } %> - <% @cost_type.rates.sort do |a, b| - if !a.valid? && !b.valid? - 0 - elsif !a.valid? - -1 - elsif !b.valid? - 1 - else - b.valid_from <=> a.valid_from - end - end.each_with_index do |rate, index| %> - <%= render partial: "rate", object: rate, locals: { index: index } %> - <%- end -%> - -
-
-
- - <%= Rate.human_attribute_name(:valid_from) %> - -
-
-
-
-
- - <%= Rate.model_name.human %> - -
-
-
- -
-
-
- - <%= - render( - Primer::Beta::IconButton.new( - icon: :plus, - id: "add_rate_date", - scheme: :invisible, - type: :button, - classes: "add-row-button wp-inline-create--add-link", - aria: { label: t(:button_add_rate) }, - data: { action: "subform#addRow" } - ) - ) - %> -
- <%= styled_button_tag t(:button_save), class: "-with-icon icon-checkmark" %> -<% end %> +<%= render(Admin::CostTypes::DetailsComponent.new(@cost_type)) %> diff --git a/modules/costs/app/views/admin/cost_types/index.html.erb b/modules/costs/app/views/admin/cost_types/index.html.erb index 952e8403d82..ebb694a31a5 100644 --- a/modules/costs/app/views/admin/cost_types/index.html.erb +++ b/modules/costs/app/views/admin/cost_types/index.html.erb @@ -24,7 +24,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. - ++#%> <% html_title t(:label_administration), t(:label_cost_type_plural) %> @@ -85,7 +84,7 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <% end %> -<%= render partial: "list" %> +<%= render(Admin::CostTypes::TableComponent.new(rows: @active_cost_types, fixed_date: @fixed_date)) %> <% if @include_deleted %>
diff --git a/modules/costs/app/views/admin/cost_types/rates.html.erb b/modules/costs/app/views/admin/cost_types/rates.html.erb new file mode 100644 index 00000000000..5d3a0948b73 --- /dev/null +++ b/modules/costs/app/views/admin/cost_types/rates.html.erb @@ -0,0 +1,40 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++#%> + +<% html_title t(:label_cost_type_specific, id: @cost_type.id, name: @cost_type.name) %> + +<%= + render( + Admin::CostTypes::EditFormHeaderComponent.new( + cost_type: @cost_type, + selected: :rates + ) + ) +%> + +<%= render(Admin::CostTypes::RatesComponent.new(@cost_type)) %> diff --git a/modules/costs/app/views/projects/settings/cost_types/index.html.erb b/modules/costs/app/views/projects/settings/cost_types/index.html.erb index cc8a2930862..0273959624f 100644 --- a/modules/costs/app/views/projects/settings/cost_types/index.html.erb +++ b/modules/costs/app/views/projects/settings/cost_types/index.html.erb @@ -35,43 +35,11 @@ See COPYRIGHT and LICENSE files for more details. ) %> -<% enabled_ids = CostTypesProject.where(project_id: @project.id).pluck(:cost_type_id).to_set %> - -<% if @cost_types.empty? %> - <%= - render Primer::Beta::Blankslate.new(border: true) do |c| - c.with_visual_icon(icon: :checklist) - c.with_heading(tag: :h2).with_content(I18n.t("cost_types.settings.cost_types.heading")) - c.with_description { I18n.t("cost_types.admin.cost_type_projects.no_projects.description") } - end - %> -<% else %> - - - - - - - - - <% @cost_types.each do |cost_type| %> - - - - - <% end %> - -
<%= CostType.model_name.human %>
<%= h cost_type.name %> - <% if cost_type.is_for_all? %> - <%= t(:label_for_all) rescue "For all projects" %> - <% else %> - <%= button_to( - enabled_ids.include?(cost_type.id) ? t(:button_disable) : t(:button_enable), - toggle_project_settings_cost_type_path(@project, cost_type), - method: :put, - class: "button", - form: { data: { turbo: false } } - ) %> - <% end %> -
-<% end %> +<%= + render( + Projects::Settings::CostTypes::IndexComponent.new( + project: @project, + cost_types: @cost_types + ) + ) +%> diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml index f4e8385ed95..3af93f4a01f 100644 --- a/modules/costs/config/locales/en.yml +++ b/modules/costs/config/locales/en.yml @@ -266,11 +266,14 @@ en: no_projects: heading: "No projects assigned" description: "Add projects so this cost type can be used in them." + rates: + title: "Rate history" settings: time_and_costs: "Time & Costs" cost_types: heading: "Cost types" none_active: "No cost types are currently active in this project." + is_for_all_hint: "This cost type is enabled in all projects." costs: widgets: diff --git a/modules/costs/config/routes.rb b/modules/costs/config/routes.rb index 5fb911cbefd..d22516e5598 100644 --- a/modules/costs/config/routes.rb +++ b/modules/costs/config/routes.rb @@ -63,7 +63,7 @@ Rails.application.routes.draw do namespace "settings" do resource :time_entry_activities, only: %i[show update] resources :cost_types, only: %i[index] do - member { put :toggle } + member { post :toggle } end end end @@ -95,6 +95,7 @@ Rails.application.routes.draw do # TODO: check if this can be replaced with update method put :set_rate patch :restore + get :rates end scope module: :cost_types do diff --git a/modules/costs/lib/costs/patches/permitted_params_patch.rb b/modules/costs/lib/costs/patches/permitted_params_patch.rb index b414babec7f..4d8c550ade4 100644 --- a/modules/costs/lib/costs/patches/permitted_params_patch.rb +++ b/modules/costs/lib/costs/patches/permitted_params_patch.rb @@ -57,6 +57,7 @@ module Costs::Patches::PermittedParamsPatch :unit_plural, :default, :is_for_all, + :current_rate, { new_rate_attributes: %i[valid_from rate] }, existing_rate_attributes: %i[valid_from rate]) end diff --git a/modules/costs/spec/features/cost_types/create_cost_type_spec.rb b/modules/costs/spec/features/cost_types/create_cost_type_spec.rb index c01d8607550..33727aff87b 100644 --- a/modules/costs/spec/features/cost_types/create_cost_type_spec.rb +++ b/modules/costs/spec/features/cost_types/create_cost_type_spec.rb @@ -46,11 +46,11 @@ RSpec.describe "creating a cost type", :js do fill_in "cost_type_name", with: "Test day rate" fill_in "cost_type_unit", with: "dayUnit" fill_in "cost_type_unit_plural", with: "dayUnitPlural" - fill_in "cost_type_new_rate_attributes_0_rate", with: "1,000.25" + fill_in "cost_type_current_rate", with: "1,000.25" sleep 1 - scroll_to_and_click(find("button.-with-icon.icon-checkmark")) + scroll_to_and_click(find("[data-test-selector='op-cost-type-form--submit']")) expect_angular_frontend_initialized expect(page).to have_css ".generic-table", wait: 10 @@ -77,11 +77,11 @@ RSpec.describe "creating a cost type", :js do fill_in "cost_type_name", with: "Test day rate" fill_in "cost_type_unit", with: "dayUnit" fill_in "cost_type_unit_plural", with: "dayUnitPlural" - fill_in "cost_type_new_rate_attributes_0_rate", with: "1.000,25" + fill_in "cost_type_current_rate", with: "1.000,25" sleep 1 - scroll_to_and_click(find("button.-with-icon.icon-checkmark")) + scroll_to_and_click(find("[data-test-selector='op-cost-type-form--submit']")) expect_angular_frontend_initialized expect(page).to have_css ".generic-table", wait: 10 diff --git a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb index ca201b229aa..f4ab70b10da 100644 --- a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb +++ b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb @@ -43,13 +43,13 @@ RSpec.describe "deleting a cost type", :js do it "can delete the cost type" do visit admin_cost_types_path - within("#delete_cost_type_#{cost_type.id}") do - scroll_to_and_click(find("button.submit_cost_type")) + accept_confirm do + scroll_to_and_click(find("[data-test-selector='op-admin-cost-type-#{cost_type.id}-lock']")) end # Expect no results if not locked expect_angular_frontend_initialized - expect(page).to have_css ".generic-table--no-results-container", wait: 10 + expect(page).to have_css ".generic-table--empty-row", wait: 10 # Show locked find_by_id("include_deleted").set true @@ -57,7 +57,7 @@ RSpec.describe "deleting a cost type", :js do wait_for_network_idle - # Expect no results if not locked + # Expect locked list to render with the cost type expect(page).to have_text I18n.t(:label_locked_cost_types) expect(page).to have_css(".restore_cost_type") diff --git a/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb index 466a094ed03..619bfe2f213 100644 --- a/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb +++ b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb @@ -48,11 +48,11 @@ RSpec.describe Projects::Settings::CostTypesController, :skip_csrf, type: :rails end end - describe "PUT #toggle" do + describe "POST #toggle" do context "with a non-global cost type not yet enabled in the project" do it "creates the mapping" do expect do - put toggle_project_settings_cost_type_path(project, scoped_ct) + post toggle_project_settings_cost_type_path(project, scoped_ct) end.to change { CostTypesProject.where(project:, cost_type: scoped_ct).count }.from(0).to(1) expect(response).to redirect_to(project_settings_cost_types_path(project)) end @@ -63,7 +63,7 @@ RSpec.describe Projects::Settings::CostTypesController, :skip_csrf, type: :rails it "removes the mapping" do expect do - put toggle_project_settings_cost_type_path(project, scoped_ct) + post toggle_project_settings_cost_type_path(project, scoped_ct) end.to change { CostTypesProject.where(project:, cost_type: scoped_ct).count }.from(1).to(0) end end @@ -71,7 +71,7 @@ RSpec.describe Projects::Settings::CostTypesController, :skip_csrf, type: :rails context "with a global cost type" do it "rejects toggling" do expect do - put toggle_project_settings_cost_type_path(project, global_ct) + post toggle_project_settings_cost_type_path(project, global_ct) end.not_to change(CostTypesProject, :count) expect(flash[:error]).to be_present end From b1e9b367a841334820cda80d162903aab937d134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Thu, 14 May 2026 21:04:55 +0200 Subject: [PATCH 109/381] Primerize cost type list --- app/components/row_component.rb | 8 +- .../admin/cost_types/row_component.rb | 46 ++++-- .../admin/cost_types/table_component.rb | 42 ++++-- .../admin/cost_types_controller.rb | 21 +-- .../settings/cost_types_controller.rb | 7 +- .../app/views/admin/cost_types/_list.html.erb | 131 ------------------ .../admin/cost_types/_list_deleted.html.erb | 98 ------------- .../app/views/admin/cost_types/index.html.erb | 55 ++------ modules/costs/config/locales/en.yml | 3 +- .../cost_types/delete_cost_type_spec.rb | 15 +- 10 files changed, 104 insertions(+), 322 deletions(-) delete mode 100644 modules/costs/app/views/admin/cost_types/_list.html.erb delete mode 100644 modules/costs/app/views/admin/cost_types/_list_deleted.html.erb diff --git a/app/components/row_component.rb b/app/components/row_component.rb index 00ae80c0993..d9ae018c387 100644 --- a/app/components/row_component.rb +++ b/app/components/row_component.rb @@ -89,8 +89,12 @@ class RowComponent < ApplicationComponent :default end - def checkmark(condition) - if condition + def checkmark(condition, primerized: false) + return unless condition + + if primerized + render(Primer::Beta::Octicon.new(icon: :check)) + else helpers.op_icon "icon icon-checkmark" end end diff --git a/modules/costs/app/components/admin/cost_types/row_component.rb b/modules/costs/app/components/admin/cost_types/row_component.rb index d875400acef..5f951ac69ae 100644 --- a/modules/costs/app/components/admin/cost_types/row_component.rb +++ b/modules/costs/app/components/admin/cost_types/row_component.rb @@ -31,6 +31,8 @@ module Admin module CostTypes class RowComponent < ::RowComponent + delegate :unit, :unit_plural, to: :cost_type + def cost_type model end @@ -39,20 +41,27 @@ module Admin helpers.link_to(cost_type.name, helpers.edit_admin_cost_type_path(cost_type)) end - def unit - cost_type.unit - end - - def unit_plural - cost_type.unit_plural - end - def current_rate - helpers.to_currency_with_empty(cost_type.rate_at(table.fixed_date)) + helpers.to_currency_with_empty(cost_type.rate_at(Date.current)) end def default - checkmark(cost_type.is_default?) + checkmark(cost_type.is_default?, primerized: true) + end + + def active_projects + if cost_type.is_for_all? + I18n.t("settings.project_attributes.label_for_all_projects") + else + count = Project.active.joins(:cost_types_projects) + .where(cost_types_projects: { cost_type_id: cost_type.id }) + .count + count.zero? ? I18n.t(:label_none) : count + end + end + + def deleted_at + helpers.format_date(cost_type.deleted_at) if cost_type.deleted_at end def column_css_class(column) @@ -64,7 +73,7 @@ module Admin end def button_links - [lock_link] + table.locked? ? [restore_link] : [lock_link] end def lock_link @@ -84,6 +93,21 @@ module Admin ) ) end + + def restore_link + render( + Primer::Beta::IconButton.new( + icon: :unlock, + scheme: :invisible, + tag: :a, + href: helpers.restore_admin_cost_type_path(cost_type), + "aria-label": t(:button_unlock), + tooltip_direction: :w, + test_selector: "op-admin-cost-type-#{cost_type.id}-restore", + data: { turbo_method: :patch } + ) + ) + end end end end diff --git a/modules/costs/app/components/admin/cost_types/table_component.rb b/modules/costs/app/components/admin/cost_types/table_component.rb index 1c04d381fa5..3c317aa76fc 100644 --- a/modules/costs/app/components/admin/cost_types/table_component.rb +++ b/modules/costs/app/components/admin/cost_types/table_component.rb @@ -31,30 +31,48 @@ module Admin module CostTypes class TableComponent < ::TableComponent - columns :name, :unit, :unit_plural, :current_rate, :default - sortable_columns :name, :unit, :unit_plural - options :fixed_date + options status: "active" + + def columns + if status == "locked" + %i[name unit unit_plural current_rate deleted_at] + else + %i[name unit unit_plural current_rate active_projects default] + end + end + + def sortable_columns + %i[name unit unit_plural] + end def initial_sort %i[name asc] end def headers - [ - ["name", { caption: CostType.model_name.human }], - ["unit", { caption: CostType.human_attribute_name(:unit) }], - ["unit_plural", { caption: CostType.human_attribute_name(:unit_plural) }], - ["current_rate", { caption: CostType.human_attribute_name(:current_rate) }], - ["default", { caption: I18n.t(:caption_default) }] - ] + columns.map { |column| [column.to_s, { caption: header_caption(column) }] } end def sortable? true end - def fixed_date - options.fetch(:fixed_date) { Date.current } + def locked? + status == "locked" + end + + private + + def header_caption(column) + case column + when :name then CostType.model_name.human + when :unit then CostType.human_attribute_name(:unit) + when :unit_plural then CostType.human_attribute_name(:unit_plural) + when :current_rate then CostType.human_attribute_name(:current_rate) + when :active_projects then I18n.t("cost_types.admin.columns.active_projects") + when :default then I18n.t(:caption_default) + when :deleted_at then I18n.t(:caption_locked_on) + end end end end diff --git a/modules/costs/app/controllers/admin/cost_types_controller.rb b/modules/costs/app/controllers/admin/cost_types_controller.rb index a232b36892e..c57f0f475f6 100644 --- a/modules/costs/app/controllers/admin/cost_types_controller.rb +++ b/modules/costs/app/controllers/admin/cost_types_controller.rb @@ -49,20 +49,9 @@ module Admin "unit_plural" => "#{CostType.table_name}.unit_plural" } sort_update sort_columns - @active_cost_types = CostType.active - @cost_types = CostType.order(sort_clause) - - if params[:clear_filter] - @fixed_date = Time.zone.today - @include_deleted = nil - else - @fixed_date = begin - Date.parse(params[:fixed_date]) - rescue StandardError - Time.zone.today - end - @include_deleted = params[:include_deleted] - end + @status = params[:status] == "locked" ? "locked" : "active" + @cost_types = (@status == "locked" ? CostType.where.not(deleted_at: nil) : CostType.active) + .order(sort_clause) render action: "index", layout: !request.xhr? end @@ -119,7 +108,7 @@ module Admin if @cost_type.save flash[:notice] = t(:notice_successful_lock) - redirect_back_or_default({ action: "index" }) + redirect_back_or_default({ action: "index" }, status: :see_other) end end @@ -130,7 +119,7 @@ module Admin if @cost_type.save flash[:notice] = t(:notice_successful_restore) - redirect_back_or_default({ action: "index" }) + redirect_back_or_default({ action: "index" }, status: :see_other) end end diff --git a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb index a4779d9d8e9..4dbb7f85ed9 100644 --- a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb +++ b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb @@ -64,8 +64,11 @@ class Projects::Settings::CostTypesController < Projects::SettingsController respond_to do |format| format.json { render json: {}, status: } format.html do - flash[:notice] = I18n.t(:notice_successful_update) if status == :ok - flash[:error] = I18n.t("activerecord.errors.messages.is_for_all_cannot_modify") if status != :ok + if status == :ok + flash[:notice] = I18n.t(:notice_successful_update) + else + flash[:error] = I18n.t("activerecord.errors.messages.is_for_all_cannot_modify") + end redirect_to project_settings_cost_types_path(@project) end end diff --git a/modules/costs/app/views/admin/cost_types/_list.html.erb b/modules/costs/app/views/admin/cost_types/_list.html.erb deleted file mode 100644 index 299d68a6699..00000000000 --- a/modules/costs/app/views/admin/cost_types/_list.html.erb +++ /dev/null @@ -1,131 +0,0 @@ -<%#-- copyright -OpenProject is an open source project management software. -Copyright (C) the OpenProject GmbH - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 3. - -OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -Copyright (C) 2006-2013 Jean-Philippe Lang -Copyright (C) 2010-2013 the ChiliProject Team - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -See COPYRIGHT and LICENSE files for more details. - -++#%> - -<% cost_types = @cost_types.reject(&:deleted_at) -%> - -<% if cost_types.empty? %> - <%= no_results_box %> -<% else %> -
-
- - - - - - - - - - - - - <%= sort_header_tag "name", caption: CostType.model_name.human %> - <%= sort_header_tag "unit", caption: CostType.human_attribute_name(:unit) %> - <%= sort_header_tag "unit_plural", caption: CostType.human_attribute_name(:unit_plural) %> - - - - - - - - <% cost_types.each do |cost_type| %> - - <%= content_tag :td, link_to(cost_type.name, { controller: "/admin/cost_types", action: "edit", id: cost_type }) %> - <%= content_tag :td, cost_type.unit %> - <%= content_tag :td, cost_type.unit_plural %> - <%= content_tag :td, to_currency_with_empty(cost_type.rate_at(@fixed_date)), class: "currency", id: "cost_type_#{cost_type.id}_rate" %> - - <%= content_tag :td, cost_type.is_default? ? icon_wrapper("icon icon-checkmark", I18n.t(:general_text_Yes)) : "" %> - - - - - <% end %> - -
-
-
- - <%= CostType.human_attribute_name(:current_rate) %> - -
-
-
-
-
- - <%= t(:caption_set_rate) %> - -
-
-
-
-
- - <%= t(:caption_default) %> - -
-
-
- <%= form_for cost_type, url: { controller: "/admin/cost_types", action: "set_rate", id: cost_type }, method: :put, html: { class: "inline-label" } do |f| %> - - <%= content_tag :input, - "", - value: "", - name: :rate, - size: 7, - inputmode: :decimal, - placeholder: t(:label_example_placeholder, decimal: unitless_currency_number(1000.50)), - id: "rate_field_#{cost_type.id}" %> - - <%= Setting.costs_currency %> - - - <% end %> - - <%= form_for cost_type, url: admin_cost_type_path(cost_type), - method: :delete, - html: { id: "delete_cost_type_#{cost_type.id}", - class: "delete_cost_type", - title: t(:button_lock) } do |f| %> - - <% end %> -
- -
-
-<% end %> diff --git a/modules/costs/app/views/admin/cost_types/_list_deleted.html.erb b/modules/costs/app/views/admin/cost_types/_list_deleted.html.erb deleted file mode 100644 index f38ff7c72b6..00000000000 --- a/modules/costs/app/views/admin/cost_types/_list_deleted.html.erb +++ /dev/null @@ -1,98 +0,0 @@ -<%#-- copyright -OpenProject is an open source project management software. -Copyright (C) the OpenProject GmbH - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 3. - -OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -Copyright (C) 2006-2013 Jean-Philippe Lang -Copyright (C) 2010-2013 the ChiliProject Team - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -See COPYRIGHT and LICENSE files for more details. - -++#%> - -<% cost_types = @cost_types.select(&:deleted_at) -%> - -<% if cost_types.empty? %> - <%= no_results_box %> -<% else %> -
-
- - - - - - - - - - - - <%= sort_header_tag("name", caption: CostType.model_name.human) %> - <%= sort_header_tag("unit", caption: CostType.human_attribute_name(:unit)) %> - <%= sort_header_tag("unit_plural", caption: CostType.human_attribute_name(:unit_plural)) %> - - - - - - - <% cost_types.each do |cost_type| %> - - <%= content_tag :td, cost_type.name %> - <%= content_tag :td, cost_type.unit %> - <%= content_tag :td, cost_type.unit_plural %> - <%= content_tag :td, to_currency_with_empty(cost_type.rate_at(@fixed_date)), class: "currency" %> - <%= content_tag :td, cost_type.deleted_at.to_date %> - - - <% end %> - -
-
-
- - <%= CostType.human_attribute_name(:current_rate) %> - -
-
-
-
-
- - <%= t(:caption_locked_on) %> - -
-
-
- <%= form_for cost_type, url: restore_admin_cost_type_path(cost_type), - method: :patch, - html: { id: "restore_cost_type_#{cost_type.id}", - class: "restore_cost_type" } do |f| %> - - <% end %> -
- -
-
-<% end %> diff --git a/modules/costs/app/views/admin/cost_types/index.html.erb b/modules/costs/app/views/admin/cost_types/index.html.erb index ebb694a31a5..6ad93cfb580 100644 --- a/modules/costs/app/views/admin/cost_types/index.html.erb +++ b/modules/costs/app/views/admin/cost_types/index.html.erb @@ -42,6 +42,19 @@ See COPYRIGHT and LICENSE files for more details. %> <%= render(Primer::OpenProject::SubHeader.new) do |subheader| %> + <% subheader.with_filter_component do %> + <%= render(Primer::Alpha::SegmentedControl.new("aria-label": t(:label_filter_plural), full_width: false)) do |control| %> + <% control.with_item(tag: :a, + href: admin_cost_types_path(status: "active"), + label: t(:label_active), + selected: @status == "active") %> + <% control.with_item(tag: :a, + href: admin_cost_types_path(status: "locked"), + label: t("members.menu.locked"), + selected: @status == "locked") %> + <% end %> + <% end %> + <% subheader.with_action_button( scheme: :primary, leading_icon: :plus, @@ -51,44 +64,6 @@ See COPYRIGHT and LICENSE files for more details. ) do CostType.model_name.human end %> - - <% subheader.with_bottom_pane_component do %> - <%= styled_form_tag(admin_cost_types_path, { method: :get, id: "query_form" }) do %> -
- <%= t(:label_filter_plural) %> -
    -
  • - <%= styled_label_tag :fixed_date, t(:"attributes.fixed_date"), class: "simple-filters--filter-name" %> -
    - <%= angular_component_tag "opce-basic-single-date-picker", - inputs: { - value: @fixed_date, - id: :start_date, - name: :fixed_date - } %> -
    -
  • -
  • - <%= styled_label_tag :include_deleted, t(:caption_show_locked), class: "simple-filters--filter-name -small" %> -
    - <%= styled_check_box_tag :include_deleted, "1", @include_deleted, autocomplete: "off" %> -
    -
  • -
  • - <%= submit_tag t(:button_apply), class: "button -primary -small" %> - <%= link_to t(:button_clear), cost_types_path, class: "button -small -with-icon icon-undo" %> -
  • -
-
- <% end %> - <% end %> - <% end %> - -<%= render(Admin::CostTypes::TableComponent.new(rows: @active_cost_types, fixed_date: @fixed_date)) %> - -<% if @include_deleted %> -
-

<%= t(:label_locked_cost_types) %>

- <%= render partial: "list_deleted" %> -
<% end %> + +<%= render(Admin::CostTypes::TableComponent.new(rows: @cost_types, status: @status)) %> diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml index 3af93f4a01f..49eb5f222e5 100644 --- a/modules/costs/config/locales/en.yml +++ b/modules/costs/config/locales/en.yml @@ -144,7 +144,6 @@ en: label_current_default_rate: "Current default rate" label_date_on: "on" label_deleted_cost_types: "Deleted cost types" - label_locked_cost_types: "Locked cost types" label_display_cost_entries: "Display unit costs" label_display_time_entries: "Display reported hours" label_display_types: "Display types" @@ -259,6 +258,8 @@ en: errors: no_cost_types_available: "No cost types are available in this project. Please contact an administrator." admin: + columns: + active_projects: "Active projects" cost_type_projects: is_for_all_blank_slate: heading: "This cost type is enabled in all projects" diff --git a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb index f4ab70b10da..a9a2b6a74d5 100644 --- a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb +++ b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb @@ -47,20 +47,17 @@ RSpec.describe "deleting a cost type", :js do scroll_to_and_click(find("[data-test-selector='op-admin-cost-type-#{cost_type.id}-lock']")) end - # Expect no results if not locked + # Active list becomes empty expect_angular_frontend_initialized expect(page).to have_css ".generic-table--empty-row", wait: 10 - # Show locked - find_by_id("include_deleted").set true - click_on "Apply" + # Switch to the locked tab via the segmented control + click_on I18n.t(:label_locked) wait_for_network_idle - # Expect locked list to render with the cost type - expect(page).to have_text I18n.t(:label_locked_cost_types) - - expect(page).to have_css(".restore_cost_type") - expect(page).to have_css(".cost-types--list-deleted td", text: "Translations") + # The locked cost type appears with a restore action + expect(page).to have_css("[data-test-selector='op-admin-cost-type-#{cost_type.id}-restore']") + expect(page).to have_css("td", text: "Translations") end end From 6ef8757560642622996f676690380165f4e81d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 26 May 2026 09:06:54 +0200 Subject: [PATCH 110/381] Rename "is_for_all" to "for_all_projects" --- ...260513120000_add_project_scoping_to_cost_types.rb | 2 +- .../new_cost_type_projects_modal_component.rb | 2 +- .../app/components/admin/cost_types/row_component.rb | 2 +- .../settings/cost_types/index_component.html.erb | 2 +- .../projects/settings/cost_types/index_component.rb | 4 ++-- .../cost_types/cost_type_projects/base_contract.rb | 2 +- .../projects/settings/cost_types_controller.rb | 2 +- .../costs/app/forms/admin/cost_types/details_form.rb | 4 ++-- modules/costs/app/models/cost_type.rb | 4 ++-- modules/costs/app/models/cost_types_project.rb | 2 +- .../filters/available_cost_types_projects_filter.rb | 2 +- .../cost_types/cost_type_projects/index.html.erb | 8 ++++---- modules/costs/config/locales/en.yml | 6 +++--- .../lib/costs/patches/permitted_params_patch.rb | 2 +- .../spec/controllers/costlog_controller_spec.rb | 8 ++++---- .../costs/spec/features/costs_context_menu_spec.rb | 2 +- .../work_packages/work_package_representer_spec.rb | 8 ++++---- modules/costs/spec/models/cost_type_spec.rb | 12 ++++++------ modules/costs/spec/models/cost_types_project_spec.rb | 2 +- .../spec/models/project_cost_types_available_spec.rb | 8 ++++---- .../available_cost_types_projects_filter_spec.rb | 10 +++++----- .../projects/settings/cost_types_controller_spec.rb | 4 ++-- .../cost_type_projects/bulk_create_service_spec.rb | 2 +- .../cost_type_projects/delete_service_spec.rb | 6 +++--- 24 files changed, 53 insertions(+), 53 deletions(-) diff --git a/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb b/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb index c640faa34f6..e4db5f28f83 100644 --- a/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb +++ b/db/migrate/20260513120000_add_project_scoping_to_cost_types.rb @@ -30,7 +30,7 @@ class AddProjectScopingToCostTypes < ActiveRecord::Migration[8.0] def change - add_column :cost_types, :is_for_all, :boolean, default: true, null: false + add_column :cost_types, :for_all_projects, :boolean, default: true, null: false create_table :cost_types_projects do |t| t.references :cost_type, null: false, foreign_key: true diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb index ed8bcb69b85..0b8d944d6de 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb @@ -41,7 +41,7 @@ module Admin end def render? - !cost_type.is_for_all? + !cost_type.for_all_projects? end private diff --git a/modules/costs/app/components/admin/cost_types/row_component.rb b/modules/costs/app/components/admin/cost_types/row_component.rb index 5f951ac69ae..8760f8f96d6 100644 --- a/modules/costs/app/components/admin/cost_types/row_component.rb +++ b/modules/costs/app/components/admin/cost_types/row_component.rb @@ -50,7 +50,7 @@ module Admin end def active_projects - if cost_type.is_for_all? + if cost_type.for_all_projects? I18n.t("settings.project_attributes.label_for_all_projects") else count = Project.active.joins(:cost_types_projects) diff --git a/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb b/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb index fa52650792d..0e8908524d4 100644 --- a/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb +++ b/modules/costs/app/components/projects/settings/cost_types/index_component.html.erb @@ -82,7 +82,7 @@ See COPYRIGHT and LICENSE files for more details. ) do |hover_card| hover_card.with_column do render(Primer::Beta::Text.new) do - t("cost_types.settings.cost_types.is_for_all_hint") + t("cost_types.settings.cost_types.for_all_projects_hint") end end end diff --git a/modules/costs/app/components/projects/settings/cost_types/index_component.rb b/modules/costs/app/components/projects/settings/cost_types/index_component.rb index 76c0d309791..ec2139c6a34 100644 --- a/modules/costs/app/components/projects/settings/cost_types/index_component.rb +++ b/modules/costs/app/components/projects/settings/cost_types/index_component.rb @@ -58,11 +58,11 @@ module Projects end def toggle_checked?(cost_type) - cost_type.is_for_all? || enabled?(cost_type) + cost_type.for_all_projects? || enabled?(cost_type) end def toggle_disabled?(cost_type) - cost_type.is_for_all? + cost_type.for_all_projects? end def toggle_data_attributes(cost_type) diff --git a/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb b/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb index 993250ea1ae..3ea9481a707 100644 --- a/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb +++ b/modules/costs/app/contracts/cost_types/cost_type_projects/base_contract.rb @@ -63,7 +63,7 @@ module CostTypes end def not_for_all - return if model.cost_type.nil? || !model.cost_type.is_for_all? + return if model.cost_type.nil? || !model.cost_type.for_all_projects? errors.add :cost_type_id, :is_for_all_cannot_modify end diff --git a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb index 4dbb7f85ed9..6fb9edec4d0 100644 --- a/modules/costs/app/controllers/projects/settings/cost_types_controller.rb +++ b/modules/costs/app/controllers/projects/settings/cost_types_controller.rb @@ -38,7 +38,7 @@ class Projects::Settings::CostTypesController < Projects::SettingsController end def toggle - if @cost_type.is_for_all? + if @cost_type.for_all_projects? respond_with_status(:unprocessable_entity) return end diff --git a/modules/costs/app/forms/admin/cost_types/details_form.rb b/modules/costs/app/forms/admin/cost_types/details_form.rb index 5408c8fd7ed..6113d8c0eaf 100644 --- a/modules/costs/app/forms/admin/cost_types/details_form.rb +++ b/modules/costs/app/forms/admin/cost_types/details_form.rb @@ -68,8 +68,8 @@ module Admin ) f.check_box( - name: :is_for_all, - label: ::CostType.human_attribute_name(:is_for_all) + name: :for_all_projects, + label: ::CostType.human_attribute_name(:for_all_projects) ) end diff --git a/modules/costs/app/models/cost_type.rb b/modules/costs/app/models/cost_type.rb index 892969b2a0b..75e2d88465d 100644 --- a/modules/costs/app/models/cost_type.rb +++ b/modules/costs/app/models/cost_type.rb @@ -42,10 +42,10 @@ class CostType < ApplicationRecord include ActiveModel::ForbiddenAttributesProtection scope :active, -> { where(deleted_at: nil) } - scope :for_all, -> { where(is_for_all: true) } + scope :for_all, -> { where(for_all_projects: true) } scope :available_for_project, ->(project) { project_id = project.is_a?(Project) ? project.id : project - where(is_for_all: true) + where(for_all_projects: true) .or(where(id: CostTypesProject.where(project_id:).select(:cost_type_id))) } diff --git a/modules/costs/app/models/cost_types_project.rb b/modules/costs/app/models/cost_types_project.rb index 018f4a95c12..340fa18363d 100644 --- a/modules/costs/app/models/cost_types_project.rb +++ b/modules/costs/app/models/cost_types_project.rb @@ -28,7 +28,7 @@ # See COPYRIGHT and LICENSE files for more details. #++ -# Join table for cost types on projects, used when CostType#is_for_all is not set +# Join table for cost types on projects, used when CostType#for_all_projects is not set # to find which cost types are activated. class CostTypesProject < ApplicationRecord belongs_to :cost_type diff --git a/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb b/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb index 13918576df9..3890f8a1a21 100644 --- a/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb +++ b/modules/costs/app/models/queries/projects/filters/available_cost_types_projects_filter.rb @@ -38,7 +38,7 @@ class Queries::Projects::Filters::AvailableCostTypesProjectsFilter < Queries::Pr end def allowed_values - @allowed_values ||= CostType.where(is_for_all: false).pluck(:name, :id) + @allowed_values ||= CostType.where(for_all_projects: false).pluck(:name, :id) end def available? diff --git a/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb b/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb index 43d5a1887a8..2c878694758 100644 --- a/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb +++ b/modules/costs/app/views/admin/cost_types/cost_type_projects/index.html.erb @@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details. %> <%= - unless @cost_type.is_for_all? + unless @cost_type.for_all_projects? render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component| component.with_action_button(scheme: :primary, leading_icon: :"op-include-projects", @@ -53,11 +53,11 @@ See COPYRIGHT and LICENSE files for more details. %> <%= - if @cost_type.is_for_all? + if @cost_type.for_all_projects? render Primer::Beta::Blankslate.new(border: true) do |component| component.with_visual_icon(icon: :checklist) - component.with_heading(tag: :h2).with_content(I18n.t("cost_types.admin.cost_type_projects.is_for_all_blank_slate.heading")) - component.with_description { I18n.t("cost_types.admin.cost_type_projects.is_for_all_blank_slate.description") } + component.with_heading(tag: :h2).with_content(I18n.t("cost_types.admin.cost_type_projects.for_all_projects_blank_slate.heading")) + component.with_description { I18n.t("cost_types.admin.cost_type_projects.for_all_projects_blank_slate.description") } end else render( diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml index 49eb5f222e5..748a094821d 100644 --- a/modules/costs/config/locales/en.yml +++ b/modules/costs/config/locales/en.yml @@ -47,7 +47,7 @@ en: unit: "Unit name" unit_plural: "Pluralized unit name" default: "Cost type by default" - is_for_all: "For all projects" + for_all_projects: "For all projects" rates: "Rates" work_package: costs_by_type: "Spent units" @@ -261,7 +261,7 @@ en: columns: active_projects: "Active projects" cost_type_projects: - is_for_all_blank_slate: + for_all_projects_blank_slate: heading: "This cost type is enabled in all projects" description: "Uncheck \"For all projects\" on the details tab to limit this cost type to specific projects." no_projects: @@ -274,7 +274,7 @@ en: cost_types: heading: "Cost types" none_active: "No cost types are currently active in this project." - is_for_all_hint: "This cost type is enabled in all projects." + for_all_projects_hint: "This cost type is enabled in all projects." costs: widgets: diff --git a/modules/costs/lib/costs/patches/permitted_params_patch.rb b/modules/costs/lib/costs/patches/permitted_params_patch.rb index 4d8c550ade4..6b20ab513de 100644 --- a/modules/costs/lib/costs/patches/permitted_params_patch.rb +++ b/modules/costs/lib/costs/patches/permitted_params_patch.rb @@ -56,7 +56,7 @@ module Costs::Patches::PermittedParamsPatch :unit, :unit_plural, :default, - :is_for_all, + :for_all_projects, :current_rate, { new_rate_attributes: %i[valid_from rate] }, existing_rate_attributes: %i[valid_from rate]) diff --git a/modules/costs/spec/controllers/costlog_controller_spec.rb b/modules/costs/spec/controllers/costlog_controller_spec.rb index c194024171b..24ac59370c5 100644 --- a/modules/costs/spec/controllers/costlog_controller_spec.rb +++ b/modules/costs/spec/controllers/costlog_controller_spec.rb @@ -180,7 +180,7 @@ RSpec.describe CostlogController do end describe "WHEN no cost type is available in the project" do - let(:scoped_cost_type) { create(:cost_type, is_for_all: false) } + let(:scoped_cost_type) { create(:cost_type, for_all_projects: false) } before do CostType.destroy_all @@ -200,7 +200,7 @@ RSpec.describe CostlogController do before do CostType.destroy_all - cost_type.is_for_all = true + cost_type.for_all_projects = true cost_type.default = true cost_type.save! grant_current_user_permissions user, %i[view_project view_work_packages log_costs] @@ -211,8 +211,8 @@ RSpec.describe CostlogController do describe "WHEN the global default cost type is unavailable in the project, " \ "but another non-global cost type is enabled" do - let(:scoped_cost_type) { create(:cost_type, is_for_all: false) } - let(:global_default) { create(:cost_type, is_for_all: false, default: true) } + let(:scoped_cost_type) { create(:cost_type, for_all_projects: false) } + let(:global_default) { create(:cost_type, for_all_projects: false, default: true) } let(:expected_cost_type) { scoped_cost_type } before do diff --git a/modules/costs/spec/features/costs_context_menu_spec.rb b/modules/costs/spec/features/costs_context_menu_spec.rb index 77780e0faaf..3a2b4f05d9f 100644 --- a/modules/costs/spec/features/costs_context_menu_spec.rb +++ b/modules/costs/spec/features/costs_context_menu_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" RSpec.describe "Work package table log unit costs", :js do let(:user) { create(:admin) } let(:work_package) { create(:work_package) } - let!(:cost_type) { create(:cost_type, is_for_all: true) } + let!(:cost_type) { create(:cost_type, for_all_projects: true) } let(:wp_table) { Pages::WorkPackagesTable.new } let(:menu) { Components::WorkPackages::ContextMenu.new } diff --git a/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb index 1cdba742a74..62c92edfa86 100644 --- a/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb +++ b/modules/costs/spec/lib/api/v3/work_packages/work_package_representer_spec.rb @@ -75,7 +75,7 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do # Create a cost type that enables the log unit cost paths let!(:cost_type) do - create(:cost_type, is_for_all: true) + create(:cost_type, for_all_projects: true) end before do @@ -313,7 +313,7 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do before { CostType.destroy_all } context "when at least one cost type is available in the project" do - before { create(:cost_type, is_for_all: true) } + before { create(:cost_type, for_all_projects: true) } it "has the logCosts link" do expect(subject).to have_json_path("_links/logCosts/href") @@ -321,7 +321,7 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do end context "when no cost type is available in the project" do - before { create(:cost_type, is_for_all: false) } + before { create(:cost_type, for_all_projects: false) } it "omits the logCosts link" do expect(subject).not_to have_json_path("_links/logCosts/href") @@ -329,7 +329,7 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do end context "when a non-global cost type is explicitly enabled in the project" do - let!(:scoped_cost_type) { create(:cost_type, is_for_all: false) } + let!(:scoped_cost_type) { create(:cost_type, for_all_projects: false) } before { CostTypesProject.create!(project:, cost_type: scoped_cost_type) } diff --git a/modules/costs/spec/models/cost_type_spec.rb b/modules/costs/spec/models/cost_type_spec.rb index 4ff8542910c..04965f395f9 100644 --- a/modules/costs/spec/models/cost_type_spec.rb +++ b/modules/costs/spec/models/cost_type_spec.rb @@ -62,9 +62,9 @@ RSpec.describe CostType do describe ".available_for_project" do let(:project) { create(:project) } let(:other_project) { create(:project) } - let!(:global_ct) { create(:cost_type, is_for_all: true) } - let!(:scoped_ct) { create(:cost_type, is_for_all: false) } - let!(:unrelated_ct) { create(:cost_type, is_for_all: false) } + let!(:global_ct) { create(:cost_type, for_all_projects: true) } + let!(:scoped_ct) { create(:cost_type, for_all_projects: false) } + let!(:unrelated_ct) { create(:cost_type, for_all_projects: false) } before do CostTypesProject.create!(cost_type: scoped_ct, project: project) @@ -84,8 +84,8 @@ RSpec.describe CostType do let(:project) { create(:project) } context "when the global default is available in the project" do - let!(:default_ct) { create(:cost_type, is_for_all: true, default: true) } - let!(:_other) { create(:cost_type, is_for_all: true) } + let!(:default_ct) { create(:cost_type, for_all_projects: true, default: true) } + let!(:_other) { create(:cost_type, for_all_projects: true) } it "returns the default" do expect(described_class.default_for_project(project)).to eq(default_ct) @@ -102,7 +102,7 @@ RSpec.describe CostType do end context "when no cost type is available in the project" do - let!(:_unrelated) { create(:cost_type, is_for_all: false) } + let!(:_unrelated) { create(:cost_type, for_all_projects: false) } it "returns nil" do expect(described_class.default_for_project(project)).to be_nil diff --git a/modules/costs/spec/models/cost_types_project_spec.rb b/modules/costs/spec/models/cost_types_project_spec.rb index 5248e6e5f39..8fa922262a7 100644 --- a/modules/costs/spec/models/cost_types_project_spec.rb +++ b/modules/costs/spec/models/cost_types_project_spec.rb @@ -32,7 +32,7 @@ require_relative "../spec_helper" RSpec.describe CostTypesProject do let(:project) { create(:project) } - let(:cost_type) { create(:cost_type, is_for_all: false) } + let(:cost_type) { create(:cost_type, for_all_projects: false) } it "creates a mapping with both belongs_to associations" do mapping = described_class.create!(project:, cost_type:) diff --git a/modules/costs/spec/models/project_cost_types_available_spec.rb b/modules/costs/spec/models/project_cost_types_available_spec.rb index 83ccadc2af3..0e60258d553 100644 --- a/modules/costs/spec/models/project_cost_types_available_spec.rb +++ b/modules/costs/spec/models/project_cost_types_available_spec.rb @@ -36,23 +36,23 @@ RSpec.describe Project, "#cost_types_available?" do before { CostType.destroy_all } it "is true when at least one cost type is for all projects" do - create(:cost_type, is_for_all: true) + create(:cost_type, for_all_projects: true) expect(project.cost_types_available?).to be true end it "is true when a cost type is explicitly enabled in the project" do - cost_type = create(:cost_type, is_for_all: false) + cost_type = create(:cost_type, for_all_projects: false) CostTypesProject.create!(project:, cost_type:) expect(project.cost_types_available?).to be true end it "is false when there are no cost types enabled in the project" do - create(:cost_type, is_for_all: false) + create(:cost_type, for_all_projects: false) expect(project.cost_types_available?).to be false end it "ignores soft-deleted cost types" do - create(:cost_type, :deleted, is_for_all: true) + create(:cost_type, :deleted, for_all_projects: true) expect(project.cost_types_available?).to be false end end diff --git a/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb b/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb index d994a639309..f1068282fae 100644 --- a/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb +++ b/modules/costs/spec/models/queries/projects/filters/available_cost_types_projects_filter_spec.rb @@ -40,9 +40,9 @@ RSpec.describe Queries::Projects::Filters::AvailableCostTypesProjectsFilter do describe "#allowed_values" do before { CostType.destroy_all } - let!(:scoped_a) { create(:cost_type, is_for_all: false, name: "Disk") } - let!(:scoped_b) { create(:cost_type, is_for_all: false, name: "License") } - let!(:_global) { create(:cost_type, is_for_all: true, name: "Travel") } + let!(:scoped_a) { create(:cost_type, for_all_projects: false, name: "Disk") } + let!(:scoped_b) { create(:cost_type, for_all_projects: false, name: "License") } + let!(:_global) { create(:cost_type, for_all_projects: true, name: "Travel") } it "lists only non-global cost types (so filter validates even before any mapping exists)" do expect(instance.allowed_values).to contain_exactly( @@ -60,7 +60,7 @@ RSpec.describe Queries::Projects::Filters::AvailableCostTypesProjectsFilter do describe "applying the filter via ProjectQuery" do let(:admin) { create(:admin) } - let!(:cost_type) { create(:cost_type, is_for_all: false) } + let!(:cost_type) { create(:cost_type, for_all_projects: false) } let!(:mapped_project) { create(:project) } let!(:unmapped_project) { create(:project) } @@ -80,7 +80,7 @@ RSpec.describe Queries::Projects::Filters::AvailableCostTypesProjectsFilter do end it "returns no projects when the cost type has no mappings (and query stays valid)" do - cost_type_without_mappings = create(:cost_type, is_for_all: false) + cost_type_without_mappings = create(:cost_type, for_all_projects: false) query = ProjectQuery.new(name: "t2") do |q| q.where(:available_cost_types_projects, "=", [cost_type_without_mappings.id]) diff --git a/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb index 619bfe2f213..97683fdf5e5 100644 --- a/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb +++ b/modules/costs/spec/requests/projects/settings/cost_types_controller_spec.rb @@ -36,8 +36,8 @@ RSpec.describe Projects::Settings::CostTypesController, :skip_csrf, type: :rails let(:permissions) { %i[manage_project_activities] } let(:user) { create(:user, member_with_permissions: { project => permissions }) } - let!(:global_ct) { create(:cost_type, is_for_all: true) } - let!(:scoped_ct) { create(:cost_type, is_for_all: false) } + let!(:global_ct) { create(:cost_type, for_all_projects: true) } + let!(:scoped_ct) { create(:cost_type, for_all_projects: false) } before { login_as(user) } diff --git a/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb b/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb index 52034023767..8d106873e8a 100644 --- a/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb +++ b/modules/costs/spec/services/cost_types/cost_type_projects/bulk_create_service_spec.rb @@ -32,7 +32,7 @@ require_relative "../../../spec_helper" require Rails.root.join("spec/services/bulk_services/project_mappings/behaves_like_bulk_project_mapping_create_service") RSpec.describe CostTypes::CostTypeProjects::BulkCreateService do - shared_let(:cost_type) { create(:cost_type, is_for_all: false) } + shared_let(:cost_type) { create(:cost_type, for_all_projects: false) } it_behaves_like "BulkServices project mappings create service" do let(:model) { cost_type } diff --git a/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb b/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb index 2c0d8e4ecb7..e6967e2ae18 100644 --- a/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb +++ b/modules/costs/spec/services/cost_types/cost_type_projects/delete_service_spec.rb @@ -32,7 +32,7 @@ require_relative "../../../spec_helper" RSpec.describe CostTypes::CostTypeProjects::DeleteService do shared_let(:project) { create(:project) } - shared_let(:cost_type) { create(:cost_type, is_for_all: false) } + shared_let(:cost_type) { create(:cost_type, for_all_projects: false) } let!(:mapping) { CostTypesProject.create!(project:, cost_type:) } @@ -56,10 +56,10 @@ RSpec.describe CostTypes::CostTypeProjects::DeleteService do end end - context "when the cost type is is_for_all" do + context "when the cost type is for all projects" do let(:user) { create(:admin) } - before { cost_type.update!(is_for_all: true) } + before { cost_type.update!(for_all_projects: true) } it "refuses to delete the mapping" do result = described_class.new(user:, model: mapping).call From 2e4ea0e83315b7f7a3758fed891a580e82d9d9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 26 May 2026 09:29:06 +0200 Subject: [PATCH 111/381] Render form in body only --- ...ype_projects_form_modal_component.html.erb | 43 ++++++++++--------- ...cost_type_projects_form_modal_component.rb | 2 + 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb index 3cd24755d16..c7801bdea5b 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb @@ -28,29 +28,30 @@ See COPYRIGHT and LICENSE files for more details. <%= component_wrapper do - primer_form_with( - model: @cost_type_project_mapping, - url:, - data: { turbo: true }, - method: :post - ) do |form| - concat( - render( - Primer::Alpha::Dialog::Body.new( - id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title }, - classes: "Overlay-body_autocomplete_height" - ) - ) do + concat( + render( + Primer::Alpha::Dialog::Body.new( + id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title }, + classes: "Overlay-body_autocomplete_height" + ) + ) do + primer_form_with( + model: @cost_type_project_mapping, + id: form_id, + url:, + data: { turbo: true }, + method: :post + ) do |form| render(::CostTypes::CostTypeProjects::CostTypeMappingForm.new(form, project_mapping: @cost_type_project_mapping)) end - ) + end + ) - concat( - render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do - concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text }) - concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit)) { submit_button_text }) - end - ) - end + concat( + render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do + concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text }) + concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit, form: form_id)) { submit_button_text }) + end + ) end %> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb index 7ccc1b5c68a..2313803d7ef 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb @@ -36,6 +36,7 @@ module Admin DIALOG_ID = "new-cost-type-projects-modal" DIALOG_BODY_ID = "new-cost-type-projects-modal-body" + FORM_ID = "new-cost-type-projects-form" def initialize(cost_type_project_mapping:, cost_type:, **) @cost_type_project_mapping = cost_type_project_mapping @@ -51,6 +52,7 @@ module Admin def dialog_id = DIALOG_ID def dialog_body_id = DIALOG_BODY_ID + def form_id = FORM_ID attr_reader :cost_type_project_mapping, :cost_type From 65da9f7f7799fb834781bcb4cb0d471942e58f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 26 May 2026 10:08:09 +0200 Subject: [PATCH 112/381] Render dailog inside the main modal component --- ...ype_projects_form_modal_component.html.erb | 34 +++++-------------- ...cost_type_projects_form_modal_component.rb | 14 -------- ...ost_type_projects_modal_component.html.erb | 16 ++++++++- .../new_cost_type_projects_modal_component.rb | 9 +++++ 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb index c7801bdea5b..b9bde37c00d 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.html.erb @@ -28,30 +28,14 @@ See COPYRIGHT and LICENSE files for more details. <%= component_wrapper do - concat( - render( - Primer::Alpha::Dialog::Body.new( - id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title }, - classes: "Overlay-body_autocomplete_height" - ) - ) do - primer_form_with( - model: @cost_type_project_mapping, - id: form_id, - url:, - data: { turbo: true }, - method: :post - ) do |form| - render(::CostTypes::CostTypeProjects::CostTypeMappingForm.new(form, project_mapping: @cost_type_project_mapping)) - end - end - ) - - concat( - render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do - concat(render(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text }) - concat(render(Primer::Beta::Button.new(scheme: :primary, type: :submit, form: form_id)) { submit_button_text }) - end - ) + primer_form_with( + model: @cost_type_project_mapping, + id: form_id, + url:, + data: { turbo: true }, + method: :post + ) do |form| + render(::CostTypes::CostTypeProjects::CostTypeMappingForm.new(form, project_mapping: @cost_type_project_mapping)) + end end %> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb index 2313803d7ef..8c441534fcc 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_form_modal_component.rb @@ -50,23 +50,9 @@ module Admin url_helpers.admin_cost_type_projects_path(@cost_type) end - def dialog_id = DIALOG_ID - def dialog_body_id = DIALOG_BODY_ID def form_id = FORM_ID attr_reader :cost_type_project_mapping, :cost_type - - def title - I18n.t(:label_add_projects) - end - - def cancel_button_text - I18n.t("button_cancel") - end - - def submit_button_text - I18n.t("button_add") - end end end end diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb index 6c45cd543eb..d25e5d7547c 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.html.erb @@ -41,6 +41,20 @@ See COPYRIGHT and LICENSE files for more details. variant: :large ) - render(form_modal_component) + dialog.with_body( + id: dialog_body_id, + test_selector: dialog_body_id, + aria: { label: title }, + classes: "Overlay-body_autocomplete_height" + ) do + render(form_modal_component) + end + + dialog.with_footer(show_divider: false) do + component_collection do |footer| + footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": dialog_id })) { cancel_button_text } + footer.with_component(Primer::Beta::Button.new(scheme: :primary, type: :submit, form: form_id)) { submit_button_text } + end + end end %> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb index 0b8d944d6de..e1e4c74407e 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/new_cost_type_projects_modal_component.rb @@ -50,11 +50,20 @@ module Admin def dialog_id = NewCostTypeProjectsFormModalComponent::DIALOG_ID def dialog_body_id = NewCostTypeProjectsFormModalComponent::DIALOG_BODY_ID + def form_id = NewCostTypeProjectsFormModalComponent::FORM_ID def title I18n.t(:label_add_projects) end + def cancel_button_text + I18n.t("button_cancel") + end + + def submit_button_text + I18n.t("button_add") + end + def form_modal_component Admin::CostTypes::CostTypeProjects::NewCostTypeProjectsFormModalComponent.new( cost_type_project_mapping:, cost_type: From 37081e8dedc273d2a75d84787f9fb36b7750f54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 26 May 2026 10:08:44 +0200 Subject: [PATCH 113/381] Remove useless turbo: true --- .../custom_fields/custom_field_projects/row_component.html.erb | 2 +- .../admin/cost_types/cost_type_projects/row_component.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb index cf694aa0c31..3792e1735e5 100644 --- a/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb +++ b/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb @@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details. ++#%> -<%= component_wrapper(tag: "tr", class: row_css_class, data: { turbo: true }) do %> +<%= component_wrapper(tag: "tr", class: row_css_class) do %> <% columns.each do |column| %> <%= column_value(column) %> diff --git a/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb index c492d478b6c..1ed14cf26a6 100644 --- a/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb +++ b/modules/costs/app/components/admin/cost_types/cost_type_projects/row_component.html.erb @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. ++#%> -<%= component_wrapper(tag: "tr", class: row_css_class, data: { turbo: true }) do %> +<%= component_wrapper(tag: "tr", class: row_css_class) do %> <% columns.each do |column| %> <%= column_value(column) %> From 66a80ff463bc25ee301bf4f8053f55b2ae603688 Mon Sep 17 00:00:00 2001 From: Mir Bhatia Date: Tue, 19 May 2026 15:38:39 +0200 Subject: [PATCH 114/381] Use correct slot --- .../cost_types/filter_button_component.rb | 37 +++++++++++++ .../admin/cost_types/filters_component.rb | 37 +++++++++++++ .../app/views/admin/cost_types/index.html.erb | 54 +++++++++++++------ .../cost_types/delete_cost_type_spec.rb | 2 +- 4 files changed, 114 insertions(+), 16 deletions(-) create mode 100644 modules/costs/app/components/admin/cost_types/filter_button_component.rb create mode 100644 modules/costs/app/components/admin/cost_types/filters_component.rb diff --git a/modules/costs/app/components/admin/cost_types/filter_button_component.rb b/modules/costs/app/components/admin/cost_types/filter_button_component.rb new file mode 100644 index 00000000000..838a71337df --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/filter_button_component.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +# TODO - Remove with https://community.openproject.org/wp/75158 +module Admin + module CostTypes + class FilterButtonComponent < Filter::FilterButtonComponent + end + end +end diff --git a/modules/costs/app/components/admin/cost_types/filters_component.rb b/modules/costs/app/components/admin/cost_types/filters_component.rb new file mode 100644 index 00000000000..fcc8e42fc45 --- /dev/null +++ b/modules/costs/app/components/admin/cost_types/filters_component.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +# TODO - Remove with https://community.openproject.org/wp/75158 +module Admin + module CostTypes + class FiltersComponent < Filter::FilterComponent + end + end +end diff --git a/modules/costs/app/views/admin/cost_types/index.html.erb b/modules/costs/app/views/admin/cost_types/index.html.erb index 6ad93cfb580..f9b096f1381 100644 --- a/modules/costs/app/views/admin/cost_types/index.html.erb +++ b/modules/costs/app/views/admin/cost_types/index.html.erb @@ -41,9 +41,18 @@ See COPYRIGHT and LICENSE files for more details. end %> -<%= render(Primer::OpenProject::SubHeader.new) do |subheader| %> - <% subheader.with_filter_component do %> - <%= render(Primer::Alpha::SegmentedControl.new("aria-label": t(:label_filter_plural), full_width: false)) do |control| %> +<%= + render( + Primer::OpenProject::SubHeader.new( + data: { + controller: "filter--filters-form", + "filter--filters-form-output-format-value": "json", + "filter--filters-form-display-filters-value": @query.filters.any? + } + ) + ) do |subheader| + subheader.with_quick_filter do + render(Primer::Alpha::SegmentedControl.new("aria-label": t(:label_filter_plural), full_width: false)) do |control| %> <% control.with_item(tag: :a, href: admin_cost_types_path(status: "active"), label: t(:label_active), @@ -52,18 +61,33 @@ See COPYRIGHT and LICENSE files for more details. href: admin_cost_types_path(status: "locked"), label: t("members.menu.locked"), selected: @status == "locked") %> - <% end %> - <% end %> + <% end + end - <% subheader.with_action_button( - scheme: :primary, - leading_icon: :plus, - label: I18n.t(:button_add_cost_type), - tag: :a, - href: new_admin_cost_type_path - ) do - CostType.model_name.human - end %> -<% end %> + # TODO - Remove with https://community.openproject.org/wp/75158 + subheader.with_filter_component do + render(Admin::CostTypes::FilterButtonComponent.new(query: @query)) + end + + subheader.with_action_button( + scheme: :primary, + leading_icon: :plus, + label: I18n.t(:button_add_cost_type), + tag: :a, + href: new_admin_cost_type_path + ) do + CostType.model_name.human + end + + subheader.with_bottom_pane_component do + render( + Admin::CostTypes::FiltersComponent.new( + query: @query, + initially_expanded: @query.filters.any? + ) + ) + end + end +%> <%= render(Admin::CostTypes::TableComponent.new(rows: @cost_types, status: @status)) %> diff --git a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb index a9a2b6a74d5..624609f9e07 100644 --- a/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb +++ b/modules/costs/spec/features/cost_types/delete_cost_type_spec.rb @@ -52,7 +52,7 @@ RSpec.describe "deleting a cost type", :js do expect(page).to have_css ".generic-table--empty-row", wait: 10 # Switch to the locked tab via the segmented control - click_on I18n.t(:label_locked) + click_on I18n.t("members.menu.locked") wait_for_network_idle From 40a2f5fbf2cae857da5833c0d49b178fcdd323e3 Mon Sep 17 00:00:00 2001 From: Mir Bhatia Date: Tue, 19 May 2026 14:08:57 +0200 Subject: [PATCH 115/381] Add query and quick filter for cost types index page --- .../admin/cost_types_controller.rb | 12 ++- .../costs/app/models/queries/cost_types.rb | 35 +++++++++ .../queries/cost_types/cost_type_query.rb | 42 +++++++++++ .../cost_types/filters/status_filter.rb | 75 +++++++++++++++++++ .../app/views/admin/cost_types/index.html.erb | 21 +++--- 5 files changed, 172 insertions(+), 13 deletions(-) create mode 100644 modules/costs/app/models/queries/cost_types.rb create mode 100644 modules/costs/app/models/queries/cost_types/cost_type_query.rb create mode 100644 modules/costs/app/models/queries/cost_types/filters/status_filter.rb diff --git a/modules/costs/app/controllers/admin/cost_types_controller.rb b/modules/costs/app/controllers/admin/cost_types_controller.rb index c57f0f475f6..d80a133991e 100644 --- a/modules/costs/app/controllers/admin/cost_types_controller.rb +++ b/modules/costs/app/controllers/admin/cost_types_controller.rb @@ -49,9 +49,9 @@ module Admin "unit_plural" => "#{CostType.table_name}.unit_plural" } sort_update sort_columns - @status = params[:status] == "locked" ? "locked" : "active" - @cost_types = (@status == "locked" ? CostType.where.not(deleted_at: nil) : CostType.active) - .order(sort_clause) + @query = load_query + @status = @query.find_active_filter(:status).values.first + @cost_types = @query.results.reorder(sort_clause) render action: "index", layout: !request.xhr? end @@ -144,6 +144,12 @@ module Admin private + def load_query + query = ParamsToQueryService.new(CostType, current_user).call(params) + query.where("status", "=", ["active"]) unless query.find_active_filter(:status) + query + end + def find_cost_type @cost_type = CostType.find(params[:id]) end diff --git a/modules/costs/app/models/queries/cost_types.rb b/modules/costs/app/models/queries/cost_types.rb new file mode 100644 index 00000000000..dd08ce6ef18 --- /dev/null +++ b/modules/costs/app/models/queries/cost_types.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Queries::CostTypes + ::Queries::Register.register(CostTypeQuery) do + filter Filters::StatusFilter + end +end diff --git a/modules/costs/app/models/queries/cost_types/cost_type_query.rb b/modules/costs/app/models/queries/cost_types/cost_type_query.rb new file mode 100644 index 00000000000..39d77ddc101 --- /dev/null +++ b/modules/costs/app/models/queries/cost_types/cost_type_query.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Queries::CostTypes::CostTypeQuery + include ::Queries::BaseQuery + include ::Queries::UnpersistedQuery + + def self.model + CostType + end + + def default_scope + CostType.all + end +end diff --git a/modules/costs/app/models/queries/cost_types/filters/status_filter.rb b/modules/costs/app/models/queries/cost_types/filters/status_filter.rb new file mode 100644 index 00000000000..66278804fe9 --- /dev/null +++ b/modules/costs/app/models/queries/cost_types/filters/status_filter.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +class Queries::CostTypes::Filters::StatusFilter < Queries::Filters::Base + ACTIVE_VALUE = "active" + LOCKED_VALUE = "locked" + + self.model = CostType + + validate :validate_single_value + + def allowed_values + [ + [I18n.t(:label_active), ACTIVE_VALUE], + [I18n.t("members.menu.locked"), LOCKED_VALUE] + ] + end + + def where + if values.first == LOCKED_VALUE + "cost_types.deleted_at IS NOT NULL" + else + "cost_types.deleted_at IS NULL" + end + end + + def human_name + I18n.t(:label_status) + end + + def type + :list + end + + def self.key + :status + end + + def available_operators + [::Queries::Operators::Equals] + end + + private + + def validate_single_value + errors.add(:values, :invalid) if values.length != 1 + end +end diff --git a/modules/costs/app/views/admin/cost_types/index.html.erb b/modules/costs/app/views/admin/cost_types/index.html.erb index f9b096f1381..5e50d700858 100644 --- a/modules/costs/app/views/admin/cost_types/index.html.erb +++ b/modules/costs/app/views/admin/cost_types/index.html.erb @@ -52,16 +52,17 @@ See COPYRIGHT and LICENSE files for more details. ) ) do |subheader| subheader.with_quick_filter do - render(Primer::Alpha::SegmentedControl.new("aria-label": t(:label_filter_plural), full_width: false)) do |control| %> - <% control.with_item(tag: :a, - href: admin_cost_types_path(status: "active"), - label: t(:label_active), - selected: @status == "active") %> - <% control.with_item(tag: :a, - href: admin_cost_types_path(status: "locked"), - label: t("members.menu.locked"), - selected: @status == "locked") %> - <% end + render( + OpPrimer::QuickFilter::SegmentedComponent.new( + name: t(:label_filter_plural), + query: @query, + filter_key: :status, + path_args: %i[admin cost_types] + ) + ) do |component| + component.with_item(label: t(:label_active), value: "active") + component.with_item(label: t("members.menu.locked"), value: "locked") + end end # TODO - Remove with https://community.openproject.org/wp/75158 From 1ba2dd2775cf2ee73aa419d690307fc9e95517d1 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 22:49:56 +0200 Subject: [PATCH 116/381] [#75314] Replace deprecated Pagy max_pages option Pagy 43.4.3 deprecated `:max_pages` and recommends capping records before pagination instead. Caps the combined array in `base_journals`. https://community.openproject.org/wp/75314 --- .../work_packages/activities_tab/paginator.rb | 10 ++++- .../activities_tab/paginator_spec.rb | 41 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/app/services/work_packages/activities_tab/paginator.rb b/app/services/work_packages/activities_tab/paginator.rb index 052a2256a08..7efccf5cb4c 100644 --- a/app/services/work_packages/activities_tab/paginator.rb +++ b/app/services/work_packages/activities_tab/paginator.rb @@ -52,6 +52,8 @@ class WorkPackages::ActivitiesTab::Paginator include Pagy::Method include WorkPackages::ActivitiesTab::JournalSortingInquirable + MAX_PAGES = 100 + def self.paginate(work_package, params = {}) new(work_package, params).call end @@ -72,7 +74,7 @@ class WorkPackages::ActivitiesTab::Paginator @filter = :all # Ignore filter when jumping to specific journal pagy_array_for_target_journal(anchor_type, target_record_id) else - pagy(:offset, base_journals, **pagy_options) + pagy(:offset, capped_journals, **pagy_options) end # For UI display: if user wants "oldest first" UI, reverse the array @@ -87,7 +89,6 @@ class WorkPackages::ActivitiesTab::Paginator { page: params[:page] || 1, limit: params[:limit] || Pagy::DEFAULT[:limit], - max_pages: 100, request: { params: } }.compact end @@ -127,6 +128,11 @@ class WorkPackages::ActivitiesTab::Paginator combine_and_sort_records(fetch_journals, fetch_revisions) end + def capped_journals + max_records = (params[:limit] || Pagy::DEFAULT[:limit]) * MAX_PAGES + base_journals.first(max_records) + end + def fetch_journals API::V3::Activities::ActivityEagerLoadingWrapper.wrap(fetch_ar_journals) end diff --git a/spec/services/work_packages/activities_tab/paginator_spec.rb b/spec/services/work_packages/activities_tab/paginator_spec.rb index 02de1178c8f..e6323340eb6 100644 --- a/spec/services/work_packages/activities_tab/paginator_spec.rb +++ b/spec/services/work_packages/activities_tab/paginator_spec.rb @@ -206,6 +206,47 @@ RSpec.describe WorkPackages::ActivitiesTab::Paginator, with_settings: { journal_ end end + context "when record count exceeds MAX_PAGES cap" do + let(:test_limit) { 2 } + + before do + stub_const("#{described_class}::MAX_PAGES", 3) + 8.times do |i| + create(:work_package_journal, user:, notes: "Comment #{i + 1}", journable: work_package, version: i + 2) + end + params[:limit] = test_limit + end + + it "caps total records to limit * MAX_PAGES" do + pagy, _records = paginator.call + + expect(pagy.count).to eq(test_limit * 3) + expect(pagy.pages).to eq(3) + end + + it "keeps the newest records when truncating" do + _pagy, records = paginator.call + + notes = records.map(&:notes) + expect(notes).to include("Comment 8") + expect(notes).not_to include("Comment 1") + end + + it "still resolves an anchor to a journal beyond the cap" do + oldest_journal = work_package.journals.order(:version).first + params[:anchor] = "comment-#{oldest_journal.id}" + pagy, records = paginator.call + + expect(records.map(&:id)).to include(oldest_journal.id) + + aggregate_failures "breaks out of capped limit" do + expect(pagy.count).to eq(work_package.journals.count) + expect(pagy.pages).to eq(5) + expect(pagy.page).to eq(5), "expected oldest journal on last page (page 5), got page #{pagy.page}" + end + end + end + context "with internal comments filtering" do let!(:internal_journal) do create(:work_package_journal, From 94c2a6bad5175d19b9a3285a2e7018633dee868e Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 22:50:02 +0200 Subject: [PATCH 117/381] Update Pagy initializer comments Removes deprecated `max_pages` and `client_max_limit` example options, replaces with current `max_limit` equivalent. Bumps version comment from 43.0.2 to 43.5.4. --- config/initializers/pagy.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 5b75b361c18..b7f0160cf35 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -28,7 +28,7 @@ # See COPYRIGHT and LICENSE files for more details. #++ -# Pagy initializer file (43.0.2) +# Pagy initializer file (43.5.4) # See https://ddnexus.github.io/pagy/resources/initializer/ ############ Global Options ################################################################ @@ -37,8 +37,7 @@ # For example: # # Pagy.options[:limit] = 10 # Limit the items per page -# Pagy.options[:client_max_limit] = 100 # The client can request a limit up to 100 -# Pagy.options[:max_pages] = 200 # Allow only 200 pages +# Pagy.options[:max_limit] = 100 # The client can request a limit up to 100 # Pagy.options[:jsonapi] = true # Use JSON:API compliant URLs ############ JavaScript #################################################################### From 9e4fdad36c4ed6d89e58d57d561ed69cd8107448 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:10 +0000 Subject: [PATCH 118/381] [#71661] Bump jQuery to 4.0.0 https://community.openproject.org/wp/71661 --- frontend/package-lock.json | 50 +++++++++++---------------------- frontend/package.json | 4 +-- frontend/src/typings/shims.d.ts | 1 - 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 33ad29cb669..24f13149e03 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -90,7 +90,7 @@ "hammerjs": "^2.0.8", "i18n-js": "^4.3.0", "idiomorph": "^0.7.4", - "jquery": "^3.7.1", + "jquery": "^4.0.0", "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", @@ -147,7 +147,7 @@ "@types/flot": "^0.0.36", "@types/hammerjs": "^2.0.36", "@types/hotwired__turbo": "^8.0.5", - "@types/jquery": "^3.5.33", + "@types/jquery": "^4.0.0", "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", @@ -9841,13 +9841,11 @@ } }, "node_modules/@types/jquery": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.33.tgz", - "integrity": "sha512-SeyVJXlCZpEki5F0ghuYe+L+PprQta6nRZqhONt9F13dWBtR/ftoaIbdRQ7cis7womE+X2LKhsDdDtkkDhJS6g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-Z+to+A2VkaHq1DfI2oSwsoCdhCHMpTSgjWzNcbNlRGYzksDBpPUgEcAL+RQjOBJRaLoEAOHXxqDGBVP+BblBwg==", "dev": true, - "dependencies": { - "@types/sizzle": "*" - } + "license": "MIT" }, "node_modules/@types/jqueryui": { "version": "1.12.24", @@ -10031,12 +10029,6 @@ "@types/node": "*" } }, - "node_modules/@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", - "dev": true - }, "node_modules/@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -17337,9 +17329,10 @@ } }, "node_modules/jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-TXCHVR3Lb6TZdtw1l3RTLf8RBWVGexdxL6AC8/e0xZKEpBflBsjh9/8LXw+dkNFuOyW9B7iB3O1sP7hS0Kiacg==", + "license": "MIT" }, "node_modules/jquery.caret": { "version": "0.3.1", @@ -31931,13 +31924,10 @@ } }, "@types/jquery": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.33.tgz", - "integrity": "sha512-SeyVJXlCZpEki5F0ghuYe+L+PprQta6nRZqhONt9F13dWBtR/ftoaIbdRQ7cis7womE+X2LKhsDdDtkkDhJS6g==", - "dev": true, - "requires": { - "@types/sizzle": "*" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-Z+to+A2VkaHq1DfI2oSwsoCdhCHMpTSgjWzNcbNlRGYzksDBpPUgEcAL+RQjOBJRaLoEAOHXxqDGBVP+BblBwg==", + "dev": true }, "@types/jqueryui": { "version": "1.12.24", @@ -32115,12 +32105,6 @@ } } }, - "@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", - "dev": true - }, "@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -37164,9 +37148,9 @@ "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==" }, "jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-4.0.0.tgz", + "integrity": "sha512-TXCHVR3Lb6TZdtw1l3RTLf8RBWVGexdxL6AC8/e0xZKEpBflBsjh9/8LXw+dkNFuOyW9B7iB3O1sP7hS0Kiacg==" }, "jquery.caret": { "version": "0.3.1", diff --git a/frontend/package.json b/frontend/package.json index acd1c25ea03..9cbb3300850 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,7 +25,7 @@ "@types/flot": "^0.0.36", "@types/hammerjs": "^2.0.36", "@types/hotwired__turbo": "^8.0.5", - "@types/jquery": "^3.5.33", + "@types/jquery": "^4.0.0", "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", @@ -141,7 +141,7 @@ "hammerjs": "^2.0.8", "i18n-js": "^4.3.0", "idiomorph": "^0.7.4", - "jquery": "^3.7.1", + "jquery": "^4.0.0", "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", diff --git a/frontend/src/typings/shims.d.ts b/frontend/src/typings/shims.d.ts index 6d5a1540d01..9a6278985ec 100644 --- a/frontend/src/typings/shims.d.ts +++ b/frontend/src/typings/shims.d.ts @@ -5,7 +5,6 @@ // Active issue // https://github.com/Microsoft/TypeScript/issues/10178 -/// /// /// /// From b770151b8d4221c68bdaac9ff321c9e8286e5e94 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:11 +0000 Subject: [PATCH 119/381] [#71661] Add jQuery Migrate plugin See https://jquery.com/upgrade-guide/4.0/ https://community.openproject.org/wp/71661 --- frontend/package-lock.json | 57 +++++++++++++++++++++- frontend/package.json | 2 + frontend/src/app/core/setup/init-jquery.ts | 1 + 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 24f13149e03..87e84d4f97b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -91,6 +91,7 @@ "i18n-js": "^4.3.0", "idiomorph": "^0.7.4", "jquery": "^4.0.0", + "jquery-migrate": "^4.0.2", "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", @@ -148,6 +149,7 @@ "@types/hammerjs": "^2.0.36", "@types/hotwired__turbo": "^8.0.5", "@types/jquery": "^4.0.0", + "@types/jquery-migrate": "^3.3.3", "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", @@ -9845,7 +9847,20 @@ "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-4.0.0.tgz", "integrity": "sha512-Z+to+A2VkaHq1DfI2oSwsoCdhCHMpTSgjWzNcbNlRGYzksDBpPUgEcAL+RQjOBJRaLoEAOHXxqDGBVP+BblBwg==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/jquery-migrate": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@types/jquery-migrate/-/jquery-migrate-3.3.3.tgz", + "integrity": "sha512-0CRPTHKGaK831+bxIbRerQpyLHwkNr/vSYZD5JAYpWw/TL2RUGiyWdwR8dAoGC4MpoyH5S+ato3+SyQDBmrZNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/jquery": "*" + } }, "node_modules/@types/jqueryui": { "version": "1.12.24", @@ -10029,6 +10044,12 @@ "@types/node": "*" } }, + "node_modules/@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "node_modules/@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -17334,6 +17355,15 @@ "integrity": "sha512-TXCHVR3Lb6TZdtw1l3RTLf8RBWVGexdxL6AC8/e0xZKEpBflBsjh9/8LXw+dkNFuOyW9B7iB3O1sP7hS0Kiacg==", "license": "MIT" }, + "node_modules/jquery-migrate": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-4.0.2.tgz", + "integrity": "sha512-J15ilpECoAsObLv2robklj0qf1qt9QCnZwwNcJAXkM7dIiOgcac2dqC3HgDtUF0fmRwKZa/ggTkxTj9S4Vk+HQ==", + "license": "MIT", + "peerDependencies": { + "jquery": ">=4 <5" + } + }, "node_modules/jquery.caret": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/jquery.caret/-/jquery.caret-0.3.1.tgz", @@ -31927,7 +31957,19 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-4.0.0.tgz", "integrity": "sha512-Z+to+A2VkaHq1DfI2oSwsoCdhCHMpTSgjWzNcbNlRGYzksDBpPUgEcAL+RQjOBJRaLoEAOHXxqDGBVP+BblBwg==", - "dev": true + "dev": true, + "requires": { + "@types/sizzle": "*" + } + }, + "@types/jquery-migrate": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@types/jquery-migrate/-/jquery-migrate-3.3.3.tgz", + "integrity": "sha512-0CRPTHKGaK831+bxIbRerQpyLHwkNr/vSYZD5JAYpWw/TL2RUGiyWdwR8dAoGC4MpoyH5S+ato3+SyQDBmrZNQ==", + "dev": true, + "requires": { + "@types/jquery": "*" + } }, "@types/jqueryui": { "version": "1.12.24", @@ -32105,6 +32147,12 @@ } } }, + "@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -37152,6 +37200,11 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-4.0.0.tgz", "integrity": "sha512-TXCHVR3Lb6TZdtw1l3RTLf8RBWVGexdxL6AC8/e0xZKEpBflBsjh9/8LXw+dkNFuOyW9B7iB3O1sP7hS0Kiacg==" }, + "jquery-migrate": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-4.0.2.tgz", + "integrity": "sha512-J15ilpECoAsObLv2robklj0qf1qt9QCnZwwNcJAXkM7dIiOgcac2dqC3HgDtUF0fmRwKZa/ggTkxTj9S4Vk+HQ==" + }, "jquery.caret": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/jquery.caret/-/jquery.caret-0.3.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 9cbb3300850..ddcdce9d79a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,6 +26,7 @@ "@types/hammerjs": "^2.0.36", "@types/hotwired__turbo": "^8.0.5", "@types/jquery": "^4.0.0", + "@types/jquery-migrate": "^3.3.3", "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", @@ -142,6 +143,7 @@ "i18n-js": "^4.3.0", "idiomorph": "^0.7.4", "jquery": "^4.0.0", + "jquery-migrate": "^4.0.2", "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", diff --git a/frontend/src/app/core/setup/init-jquery.ts b/frontend/src/app/core/setup/init-jquery.ts index 945ff1dd5d5..d992edc1ce7 100644 --- a/frontend/src/app/core/setup/init-jquery.ts +++ b/frontend/src/app/core/setup/init-jquery.ts @@ -27,6 +27,7 @@ //++ import jQuery from 'jquery'; +import 'jquery-migrate'; declare global { interface Window { From 855222a6317294e5a070880c116db6dafd3cb948 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:11 +0000 Subject: [PATCH 120/381] [#69633] Remove jQuery global Remove jQuery from global window scope in main application to enable incremental migration away from jQuery. - Removed global jQuery init from `init-vendors.ts` - Created local init-jquery modules for reporting that still require jQuery globals for legacy plugins - Updated TypeScript shims to declare `window.jQuery` as optional https://community.openproject.org/wp/69633 --- app/helpers/frontend_asset_helper.rb | 2 -- frontend/angular.json | 6 ------ .../app/core/{setup => setup-legacy}/init-jquery.ts | 11 +++++++++++ frontend/src/app/core/setup/init-vendors.ts | 8 -------- frontend/src/main.ts | 1 - .../controllers/dynamic/reporting/page.controller.ts | 1 + 6 files changed, 12 insertions(+), 17 deletions(-) rename frontend/src/app/core/{setup => setup-legacy}/init-jquery.ts (80%) diff --git a/app/helpers/frontend_asset_helper.rb b/app/helpers/frontend_asset_helper.rb index a8288a34c07..1c5396baefc 100644 --- a/app/helpers/frontend_asset_helper.rb +++ b/app/helpers/frontend_asset_helper.rb @@ -49,8 +49,6 @@ module FrontendAssetHelper # or referencing the running CLI proxy that hosts the assets in memory. def include_frontend_assets capture do - concat nonced_javascript_include_tag variable_asset_path("jquery.js"), skip_pipeline: true - %w(polyfills.js main.js).each do |file| concat nonced_javascript_include_tag variable_asset_path(file), skip_pipeline: true, type: "module" end diff --git a/frontend/angular.json b/frontend/angular.json index 0a5f664086c..874f7254f09 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -23,7 +23,6 @@ "moment-timezone", "observable-array", "dragula", - "jquery", "contra/emitter", "crossvent", "create-point-cb", @@ -73,11 +72,6 @@ } }, "scripts": [ - { - "input": "node_modules/jquery/dist/jquery.min.js", - "inject": false, - "bundleName": "jquery" - }, { "input": "node_modules/openapi-explorer/dist/browser/openapi-explorer.min.js", "inject": false, diff --git a/frontend/src/app/core/setup/init-jquery.ts b/frontend/src/app/core/setup-legacy/init-jquery.ts similarity index 80% rename from frontend/src/app/core/setup/init-jquery.ts rename to frontend/src/app/core/setup-legacy/init-jquery.ts index d992edc1ce7..96aab996fad 100644 --- a/frontend/src/app/core/setup/init-jquery.ts +++ b/frontend/src/app/core/setup-legacy/init-jquery.ts @@ -26,13 +26,24 @@ // See COPYRIGHT and LICENSE files for more details. //++ +/** + * Initialize jQuery 4 + jquery-migrate as globals for legacy code. + * + * This module sets up window.jQuery and window.$ for compatibility with + * legacy jQuery plugins (jquery-ui, tablesorter) that expect these globals. + * + * Import this BEFORE importing any jQuery-dependent libraries. + */ + import jQuery from 'jquery'; import 'jquery-migrate'; declare global { interface Window { jQuery:typeof jQuery; + $:typeof jQuery; } } window.jQuery = jQuery; +window.$ = jQuery; diff --git a/frontend/src/app/core/setup/init-vendors.ts b/frontend/src/app/core/setup/init-vendors.ts index 994eeda6774..8fcd012c4b9 100644 --- a/frontend/src/app/core/setup/init-vendors.ts +++ b/frontend/src/app/core/setup/init-vendors.ts @@ -33,14 +33,6 @@ // Lodash import lodash from 'lodash'; -// Jquery UI -// import 'jquery-ui/ui/position'; -// import 'jquery-ui/ui/disable-selection'; -// import 'jquery-ui/ui/widgets/sortable'; -// import 'jquery-ui/ui/widgets/dialog'; -// import 'jquery-ui/ui/widgets/tooltip'; -import 'core-vendor/jquery-ui-1.14.1/jquery-ui'; - import moment from 'moment'; import './init-moment-locales'; diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 30459af0604..d5a763220f5 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,7 +1,6 @@ import { OpenProjectModule } from 'core-app/app.module'; import { enableProdMode, provideZonelessChangeDetection } from '@angular/core'; -import 'core-app/core/setup/init-jquery'; import 'core-app/core/setup/init-js-patches'; import { initializeLocale } from 'core-app/core/setup/init-locale'; diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts index 6679d483a64..ee794e36edd 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts @@ -32,6 +32,7 @@ import { Controller } from '@hotwired/stimulus'; import { FetchRequestError, post, ValidationError } from 'core-stimulus/helpers/request-helpers'; import dragula from 'dragula'; import jQuery from 'jquery'; +import 'core-app/core/setup-legacy/init-jquery'; import 'tablesorter'; declare global { From e0894671a247db5f94574ed849ad3ed527ffdc63 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:11 +0000 Subject: [PATCH 121/381] Remove dead Compatibility module in Backlogs Delete the unused Backlogs compatibility module after the jQuery 4 migration made the old browser compatibility hook obsolete. --- .../open_project/backlogs/compatibility.rb | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 modules/backlogs/lib/open_project/backlogs/compatibility.rb diff --git a/modules/backlogs/lib/open_project/backlogs/compatibility.rb b/modules/backlogs/lib/open_project/backlogs/compatibility.rb deleted file mode 100644 index 552568a8374..00000000000 --- a/modules/backlogs/lib/open_project/backlogs/compatibility.rb +++ /dev/null @@ -1,38 +0,0 @@ -#-- copyright -# OpenProject is an open source project management software. -# Copyright (C) the OpenProject GmbH -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See COPYRIGHT and LICENSE files for more details. -#++ - -module OpenProject::Backlogs::Compatibility - def using_jquery? - OpenProject::Compatibility.respond_to?(:using_jquery?) and - OpenProject::Compatibility.using_jquery? - rescue NameError - false - end - - extend self -end From c150ef9d523c9e228b22fb574abed850800f71fc Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:12 +0000 Subject: [PATCH 122/381] Remove unused jQuery plugins Drop unused jquery.caret and jQuery mark.js imports and remove the vendored jQuery UI JavaScript and stylesheet assets. The remaining compatibility path only keeps globals for legacy plugins still loaded at runtime. --- frontend/angular.json | 3 - frontend/package-lock.json | 42 - frontend/package.json | 3 - .../src/app/core/setup-legacy/init-jquery.ts | 2 +- .../core/setup/globals/global-listeners.ts | 2 +- frontend/src/app/core/setup/init-vendors.ts | 5 - frontend/src/typings/shims.d.ts | 1 - .../src/vendor/jquery-ui-1.14.1/AUTHORS.txt | 384 - .../src/vendor/jquery-ui-1.14.1/LICENSE.txt | 43 - .../external/jquery/jquery.js | 10716 ---------------- .../images/ui-icons_444444_256x240.png | Bin 7107 -> 0 bytes .../images/ui-icons_555555_256x240.png | Bin 7105 -> 0 bytes .../images/ui-icons_777620_256x240.png | Bin 4615 -> 0 bytes .../images/ui-icons_777777_256x240.png | Bin 7115 -> 0 bytes .../images/ui-icons_cc0000_256x240.png | Bin 4615 -> 0 bytes .../images/ui-icons_ffffff_256x240.png | Bin 6395 -> 0 bytes .../src/vendor/jquery-ui-1.14.1/index.html | 396 - .../src/vendor/jquery-ui-1.14.1/jquery-ui.css | 833 -- .../src/vendor/jquery-ui-1.14.1/jquery-ui.js | 8352 ------------ .../vendor/jquery-ui-1.14.1/jquery-ui.min.css | 7 - .../vendor/jquery-ui-1.14.1/jquery-ui.min.js | 6 - .../jquery-ui-1.14.1/jquery-ui.structure.css | 411 - .../jquery-ui.structure.min.css | 5 - .../jquery-ui-1.14.1/jquery-ui.theme.css | 439 - .../jquery-ui-1.14.1/jquery-ui.theme.min.css | 5 - .../src/vendor/jquery-ui-1.14.1/package.json | 82 - 26 files changed, 2 insertions(+), 21735 deletions(-) delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/AUTHORS.txt delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/LICENSE.txt delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/external/jquery/jquery.js delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_444444_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_555555_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_777620_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_777777_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_cc0000_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/images/ui-icons_ffffff_256x240.png delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/index.html delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.js delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.js delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.min.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.min.css delete mode 100644 frontend/src/vendor/jquery-ui-1.14.1/package.json diff --git a/frontend/angular.json b/frontend/angular.json index 874f7254f09..d691aaf5b43 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -53,9 +53,6 @@ }, "src/styles.scss", "node_modules/codemirror/lib/codemirror.css", - "src/vendor/jquery-ui-1.14.1/jquery-ui.css", - "src/vendor/jquery-ui-1.14.1/jquery-ui.structure.css", - "src/vendor/jquery-ui-1.14.1/jquery-ui.theme.css", "node_modules/flatpickr/dist/flatpickr.min.css", "src/vendor/ckeditor/ckeditor.css" ], diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 87e84d4f97b..8eabf460789 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -92,12 +92,10 @@ "idiomorph": "^0.7.4", "jquery": "^4.0.0", "jquery-migrate": "^4.0.2", - "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", "lodash": "^4.18.1", "luxon": "^3.7.2", - "mark.js": "^8.11.0", "mdx-embed": "^1.1.2", "mime": "^4.1.0", "moment": "^2.30.1", @@ -150,7 +148,6 @@ "@types/hotwired__turbo": "^8.0.5", "@types/jquery": "^4.0.0", "@types/jquery-migrate": "^3.3.3", - "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", "@types/pako": "^2.0.4", @@ -9862,16 +9859,6 @@ "@types/jquery": "*" } }, - "node_modules/@types/jqueryui": { - "version": "1.12.24", - "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", - "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/jquery": "*" - } - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -17364,11 +17351,6 @@ "jquery": ">=4 <5" } }, - "node_modules/jquery.caret": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/jquery.caret/-/jquery.caret-0.3.1.tgz", - "integrity": "sha512-nS2mjMZzP4e4tIOgeTLSs+jFhUsUVZUPgkUMpi4DlJq9SgKEg6w2jf7q8joMJp6v+voJHXrH8rzAnbyxWHwAeA==" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -18333,11 +18315,6 @@ "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.3.0.tgz", "integrity": "sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==" }, - "node_modules/mark.js": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", - "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==" - }, "node_modules/markdown-it": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.1.tgz", @@ -31971,15 +31948,6 @@ "@types/jquery": "*" } }, - "@types/jqueryui": { - "version": "1.12.24", - "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.24.tgz", - "integrity": "sha512-E2sGULwzMhg4kAeOV+gYcXjg988RuPkviWCt09jLe6GGK9sHM7dTqS8H7JMuUWoZQBucIBzBAgM5o/ezKUFkeg==", - "dev": true, - "requires": { - "@types/jquery": "*" - } - }, "@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -37205,11 +37173,6 @@ "resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-4.0.2.tgz", "integrity": "sha512-J15ilpECoAsObLv2robklj0qf1qt9QCnZwwNcJAXkM7dIiOgcac2dqC3HgDtUF0fmRwKZa/ggTkxTj9S4Vk+HQ==" }, - "jquery.caret": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/jquery.caret/-/jquery.caret-0.3.1.tgz", - "integrity": "sha512-nS2mjMZzP4e4tIOgeTLSs+jFhUsUVZUPgkUMpi4DlJq9SgKEg6w2jf7q8joMJp6v+voJHXrH8rzAnbyxWHwAeA==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -37889,11 +37852,6 @@ "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.3.0.tgz", "integrity": "sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==" }, - "mark.js": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", - "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==" - }, "markdown-it": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index ddcdce9d79a..379e334a3e9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,7 +27,6 @@ "@types/hotwired__turbo": "^8.0.5", "@types/jquery": "^4.0.0", "@types/jquery-migrate": "^3.3.3", - "@types/jqueryui": "^1.12.24", "@types/lodash": "^4.17.23", "@types/mousetrap": "^1.6.3", "@types/pako": "^2.0.4", @@ -144,12 +143,10 @@ "idiomorph": "^0.7.4", "jquery": "^4.0.0", "jquery-migrate": "^4.0.2", - "jquery.caret": "^0.3.1", "json5": "^2.2.2", "lit-html": "^3.3.2", "lodash": "^4.18.1", "luxon": "^3.7.2", - "mark.js": "^8.11.0", "mdx-embed": "^1.1.2", "mime": "^4.1.0", "moment": "^2.30.1", diff --git a/frontend/src/app/core/setup-legacy/init-jquery.ts b/frontend/src/app/core/setup-legacy/init-jquery.ts index 96aab996fad..7654e73d559 100644 --- a/frontend/src/app/core/setup-legacy/init-jquery.ts +++ b/frontend/src/app/core/setup-legacy/init-jquery.ts @@ -30,7 +30,7 @@ * Initialize jQuery 4 + jquery-migrate as globals for legacy code. * * This module sets up window.jQuery and window.$ for compatibility with - * legacy jQuery plugins (jquery-ui, tablesorter) that expect these globals. + * legacy jQuery plugins (tablesorter) that expect these globals. * * Import this BEFORE importing any jQuery-dependent libraries. */ diff --git a/frontend/src/app/core/setup/globals/global-listeners.ts b/frontend/src/app/core/setup/globals/global-listeners.ts index 7b11efdf24c..3212fe5d0dd 100644 --- a/frontend/src/app/core/setup/globals/global-listeners.ts +++ b/frontend/src/app/core/setup/globals/global-listeners.ts @@ -57,7 +57,7 @@ export function initializeGlobalListeners():void { } // Prevent angular handling clicks on href="#..." links from other libraries - // (especially jquery-ui and its datepicker) from routing to /# + // from routing to /# if (performAnchorHijacking(evt, linkElement)) { evt.preventDefault(); } diff --git a/frontend/src/app/core/setup/init-vendors.ts b/frontend/src/app/core/setup/init-vendors.ts index 8fcd012c4b9..e22dbf32f04 100644 --- a/frontend/src/app/core/setup/init-vendors.ts +++ b/frontend/src/app/core/setup/init-vendors.ts @@ -36,12 +36,7 @@ import lodash from 'lodash'; import moment from 'moment'; import './init-moment-locales'; -import 'jquery.caret'; -// Text highlight for autocompleter -import 'mark.js/dist/jquery.mark.min'; - import 'moment-timezone/builds/moment-timezone-with-data.min'; -// eslint-disable-next-line import/extensions,import/no-extraneous-dependencies import '@openproject/primer-view-components/app/assets/javascripts/primer_view_components.js'; import URI from 'urijs'; diff --git a/frontend/src/typings/shims.d.ts b/frontend/src/typings/shims.d.ts index 9a6278985ec..dc319ec8fa3 100644 --- a/frontend/src/typings/shims.d.ts +++ b/frontend/src/typings/shims.d.ts @@ -5,7 +5,6 @@ // Active issue // https://github.com/Microsoft/TypeScript/issues/10178 -/// /// /// /// diff --git a/frontend/src/vendor/jquery-ui-1.14.1/AUTHORS.txt b/frontend/src/vendor/jquery-ui-1.14.1/AUTHORS.txt deleted file mode 100644 index b855d39997e..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/AUTHORS.txt +++ /dev/null @@ -1,384 +0,0 @@ -Authors ordered by first contribution -A list of current team members is available at https://jqueryui.com/about - -Paul Bakaus -Richard Worth -Yehuda Katz -Sean Catchpole -John Resig -Tane Piper -Dmitri Gaskin -Klaus Hartl -Stefan Petre -Gilles van den Hoven -Micheil Bryan Smith -Jörn Zaefferer -Marc Grabanski -Keith Wood -Brandon Aaron -Scott González -Eduardo Lundgren -Aaron Eisenberger -Joan Piedra -Bruno Basto -Remy Sharp -Bohdan Ganicky -David Bolter -Chi Cheng -Ca-Phun Ung -Ariel Flesler -Maggie Wachs -Scott Jehl -Todd Parker -Andrew Powell -Brant Burnett -Douglas Neiner -Paul Irish -Ralph Whitbeck -Thibault Duplessis -Dominique Vincent -Jack Hsu -Adam Sontag -Carl Fürstenberg -Kevin Dalman -Alberto Fernández Capel -Jacek Jędrzejewski (https://jacek.jedrzejewski.name) -Ting Kuei -Samuel Cormier-Iijima -Jon Palmer -Ben Hollis -Justin MacCarthy -Eyal Kobrigo -Tiago Freire -Diego Tres -Holger Rüprich -Ziling Zhao -Mike Alsup -Robson Braga Araujo -Pierre-Henri Ausseil -Christopher McCulloh -Andrew Newcomb -Lim Chee Aun -Jorge Barreiro -Daniel Steigerwald -John Firebaugh -John Enters -Andrey Kapitcyn -Dmitry Petrov -Eric Hynds -Chairat Sunthornwiphat -Josh Varner -Stéphane Raimbault -Jay Merrifield -J. Ryan Stinnett -Peter Heiberg -Alex Dovenmuehle -Jamie Gegerson -Raymond Schwartz -Phillip Barnes -Kyle Wilkinson -Khaled AlHourani -Marian Rudzynski -Jean-Francois Remy -Doug Blood -Filippo Cavallarin -Heiko Henning -Aliaksandr Rahalevich -Mario Visic -Xavi Ramirez -Max Schnur -Saji Nediyanchath -Corey Frang -Aaron Peterson -Ivan Peters -Mohamed Cherif Bouchelaghem -Marcos Sousa -Michael DellaNoce -George Marshall -Tobias Brunner -Martin Solli -David Petersen -Dan Heberden -William Kevin Manire -Gilmore Davidson -Michael Wu -Adam Parod -Guillaume Gautreau -Marcel Toele -Dan Streetman -Matt Hoskins -Giovanni Giacobbi -Kyle Florence -Pavol Hluchý -Hans Hillen -Mark Johnson -Trey Hunner -Shane Whittet -Edward A Faulkner -Adam Baratz -Kato Kazuyoshi -Eike Send -Kris Borchers -Eddie Monge -Israel Tsadok -Carson McDonald -Jason Davies -Garrison Locke -David Murdoch -Benjamin Scott Boyle -Jesse Baird -Jonathan Vingiano -Dylan Just -Hiroshi Tomita -Glenn Goodrich -Tarafder Ashek-E-Elahi -Ryan Neufeld -Marc Neuwirth -Philip Graham -Benjamin Sterling -Wesley Walser -Kouhei Sutou -Karl Kirch -Chris Kelly -Jason Oster -Felix Nagel -Alexander Polomoshnov -David Leal -Igor Milla -Dave Methvin -Florian Gutmann -Marwan Al Jubeh -Milan Broum -Sebastian Sauer -Gaëtan Muller -Michel Weimerskirch -William Griffiths -Stojce Slavkovski -David Soms -David De Sloovere -Michael P. Jung -Shannon Pekary -Dan Wellman -Matthew Edward Hutton -James Khoury -Rob Loach -Alberto Monteiro -Alex Rhea -Krzysztof Rosiński -Ryan Olton -Genie <386@mail.com> -Rick Waldron -Ian Simpson -Lev Kitsis -TJ VanToll -Justin Domnitz -Douglas Cerna -Bert ter Heide -Jasvir Nagra -Yuriy Khabarov <13real008@gmail.com> -Harri Kilpiö -Lado Lomidze -Amir E. Aharoni -Simon Sattes -Jo Liss -Guntupalli Karunakar -Shahyar Ghobadpour -Lukasz Lipinski -Timo Tijhof -Jason Moon -Martin Frost -Eneko Illarramendi -EungJun Yi -Courtland Allen -Viktar Varvanovich -Danny Trunk -Pavel Stetina -Michael Stay -Steven Roussey -Michael Hollis -Lee Rowlands -Timmy Willison -Karl Swedberg -Baoju Yuan -Maciej Mroziński -Luis Dalmolin -Mark Aaron Shirley -Martin Hoch -Jiayi Yang -Philipp Benjamin Köppchen -Sindre Sorhus -Bernhard Sirlinger -Jared A. Scheel -Rafael Xavier de Souza -John Chen -Robert Beuligmann -Dale Kocian -Mike Sherov -Andrew Couch -Marc-Andre Lafortune -Nate Eagle -David Souther -Mathias Stenbom -Sergey Kartashov -Avinash R -Ethan Romba -Cory Gackenheimer -Juan Pablo Kaniefsky -Roman Salnikov -Anika Henke -Samuel Bovée -Fabrício Matté -Viktor Kojouharov -Pawel Maruszczyk (http://hrabstwo.net) -Pavel Selitskas -Bjørn Johansen -Matthieu Penant -Dominic Barnes -David Sullivan -Thomas Jaggi -Vahid Sohrabloo -Travis Carden -Bruno M. Custódio -Nathanael Silverman -Christian Wenz -Steve Urmston -Zaven Muradyan -Woody Gilk -Zbigniew Motyka -Suhail Alkowaileet -Toshi MARUYAMA -David Hansen -Brian Grinstead -Christian Klammer -Steven Luscher -Gan Eng Chin -Gabriel Schulhof -Alexander Schmitz -Vilhjálmur Skúlason -Siebrand Mazeland -Mohsen Ekhtiari -Pere Orga -Jasper de Groot -Stephane Deschamps -Jyoti Deka -Andrei Picus -Ondrej Novy -Jacob McCutcheon -Monika Piotrowicz -Imants Horsts -Eric Dahl -Dave Stein -Dylan Barrell -Daniel DeGroff -Michael Wiencek -Thomas Meyer -Ruslan Yakhyaev -Brian J. Dowling -Ben Higgins -Yermo Lamers -Patrick Stapleton -Trisha Crowley -Usman Akeju -Rodrigo Menezes -Jacques Perrault -Frederik Elvhage -Will Holley -Uri Gilad -Richard Gibson -Simen Bekkhus -Chen Eshchar -Bruno Pérel -Mohammed Alshehri -Lisa Seacat DeLuca -Anne-Gaelle Colom -Adam Foster -Luke Page -Daniel Owens -Michael Orchard -Marcus Warren -Nils Heuermann -Marco Ziech -Patricia Juarez -Ben Mosher -Ablay Keldibek -Thomas Applencourt -Jiabao Wu -Eric Lee Carraway -Victor Homyakov -Myeongjin Lee -Liran Sharir -Weston Ruter -Mani Mishra -Hannah Methvin -Leonardo Balter -Benjamin Albert -Michał Gołębiowski-Owczarek -Alyosha Pushak -Fahad Ahmad -Matt Brundage -Francesc Baeta -Piotr Baran -Mukul Hase -Konstantin Dinev -Rand Scullard -Dan Strohl -Maksim Ryzhikov -Amine HADDAD -Amanpreet Singh -Alexey Balchunas -Peter Kehl -Peter Dave Hello -Johannes Schäfer -Ville Skyttä -Ryan Oriecuia -Sergei Ratnikov -milk54 -Evelyn Masso -Robin -Simon Asika -Kevin Cupp -Jeremy Mickelson -Kyle Rosenberg -Petri Partio -pallxk -Luke Brookhart -claudi -Eirik Sletteberg -Albert Johansson -A. Wells -Robert Brignull -Horus68 -Maksymenkov Eugene -OskarNS -Gez Quinn -jigar gala -Florian Wegscheider -Fatér Zsolt -Szabolcs Szabolcsi-Toth -Jérémy Munsch -Hrvoje Novosel -Paul Capron -Micah Miller -sakshi87 <53863764+sakshi87@users.noreply.github.com> -Mikolaj Wolicki -Patrick McKay -c-lambert <58025159+c-lambert@users.noreply.github.com> -Josep Sanz -Ben Mullins -Christian Oliff -dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Adam Lidén Hällgren -James Hinderks -Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> -Matías Cánepa -Ashish Kurmi <100655670+boahc077@users.noreply.github.com> -DeerBear -Дилян Палаузов -Kenneth DeBacker -Timo Tijhof -Timmy Willison -divdeploy <166095818+divdeploy@users.noreply.github.com> -mark van tilburg -Ralf Koller <1665422+rpkoller@users.noreply.github.com> -Porter Clevidence <116387727+porterclev@users.noreply.github.com> -Daniel García <93217193+Daniel-Garmig@users.noreply.github.com> diff --git a/frontend/src/vendor/jquery-ui-1.14.1/LICENSE.txt b/frontend/src/vendor/jquery-ui-1.14.1/LICENSE.txt deleted file mode 100644 index 78108290c40..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/LICENSE.txt +++ /dev/null @@ -1,43 +0,0 @@ -Copyright OpenJS Foundation and other contributors, https://openjsf.org/ - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/jquery/jquery-ui - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code contained within the demos directory. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -All files located in the node_modules and external directories are -externally maintained libraries used by this software which have their -own licenses; we recommend you read them, as their terms may differ from -the terms above. diff --git a/frontend/src/vendor/jquery-ui-1.14.1/external/jquery/jquery.js b/frontend/src/vendor/jquery-ui-1.14.1/external/jquery/jquery.js deleted file mode 100644 index 1a86433c223..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/external/jquery/jquery.js +++ /dev/null @@ -1,10716 +0,0 @@ -/*! - * jQuery JavaScript Library v3.7.1 - * https://jquery.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2023-08-28T13:37Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket trac-14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var version = "3.7.1", - - rhtmlSuffix = /HTML$/i, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - - // Retrieve the text value of an array of DOM nodes - text: function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += jQuery.text( node ); - } - } - if ( nodeType === 1 || nodeType === 11 ) { - return elem.textContent; - } - if ( nodeType === 9 ) { - return elem.documentElement.textContent; - } - if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - isXMLDoc: function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Assume HTML when documentElement doesn't yet exist, such as inside - // document fragments. - return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var pop = arr.pop; - - -var sort = arr.sort; - - -var splice = arr.splice; - - -var whitespace = "[\\x20\\t\\r\\n\\f]"; - - -var rtrimCSS = new RegExp( - "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", - "g" -); - - - - -// Note: an element does not contain itself -jQuery.contains = function( a, b ) { - var bup = b && b.parentNode; - - return a === bup || !!( bup && bup.nodeType === 1 && ( - - // Support: IE 9 - 11+ - // IE doesn't have `contains` on SVG. - a.contains ? - a.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); -}; - - - - -// CSS string/identifier serialization -// https://drafts.csswg.org/cssom/#common-serializing-idioms -var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; - -function fcssescape( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; -} - -jQuery.escapeSelector = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - - - - -var preferredDoc = document, - pushNative = push; - -( function() { - -var i, - Expr, - outermostContext, - sortInput, - hasDuplicate, - push = pushNative, - - // Local document vars - document, - documentElement, - documentIsHTML, - rbuggyQSA, - matches, - - // Instance-specific data - expando = jQuery.expando, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + - "loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + - whitespace + "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - ID: new RegExp( "^#(" + identifier + ")" ), - CLASS: new RegExp( "^\\.(" + identifier + ")" ), - TAG: new RegExp( "^(" + identifier + "|[*])" ), - ATTR: new RegExp( "^" + attributes ), - PSEUDO: new RegExp( "^" + pseudos ), - CHILD: new RegExp( - "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - bool: new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - needsContext: new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - if ( nonHex ) { - - // Strip the backslash prefix from a non-hex escape sequence - return nonHex; - } - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - return high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // Used for iframes; see `setDocument`. - // Support: IE 9 - 11+, Edge 12 - 18+ - // Removing the function wrapper causes a "Permission Denied" - // error in IE/Edge. - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && nodeName( elem, "fieldset" ); - }, - { dir: "parentNode", next: "legend" } - ); - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android <=4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { - apply: function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - }, - call: function( target ) { - pushNative.apply( target, slice.call( arguments, 1 ) ); - } - }; -} - -function find( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE 9 only - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - push.call( results, elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE 9 only - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - find.contains( context, elem ) && - elem.id === m ) { - - push.call( results, elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when - // strict-comparing two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( newContext != context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = jQuery.escapeSelector( nid ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties - // (see https://github.com/jquery/sizzle/issues/157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by jQuery selector module - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - return nodeName( elem, "input" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && - elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11+ - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a jQuery selector context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [node] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -function setDocument( node ) { - var subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - documentElement = document.documentElement; - documentIsHTML = !jQuery.isXMLDoc( document ); - - // Support: iOS 7 only, IE 9 - 11+ - // Older browsers didn't support unprefixed `matches`. - matches = documentElement.matches || - documentElement.webkitMatchesSelector || - documentElement.msMatchesSelector; - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors - // (see trac-13936). - // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, - // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. - if ( documentElement.msMatchesSelector && - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 9 - 11+, Edge 12 - 18+ - subWindow.addEventListener( "unload", unloadHandler ); - } - - // Support: IE <10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - documentElement.appendChild( el ).id = jQuery.expando; - return !document.getElementsByName || - !document.getElementsByName( jQuery.expando ).length; - } ); - - // Support: IE 9 only - // Check to see if it's possible to do matchesSelector - // on a disconnected node. - support.disconnectedMatch = assert( function( el ) { - return matches.call( el, "*" ); - } ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // IE/Edge don't support the :scope pseudo-class. - support.scope = assert( function() { - return document.querySelectorAll( ":scope" ); - } ); - - // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only - // Make sure the `:has()` argument is parsed unforgivingly. - // We include `*` in the test to detect buggy implementations that are - // _selectively_ forgiving (specifically when the list includes at least - // one valid selector). - // Note that we treat complete lack of support for `:has()` as if it were - // spec-compliant support, which is fine because use of `:has()` in such - // environments will fail in the qSA path and fall back to jQuery traversal - // anyway. - support.cssHas = assert( function() { - try { - document.querySelector( ":has(*,:jqfake)" ); - return false; - } catch ( e ) { - return true; - } - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter.ID = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find.ID = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter.ID = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find.ID = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find.TAG = function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else { - return context.querySelectorAll( tag ); - } - }; - - // Class - Expr.find.CLASS = function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - rbuggyQSA = []; - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - documentElement.appendChild( el ).innerHTML = - "" + - ""; - - // Support: iOS <=7 - 8 only - // Boolean attributes and "value" are not treated correctly in some XML documents - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: iOS <=7 - 8 only - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: iOS 8 only - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ - // In some of the document kinds, these selectors wouldn't work natively. - // This is probably OK but for backwards compatibility we want to maintain - // handling them through jQuery traversal in jQuery 3.x. - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE 9 - 11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ - // In some of the document kinds, these selectors wouldn't work natively. - // This is probably OK but for backwards compatibility we want to maintain - // handling them through jQuery traversal in jQuery 3.x. - documentElement.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - } ); - - if ( !support.cssHas ) { - - // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ - // Our regular `try-catch` mechanism fails to detect natively-unsupported - // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) - // in browsers that parse the `:has()` argument as a forgiving selector list. - // https://drafts.csswg.org/selectors/#relational now requires the argument - // to be parsed unforgivingly, but browsers have not yet fully adjusted. - rbuggyQSA.push( ":has" ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a === document || a.ownerDocument == preferredDoc && - find.contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b === document || b.ownerDocument == preferredDoc && - find.contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - }; - - return document; -} - -find.matches = function( expr, elements ) { - return find( expr, null, null, elements ); -}; - -find.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return find( expr, document, null, [ elem ] ).length > 0; -}; - -find.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return jQuery.contains( context, elem ); -}; - - -find.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (see trac-13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - if ( val !== undefined ) { - return val; - } - - return elem.getAttribute( name ); -}; - -find.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -jQuery.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - // - // Support: Android <=4.0+ - // Testing for detecting duplicates is unpredictable so instead assume we can't - // depend on duplicate detection in all browsers without a stable sort. - hasDuplicate = !support.sortStable; - sortInput = !support.sortStable && slice.call( results, 0 ); - sort.call( results, sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - splice.call( results, duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -jQuery.fn.uniqueSort = function() { - return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); -}; - -Expr = jQuery.expr = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - ATTR: function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) - .replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - CHILD: function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - find.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) - ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - find.error( match[ 0 ] ); - } - - return match; - }, - - PSEUDO: function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr.CHILD.test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - TAG: function( nodeNameSelector ) { - var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return nodeName( elem, expectedNodeName ); - }; - }, - - CLASS: function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + ")" + className + - "(" + whitespace + "|$)" ) ) && - classCache( className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - ATTR: function( name, operator, check ) { - return function( elem ) { - var result = find.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - if ( operator === "=" ) { - return result === check; - } - if ( operator === "!=" ) { - return result !== check; - } - if ( operator === "^=" ) { - return check && result.indexOf( check ) === 0; - } - if ( operator === "*=" ) { - return check && result.indexOf( check ) > -1; - } - if ( operator === "$=" ) { - return check && result.slice( -check.length ) === check; - } - if ( operator === "~=" ) { - return ( " " + result.replace( rwhitespace, " " ) + " " ) - .indexOf( check ) > -1; - } - if ( operator === "|=" ) { - return result === check || result.slice( 0, check.length + 1 ) === check + "-"; - } - - return false; - }; - }, - - CHILD: function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - nodeName( node, name ) : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || ( parent[ expando ] = {} ); - cache = outerCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - cache = outerCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - nodeName( node, name ) : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - outerCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - PSEUDO: function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // https://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - find.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as jQuery does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - not: markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrimCSS, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element - // (see https://github.com/jquery/sizzle/issues/299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - has: markFunction( function( selector ) { - return function( elem ) { - return find( selector, elem ).length > 0; - }; - } ), - - contains: markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // https://www.w3.org/TR/selectors/#lang-pseudo - lang: markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - find.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - target: function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - root: function( elem ) { - return elem === documentElement; - }, - - focus: function( elem ) { - return elem === safeActiveElement() && - document.hasFocus() && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - enabled: createDisabledPseudo( false ), - disabled: createDisabledPseudo( true ), - - checked: function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - return ( nodeName( elem, "input" ) && !!elem.checked ) || - ( nodeName( elem, "option" ) && !!elem.selected ); - }, - - selected: function( elem ) { - - // Support: IE <=11+ - // Accessing the selectedIndex property - // forces the browser to treat the default option as - // selected when in an optgroup. - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - empty: function( elem ) { - - // https://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - parent: function( elem ) { - return !Expr.pseudos.empty( elem ); - }, - - // Element/input types - header: function( elem ) { - return rheader.test( elem.nodeName ); - }, - - input: function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - button: function( elem ) { - return nodeName( elem, "input" ) && elem.type === "button" || - nodeName( elem, "button" ); - }, - - text: function( elem ) { - var attr; - return nodeName( elem, "input" ) && elem.type === "text" && - - // Support: IE <10 only - // New HTML5 attribute values (e.g., "search") appear - // with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - first: createPositionalPseudo( function() { - return [ 0 ]; - } ), - - last: createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - even: createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - odd: createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - lt: createPositionalPseudo( function( matchIndexes, length, argument ) { - var i; - - if ( argument < 0 ) { - i = argument + length; - } else if ( argument > length ) { - i = length; - } else { - i = argument; - } - - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - gt: createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos.nth = Expr.pseudos.eq; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rleadingCombinator.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrimCSS, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - if ( parseOnly ) { - return soFar.length; - } - - return soFar ? - find.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - if ( skip && nodeName( elem, skip ) ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = outerCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - outerCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - find( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, matcherOut, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || - multipleContexts( selector || "*", - context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems; - - if ( matcher ) { - - // If we have a postFinder, or filtered seed, or non-seed postFilter - // or preexisting results, - matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results; - - // Find primary matches - matcher( matcherIn, matcherOut, context, xml ); - } else { - matcherOut = matcherIn; - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element - // (see https://github.com/jquery/sizzle/issues/299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrimCSS, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find.TAG( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: iOS <=7 - 9 only - // Tolerate NodeList properties (IE: "length"; Safari: ) matching - // elements by id. (see trac-14142) - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - push.call( results, elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - jQuery.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -function compile( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -} - -/** - * A low-level selection function that works with jQuery's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with jQuery selector compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find.ID( - token.matches[ 0 ].replace( runescape, funescape ), - context - ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && - testContext( context.parentNode ) || context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -} - -// One-time assignments - -// Support: Android <=4.0 - 4.1+ -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Initialize against the default document -setDocument(); - -// Support: Android <=4.0 - 4.1+ -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -jQuery.find = find; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.unique = jQuery.uniqueSort; - -// These have always been private, but they used to be documented as part of -// Sizzle so let's maintain them for now for backwards compatibility purposes. -find.compile = compile; -find.select = select; -find.setDocument = setDocument; -find.tokenize = tokenize; - -find.escape = jQuery.escapeSelector; -find.getText = jQuery.text; -find.isXML = jQuery.isXMLDoc; -find.selectors = jQuery.expr; -find.support = jQuery.support; -find.uniqueSort = jQuery.uniqueSort; - - /* eslint-enable */ - -} )(); - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (trac-9521) - // Strict HTML recognition (trac-11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to jQuery#find - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.error ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the error, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getErrorHook ) { - process.error = jQuery.Deferred.getErrorHook(); - - // The deprecated alias of the above. While the name suggests - // returning the stack, not an error instance, jQuery just passes - // it directly to `console.warn` so both will work; an instance - // just better cooperates with source maps. - } else if ( jQuery.Deferred.getStackHook ) { - process.error = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error -// captured before the async barrier to get the original error cause -// which may otherwise be hidden. -jQuery.Deferred.exceptionHook = function( error, asyncError ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, - error.stack, asyncError ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See trac-6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (trac-9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see trac-8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (trac-14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (trac-11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (trac-14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (trac-13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (trac-12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (trac-13208) - // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (trac-13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", true ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, isSetup ) { - - // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add - if ( !isSetup ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - if ( !saved ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - this[ type ](); - result = dataPriv.get( this, type ); - dataPriv.set( this, type, false ); - - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - return result; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering - // the native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved ) { - - // ...and capture the result - dataPriv.set( this, type, jQuery.event.trigger( - saved[ 0 ], - saved.slice( 1 ), - this - ) ); - - // Abort handling of the native event by all jQuery handlers while allowing - // native handlers on the same element to run. On target, this is achieved - // by stopping immediate propagation just on the jQuery event. However, - // the native event is re-wrapped by a jQuery one on each level of the - // propagation so the only way to stop it for jQuery is to stop it for - // everyone via native `stopPropagation()`. This is not a problem for - // focus/blur which don't bubble, but it does also stop click on checkboxes - // and radios. We accept this limitation. - event.stopPropagation(); - event.isImmediatePropagationStopped = returnTrue; - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (trac-504, trac-13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - - function focusMappedHandler( nativeEvent ) { - if ( document.documentMode ) { - - // Support: IE 11+ - // Attach a single focusin/focusout handler on the document while someone wants - // focus/blur. This is because the former are synchronous in IE while the latter - // are async. In other browsers, all those handlers are invoked synchronously. - - // `handle` from private data would already wrap the event, but we need - // to change the `type` here. - var handle = dataPriv.get( this, "handle" ), - event = jQuery.event.fix( nativeEvent ); - event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; - event.isSimulated = true; - - // First, handle focusin/focusout - handle( nativeEvent ); - - // ...then, handle focus/blur - // - // focus/blur don't bubble while focusin/focusout do; simulate the former by only - // invoking the handler at the lower level. - if ( event.target === event.currentTarget ) { - - // The setup part calls `leverageNative`, which, in turn, calls - // `jQuery.event.add`, so event handle will already have been set - // by this point. - handle( event ); - } - } else { - - // For non-IE browsers, attach a single capturing handler on the document - // while someone wants focusin/focusout. - jQuery.event.simulate( delegateType, nativeEvent.target, - jQuery.event.fix( nativeEvent ) ); - } - } - - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - var attaches; - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, true ); - - if ( document.documentMode ) { - - // Support: IE 9 - 11+ - // We use the same native handler for focusin & focus (and focusout & blur) - // so we need to coordinate setup & teardown parts between those events. - // Use `delegateType` as the key as `type` is already used by `leverageNative`. - attaches = dataPriv.get( this, delegateType ); - if ( !attaches ) { - this.addEventListener( delegateType, focusMappedHandler ); - } - dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); - } else { - - // Return false to allow normal processing in the caller - return false; - } - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - teardown: function() { - var attaches; - - if ( document.documentMode ) { - attaches = dataPriv.get( this, delegateType ) - 1; - if ( !attaches ) { - this.removeEventListener( delegateType, focusMappedHandler ); - dataPriv.remove( this, delegateType ); - } else { - dataPriv.set( this, delegateType, attaches ); - } - } else { - - // Return false to indicate standard teardown should be applied - return false; - } - }, - - // Suppress native focus or blur if we're currently inside - // a leveraged native-event stack - _default: function( event ) { - return dataPriv.get( event.target, type ); - }, - - delegateType: delegateType - }; - - // Support: Firefox <=44 - // Firefox doesn't have focus(in | out) events - // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 - // - // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 - // focus(in | out) events fire after focus & blur events, - // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order - // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 - // - // Support: IE 9 - 11+ - // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, - // attach a single handler for both events in IE. - jQuery.event.special[ delegateType ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - dataHolder = document.documentMode ? this : doc, - attaches = dataPriv.get( dataHolder, delegateType ); - - // Support: IE 9 - 11+ - // We use the same native handler for focusin & focus (and focusout & blur) - // so we need to coordinate setup & teardown parts between those events. - // Use `delegateType` as the key as `type` is already used by `leverageNative`. - if ( !attaches ) { - if ( document.documentMode ) { - this.addEventListener( delegateType, focusMappedHandler ); - } else { - doc.addEventListener( type, focusMappedHandler, true ); - } - } - dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - dataHolder = document.documentMode ? this : doc, - attaches = dataPriv.get( dataHolder, delegateType ) - 1; - - if ( !attaches ) { - if ( document.documentMode ) { - this.removeEventListener( delegateType, focusMappedHandler ); - } else { - doc.removeEventListener( type, focusMappedHandler, true ); - } - dataPriv.remove( dataHolder, delegateType ); - } else { - dataPriv.set( dataHolder, delegateType, attaches ); - } - } - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (trac-8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Re-enable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - - // Unwrap a CDATA section containing script contents. This shouldn't be - // needed as in XML documents they're already not visible when - // inspecting element contents and in HTML documents they have no - // meaning but we're preserving that logic for backwards compatibility. - // This will be removed completely in 4.0. See gh-4904. - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew jQuery#find here for performance reasons: - // https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var rcustomProp = /^--/; - - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (trac-8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "box-sizing:content-box;border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is `display: block` - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - isCustomProp = rcustomProp.test( name ), - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, trac-12537) - // .css('--customProperty) (gh-3144) - if ( computed ) { - - // Support: IE <=9 - 11+ - // IE only supports `"float"` in `getPropertyValue`; in computed styles - // it's only available as `"cssFloat"`. We no longer modify properties - // sent to `.css()` apart from camelCasing, so we need to check both. - // Normally, this would create difference in behavior: if - // `getPropertyValue` returns an empty string, the value returned - // by `.css()` would be `undefined`. This is usually the case for - // disconnected elements. However, in IE even disconnected elements - // with no styles return `"none"` for `getPropertyValue( "float" )` - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( isCustomProp && ret ) { - - // Support: Firefox 105+, Chrome <=105+ - // Spec requires trimming whitespace for custom properties (gh-4926). - // Firefox only trims leading whitespace. Chrome just collapses - // both leading & trailing whitespace to a single space. - // - // Fall back to `undefined` if empty string returned. - // This collapses a missing definition with property defined - // and set to an empty string but there's no standard API - // allowing us to differentiate them without a performance penalty - // and returning `undefined` aligns with older jQuery. - // - // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED - // as whitespace while CSS does not, but this is not a problem - // because CSS preprocessing replaces them with U+000A LINE FEED - // (which *is* CSS whitespace) - // https://www.w3.org/TR/css-syntax-3/#input-preprocessing - ret = ret.replace( rtrimCSS, "$1" ) || undefined; - } - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0, - marginDelta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - // Count margin delta separately to only add it after scroll gutter adjustment. - // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). - if ( box === "margin" ) { - marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta + marginDelta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - animationIterationCount: true, - aspectRatio: true, - borderImageSlice: true, - columnCount: true, - flexGrow: true, - flexShrink: true, - fontWeight: true, - gridArea: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnStart: true, - gridRow: true, - gridRowEnd: true, - gridRowStart: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - scale: true, - widows: true, - zIndex: true, - zoom: true, - - // SVG-related - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeMiterlimit: true, - strokeOpacity: true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (trac-7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug trac-9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (trac-7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // Use proper attribute retrieval (trac-12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classNames, cur, curValue, className, i, finalValue; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classNames = classesToArray( value ); - - if ( classNames.length ) { - return this.each( function() { - curValue = getClass( this ); - cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - for ( i = 0; i < classNames.length; i++ ) { - className = classNames[ i ]; - if ( cur.indexOf( " " + className + " " ) < 0 ) { - cur += className + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - this.setAttribute( "class", finalValue ); - } - } - } ); - } - - return this; - }, - - removeClass: function( value ) { - var classNames, cur, curValue, className, i, finalValue; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classNames = classesToArray( value ); - - if ( classNames.length ) { - return this.each( function() { - curValue = getClass( this ); - - // This expression is here for better compressibility (see addClass) - cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - for ( i = 0; i < classNames.length; i++ ) { - className = classNames[ i ]; - - // Remove *all* instances - while ( cur.indexOf( " " + className + " " ) > -1 ) { - cur = cur.replace( " " + className + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - this.setAttribute( "class", finalValue ); - } - } - } ); - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var classNames, className, i, self, - type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - classNames = classesToArray( value ); - - return this.each( function() { - if ( isValidValue ) { - - // Toggle individual class names - self = jQuery( this ); - - for ( i = 0; i < classNames.length; i++ ) { - className = classNames[ i ]; - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (trac-14686, trac-14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (trac-2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (trac-9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (trac-6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // trac-7653, trac-8125, trac-8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes trac-9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (trac-10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket trac-12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // trac-9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (trac-11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // trac-1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see trac-8605, trac-14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // trac-14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.css deleted file mode 100644 index 7d3a8a29112..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.css +++ /dev/null @@ -1,833 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Includes: draggable.css, core.css, resizable.css, sortable.css, button.css, controlgroup.css, checkboxradio.css, dialog.css, tooltip.css, theme.css -* To view and modify this theme, visit https://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -.ui-draggable-handle { - touch-action: none; -} -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { - display: none; -} -.ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} -.ui-helper-clearfix:before, -.ui-helper-clearfix:after { - content: ""; - display: table; - border-collapse: collapse; -} -.ui-helper-clearfix:after { - clear: both; -} -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; -} - -.ui-front { - z-index: 100; -} - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { - cursor: default !important; - pointer-events: none; -} - - -/* Icons -----------------------------------*/ -.ui-icon { - display: inline-block; - vertical-align: middle; - margin-top: -.25em; - position: relative; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - -.ui-widget-icon-block { - left: 50%; - margin-left: -8px; - display: block; -} - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.ui-resizable { - position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - touch-action: none; -} -.ui-resizable-disabled .ui-resizable-handle, -.ui-resizable-autohide .ui-resizable-handle { - display: none; -} -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; -} -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; -} -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; -} -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; -} -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.ui-sortable-handle { - touch-action: none; -} -.ui-button { - padding: .4em 1em; - display: inline-block; - position: relative; - line-height: normal; - margin-right: .1em; - cursor: pointer; - vertical-align: middle; - text-align: center; - -webkit-user-select: none; - user-select: none; -} - -.ui-button, -.ui-button:link, -.ui-button:visited, -.ui-button:hover, -.ui-button:active { - text-decoration: none; -} - -/* to make room for the icon, a width needs to be set here */ -.ui-button-icon-only { - width: 2em; - box-sizing: border-box; - text-indent: -9999px; - white-space: nowrap; -} - -/* no icon support for input elements */ -input.ui-button.ui-button-icon-only { - text-indent: 0; -} - -/* button icon element(s) */ -.ui-button-icon-only .ui-icon { - position: absolute; - top: 50%; - left: 50%; - margin-top: -8px; - margin-left: -8px; -} - -.ui-button.ui-icon-notext .ui-icon { - padding: 0; - width: 2.1em; - height: 2.1em; - text-indent: -9999px; - white-space: nowrap; - -} - -input.ui-button.ui-icon-notext .ui-icon { - width: auto; - height: auto; - text-indent: 0; - white-space: normal; - padding: .4em 1em; -} - -/* workarounds */ -/* Support: Firefox 5 - 125+ */ -input.ui-button::-moz-focus-inner, -button.ui-button::-moz-focus-inner { - border: 0; - padding: 0; -} -.ui-controlgroup { - vertical-align: middle; - display: inline-block; -} -.ui-controlgroup > .ui-controlgroup-item { - float: left; - margin-left: 0; - margin-right: 0; -} -.ui-controlgroup > .ui-controlgroup-item:focus, -.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { - z-index: 9999; -} -.ui-controlgroup-vertical > .ui-controlgroup-item { - display: block; - float: none; - width: 100%; - margin-top: 0; - margin-bottom: 0; - text-align: left; -} -.ui-controlgroup-vertical .ui-controlgroup-item { - box-sizing: border-box; -} -.ui-controlgroup .ui-controlgroup-label { - padding: .4em 1em; -} -.ui-controlgroup .ui-controlgroup-label span { - font-size: 80%; -} -.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { - border-left: none; -} -.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { - border-top: none; -} -.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { - border-right: none; -} -.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { - border-bottom: none; -} - -/* Spinner specific style fixes */ -.ui-controlgroup-vertical .ui-spinner-input { - width: calc( 100% - 2.4em ); -} -.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { - border-top-style: solid; -} - -.ui-checkboxradio-label .ui-icon-background { - box-shadow: inset 1px 1px 1px #ccc; - border-radius: .12em; - border: none; -} -.ui-checkboxradio-radio-label .ui-icon-background { - width: 16px; - height: 16px; - border-radius: 1em; - overflow: visible; - border: none; -} -.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, -.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { - background-image: none; - width: 8px; - height: 8px; - border-width: 4px; - border-style: solid; -} -.ui-checkboxradio-disabled { - pointer-events: none; -} -.ui-dialog { - position: absolute; - top: 0; - left: 0; - padding: .2em; - outline: 0; -} -.ui-dialog .ui-dialog-titlebar { - padding: .4em 1em; - position: relative; -} -.ui-dialog .ui-dialog-title { - float: left; - margin: .1em 0; - white-space: nowrap; - width: 90%; - overflow: hidden; - text-overflow: ellipsis; -} -.ui-dialog .ui-dialog-titlebar-close { - position: absolute; - right: .3em; - top: 50%; - width: 20px; - margin: -10px 0 0 0; - padding: 1px; - height: 20px; -} -.ui-dialog .ui-dialog-content { - position: relative; - border: 0; - padding: .5em 1em; - background: none; - overflow: auto; -} -.ui-dialog .ui-dialog-buttonpane { - text-align: left; - border-width: 1px 0 0 0; - background-image: none; - margin-top: .5em; - padding: .3em 1em .5em .4em; -} -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { - float: right; -} -.ui-dialog .ui-dialog-buttonpane button { - margin: .5em .4em .5em 0; - cursor: pointer; -} -.ui-dialog .ui-resizable-n { - height: 2px; - top: 0; -} -.ui-dialog .ui-resizable-e { - width: 2px; - right: 0; -} -.ui-dialog .ui-resizable-s { - height: 2px; - bottom: 0; -} -.ui-dialog .ui-resizable-w { - width: 2px; - left: 0; -} -.ui-dialog .ui-resizable-se, -.ui-dialog .ui-resizable-sw, -.ui-dialog .ui-resizable-ne, -.ui-dialog .ui-resizable-nw { - width: 7px; - height: 7px; -} -.ui-dialog .ui-resizable-se { - right: 0; - bottom: 0; -} -.ui-dialog .ui-resizable-sw { - left: 0; - bottom: 0; -} -.ui-dialog .ui-resizable-ne { - right: 0; - top: 0; -} -.ui-dialog .ui-resizable-nw { - left: 0; - top: 0; -} -.ui-draggable .ui-dialog-titlebar { - cursor: move; -} -.ui-tooltip { - padding: 8px; - position: absolute; - z-index: 9999; - max-width: 300px; -} -body .ui-tooltip { - border-width: 2px; -} - -/* Component containers -----------------------------------*/ -.ui-widget { - font-family: Arial,Helvetica,sans-serif; - font-size: 1em; -} -.ui-widget .ui-widget { - font-size: 1em; -} -.ui-widget input, -.ui-widget select, -.ui-widget textarea, -.ui-widget button { - font-family: Arial,Helvetica,sans-serif; - font-size: 1em; -} -.ui-widget.ui-widget-content { - border: 1px solid #c5c5c5; -} -.ui-widget-content { - border: 1px solid #dddddd; - background: #ffffff; - color: #333333; -} -.ui-widget-content a { - color: #333333; -} -.ui-widget-header { - border: 1px solid #dddddd; - background: #e9e9e9; - color: #333333; - font-weight: bold; -} -.ui-widget-header a { - color: #333333; -} - -/* Interaction states -----------------------------------*/ -.ui-state-default, -.ui-widget-content .ui-state-default, -.ui-widget-header .ui-state-default, -.ui-button, - -/* We use html here because we need a greater specificity to make sure disabled -works properly when clicked or hovered */ -html .ui-button.ui-state-disabled:hover, -html .ui-button.ui-state-disabled:active { - border: 1px solid #c5c5c5; - background: #f6f6f6; - font-weight: normal; - color: #454545; -} -.ui-state-default a, -.ui-state-default a:link, -.ui-state-default a:visited, -a.ui-button, -a:link.ui-button, -a:visited.ui-button, -.ui-button { - color: #454545; - text-decoration: none; -} -.ui-state-hover, -.ui-widget-content .ui-state-hover, -.ui-widget-header .ui-state-hover, -.ui-state-focus, -.ui-widget-content .ui-state-focus, -.ui-widget-header .ui-state-focus, -.ui-button:hover, -.ui-button:focus { - border: 1px solid #cccccc; - background: #ededed; - font-weight: normal; - color: #2b2b2b; -} -.ui-state-hover a, -.ui-state-hover a:hover, -.ui-state-hover a:link, -.ui-state-hover a:visited, -.ui-state-focus a, -.ui-state-focus a:hover, -.ui-state-focus a:link, -.ui-state-focus a:visited, -a.ui-button:hover, -a.ui-button:focus { - color: #2b2b2b; - text-decoration: none; -} - -.ui-visual-focus { - box-shadow: 0 0 3px 1px rgb(94, 158, 214); -} -.ui-state-active, -.ui-widget-content .ui-state-active, -.ui-widget-header .ui-state-active, -a.ui-button:active, -.ui-button:active, -.ui-button.ui-state-active:hover { - border: 1px solid #003eff; - background: #007fff; - font-weight: normal; - color: #ffffff; -} -.ui-icon-background, -.ui-state-active .ui-icon-background { - border: #003eff; - background-color: #ffffff; -} -.ui-state-active a, -.ui-state-active a:link, -.ui-state-active a:visited { - color: #ffffff; - text-decoration: none; -} - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, -.ui-widget-content .ui-state-highlight, -.ui-widget-header .ui-state-highlight { - border: 1px solid #dad55e; - background: #fffa90; - color: #777620; -} -.ui-state-checked { - border: 1px solid #dad55e; - background: #fffa90; -} -.ui-state-highlight a, -.ui-widget-content .ui-state-highlight a, -.ui-widget-header .ui-state-highlight a { - color: #777620; -} -.ui-state-error, -.ui-widget-content .ui-state-error, -.ui-widget-header .ui-state-error { - border: 1px solid #f1a899; - background: #fddfdf; - color: #5f3f3f; -} -.ui-state-error a, -.ui-widget-content .ui-state-error a, -.ui-widget-header .ui-state-error a { - color: #5f3f3f; -} -.ui-state-error-text, -.ui-widget-content .ui-state-error-text, -.ui-widget-header .ui-state-error-text { - color: #5f3f3f; -} -.ui-priority-primary, -.ui-widget-content .ui-priority-primary, -.ui-widget-header .ui-priority-primary { - font-weight: bold; -} -.ui-priority-secondary, -.ui-widget-content .ui-priority-secondary, -.ui-widget-header .ui-priority-secondary { - opacity: .7; - font-weight: normal; -} -.ui-state-disabled, -.ui-widget-content .ui-state-disabled, -.ui-widget-header .ui-state-disabled { - opacity: .35; - background-image: none; -} - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - width: 16px; - height: 16px; -} -.ui-icon, -.ui-widget-content .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png"); -} -.ui-widget-header .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png"); -} -.ui-state-hover .ui-icon, -.ui-state-focus .ui-icon, -.ui-button:hover .ui-icon, -.ui-button:focus .ui-icon { - background-image: url("images/ui-icons_555555_256x240.png"); -} -.ui-state-active .ui-icon, -.ui-button:active .ui-icon { - background-image: url("images/ui-icons_ffffff_256x240.png"); -} -.ui-state-highlight .ui-icon, -.ui-button .ui-state-highlight.ui-icon { - background-image: url("images/ui-icons_777620_256x240.png"); -} -.ui-state-error .ui-icon, -.ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cc0000_256x240.png"); -} -.ui-button .ui-icon { - background-image: url("images/ui-icons_777777_256x240.png"); -} - -/* positioning */ -/* Three classes needed to override `.ui-button:hover .ui-icon` */ -.ui-icon-blank.ui-icon-blank.ui-icon-blank { - background-image: none; -} -.ui-icon-caret-1-n { background-position: 0 0; } -.ui-icon-caret-1-ne { background-position: -16px 0; } -.ui-icon-caret-1-e { background-position: -32px 0; } -.ui-icon-caret-1-se { background-position: -48px 0; } -.ui-icon-caret-1-s { background-position: -65px 0; } -.ui-icon-caret-1-sw { background-position: -80px 0; } -.ui-icon-caret-1-w { background-position: -96px 0; } -.ui-icon-caret-1-nw { background-position: -112px 0; } -.ui-icon-caret-2-n-s { background-position: -128px 0; } -.ui-icon-caret-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -65px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -65px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 1px -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-on { background-position: -96px -144px; } -.ui-icon-radio-off { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, -.ui-corner-top, -.ui-corner-left, -.ui-corner-tl { - border-top-left-radius: 3px; -} -.ui-corner-all, -.ui-corner-top, -.ui-corner-right, -.ui-corner-tr { - border-top-right-radius: 3px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-left, -.ui-corner-bl { - border-bottom-left-radius: 3px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-br { - border-bottom-right-radius: 3px; -} - -/* Overlays */ -.ui-widget-overlay { - background: #aaaaaa; - opacity: .3; -} -.ui-widget-shadow { - box-shadow: 0px 0px 5px #666666; -} diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.js b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.js deleted file mode 100644 index fd04acadd24..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.js +++ /dev/null @@ -1,8352 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/resizable.js, widgets/sortable.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/dialog.js, widgets/mouse.js, widgets/tooltip.js -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -( function( factory ) { - "use strict"; - - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -$.ui = $.ui || {}; - -var version = $.ui.version = "1.14.1"; - - -/*! - * jQuery UI Widget 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Widget -//>>group: Core -//>>description: Provides a factory for creating stateful widgets with a common API. -//>>docs: https://api.jqueryui.com/jQuery.widget/ -//>>demos: https://jqueryui.com/widget/ - - -var widgetUuid = 0; -var widgetHasOwnProperty = Array.prototype.hasOwnProperty; -var widgetSlice = Array.prototype.slice; - -$.cleanData = ( function( orig ) { - return function( elems ) { - var events, elem, i; - for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { - - // Only trigger remove when necessary to save time - events = $._data( elem, "events" ); - if ( events && events.remove ) { - $( elem ).triggerHandler( "remove" ); - } - } - orig( elems ); - }; -} )( $.cleanData ); - -$.widget = function( name, base, prototype ) { - var existingConstructor, constructor, basePrototype; - - // ProxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - var proxiedPrototype = {}; - - var namespace = name.split( "." )[ 0 ]; - name = name.split( "." )[ 1 ]; - if ( name === "__proto__" || name === "constructor" ) { - return $.error( "Invalid widget name: " + name ); - } - var fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - if ( Array.isArray( prototype ) ) { - prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); - } - - // Create selector for plugin - $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { - return !!$.data( elem, fullName ); - }; - - $[ namespace ] = $[ namespace ] || {}; - existingConstructor = $[ namespace ][ name ]; - constructor = $[ namespace ][ name ] = function( options, element ) { - - // Allow instantiation without "new" keyword - if ( !this || !this._createWidget ) { - return new constructor( options, element ); - } - - // Allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - // Extend with the existing constructor to carry over any static properties - $.extend( constructor, existingConstructor, { - version: prototype.version, - - // Copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend( {}, prototype ), - - // Track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - } ); - - basePrototype = new base(); - - // We need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend( {}, basePrototype.options ); - $.each( prototype, function( prop, value ) { - if ( typeof value !== "function" ) { - proxiedPrototype[ prop ] = value; - return; - } - proxiedPrototype[ prop ] = ( function() { - function _super() { - return base.prototype[ prop ].apply( this, arguments ); - } - - function _superApply( args ) { - return base.prototype[ prop ].apply( this, args ); - } - - return function() { - var __super = this._super; - var __superApply = this._superApply; - var returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply( this, arguments ); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - } )(); - } ); - constructor.prototype = $.widget.extend( basePrototype, { - - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - } ); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if ( existingConstructor ) { - $.each( existingConstructor._childConstructors, function( i, child ) { - var childPrototype = child.prototype; - - // Redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, - child._proto ); - } ); - - // Remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push( constructor ); - } - - $.widget.bridge( name, constructor ); - - return constructor; -}; - -$.widget.extend = function( target ) { - var input = widgetSlice.call( arguments, 1 ); - var inputIndex = 0; - var inputLength = input.length; - var key; - var value; - - for ( ; inputIndex < inputLength; inputIndex++ ) { - for ( key in input[ inputIndex ] ) { - value = input[ inputIndex ][ key ]; - if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { - - // Clone objects - if ( $.isPlainObject( value ) ) { - target[ key ] = $.isPlainObject( target[ key ] ) ? - $.widget.extend( {}, target[ key ], value ) : - - // Don't extend strings, arrays, etc. with objects - $.widget.extend( {}, value ); - - // Copy everything else by reference - } else { - target[ key ] = value; - } - } - } - } - return target; -}; - -$.widget.bridge = function( name, object ) { - var fullName = object.prototype.widgetFullName || name; - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string"; - var args = widgetSlice.call( arguments, 1 ); - var returnValue = this; - - if ( isMethodCall ) { - - // If this is an empty collection, we need to have the instance method - // return undefined instead of the jQuery instance - if ( !this.length && options === "instance" ) { - returnValue = undefined; - } else { - this.each( function() { - var methodValue; - var instance = $.data( this, fullName ); - - if ( options === "instance" ) { - returnValue = instance; - return false; - } - - if ( !instance ) { - return $.error( "cannot call methods on " + name + - " prior to initialization; " + - "attempted to call method '" + options + "'" ); - } - - if ( typeof instance[ options ] !== "function" || - options.charAt( 0 ) === "_" ) { - return $.error( "no such method '" + options + "' for " + name + - " widget instance" ); - } - - methodValue = instance[ options ].apply( instance, args ); - - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack( methodValue.get() ) : - methodValue; - return false; - } - } ); - } - } else { - - // Allow multiple hashes to be passed on init - if ( args.length ) { - options = $.widget.extend.apply( null, [ options ].concat( args ) ); - } - - this.each( function() { - var instance = $.data( this, fullName ); - if ( instance ) { - instance.option( options || {} ); - if ( instance._init ) { - instance._init(); - } - } else { - $.data( this, fullName, new object( options, this ) ); - } - } ); - } - - return returnValue; - }; -}; - -$.Widget = function( /* options, element */ ) {}; -$.Widget._childConstructors = []; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
", - - options: { - classes: {}, - disabled: false, - - // Callbacks - create: null - }, - - _createWidget: function( options, element ) { - element = $( element || this.defaultElement || this )[ 0 ]; - this.element = $( element ); - this.uuid = widgetUuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - this.classesElementLookup = {}; - - if ( element !== this ) { - $.data( element, this.widgetFullName, this ); - this._on( true, this.element, { - remove: function( event ) { - if ( event.target === element ) { - this.destroy(); - } - } - } ); - this.document = $( element.style ? - - // Element within the document - element.ownerDocument : - - // Element is window or document - element.document || element ); - this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); - } - - this.options = $.widget.extend( {}, - this.options, - this._getCreateOptions(), - options ); - - this._create(); - - if ( this.options.disabled ) { - this._setOptionDisabled( this.options.disabled ); - } - - this._trigger( "create", null, this._getCreateEventData() ); - this._init(); - }, - - _getCreateOptions: function() { - return {}; - }, - - _getCreateEventData: $.noop, - - _create: $.noop, - - _init: $.noop, - - destroy: function() { - var that = this; - - this._destroy(); - $.each( this.classesElementLookup, function( key, value ) { - that._removeClass( value, key ); - } ); - - // We can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .off( this.eventNamespace ) - .removeData( this.widgetFullName ); - this.widget() - .off( this.eventNamespace ) - .removeAttr( "aria-disabled" ); - - // Clean up events and states - this.bindings.off( this.eventNamespace ); - }, - - _destroy: $.noop, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key; - var parts; - var curOption; - var i; - - if ( arguments.length === 0 ) { - - // Don't return a reference to the internal hash - return $.widget.extend( {}, this.options ); - } - - if ( typeof key === "string" ) { - - // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split( "." ); - key = parts.shift(); - if ( parts.length ) { - curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); - for ( i = 0; i < parts.length - 1; i++ ) { - curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; - curOption = curOption[ parts[ i ] ]; - } - key = parts.pop(); - if ( arguments.length === 1 ) { - return curOption[ key ] === undefined ? null : curOption[ key ]; - } - curOption[ key ] = value; - } else { - if ( arguments.length === 1 ) { - return this.options[ key ] === undefined ? null : this.options[ key ]; - } - options[ key ] = value; - } - } - - this._setOptions( options ); - - return this; - }, - - _setOptions: function( options ) { - var key; - - for ( key in options ) { - this._setOption( key, options[ key ] ); - } - - return this; - }, - - _setOption: function( key, value ) { - if ( key === "classes" ) { - this._setOptionClasses( value ); - } - - this.options[ key ] = value; - - if ( key === "disabled" ) { - this._setOptionDisabled( value ); - } - - return this; - }, - - _setOptionClasses: function( value ) { - var classKey, elements, currentElements; - - for ( classKey in value ) { - currentElements = this.classesElementLookup[ classKey ]; - if ( value[ classKey ] === this.options.classes[ classKey ] || - !currentElements || - !currentElements.length ) { - continue; - } - - // We are doing this to create a new jQuery object because the _removeClass() call - // on the next line is going to destroy the reference to the current elements being - // tracked. We need to save a copy of this collection so that we can add the new classes - // below. - elements = $( currentElements.get() ); - this._removeClass( currentElements, classKey ); - - // We don't use _addClass() here, because that uses this.options.classes - // for generating the string of classes. We want to use the value passed in from - // _setOption(), this is the new value of the classes option which was passed to - // _setOption(). We pass this value directly to _classes(). - elements.addClass( this._classes( { - element: elements, - keys: classKey, - classes: value, - add: true - } ) ); - } - }, - - _setOptionDisabled: function( value ) { - this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); - - // If the widget is becoming disabled, then nothing is interactive - if ( value ) { - this._removeClass( this.hoverable, null, "ui-state-hover" ); - this._removeClass( this.focusable, null, "ui-state-focus" ); - } - }, - - enable: function() { - return this._setOptions( { disabled: false } ); - }, - - disable: function() { - return this._setOptions( { disabled: true } ); - }, - - _classes: function( options ) { - var full = []; - var that = this; - - options = $.extend( { - element: this.element, - classes: this.options.classes || {} - }, options ); - - function bindRemoveEvent() { - var nodesToBind = []; - - options.element.each( function( _, element ) { - var isTracked = $.map( that.classesElementLookup, function( elements ) { - return elements; - } ) - .some( function( elements ) { - return elements.is( element ); - } ); - - if ( !isTracked ) { - nodesToBind.push( element ); - } - } ); - - that._on( $( nodesToBind ), { - remove: "_untrackClassesElement" - } ); - } - - function processClassString( classes, checkOption ) { - var current, i; - for ( i = 0; i < classes.length; i++ ) { - current = that.classesElementLookup[ classes[ i ] ] || $(); - if ( options.add ) { - bindRemoveEvent(); - current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); - } else { - current = $( current.not( options.element ).get() ); - } - that.classesElementLookup[ classes[ i ] ] = current; - full.push( classes[ i ] ); - if ( checkOption && options.classes[ classes[ i ] ] ) { - full.push( options.classes[ classes[ i ] ] ); - } - } - } - - if ( options.keys ) { - processClassString( options.keys.match( /\S+/g ) || [], true ); - } - if ( options.extra ) { - processClassString( options.extra.match( /\S+/g ) || [] ); - } - - return full.join( " " ); - }, - - _untrackClassesElement: function( event ) { - var that = this; - $.each( that.classesElementLookup, function( key, value ) { - if ( $.inArray( event.target, value ) !== -1 ) { - that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); - } - } ); - - this._off( $( event.target ) ); - }, - - _removeClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, false ); - }, - - _addClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, true ); - }, - - _toggleClass: function( element, keys, extra, add ) { - add = ( typeof add === "boolean" ) ? add : extra; - var shift = ( typeof element === "string" || element === null ), - options = { - extra: shift ? keys : extra, - keys: shift ? element : keys, - element: shift ? this.element : element, - add: add - }; - options.element.toggleClass( this._classes( options ), add ); - return this; - }, - - _on: function( suppressDisabledCheck, element, handlers ) { - var delegateElement; - var instance = this; - - // No suppressDisabledCheck flag, shuffle arguments - if ( typeof suppressDisabledCheck !== "boolean" ) { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // No element argument, shuffle and use this.element - if ( !handlers ) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - element = delegateElement = $( element ); - this.bindings = this.bindings.add( element ); - } - - $.each( handlers, function( event, handler ) { - function handlerProxy() { - - // Allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if ( !suppressDisabledCheck && - ( instance.options.disabled === true || - $( this ).hasClass( "ui-state-disabled" ) ) ) { - return; - } - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - - // Copy the guid so direct unbinding works - if ( typeof handler !== "string" ) { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match( /^([\w:-]*)\s*(.*)$/ ); - var eventName = match[ 1 ] + instance.eventNamespace; - var selector = match[ 2 ]; - - if ( selector ) { - delegateElement.on( eventName, selector, handlerProxy ); - } else { - element.on( eventName, handlerProxy ); - } - } ); - }, - - _off: function( element, eventName ) { - eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + - this.eventNamespace; - element.off( eventName ); - - // Clear the stack to avoid memory leaks (#10056) - this.bindings = $( this.bindings.not( element ).get() ); - this.focusable = $( this.focusable.not( element ).get() ); - this.hoverable = $( this.hoverable.not( element ).get() ); - }, - - _delay: function( handler, delay ) { - function handlerProxy() { - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - var instance = this; - return setTimeout( handlerProxy, delay || 0 ); - }, - - _hoverable: function( element ) { - this.hoverable = this.hoverable.add( element ); - this._on( element, { - mouseenter: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); - }, - mouseleave: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); - } - } ); - }, - - _focusable: function( element ) { - this.focusable = this.focusable.add( element ); - this._on( element, { - focusin: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); - }, - focusout: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); - } - } ); - }, - - _trigger: function( type, event, data ) { - var prop, orig; - var callback = this.options[ type ]; - - data = data || {}; - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - - // The original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[ 0 ]; - - // Copy original event properties over to the new event - orig = event.originalEvent; - if ( orig ) { - for ( prop in orig ) { - if ( !( prop in event ) ) { - event[ prop ] = orig[ prop ]; - } - } - } - - this.element.trigger( event, data ); - return !( typeof callback === "function" && - callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || - event.isDefaultPrevented() ); - } -}; - -$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { - $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { - if ( typeof options === "string" ) { - options = { effect: options }; - } - - var hasOptions; - var effectName = !options ? - method : - options === true || typeof options === "number" ? - defaultEffect : - options.effect || defaultEffect; - - options = options || {}; - if ( typeof options === "number" ) { - options = { duration: options }; - } else if ( options === true ) { - options = {}; - } - - hasOptions = !$.isEmptyObject( options ); - options.complete = callback; - - if ( options.delay ) { - element.delay( options.delay ); - } - - if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { - element[ method ]( options ); - } else if ( effectName !== method && element[ effectName ] ) { - element[ effectName ]( options.duration, options.easing, callback ); - } else { - element.queue( function( next ) { - $( this )[ method ](); - if ( callback ) { - callback.call( element[ 0 ] ); - } - next(); - } ); - } - }; -} ); - -var widget = $.widget; - - -/*! - * jQuery UI Position 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - * - * https://api.jqueryui.com/position/ - */ - -//>>label: Position -//>>group: Core -//>>description: Positions elements relative to other elements. -//>>docs: https://api.jqueryui.com/position/ -//>>demos: https://jqueryui.com/position/ - - -( function() { -var cachedScrollbarWidth, - max = Math.max, - abs = Math.abs, - rhorizontal = /left|center|right/, - rvertical = /top|center|bottom/, - roffset = /[\+\-]\d+(\.[\d]+)?%?/, - rposition = /^\w+/, - rpercent = /%$/, - _position = $.fn.position; - -function getOffsets( offsets, width, height ) { - return [ - parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), - parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) - ]; -} - -function parseCss( element, property ) { - return parseInt( $.css( element, property ), 10 ) || 0; -} - -function isWindow( obj ) { - return obj != null && obj === obj.window; -} - -function getDimensions( elem ) { - var raw = elem[ 0 ]; - if ( raw.nodeType === 9 ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: 0, left: 0 } - }; - } - if ( isWindow( raw ) ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: elem.scrollTop(), left: elem.scrollLeft() } - }; - } - if ( raw.preventDefault ) { - return { - width: 0, - height: 0, - offset: { top: raw.pageY, left: raw.pageX } - }; - } - return { - width: elem.outerWidth(), - height: elem.outerHeight(), - offset: elem.offset() - }; -} - -$.position = { - scrollbarWidth: function() { - if ( cachedScrollbarWidth !== undefined ) { - return cachedScrollbarWidth; - } - var w1, w2, - div = $( "
" + - "
" ), - innerDiv = div.children()[ 0 ]; - - $( "body" ).append( div ); - w1 = innerDiv.offsetWidth; - div.css( "overflow", "scroll" ); - - w2 = innerDiv.offsetWidth; - - if ( w1 === w2 ) { - w2 = div[ 0 ].clientWidth; - } - - div.remove(); - - return ( cachedScrollbarWidth = w1 - w2 ); - }, - getScrollInfo: function( within ) { - var overflowX = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-x" ), - overflowY = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-y" ), - hasOverflowX = overflowX === "scroll" || - ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), - hasOverflowY = overflowY === "scroll" || - ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); - return { - width: hasOverflowY ? $.position.scrollbarWidth() : 0, - height: hasOverflowX ? $.position.scrollbarWidth() : 0 - }; - }, - getWithinInfo: function( element ) { - var withinElement = $( element || window ), - isElemWindow = isWindow( withinElement[ 0 ] ), - isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, - hasOffset = !isElemWindow && !isDocument; - return { - element: withinElement, - isWindow: isElemWindow, - isDocument: isDocument, - offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, - scrollLeft: withinElement.scrollLeft(), - scrollTop: withinElement.scrollTop(), - width: withinElement.outerWidth(), - height: withinElement.outerHeight() - }; - } -}; - -$.fn.position = function( options ) { - if ( !options || !options.of ) { - return _position.apply( this, arguments ); - } - - // Make a copy, we don't want to modify arguments - options = $.extend( {}, options ); - - var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, - - // Make sure string options are treated as CSS selectors - target = typeof options.of === "string" ? - $( document ).find( options.of ) : - $( options.of ), - - within = $.position.getWithinInfo( options.within ), - scrollInfo = $.position.getScrollInfo( within ), - collision = ( options.collision || "flip" ).split( " " ), - offsets = {}; - - dimensions = getDimensions( target ); - if ( target[ 0 ].preventDefault ) { - - // Force left top to allow flipping - options.at = "left top"; - } - targetWidth = dimensions.width; - targetHeight = dimensions.height; - targetOffset = dimensions.offset; - - // Clone to reuse original targetOffset later - basePosition = $.extend( {}, targetOffset ); - - // Force my and at to have valid horizontal and vertical positions - // if a value is missing or invalid, it will be converted to center - $.each( [ "my", "at" ], function() { - var pos = ( options[ this ] || "" ).split( " " ), - horizontalOffset, - verticalOffset; - - if ( pos.length === 1 ) { - pos = rhorizontal.test( pos[ 0 ] ) ? - pos.concat( [ "center" ] ) : - rvertical.test( pos[ 0 ] ) ? - [ "center" ].concat( pos ) : - [ "center", "center" ]; - } - pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; - pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; - - // Calculate offsets - horizontalOffset = roffset.exec( pos[ 0 ] ); - verticalOffset = roffset.exec( pos[ 1 ] ); - offsets[ this ] = [ - horizontalOffset ? horizontalOffset[ 0 ] : 0, - verticalOffset ? verticalOffset[ 0 ] : 0 - ]; - - // Reduce to just the positions without the offsets - options[ this ] = [ - rposition.exec( pos[ 0 ] )[ 0 ], - rposition.exec( pos[ 1 ] )[ 0 ] - ]; - } ); - - // Normalize collision option - if ( collision.length === 1 ) { - collision[ 1 ] = collision[ 0 ]; - } - - if ( options.at[ 0 ] === "right" ) { - basePosition.left += targetWidth; - } else if ( options.at[ 0 ] === "center" ) { - basePosition.left += targetWidth / 2; - } - - if ( options.at[ 1 ] === "bottom" ) { - basePosition.top += targetHeight; - } else if ( options.at[ 1 ] === "center" ) { - basePosition.top += targetHeight / 2; - } - - atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); - basePosition.left += atOffset[ 0 ]; - basePosition.top += atOffset[ 1 ]; - - return this.each( function() { - var collisionPosition, using, - elem = $( this ), - elemWidth = elem.outerWidth(), - elemHeight = elem.outerHeight(), - marginLeft = parseCss( this, "marginLeft" ), - marginTop = parseCss( this, "marginTop" ), - collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + - scrollInfo.width, - collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + - scrollInfo.height, - position = $.extend( {}, basePosition ), - myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); - - if ( options.my[ 0 ] === "right" ) { - position.left -= elemWidth; - } else if ( options.my[ 0 ] === "center" ) { - position.left -= elemWidth / 2; - } - - if ( options.my[ 1 ] === "bottom" ) { - position.top -= elemHeight; - } else if ( options.my[ 1 ] === "center" ) { - position.top -= elemHeight / 2; - } - - position.left += myOffset[ 0 ]; - position.top += myOffset[ 1 ]; - - collisionPosition = { - marginLeft: marginLeft, - marginTop: marginTop - }; - - $.each( [ "left", "top" ], function( i, dir ) { - if ( $.ui.position[ collision[ i ] ] ) { - $.ui.position[ collision[ i ] ][ dir ]( position, { - targetWidth: targetWidth, - targetHeight: targetHeight, - elemWidth: elemWidth, - elemHeight: elemHeight, - collisionPosition: collisionPosition, - collisionWidth: collisionWidth, - collisionHeight: collisionHeight, - offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], - my: options.my, - at: options.at, - within: within, - elem: elem - } ); - } - } ); - - if ( options.using ) { - - // Adds feedback as second argument to using callback, if present - using = function( props ) { - var left = targetOffset.left - position.left, - right = left + targetWidth - elemWidth, - top = targetOffset.top - position.top, - bottom = top + targetHeight - elemHeight, - feedback = { - target: { - element: target, - left: targetOffset.left, - top: targetOffset.top, - width: targetWidth, - height: targetHeight - }, - element: { - element: elem, - left: position.left, - top: position.top, - width: elemWidth, - height: elemHeight - }, - horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", - vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" - }; - if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { - feedback.horizontal = "center"; - } - if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { - feedback.vertical = "middle"; - } - if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { - feedback.important = "horizontal"; - } else { - feedback.important = "vertical"; - } - options.using.call( this, props, feedback ); - }; - } - - elem.offset( $.extend( position, { using: using } ) ); - } ); -}; - -$.ui.position = { - fit: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, - outerWidth = within.width, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = withinOffset - collisionPosLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, - newOverRight; - - // Element is wider than within - if ( data.collisionWidth > outerWidth ) { - - // Element is initially over the left side of within - if ( overLeft > 0 && overRight <= 0 ) { - newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - - withinOffset; - position.left += overLeft - newOverRight; - - // Element is initially over right side of within - } else if ( overRight > 0 && overLeft <= 0 ) { - position.left = withinOffset; - - // Element is initially over both left and right sides of within - } else { - if ( overLeft > overRight ) { - position.left = withinOffset + outerWidth - data.collisionWidth; - } else { - position.left = withinOffset; - } - } - - // Too far left -> align with left edge - } else if ( overLeft > 0 ) { - position.left += overLeft; - - // Too far right -> align with right edge - } else if ( overRight > 0 ) { - position.left -= overRight; - - // Adjust based on position and margin - } else { - position.left = max( position.left - collisionPosLeft, position.left ); - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollTop : within.offset.top, - outerHeight = data.within.height, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = withinOffset - collisionPosTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, - newOverBottom; - - // Element is taller than within - if ( data.collisionHeight > outerHeight ) { - - // Element is initially over the top of within - if ( overTop > 0 && overBottom <= 0 ) { - newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - - withinOffset; - position.top += overTop - newOverBottom; - - // Element is initially over bottom of within - } else if ( overBottom > 0 && overTop <= 0 ) { - position.top = withinOffset; - - // Element is initially over both top and bottom of within - } else { - if ( overTop > overBottom ) { - position.top = withinOffset + outerHeight - data.collisionHeight; - } else { - position.top = withinOffset; - } - } - - // Too far up -> align with top - } else if ( overTop > 0 ) { - position.top += overTop; - - // Too far down -> align with bottom edge - } else if ( overBottom > 0 ) { - position.top -= overBottom; - - // Adjust based on position and margin - } else { - position.top = max( position.top - collisionPosTop, position.top ); - } - } - }, - flip: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.offset.left + within.scrollLeft, - outerWidth = within.width, - offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = collisionPosLeft - offsetLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, - myOffset = data.my[ 0 ] === "left" ? - -data.elemWidth : - data.my[ 0 ] === "right" ? - data.elemWidth : - 0, - atOffset = data.at[ 0 ] === "left" ? - data.targetWidth : - data.at[ 0 ] === "right" ? - -data.targetWidth : - 0, - offset = -2 * data.offset[ 0 ], - newOverRight, - newOverLeft; - - if ( overLeft < 0 ) { - newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - - outerWidth - withinOffset; - if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { - position.left += myOffset + atOffset + offset; - } - } else if ( overRight > 0 ) { - newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + - atOffset + offset - offsetLeft; - if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { - position.left += myOffset + atOffset + offset; - } - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.offset.top + within.scrollTop, - outerHeight = within.height, - offsetTop = within.isWindow ? within.scrollTop : within.offset.top, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = collisionPosTop - offsetTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, - top = data.my[ 1 ] === "top", - myOffset = top ? - -data.elemHeight : - data.my[ 1 ] === "bottom" ? - data.elemHeight : - 0, - atOffset = data.at[ 1 ] === "top" ? - data.targetHeight : - data.at[ 1 ] === "bottom" ? - -data.targetHeight : - 0, - offset = -2 * data.offset[ 1 ], - newOverTop, - newOverBottom; - if ( overTop < 0 ) { - newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - - outerHeight - withinOffset; - if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { - position.top += myOffset + atOffset + offset; - } - } else if ( overBottom > 0 ) { - newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + - offset - offsetTop; - if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { - position.top += myOffset + atOffset + offset; - } - } - } - }, - flipfit: { - left: function() { - $.ui.position.flip.left.apply( this, arguments ); - $.ui.position.fit.left.apply( this, arguments ); - }, - top: function() { - $.ui.position.flip.top.apply( this, arguments ); - $.ui.position.fit.top.apply( this, arguments ); - } - } -}; - -} )(); - -var position = $.ui.position; - - -/*! - * jQuery UI :data 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: :data Selector -//>>group: Core -//>>description: Selects elements which have data stored under the specified key. -//>>docs: https://api.jqueryui.com/data-selector/ - - -var data = $.extend( $.expr.pseudos, { - data: $.expr.createPseudo( function( dataName ) { - return function( elem ) { - return !!$.data( elem, dataName ); - }; - } ) -} ); - -/*! - * jQuery UI Disable Selection 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: disableSelection -//>>group: Core -//>>description: Disable selection of text content within the set of matched elements. -//>>docs: https://api.jqueryui.com/disableSelection/ - -// This file is deprecated - -var disableSelection = $.fn.extend( { - disableSelection: ( function() { - var eventType = "onselectstart" in document.createElement( "div" ) ? - "selectstart" : - "mousedown"; - - return function() { - return this.on( eventType + ".ui-disableSelection", function( event ) { - event.preventDefault(); - } ); - }; - } )(), - - enableSelection: function() { - return this.off( ".ui-disableSelection" ); - } -} ); - - -/*! - * jQuery UI Focusable 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: :focusable Selector -//>>group: Core -//>>description: Selects elements which can be focused. -//>>docs: https://api.jqueryui.com/focusable-selector/ - - -// Selectors -$.ui.focusable = function( element, hasTabindex ) { - var map, mapName, img, focusableIfVisible, fieldset, - nodeName = element.nodeName.toLowerCase(); - - if ( "area" === nodeName ) { - map = element.parentNode; - mapName = map.name; - if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { - return false; - } - img = $( "img[usemap='#" + mapName + "']" ); - return img.length > 0 && img.is( ":visible" ); - } - - if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { - focusableIfVisible = !element.disabled; - - if ( focusableIfVisible ) { - - // Form controls within a disabled fieldset are disabled. - // However, controls within the fieldset's legend do not get disabled. - // Since controls generally aren't placed inside legends, we skip - // this portion of the check. - fieldset = $( element ).closest( "fieldset" )[ 0 ]; - if ( fieldset ) { - focusableIfVisible = !fieldset.disabled; - } - } - } else if ( "a" === nodeName ) { - focusableIfVisible = element.href || hasTabindex; - } else { - focusableIfVisible = hasTabindex; - } - - return focusableIfVisible && $( element ).is( ":visible" ) && - $( element ).css( "visibility" ) === "visible"; -}; - -$.extend( $.expr.pseudos, { - focusable: function( element ) { - return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); - } -} ); - -var focusable = $.ui.focusable; - - -/*! - * jQuery UI Form Reset Mixin 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Form Reset Mixin -//>>group: Core -//>>description: Refresh input widgets when their form is reset -//>>docs: https://api.jqueryui.com/form-reset-mixin/ - - -var formResetMixin = $.ui.formResetMixin = { - _formResetHandler: function() { - var form = $( this ); - - // Wait for the form reset to actually happen before refreshing - setTimeout( function() { - var instances = form.data( "ui-form-reset-instances" ); - $.each( instances, function() { - this.refresh(); - } ); - } ); - }, - - _bindFormResetHandler: function() { - this.form = $( this.element.prop( "form" ) ); - if ( !this.form.length ) { - return; - } - - var instances = this.form.data( "ui-form-reset-instances" ) || []; - if ( !instances.length ) { - - // We don't use _on() here because we use a single event handler per form - this.form.on( "reset.ui-form-reset", this._formResetHandler ); - } - instances.push( this ); - this.form.data( "ui-form-reset-instances", instances ); - }, - - _unbindFormResetHandler: function() { - if ( !this.form.length ) { - return; - } - - var instances = this.form.data( "ui-form-reset-instances" ); - instances.splice( $.inArray( this, instances ), 1 ); - if ( instances.length ) { - this.form.data( "ui-form-reset-instances", instances ); - } else { - this.form - .removeData( "ui-form-reset-instances" ) - .off( "reset.ui-form-reset" ); - } - } -}; - - -/*! - * jQuery UI Keycode 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Keycode -//>>group: Core -//>>description: Provide keycodes as keynames -//>>docs: https://api.jqueryui.com/jQuery.ui.keyCode/ - - -var keycode = $.ui.keyCode = { - BACKSPACE: 8, - COMMA: 188, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - LEFT: 37, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SPACE: 32, - TAB: 9, - UP: 38 -}; - - -/*! - * jQuery UI Labels 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: labels -//>>group: Core -//>>description: Find all the labels associated with a given input -//>>docs: https://api.jqueryui.com/labels/ - - -var labels = $.fn.labels = function() { - var ancestor, selector, id, labels, ancestors; - - if ( !this.length ) { - return this.pushStack( [] ); - } - - // Check control.labels first - if ( this[ 0 ].labels && this[ 0 ].labels.length ) { - return this.pushStack( this[ 0 ].labels ); - } - - // If `control.labels` is empty - e.g. inside of document fragments - find - // the labels manually - labels = this.eq( 0 ).parents( "label" ); - - // Look for the label based on the id - id = this.attr( "id" ); - if ( id ) { - - // We don't search against the document in case the element - // is disconnected from the DOM - ancestor = this.eq( 0 ).parents().last(); - - // Get a full set of top level ancestors - ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); - - // Create a selector for the label based on the id - selector = "label[for='" + CSS.escape( id ) + "']"; - - labels = labels.add( ancestors.find( selector ).addBack( selector ) ); - - } - - // Return whatever we have found for labels - return this.pushStack( labels ); -}; - - -/*! - * jQuery UI Scroll Parent 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: scrollParent -//>>group: Core -//>>description: Get the closest ancestor element that is scrollable. -//>>docs: https://api.jqueryui.com/scrollParent/ - - -var scrollParent = $.fn.scrollParent = function( includeHidden ) { - var position = this.css( "position" ), - excludeStaticParent = position === "absolute", - overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, - scrollParent = this.parents().filter( function() { - var parent = $( this ); - if ( excludeStaticParent && parent.css( "position" ) === "static" ) { - return false; - } - return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + - parent.css( "overflow-x" ) ); - } ).eq( 0 ); - - return position === "fixed" || !scrollParent.length ? - $( this[ 0 ].ownerDocument || document ) : - scrollParent; -}; - - -/*! - * jQuery UI Tabbable 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: :tabbable Selector -//>>group: Core -//>>description: Selects elements which can be tabbed to. -//>>docs: https://api.jqueryui.com/tabbable-selector/ - - -var tabbable = $.extend( $.expr.pseudos, { - tabbable: function( element ) { - var tabIndex = $.attr( element, "tabindex" ), - hasTabindex = tabIndex != null; - return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex ); - } -} ); - - -/*! - * jQuery UI Unique ID 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: uniqueId -//>>group: Core -//>>description: Functions to generate and remove uniqueId's -//>>docs: https://api.jqueryui.com/uniqueId/ - - -var uniqueId = $.fn.extend( { - uniqueId: ( function() { - var uuid = 0; - - return function() { - return this.each( function() { - if ( !this.id ) { - this.id = "ui-id-" + ( ++uuid ); - } - } ); - }; - } )(), - - removeUniqueId: function() { - return this.each( function() { - if ( /^ui-id-\d+$/.test( this.id ) ) { - $( this ).removeAttr( "id" ); - } - } ); - } -} ); - - -/*! - * jQuery UI Mouse 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Mouse -//>>group: Widgets -//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. -//>>docs: https://api.jqueryui.com/mouse/ - - -var mouseHandled = false; -$( document ).on( "mouseup", function() { - mouseHandled = false; -} ); - -var widgetsMouse = $.widget( "ui.mouse", { - version: "1.14.1", - options: { - cancel: "input, textarea, button, select, option", - distance: 1, - delay: 0 - }, - _mouseInit: function() { - var that = this; - - this.element - .on( "mousedown." + this.widgetName, function( event ) { - return that._mouseDown( event ); - } ) - .on( "click." + this.widgetName, function( event ) { - if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { - $.removeData( event.target, that.widgetName + ".preventClickEvent" ); - event.stopImmediatePropagation(); - return false; - } - } ); - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.off( "." + this.widgetName ); - if ( this._mouseMoveDelegate ) { - this.document - .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); - } - }, - - _mouseDown: function( event ) { - - // don't let more than one widget handle mouseStart - if ( mouseHandled ) { - return; - } - - this._mouseMoved = false; - - // We may have missed mouseup (out of window) - if ( this._mouseStarted ) { - this._mouseUp( event ); - } - - this._mouseDownEvent = event; - - var that = this, - btnIsLeft = event.which === 1, - elIsCancel = typeof this.options.cancel === "string" ? - $( event.target ).closest( this.options.cancel ).length : - false; - if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if ( !this.mouseDelayMet ) { - this._mouseDelayTimer = setTimeout( function() { - that.mouseDelayMet = true; - }, this.options.delay ); - } - - if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { - this._mouseStarted = ( this._mouseStart( event ) !== false ); - if ( !this._mouseStarted ) { - event.preventDefault(); - return true; - } - } - - // Click event may never have fired (Gecko & Opera) - if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { - $.removeData( event.target, this.widgetName + ".preventClickEvent" ); - } - - // These delegates are required to keep context - this._mouseMoveDelegate = function( event ) { - return that._mouseMove( event ); - }; - this._mouseUpDelegate = function( event ) { - return that._mouseUp( event ); - }; - - this.document - .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - event.preventDefault(); - - mouseHandled = true; - return true; - }, - - _mouseMove: function( event ) { - - // Only check for mouseups outside the document if you've moved inside the document - // at least once. - if ( this._mouseMoved && !event.which ) { - - // Support: Safari <=8 - 9 - // Safari sets which to 0 if you press any of the following keys - // during a drag (#14461) - if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || - event.originalEvent.metaKey || event.originalEvent.shiftKey ) { - this.ignoreMissingWhich = true; - } else if ( !this.ignoreMissingWhich ) { - return this._mouseUp( event ); - } - } - - if ( event.which || event.button ) { - this._mouseMoved = true; - } - - if ( this._mouseStarted ) { - this._mouseDrag( event ); - return event.preventDefault(); - } - - if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { - this._mouseStarted = - ( this._mouseStart( this._mouseDownEvent, event ) !== false ); - if ( this._mouseStarted ) { - this._mouseDrag( event ); - } else { - this._mouseUp( event ); - } - } - - return !this._mouseStarted; - }, - - _mouseUp: function( event ) { - this.document - .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - if ( this._mouseStarted ) { - this._mouseStarted = false; - - if ( event.target === this._mouseDownEvent.target ) { - $.data( event.target, this.widgetName + ".preventClickEvent", true ); - } - - this._mouseStop( event ); - } - - if ( this._mouseDelayTimer ) { - clearTimeout( this._mouseDelayTimer ); - delete this._mouseDelayTimer; - } - - this.ignoreMissingWhich = false; - mouseHandled = false; - event.preventDefault(); - }, - - _mouseDistanceMet: function( event ) { - return ( Math.max( - Math.abs( this._mouseDownEvent.pageX - event.pageX ), - Math.abs( this._mouseDownEvent.pageY - event.pageY ) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function( /* event */ ) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function( /* event */ ) {}, - _mouseDrag: function( /* event */ ) {}, - _mouseStop: function( /* event */ ) {}, - _mouseCapture: function( /* event */ ) { - return true; - } -} ); - - - -// $.ui.plugin is deprecated. Use $.widget() extensions instead. -var plugin = $.ui.plugin = { - add: function( module, option, set ) { - var i, - proto = $.ui[ module ].prototype; - for ( i in set ) { - proto.plugins[ i ] = proto.plugins[ i ] || []; - proto.plugins[ i ].push( [ option, set[ i ] ] ); - } - }, - call: function( instance, name, args, allowDisconnected ) { - var i, - set = instance.plugins[ name ]; - - if ( !set ) { - return; - } - - if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || - instance.element[ 0 ].parentNode.nodeType === 11 ) ) { - return; - } - - for ( i = 0; i < set.length; i++ ) { - if ( instance.options[ set[ i ][ 0 ] ] ) { - set[ i ][ 1 ].apply( instance.element, args ); - } - } - } -}; - - -/*! - * jQuery UI Draggable 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Draggable -//>>group: Interactions -//>>description: Enables dragging functionality for any element. -//>>docs: https://api.jqueryui.com/draggable/ -//>>demos: https://jqueryui.com/draggable/ -//>>css.structure: ../../themes/base/draggable.css - - -$.widget( "ui.draggable", $.ui.mouse, { - version: "1.14.1", - widgetEventPrefix: "drag", - options: { - addClasses: true, - appendTo: "parent", - axis: false, - connectToSortable: false, - containment: false, - cursor: "auto", - cursorAt: false, - grid: false, - handle: false, - helper: "original", - iframeFix: false, - opacity: false, - refreshPositions: false, - revert: false, - revertDuration: 500, - scope: "default", - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - snap: false, - snapMode: "both", - snapTolerance: 20, - stack: false, - zIndex: false, - - // Callbacks - drag: null, - start: null, - stop: null - }, - _create: function() { - - if ( this.options.helper === "original" ) { - this._setPositionRelative(); - } - if ( this.options.addClasses ) { - this._addClass( "ui-draggable" ); - } - this._setHandleClassName(); - - this._mouseInit(); - }, - - _setOption: function( key, value ) { - this._super( key, value ); - if ( key === "handle" ) { - this._removeHandleClassName(); - this._setHandleClassName(); - } - }, - - _destroy: function() { - if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { - this.destroyOnClear = true; - return; - } - this._removeHandleClassName(); - this._mouseDestroy(); - }, - - _mouseCapture: function( event ) { - var o = this.options; - - // Among others, prevent a drag on a resizable-handle - if ( this.helper || o.disabled || - $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { - return false; - } - - //Quit if we're not on a valid handle - this.handle = this._getHandle( event ); - if ( !this.handle ) { - return false; - } - - this._blurActiveElement( event ); - - this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); - - return true; - - }, - - _blockFrames: function( selector ) { - this.iframeBlocks = this.document.find( selector ).map( function() { - var iframe = $( this ); - - return $( "
" ) - .css( "position", "absolute" ) - .appendTo( iframe.parent() ) - .outerWidth( iframe.outerWidth() ) - .outerHeight( iframe.outerHeight() ) - .offset( iframe.offset() )[ 0 ]; - } ); - }, - - _unblockFrames: function() { - if ( this.iframeBlocks ) { - this.iframeBlocks.remove(); - delete this.iframeBlocks; - } - }, - - _blurActiveElement: function( event ) { - var activeElement = this.document[ 0 ].activeElement, - target = $( event.target ); - - // Don't blur if the event occurred on an element that is within - // the currently focused element - // See #10527, #12472 - if ( target.closest( activeElement ).length ) { - return; - } - - // Blur any element that currently has focus, see #4261 - $( activeElement ).trigger( "blur" ); - }, - - _mouseStart: function( event ) { - - var o = this.options; - - //Create and append the visible helper - this.helper = this._createHelper( event ); - - this._addClass( this.helper, "ui-draggable-dragging" ); - - //Cache the helper size - this._cacheHelperProportions(); - - //If ddmanager is used for droppables, set the global draggable - if ( $.ui.ddmanager ) { - $.ui.ddmanager.current = this; - } - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Store the helper's css position - this.cssPosition = this.helper.css( "position" ); - this.scrollParent = this.helper.scrollParent( true ); - this.offsetParent = this.helper.offsetParent(); - this.hasFixedAncestor = this.helper.parents().filter( function() { - return $( this ).css( "position" ) === "fixed"; - } ).length > 0; - - //The element's absolute position on the page minus margins - this.positionAbs = this.element.offset(); - this._refreshOffsets( event ); - - //Generate the original position - this.originalPosition = this.position = this._generatePosition( event, false ); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if "cursorAt" is supplied - if ( o.cursorAt ) { - this._adjustOffsetFromHelper( o.cursorAt ); - } - - //Set a containment if given in the options - this._setContainment(); - - //Trigger event + callbacks - if ( this._trigger( "start", event ) === false ) { - this._clear(); - return false; - } - - //Recache the helper size - this._cacheHelperProportions(); - - //Prepare the droppable offsets - if ( $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - - // Execute the drag once - this causes the helper not to be visible before getting its - // correct position - this._mouseDrag( event, true ); - - // If the ddmanager is used for droppables, inform the manager that dragging has started - // (see #5003) - if ( $.ui.ddmanager ) { - $.ui.ddmanager.dragStart( this, event ); - } - - return true; - }, - - _refreshOffsets: function( event ) { - this.offset = { - top: this.positionAbs.top - this.margins.top, - left: this.positionAbs.left - this.margins.left, - scroll: false, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() - }; - - this.offset.click = { - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }; - }, - - _mouseDrag: function( event, noPropagation ) { - - // reset any necessary cached properties (see #5009) - if ( this.hasFixedAncestor ) { - this.offset.parent = this._getParentOffset(); - } - - //Compute the helpers position - this.position = this._generatePosition( event, true ); - this.positionAbs = this._convertPositionTo( "absolute" ); - - //Call plugins and callbacks and use the resulting position if something is returned - if ( !noPropagation ) { - var ui = this._uiHash(); - if ( this._trigger( "drag", event, ui ) === false ) { - this._mouseUp( new $.Event( "mouseup", event ) ); - return false; - } - this.position = ui.position; - } - - this.helper[ 0 ].style.left = this.position.left + "px"; - this.helper[ 0 ].style.top = this.position.top + "px"; - - if ( $.ui.ddmanager ) { - $.ui.ddmanager.drag( this, event ); - } - - return false; - }, - - _mouseStop: function( event ) { - - //If we are using droppables, inform the manager about the drop - var that = this, - dropped = false; - if ( $.ui.ddmanager && !this.options.dropBehaviour ) { - dropped = $.ui.ddmanager.drop( this, event ); - } - - //if a drop comes from outside (a sortable) - if ( this.dropped ) { - dropped = this.dropped; - this.dropped = false; - } - - if ( ( this.options.revert === "invalid" && !dropped ) || - ( this.options.revert === "valid" && dropped ) || - this.options.revert === true || ( typeof this.options.revert === "function" && - this.options.revert.call( this.element, dropped ) ) - ) { - $( this.helper ).animate( - this.originalPosition, - parseInt( this.options.revertDuration, 10 ), - function() { - if ( that._trigger( "stop", event ) !== false ) { - that._clear(); - } - } - ); - } else { - if ( this._trigger( "stop", event ) !== false ) { - this._clear(); - } - } - - return false; - }, - - _mouseUp: function( event ) { - this._unblockFrames(); - - // If the ddmanager is used for droppables, inform the manager that dragging has stopped - // (see #5003) - if ( $.ui.ddmanager ) { - $.ui.ddmanager.dragStop( this, event ); - } - - // Only need to focus if the event occurred on the draggable itself, see #10527 - if ( this.handleElement.is( event.target ) ) { - - // The interaction is over; whether or not the click resulted in a drag, - // focus the element - this.element.trigger( "focus" ); - } - - return $.ui.mouse.prototype._mouseUp.call( this, event ); - }, - - cancel: function() { - - if ( this.helper.is( ".ui-draggable-dragging" ) ) { - this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); - } else { - this._clear(); - } - - return this; - - }, - - _getHandle: function( event ) { - return this.options.handle ? - !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : - true; - }, - - _setHandleClassName: function() { - this.handleElement = this.options.handle ? - this.element.find( this.options.handle ) : this.element; - this._addClass( this.handleElement, "ui-draggable-handle" ); - }, - - _removeHandleClassName: function() { - this._removeClass( this.handleElement, "ui-draggable-handle" ); - }, - - _createHelper: function( event ) { - - var o = this.options, - helperIsFunction = typeof o.helper === "function", - helper = helperIsFunction ? - $( o.helper.apply( this.element[ 0 ], [ event ] ) ) : - ( o.helper === "clone" ? - this.element.clone().removeAttr( "id" ) : - this.element ); - - if ( !helper.parents( "body" ).length ) { - helper.appendTo( ( o.appendTo === "parent" ? - this.element[ 0 ].parentNode : - o.appendTo ) ); - } - - // https://bugs.jqueryui.com/ticket/9446 - // a helper function can return the original element - // which wouldn't have been set to relative in _create - if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) { - this._setPositionRelative(); - } - - if ( helper[ 0 ] !== this.element[ 0 ] && - !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { - helper.css( "position", "absolute" ); - } - - return helper; - - }, - - _setPositionRelative: function() { - if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) { - this.element[ 0 ].style.position = "relative"; - } - }, - - _adjustOffsetFromHelper: function( obj ) { - if ( typeof obj === "string" ) { - obj = obj.split( " " ); - } - if ( Array.isArray( obj ) ) { - obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; - } - if ( "left" in obj ) { - this.offset.click.left = obj.left + this.margins.left; - } - if ( "right" in obj ) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ( "top" in obj ) { - this.offset.click.top = obj.top + this.margins.top; - } - if ( "bottom" in obj ) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _isRootNode: function( element ) { - return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ]; - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - var po = this.offsetParent.offset(), - document = this.document[ 0 ]; - - // This is a special case where we need to modify a offset calculated on start, since the - // following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the - // next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't - // the document, which means that the scroll is included in the initial calculation of the - // offset of the parent, and never recalculated upon drag - if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if ( this._isRootNode( this.offsetParent[ 0 ] ) ) { - po = { top: 0, left: 0 }; - } - - return { - top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), - left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) - }; - - }, - - _getRelativeOffset: function() { - if ( this.cssPosition !== "relative" ) { - return { top: 0, left: 0 }; - } - - var p = this.element.position(), - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); - - return { - top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + - ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), - left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + - ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) - }; - - }, - - _cacheMargins: function() { - this.margins = { - left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), - top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), - right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), - bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var isUserScrollable, c, ce, - o = this.options, - document = this.document[ 0 ]; - - this.relativeContainer = null; - - if ( !o.containment ) { - this.containment = null; - return; - } - - if ( o.containment === "window" ) { - this.containment = [ - $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, - $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, - $( window ).scrollLeft() + $( window ).width() - - this.helperProportions.width - this.margins.left, - $( window ).scrollTop() + - ( $( window ).height() || document.body.parentNode.scrollHeight ) - - this.helperProportions.height - this.margins.top - ]; - return; - } - - if ( o.containment === "document" ) { - this.containment = [ - 0, - 0, - $( document ).width() - this.helperProportions.width - this.margins.left, - ( $( document ).height() || document.body.parentNode.scrollHeight ) - - this.helperProportions.height - this.margins.top - ]; - return; - } - - if ( o.containment.constructor === Array ) { - this.containment = o.containment; - return; - } - - if ( o.containment === "parent" ) { - o.containment = this.helper[ 0 ].parentNode; - } - - c = $( o.containment ); - ce = c[ 0 ]; - - if ( !ce ) { - return; - } - - isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) ); - - this.containment = [ - ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + - ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), - ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + - ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), - ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - - this.helperProportions.width - - this.margins.left - - this.margins.right, - ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - - this.helperProportions.height - - this.margins.top - - this.margins.bottom - ]; - this.relativeContainer = c; - }, - - _convertPositionTo: function( d, pos ) { - - if ( !pos ) { - pos = this.position; - } - - var mod = d === "absolute" ? 1 : -1, - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); - - return { - top: ( - - // The absolute mouse position - pos.top + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top * mod - - ( ( this.cssPosition === "fixed" ? - -this.offset.scroll.top : - ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) - ), - left: ( - - // The absolute mouse position - pos.left + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left * mod - - ( ( this.cssPosition === "fixed" ? - -this.offset.scroll.left : - ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) - ) - }; - - }, - - _generatePosition: function( event, constrainPosition ) { - - var containment, co, top, left, - o = this.options, - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ), - pageX = event.pageX, - pageY = event.pageY; - - // Cache the scroll - if ( !scrollIsRootNode || !this.offset.scroll ) { - this.offset.scroll = { - top: this.scrollParent.scrollTop(), - left: this.scrollParent.scrollLeft() - }; - } - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - // If we are not dragging yet, we won't check for options - if ( constrainPosition ) { - if ( this.containment ) { - if ( this.relativeContainer ) { - co = this.relativeContainer.offset(); - containment = [ - this.containment[ 0 ] + co.left, - this.containment[ 1 ] + co.top, - this.containment[ 2 ] + co.left, - this.containment[ 3 ] + co.top - ]; - } else { - containment = this.containment; - } - - if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { - pageX = containment[ 0 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { - pageY = containment[ 1 ] + this.offset.click.top; - } - if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { - pageX = containment[ 2 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { - pageY = containment[ 3 ] + this.offset.click.top; - } - } - - if ( o.grid ) { - - //Check for grid elements set to 0 to prevent divide by 0 error causing invalid - // argument errors in IE (see ticket #6950) - top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - - this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; - pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || - top - this.offset.click.top > containment[ 3 ] ) ? - top : - ( ( top - this.offset.click.top >= containment[ 1 ] ) ? - top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; - - left = o.grid[ 0 ] ? this.originalPageX + - Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : - this.originalPageX; - pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || - left - this.offset.click.left > containment[ 2 ] ) ? - left : - ( ( left - this.offset.click.left >= containment[ 0 ] ) ? - left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; - } - - if ( o.axis === "y" ) { - pageX = this.originalPageX; - } - - if ( o.axis === "x" ) { - pageY = this.originalPageY; - } - } - - return { - top: ( - - // The absolute mouse position - pageY - - - // Click offset (relative to the element) - this.offset.click.top - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top + - ( this.cssPosition === "fixed" ? - -this.offset.scroll.top : - ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) - ), - left: ( - - // The absolute mouse position - pageX - - - // Click offset (relative to the element) - this.offset.click.left - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left + - ( this.cssPosition === "fixed" ? - -this.offset.scroll.left : - ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) - ) - }; - - }, - - _clear: function() { - this._removeClass( this.helper, "ui-draggable-dragging" ); - if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { - this.helper.remove(); - } - this.helper = null; - this.cancelHelperRemoval = false; - if ( this.destroyOnClear ) { - this.destroy(); - } - }, - - // From now on bulk stuff - mainly helpers - - _trigger: function( type, event, ui ) { - ui = ui || this._uiHash(); - $.ui.plugin.call( this, type, [ event, ui, this ], true ); - - // Absolute position and offset (see #6884 ) have to be recalculated after plugins - if ( /^(drag|start|stop)/.test( type ) ) { - this.positionAbs = this._convertPositionTo( "absolute" ); - ui.offset = this.positionAbs; - } - return $.Widget.prototype._trigger.call( this, type, event, ui ); - }, - - plugins: {}, - - _uiHash: function() { - return { - helper: this.helper, - position: this.position, - originalPosition: this.originalPosition, - offset: this.positionAbs - }; - } - -} ); - -$.ui.plugin.add( "draggable", "connectToSortable", { - start: function( event, ui, draggable ) { - var uiSortable = $.extend( {}, ui, { - item: draggable.element - } ); - - draggable.sortables = []; - $( draggable.options.connectToSortable ).each( function() { - var sortable = $( this ).sortable( "instance" ); - - if ( sortable && !sortable.options.disabled ) { - draggable.sortables.push( sortable ); - - // RefreshPositions is called at drag start to refresh the containerCache - // which is used in drag. This ensures it's initialized and synchronized - // with any changes that might have happened on the page since initialization. - sortable.refreshPositions(); - sortable._trigger( "activate", event, uiSortable ); - } - } ); - }, - stop: function( event, ui, draggable ) { - var uiSortable = $.extend( {}, ui, { - item: draggable.element - } ); - - draggable.cancelHelperRemoval = false; - - $.each( draggable.sortables, function() { - var sortable = this; - - if ( sortable.isOver ) { - sortable.isOver = 0; - - // Allow this sortable to handle removing the helper - draggable.cancelHelperRemoval = true; - sortable.cancelHelperRemoval = false; - - // Use _storedCSS To restore properties in the sortable, - // as this also handles revert (#9675) since the draggable - // may have modified them in unexpected ways (#8809) - sortable._storedCSS = { - position: sortable.placeholder.css( "position" ), - top: sortable.placeholder.css( "top" ), - left: sortable.placeholder.css( "left" ) - }; - - sortable._mouseStop( event ); - - // Once drag has ended, the sortable should return to using - // its original helper, not the shared helper from draggable - sortable.options.helper = sortable.options._helper; - } else { - - // Prevent this Sortable from removing the helper. - // However, don't set the draggable to remove the helper - // either as another connected Sortable may yet handle the removal. - sortable.cancelHelperRemoval = true; - - sortable._trigger( "deactivate", event, uiSortable ); - } - } ); - }, - drag: function( event, ui, draggable ) { - $.each( draggable.sortables, function() { - var innermostIntersecting = false, - sortable = this; - - // Copy over variables that sortable's _intersectsWith uses - sortable.positionAbs = draggable.positionAbs; - sortable.helperProportions = draggable.helperProportions; - sortable.offset.click = draggable.offset.click; - - if ( sortable._intersectsWith( sortable.containerCache ) ) { - innermostIntersecting = true; - - $.each( draggable.sortables, function() { - - // Copy over variables that sortable's _intersectsWith uses - this.positionAbs = draggable.positionAbs; - this.helperProportions = draggable.helperProportions; - this.offset.click = draggable.offset.click; - - if ( this !== sortable && - this._intersectsWith( this.containerCache ) && - $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) { - innermostIntersecting = false; - } - - return innermostIntersecting; - } ); - } - - if ( innermostIntersecting ) { - - // If it intersects, we use a little isOver variable and set it once, - // so that the move-in stuff gets fired only once. - if ( !sortable.isOver ) { - sortable.isOver = 1; - - // Store draggable's parent in case we need to reappend to it later. - draggable._parent = ui.helper.parent(); - - sortable.currentItem = ui.helper - .appendTo( sortable.element ) - .data( "ui-sortable-item", true ); - - // Store helper option to later restore it - sortable.options._helper = sortable.options.helper; - - sortable.options.helper = function() { - return ui.helper[ 0 ]; - }; - - // Fire the start events of the sortable with our passed browser event, - // and our own helper (so it doesn't create a new one) - event.target = sortable.currentItem[ 0 ]; - sortable._mouseCapture( event, true ); - sortable._mouseStart( event, true, true ); - - // Because the browser event is way off the new appended portlet, - // modify necessary variables to reflect the changes - sortable.offset.click.top = draggable.offset.click.top; - sortable.offset.click.left = draggable.offset.click.left; - sortable.offset.parent.left -= draggable.offset.parent.left - - sortable.offset.parent.left; - sortable.offset.parent.top -= draggable.offset.parent.top - - sortable.offset.parent.top; - - draggable._trigger( "toSortable", event ); - - // Inform draggable that the helper is in a valid drop zone, - // used solely in the revert option to handle "valid/invalid". - draggable.dropped = sortable.element; - - // Need to refreshPositions of all sortables in the case that - // adding to one sortable changes the location of the other sortables (#9675) - $.each( draggable.sortables, function() { - this.refreshPositions(); - } ); - - // Hack so receive/update callbacks work (mostly) - draggable.currentItem = draggable.element; - sortable.fromOutside = draggable; - } - - if ( sortable.currentItem ) { - sortable._mouseDrag( event ); - - // Copy the sortable's position because the draggable's can potentially reflect - // a relative position, while sortable is always absolute, which the dragged - // element has now become. (#8809) - ui.position = sortable.position; - } - } else { - - // If it doesn't intersect with the sortable, and it intersected before, - // we fake the drag stop of the sortable, but make sure it doesn't remove - // the helper by using cancelHelperRemoval. - if ( sortable.isOver ) { - - sortable.isOver = 0; - sortable.cancelHelperRemoval = true; - - // Calling sortable's mouseStop would trigger a revert, - // so revert must be temporarily false until after mouseStop is called. - sortable.options._revert = sortable.options.revert; - sortable.options.revert = false; - - sortable._trigger( "out", event, sortable._uiHash( sortable ) ); - sortable._mouseStop( event, true ); - - // Restore sortable behaviors that were modfied - // when the draggable entered the sortable area (#9481) - sortable.options.revert = sortable.options._revert; - sortable.options.helper = sortable.options._helper; - - if ( sortable.placeholder ) { - sortable.placeholder.remove(); - } - - // Restore and recalculate the draggable's offset considering the sortable - // may have modified them in unexpected ways. (#8809, #10669) - ui.helper.appendTo( draggable._parent ); - draggable._refreshOffsets( event ); - ui.position = draggable._generatePosition( event, true ); - - draggable._trigger( "fromSortable", event ); - - // Inform draggable that the helper is no longer in a valid drop zone - draggable.dropped = false; - - // Need to refreshPositions of all sortables just in case removing - // from one sortable changes the location of other sortables (#9675) - $.each( draggable.sortables, function() { - this.refreshPositions(); - } ); - } - } - } ); - } -} ); - -$.ui.plugin.add( "draggable", "cursor", { - start: function( event, ui, instance ) { - var t = $( "body" ), - o = instance.options; - - if ( t.css( "cursor" ) ) { - o._cursor = t.css( "cursor" ); - } - t.css( "cursor", o.cursor ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - if ( o._cursor ) { - $( "body" ).css( "cursor", o._cursor ); - } - } -} ); - -$.ui.plugin.add( "draggable", "opacity", { - start: function( event, ui, instance ) { - var t = $( ui.helper ), - o = instance.options; - if ( t.css( "opacity" ) ) { - o._opacity = t.css( "opacity" ); - } - t.css( "opacity", o.opacity ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - if ( o._opacity ) { - $( ui.helper ).css( "opacity", o._opacity ); - } - } -} ); - -$.ui.plugin.add( "draggable", "scroll", { - start: function( event, ui, i ) { - if ( !i.scrollParentNotHidden ) { - i.scrollParentNotHidden = i.helper.scrollParent( false ); - } - - if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && - i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { - i.overflowOffset = i.scrollParentNotHidden.offset(); - } - }, - drag: function( event, ui, i ) { - - var o = i.options, - scrolled = false, - scrollParent = i.scrollParentNotHidden[ 0 ], - document = i.document[ 0 ]; - - if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { - if ( !o.axis || o.axis !== "x" ) { - if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < - o.scrollSensitivity ) { - scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; - } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { - scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed; - } - } - - if ( !o.axis || o.axis !== "y" ) { - if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < - o.scrollSensitivity ) { - scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; - } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { - scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed; - } - } - - } else { - - if ( !o.axis || o.axis !== "x" ) { - if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { - scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); - } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < - o.scrollSensitivity ) { - scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); - } - } - - if ( !o.axis || o.axis !== "y" ) { - if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { - scrolled = $( document ).scrollLeft( - $( document ).scrollLeft() - o.scrollSpeed - ); - } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < - o.scrollSensitivity ) { - scrolled = $( document ).scrollLeft( - $( document ).scrollLeft() + o.scrollSpeed - ); - } - } - - } - - if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( i, event ); - } - - } -} ); - -$.ui.plugin.add( "draggable", "snap", { - start: function( event, ui, i ) { - - var o = i.options; - - i.snapElements = []; - - $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) - .each( function() { - var $t = $( this ), - $o = $t.offset(); - if ( this !== i.element[ 0 ] ) { - i.snapElements.push( { - item: this, - width: $t.outerWidth(), height: $t.outerHeight(), - top: $o.top, left: $o.left - } ); - } - } ); - - }, - drag: function( event, ui, inst ) { - - var ts, bs, ls, rs, l, r, t, b, i, first, - o = inst.options, - d = o.snapTolerance, - x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, - y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; - - for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { - - l = inst.snapElements[ i ].left - inst.margins.left; - r = l + inst.snapElements[ i ].width; - t = inst.snapElements[ i ].top - inst.margins.top; - b = t + inst.snapElements[ i ].height; - - if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || - !$.contains( inst.snapElements[ i ].item.ownerDocument, - inst.snapElements[ i ].item ) ) { - if ( inst.snapElements[ i ].snapping ) { - if ( inst.options.snap.release ) { - inst.options.snap.release.call( - inst.element, - event, - $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) - ); - } - } - inst.snapElements[ i ].snapping = false; - continue; - } - - if ( o.snapMode !== "inner" ) { - ts = Math.abs( t - y2 ) <= d; - bs = Math.abs( b - y1 ) <= d; - ls = Math.abs( l - x2 ) <= d; - rs = Math.abs( r - x1 ) <= d; - if ( ts ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: t - inst.helperProportions.height, - left: 0 - } ).top; - } - if ( bs ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: b, - left: 0 - } ).top; - } - if ( ls ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: l - inst.helperProportions.width - } ).left; - } - if ( rs ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: r - } ).left; - } - } - - first = ( ts || bs || ls || rs ); - - if ( o.snapMode !== "outer" ) { - ts = Math.abs( t - y1 ) <= d; - bs = Math.abs( b - y2 ) <= d; - ls = Math.abs( l - x1 ) <= d; - rs = Math.abs( r - x2 ) <= d; - if ( ts ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: t, - left: 0 - } ).top; - } - if ( bs ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: b - inst.helperProportions.height, - left: 0 - } ).top; - } - if ( ls ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: l - } ).left; - } - if ( rs ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: r - inst.helperProportions.width - } ).left; - } - } - - if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { - if ( inst.options.snap.snap ) { - inst.options.snap.snap.call( - inst.element, - event, - $.extend( inst._uiHash(), { - snapItem: inst.snapElements[ i ].item - } ) ); - } - } - inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); - - } - - } -} ); - -$.ui.plugin.add( "draggable", "stack", { - start: function( event, ui, instance ) { - var min, - o = instance.options, - group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { - return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - - ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); - } ); - - if ( !group.length ) { - return; - } - - min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; - $( group ).each( function( i ) { - $( this ).css( "zIndex", min + i ); - } ); - this.css( "zIndex", ( min + group.length ) ); - } -} ); - -$.ui.plugin.add( "draggable", "zIndex", { - start: function( event, ui, instance ) { - var t = $( ui.helper ), - o = instance.options; - - if ( t.css( "zIndex" ) ) { - o._zIndex = t.css( "zIndex" ); - } - t.css( "zIndex", o.zIndex ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - - if ( o._zIndex ) { - $( ui.helper ).css( "zIndex", o._zIndex ); - } - } -} ); - -var widgetsDraggable = $.ui.draggable; - - -/*! - * jQuery UI Resizable 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Resizable -//>>group: Interactions -//>>description: Enables resize functionality for any element. -//>>docs: https://api.jqueryui.com/resizable/ -//>>demos: https://jqueryui.com/resizable/ -//>>css.structure: ../../themes/base/core.css -//>>css.structure: ../../themes/base/resizable.css -//>>css.theme: ../../themes/base/theme.css - - -$.widget( "ui.resizable", $.ui.mouse, { - version: "1.14.1", - widgetEventPrefix: "resize", - options: { - alsoResize: false, - animate: false, - animateDuration: "slow", - animateEasing: "swing", - aspectRatio: false, - autoHide: false, - classes: { - "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" - }, - containment: false, - ghost: false, - grid: false, - handles: "e,s,se", - helper: false, - maxHeight: null, - maxWidth: null, - minHeight: 10, - minWidth: 10, - - // See #7960 - zIndex: 90, - - // Callbacks - resize: null, - start: null, - stop: null - }, - - _num: function( value ) { - return parseFloat( value ) || 0; - }, - - _isNumber: function( value ) { - return !isNaN( parseFloat( value ) ); - }, - - _hasScroll: function( el, a ) { - - var scroll, - has = false, - overflow = $( el ).css( "overflow" ); - - if ( overflow === "hidden" ) { - return false; - } - if ( overflow === "scroll" ) { - return true; - } - - scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop"; - - if ( el[ scroll ] > 0 ) { - return true; - } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - try { - el[ scroll ] = 1; - has = ( el[ scroll ] > 0 ); - el[ scroll ] = 0; - } catch ( e ) { - - // `el` might be a string, then setting `scroll` will throw - // an error in strict mode; ignore it. - } - return has; - }, - - _create: function() { - - var margins, - o = this.options, - that = this; - this._addClass( "ui-resizable" ); - - $.extend( this, { - _aspectRatio: !!( o.aspectRatio ), - aspectRatio: o.aspectRatio, - originalElement: this.element, - _proportionallyResizeElements: [], - _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null - } ); - - // Wrap the element if it cannot hold child nodes - if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) { - - this.element.wrap( - $( "
" ).css( { - overflow: "hidden", - position: this.element.css( "position" ), - width: this.element.outerWidth(), - height: this.element.outerHeight(), - top: this.element.css( "top" ), - left: this.element.css( "left" ) - } ) - ); - - this.element = this.element.parent().data( - "ui-resizable", this.element.resizable( "instance" ) - ); - - this.elementIsWrapper = true; - - margins = { - marginTop: this.originalElement.css( "marginTop" ), - marginRight: this.originalElement.css( "marginRight" ), - marginBottom: this.originalElement.css( "marginBottom" ), - marginLeft: this.originalElement.css( "marginLeft" ) - }; - - this.element.css( margins ); - - // Support: Safari - // Prevent Safari textarea resize - this.originalResizeStyle = this.originalElement.css( "resize" ); - this.originalElement.css( "resize", "none" ); - - this._proportionallyResizeElements.push( this.originalElement.css( { - position: "static", - zoom: 1, - display: "block" - } ) ); - - this._proportionallyResize(); - } - - this._setupHandles(); - - if ( o.autoHide ) { - $( this.element ) - .on( "mouseenter", function() { - if ( o.disabled ) { - return; - } - that._removeClass( "ui-resizable-autohide" ); - that._handles.show(); - } ) - .on( "mouseleave", function() { - if ( o.disabled ) { - return; - } - if ( !that.resizing ) { - that._addClass( "ui-resizable-autohide" ); - that._handles.hide(); - } - } ); - } - - this._mouseInit(); - }, - - _destroy: function() { - - this._mouseDestroy(); - this._addedHandles.remove(); - - var wrapper, - _destroy = function( exp ) { - $( exp ) - .removeData( "resizable" ) - .removeData( "ui-resizable" ) - .off( ".resizable" ); - }; - - // TODO: Unwrap at same DOM position - if ( this.elementIsWrapper ) { - _destroy( this.element ); - wrapper = this.element; - this.originalElement.css( { - position: wrapper.css( "position" ), - width: wrapper.outerWidth(), - height: wrapper.outerHeight(), - top: wrapper.css( "top" ), - left: wrapper.css( "left" ) - } ).insertAfter( wrapper ); - wrapper.remove(); - } - - this.originalElement.css( "resize", this.originalResizeStyle ); - _destroy( this.originalElement ); - - return this; - }, - - _setOption: function( key, value ) { - this._super( key, value ); - - switch ( key ) { - case "handles": - this._removeHandles(); - this._setupHandles(); - break; - case "aspectRatio": - this._aspectRatio = !!value; - break; - default: - break; - } - }, - - _setupHandles: function() { - var o = this.options, handle, i, n, hname, axis, that = this; - this.handles = o.handles || - ( !$( ".ui-resizable-handle", this.element ).length ? - "e,s,se" : { - n: ".ui-resizable-n", - e: ".ui-resizable-e", - s: ".ui-resizable-s", - w: ".ui-resizable-w", - se: ".ui-resizable-se", - sw: ".ui-resizable-sw", - ne: ".ui-resizable-ne", - nw: ".ui-resizable-nw" - } ); - - this._handles = $(); - this._addedHandles = $(); - if ( this.handles.constructor === String ) { - - if ( this.handles === "all" ) { - this.handles = "n,e,s,w,se,sw,ne,nw"; - } - - n = this.handles.split( "," ); - this.handles = {}; - - for ( i = 0; i < n.length; i++ ) { - - handle = String.prototype.trim.call( n[ i ] ); - hname = "ui-resizable-" + handle; - axis = $( "
" ); - this._addClass( axis, "ui-resizable-handle " + hname ); - - axis.css( { zIndex: o.zIndex } ); - - this.handles[ handle ] = ".ui-resizable-" + handle; - if ( !this.element.children( this.handles[ handle ] ).length ) { - this.element.append( axis ); - this._addedHandles = this._addedHandles.add( axis ); - } - } - - } - - this._renderAxis = function( target ) { - - var i, axis, padPos, padWrapper; - - target = target || this.element; - - for ( i in this.handles ) { - - if ( this.handles[ i ].constructor === String ) { - this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show(); - } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) { - this.handles[ i ] = $( this.handles[ i ] ); - this._on( this.handles[ i ], { "mousedown": that._mouseDown } ); - } - - if ( this.elementIsWrapper && - this.originalElement[ 0 ] - .nodeName - .match( /^(textarea|input|select|button)$/i ) ) { - axis = $( this.handles[ i ], this.element ); - - padWrapper = /sw|ne|nw|se|n|s/.test( i ) ? - axis.outerHeight() : - axis.outerWidth(); - - padPos = [ "padding", - /ne|nw|n/.test( i ) ? "Top" : - /se|sw|s/.test( i ) ? "Bottom" : - /^e$/.test( i ) ? "Right" : "Left" ].join( "" ); - - target.css( padPos, padWrapper ); - - this._proportionallyResize(); - } - - this._handles = this._handles.add( this.handles[ i ] ); - } - }; - - // TODO: make renderAxis a prototype function - this._renderAxis( this.element ); - - this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) ); - this._handles.disableSelection(); - - this._handles.on( "mouseover", function() { - if ( !that.resizing ) { - if ( this.className ) { - axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i ); - } - that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se"; - } - } ); - - if ( o.autoHide ) { - this._handles.hide(); - this._addClass( "ui-resizable-autohide" ); - } - }, - - _removeHandles: function() { - this._addedHandles.remove(); - }, - - _mouseCapture: function( event ) { - var i, handle, - capture = false; - - for ( i in this.handles ) { - handle = $( this.handles[ i ] )[ 0 ]; - if ( handle === event.target || $.contains( handle, event.target ) ) { - capture = true; - } - } - - return !this.options.disabled && capture; - }, - - _mouseStart: function( event ) { - - var curleft, curtop, cursor, calculatedSize, - o = this.options, - el = this.element; - - this.resizing = true; - - this._renderProxy(); - - curleft = this._num( this.helper.css( "left" ) ); - curtop = this._num( this.helper.css( "top" ) ); - - if ( o.containment ) { - curleft += $( o.containment ).scrollLeft() || 0; - curtop += $( o.containment ).scrollTop() || 0; - } - - this.offset = this.helper.offset(); - this.position = { left: curleft, top: curtop }; - - if ( !this._helper ) { - calculatedSize = this._calculateAdjustedElementDimensions( el ); - } - - this.size = this._helper ? { - width: this.helper.width(), - height: this.helper.height() - } : { - width: calculatedSize.width, - height: calculatedSize.height - }; - - this.originalSize = this._helper ? { - width: el.outerWidth(), - height: el.outerHeight() - } : { - width: calculatedSize.width, - height: calculatedSize.height - }; - - this.sizeDiff = { - width: el.outerWidth() - el.width(), - height: el.outerHeight() - el.height() - }; - - this.originalPosition = { left: curleft, top: curtop }; - this.originalMousePosition = { left: event.pageX, top: event.pageY }; - - this.aspectRatio = ( typeof o.aspectRatio === "number" ) ? - o.aspectRatio : - ( ( this.originalSize.width / this.originalSize.height ) || 1 ); - - cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" ); - $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor ); - - this._addClass( "ui-resizable-resizing" ); - this._propagate( "start", event ); - return true; - }, - - _mouseDrag: function( event ) { - - var data, props, - smp = this.originalMousePosition, - a = this.axis, - dx = ( event.pageX - smp.left ) || 0, - dy = ( event.pageY - smp.top ) || 0, - trigger = this._change[ a ]; - - this._updatePrevProperties(); - - if ( !trigger ) { - return false; - } - - data = trigger.apply( this, [ event, dx, dy ] ); - - this._updateVirtualBoundaries( event.shiftKey ); - if ( this._aspectRatio || event.shiftKey ) { - data = this._updateRatio( data, event ); - } - - data = this._respectSize( data, event ); - - this._updateCache( data ); - - this._propagate( "resize", event ); - - props = this._applyChanges(); - - if ( !this._helper && this._proportionallyResizeElements.length ) { - this._proportionallyResize(); - } - - if ( !$.isEmptyObject( props ) ) { - this._updatePrevProperties(); - this._trigger( "resize", event, this.ui() ); - this._applyChanges(); - } - - return false; - }, - - _mouseStop: function( event ) { - - this.resizing = false; - var pr, ista, soffseth, soffsetw, s, left, top, - o = this.options, that = this; - - if ( this._helper ) { - - pr = this._proportionallyResizeElements; - ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ); - soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height; - soffsetw = ista ? 0 : that.sizeDiff.width; - - s = { - width: ( that.helper.width() - soffsetw ), - height: ( that.helper.height() - soffseth ) - }; - left = ( parseFloat( that.element.css( "left" ) ) + - ( that.position.left - that.originalPosition.left ) ) || null; - top = ( parseFloat( that.element.css( "top" ) ) + - ( that.position.top - that.originalPosition.top ) ) || null; - - if ( !o.animate ) { - this.element.css( $.extend( s, { top: top, left: left } ) ); - } - - that.helper.height( that.size.height ); - that.helper.width( that.size.width ); - - if ( this._helper && !o.animate ) { - this._proportionallyResize(); - } - } - - $( "body" ).css( "cursor", "auto" ); - - this._removeClass( "ui-resizable-resizing" ); - - this._propagate( "stop", event ); - - if ( this._helper ) { - this.helper.remove(); - } - - return false; - - }, - - _updatePrevProperties: function() { - this.prevPosition = { - top: this.position.top, - left: this.position.left - }; - this.prevSize = { - width: this.size.width, - height: this.size.height - }; - }, - - _applyChanges: function() { - var props = {}; - - if ( this.position.top !== this.prevPosition.top ) { - props.top = this.position.top + "px"; - } - if ( this.position.left !== this.prevPosition.left ) { - props.left = this.position.left + "px"; - } - - this.helper.css( props ); - - if ( this.size.width !== this.prevSize.width ) { - props.width = this.size.width + "px"; - this.helper.width( props.width ); - } - if ( this.size.height !== this.prevSize.height ) { - props.height = this.size.height + "px"; - this.helper.height( props.height ); - } - - return props; - }, - - _updateVirtualBoundaries: function( forceAspectRatio ) { - var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, - o = this.options; - - b = { - minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0, - maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity, - minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0, - maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity - }; - - if ( this._aspectRatio || forceAspectRatio ) { - pMinWidth = b.minHeight * this.aspectRatio; - pMinHeight = b.minWidth / this.aspectRatio; - pMaxWidth = b.maxHeight * this.aspectRatio; - pMaxHeight = b.maxWidth / this.aspectRatio; - - if ( pMinWidth > b.minWidth ) { - b.minWidth = pMinWidth; - } - if ( pMinHeight > b.minHeight ) { - b.minHeight = pMinHeight; - } - if ( pMaxWidth < b.maxWidth ) { - b.maxWidth = pMaxWidth; - } - if ( pMaxHeight < b.maxHeight ) { - b.maxHeight = pMaxHeight; - } - } - this._vBoundaries = b; - }, - - _updateCache: function( data ) { - this.offset = this.helper.offset(); - if ( this._isNumber( data.left ) ) { - this.position.left = data.left; - } - if ( this._isNumber( data.top ) ) { - this.position.top = data.top; - } - if ( this._isNumber( data.height ) ) { - this.size.height = data.height; - } - if ( this._isNumber( data.width ) ) { - this.size.width = data.width; - } - }, - - _updateRatio: function( data ) { - - var cpos = this.position, - csize = this.size, - a = this.axis; - - if ( this._isNumber( data.height ) ) { - data.width = ( data.height * this.aspectRatio ); - } else if ( this._isNumber( data.width ) ) { - data.height = ( data.width / this.aspectRatio ); - } - - if ( a === "sw" ) { - data.left = cpos.left + ( csize.width - data.width ); - data.top = null; - } - if ( a === "nw" ) { - data.top = cpos.top + ( csize.height - data.height ); - data.left = cpos.left + ( csize.width - data.width ); - } - - return data; - }, - - _respectSize: function( data ) { - - var o = this._vBoundaries, - a = this.axis, - ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ), - ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ), - isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ), - isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ), - dw = this.originalPosition.left + this.originalSize.width, - dh = this.originalPosition.top + this.originalSize.height, - cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a ); - if ( isminw ) { - data.width = o.minWidth; - } - if ( isminh ) { - data.height = o.minHeight; - } - if ( ismaxw ) { - data.width = o.maxWidth; - } - if ( ismaxh ) { - data.height = o.maxHeight; - } - - if ( isminw && cw ) { - data.left = dw - o.minWidth; - } - if ( ismaxw && cw ) { - data.left = dw - o.maxWidth; - } - if ( isminh && ch ) { - data.top = dh - o.minHeight; - } - if ( ismaxh && ch ) { - data.top = dh - o.maxHeight; - } - - // Fixing jump error on top/left - bug #2330 - if ( !data.width && !data.height && !data.left && data.top ) { - data.top = null; - } else if ( !data.width && !data.height && !data.top && data.left ) { - data.left = null; - } - - return data; - }, - - _getPaddingPlusBorderDimensions: function( element ) { - var i = 0, - widths = [], - borders = [ - element.css( "borderTopWidth" ), - element.css( "borderRightWidth" ), - element.css( "borderBottomWidth" ), - element.css( "borderLeftWidth" ) - ], - paddings = [ - element.css( "paddingTop" ), - element.css( "paddingRight" ), - element.css( "paddingBottom" ), - element.css( "paddingLeft" ) - ]; - - for ( ; i < 4; i++ ) { - widths[ i ] = ( parseFloat( borders[ i ] ) || 0 ); - widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 ); - } - - return { - height: widths[ 0 ] + widths[ 2 ], - width: widths[ 1 ] + widths[ 3 ] - }; - }, - - _calculateAdjustedElementDimensions: function( element ) { - var elWidth, elHeight, paddingBorder, - ce = element.get( 0 ); - - if ( element.css( "box-sizing" ) !== "content-box" || - ( !this._hasScroll( ce ) && !this._hasScroll( ce, "left" ) ) ) { - return { - height: parseFloat( element.css( "height" ) ), - width: parseFloat( element.css( "width" ) ) - }; - } - - // Check if CSS inline styles are set and use those (usually from previous resizes) - elWidth = parseFloat( ce.style.width ); - elHeight = parseFloat( ce.style.height ); - - paddingBorder = this._getPaddingPlusBorderDimensions( element ); - elWidth = isNaN( elWidth ) ? - this._getElementTheoreticalSize( element, paddingBorder, "width" ) : - elWidth; - elHeight = isNaN( elHeight ) ? - this._getElementTheoreticalSize( element, paddingBorder, "height" ) : - elHeight; - - return { - height: elHeight, - width: elWidth - }; - }, - - _getElementTheoreticalSize: function( element, extraSize, dimension ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - var size = Math.max( 0, Math.ceil( - element.get( 0 )[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - extraSize[ dimension ] - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine theoretical size. - // Use an explicit zero to avoid NaN. - // See https://github.com/jquery/jquery/issues/3964 - ) ) || 0; - - return size; - }, - - _proportionallyResize: function() { - - if ( !this._proportionallyResizeElements.length ) { - return; - } - - var prel, - i = 0, - element = this.helper || this.element; - - for ( ; i < this._proportionallyResizeElements.length; i++ ) { - - prel = this._proportionallyResizeElements[ i ]; - - // TODO: Seems like a bug to cache this.outerDimensions - // considering that we are in a loop. - if ( !this.outerDimensions ) { - this.outerDimensions = this._getPaddingPlusBorderDimensions( prel ); - } - - prel.css( { - height: ( element.height() - this.outerDimensions.height ) || 0, - width: ( element.width() - this.outerDimensions.width ) || 0 - } ); - - } - - }, - - _renderProxy: function() { - - var el = this.element, o = this.options; - this.elementOffset = el.offset(); - - if ( this._helper ) { - - this.helper = this.helper || $( "
" ).css( { overflow: "hidden" } ); - - this._addClass( this.helper, this._helper ); - this.helper.css( { - width: this.element.outerWidth(), - height: this.element.outerHeight(), - position: "absolute", - left: this.elementOffset.left + "px", - top: this.elementOffset.top + "px", - zIndex: ++o.zIndex //TODO: Don't modify option - } ); - - this.helper - .appendTo( "body" ) - .disableSelection(); - - } else { - this.helper = this.element; - } - - }, - - _change: { - e: function( event, dx ) { - return { width: this.originalSize.width + dx }; - }, - w: function( event, dx ) { - var cs = this.originalSize, sp = this.originalPosition; - return { left: sp.left + dx, width: cs.width - dx }; - }, - n: function( event, dx, dy ) { - var cs = this.originalSize, sp = this.originalPosition; - return { top: sp.top + dy, height: cs.height - dy }; - }, - s: function( event, dx, dy ) { - return { height: this.originalSize.height + dy }; - }, - se: function( event, dx, dy ) { - return $.extend( this._change.s.apply( this, arguments ), - this._change.e.apply( this, [ event, dx, dy ] ) ); - }, - sw: function( event, dx, dy ) { - return $.extend( this._change.s.apply( this, arguments ), - this._change.w.apply( this, [ event, dx, dy ] ) ); - }, - ne: function( event, dx, dy ) { - return $.extend( this._change.n.apply( this, arguments ), - this._change.e.apply( this, [ event, dx, dy ] ) ); - }, - nw: function( event, dx, dy ) { - return $.extend( this._change.n.apply( this, arguments ), - this._change.w.apply( this, [ event, dx, dy ] ) ); - } - }, - - _propagate: function( n, event ) { - $.ui.plugin.call( this, n, [ event, this.ui() ] ); - if ( n !== "resize" ) { - this._trigger( n, event, this.ui() ); - } - }, - - plugins: {}, - - ui: function() { - return { - originalElement: this.originalElement, - element: this.element, - helper: this.helper, - position: this.position, - size: this.size, - originalSize: this.originalSize, - originalPosition: this.originalPosition - }; - } - -} ); - -/* - * Resizable Extensions - */ - -$.ui.plugin.add( "resizable", "animate", { - - stop: function( event ) { - var that = $( this ).resizable( "instance" ), - o = that.options, - pr = that._proportionallyResizeElements, - ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ), - soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height, - soffsetw = ista ? 0 : that.sizeDiff.width, - style = { - width: ( that.size.width - soffsetw ), - height: ( that.size.height - soffseth ) - }, - left = ( parseFloat( that.element.css( "left" ) ) + - ( that.position.left - that.originalPosition.left ) ) || null, - top = ( parseFloat( that.element.css( "top" ) ) + - ( that.position.top - that.originalPosition.top ) ) || null; - - that.element.animate( - $.extend( style, top && left ? { top: top, left: left } : {} ), { - duration: o.animateDuration, - easing: o.animateEasing, - step: function() { - - var data = { - width: parseFloat( that.element.css( "width" ) ), - height: parseFloat( that.element.css( "height" ) ), - top: parseFloat( that.element.css( "top" ) ), - left: parseFloat( that.element.css( "left" ) ) - }; - - if ( pr && pr.length ) { - $( pr[ 0 ] ).css( { width: data.width, height: data.height } ); - } - - // Propagating resize, and updating values for each animation step - that._updateCache( data ); - that._propagate( "resize", event ); - - } - } - ); - } - -} ); - -$.ui.plugin.add( "resizable", "containment", { - - start: function() { - var element, p, co, ch, cw, width, height, - that = $( this ).resizable( "instance" ), - o = that.options, - el = that.element, - oc = o.containment, - ce = ( oc instanceof $ ) ? - oc.get( 0 ) : - ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc; - - if ( !ce ) { - return; - } - - that.containerElement = $( ce ); - - if ( /document/.test( oc ) || oc === document ) { - that.containerOffset = { - left: 0, - top: 0 - }; - that.containerPosition = { - left: 0, - top: 0 - }; - - that.parentData = { - element: $( document ), - left: 0, - top: 0, - width: $( document ).width(), - height: $( document ).height() || document.body.parentNode.scrollHeight - }; - } else { - element = $( ce ); - p = []; - $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) { - p[ i ] = that._num( element.css( "padding" + name ) ); - } ); - - that.containerOffset = element.offset(); - that.containerPosition = element.position(); - that.containerSize = { - height: ( element.innerHeight() - p[ 3 ] ), - width: ( element.innerWidth() - p[ 1 ] ) - }; - - co = that.containerOffset; - ch = that.containerSize.height; - cw = that.containerSize.width; - width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw ); - height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch ); - - that.parentData = { - element: ce, - left: co.left, - top: co.top, - width: width, - height: height - }; - } - }, - - resize: function( event ) { - var woset, hoset, isParent, isOffsetRelative, - that = $( this ).resizable( "instance" ), - o = that.options, - co = that.containerOffset, - cp = that.position, - pRatio = that._aspectRatio || event.shiftKey, - cop = { - top: 0, - left: 0 - }, - ce = that.containerElement, - continueResize = true; - - if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { - cop = co; - } - - if ( cp.left < ( that._helper ? co.left : 0 ) ) { - that.size.width = that.size.width + - ( that._helper ? - ( that.position.left - co.left ) : - ( that.position.left - cop.left ) ); - - if ( pRatio ) { - that.size.height = that.size.width / that.aspectRatio; - continueResize = false; - } - that.position.left = o.helper ? co.left : 0; - } - - if ( cp.top < ( that._helper ? co.top : 0 ) ) { - that.size.height = that.size.height + - ( that._helper ? - ( that.position.top - co.top ) : - that.position.top ); - - if ( pRatio ) { - that.size.width = that.size.height * that.aspectRatio; - continueResize = false; - } - that.position.top = that._helper ? co.top : 0; - } - - isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 ); - isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) ); - - if ( isParent && isOffsetRelative ) { - that.offset.left = that.parentData.left + that.position.left; - that.offset.top = that.parentData.top + that.position.top; - } else { - that.offset.left = that.element.offset().left; - that.offset.top = that.element.offset().top; - } - - woset = Math.abs( that.sizeDiff.width + - ( that._helper ? - that.offset.left - cop.left : - ( that.offset.left - co.left ) ) ); - - hoset = Math.abs( that.sizeDiff.height + - ( that._helper ? - that.offset.top - cop.top : - ( that.offset.top - co.top ) ) ); - - if ( woset + that.size.width >= that.parentData.width ) { - that.size.width = that.parentData.width - woset; - if ( pRatio ) { - that.size.height = that.size.width / that.aspectRatio; - continueResize = false; - } - } - - if ( hoset + that.size.height >= that.parentData.height ) { - that.size.height = that.parentData.height - hoset; - if ( pRatio ) { - that.size.width = that.size.height * that.aspectRatio; - continueResize = false; - } - } - - if ( !continueResize ) { - that.position.left = that.prevPosition.left; - that.position.top = that.prevPosition.top; - that.size.width = that.prevSize.width; - that.size.height = that.prevSize.height; - } - }, - - stop: function() { - var that = $( this ).resizable( "instance" ), - o = that.options, - co = that.containerOffset, - cop = that.containerPosition, - ce = that.containerElement, - helper = $( that.helper ), - ho = helper.offset(), - w = helper.outerWidth() - that.sizeDiff.width, - h = helper.outerHeight() - that.sizeDiff.height; - - if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) { - $( this ).css( { - left: ho.left - cop.left - co.left, - width: w, - height: h - } ); - } - - if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) { - $( this ).css( { - left: ho.left - cop.left - co.left, - width: w, - height: h - } ); - } - } -} ); - -$.ui.plugin.add( "resizable", "alsoResize", { - - start: function() { - var that = $( this ).resizable( "instance" ), - o = that.options; - - $( o.alsoResize ).each( function() { - var el = $( this ), - elSize = that._calculateAdjustedElementDimensions( el ); - - el.data( "ui-resizable-alsoresize", { - width: elSize.width, height: elSize.height, - left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) ) - } ); - } ); - }, - - resize: function( event, ui ) { - var that = $( this ).resizable( "instance" ), - o = that.options, - os = that.originalSize, - op = that.originalPosition, - delta = { - height: ( that.size.height - os.height ) || 0, - width: ( that.size.width - os.width ) || 0, - top: ( that.position.top - op.top ) || 0, - left: ( that.position.left - op.left ) || 0 - }; - - $( o.alsoResize ).each( function() { - var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {}, - css = el.parents( ui.originalElement[ 0 ] ).length ? - [ "width", "height" ] : - [ "width", "height", "top", "left" ]; - - $.each( css, function( i, prop ) { - var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 ); - if ( sum && sum >= 0 ) { - style[ prop ] = sum || null; - } - } ); - - el.css( style ); - } ); - }, - - stop: function() { - $( this ).removeData( "ui-resizable-alsoresize" ); - } -} ); - -$.ui.plugin.add( "resizable", "ghost", { - - start: function() { - - var that = $( this ).resizable( "instance" ), cs = that.size; - - that.ghost = that.originalElement.clone(); - that.ghost.css( { - opacity: 0.25, - display: "block", - position: "relative", - height: cs.height, - width: cs.width, - margin: 0, - left: 0, - top: 0 - } ); - - that._addClass( that.ghost, "ui-resizable-ghost" ); - - // DEPRECATED - // TODO: remove after 1.12 - if ( $.uiBackCompat === true && typeof that.options.ghost === "string" ) { - - // Ghost option - that.ghost.addClass( this.options.ghost ); - } - - that.ghost.appendTo( that.helper ); - - }, - - resize: function() { - var that = $( this ).resizable( "instance" ); - if ( that.ghost ) { - that.ghost.css( { - position: "relative", - height: that.size.height, - width: that.size.width - } ); - } - }, - - stop: function() { - var that = $( this ).resizable( "instance" ); - if ( that.ghost && that.helper ) { - that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) ); - } - } - -} ); - -$.ui.plugin.add( "resizable", "grid", { - - resize: function() { - var outerDimensions, - that = $( this ).resizable( "instance" ), - o = that.options, - cs = that.size, - os = that.originalSize, - op = that.originalPosition, - a = that.axis, - grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid, - gridX = ( grid[ 0 ] || 1 ), - gridY = ( grid[ 1 ] || 1 ), - ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX, - oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY, - newWidth = os.width + ox, - newHeight = os.height + oy, - isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ), - isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ), - isMinWidth = o.minWidth && ( o.minWidth > newWidth ), - isMinHeight = o.minHeight && ( o.minHeight > newHeight ); - - o.grid = grid; - - if ( isMinWidth ) { - newWidth += gridX; - } - if ( isMinHeight ) { - newHeight += gridY; - } - if ( isMaxWidth ) { - newWidth -= gridX; - } - if ( isMaxHeight ) { - newHeight -= gridY; - } - - if ( /^(se|s|e)$/.test( a ) ) { - that.size.width = newWidth; - that.size.height = newHeight; - } else if ( /^(ne)$/.test( a ) ) { - that.size.width = newWidth; - that.size.height = newHeight; - that.position.top = op.top - oy; - } else if ( /^(sw)$/.test( a ) ) { - that.size.width = newWidth; - that.size.height = newHeight; - that.position.left = op.left - ox; - } else { - if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) { - outerDimensions = that._getPaddingPlusBorderDimensions( this ); - } - - if ( newHeight - gridY > 0 ) { - that.size.height = newHeight; - that.position.top = op.top - oy; - } else { - newHeight = gridY - outerDimensions.height; - that.size.height = newHeight; - that.position.top = op.top + os.height - newHeight; - } - if ( newWidth - gridX > 0 ) { - that.size.width = newWidth; - that.position.left = op.left - ox; - } else { - newWidth = gridX - outerDimensions.width; - that.size.width = newWidth; - that.position.left = op.left + os.width - newWidth; - } - } - } - -} ); - -var widgetsResizable = $.ui.resizable; - - -/*! - * jQuery UI Sortable 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Sortable -//>>group: Interactions -//>>description: Enables items in a list to be sorted using the mouse. -//>>docs: https://api.jqueryui.com/sortable/ -//>>demos: https://jqueryui.com/sortable/ -//>>css.structure: ../../themes/base/sortable.css - - -var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, { - version: "1.14.1", - widgetEventPrefix: "sort", - ready: false, - options: { - appendTo: "parent", - axis: false, - connectWith: false, - containment: false, - cursor: "auto", - cursorAt: false, - dropOnEmpty: true, - forcePlaceholderSize: false, - forceHelperSize: false, - grid: false, - handle: false, - helper: "original", - items: "> *", - opacity: false, - placeholder: false, - revert: false, - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - scope: "default", - tolerance: "intersect", - zIndex: 1000, - - // Callbacks - activate: null, - beforeStop: null, - change: null, - deactivate: null, - out: null, - over: null, - receive: null, - remove: null, - sort: null, - start: null, - stop: null, - update: null - }, - - _isOverAxis: function( x, reference, size ) { - return ( x >= reference ) && ( x < ( reference + size ) ); - }, - - _isFloating: function( item ) { - return ( /left|right/ ).test( item.css( "float" ) ) || - ( /inline|table-cell/ ).test( item.css( "display" ) ); - }, - - _create: function() { - this.containerCache = {}; - this._addClass( "ui-sortable" ); - - //Get the items - this.refresh(); - - //Let's determine the parent's offset - this.offset = this.element.offset(); - - //Initialize mouse events for interaction - this._mouseInit(); - - this._setHandleClassName(); - - //We're ready to go - this.ready = true; - - }, - - _setOption: function( key, value ) { - this._super( key, value ); - - if ( key === "handle" ) { - this._setHandleClassName(); - } - }, - - _setHandleClassName: function() { - var that = this; - this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); - $.each( this.items, function() { - that._addClass( - this.instance.options.handle ? - this.item.find( this.instance.options.handle ) : - this.item, - "ui-sortable-handle" - ); - } ); - }, - - _destroy: function() { - this._mouseDestroy(); - - for ( var i = this.items.length - 1; i >= 0; i-- ) { - this.items[ i ].item.removeData( this.widgetName + "-item" ); - } - - return this; - }, - - _mouseCapture: function( event, overrideHandle ) { - var currentItem = null, - validHandle = false, - that = this; - - if ( this.reverting ) { - return false; - } - - if ( this.options.disabled || this.options.type === "static" ) { - return false; - } - - //We have to refresh the items data once first - this._refreshItems( event ); - - //Find out if the clicked node (or one of its parents) is a actual item in this.items - $( event.target ).parents().each( function() { - if ( $.data( this, that.widgetName + "-item" ) === that ) { - currentItem = $( this ); - return false; - } - } ); - if ( $.data( event.target, that.widgetName + "-item" ) === that ) { - currentItem = $( event.target ); - } - - if ( !currentItem ) { - return false; - } - if ( this.options.handle && !overrideHandle ) { - $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { - if ( this === event.target ) { - validHandle = true; - } - } ); - if ( !validHandle ) { - return false; - } - } - - this.currentItem = currentItem; - this._removeCurrentsFromItems(); - return true; - - }, - - _mouseStart: function( event, overrideHandle, noActivation ) { - - var i, body, - o = this.options; - - this.currentContainer = this; - - //We only need to call refreshPositions, because the refreshItems call has been moved to - // mouseCapture - this.refreshPositions(); - - //Prepare the dragged items parent - this.appendTo = $( o.appendTo !== "parent" ? - o.appendTo : - this.currentItem.parent() ); - - //Create and append the visible helper - this.helper = this._createHelper( event ); - - //Cache the helper size - this._cacheHelperProportions(); - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //The element's absolute position on the page minus margins - this.offset = this.currentItem.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend( this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - - // This is a relative to absolute position minus the actual position calculation - - // only used for relative positioned helper - relative: this._getRelativeOffset() - } ); - - // After we get the helper offset, but before we get the parent offset we can - // change the helper's position to absolute - // TODO: Still need to figure out a way to make relative sorting possible - this.helper.css( "position", "absolute" ); - this.cssPosition = this.helper.css( "position" ); - - //Adjust the mouse offset relative to the helper if "cursorAt" is supplied - if ( o.cursorAt ) { - this._adjustOffsetFromHelper( o.cursorAt ); - } - - //Cache the former DOM position - this.domPosition = { - prev: this.currentItem.prev()[ 0 ], - parent: this.currentItem.parent()[ 0 ] - }; - - // If the helper is not the original, hide the original so it's not playing any role during - // the drag, won't cause anything bad this way - if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { - this.currentItem.hide(); - } - - //Create the placeholder - this._createPlaceholder(); - - //Get the next scrolling parent - this.scrollParent = this.placeholder.scrollParent(); - - $.extend( this.offset, { - parent: this._getParentOffset() - } ); - - //Set a containment if given in the options - if ( o.containment ) { - this._setContainment(); - } - - if ( o.cursor && o.cursor !== "auto" ) { // cursor option - body = this.document.find( "body" ); - - this._storedStylesheet = - $( "" ).appendTo( body ); - } - - // We need to make sure to grab the zIndex before setting the - // opacity, because setting the opacity to anything lower than 1 - // causes the zIndex to change from "auto" to 0. - if ( o.zIndex ) { // zIndex option - if ( this.helper.css( "zIndex" ) ) { - this._storedZIndex = this.helper.css( "zIndex" ); - } - this.helper.css( "zIndex", o.zIndex ); - } - - if ( o.opacity ) { // opacity option - if ( this.helper.css( "opacity" ) ) { - this._storedOpacity = this.helper.css( "opacity" ); - } - this.helper.css( "opacity", o.opacity ); - } - - //Prepare scrolling - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { - this.overflowOffset = this.scrollParent.offset(); - } - - //Call callbacks - this._trigger( "start", event, this._uiHash() ); - - //Recache the helper size - if ( !this._preserveHelperProportions ) { - this._cacheHelperProportions(); - } - - //Post "activate" events to possible containers - if ( !noActivation ) { - for ( i = this.containers.length - 1; i >= 0; i-- ) { - this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); - } - } - - //Prepare possible droppables - if ( $.ui.ddmanager ) { - $.ui.ddmanager.current = this; - } - - if ( $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - - this.dragging = true; - - this._addClass( this.helper, "ui-sortable-helper" ); - - //Move the helper, if needed - if ( !this.helper.parent().is( this.appendTo ) ) { - this.helper.detach().appendTo( this.appendTo ); - - //Update position - this.offset.parent = this._getParentOffset(); - } - - //Generate the original position - this.position = this.originalPosition = this._generatePosition( event ); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" ); - - this._mouseDrag( event ); - - return true; - - }, - - _scroll: function( event ) { - var o = this.options, - scrolled = false; - - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { - - if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - - event.pageY < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; - } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; - } - - if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - - event.pageX < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; - } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; - } - - } else { - - if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); - } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); - } - - if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() - o.scrollSpeed - ); - } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() + o.scrollSpeed - ); - } - - } - - return scrolled; - }, - - _mouseDrag: function( event ) { - var i, item, itemElement, intersection, - o = this.options; - - //Compute the helpers position - this.position = this._generatePosition( event ); - this.positionAbs = this._convertPositionTo( "absolute" ); - - //Set the helper position - if ( !this.options.axis || this.options.axis !== "y" ) { - this.helper[ 0 ].style.left = this.position.left + "px"; - } - if ( !this.options.axis || this.options.axis !== "x" ) { - this.helper[ 0 ].style.top = this.position.top + "px"; - } - - //Do scrolling - if ( o.scroll ) { - if ( this._scroll( event ) !== false ) { - - //Update item positions used in position checks - this._refreshItemPositions( true ); - - if ( $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - } - } - - this.dragDirection = { - vertical: this._getDragVerticalDirection(), - horizontal: this._getDragHorizontalDirection() - }; - - //Rearrange - for ( i = this.items.length - 1; i >= 0; i-- ) { - - //Cache variables and intersection, continue if no intersection - item = this.items[ i ]; - itemElement = item.item[ 0 ]; - intersection = this._intersectsWithPointer( item ); - if ( !intersection ) { - continue; - } - - // Only put the placeholder inside the current Container, skip all - // items from other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this, moving items in "sub-sortables" can cause - // the placeholder to jitter between the outer and inner container. - if ( item.instance !== this.currentContainer ) { - continue; - } - - // Cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if ( itemElement !== this.currentItem[ 0 ] && - this.placeholder[ intersection === 1 ? - "next" : "prev" ]()[ 0 ] !== itemElement && - !$.contains( this.placeholder[ 0 ], itemElement ) && - ( this.options.type === "semi-dynamic" ? - !$.contains( this.element[ 0 ], itemElement ) : - true - ) - ) { - - this.direction = intersection === 1 ? "down" : "up"; - - if ( this.options.tolerance === "pointer" || - this._intersectsWithSides( item ) ) { - this._rearrange( event, item ); - } else { - break; - } - - this._trigger( "change", event, this._uiHash() ); - break; - } - } - - //Post events to containers - this._contactContainers( event ); - - //Interconnect with droppables - if ( $.ui.ddmanager ) { - $.ui.ddmanager.drag( this, event ); - } - - //Call callbacks - this._trigger( "sort", event, this._uiHash() ); - - this.lastPositionAbs = this.positionAbs; - return false; - - }, - - _mouseStop: function( event, noPropagation ) { - - if ( !event ) { - return; - } - - //If we are using droppables, inform the manager about the drop - if ( $.ui.ddmanager && !this.options.dropBehaviour ) { - $.ui.ddmanager.drop( this, event ); - } - - if ( this.options.revert ) { - var that = this, - cur = this.placeholder.offset(), - axis = this.options.axis, - animation = {}; - - if ( !axis || axis === "x" ) { - animation.left = cur.left - this.offset.parent.left - this.margins.left + - ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? - 0 : - this.offsetParent[ 0 ].scrollLeft - ); - } - if ( !axis || axis === "y" ) { - animation.top = cur.top - this.offset.parent.top - this.margins.top + - ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? - 0 : - this.offsetParent[ 0 ].scrollTop - ); - } - this.reverting = true; - $( this.helper ).animate( - animation, - parseInt( this.options.revert, 10 ) || 500, - function() { - that._clear( event ); - } - ); - } else { - this._clear( event, noPropagation ); - } - - return false; - - }, - - cancel: function() { - - if ( this.dragging ) { - - this._mouseUp( new $.Event( "mouseup", { target: null } ) ); - - if ( this.options.helper === "original" ) { - this.currentItem.css( this._storedCSS ); - this._removeClass( this.currentItem, "ui-sortable-helper" ); - } else { - this.currentItem.show(); - } - - //Post deactivating events to containers - for ( var i = this.containers.length - 1; i >= 0; i-- ) { - this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); - if ( this.containers[ i ].containerCache.over ) { - this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - } - - if ( this.placeholder ) { - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, - // it unbinds ALL events from the original node! - if ( this.placeholder[ 0 ].parentNode ) { - this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); - } - if ( this.options.helper !== "original" && this.helper && - this.helper[ 0 ].parentNode ) { - this.helper.remove(); - } - - $.extend( this, { - helper: null, - dragging: false, - reverting: false, - _noFinalSort: null - } ); - - if ( this.domPosition.prev ) { - $( this.domPosition.prev ).after( this.currentItem ); - } else { - $( this.domPosition.parent ).prepend( this.currentItem ); - } - } - - return this; - - }, - - serialize: function( o ) { - - var items = this._getItemsAsjQuery( o && o.connected ), - str = []; - o = o || {}; - - $( items ).each( function() { - var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) - .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); - if ( res ) { - str.push( - ( o.key || res[ 1 ] + "[]" ) + - "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); - } - } ); - - if ( !str.length && o.key ) { - str.push( o.key + "=" ); - } - - return str.join( "&" ); - - }, - - toArray: function( o ) { - - var items = this._getItemsAsjQuery( o && o.connected ), - ret = []; - - o = o || {}; - - items.each( function() { - ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); - } ); - return ret; - - }, - - /* Be careful with the following core functions */ - _intersectsWith: function( item ) { - - var x1 = this.positionAbs.left, - x2 = x1 + this.helperProportions.width, - y1 = this.positionAbs.top, - y2 = y1 + this.helperProportions.height, - l = item.left, - r = l + item.width, - t = item.top, - b = t + item.height, - dyClick = this.offset.click.top, - dxClick = this.offset.click.left, - isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && - ( y1 + dyClick ) < b ), - isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && - ( x1 + dxClick ) < r ), - isOverElement = isOverElementHeight && isOverElementWidth; - - if ( this.options.tolerance === "pointer" || - this.options.forcePointerForContainers || - ( this.options.tolerance !== "pointer" && - this.helperProportions[ this.floating ? "width" : "height" ] > - item[ this.floating ? "width" : "height" ] ) - ) { - return isOverElement; - } else { - - return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half - x2 - ( this.helperProportions.width / 2 ) < r && // Left Half - t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half - y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half - - } - }, - - _intersectsWithPointer: function( item ) { - var verticalDirection, horizontalDirection, - isOverElementHeight = ( this.options.axis === "x" ) || - this._isOverAxis( - this.positionAbs.top + this.offset.click.top, item.top, item.height ), - isOverElementWidth = ( this.options.axis === "y" ) || - this._isOverAxis( - this.positionAbs.left + this.offset.click.left, item.left, item.width ), - isOverElement = isOverElementHeight && isOverElementWidth; - - if ( !isOverElement ) { - return false; - } - - verticalDirection = this.dragDirection.vertical; - horizontalDirection = this.dragDirection.horizontal; - - return this.floating ? - ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) : - ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); - - }, - - _intersectsWithSides: function( item ) { - - var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + - this.offset.click.top, item.top + ( item.height / 2 ), item.height ), - isOverRightHalf = this._isOverAxis( this.positionAbs.left + - this.offset.click.left, item.left + ( item.width / 2 ), item.width ), - verticalDirection = this.dragDirection.vertical, - horizontalDirection = this.dragDirection.horizontal; - - if ( this.floating && horizontalDirection ) { - return ( ( horizontalDirection === "right" && isOverRightHalf ) || - ( horizontalDirection === "left" && !isOverRightHalf ) ); - } else { - return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || - ( verticalDirection === "up" && !isOverBottomHalf ) ); - } - - }, - - _getDragVerticalDirection: function() { - var delta = this.positionAbs.top - this.lastPositionAbs.top; - return delta !== 0 && ( delta > 0 ? "down" : "up" ); - }, - - _getDragHorizontalDirection: function() { - var delta = this.positionAbs.left - this.lastPositionAbs.left; - return delta !== 0 && ( delta > 0 ? "right" : "left" ); - }, - - refresh: function( event ) { - this._refreshItems( event ); - this._setHandleClassName(); - this.refreshPositions(); - return this; - }, - - _connectWith: function() { - var options = this.options; - return options.connectWith.constructor === String ? - [ options.connectWith ] : - options.connectWith; - }, - - _getItemsAsjQuery: function( connected ) { - - var i, j, cur, inst, - items = [], - queries = [], - connectWith = this._connectWith(); - - if ( connectWith && connected ) { - for ( i = connectWith.length - 1; i >= 0; i-- ) { - cur = $( connectWith[ i ], this.document[ 0 ] ); - for ( j = cur.length - 1; j >= 0; j-- ) { - inst = $.data( cur[ j ], this.widgetFullName ); - if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ typeof inst.options.items === "function" ? - inst.options.items.call( inst.element ) : - $( inst.options.items, inst.element ) - .not( ".ui-sortable-helper" ) - .not( ".ui-sortable-placeholder" ), inst ] ); - } - } - } - } - - queries.push( [ typeof this.options.items === "function" ? - this.options.items - .call( this.element, null, { options: this.options, item: this.currentItem } ) : - $( this.options.items, this.element ) - .not( ".ui-sortable-helper" ) - .not( ".ui-sortable-placeholder" ), this ] ); - - function addItems() { - items.push( this ); - } - for ( i = queries.length - 1; i >= 0; i-- ) { - queries[ i ][ 0 ].each( addItems ); - } - - return $( items ); - - }, - - _removeCurrentsFromItems: function() { - - var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); - - this.items = $.grep( this.items, function( item ) { - for ( var j = 0; j < list.length; j++ ) { - if ( list[ j ] === item.item[ 0 ] ) { - return false; - } - } - return true; - } ); - - }, - - _refreshItems: function( event ) { - - this.items = []; - this.containers = [ this ]; - - var i, j, cur, inst, targetData, _queries, item, queriesLength, - items = this.items, - queries = [ [ typeof this.options.items === "function" ? - this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : - $( this.options.items, this.element ), this ] ], - connectWith = this._connectWith(); - - //Shouldn't be run the first time through due to massive slow-down - if ( connectWith && this.ready ) { - for ( i = connectWith.length - 1; i >= 0; i-- ) { - cur = $( connectWith[ i ], this.document[ 0 ] ); - for ( j = cur.length - 1; j >= 0; j-- ) { - inst = $.data( cur[ j ], this.widgetFullName ); - if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ typeof inst.options.items === "function" ? - inst.options.items - .call( inst.element[ 0 ], event, { item: this.currentItem } ) : - $( inst.options.items, inst.element ), inst ] ); - this.containers.push( inst ); - } - } - } - } - - for ( i = queries.length - 1; i >= 0; i-- ) { - targetData = queries[ i ][ 1 ]; - _queries = queries[ i ][ 0 ]; - - for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { - item = $( _queries[ j ] ); - - // Data for target checking (mouse manager) - item.data( this.widgetName + "-item", targetData ); - - items.push( { - item: item, - instance: targetData, - width: 0, height: 0, - left: 0, top: 0 - } ); - } - } - - }, - - _refreshItemPositions: function( fast ) { - var i, item, t, p; - - for ( i = this.items.length - 1; i >= 0; i-- ) { - item = this.items[ i ]; - - //We ignore calculating positions of all connected containers when we're not over them - if ( this.currentContainer && item.instance !== this.currentContainer && - item.item[ 0 ] !== this.currentItem[ 0 ] ) { - continue; - } - - t = this.options.toleranceElement ? - $( this.options.toleranceElement, item.item ) : - item.item; - - if ( !fast ) { - item.width = t.outerWidth(); - item.height = t.outerHeight(); - } - - p = t.offset(); - item.left = p.left; - item.top = p.top; - } - }, - - refreshPositions: function( fast ) { - - // Determine whether items are being displayed horizontally - this.floating = this.items.length ? - this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : - false; - - // This has to be redone because due to the item being moved out/into the offsetParent, - // the offsetParent's position will change - if ( this.offsetParent && this.helper ) { - this.offset.parent = this._getParentOffset(); - } - - this._refreshItemPositions( fast ); - - var i, p; - - if ( this.options.custom && this.options.custom.refreshContainers ) { - this.options.custom.refreshContainers.call( this ); - } else { - for ( i = this.containers.length - 1; i >= 0; i-- ) { - p = this.containers[ i ].element.offset(); - this.containers[ i ].containerCache.left = p.left; - this.containers[ i ].containerCache.top = p.top; - this.containers[ i ].containerCache.width = - this.containers[ i ].element.outerWidth(); - this.containers[ i ].containerCache.height = - this.containers[ i ].element.outerHeight(); - } - } - - return this; - }, - - _createPlaceholder: function( that ) { - that = that || this; - var className, nodeName, - o = that.options; - - if ( !o.placeholder || o.placeholder.constructor === String ) { - className = o.placeholder; - nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(); - o.placeholder = { - element: function() { - - var element = $( "<" + nodeName + ">", that.document[ 0 ] ); - - that._addClass( element, "ui-sortable-placeholder", - className || that.currentItem[ 0 ].className ) - ._removeClass( element, "ui-sortable-helper" ); - - if ( nodeName === "tbody" ) { - that._createTrPlaceholder( - that.currentItem.find( "tr" ).eq( 0 ), - $( "", that.document[ 0 ] ).appendTo( element ) - ); - } else if ( nodeName === "tr" ) { - that._createTrPlaceholder( that.currentItem, element ); - } else if ( nodeName === "img" ) { - element.attr( "src", that.currentItem.attr( "src" ) ); - } - - if ( !className ) { - element.css( "visibility", "hidden" ); - } - - return element; - }, - update: function( container, p ) { - - // 1. If a className is set as 'placeholder option, we don't force sizes - - // the class is responsible for that - // 2. The option 'forcePlaceholderSize can be enabled to force it even if a - // class name is specified - if ( className && !o.forcePlaceholderSize ) { - return; - } - - // If the element doesn't have a actual height or width by itself (without - // styles coming from a stylesheet), it receives the inline height and width - // from the dragged item. Or, if it's a tbody or tr, it's going to have a height - // anyway since we're populating them with s above, but they're unlikely to - // be the correct height on their own if the row heights are dynamic, so we'll - // always assign the height of the dragged item given forcePlaceholderSize - // is true. - if ( !p.height() || ( o.forcePlaceholderSize && - ( nodeName === "tbody" || nodeName === "tr" ) ) ) { - p.height( - that.currentItem.innerHeight() - - parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - - parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); - } - if ( !p.width() ) { - p.width( - that.currentItem.innerWidth() - - parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - - parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); - } - } - }; - } - - //Create the placeholder - that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); - - //Append it after the actual current item - that.currentItem.after( that.placeholder ); - - //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) - o.placeholder.update( that, that.placeholder ); - - }, - - _createTrPlaceholder: function( sourceTr, targetTr ) { - var that = this; - - sourceTr.children().each( function() { - $( " ", that.document[ 0 ] ) - .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) - .appendTo( targetTr ); - } ); - }, - - _contactContainers: function( event ) { - var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, - floating, axis, - innermostContainer = null, - innermostIndex = null; - - // Get innermost container that intersects with item - for ( i = this.containers.length - 1; i >= 0; i-- ) { - - // Never consider a container that's located within the item itself - if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { - continue; - } - - if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { - - // If we've already found a container and it's more "inner" than this, then continue - if ( innermostContainer && - $.contains( - this.containers[ i ].element[ 0 ], - innermostContainer.element[ 0 ] ) ) { - continue; - } - - innermostContainer = this.containers[ i ]; - innermostIndex = i; - - } else { - - // container doesn't intersect. trigger "out" event if necessary - if ( this.containers[ i ].containerCache.over ) { - this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - } - - // If no intersecting containers found, return - if ( !innermostContainer ) { - return; - } - - // Move the item into the container if it's not there already - if ( this.containers.length === 1 ) { - if ( !this.containers[ innermostIndex ].containerCache.over ) { - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); - this.containers[ innermostIndex ].containerCache.over = 1; - } - } else { - - // When entering a new container, we will find the item with the least distance and - // append our item near it - dist = 10000; - itemWithLeastDistance = null; - floating = innermostContainer.floating || this._isFloating( this.currentItem ); - posProperty = floating ? "left" : "top"; - sizeProperty = floating ? "width" : "height"; - axis = floating ? "pageX" : "pageY"; - - for ( j = this.items.length - 1; j >= 0; j-- ) { - if ( !$.contains( - this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) - ) { - continue; - } - if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { - continue; - } - - cur = this.items[ j ].item.offset()[ posProperty ]; - nearBottom = false; - if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { - nearBottom = true; - } - - if ( Math.abs( event[ axis ] - cur ) < dist ) { - dist = Math.abs( event[ axis ] - cur ); - itemWithLeastDistance = this.items[ j ]; - this.direction = nearBottom ? "up" : "down"; - } - } - - //Check if dropOnEmpty is enabled - if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { - return; - } - - if ( this.currentContainer === this.containers[ innermostIndex ] ) { - if ( !this.currentContainer.containerCache.over ) { - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); - this.currentContainer.containerCache.over = 1; - } - return; - } - - if ( itemWithLeastDistance ) { - this._rearrange( event, itemWithLeastDistance, null, true ); - } else { - this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); - } - this._trigger( "change", event, this._uiHash() ); - this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); - this.currentContainer = this.containers[ innermostIndex ]; - - //Update the placeholder - this.options.placeholder.update( this.currentContainer, this.placeholder ); - - //Update scrollParent - this.scrollParent = this.placeholder.scrollParent(); - - //Update overflowOffset - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { - this.overflowOffset = this.scrollParent.offset(); - } - - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); - this.containers[ innermostIndex ].containerCache.over = 1; - } - - }, - - _createHelper: function( event ) { - - var o = this.options, - helper = typeof o.helper === "function" ? - $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : - ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); - - //Add the helper to the DOM if that didn't happen already - if ( !helper.parents( "body" ).length ) { - this.appendTo[ 0 ].appendChild( helper[ 0 ] ); - } - - if ( helper[ 0 ] === this.currentItem[ 0 ] ) { - this._storedCSS = { - width: this.currentItem[ 0 ].style.width, - height: this.currentItem[ 0 ].style.height, - position: this.currentItem.css( "position" ), - top: this.currentItem.css( "top" ), - left: this.currentItem.css( "left" ) - }; - } - - if ( !helper[ 0 ].style.width || o.forceHelperSize ) { - helper.width( this.currentItem.width() ); - } - if ( !helper[ 0 ].style.height || o.forceHelperSize ) { - helper.height( this.currentItem.height() ); - } - - return helper; - - }, - - _adjustOffsetFromHelper: function( obj ) { - if ( typeof obj === "string" ) { - obj = obj.split( " " ); - } - if ( Array.isArray( obj ) ) { - obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; - } - if ( "left" in obj ) { - this.offset.click.left = obj.left + this.margins.left; - } - if ( "right" in obj ) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ( "top" in obj ) { - this.offset.click.top = obj.top + this.margins.top; - } - if ( "bottom" in obj ) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the - // following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the - // next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't - // the document, which means that the scroll is included in the initial calculation of the - // offset of the parent, and never recalculated upon drag - if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - // This needs to be actually done for all browsers, since pageX/pageY includes - // this information. - if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) { - po = { top: 0, left: 0 }; - } - - return { - top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), - left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) - }; - - }, - - _getRelativeOffset: function() { - - if ( this.cssPosition === "relative" ) { - var p = this.currentItem.position(); - return { - top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + - this.scrollParent.scrollTop(), - left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + - this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), - top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var ce, co, over, - o = this.options; - if ( o.containment === "parent" ) { - o.containment = this.helper[ 0 ].parentNode; - } - if ( o.containment === "document" || o.containment === "window" ) { - this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - o.containment === "document" ? - this.document.width() : - this.window.width() - this.helperProportions.width - this.margins.left, - ( o.containment === "document" ? - ( this.document.height() || document.body.parentNode.scrollHeight ) : - this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight - ) - this.helperProportions.height - this.margins.top - ]; - } - - if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { - ce = $( o.containment )[ 0 ]; - co = $( o.containment ).offset(); - over = ( $( ce ).css( "overflow" ) !== "hidden" ); - - this.containment = [ - co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + - ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, - co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + - ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, - co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - - ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - - ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - - this.helperProportions.width - this.margins.left, - co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - - ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - - ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - - this.helperProportions.height - this.margins.top - ]; - } - - }, - - _convertPositionTo: function( d, pos ) { - - if ( !pos ) { - pos = this.position; - } - var mod = d === "absolute" ? 1 : -1, - scroll = this.cssPosition === "absolute" && - !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? - this.offsetParent : - this.scrollParent, - scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); - - return { - top: ( - - // The absolute mouse position - pos.top + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top * mod - - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollTop() : - ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) - ), - left: ( - - // The absolute mouse position - pos.left + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left * mod - - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : - scroll.scrollLeft() ) * mod ) - ) - }; - - }, - - _generatePosition: function( event ) { - - var top, left, - o = this.options, - pageX = event.pageX, - pageY = event.pageY, - scroll = this.cssPosition === "absolute" && - !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? - this.offsetParent : - this.scrollParent, - scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { - this.offset.relative = this._getRelativeOffset(); - } - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options - - if ( this.containment ) { - if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { - pageX = this.containment[ 0 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { - pageY = this.containment[ 1 ] + this.offset.click.top; - } - if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { - pageX = this.containment[ 2 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { - pageY = this.containment[ 3 ] + this.offset.click.top; - } - } - - if ( o.grid ) { - top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / - o.grid[ 1 ] ) * o.grid[ 1 ]; - pageY = this.containment ? - ( ( top - this.offset.click.top >= this.containment[ 1 ] && - top - this.offset.click.top <= this.containment[ 3 ] ) ? - top : - ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? - top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : - top; - - left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / - o.grid[ 0 ] ) * o.grid[ 0 ]; - pageX = this.containment ? - ( ( left - this.offset.click.left >= this.containment[ 0 ] && - left - this.offset.click.left <= this.containment[ 2 ] ) ? - left : - ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? - left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : - left; - } - - } - - return { - top: ( - - // The absolute mouse position - pageY - - - // Click offset (relative to the element) - this.offset.click.top - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top + - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollTop() : - ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) - ), - left: ( - - // The absolute mouse position - pageX - - - // Click offset (relative to the element) - this.offset.click.left - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left + - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollLeft() : - scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) - ) - }; - - }, - - _rearrange: function( event, i, a, hardRefresh ) { - - if ( a ) { - a[ 0 ].appendChild( this.placeholder[ 0 ] ); - } else { - i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], - ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); - } - - //Various things done here to improve the performance: - // 1. we create a setTimeout, that calls refreshPositions - // 2. on the instance, we have a counter variable, that get's higher after every append - // 3. on the local scope, we copy the counter variable, and check in the timeout, - // if it's still the same - // 4. this lets only the last addition to the timeout stack through - this.counter = this.counter ? ++this.counter : 1; - var counter = this.counter; - - this._delay( function() { - if ( counter === this.counter ) { - - //Precompute after each DOM insertion, NOT on mousemove - this.refreshPositions( !hardRefresh ); - } - } ); - - }, - - _clear: function( event, noPropagation ) { - - this.reverting = false; - - // We delay all events that have to be triggered to after the point where the placeholder - // has been removed and everything else normalized again - var i, - delayedTriggers = []; - - // We first have to update the dom position of the actual currentItem - // Note: don't do it if the current item is already removed (by a user), or it gets - // reappended (see #4088) - if ( !this._noFinalSort && this.currentItem.parent().length ) { - this.placeholder.before( this.currentItem ); - } - this._noFinalSort = null; - - if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { - for ( i in this._storedCSS ) { - if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { - this._storedCSS[ i ] = ""; - } - } - this.currentItem.css( this._storedCSS ); - this._removeClass( this.currentItem, "ui-sortable-helper" ); - } else { - this.currentItem.show(); - } - - if ( this.fromOutside && !noPropagation ) { - delayedTriggers.push( function( event ) { - this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); - } ); - } - if ( ( this.fromOutside || - this.domPosition.prev !== - this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || - this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { - - // Trigger update callback if the DOM position has changed - delayedTriggers.push( function( event ) { - this._trigger( "update", event, this._uiHash() ); - } ); - } - - // Check if the items Container has Changed and trigger appropriate - // events. - if ( this !== this.currentContainer ) { - if ( !noPropagation ) { - delayedTriggers.push( function( event ) { - this._trigger( "remove", event, this._uiHash() ); - } ); - delayedTriggers.push( ( function( c ) { - return function( event ) { - c._trigger( "receive", event, this._uiHash( this ) ); - }; - } ).call( this, this.currentContainer ) ); - delayedTriggers.push( ( function( c ) { - return function( event ) { - c._trigger( "update", event, this._uiHash( this ) ); - }; - } ).call( this, this.currentContainer ) ); - } - } - - //Post events to containers - function delayEvent( type, instance, container ) { - return function( event ) { - container._trigger( type, event, instance._uiHash( instance ) ); - }; - } - for ( i = this.containers.length - 1; i >= 0; i-- ) { - if ( !noPropagation ) { - delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); - } - if ( this.containers[ i ].containerCache.over ) { - delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - //Do what was originally in plugins - if ( this._storedStylesheet ) { - this._storedStylesheet.remove(); - this._storedStylesheet = null; - } - if ( this._storedOpacity ) { - this.helper.css( "opacity", this._storedOpacity ); - } - if ( this._storedZIndex ) { - this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); - } - - this.dragging = false; - - if ( !noPropagation ) { - this._trigger( "beforeStop", event, this._uiHash() ); - } - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, - // it unbinds ALL events from the original node! - this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); - - if ( !this.cancelHelperRemoval ) { - if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { - this.helper.remove(); - } - this.helper = null; - } - - if ( !noPropagation ) { - for ( i = 0; i < delayedTriggers.length; i++ ) { - - // Trigger all delayed events - delayedTriggers[ i ].call( this, event ); - } - this._trigger( "stop", event, this._uiHash() ); - } - - this.fromOutside = false; - return !this.cancelHelperRemoval; - - }, - - _trigger: function() { - if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { - this.cancel(); - } - }, - - _uiHash: function( _inst ) { - var inst = _inst || this; - return { - helper: inst.helper, - placeholder: inst.placeholder || $( [] ), - position: inst.position, - originalPosition: inst.originalPosition, - offset: inst.positionAbs, - item: inst.currentItem, - sender: _inst ? _inst.element : null - }; - } - -} ); - - -/*! - * jQuery UI Controlgroup 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Controlgroup -//>>group: Widgets -//>>description: Visually groups form control widgets -//>>docs: https://api.jqueryui.com/controlgroup/ -//>>demos: https://jqueryui.com/controlgroup/ -//>>css.structure: ../../themes/base/core.css -//>>css.structure: ../../themes/base/controlgroup.css -//>>css.theme: ../../themes/base/theme.css - - -var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; - -var widgetsControlgroup = $.widget( "ui.controlgroup", { - version: "1.14.1", - defaultElement: "
", - options: { - direction: "horizontal", - disabled: null, - onlyVisible: true, - items: { - "button": "input[type=button], input[type=submit], input[type=reset], button, a", - "controlgroupLabel": ".ui-controlgroup-label", - "checkboxradio": "input[type='checkbox'], input[type='radio']", - "selectmenu": "select", - "spinner": ".ui-spinner-input" - } - }, - - _create: function() { - this._enhance(); - }, - - // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation - _enhance: function() { - this.element.attr( "role", "toolbar" ); - this.refresh(); - }, - - _destroy: function() { - this._callChildMethod( "destroy" ); - this.childWidgets.removeData( "ui-controlgroup-data" ); - this.element.removeAttr( "role" ); - if ( this.options.items.controlgroupLabel ) { - this.element - .find( this.options.items.controlgroupLabel ) - .find( ".ui-controlgroup-label-contents" ) - .contents().unwrap(); - } - }, - - _initWidgets: function() { - var that = this, - childWidgets = []; - - // First we iterate over each of the items options - $.each( this.options.items, function( widget, selector ) { - var labels; - var options = {}; - - // Make sure the widget has a selector set - if ( !selector ) { - return; - } - - if ( widget === "controlgroupLabel" ) { - labels = that.element.find( selector ); - labels.each( function() { - var element = $( this ); - - if ( element.children( ".ui-controlgroup-label-contents" ).length ) { - return; - } - element.contents() - .wrapAll( "" ); - } ); - that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); - childWidgets = childWidgets.concat( labels.get() ); - return; - } - - // Make sure the widget actually exists - if ( !$.fn[ widget ] ) { - return; - } - - // We assume everything is in the middle to start because we can't determine - // first / last elements until all enhancments are done. - if ( that[ "_" + widget + "Options" ] ) { - options = that[ "_" + widget + "Options" ]( "middle" ); - } else { - options = { classes: {} }; - } - - // Find instances of this widget inside controlgroup and init them - that.element - .find( selector ) - .each( function() { - var element = $( this ); - var instance = element[ widget ]( "instance" ); - - // We need to clone the default options for this type of widget to avoid - // polluting the variable options which has a wider scope than a single widget. - var instanceOptions = $.widget.extend( {}, options ); - - // If the button is the child of a spinner ignore it - // TODO: Find a more generic solution - if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { - return; - } - - // Create the widget if it doesn't exist - if ( !instance ) { - instance = element[ widget ]()[ widget ]( "instance" ); - } - if ( instance ) { - instanceOptions.classes = - that._resolveClassesValues( instanceOptions.classes, instance ); - } - element[ widget ]( instanceOptions ); - - // Store an instance of the controlgroup to be able to reference - // from the outermost element for changing options and refresh - var widgetElement = element[ widget ]( "widget" ); - $.data( widgetElement[ 0 ], "ui-controlgroup-data", - instance ? instance : element[ widget ]( "instance" ) ); - - childWidgets.push( widgetElement[ 0 ] ); - } ); - } ); - - this.childWidgets = $( $.uniqueSort( childWidgets ) ); - this._addClass( this.childWidgets, "ui-controlgroup-item" ); - }, - - _callChildMethod: function( method ) { - this.childWidgets.each( function() { - var element = $( this ), - data = element.data( "ui-controlgroup-data" ); - if ( data && data[ method ] ) { - data[ method ](); - } - } ); - }, - - _updateCornerClass: function( element, position ) { - var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; - var add = this._buildSimpleOptions( position, "label" ).classes.label; - - this._removeClass( element, null, remove ); - this._addClass( element, null, add ); - }, - - _buildSimpleOptions: function( position, key ) { - var direction = this.options.direction === "vertical"; - var result = { - classes: {} - }; - result.classes[ key ] = { - "middle": "", - "first": "ui-corner-" + ( direction ? "top" : "left" ), - "last": "ui-corner-" + ( direction ? "bottom" : "right" ), - "only": "ui-corner-all" - }[ position ]; - - return result; - }, - - _spinnerOptions: function( position ) { - var options = this._buildSimpleOptions( position, "ui-spinner" ); - - options.classes[ "ui-spinner-up" ] = ""; - options.classes[ "ui-spinner-down" ] = ""; - - return options; - }, - - _buttonOptions: function( position ) { - return this._buildSimpleOptions( position, "ui-button" ); - }, - - _checkboxradioOptions: function( position ) { - return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); - }, - - _selectmenuOptions: function( position ) { - var direction = this.options.direction === "vertical"; - return { - width: direction ? "auto" : false, - classes: { - middle: { - "ui-selectmenu-button-open": "", - "ui-selectmenu-button-closed": "" - }, - first: { - "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), - "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) - }, - last: { - "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", - "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) - }, - only: { - "ui-selectmenu-button-open": "ui-corner-top", - "ui-selectmenu-button-closed": "ui-corner-all" - } - - }[ position ] - }; - }, - - _resolveClassesValues: function( classes, instance ) { - var result = {}; - $.each( classes, function( key ) { - var current = instance.options.classes[ key ] || ""; - current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) ); - result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); - } ); - return result; - }, - - _setOption: function( key, value ) { - if ( key === "direction" ) { - this._removeClass( "ui-controlgroup-" + this.options.direction ); - } - - this._super( key, value ); - if ( key === "disabled" ) { - this._callChildMethod( value ? "disable" : "enable" ); - return; - } - - this.refresh(); - }, - - refresh: function() { - var children, - that = this; - - this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); - - if ( this.options.direction === "horizontal" ) { - this._addClass( null, "ui-helper-clearfix" ); - } - this._initWidgets(); - - children = this.childWidgets; - - // We filter here because we need to track all childWidgets not just the visible ones - if ( this.options.onlyVisible ) { - children = children.filter( ":visible" ); - } - - if ( children.length ) { - - // We do this last because we need to make sure all enhancment is done - // before determining first and last - $.each( [ "first", "last" ], function( index, value ) { - var instance = children[ value ]().data( "ui-controlgroup-data" ); - - if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { - var options = that[ "_" + instance.widgetName + "Options" ]( - children.length === 1 ? "only" : value - ); - options.classes = that._resolveClassesValues( options.classes, instance ); - instance.element[ instance.widgetName ]( options ); - } else { - that._updateCornerClass( children[ value ](), value ); - } - } ); - - // Finally call the refresh method on each of the child widgets. - this._callChildMethod( "refresh" ); - } - } -} ); - -/*! - * jQuery UI Checkboxradio 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Checkboxradio -//>>group: Widgets -//>>description: Enhances a form with multiple themeable checkboxes or radio buttons. -//>>docs: https://api.jqueryui.com/checkboxradio/ -//>>demos: https://jqueryui.com/checkboxradio/ -//>>css.structure: ../../themes/base/core.css -//>>css.structure: ../../themes/base/button.css -//>>css.structure: ../../themes/base/checkboxradio.css -//>>css.theme: ../../themes/base/theme.css - - -$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { - version: "1.14.1", - options: { - disabled: null, - label: null, - icon: true, - classes: { - "ui-checkboxradio-label": "ui-corner-all", - "ui-checkboxradio-icon": "ui-corner-all" - } - }, - - _getCreateOptions: function() { - var disabled, labels, labelContents; - var options = this._super() || {}; - - // We read the type here, because it makes more sense to throw a element type error first, - // rather then the error for lack of a label. Often if its the wrong type, it - // won't have a label (e.g. calling on a div, btn, etc) - this._readType(); - - labels = this.element.labels(); - - // If there are multiple labels, use the last one - this.label = $( labels[ labels.length - 1 ] ); - if ( !this.label.length ) { - $.error( "No label found for checkboxradio widget" ); - } - - this.originalLabel = ""; - - // We need to get the label text but this may also need to make sure it does not contain the - // input itself. - // The label contents could be text, html, or a mix. We wrap all elements - // and read the wrapper's `innerHTML` to get a string representation of - // the label, without the input as part of it. - labelContents = this.label.contents().not( this.element[ 0 ] ); - - if ( labelContents.length ) { - this.originalLabel += labelContents - .clone() - .wrapAll( "
" ) - .parent() - .html(); - } - - // Set the label option if we found label text - if ( this.originalLabel ) { - options.label = this.originalLabel; - } - - disabled = this.element[ 0 ].disabled; - if ( disabled != null ) { - options.disabled = disabled; - } - return options; - }, - - _create: function() { - var checked = this.element[ 0 ].checked; - - this._bindFormResetHandler(); - - if ( this.options.disabled == null ) { - this.options.disabled = this.element[ 0 ].disabled; - } - - this._setOption( "disabled", this.options.disabled ); - this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" ); - this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" ); - - if ( this.type === "radio" ) { - this._addClass( this.label, "ui-checkboxradio-radio-label" ); - } - - if ( this.options.label && this.options.label !== this.originalLabel ) { - this._updateLabel(); - } else if ( this.originalLabel ) { - this.options.label = this.originalLabel; - } - - this._enhance(); - - if ( checked ) { - this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); - } - - this._on( { - change: "_toggleClasses", - focus: function() { - this._addClass( this.label, null, "ui-state-focus ui-visual-focus" ); - }, - blur: function() { - this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" ); - } - } ); - }, - - _readType: function() { - var nodeName = this.element[ 0 ].nodeName.toLowerCase(); - this.type = this.element[ 0 ].type; - if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) { - $.error( "Can't create checkboxradio on element.nodeName=" + nodeName + - " and element.type=" + this.type ); - } - }, - - // Support jQuery Mobile enhanced option - _enhance: function() { - this._updateIcon( this.element[ 0 ].checked ); - }, - - widget: function() { - return this.label; - }, - - _getRadioGroup: function() { - var group; - var name = this.element[ 0 ].name; - var nameSelector = "input[name='" + CSS.escape( name ) + "']"; - - if ( !name ) { - return $( [] ); - } - - if ( this.form.length ) { - group = $( this.form[ 0 ].elements ).filter( nameSelector ); - } else { - - // Not inside a form, check all inputs that also are not inside a form - group = $( nameSelector ).filter( function() { - return $( $( this ).prop( "form" ) ).length === 0; - } ); - } - - return group.not( this.element ); - }, - - _toggleClasses: function() { - var checked = this.element[ 0 ].checked; - this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); - - if ( this.options.icon && this.type === "checkbox" ) { - this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked ) - ._toggleClass( this.icon, null, "ui-icon-blank", !checked ); - } - - if ( this.type === "radio" ) { - this._getRadioGroup() - .each( function() { - var instance = $( this ).checkboxradio( "instance" ); - - if ( instance ) { - instance._removeClass( instance.label, - "ui-checkboxradio-checked", "ui-state-active" ); - } - } ); - } - }, - - _destroy: function() { - this._unbindFormResetHandler(); - - if ( this.icon ) { - this.icon.remove(); - this.iconSpace.remove(); - } - }, - - _setOption: function( key, value ) { - - // We don't allow the value to be set to nothing - if ( key === "label" && !value ) { - return; - } - - this._super( key, value ); - - if ( key === "disabled" ) { - this._toggleClass( this.label, null, "ui-state-disabled", value ); - this.element[ 0 ].disabled = value; - - // Don't refresh when setting disabled - return; - } - this.refresh(); - }, - - _updateIcon: function( checked ) { - var toAdd = "ui-icon ui-icon-background "; - - if ( this.options.icon ) { - if ( !this.icon ) { - this.icon = $( "" ); - this.iconSpace = $( " " ); - this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" ); - } - - if ( this.type === "checkbox" ) { - toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank"; - this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" ); - } else { - toAdd += "ui-icon-blank"; - } - this._addClass( this.icon, "ui-checkboxradio-icon", toAdd ); - if ( !checked ) { - this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" ); - } - this.icon.prependTo( this.label ).after( this.iconSpace ); - } else if ( this.icon !== undefined ) { - this.icon.remove(); - this.iconSpace.remove(); - delete this.icon; - } - }, - - _updateLabel: function() { - - // Remove the contents of the label ( minus the icon, icon space, and input ) - var contents = this.label.contents().not( this.element[ 0 ] ); - if ( this.icon ) { - contents = contents.not( this.icon[ 0 ] ); - } - if ( this.iconSpace ) { - contents = contents.not( this.iconSpace[ 0 ] ); - } - contents.remove(); - - this.label.append( this.options.label ); - }, - - refresh: function() { - var checked = this.element[ 0 ].checked, - isDisabled = this.element[ 0 ].disabled; - - this._updateIcon( checked ); - this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); - if ( this.options.label !== null ) { - this._updateLabel(); - } - - if ( isDisabled !== this.options.disabled ) { - this._setOptions( { "disabled": isDisabled } ); - } - } - -} ] ); - -var widgetsCheckboxradio = $.ui.checkboxradio; - - -/*! - * jQuery UI Button 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Button -//>>group: Widgets -//>>description: Enhances a form with themeable buttons. -//>>docs: https://api.jqueryui.com/button/ -//>>demos: https://jqueryui.com/button/ -//>>css.structure: ../../themes/base/core.css -//>>css.structure: ../../themes/base/button.css -//>>css.theme: ../../themes/base/theme.css - - -$.widget( "ui.button", { - version: "1.14.1", - defaultElement: "" ) - .button( { - label: $( "" ).text( this.options.closeText ).html(), - icon: "ui-icon-closethick", - showLabel: false - } ) - .appendTo( this.uiDialogTitlebar ); - - this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" ); - this._on( this.uiDialogTitlebarClose, { - click: function( event ) { - event.preventDefault(); - this.close( event ); - } - } ); - - var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel ) && - this.options.uiDialogTitleHeadingLevel > 0 && - this.options.uiDialogTitleHeadingLevel <= 6 ? - "h" + this.options.uiDialogTitleHeadingLevel : "span"; - - uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ) - .uniqueId().prependTo( this.uiDialogTitlebar ); - this._addClass( uiDialogTitle, "ui-dialog-title" ); - this._title( uiDialogTitle ); - - this.uiDialogTitlebar.prependTo( this.uiDialog ); - - this.uiDialog.attr( { - "aria-labelledby": uiDialogTitle.attr( "id" ) - } ); - }, - - _title: function( title ) { - if ( this.options.title ) { - title.text( this.options.title ); - } else { - title.html( " " ); - } - }, - - _createButtonPane: function() { - this.uiDialogButtonPane = $( "
" ); - this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane", - "ui-widget-content ui-helper-clearfix" ); - - this.uiButtonSet = $( "
" ) - .appendTo( this.uiDialogButtonPane ); - this._addClass( this.uiButtonSet, "ui-dialog-buttonset" ); - - this._createButtons(); - }, - - _createButtons: function() { - var that = this, - buttons = this.options.buttons; - - // If we already have a button pane, remove it - this.uiDialogButtonPane.remove(); - this.uiButtonSet.empty(); - - if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) { - this._removeClass( this.uiDialog, "ui-dialog-buttons" ); - return; - } - - $.each( buttons, function( name, props ) { - var click, buttonOptions; - props = typeof props === "function" ? - { click: props, text: name } : - props; - - // Default to a non-submitting button - props = $.extend( { type: "button" }, props ); - - // Change the context for the click callback to be the main element - click = props.click; - buttonOptions = { - icon: props.icon, - iconPosition: props.iconPosition, - showLabel: props.showLabel, - - // Deprecated options - icons: props.icons, - text: props.text - }; - - delete props.click; - delete props.icon; - delete props.iconPosition; - delete props.showLabel; - - // Deprecated options - delete props.icons; - if ( typeof props.text === "boolean" ) { - delete props.text; - } - - $( "", props ) - .button( buttonOptions ) - .appendTo( that.uiButtonSet ) - .on( "click", function() { - click.apply( that.element[ 0 ], arguments ); - } ); - } ); - this._addClass( this.uiDialog, "ui-dialog-buttons" ); - this.uiDialogButtonPane.appendTo( this.uiDialog ); - }, - - _makeDraggable: function() { - var that = this, - options = this.options; - - function filteredUi( ui ) { - return { - position: ui.position, - offset: ui.offset - }; - } - - this.uiDialog.draggable( { - cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", - handle: ".ui-dialog-titlebar", - containment: "document", - start: function( event, ui ) { - that._addClass( $( this ), "ui-dialog-dragging" ); - that._blockFrames(); - that._trigger( "dragStart", event, filteredUi( ui ) ); - }, - drag: function( event, ui ) { - that._trigger( "drag", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - var left = ui.offset.left - that.document.scrollLeft(), - top = ui.offset.top - that.document.scrollTop(); - - options.position = { - my: "left top", - at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + - "top" + ( top >= 0 ? "+" : "" ) + top, - of: that.window - }; - that._removeClass( $( this ), "ui-dialog-dragging" ); - that._unblockFrames(); - that._trigger( "dragStop", event, filteredUi( ui ) ); - } - } ); - }, - - _makeResizable: function() { - var that = this, - options = this.options, - handles = options.resizable, - - // .ui-resizable has position: relative defined in the stylesheet - // but dialogs have to use absolute or fixed positioning - position = this.uiDialog.css( "position" ), - resizeHandles = typeof handles === "string" ? - handles : - "n,e,s,w,se,sw,ne,nw"; - - function filteredUi( ui ) { - return { - originalPosition: ui.originalPosition, - originalSize: ui.originalSize, - position: ui.position, - size: ui.size - }; - } - - this.uiDialog.resizable( { - cancel: ".ui-dialog-content", - containment: "document", - alsoResize: this.element, - maxWidth: options.maxWidth, - maxHeight: options.maxHeight, - minWidth: options.minWidth, - minHeight: this._minHeight(), - handles: resizeHandles, - start: function( event, ui ) { - that._addClass( $( this ), "ui-dialog-resizing" ); - that._blockFrames(); - that._trigger( "resizeStart", event, filteredUi( ui ) ); - }, - resize: function( event, ui ) { - that._trigger( "resize", event, filteredUi( ui ) ); - }, - stop: function( event, ui ) { - var offset = that.uiDialog.offset(), - left = offset.left - that.document.scrollLeft(), - top = offset.top - that.document.scrollTop(); - - options.height = that.uiDialog.height(); - options.width = that.uiDialog.width(); - options.position = { - my: "left top", - at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + - "top" + ( top >= 0 ? "+" : "" ) + top, - of: that.window - }; - that._removeClass( $( this ), "ui-dialog-resizing" ); - that._unblockFrames(); - that._trigger( "resizeStop", event, filteredUi( ui ) ); - } - } ) - .css( "position", position ); - }, - - _trackFocus: function() { - this._on( this.widget(), { - focusin: function( event ) { - this._makeFocusTarget(); - this._focusedElement = $( event.target ); - } - } ); - }, - - _makeFocusTarget: function() { - this._untrackInstance(); - this._trackingInstances().unshift( this ); - }, - - _untrackInstance: function() { - var instances = this._trackingInstances(), - exists = $.inArray( this, instances ); - if ( exists !== -1 ) { - instances.splice( exists, 1 ); - } - }, - - _trackingInstances: function() { - var instances = this.document.data( "ui-dialog-instances" ); - if ( !instances ) { - instances = []; - this.document.data( "ui-dialog-instances", instances ); - } - return instances; - }, - - _minHeight: function() { - var options = this.options; - - return options.height === "auto" ? - options.minHeight : - Math.min( options.minHeight, options.height ); - }, - - _position: function() { - - // Need to show the dialog to get the actual offset in the position plugin - var isVisible = this.uiDialog.is( ":visible" ); - if ( !isVisible ) { - this.uiDialog.show(); - } - this.uiDialog.position( this.options.position ); - if ( !isVisible ) { - this.uiDialog.hide(); - } - }, - - _setOptions: function( options ) { - var that = this, - resize = false, - resizableOptions = {}; - - $.each( options, function( key, value ) { - that._setOption( key, value ); - - if ( key in that.sizeRelatedOptions ) { - resize = true; - } - if ( key in that.resizableRelatedOptions ) { - resizableOptions[ key ] = value; - } - } ); - - if ( resize ) { - this._size(); - this._position(); - } - if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { - this.uiDialog.resizable( "option", resizableOptions ); - } - }, - - _setOption: function( key, value ) { - var isDraggable, isResizable, - uiDialog = this.uiDialog; - - if ( key === "disabled" ) { - return; - } - - this._super( key, value ); - - if ( key === "appendTo" ) { - this.uiDialog.appendTo( this._appendTo() ); - } - - if ( key === "buttons" ) { - this._createButtons(); - } - - if ( key === "closeText" ) { - this.uiDialogTitlebarClose.button( { - - // Ensure that we always pass a string - label: $( "" ).text( "" + this.options.closeText ).html() - } ); - } - - if ( key === "draggable" ) { - isDraggable = uiDialog.is( ":data(ui-draggable)" ); - if ( isDraggable && !value ) { - uiDialog.draggable( "destroy" ); - } - - if ( !isDraggable && value ) { - this._makeDraggable(); - } - } - - if ( key === "position" ) { - this._position(); - } - - if ( key === "resizable" ) { - - // currently resizable, becoming non-resizable - isResizable = uiDialog.is( ":data(ui-resizable)" ); - if ( isResizable && !value ) { - uiDialog.resizable( "destroy" ); - } - - // Currently resizable, changing handles - if ( isResizable && typeof value === "string" ) { - uiDialog.resizable( "option", "handles", value ); - } - - // Currently non-resizable, becoming resizable - if ( !isResizable && value !== false ) { - this._makeResizable(); - } - } - - if ( key === "title" ) { - this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) ); - } - - if ( key === "modal" ) { - uiDialog.attr( "aria-modal", value ? "true" : null ); - } - }, - - _size: function() { - - // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - // divs will both have width and height set, so we need to reset them - var nonContentHeight, minContentHeight, maxContentHeight, - options = this.options; - - // Reset content sizing - this.element.show().css( { - width: "auto", - minHeight: 0, - maxHeight: "none", - height: 0 - } ); - - if ( options.minWidth > options.width ) { - options.width = options.minWidth; - } - - // Reset wrapper sizing - // determine the height of all the non-content elements - nonContentHeight = this.uiDialog.css( { - height: "auto", - width: options.width - } ) - .outerHeight(); - minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); - maxContentHeight = typeof options.maxHeight === "number" ? - Math.max( 0, options.maxHeight - nonContentHeight ) : - "none"; - - if ( options.height === "auto" ) { - this.element.css( { - minHeight: minContentHeight, - maxHeight: maxContentHeight, - height: "auto" - } ); - } else { - this.element.height( Math.max( 0, options.height - nonContentHeight ) ); - } - - if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { - this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); - } - }, - - _blockFrames: function() { - this.iframeBlocks = this.document.find( "iframe" ).map( function() { - var iframe = $( this ); - - return $( "
" ) - .css( { - position: "absolute", - width: iframe.outerWidth(), - height: iframe.outerHeight() - } ) - .appendTo( iframe.parent() ) - .offset( iframe.offset() )[ 0 ]; - } ); - }, - - _unblockFrames: function() { - if ( this.iframeBlocks ) { - this.iframeBlocks.remove(); - delete this.iframeBlocks; - } - }, - - _allowInteraction: function( event ) { - if ( $( event.target ).closest( ".ui-dialog" ).length ) { - return true; - } - - // TODO: Remove hack when datepicker implements - // the .ui-front logic (#8989) - return !!$( event.target ).closest( ".ui-datepicker" ).length; - }, - - _createOverlay: function() { - if ( !this.options.modal ) { - return; - } - - // We use a delay in case the overlay is created from an - // event that we're going to be cancelling (#2804) - var isOpening = true; - this._delay( function() { - isOpening = false; - } ); - - if ( !this.document.data( "ui-dialog-overlays" ) ) { - - // Prevent use of anchors and inputs - // This doesn't use `_on()` because it is a shared event handler - // across all open modal dialogs. - this.document.on( "focusin.ui-dialog", function( event ) { - if ( isOpening ) { - return; - } - - var instance = this._trackingInstances()[ 0 ]; - if ( !instance._allowInteraction( event ) ) { - event.preventDefault(); - instance._focusTabbable(); - } - }.bind( this ) ); - } - - this.overlay = $( "
" ) - .appendTo( this._appendTo() ); - - this._addClass( this.overlay, null, "ui-widget-overlay ui-front" ); - this._on( this.overlay, { - mousedown: "_keepFocus" - } ); - this.document.data( "ui-dialog-overlays", - ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 ); - }, - - _destroyOverlay: function() { - if ( !this.options.modal ) { - return; - } - - if ( this.overlay ) { - var overlays = this.document.data( "ui-dialog-overlays" ) - 1; - - if ( !overlays ) { - this.document.off( "focusin.ui-dialog" ); - this.document.removeData( "ui-dialog-overlays" ); - } else { - this.document.data( "ui-dialog-overlays", overlays ); - } - - this.overlay.remove(); - this.overlay = null; - } - } -} ); - -// DEPRECATED -// TODO: switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat === true ) { - - // Backcompat for dialogClass option - $.widget( "ui.dialog", $.ui.dialog, { - options: { - dialogClass: "" - }, - _createWrapper: function() { - this._super(); - this.uiDialog.addClass( this.options.dialogClass ); - }, - _setOption: function( key, value ) { - if ( key === "dialogClass" ) { - this.uiDialog - .removeClass( this.options.dialogClass ) - .addClass( value ); - } - this._superApply( arguments ); - } - } ); -} - -var widgetsDialog = $.ui.dialog; - - -/*! - * jQuery UI Tooltip 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - */ - -//>>label: Tooltip -//>>group: Widgets -//>>description: Shows additional information for any element on hover or focus. -//>>docs: https://api.jqueryui.com/tooltip/ -//>>demos: https://jqueryui.com/tooltip/ -//>>css.structure: ../../themes/base/core.css -//>>css.structure: ../../themes/base/tooltip.css -//>>css.theme: ../../themes/base/theme.css - - -$.widget( "ui.tooltip", { - version: "1.14.1", - options: { - classes: { - "ui-tooltip": "ui-corner-all ui-widget-shadow" - }, - content: function() { - var title = $( this ).attr( "title" ); - - // Escape title, since we're going from an attribute to raw HTML - return $( "" ).text( title ).html(); - }, - hide: true, - - // Disabled elements have inconsistent behavior across browsers (#8661) - items: "[title]:not([disabled])", - position: { - my: "left top+15", - at: "left bottom", - collision: "flipfit flip" - }, - show: true, - track: false, - - // Callbacks - close: null, - open: null - }, - - _addDescribedBy: function( elem, id ) { - var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ); - describedby.push( id ); - elem - .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); - }, - - _removeDescribedBy: function( elem ) { - var id = elem.data( "ui-tooltip-id" ), - describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ), - index = $.inArray( id, describedby ); - - if ( index !== -1 ) { - describedby.splice( index, 1 ); - } - - elem.removeData( "ui-tooltip-id" ); - describedby = String.prototype.trim.call( describedby.join( " " ) ); - if ( describedby ) { - elem.attr( "aria-describedby", describedby ); - } else { - elem.removeAttr( "aria-describedby" ); - } - }, - - _create: function() { - this._on( { - mouseover: "open", - focusin: "open" - } ); - - // IDs of generated tooltips, needed for destroy - this.tooltips = {}; - - // IDs of parent tooltips where we removed the title attribute - this.parents = {}; - - // Append the aria-live region so tooltips announce correctly - this.liveRegion = $( "
" ) - .attr( { - role: "log", - "aria-live": "assertive", - "aria-relevant": "additions" - } ) - .appendTo( this.document[ 0 ].body ); - this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); - - this.disabledTitles = $( [] ); - }, - - _setOption: function( key, value ) { - var that = this; - - this._super( key, value ); - - if ( key === "content" ) { - $.each( this.tooltips, function( id, tooltipData ) { - that._updateContent( tooltipData.element ); - } ); - } - }, - - _setOptionDisabled: function( value ) { - this[ value ? "_disable" : "_enable" ](); - }, - - _disable: function() { - var that = this; - - // Close open tooltips - $.each( this.tooltips, function( id, tooltipData ) { - var event = $.Event( "blur" ); - event.target = event.currentTarget = tooltipData.element[ 0 ]; - that.close( event, true ); - } ); - - // Remove title attributes to prevent native tooltips - this.disabledTitles = this.disabledTitles.add( - this.element.find( this.options.items ).addBack() - .filter( function() { - var element = $( this ); - if ( element.is( "[title]" ) ) { - return element - .data( "ui-tooltip-title", element.attr( "title" ) ) - .removeAttr( "title" ); - } - } ) - ); - }, - - _enable: function() { - - // restore title attributes - this.disabledTitles.each( function() { - var element = $( this ); - if ( element.data( "ui-tooltip-title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - } ); - this.disabledTitles = $( [] ); - }, - - open: function( event ) { - var that = this, - target = $( event ? event.target : this.element ) - - // we need closest here due to mouseover bubbling, - // but always pointing at the same event target - .closest( this.options.items ); - - // No element to show a tooltip for or the tooltip is already open - if ( !target.length || target.data( "ui-tooltip-id" ) ) { - return; - } - - if ( target.attr( "title" ) ) { - target.data( "ui-tooltip-title", target.attr( "title" ) ); - } - - target.data( "ui-tooltip-open", true ); - - // Kill parent tooltips, custom or native, for hover - if ( event && event.type === "mouseover" ) { - target.parents().each( function() { - var parent = $( this ), - blurEvent; - if ( parent.data( "ui-tooltip-open" ) ) { - blurEvent = $.Event( "blur" ); - blurEvent.target = blurEvent.currentTarget = this; - that.close( blurEvent, true ); - } - if ( parent.attr( "title" ) ) { - parent.uniqueId(); - that.parents[ this.id ] = { - element: this, - title: parent.attr( "title" ) - }; - parent.attr( "title", "" ); - } - } ); - } - - this._registerCloseHandlers( event, target ); - this._updateContent( target, event ); - }, - - _updateContent: function( target, event ) { - var content, - contentOption = this.options.content, - that = this, - eventType = event ? event.type : null; - - if ( typeof contentOption === "string" || contentOption.nodeType || - contentOption.jquery ) { - return this._open( event, target, contentOption ); - } - - content = contentOption.call( target[ 0 ], function( response ) { - - // Ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - - // JQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - that._open( event, target, response ); - } ); - if ( content ) { - this._open( event, target, content ); - } - }, - - _open: function( event, target, content ) { - var tooltipData, tooltip, delayedShow, a11yContent, - positionOption = $.extend( {}, this.options.position ); - - if ( !content ) { - return; - } - - // Content can be updated multiple times. If the tooltip already - // exists, then just update the content and bail. - tooltipData = this._find( target ); - if ( tooltipData ) { - tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); - return; - } - - // If we have a title, clear it to prevent the native tooltip - // we have to check first to avoid defining a title if none exists - // (we don't want to cause an element to start matching [title]) - // - // We use removeAttr only for key events, to allow IE to export the correct - // accessible attributes. For mouse events, set to empty string to avoid - // native tooltip showing up (happens only when removing inside mouseover). - if ( target.is( "[title]" ) ) { - if ( event && event.type === "mouseover" ) { - target.attr( "title", "" ); - } else { - target.removeAttr( "title" ); - } - } - - tooltipData = this._tooltip( target ); - tooltip = tooltipData.tooltip; - this._addDescribedBy( target, tooltip.attr( "id" ) ); - tooltip.find( ".ui-tooltip-content" ).html( content ); - - // Support: Voiceover on OS X, JAWS on IE <= 9 - // JAWS announces deletions even when aria-relevant="additions" - // Voiceover will sometimes re-read the entire log region's contents from the beginning - this.liveRegion.children().hide(); - a11yContent = $( "
" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); - a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" ); - a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); - a11yContent.appendTo( this.liveRegion ); - - function position( event ) { - positionOption.of = event; - if ( tooltip.is( ":hidden" ) ) { - return; - } - tooltip.position( positionOption ); - } - if ( this.options.track && event && /^mouse/.test( event.type ) ) { - this._on( this.document, { - mousemove: position - } ); - - // trigger once to override element-relative positioning - position( event ); - } else { - tooltip.position( $.extend( { - of: target - }, this.options.position ) ); - } - - tooltip.hide(); - - this._show( tooltip, this.options.show ); - - // Handle tracking tooltips that are shown with a delay (#8644). As soon - // as the tooltip is visible, position the tooltip using the most recent - // event. - // Adds the check to add the timers only when both delay and track options are set (#14682) - if ( this.options.track && this.options.show && this.options.show.delay ) { - delayedShow = this.delayedShow = setInterval( function() { - if ( tooltip.is( ":visible" ) ) { - position( positionOption.of ); - clearInterval( delayedShow ); - } - }, 13 ); - } - - this._trigger( "open", event, { tooltip: tooltip } ); - }, - - _registerCloseHandlers: function( event, target ) { - var events = { - keyup: function( event ) { - if ( event.keyCode === $.ui.keyCode.ESCAPE ) { - var fakeEvent = $.Event( event ); - fakeEvent.currentTarget = target[ 0 ]; - this.close( fakeEvent, true ); - } - } - }; - - // Only bind remove handler for delegated targets. Non-delegated - // tooltips will handle this in destroy. - if ( target[ 0 ] !== this.element[ 0 ] ) { - events.remove = function() { - var targetElement = this._find( target ); - if ( targetElement ) { - this._removeTooltip( targetElement.tooltip ); - } - }; - } - - if ( !event || event.type === "mouseover" ) { - events.mouseleave = "close"; - } - if ( !event || event.type === "focusin" ) { - events.focusout = "close"; - } - this._on( true, target, events ); - }, - - close: function( event ) { - var tooltip, - that = this, - target = $( event ? event.currentTarget : this.element ), - tooltipData = this._find( target ); - - // The tooltip may already be closed - if ( !tooltipData ) { - - // We set ui-tooltip-open immediately upon open (in open()), but only set the - // additional data once there's actually content to show (in _open()). So even if the - // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in - // the period between open() and _open(). - target.removeData( "ui-tooltip-open" ); - return; - } - - tooltip = tooltipData.tooltip; - - // Disabling closes the tooltip, so we need to track when we're closing - // to avoid an infinite loop in case the tooltip becomes disabled on close - if ( tooltipData.closing ) { - return; - } - - // Clear the interval for delayed tracking tooltips - clearInterval( this.delayedShow ); - - // Only set title if we had one before (see comment in _open()) - // If the title attribute has changed since open(), don't restore - if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { - target.attr( "title", target.data( "ui-tooltip-title" ) ); - } - - this._removeDescribedBy( target ); - - tooltipData.hiding = true; - tooltip.stop( true ); - this._hide( tooltip, this.options.hide, function() { - that._removeTooltip( $( this ) ); - } ); - - target.removeData( "ui-tooltip-open" ); - this._off( target, "mouseleave focusout keyup" ); - - // Remove 'remove' binding only on delegated targets - if ( target[ 0 ] !== this.element[ 0 ] ) { - this._off( target, "remove" ); - } - this._off( this.document, "mousemove" ); - - if ( event && event.type === "mouseleave" ) { - $.each( this.parents, function( id, parent ) { - $( parent.element ).attr( "title", parent.title ); - delete that.parents[ id ]; - } ); - } - - tooltipData.closing = true; - this._trigger( "close", event, { tooltip: tooltip } ); - if ( !tooltipData.hiding ) { - tooltipData.closing = false; - } - }, - - _tooltip: function( element ) { - var tooltip = $( "
" ).attr( "role", "tooltip" ), - content = $( "
" ).appendTo( tooltip ), - id = tooltip.uniqueId().attr( "id" ); - - this._addClass( content, "ui-tooltip-content" ); - this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" ); - - tooltip.appendTo( this._appendTo( element ) ); - - return this.tooltips[ id ] = { - element: element, - tooltip: tooltip - }; - }, - - _find: function( target ) { - var id = target.data( "ui-tooltip-id" ); - return id ? this.tooltips[ id ] : null; - }, - - _removeTooltip: function( tooltip ) { - - // Clear the interval for delayed tracking tooltips - clearInterval( this.delayedShow ); - - tooltip.remove(); - delete this.tooltips[ tooltip.attr( "id" ) ]; - }, - - _appendTo: function( target ) { - var element = target.closest( ".ui-front, dialog" ); - - if ( !element.length ) { - element = this.document[ 0 ].body; - } - - return element; - }, - - _destroy: function() { - var that = this; - - // Close open tooltips - $.each( this.tooltips, function( id, tooltipData ) { - - // Delegate to close method to handle common cleanup - var event = $.Event( "blur" ), - element = tooltipData.element; - event.target = event.currentTarget = element[ 0 ]; - that.close( event, true ); - - // Remove immediately; destroying an open tooltip doesn't use the - // hide animation - $( "#" + id ).remove(); - - // Restore the title - if ( element.data( "ui-tooltip-title" ) ) { - - // If the title attribute has changed since open(), don't restore - if ( !element.attr( "title" ) ) { - element.attr( "title", element.data( "ui-tooltip-title" ) ); - } - element.removeData( "ui-tooltip-title" ); - } - } ); - this.liveRegion.remove(); - } -} ); - -// DEPRECATED -// TODO: Switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat === true ) { - - // Backcompat for tooltipClass option - $.widget( "ui.tooltip", $.ui.tooltip, { - options: { - tooltipClass: null - }, - _tooltip: function() { - var tooltipData = this._superApply( arguments ); - if ( this.options.tooltipClass ) { - tooltipData.tooltip.addClass( this.options.tooltipClass ); - } - return tooltipData; - } - } ); -} - -var widgetsTooltip = $.ui.tooltip; - - - - -} ); \ No newline at end of file diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.css deleted file mode 100644 index d22b8c87c71..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Includes: draggable.css, core.css, resizable.css, sortable.css, button.css, controlgroup.css, checkboxradio.css, dialog.css, tooltip.css, theme.css -* To view and modify this theme, visit https://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -.ui-draggable-handle{touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-sortable-handle{touch-action:none}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;user-select:none}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;background-image:none}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank.ui-icon-blank.ui-icon-blank{background-image:none}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3}.ui-widget-shadow{box-shadow:0 0 5px #666} \ No newline at end of file diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.js b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.js deleted file mode 100644 index 008b7d65a24..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/resizable.js, widgets/sortable.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/dialog.js, widgets/mouse.js, widgets/tooltip.js -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";t.ui=t.ui||{},t.ui.version="1.14.1";var e,i,s,o,n=0,r=Array.prototype.hasOwnProperty,h=Array.prototype.slice;e=t.cleanData,t.cleanData=function(i){var s,o,n;for(n=0;null!=(o=i[n]);n++)(s=t._data(o,"events"))&&s.remove&&t(o).triggerHandler("remove");e(i)},t.widget=function(e,i,s){var o,n,r,h={},a=e.split(".")[0];if("__proto__"===(e=e.split(".")[1])||"constructor"===e)return t.error("Invalid widget name: "+e);var l=a+"-"+e;return s||(s=i,i=t.Widget),Array.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr.pseudos[l.toLowerCase()]=function(e){return!!t.data(e,l)},t[a]=t[a]||{},o=t[a][e],n=t[a][e]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},t.extend(n,o,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),(r=new i).options=t.widget.extend({},r.options),t.each(s,function(t,e){if("function"!=typeof e){h[t]=e;return}h[t]=function(){function s(){return i.prototype[t].apply(this,arguments)}function o(e){return i.prototype[t].apply(this,e)}return function(){var t,i=this._super,n=this._superApply;return this._super=s,this._superApply=o,t=e.apply(this,arguments),this._super=i,this._superApply=n,t}}()}),n.prototype=t.widget.extend(r,{widgetEventPrefix:o&&r.widgetEventPrefix||e},h,{constructor:n,namespace:a,widgetName:e,widgetFullName:l}),o?(t.each(o._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,n,i._proto)}),delete o._childConstructors):i._childConstructors.push(n),t.widget.bridge(e,n),n},t.widget.extend=function(e){for(var i,s,o=h.call(arguments,1),n=0,a=o.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,o,n,r=e;if(0==arguments.length)return t.widget.extend({},this.options);if("string"==typeof e){if(r={},e=(s=e.split(".")).shift(),s.length){for(n=0,o=r[e]=t.widget.extend({},this.options[e]);n
"),n=o.children()[0];return t("body").append(o),i=n.offsetWidth,o.css("overflow","scroll"),i===(s=n.offsetWidth)&&(s=o[0].clientWidth),o.remove(),e=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.width0?"right":"center",vertical:c<0?"top":l>0?"bottom":"middle"};fi(s(l),s(c))?p.important="horizontal":p.important="vertical",e.using.call(this,t,p)}),r.offset(t.extend(C,{using:n}))})},t.ui.position={fit:{left:function(t,e){var s,o=e.within,n=o.isWindow?o.scrollLeft:o.offset.left,r=o.width,h=t.left-e.collisionPosition.marginLeft,a=n-h,l=h+e.collisionWidth-r-n;e.collisionWidth>r?a>0&&l<=0?(s=t.left+a+e.collisionWidth-r-n,t.left+=a-s):l>0&&a<=0?t.left=n:a>l?t.left=n+r-e.collisionWidth:t.left=n:a>0?t.left+=a:l>0?t.left-=l:t.left=i(t.left-h,t.left)},top:function(t,e){var s,o=e.within,n=o.isWindow?o.scrollTop:o.offset.top,r=e.within.height,h=t.top-e.collisionPosition.marginTop,a=n-h,l=h+e.collisionHeight-r-n;e.collisionHeight>r?a>0&&l<=0?(s=t.top+a+e.collisionHeight-r-n,t.top+=a-s):l>0&&a<=0?t.top=n:a>l?t.top=n+r-e.collisionHeight:t.top=n:a>0?t.top+=a:l>0?t.top-=l:t.top=i(t.top-h,t.top)}},flip:{left:function(t,e){var i,o,n=e.within,r=n.offset.left+n.scrollLeft,h=n.width,a=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-a,p=l+e.collisionWidth-h-a,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];c<0?((i=t.left+u+d+f+e.collisionWidth-h-r)<0||i0&&((o=t.left-e.collisionPosition.marginLeft+u+d+f-a)>0||s(o)0&&((i=t.top-e.collisionPosition.marginTop+u+d+f-a)>0||s(i)0&&n.is(":visible")):(/^(input|select|textarea|button|object)$/.test(a)?(r=!e.disabled)&&(h=t(e).closest("fieldset")[0])&&(r=!h.disabled):r="a"===a&&e.href||i,r&&t(e).is(":visible")&&"visible"===t(e).css("visibility"))},t.extend(t.expr.pseudos,{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=t(this.element.prop("form")),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.labels=function(){var t,e,i,s,o;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(i=this.attr("id"))&&(o=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+CSS.escape(i)+"']",s=s.add(o.find(e).addBack(e))),this.pushStack(s)):this.pushStack([])},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var e=t(this);return(!s||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&n.length?n:t(this[0].ownerDocument||document)},t.extend(t.expr.pseudos,{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:(s=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}});var a=!1;t(document).on("mouseup",function(){a=!1}),t.widget("ui.mouse",{version:"1.14.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&t(e.target).closest(this.options.cancel).length;return!(s&&!o&&this._mouseCapture(e))||((this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted))?e.preventDefault():(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),a=!0),!0)}},_mouseMove:function(t){if(this._mouseMoved&&!t.which){if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return((t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted)?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,a=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var o,n=t.ui[e].prototype;for(o in s)n.plugins[o]=n.plugins[o]||[],n.plugins[o].push([i,s[o]])},call:function(t,e,i,s){var o,n=t.plugins[e];if(n&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=this.document[0].activeElement;!t(e.target).closest(i).length&&t(i).trigger("blur")},_mouseStart:function(e){var i=this.options;return(this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e))?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s="function"==typeof i.helper,o=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),Array.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,o=this.options,n=this.document[0];if(this.relativeContainer=null,!o.containment){this.containment=null;return}if("window"===o.containment){this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if("document"===o.containment){this.containment=[0,0,t(n).width()-this.helperProportions.width-this.margins.left,(t(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(o.containment.constructor===Array){this.containment=o.containment;return}"parent"===o.containment&&(o.containment=this.helper[0].parentNode),(s=(i=t(o.containment))[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,o,n,r=this.options,h=this._isRootNode(this.scrollParent[0]),a=t.pageX,l=t.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(a=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,l=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o,n=r.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,a=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n),"y"===r.axis&&(a=this.originalPageX),"x"===r.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var o=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i,s){var o=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){this.isOver?(this.isOver=0,s.cancelHelperRemoval=!0,this.cancelHelperRemoval=!1,this._storedCSS={position:this.placeholder.css("position"),top:this.placeholder.css("top"),left:this.placeholder.css("left")},this._mouseStop(e),this.options.helper=this.options._helper):(this.cancelHelperRemoval=!0,this._trigger("deactivate",e,o))})},drag:function(e,i,s){t.each(s.sortables,function(){var o=!1,n=this;n.positionAbs=s.positionAbs,n.helperProportions=s.helperProportions,n.offset.click=s.offset.click,n._intersectsWith(n.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==n&&this._intersectsWith(this.containerCache)&&t.contains(n.element[0],this.element[0])&&(o=!1),o})),o?(n.isOver||(n.isOver=1,s._parent=i.helper.parent(),n.currentItem=i.helper.appendTo(n.element).data("ui-sortable-item",!0),n.options._helper=n.options.helper,n.options.helper=function(){return i.helper[0]},e.target=n.currentItem[0],n._mouseCapture(e,!0),n._mouseStart(e,!0,!0),n.offset.click.top=s.offset.click.top,n.offset.click.left=s.offset.click.left,n.offset.parent.left-=s.offset.parent.left-n.offset.parent.left,n.offset.parent.top-=s.offset.parent.top-n.offset.parent.top,s._trigger("toSortable",e),s.dropped=n.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,n.fromOutside=s),n.currentItem&&(n._mouseDrag(e),i.position=n.position)):n.isOver&&(n.isOver=0,n.cancelHelperRemoval=!0,n.options._revert=n.options.revert,n.options.revert=!1,n._trigger("out",e,n._uiHash(n)),n._mouseStop(e,!0),n.options.revert=n.options._revert,n.options.helper=n.options._helper,n.placeholder&&n.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var o=t("body"),n=s.options;o.css("cursor")&&(n._cursor=o.css("cursor")),o.css("cursor",n.cursor)},stop:function(e,i,s){var o=s.options;o._cursor&&t("body").css("cursor",o._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var o=t(i.helper),n=s.options;o.css("opacity")&&(n._opacity=o.css("opacity")),o.css("opacity",n.opacity)},stop:function(e,i,s){var o=s.options;o._opacity&&t(i.helper).css("opacity",o._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var o=s.options,n=!1,r=s.scrollParentNotHidden[0],h=s.document[0];r!==h&&"HTML"!==r.tagName?((!o.axis||"x"!==o.axis)&&(s.overflowOffset.top+r.offsetHeight-e.pageY=0;u--){if(l=(a=s.snapElements[u].left-s.margins.left)+s.snapElements[u].width,p=(c=s.snapElements[u].top-s.margins.top)+s.snapElements[u].height,_l+g||bp+g||!t.contains(s.snapElements[u].item.ownerDocument,s.snapElements[u].item)){s.snapElements[u].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[u].item})),s.snapElements[u].snapping=!1;continue}"inner"!==f.snapMode&&(o=Math.abs(c-b)<=g,n=Math.abs(p-v)<=g,r=Math.abs(a-_)<=g,h=Math.abs(l-m)<=g,o&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),n&&(i.position.top=s._convertPositionTo("relative",{top:p,left:0}).top),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:a-s.helperProportions.width}).left),h&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),d=o||n||r||h,"outer"!==f.snapMode&&(o=Math.abs(c-v)<=g,n=Math.abs(p-b)<=g,r=Math.abs(a-m)<=g,h=Math.abs(l-_)<=g,o&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),n&&(i.position.top=s._convertPositionTo("relative",{top:p-s.helperProportions.height,left:0}).top),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:a}).left),h&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[u].snapping&&(o||n||r||h||d)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[u].item})),s.snapElements[u].snapping=o||n||r||h||d}}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var o,n=s.options,r=t.makeArray(t(n.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});r.length&&(o=parseInt(t(r[0]).css("zIndex"),10)||0,t(r).each(function(e){t(this).css("zIndex",o+e)}),this.css("zIndex",o+r.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var o=t(i.helper),n=s.options;o.css("zIndex")&&(n._zIndex=o.css("zIndex")),o.css("zIndex",n.zIndex)},stop:function(e,i,s){var o=s.options;o._zIndex&&t(i.helper).css("zIndex",o._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){var s,o=!1,n=t(e).css("overflow");if("hidden"===n)return!1;if("scroll"===n||e[s=i&&"left"===i?"scrollLeft":"scrollTop"]>0)return!0;try{e[s]=1,o=e[s]>0,e[s]=0}catch(t){}return o},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){!i.disabled&&(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){!i.disabled&&(s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide()))}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable")};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var e,i,s,o,n,r=this.options,h=this;if(this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this._addedHandles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;i"),this._addClass(n,"ui-resizable-handle "+o),n.css({zIndex:r.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.children(this.handles[e]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(e){var i,s,o,n;for(i in e=e||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),n=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),o=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(o,n),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(e){var i,s,o=!1;for(i in this.handles)((s=t(this.handles[i])[0])===e.target||t.contains(s,e.target))&&(o=!0);return!this.options.disabled&&o},_mouseStart:function(e){var i,s,o,n,r=this.options,h=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),r.containment&&(i+=t(r.containment).scrollLeft()||0,s+=t(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this._helper||(n=this._calculateAdjustedElementDimensions(h)),this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width,height:n.height},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:n.width,height:n.height},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,o=this.originalMousePosition,n=this.axis,r=e.pageX-o.left||0,h=e.pageY-o.top||0,a=this._change[n];return this._updatePrevProperties(),!!a&&(i=a.apply(this,[e,r,h]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,s,o,n,r,h,a,l=this.options;return this._helper&&(o=(s=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:this.sizeDiff.height,n=s?0:this.sizeDiff.width,r={width:this.helper.width()-n,height:this.helper.height()-o},h=parseFloat(this.element.css("left"))+(this.position.left-this.originalPosition.left)||null,a=parseFloat(this.element.css("top"))+(this.position.top-this.originalPosition.top)||null,l.animate||this.element.css(t.extend(r,{top:a,left:h})),this.helper.height(this.size.height),this.helper.width(this.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.helper.css(t),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px",this.helper.width(t.width)),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px",this.helper.height(t.height)),t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,s=n.minWidth/this.aspectRatio,i=n.maxHeight*this.aspectRatio,o=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),s>n.minHeight&&(n.minHeight=s),it.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,a=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return n&&(t.width=e.minWidth),r&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),n&&l&&(t.left=h-e.minWidth),s&&l&&(t.left=h-e.maxWidth),r&&c&&(t.top=a-e.minHeight),o&&c&&(t.top=a-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(o[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_calculateAdjustedElementDimensions:function(t){var e,i,s,o=t.get(0);return"content-box"===t.css("box-sizing")&&(this._hasScroll(o)||this._hasScroll(o,"left"))?(e=parseFloat(o.style.width),i=parseFloat(o.style.height),s=this._getPaddingPlusBorderDimensions(t),e=isNaN(e)?this._getElementTheoreticalSize(t,s,"width"):e,{height:i=isNaN(i)?this._getElementTheoreticalSize(t,s,"height"):i,width:e}):{height:parseFloat(t.css("height")),width:parseFloat(t.css("width"))}},_getElementTheoreticalSize:function(t,e,i){return Math.max(0,Math.ceil(t.get(0)["offset"+i[0].toUpperCase()+i.slice(1)]-e[i]-.5))||0},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,o=i._proportionallyResizeElements,n=o.length&&/textarea/i.test(o[0].nodeName),r=n&&i._hasScroll(o[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,a={width:i.size.width-h,height:i.size.height-r},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(a,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};o&&o.length&&t(o[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,o,n,r,h,a=t(this).resizable("instance"),l=a.options,c=a.element,p=l.containment,u=p instanceof t?p.get(0):/parent/.test(p)?c.parent().get(0):p;u&&(a.containerElement=t(u),/document/.test(p)||p===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(u),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=a._num(e.css("padding"+s))}),a.containerOffset=e.offset(),a.containerPosition=e.position(),a.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=a.containerOffset,o=a.containerSize.height,n=a.containerSize.width,r=a._hasScroll(u,"left")?u.scrollWidth:n,h=a._hasScroll(u)?u.scrollHeight:o,a.parentData={element:u,left:s.left,top:s.top,width:r,height:h}))},resize:function(e){var i,s,o,n,r=t(this).resizable("instance"),h=r.options,a=r.containerOffset,l=r.position,c=r._aspectRatio||e.shiftKey,p={top:0,left:0},u=r.containerElement,d=!0;u[0]!==document&&/static/.test(u.css("position"))&&(p=a),l.left<(r._helper?a.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-a.left:r.position.left-p.left),c&&(r.size.height=r.size.width/r.aspectRatio,d=!1),r.position.left=h.helper?a.left:0),l.top<(r._helper?a.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-a.top:r.position.top),c&&(r.size.width=r.size.height*r.aspectRatio,d=!1),r.position.top=r._helper?a.top:0),o=r.containerElement.get(0)===r.element.parent().get(0),n=/relative|absolute/.test(r.containerElement.css("position")),o&&n?(r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top):(r.offset.left=r.element.offset().left,r.offset.top=r.element.offset().top),i=Math.abs(r.sizeDiff.width+(r._helper?r.offset.left-p.left:r.offset.left-a.left)),s=Math.abs(r.sizeDiff.height+(r._helper?r.offset.top-p.top:r.offset.top-a.top)),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,c&&(r.size.height=r.size.width/r.aspectRatio,d=!1)),s+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-s,c&&(r.size.width=r.size.height*r.aspectRatio,d=!1)),d||(r.position.left=r.prevPosition.left,r.position.top=r.prevPosition.top,r.size.width=r.prevSize.width,r.size.height=r.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,o=e.containerPosition,n=e.containerElement,r=t(e.helper),h=r.offset(),a=r.outerWidth()-e.sizeDiff.width,l=r.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(n.css("position"))&&t(this).css({left:h.left-o.left-s.left,width:a,height:l}),e._helper&&!i.animate&&/static/.test(n.css("position"))&&t(this).css({left:h.left-o.left-s.left,width:a,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance");t(e.options.alsoResize).each(function(){var i=t(this),s=e._calculateAdjustedElementDimensions(i);i.data("ui-resizable-alsoresize",{width:s.width,height:s.height,left:parseFloat(i.css("left")),top:parseFloat(i.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),o=s.options,n=s.originalSize,r=s.originalPosition,h={height:s.size.height-n.height||0,width:s.size.width-n.width||0,top:s.position.top-r.top||0,left:s.position.left-r.left||0};t(o.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),o={},n=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(n,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!0===t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,o=i.size,n=i.originalSize,r=i.originalPosition,h=i.axis,a="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=a[0]||1,c=a[1]||1,p=Math.round((o.width-n.width)/l)*l,u=Math.round((o.height-n.height)/c)*c,d=n.width+p,f=n.height+u,g=s.maxWidth&&s.maxWidthd,v=s.minHeight&&s.minHeight>f;s.grid=a,_&&(d+=l),v&&(f+=c),g&&(d-=l),m&&(f-=c),/^(se|s|e)$/.test(h)?(i.size.width=d,i.size.height=f):/^(ne)$/.test(h)?(i.size.width=d,i.size.height=f,i.position.top=r.top-u):/^(sw)$/.test(h)?(i.size.width=d,i.size.height=f,i.position.left=r.left-p):((f-c<=0||d-l<=0)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=r.top-u):(f=c-e.height,i.size.height=f,i.position.top=r.top+n.height-f),d-l>0?(i.size.width=d,i.position.left=r.left-p):(d=l-e.width,i.size.width=d,i.position.left=r.left+n.width-d))}}),t.ui.resizable,t.widget("ui.sortable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&t=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,o=!1,n=this;return!this.reverting&&!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){if(t.data(this,n.widgetName+"-item")===n)return s=t(this),!1}),t.data(e.target,n.widgetName+"-item")===n&&(s=t(e.target)),!!s&&(!this.options.handle||!!i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(o=!0)}),!!o))&&(this.currentItem=s,this._removeCurrentsFromItems(),!0))},_mouseStart:function(e,i,s){var o,n,r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.appendTo=t("parent"!==r.appendTo?r.appendTo:this.currentItem.parent()),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),t.extend(this.offset,{parent:this._getParentOffset()}),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(n=this.document.find("body"),this._storedStylesheet=t("").appendTo(n)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(e),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;i--)if(o=(s=this.items[i]).item[0],(n=this._intersectsWithPointer(s))&&s.instance===this.currentContainer&&o!==this.currentItem[0]&&this.placeholder[1===n?"next":"prev"]()[0]!==o&&!t.contains(this.placeholder[0],o)&&("semi-dynamic"!==this.options.type||!t.contains(this.element[0],o))){if(this.direction=1===n?"down":"up","pointer"===this.options.tolerance||this._intersectsWithSides(s))this._rearrange(e,s);else break;this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,o=this.placeholder.offset(),n=this.options.axis,r={};n&&"x"!==n||(r.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(r.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,n=t.left,r=n+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,p="x"===this.options.axis||s+l>h&&s+ln&&e+ct[this.floating?"width":"height"]?p&&u:n0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,o,n,r=[],h=[],a=this._connectWith();if(a&&e)for(i=a.length-1;i>=0;i--)for(s=(o=t(a[i],this.document[0])).length-1;s>=0;s--)(n=t.data(o[s],this.widgetFullName))&&n!==this&&!n.options.disabled&&h.push(["function"==typeof n.options.items?n.options.items.call(n.element):t(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){r.push(this)}for(h.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=h.length-1;i>=0;i--)h[i][0].each(l);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i=0;i--)for(s=(o=t(u[i],this.document[0])).length-1;s>=0;s--)(n=t.data(o[s],this.widgetFullName))&&n!==this&&!n.options.disabled&&(p.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],e,{item:this.currentItem}):t(n.options.items,n.element),n]),this.containers.push(n));for(i=p.length-1;i>=0;i--)for(s=0,r=p[i][1],l=(h=p[i][0]).length;s=0;i--)s=this.items[i],(!this.currentContainer||s.instance===this.currentContainer||s.item[0]===this.currentItem[0])&&(o=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=o.outerWidth(),s.height=o.outerHeight()),s.left=(n=o.offset()).left,s.top=n.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;e>=0;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(e){var i,s,o=(e=e||this).options;o.placeholder&&o.placeholder.constructor!==String||(i=o.placeholder,s=e.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var o=t("<"+s+">",e.document[0]);return e._addClass(o,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(o,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(o)):"tr"===s?e._createTrPlaceholder(e.currentItem,o):"img"===s&&o.attr("src",e.currentItem.attr("src")),i||o.css("visibility","hidden"),o},update:function(t,n){(!i||o.forcePlaceholderSize)&&((!n.height()||o.forcePlaceholderSize&&("tbody"===s||"tr"===s))&&n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(o.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),o.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t(" ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,o,n,r,h,a,l,c,p,u=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0])){if(this._intersectsWith(this.containers[i].containerCache)){if(u&&t.contains(this.containers[i].element[0],u.element[0]))continue;u=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(u){if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",e,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(o=1e4,n=null,r=(c=u.floating||this._isFloating(this.currentItem))?"left":"top",h=c?"width":"height",p=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[d].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(a=this.items[s].item.offset()[r],l=!1,e[p]-a>this.items[s][h]/2&&(l=!0),Math.abs(e[p]-a)this.containment[2]&&(n=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),o.grid&&(i=this.originalPageY+Math.round((r-this.originalPageY)/o.grid[1])*o.grid[1],r=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-o.grid[1]:i+o.grid[1]:i,s=this.originalPageX+Math.round((n-this.originalPageX)/o.grid[0])*o.grid[0],n=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-o.grid[0]:s+o.grid[0]:s)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:h.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:h.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e&&s.push(function(t){this._trigger("update",t,this._uiHash())}),this===this.currentContainer||e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push((function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}).call(this,this.currentContainer)),s.push((function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}).call(this,this.currentContainer))),i=this.containers.length-1;i>=0;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this._storedStylesheet&&(this._storedStylesheet.remove(),this._storedStylesheet=null),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,o){var n,r={};if(o){if("controlgroupLabel"===s){(n=e.element.find(o)).each(function(){var e=t(this);!e.children(".ui-controlgroup-label-contents").length&&e.contents().wrapAll("")}),e._addClass(n,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(n.get());return}t.fn[s]&&(r=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(o).each(function(){var o=t(this),n=o[s]("instance"),h=t.widget.extend({},r);if("button"!==s||!o.parent(".ui-spinner").length){n||(n=o[s]()[s]("instance")),n&&(h.classes=e._resolveClassesValues(h.classes,n)),o[s](h);var a=o[s]("widget");t.data(a[0],"ui-controlgroup-data",n||o[s]("instance")),i.push(a[0])}}))}}),this.childWidgets=t(t.uniqueSort(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this).data("ui-controlgroup-data");i&&i[e]&&i[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]=({middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"})[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:({middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}})[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(t){var o=i.options.classes[t]||"";o=String.prototype.trim.call(o.replace(l,"")),s[t]=(o+" "+e[t]).replace(/\s+/g," ")}),s},_setOption:function(t,e){if("direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t){this._callChildMethod(e?"disable":"enable");return}this.refresh()},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var o=e[s]().data("ui-controlgroup-data");if(o&&i["_"+o.widgetName+"Options"]){var n=i["_"+o.widgetName+"Options"](1===e.length?"only":s);n.classes=i._resolveClassesValues(n.classes,o),o.element[o.widgetName](n)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.14.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s,o=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",(s=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=s.clone().wrapAll("
").parent().html()),this.originalLabel&&(o.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(o.disabled=e),o},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+CSS.escape(i)+"']";return i?(this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(t(this).prop("form")).length})).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t){this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e;return}this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t(""),this.iconSpace=t(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.14.1",defaultElement:"").button({label:t("
").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<"+(Number.isInteger(this.options.uiDialogTitleHeadingLevel)&&this.options.uiDialogTitleHeadingLevel>0&&this.options.uiDialogTitleHeadingLevel<=6?"h"+this.options.uiDialogTitleHeadingLevel:"span")+">").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=t("
"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("
").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;if(this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||Array.isArray(i)&&!i.length){this._removeClass(this.uiDialog,"ui-dialog-buttons");return}t.each(i,function(i,s){var o,n;s="function"==typeof s?{click:s,text:i}:s,o=(s=t.extend({type:"button"},s)).click,n={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("",s).button(n).appendTo(e.uiButtonSet).on("click",function(){o.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){var e=this,i=this.options;function s(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,o){e._addClass(t(this),"ui-dialog-dragging"),e._blockFrames(),e._trigger("dragStart",i,s(o))},drag:function(t,i){e._trigger("drag",t,s(i))},stop:function(o,n){var r=n.offset.left-e.document.scrollLeft(),h=n.offset.top-e.document.scrollTop();i.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" top"+(h>=0?"+":"")+h,of:e.window},e._removeClass(t(this),"ui-dialog-dragging"),e._unblockFrames(),e._trigger("dragStop",o,s(n))}})},_makeResizable:function(){var e=this,i=this.options,s=i.resizable,o=this.uiDialog.css("position");function n(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:"string"==typeof s?s:"n,e,s,w,se,sw,ne,nw",start:function(i,s){e._addClass(t(this),"ui-dialog-resizing"),e._blockFrames(),e._trigger("resizeStart",i,n(s))},resize:function(t,i){e._trigger("resize",t,n(i))},stop:function(s,o){var r=e.uiDialog.offset(),h=r.left-e.document.scrollLeft(),a=r.top-e.document.scrollTop();i.height=e.uiDialog.height(),i.width=e.uiDialog.width(),i.position={my:"left top",at:"left"+(h>=0?"+":"")+h+" top"+(a>=0?"+":"")+a,of:e.window},e._removeClass(t(this),"ui-dialog-resizing"),e._unblockFrames(),e._trigger("resizeStop",s,n(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,o={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(o[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,i){var s,o,n=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("").text(""+this.options.closeText).html()}),"draggable"===e&&((s=n.is(":data(ui-draggable)"))&&!i&&n.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"!==e||((o=n.is(":data(ui-resizable)"))&&!i&&n.resizable("destroy"),o&&"string"==typeof i&&n.resizable("option","handles",i),o||!1===i||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")),"modal"===e&&n.attr("aria-modal",i?"true":null))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("
").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",(function(t){if(!e){var i=this._trackingInstances()[0];i._allowInteraction(t)||(t.preventDefault(),i._focusTabbable())}}).bind(this)),this.overlay=t("
").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!0===t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.tooltip",{version:"1.14.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title");return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),o=t.inArray(i,s);-1!==o&&s.splice(o,1),e.removeData("ui-tooltip-id"),(s=String.prototype.trim.call(s.join(" ")))?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("
").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var o=t.Event("blur");o.target=o.currentTarget=s.element[0],e.close(o,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);if(e.is("[title]"))return e.data("ui-tooltip-title",e.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);!(!s.length||s.data("ui-tooltip-id"))&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&((e=t.Event("blur")).target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,o=this,n=e?e.type:null;if("string"==typeof s||s.nodeType||s.jquery)return this._open(e,t,s);(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&(e&&(e.type=n),o._open(e,t,i))}))&&this._open(e,t,i)},_open:function(e,i,s){var o,n,r,h,a=t.extend({},this.options.position);if(s){if(o=this._find(i)){o.tooltip.find(".ui-tooltip-content").html(s);return}i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),n=(o=this._tooltip(i)).tooltip,this._addDescribedBy(i,n.attr("id")),n.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),(h=t("
").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:l}),l(e)):n.position(t.extend({of:i},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){n.is(":visible")&&(l(a.of),clearInterval(r))},13)),this._trigger("open",e,{tooltip:n})}function l(t){a.of=t,!n.is(":hidden")&&n.position(a)}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){var t=this._find(i);t&&this._removeTooltip(t.tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,o=t(e?e.currentTarget:this.element),n=this._find(o);if(!n){o.removeData("ui-tooltip-open");return}i=n.tooltip,!n.closing&&(clearInterval(this.delayedShow),o.data("ui-tooltip-title")&&!o.attr("title")&&o.attr("title",o.data("ui-tooltip-title")),this._removeDescribedBy(o),n.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),o.removeData("ui-tooltip-open"),this._off(o,"mouseleave focusout keyup"),o[0]!==this.element[0]&&this._off(o,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),n.closing=!0,this._trigger("close",e,{tooltip:i}),n.hiding||(n.closing=!1))},_tooltip:function(e){var i=t("
").attr("role","tooltip"),s=t("
").appendTo(i),o=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[o]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var o=t.Event("blur"),n=s.element;o.target=o.currentTarget=n[0],e.close(o,!0),t("#"+i).remove(),n.data("ui-tooltip-title")&&(n.attr("title")||n.attr("title",n.data("ui-tooltip-title")),n.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!0===t.uiBackCompat&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}); \ No newline at end of file diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.css deleted file mode 100644 index 03c01618657..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.css +++ /dev/null @@ -1,411 +0,0 @@ -/*! - * jQuery UI CSS Framework 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - * - * https://api.jqueryui.com/category/theming/ - */ -.ui-draggable-handle { - touch-action: none; -} -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { - display: none; -} -.ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; -} -.ui-helper-clearfix:before, -.ui-helper-clearfix:after { - content: ""; - display: table; - border-collapse: collapse; -} -.ui-helper-clearfix:after { - clear: both; -} -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; -} - -.ui-front { - z-index: 100; -} - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { - cursor: default !important; - pointer-events: none; -} - - -/* Icons -----------------------------------*/ -.ui-icon { - display: inline-block; - vertical-align: middle; - margin-top: -.25em; - position: relative; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; -} - -.ui-widget-icon-block { - left: 50%; - margin-left: -8px; - display: block; -} - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -.ui-resizable { - position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - touch-action: none; -} -.ui-resizable-disabled .ui-resizable-handle, -.ui-resizable-autohide .ui-resizable-handle { - display: none; -} -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; -} -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; -} -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; -} -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; -} -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.ui-sortable-handle { - touch-action: none; -} -.ui-button { - padding: .4em 1em; - display: inline-block; - position: relative; - line-height: normal; - margin-right: .1em; - cursor: pointer; - vertical-align: middle; - text-align: center; - -webkit-user-select: none; - user-select: none; -} - -.ui-button, -.ui-button:link, -.ui-button:visited, -.ui-button:hover, -.ui-button:active { - text-decoration: none; -} - -/* to make room for the icon, a width needs to be set here */ -.ui-button-icon-only { - width: 2em; - box-sizing: border-box; - text-indent: -9999px; - white-space: nowrap; -} - -/* no icon support for input elements */ -input.ui-button.ui-button-icon-only { - text-indent: 0; -} - -/* button icon element(s) */ -.ui-button-icon-only .ui-icon { - position: absolute; - top: 50%; - left: 50%; - margin-top: -8px; - margin-left: -8px; -} - -.ui-button.ui-icon-notext .ui-icon { - padding: 0; - width: 2.1em; - height: 2.1em; - text-indent: -9999px; - white-space: nowrap; - -} - -input.ui-button.ui-icon-notext .ui-icon { - width: auto; - height: auto; - text-indent: 0; - white-space: normal; - padding: .4em 1em; -} - -/* workarounds */ -/* Support: Firefox 5 - 125+ */ -input.ui-button::-moz-focus-inner, -button.ui-button::-moz-focus-inner { - border: 0; - padding: 0; -} -.ui-controlgroup { - vertical-align: middle; - display: inline-block; -} -.ui-controlgroup > .ui-controlgroup-item { - float: left; - margin-left: 0; - margin-right: 0; -} -.ui-controlgroup > .ui-controlgroup-item:focus, -.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { - z-index: 9999; -} -.ui-controlgroup-vertical > .ui-controlgroup-item { - display: block; - float: none; - width: 100%; - margin-top: 0; - margin-bottom: 0; - text-align: left; -} -.ui-controlgroup-vertical .ui-controlgroup-item { - box-sizing: border-box; -} -.ui-controlgroup .ui-controlgroup-label { - padding: .4em 1em; -} -.ui-controlgroup .ui-controlgroup-label span { - font-size: 80%; -} -.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { - border-left: none; -} -.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { - border-top: none; -} -.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { - border-right: none; -} -.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { - border-bottom: none; -} - -/* Spinner specific style fixes */ -.ui-controlgroup-vertical .ui-spinner-input { - width: calc( 100% - 2.4em ); -} -.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { - border-top-style: solid; -} - -.ui-checkboxradio-label .ui-icon-background { - box-shadow: inset 1px 1px 1px #ccc; - border-radius: .12em; - border: none; -} -.ui-checkboxradio-radio-label .ui-icon-background { - width: 16px; - height: 16px; - border-radius: 1em; - overflow: visible; - border: none; -} -.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, -.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { - background-image: none; - width: 8px; - height: 8px; - border-width: 4px; - border-style: solid; -} -.ui-checkboxradio-disabled { - pointer-events: none; -} -.ui-dialog { - position: absolute; - top: 0; - left: 0; - padding: .2em; - outline: 0; -} -.ui-dialog .ui-dialog-titlebar { - padding: .4em 1em; - position: relative; -} -.ui-dialog .ui-dialog-title { - float: left; - margin: .1em 0; - white-space: nowrap; - width: 90%; - overflow: hidden; - text-overflow: ellipsis; -} -.ui-dialog .ui-dialog-titlebar-close { - position: absolute; - right: .3em; - top: 50%; - width: 20px; - margin: -10px 0 0 0; - padding: 1px; - height: 20px; -} -.ui-dialog .ui-dialog-content { - position: relative; - border: 0; - padding: .5em 1em; - background: none; - overflow: auto; -} -.ui-dialog .ui-dialog-buttonpane { - text-align: left; - border-width: 1px 0 0 0; - background-image: none; - margin-top: .5em; - padding: .3em 1em .5em .4em; -} -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { - float: right; -} -.ui-dialog .ui-dialog-buttonpane button { - margin: .5em .4em .5em 0; - cursor: pointer; -} -.ui-dialog .ui-resizable-n { - height: 2px; - top: 0; -} -.ui-dialog .ui-resizable-e { - width: 2px; - right: 0; -} -.ui-dialog .ui-resizable-s { - height: 2px; - bottom: 0; -} -.ui-dialog .ui-resizable-w { - width: 2px; - left: 0; -} -.ui-dialog .ui-resizable-se, -.ui-dialog .ui-resizable-sw, -.ui-dialog .ui-resizable-ne, -.ui-dialog .ui-resizable-nw { - width: 7px; - height: 7px; -} -.ui-dialog .ui-resizable-se { - right: 0; - bottom: 0; -} -.ui-dialog .ui-resizable-sw { - left: 0; - bottom: 0; -} -.ui-dialog .ui-resizable-ne { - right: 0; - top: 0; -} -.ui-dialog .ui-resizable-nw { - left: 0; - top: 0; -} -.ui-draggable .ui-dialog-titlebar { - cursor: move; -} -.ui-tooltip { - padding: 8px; - position: absolute; - z-index: 9999; - max-width: 300px; -} -body .ui-tooltip { - border-width: 2px; -} diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.min.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.min.css deleted file mode 100644 index bcf56d5a104..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.structure.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -.ui-draggable-handle{touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-sortable-handle{touch-action:none}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;user-select:none}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px} \ No newline at end of file diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.css deleted file mode 100644 index fe1c5e16c31..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.css +++ /dev/null @@ -1,439 +0,0 @@ -/*! - * jQuery UI CSS Framework 1.14.1 - * https://jqueryui.com - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license - * - * https://api.jqueryui.com/category/theming/ - * - * To view and modify this theme, visit https://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { - font-family: Arial,Helvetica,sans-serif; - font-size: 1em; -} -.ui-widget .ui-widget { - font-size: 1em; -} -.ui-widget input, -.ui-widget select, -.ui-widget textarea, -.ui-widget button { - font-family: Arial,Helvetica,sans-serif; - font-size: 1em; -} -.ui-widget.ui-widget-content { - border: 1px solid #c5c5c5; -} -.ui-widget-content { - border: 1px solid #dddddd; - background: #ffffff; - color: #333333; -} -.ui-widget-content a { - color: #333333; -} -.ui-widget-header { - border: 1px solid #dddddd; - background: #e9e9e9; - color: #333333; - font-weight: bold; -} -.ui-widget-header a { - color: #333333; -} - -/* Interaction states -----------------------------------*/ -.ui-state-default, -.ui-widget-content .ui-state-default, -.ui-widget-header .ui-state-default, -.ui-button, - -/* We use html here because we need a greater specificity to make sure disabled -works properly when clicked or hovered */ -html .ui-button.ui-state-disabled:hover, -html .ui-button.ui-state-disabled:active { - border: 1px solid #c5c5c5; - background: #f6f6f6; - font-weight: normal; - color: #454545; -} -.ui-state-default a, -.ui-state-default a:link, -.ui-state-default a:visited, -a.ui-button, -a:link.ui-button, -a:visited.ui-button, -.ui-button { - color: #454545; - text-decoration: none; -} -.ui-state-hover, -.ui-widget-content .ui-state-hover, -.ui-widget-header .ui-state-hover, -.ui-state-focus, -.ui-widget-content .ui-state-focus, -.ui-widget-header .ui-state-focus, -.ui-button:hover, -.ui-button:focus { - border: 1px solid #cccccc; - background: #ededed; - font-weight: normal; - color: #2b2b2b; -} -.ui-state-hover a, -.ui-state-hover a:hover, -.ui-state-hover a:link, -.ui-state-hover a:visited, -.ui-state-focus a, -.ui-state-focus a:hover, -.ui-state-focus a:link, -.ui-state-focus a:visited, -a.ui-button:hover, -a.ui-button:focus { - color: #2b2b2b; - text-decoration: none; -} - -.ui-visual-focus { - box-shadow: 0 0 3px 1px rgb(94, 158, 214); -} -.ui-state-active, -.ui-widget-content .ui-state-active, -.ui-widget-header .ui-state-active, -a.ui-button:active, -.ui-button:active, -.ui-button.ui-state-active:hover { - border: 1px solid #003eff; - background: #007fff; - font-weight: normal; - color: #ffffff; -} -.ui-icon-background, -.ui-state-active .ui-icon-background { - border: #003eff; - background-color: #ffffff; -} -.ui-state-active a, -.ui-state-active a:link, -.ui-state-active a:visited { - color: #ffffff; - text-decoration: none; -} - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, -.ui-widget-content .ui-state-highlight, -.ui-widget-header .ui-state-highlight { - border: 1px solid #dad55e; - background: #fffa90; - color: #777620; -} -.ui-state-checked { - border: 1px solid #dad55e; - background: #fffa90; -} -.ui-state-highlight a, -.ui-widget-content .ui-state-highlight a, -.ui-widget-header .ui-state-highlight a { - color: #777620; -} -.ui-state-error, -.ui-widget-content .ui-state-error, -.ui-widget-header .ui-state-error { - border: 1px solid #f1a899; - background: #fddfdf; - color: #5f3f3f; -} -.ui-state-error a, -.ui-widget-content .ui-state-error a, -.ui-widget-header .ui-state-error a { - color: #5f3f3f; -} -.ui-state-error-text, -.ui-widget-content .ui-state-error-text, -.ui-widget-header .ui-state-error-text { - color: #5f3f3f; -} -.ui-priority-primary, -.ui-widget-content .ui-priority-primary, -.ui-widget-header .ui-priority-primary { - font-weight: bold; -} -.ui-priority-secondary, -.ui-widget-content .ui-priority-secondary, -.ui-widget-header .ui-priority-secondary { - opacity: .7; - font-weight: normal; -} -.ui-state-disabled, -.ui-widget-content .ui-state-disabled, -.ui-widget-header .ui-state-disabled { - opacity: .35; - background-image: none; -} - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { - width: 16px; - height: 16px; -} -.ui-icon, -.ui-widget-content .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png"); -} -.ui-widget-header .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png"); -} -.ui-state-hover .ui-icon, -.ui-state-focus .ui-icon, -.ui-button:hover .ui-icon, -.ui-button:focus .ui-icon { - background-image: url("images/ui-icons_555555_256x240.png"); -} -.ui-state-active .ui-icon, -.ui-button:active .ui-icon { - background-image: url("images/ui-icons_ffffff_256x240.png"); -} -.ui-state-highlight .ui-icon, -.ui-button .ui-state-highlight.ui-icon { - background-image: url("images/ui-icons_777620_256x240.png"); -} -.ui-state-error .ui-icon, -.ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cc0000_256x240.png"); -} -.ui-button .ui-icon { - background-image: url("images/ui-icons_777777_256x240.png"); -} - -/* positioning */ -/* Three classes needed to override `.ui-button:hover .ui-icon` */ -.ui-icon-blank.ui-icon-blank.ui-icon-blank { - background-image: none; -} -.ui-icon-caret-1-n { background-position: 0 0; } -.ui-icon-caret-1-ne { background-position: -16px 0; } -.ui-icon-caret-1-e { background-position: -32px 0; } -.ui-icon-caret-1-se { background-position: -48px 0; } -.ui-icon-caret-1-s { background-position: -65px 0; } -.ui-icon-caret-1-sw { background-position: -80px 0; } -.ui-icon-caret-1-w { background-position: -96px 0; } -.ui-icon-caret-1-nw { background-position: -112px 0; } -.ui-icon-caret-2-n-s { background-position: -128px 0; } -.ui-icon-caret-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -65px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -65px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 1px -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-on { background-position: -96px -144px; } -.ui-icon-radio-off { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, -.ui-corner-top, -.ui-corner-left, -.ui-corner-tl { - border-top-left-radius: 3px; -} -.ui-corner-all, -.ui-corner-top, -.ui-corner-right, -.ui-corner-tr { - border-top-right-radius: 3px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-left, -.ui-corner-bl { - border-bottom-left-radius: 3px; -} -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-br { - border-bottom-right-radius: 3px; -} - -/* Overlays */ -.ui-widget-overlay { - background: #aaaaaa; - opacity: .3; -} -.ui-widget-shadow { - box-shadow: 0px 0px 5px #666666; -} diff --git a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.min.css b/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.min.css deleted file mode 100644 index dfdaf6fe7ef..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/jquery-ui.theme.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! jQuery UI - v1.14.1 - 2025-06-23 -* https://jqueryui.com -* Copyright OpenJS Foundation and other contributors; Licensed MIT */ - -.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;background-image:none}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank.ui-icon-blank.ui-icon-blank{background-image:none}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3}.ui-widget-shadow{box-shadow:0 0 5px #666} \ No newline at end of file diff --git a/frontend/src/vendor/jquery-ui-1.14.1/package.json b/frontend/src/vendor/jquery-ui-1.14.1/package.json deleted file mode 100644 index abf413bf736..00000000000 --- a/frontend/src/vendor/jquery-ui-1.14.1/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "jquery-ui", - "title": "jQuery UI", - "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.", - "version": "1.14.1", - "homepage": "https://jqueryui.com", - "author": { - "name": "OpenJS Foundation and other contributors", - "url": "https://github.com/jquery/jquery-ui/blob/1.14.1/AUTHORS.txt" - }, - "main": "ui/widget.js", - "maintainers": [ - { - "name": "Jörn Zaefferer", - "email": "joern.zaefferer@gmail.com", - "url": "https://bassistance.de" - }, - { - "name": "Mike Sherov", - "email": "mike.sherov@gmail.com", - "url": "https://mike.sherov.com" - }, - { - "name": "TJ VanToll", - "email": "tj.vantoll@gmail.com", - "url": "https://www.tjvantoll.com" - }, - { - "name": "Felix Nagel", - "email": "info@felixnagel.com", - "url": "https://www.felixnagel.com" - }, - { - "name": "Alex Schmitz", - "email": "arschmitz@gmail.com", - "url": "https://github.com/arschmitz" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/jquery/jquery-ui.git" - }, - "bugs": { - "url": "https://github.com/jquery/jquery-ui/issues" - }, - "license": "MIT", - "scripts": { - "build": "grunt build", - "lint": "grunt lint", - "test:server": "node tests/runner/server.js", - "test:unit": "node tests/runner/command.js", - "test": "grunt && npm run test:unit -- -h" - }, - "dependencies": { - "jquery": ">=1.12.0 <5.0.0" - }, - "devDependencies": { - "body-parser": "1.20.3", - "browserstack-local": "1.5.5", - "commitplease": "3.2.0", - "diff": "5.2.0", - "eslint-config-jquery": "3.0.2", - "exit-hook": "4.0.0", - "express": "4.21.1", - "express-body-parser-error-handler": "1.0.7", - "grunt": "1.6.1", - "grunt-bowercopy": "1.2.5", - "grunt-compare-size": "0.4.2", - "grunt-contrib-concat": "2.1.0", - "grunt-contrib-csslint": "2.0.0", - "grunt-contrib-requirejs": "1.0.0", - "grunt-contrib-uglify": "5.2.2", - "grunt-eslint": "24.0.1", - "grunt-git-authors": "3.2.0", - "grunt-html": "17.1.0", - "load-grunt-tasks": "5.1.0", - "rimraf": "6.0.1", - "selenium-webdriver": "4.26.0", - "yargs": "17.7.2" - }, - "keywords": [] -} From b49d3c8c44dc18ad8427ec169f0385b90dac8e7d Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:12 +0000 Subject: [PATCH 123/381] Remove jQuery from BIM IFC models form Replace jQuery with vanilla JavaScript and Fetch API for direct S3 uploads. Convert DOM selection, event handling, and Ajax calls to modern native browser APIs. --- .../bim/ifc_models/ifc_models/_form.html.erb | 165 ++++++++++-------- 1 file changed, 96 insertions(+), 69 deletions(-) diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb index 0d71710c757..75e23fa3f60 100644 --- a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb +++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb @@ -54,87 +54,108 @@ See COPYRIGHT and LICENSE files for more details. <% if OpenProject::Configuration.direct_uploads? %> <%= nonced_javascript_tag do %> - jQuery(document).ready(function() { - var setDirectUploadFileName = function () { - var fileNameField = jQuery('input[type=file]') - var fileName = ''; - if (fileNameField.length > 0 && fileNameField[0].files && fileNameField[0].files[0]) { - fileName = fileNameField[0].files[0].name; + document.addEventListener('DOMContentLoaded', function() { + const setDirectUploadFileName = function () { + const fileNameField = document.querySelector('input[type=file]'); + const selectedFile = fileNameField?.files?.[0]; + let fileName = ''; + if (selectedFile) { + fileName = selectedFile.name; } if (fileName.length === 0) { - return jQuery.Deferred().resolve().promise(); + return Promise.resolve(); } <%# Reset the form validity %> <%# See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity %> - fileNameField[0].setCustomValidity(''); + fileNameField?.setCustomValidity(''); - var titleField = jQuery("#bim_ifc_models_ifc_model_title"); + if (!fileNameField || !selectedFile) { + return Promise.resolve(); + } + + const titleField = document.getElementById('bim_ifc_models_ifc_model_title'); <%# When creating a new model, there is no titleField. %> - var titleFieldValue = ''; - if (titleField.length > 0) { - titleFieldValue = jQuery("#bim_ifc_models_ifc_model_title").val(); - }; - - var title = ''; - if (titleFieldValue.length > 0) { - title = titleFieldValue; - } else { - title = fileName; + let titleFieldValue = ''; + if (titleField) { + titleFieldValue = titleField.value; } - var csrfToken = jQuery('meta[name="csrf-token"]').attr("content"); - return jQuery.ajax({ - type: "post", - url: "<%= set_direct_upload_file_name_bcf_project_ifc_models_path %>", - dataType: "json", - xhrFields: { - withCredentials: true + const title = titleFieldValue.length > 0 ? titleFieldValue : fileName; + + const isDefaultCheckbox = document.getElementById('bim_ifc_models_ifc_model_is_default'); + const body = new URLSearchParams({ + title: title, + isDefault: isDefaultCheckbox?.checked ? 1 : 0, + filesize: selectedFile.size + }); + + return fetch("<%= set_direct_upload_file_name_bcf_project_ifc_models_path %>", { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') ?? '' }, - data: { - authenticity_token: csrfToken, - title: title, - isDefault: jQuery("#bim_ifc_models_ifc_model_is_default").is(":checked") ? 1 : 0, - filesize: fileNameField[0].files[0].size - }, - statusCode: { - 401: function(resp, status, error) { - document.location.reload(); // reload to make user login again - } - }, - error: function(jqXHR, ajaxOptions, errorThrown) { - if (jqXHR.status == 422) { - var errorMessage = jqXHR.responseJSON.error; - fileNameField[0].setCustomValidity(errorMessage); - fileNameField[0].reportValidity(); - } + credentials: 'same-origin', + body: body + }).then(response => { + if (response.status === 401) { + document.location.reload(); // reload to make user login again + return Promise.reject(); } + if (response.status === 422) { + return response.json().then(data => { + const errorMessage = data.error; + fileNameField.setCustomValidity(errorMessage); + fileNameField.reportValidity(); + return Promise.reject(errorMessage); + }); + } + return; }); }; - jQuery("#bim_ifc_models_ifc_model_is_default").change(function(e){ - setDirectUploadFileName(); - }); - jQuery("input[type=file]").change(function(e){ - setDirectUploadFileName(); - <%# rebuild form to post to S3 directly %> - if (jQuery("input[name=authenticity_token]").length === 1) { - jQuery("input[name=authenticity_token]").remove(); - jQuery("input[name=_method]").remove(); + const isDefaultCheckbox = document.getElementById('bim_ifc_models_ifc_model_is_default'); + if (isDefaultCheckbox) { + isDefaultCheckbox.addEventListener('change', function(e) { + void setDirectUploadFileName().catch(() => {}); + }); + } - var url = jQuery("input[name=uri]").val(); + const fileInput = document.querySelector('input[type=file]'); + if (fileInput) { + fileInput.addEventListener('change', function(e) { + void setDirectUploadFileName().catch(() => {}); - jQuery("form").attr("action", url); - jQuery("form").attr("enctype", "multipart/form-data"); + <%# rebuild form to post to S3 directly %> + const authenticityToken = document.querySelector('input[name=authenticity_token]'); + if (authenticityToken) { + authenticityToken.remove(); + const methodInput = document.querySelector('input[name=_method]'); + if (methodInput) { + methodInput.remove(); + } - jQuery("input[name=uri]").remove(); + const uriInput = document.querySelector('input[name=uri]'); + const url = uriInput.value; + + const form = document.querySelector('form'); + form.setAttribute('action', url); + form.setAttribute('enctype', 'multipart/form-data'); + + uriInput.remove(); + + form.addEventListener('submit', function() { + const titleField = document.getElementById('bim_ifc_models_ifc_model_title'); + if (titleField) { + titleField.disabled = true; + } + }); + } + }); + } - jQuery("form").submit(function() { - jQuery("#bim_ifc_models_ifc_model_title").prop("disabled", "disabled"); - }); - } - }); <% unless @ifc_model.new_record? %> <%# The titleField might have changed AFTER selecting a file. Therefore, we need to intercept form submits to first send the file name etc and @@ -142,15 +163,21 @@ See COPYRIGHT and LICENSE files for more details. Also, we need take care not to end up in a submit loop. So prevent it to be submitted several times. %> - var submitted = false; - var form = jQuery("form#edit_bim_ifc_models_ifc_model_<%= @ifc_model.id %>") - form.submit((e) => { - if (submitted) { return }; + let submitted = false; + const form = document.getElementById('edit_bim_ifc_models_ifc_model_<%= @ifc_model.id %>'); + if (form) { + form.addEventListener('submit', (e) => { + if (submitted) { return; } - e.preventDefault(); - setDirectUploadFileName().always(() => form.submit()); - submitted = true; - }); + e.preventDefault(); + setDirectUploadFileName() + .then(() => { + submitted = true; + form.submit(); + }) + .catch(() => {}); + }); + } <% end %> }); <% end %> From 6a86c267f4536d414534efdc67a8d7cda1ec6bfe Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:12 +0000 Subject: [PATCH 124/381] [#68734] Migrate webhooks form jQuery to Stimulus Replaces jQuery-based enable/disable logic in the webhooks admin form with a new Stimulus controller `disable-when-value-selected`. This change was originally deferred from PR #20884 as it was planned to be addressed in Work Package #69436 / PR #21227. Since that work has been put on hold and jQuery removal is progressing, this commit completes the migration now. Changes: - Add DisableWhenValueSelectedController for declarative form toggling - Add toggleEnabled/enableElement/disableElement helpers to dom-helpers - Remove jQuery code from webhooks admin form - Apply Stimulus controller to project selection fieldset Related to opf/openproject#20884 https://community.openproject.org/wp/68734 --- .../src/app/shared/helpers/dom-helpers.ts | 32 +++++++++ .../disable-when-value-selected.controller.ts | 69 +++++++++++++++++++ frontend/src/stimulus/setup.ts | 2 + .../webhooks/outgoing/admin/_form.html.erb | 34 ++++----- 4 files changed, 120 insertions(+), 17 deletions(-) create mode 100644 frontend/src/stimulus/controllers/disable-when-value-selected.controller.ts diff --git a/frontend/src/app/shared/helpers/dom-helpers.ts b/frontend/src/app/shared/helpers/dom-helpers.ts index 635c2da2e9e..03991e1fcb0 100644 --- a/frontend/src/app/shared/helpers/dom-helpers.ts +++ b/frontend/src/app/shared/helpers/dom-helpers.ts @@ -243,3 +243,35 @@ export function attributeTokenList(element:HTMLElement, attribute:string):DOMTok return list as DOMTokenList; } /* eslint-enable */ + +/** + * Toggles the enabled/disabled state of form elements. + * For fieldsets, recursively applies to all child elements. + * + * @param element the element to toggle + * @param value force state (optional): `true` to enable/`false` to disable + */ +export function toggleEnabled(element:HTMLElement, value?:boolean) { + if ( + element instanceof HTMLInputElement || + element instanceof HTMLSelectElement || + element instanceof HTMLTextAreaElement || + element instanceof HTMLButtonElement || + element instanceof HTMLFieldSetElement + ) { + if (typeof value === 'undefined') { + element.disabled = !element.disabled; + } else { + element.disabled = !value; + } + } + + if (element instanceof HTMLFieldSetElement) { + Array.from(element.elements).forEach((child) => { + toggleEnabled(child as HTMLElement, !element.disabled); + }); + } +} + +export const enableElement = (element:HTMLElement) => toggleEnabled(element, true); +export const disableElement = (element:HTMLElement) => toggleEnabled(element, false); diff --git a/frontend/src/stimulus/controllers/disable-when-value-selected.controller.ts b/frontend/src/stimulus/controllers/disable-when-value-selected.controller.ts new file mode 100644 index 00000000000..61582c71715 --- /dev/null +++ b/frontend/src/stimulus/controllers/disable-when-value-selected.controller.ts @@ -0,0 +1,69 @@ +/* + * -- copyright + * OpenProject is an open source project management software. + * Copyright (C) the OpenProject GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 3. + * + * OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: + * Copyright (C) 2006-2013 Jean-Philippe Lang + * Copyright (C) 2010-2013 the ChiliProject Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * See COPYRIGHT and LICENSE files for more details. + * ++ + */ + +import { toggleEnabled } from 'core-app/shared/helpers/dom-helpers'; +import { ApplicationController } from 'stimulus-use'; + +export default class OpDisableWhenValueSelectedController extends ApplicationController { + static targets = ['cause', 'effect']; + + declare readonly effectTargets:(HTMLInputElement|HTMLFieldSetElement)[]; + + private boundListener = this.toggleDisabled.bind(this); + + causeTargetConnected(target:HTMLElement) { + target.addEventListener('change', this.boundListener); + } + + causeTargetDisconnected(target:HTMLElement) { + target.removeEventListener('change', this.boundListener); + } + + private toggleDisabled(evt:Event):void { + const input = evt.target as HTMLInputElement; + const targetName = input.dataset.targetName; + + this + .effectTargets + .filter((el) => targetName === el.dataset.targetName) + .forEach((el) => { + const disabled = this.willDisable(el, input.value); + toggleEnabled(el, !disabled); + }); + } + + private willDisable(el:HTMLElement, value:string):boolean { + if (el.dataset.notValue) { + return el.dataset.notValue === value; + } + + return !(el.dataset.value === value); + } +} diff --git a/frontend/src/stimulus/setup.ts b/frontend/src/stimulus/setup.ts index 2fa3ac2c098..da140656c9a 100644 --- a/frontend/src/stimulus/setup.ts +++ b/frontend/src/stimulus/setup.ts @@ -2,6 +2,7 @@ import { environment } from '../environments/environment'; import { OpApplicationController } from './controllers/op-application.controller'; import MainMenuController from './controllers/dynamic/menus/main.controller'; import OpDisableWhenCheckedController from './controllers/disable-when-checked.controller'; +import OpDisableWhenValueSelectedController from './controllers/disable-when-value-selected.controller'; import PrintController from './controllers/print.controller'; import RefreshOnFormChangesController from './controllers/refresh-on-form-changes.controller'; import FormPreviewController from './controllers/form-preview.controller'; @@ -57,6 +58,7 @@ OpenProjectStimulusApplication.preregister('application', OpApplicationControlle OpenProjectStimulusApplication.preregister('async-dialog', AsyncDialogController); OpenProjectStimulusApplication.preregister('disable-when-checked', OpDisableWhenCheckedController); OpenProjectStimulusApplication.preregister('disable-when-clicked', DisableWhenClickedController); +OpenProjectStimulusApplication.preregister('disable-when-value-selected', OpDisableWhenValueSelectedController); OpenProjectStimulusApplication.preregister('flash', FlashController); OpenProjectStimulusApplication.preregister('menus--main', MainMenuController); OpenProjectStimulusApplication.preregister('require-password-confirmation', RequirePasswordConfirmationController); diff --git a/modules/webhooks/app/views/webhooks/outgoing/admin/_form.html.erb b/modules/webhooks/app/views/webhooks/outgoing/admin/_form.html.erb index 0cd3804082f..5967756c12d 100644 --- a/modules/webhooks/app/views/webhooks/outgoing/admin/_form.html.erb +++ b/modules/webhooks/app/views/webhooks/outgoing/admin/_form.html.erb @@ -70,7 +70,7 @@ <% end %> -
+
<%= t "webhooks.outgoing.form.project_ids.title" %> @@ -80,14 +80,22 @@ "all", checked: @webhook.all_projects?, label: t("webhooks.outgoing.form.project_ids.all"), - container_class: "-wide" %> + container_class: "-wide", + data: { + disable_when_value_selected_target: "cause", + target_name: "webhook_project_ids" + } %>
<%= f.radio_button :project_ids, "selection", checked: !@webhook.all_projects?, label: t("webhooks.outgoing.form.project_ids.selected"), - container_class: "-wide" %> + container_class: "-wide", + data: { + disable_when_value_selected_target: "cause", + target_name: "webhook_project_ids" + } %>
@@ -99,23 +107,15 @@ id, !@webhook.all_projects? && @webhook.project_ids.include?(id), disabled: @webhook.all_projects?, - class: "webhooks--selected-project-ids" -%> + class: "webhooks--selected-project-ids", + data: { + disable_when_value_selected_target: "effect", + target_name: "webhook_project_ids", + value: "selection" + } -%> <%= name %> <% end %>
- -<%= nonced_javascript_tag do %> - (function($) { - // Toggle selector for new/edit webhooks projects - $('input[name="webhook[project_ids]"]').change(function(){ - $('.webhooks--selected-project-ids').prop('disabled', $(this).val() === 'all'); - }); - - $('input[name="webhook[type_ids]"]').change(function(){ - $('.webhooks--selected-type-ids').prop('disabled', $(this).val() === 'all'); - }); - }(jQuery)); -<% end %> From ee668483f9c053f21c7def7419a3f7aa32a1687d Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:12 +0000 Subject: [PATCH 125/381] Use shared toggleEnabled in admin controllers Three admin controllers (roles, custom-fields, users) independently implemented identical logic for toggling visibility and disabled state on form elements. This refactoring consolidates the pattern. Changes: - Enhance toggleEnabled() to optionally handle element.hidden - Remove duplicate toggleEnabled method from roles.controller - Remove duplicate setActive method from custom-fields.controller - Remove duplicate toggleHiddenAndDisabled from users.controller - All three controllers now use shared dom-helpers function Improves code maintainability and reduces duplication by ~30 lines. --- frontend/src/app/shared/helpers/dom-helpers.ts | 14 ++++++++++++-- .../controllers/dynamic/admin/roles.controller.ts | 9 ++++----- .../controllers/dynamic/admin/users.controller.ts | 7 +++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/shared/helpers/dom-helpers.ts b/frontend/src/app/shared/helpers/dom-helpers.ts index 03991e1fcb0..00c0e366152 100644 --- a/frontend/src/app/shared/helpers/dom-helpers.ts +++ b/frontend/src/app/shared/helpers/dom-helpers.ts @@ -250,8 +250,18 @@ export function attributeTokenList(element:HTMLElement, attribute:string):DOMTok * * @param element the element to toggle * @param value force state (optional): `true` to enable/`false` to disable + * @param toggleHidden optionally toggle element.hidden inversely with disabled state */ -export function toggleEnabled(element:HTMLElement, value?:boolean) { +export function toggleEnabled(element:HTMLElement, value?:boolean, toggleHidden?:boolean) { + // Handle hidden property if requested + if (toggleHidden) { + if (typeof value === 'undefined') { + element.hidden = !element.hidden; + } else { + element.hidden = !value; + } + } + if ( element instanceof HTMLInputElement || element instanceof HTMLSelectElement || @@ -268,7 +278,7 @@ export function toggleEnabled(element:HTMLElement, value?:boolean) { if (element instanceof HTMLFieldSetElement) { Array.from(element.elements).forEach((child) => { - toggleEnabled(child as HTMLElement, !element.disabled); + toggleEnabled(child as HTMLElement, !element.disabled, toggleHidden); }); } } diff --git a/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts b/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts index da3b6092fde..b077e0c5677 100644 --- a/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts @@ -29,6 +29,7 @@ */ import { Controller } from '@hotwired/stimulus'; +import { toggleEnabled } from 'core-app/shared/helpers/dom-helpers'; export default class RolesController extends Controller { static targets = [ @@ -59,12 +60,10 @@ export default class RolesController extends Controller { this.toggleEnabled(this.globalPermissionsTarget, this.globalRoleValue); } - toggleEnabled(target:HTMLElement, enabled:boolean) { - target.hidden = !enabled; + private toggleEnabled(target:HTMLElement, enabled:boolean) { + toggleEnabled(target, enabled, true); target .querySelectorAll('input,select') - .forEach((input:HTMLInputElement) => { - input.disabled = !enabled; - }); + .forEach((input:HTMLInputElement) => toggleEnabled(input, enabled)); } } diff --git a/frontend/src/stimulus/controllers/dynamic/admin/users.controller.ts b/frontend/src/stimulus/controllers/dynamic/admin/users.controller.ts index d456813bc0a..91581604191 100644 --- a/frontend/src/stimulus/controllers/dynamic/admin/users.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/admin/users.controller.ts @@ -1,4 +1,5 @@ import { Controller } from '@hotwired/stimulus'; +import { toggleEnabled } from 'core-app/shared/helpers/dom-helpers'; export default class UsersController extends Controller { static targets = [ @@ -34,10 +35,8 @@ export default class UsersController extends Controller { } private toggleHiddenAndDisabled(target:HTMLElement, hiddenAndDisabled:boolean) { - target.hidden = hiddenAndDisabled; + toggleEnabled(target, !hiddenAndDisabled, true); target.querySelectorAll('input') - .forEach((el:HTMLInputElement) => { - el.disabled = hiddenAndDisabled; - }); + .forEach((el:HTMLInputElement) => toggleEnabled(el, !hiddenAndDisabled)); } } From 68441c1db3fe708d914fe2a69b69861e2fef1236 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:12 +0000 Subject: [PATCH 126/381] Add specs for toggleEnabled helper Adds comprehensive test coverage for the enhanced toggleEnabled function, including: - Basic disabled property toggling - toggleHidden parameter behavior - Multiple form element types (input, select, textarea, button) - Fieldset recursive behavior - Convenience functions (enableElement, disableElement) --- .../app/shared/helpers/dom-helpers.spec.ts | 211 +++++++++++++++++- 1 file changed, 210 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/shared/helpers/dom-helpers.spec.ts b/frontend/src/app/shared/helpers/dom-helpers.spec.ts index 6d73e5f4561..3bc01b2b7f3 100644 --- a/frontend/src/app/shared/helpers/dom-helpers.spec.ts +++ b/frontend/src/app/shared/helpers/dom-helpers.spec.ts @@ -26,7 +26,15 @@ // See COPYRIGHT and LICENSE files for more details. //++ -import { toggleElement, toggleElementByClass, toggleElementByVisibility, attributeTokenList, } from './dom-helpers'; +import { + toggleElement, + toggleElementByClass, + toggleElementByVisibility, + attributeTokenList, + toggleEnabled, + enableElement, + disableElement, +} from './dom-helpers'; describe('dom-helpers', () => { describe('toggleElement', () => { @@ -328,4 +336,205 @@ describe('dom-helpers', () => { expect(tokens).toEqual(['alpha', 'beta', 'gamma']); }); }); + + describe('toggleEnabled', () => { + describe('basic disabled toggling', () => { + it('toggles disabled property on input element when no value provided', () => { + const input = document.createElement('input'); + + expect(input.disabled).toBe(false); + + toggleEnabled(input); + + expect(input.disabled).toBe(true); + + toggleEnabled(input); + + expect(input.disabled).toBe(false); + }); + + it('enables element when value is true', () => { + const input = document.createElement('input'); + input.disabled = true; + + toggleEnabled(input, true); + + expect(input.disabled).toBe(false); + }); + + it('disables element when value is false', () => { + const input = document.createElement('input'); + input.disabled = false; + + toggleEnabled(input, false); + + expect(input.disabled).toBe(true); + }); + + it('works with select elements', () => { + const select = document.createElement('select'); + toggleEnabled(select, false); + + expect(select.disabled).toBe(true); + + toggleEnabled(select, true); + + expect(select.disabled).toBe(false); + }); + + it('works with textarea elements', () => { + const textarea = document.createElement('textarea'); + toggleEnabled(textarea, false); + + expect(textarea.disabled).toBe(true); + }); + + it('works with button elements', () => { + const button = document.createElement('button'); + toggleEnabled(button, false); + + expect(button.disabled).toBe(true); + }); + }); + + describe('with toggleHidden parameter', () => { + it('toggles both hidden and disabled when toggleHidden is true', () => { + const input = document.createElement('input'); + + expect(input.hidden).toBe(false); + expect(input.disabled).toBe(false); + + toggleEnabled(input, false, true); + + expect(input.hidden).toBe(true); + expect(input.disabled).toBe(true); + + toggleEnabled(input, true, true); + + expect(input.hidden).toBe(false); + expect(input.disabled).toBe(false); + }); + + it('toggles both properties when no value provided and toggleHidden is true', () => { + const input = document.createElement('input'); + + expect(input.hidden).toBe(false); + expect(input.disabled).toBe(false); + + toggleEnabled(input, undefined, true); + + expect(input.hidden).toBe(true); + expect(input.disabled).toBe(true); + + toggleEnabled(input, undefined, true); + + expect(input.hidden).toBe(false); + expect(input.disabled).toBe(false); + }); + + it('only toggles disabled when toggleHidden is false', () => { + const input = document.createElement('input'); + input.hidden = true; + + toggleEnabled(input, false, false); + + expect(input.hidden).toBe(true); // unchanged + expect(input.disabled).toBe(true); + }); + + it('only toggles disabled when toggleHidden is omitted', () => { + const input = document.createElement('input'); + input.hidden = true; + + toggleEnabled(input, false); + + expect(input.hidden).toBe(true); // unchanged + expect(input.disabled).toBe(true); + }); + + it('toggles hidden on non-form elements when toggleHidden is true', () => { + const div = document.createElement('div') as HTMLElement; + + expect(div.hidden).toBe(false); + + toggleEnabled(div, false, true); + + expect(div.hidden).toBe(true); + + toggleEnabled(div, true, true); + + expect(div.hidden).toBe(false); + }); + }); + + describe('fieldset recursion', () => { + it('recursively disables all child elements in a fieldset', () => { + const fieldset = document.createElement('fieldset'); + const input1 = document.createElement('input'); + const input2 = document.createElement('input'); + const select = document.createElement('select'); + + fieldset.appendChild(input1); + fieldset.appendChild(input2); + fieldset.appendChild(select); + + toggleEnabled(fieldset, false); + + expect(fieldset.disabled).toBe(true); + expect(input1.disabled).toBe(true); + expect(input2.disabled).toBe(true); + expect(select.disabled).toBe(true); + }); + + it('recursively enables all child elements in a fieldset', () => { + const fieldset = document.createElement('fieldset'); + const input = document.createElement('input'); + fieldset.appendChild(input); + + // First disable + toggleEnabled(fieldset, false); + + expect(fieldset.disabled).toBe(true); + expect(input.disabled).toBe(true); + + // Then enable + toggleEnabled(fieldset, true); + + expect(fieldset.disabled).toBe(false); + expect(input.disabled).toBe(false); + }); + + it('passes toggleHidden parameter to child elements', () => { + const fieldset = document.createElement('fieldset'); + const input = document.createElement('input'); + fieldset.appendChild(input); + + toggleEnabled(fieldset, false, true); + + expect(fieldset.hidden).toBe(true); + expect(fieldset.disabled).toBe(true); + expect(input.disabled).toBe(true); + }); + }); + + describe('convenience functions', () => { + it('enableElement sets disabled to false', () => { + const input = document.createElement('input'); + input.disabled = true; + + enableElement(input); + + expect(input.disabled).toBe(false); + }); + + it('disableElement sets disabled to true', () => { + const input = document.createElement('input'); + input.disabled = false; + + disableElement(input); + + expect(input.disabled).toBe(true); + }); + }); + }); }); From 78d1c9bb242a6b6afb0208353dd8e17850cf6689 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:13 +0000 Subject: [PATCH 127/381] Inject jQuery for legacy plugins Legacy jQuery plugins need to attach themselves to the same jQuery instance that application code imports from ESM. Wrap enjoyhint and tablesorter with that instance while they load so precompiled assets do not route their UMD wrappers through a separate CommonJS jQuery copy. --- frontend/esbuild/plugins.ts | 67 +++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/frontend/esbuild/plugins.ts b/frontend/esbuild/plugins.ts index 282c8959d0c..be23182ae79 100644 --- a/frontend/esbuild/plugins.ts +++ b/frontend/esbuild/plugins.ts @@ -29,6 +29,8 @@ */ import type { Plugin } from 'esbuild'; +import * as fs from 'fs'; +import * as path from 'node:path'; const customConfigPlugin:Plugin = { name: 'custom-config', @@ -36,7 +38,68 @@ const customConfigPlugin:Plugin = { if (options.chunkNames === '[name]-[hash]') { // named chunks options.chunkNames = '[dir]/[name]-[hash]'; } - } + }, +}; + +const jqueryInjectionPlugin:Plugin = { + name: 'jquery-injection', + setup(build) { + // Intercept legacy jQuery plugins that need the ESM jQuery instance. + build.onResolve({ filter: /^(core-vendor\/enjoyhint|tablesorter)$/ }, (args) => { + return { + path: args.path, + namespace: 'jquery-wrapper', + }; + }); + + // Provide the wrapper content + build.onLoad({ filter: /.*/, namespace: 'jquery-wrapper' }, async (args) => { + const workingDir = build.initialOptions.absWorkingDir ?? process.cwd(); + const modulePath = args.path === 'tablesorter' + ? path.join(workingDir, 'node_modules', 'tablesorter', 'dist', 'js', 'jquery.tablesorter.combined.js') + : path.join(workingDir, 'src', 'vendor', 'enjoyhint.js'); + const contents = await fs.promises.readFile(modulePath, 'utf8'); + + // Wrap with jQuery import + const wrappedCode = ` +import jQuery from 'jquery'; +import 'jquery-migrate'; + +const previousJQuery = window.jQuery; +const previousDollar = window.$; +const hadPreviousJQuery = 'jQuery' in window; +const hadPreviousDollar = '$' in window; + +// Legacy jQuery plugins expect global jQuery while they load. +window.jQuery = jQuery; +window.$ = jQuery; + +const define = undefined; +const module = undefined; +const exports = undefined; + +${contents} + +if (hadPreviousJQuery) { + window.jQuery = previousJQuery; +} else { + delete window.jQuery; } -export default [customConfigPlugin]; +if (hadPreviousDollar) { + window.$ = previousDollar; +} else { + delete window.$; +} +`; + + return { + contents: wrappedCode, + loader: 'js', + resolveDir: path.join(workingDir, 'src'), + }; + }); + }, +}; + +export default [customConfigPlugin, jqueryInjectionPlugin]; From 3dbf520b7508d60bfaf301ce1b5ab19ed55a1aac Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:13 +0000 Subject: [PATCH 128/381] Replace call to jQuery UI's uniqueId with ensureId Use the local ensureId helper in place of jQuery UI's uniqueId so this code path no longer depends on the removed jQuery UI helper. --- .../stimulus/controllers/dynamic/reporting/page.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts index ee794e36edd..251a9aacde2 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts @@ -34,6 +34,7 @@ import dragula from 'dragula'; import jQuery from 'jquery'; import 'core-app/core/setup-legacy/init-jquery'; import 'tablesorter'; +import { ensureId } from 'core-app/shared/helpers/dom-helpers'; declare global { interface Window { @@ -630,7 +631,7 @@ export default class PageController extends Controller { .attr('class', 'group-by--selected-element') .attr('data-group-by', field); - groupBy.uniqueId(); // give it a unique id + ensureId(groupBy[0]); // give it a unique id const label = this.createLabel(groupBy, caption); groupBy.append(label); From 1e1636eaf9b005d6ca3e69131f836744c7965845 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:13 +0000 Subject: [PATCH 129/381] Fix reporting date operators with blank values Skip positive-arity reporting operators when no value is present, which otherwise causes sporadic feature spec failures. Cover the blank-value case through the filter SQL path and keep direct operator specs focused on explicit nil values. --- modules/reporting/lib/report/filter/base.rb | 2 +- .../spec/models/cost_query/filter_spec.rb | 7 +++++++ .../spec/models/cost_query/operator_spec.rb | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/modules/reporting/lib/report/filter/base.rb b/modules/reporting/lib/report/filter/base.rb index 8c9f211fe70..0b43bb1ad9b 100644 --- a/modules/reporting/lib/report/filter/base.rb +++ b/modules/reporting/lib/report/filter/base.rb @@ -189,7 +189,7 @@ class Report::Filter # if there is just the nil it might be actually intended to be there query_values.unshift nil if Array(values).size == 1 && Array(values).first.nil? query_values = query_values[0, arity] if query_values and arity >= 0 and arity != query_values.size - operator.modify(query, field, *query_values) unless field.empty? + operator.modify(query, field, *query_values) unless field.empty? || (arity.positive? && query_values.empty?) end end end diff --git a/modules/reporting/spec/models/cost_query/filter_spec.rb b/modules/reporting/spec/models/cost_query/filter_spec.rb index 3bec6974ce1..db67a7e07f9 100644 --- a/modules/reporting/spec/models/cost_query/filter_spec.rb +++ b/modules/reporting/spec/models/cost_query/filter_spec.rb @@ -208,6 +208,13 @@ RSpec.describe CostQuery, :reporting_query_helper do expect(query.result.count).to eq(Entry.all.count { |e| e.updated_at.to_date > Time.zone.today.years_ago(20) }) end + it "ignores positive-arity date filters without values" do + query.filter :updated_on, values: [], operator: ">d" + + expect { query.result }.not_to raise_error + expect(query.result.count).to eq(Entry.count) + end + it "filters user_id" do old_user = User.current # create non-matching entry diff --git a/modules/reporting/spec/models/cost_query/operator_spec.rb b/modules/reporting/spec/models/cost_query/operator_spec.rb index 1c90e2ccc77..4907cc5e2e2 100644 --- a/modules/reporting/spec/models/cost_query/operator_spec.rb +++ b/modules/reporting/spec/models/cost_query/operator_spec.rb @@ -90,6 +90,22 @@ RSpec.describe CostQuery::Operator, :reporting_query_helper do expect(cost_query("projects", "id", ">=", project1.id + 1).size).to eq(1) end + it "does not raise for >d with nil" do + expect { cost_query("projects", "created_at", ">d", nil) }.not_to raise_error + end + + it "does not raise for =d with nil" do + expect { cost_query("projects", "created_at", ">=d", nil) }.not_to raise_error + end + it "does !" do expect(cost_query("projects", "id", "!", project1.id).size).to eq(1) end From 9f2719dcd1d8215faeea4854353cdd23eb4f3278 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:13 +0000 Subject: [PATCH 130/381] Refactor reporting filter SQL setup Extract operator application and query-value preparation from `sql_statement` to keep the blank-value fix while bringing the method back under RuboCop metric limits. --- modules/reporting/lib/report/filter/base.rb | 31 +++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/modules/reporting/lib/report/filter/base.rb b/modules/reporting/lib/report/filter/base.rb index 0b43bb1ad9b..383773f750c 100644 --- a/modules/reporting/lib/report/filter/base.rb +++ b/modules/reporting/lib/report/filter/base.rb @@ -183,14 +183,29 @@ class Report::Filter end def sql_statement - super.tap do |query| - arity = operator.arity - query_values = [*transformed_values].compact - # if there is just the nil it might be actually intended to be there - query_values.unshift nil if Array(values).size == 1 && Array(values).first.nil? - query_values = query_values[0, arity] if query_values and arity >= 0 and arity != query_values.size - operator.modify(query, field, *query_values) unless field.empty? || (arity.positive? && query_values.empty?) - end + super.tap { |query| apply_operator_to(query) } + end + + def apply_operator_to(query) + return if field.empty? + + arity = operator.arity + query_values = sql_query_values(arity) + return if skip_operator?(arity, query_values) + + operator.modify(query, field, *query_values) + end + + def sql_query_values(arity) + query_values = [*transformed_values].compact + # if there is just the nil it might be actually intended to be there + query_values.unshift nil if Array(values).size == 1 && Array(values).first.nil? + query_values = query_values[0, arity] if query_values && arity >= 0 && arity != query_values.size + query_values + end + + def skip_operator?(arity, query_values) + arity.positive? && query_values.empty? end end end From c2e8f514e5fec26263ac695cb23e6e21d06b5b95 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 15:13:14 +0000 Subject: [PATCH 131/381] Move reporting filter removal click to wrapper Moves the `click->reporting--page#removeFilter` Stimulus action from the inner `
` element to the outer `
` wrapper. This ensures the entire remove-filter area is a valid click target, so the hidden `fields[]` value is cleared reliably when removing a filter. --- modules/reporting/lib/widget/filters/remove_button.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/reporting/lib/widget/filters/remove_button.rb b/modules/reporting/lib/widget/filters/remove_button.rb index 5baf57a8771..16902d530db 100644 --- a/modules/reporting/lib/widget/filters/remove_button.rb +++ b/modules/reporting/lib/widget/filters/remove_button.rb @@ -38,7 +38,7 @@ class Widget::Filters::RemoveButton < Widget::Filters::Base href: "#", class: "filter_rem", data: { - action: "click->reporting--page#removeFilter keydown->reporting--page#filterKeydown" + action: "keydown->reporting--page#filterKeydown" } ) do icon_wrapper("icon-close advanced-filters--remove-filter-icon", I18n.t(:description_remove_filter)) @@ -46,6 +46,9 @@ class Widget::Filters::RemoveButton < Widget::Filters::Base write(content_tag(:div, hidden_field + button, id: "rm_box_#{filter_class.underscore_name}", - class: "advanced-filters--remove-filter")) + class: "advanced-filters--remove-filter", + data: { + action: "click->reporting--page#removeFilter" + })) end end From 738907bae0fb72c038400661beb1ca54729b028c Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 18:13:43 +0200 Subject: [PATCH 132/381] Fix reporting filter removal target Resolve the reporting filter name from the action owner instead of the raw event target so removing filters clears the hidden fields[] input reliably after the wrapper-level click change. --- .../dynamic/reporting/page.controller.spec.ts | 73 +++++++++++++++++++ .../dynamic/reporting/page.controller.ts | 7 +- 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts new file mode 100644 index 00000000000..2174d5cb4bc --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts @@ -0,0 +1,73 @@ +/* + * -- copyright + * OpenProject is an open source project management software. + * Copyright (C) the OpenProject GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 3. + * + * OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: + * Copyright (C) 2006-2013 Jean-Philippe Lang + * Copyright (C) 2010-2013 the ChiliProject Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * See COPYRIGHT and LICENSE files for more details. + * ++ + */ + +import PageController from './page.controller'; + +describe('Reporting PageController filters', () => { + let controller:PageController; + let fixturesElement:HTMLElement; + + beforeEach(() => { + controller = Object.create(PageController.prototype) as PageController; + fixturesElement = document.createElement('div'); + document.body.appendChild(fixturesElement); + }); + + afterEach(() => { + fixturesElement.remove(); + }); + + it('falls back to the filter data attribute when the remove input is blank', () => { + fixturesElement.innerHTML = ` +
  • +
    + +
    +
  • + `; + + const removeBox = fixturesElement.querySelector('#rm_box_subject')!; + const removedFilters:string[] = []; + Object.assign(controller, { + filters: { + remove_filter(filter:string) { + removedFilters.push(filter); + }, + }, + }); + + controller.removeFilter({ + preventDefault: () => undefined, + currentTarget: removeBox, + } as unknown as MouseEvent); + + expect(removedFilters).toEqual(['subject']); + }); +}); diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts index 251a9aacde2..16af95e23a6 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts @@ -121,8 +121,11 @@ export default class PageController extends Controller { removeFilter(evt:MouseEvent) { evt.preventDefault(); - const target = evt.target as HTMLElement; - const filterName = target.closest('li')?.getAttribute('data-filter-name'); + const removeBox = evt.currentTarget as HTMLElement; + const filterNameInput = removeBox.querySelector('input[name="fields[]"]')?.value.trim(); + const filterName = filterNameInput && filterNameInput.length > 0 + ? filterNameInput + : removeBox.closest('li')?.getAttribute('data-filter-name'); if (filterName) { this.filters.remove_filter(filterName); From edb980a823c3ce1d74c692767b28729eb60415b8 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 25 May 2026 18:13:49 +0200 Subject: [PATCH 133/381] Fix reporting apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serialize active reporting filters explicitly when applying the report. Handle unmaterialized or empty Angular filter inputs by falling back to component dataset values, including numeric autocompleter IDs, and add focused serializer specs. Co-authored-by: Oliver Günther --- .../dynamic/reporting/page.controller.spec.ts | 114 +++++++++- .../dynamic/reporting/page.controller.ts | 213 ++++++++++++++++-- 2 files changed, 304 insertions(+), 23 deletions(-) diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts index 2174d5cb4bc..ca4fc6fa505 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.spec.ts @@ -27,15 +27,24 @@ * See COPYRIGHT and LICENSE files for more details. * ++ */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import PageController from './page.controller'; -describe('Reporting PageController filters', () => { - let controller:PageController; +describe('Reporting PageController serialization', () => { + let controller:PageController & Record; + let privateController:{ + syncFilterValues:(formData:FormData, field:string) => void; + syncActiveFilters:(formData:FormData) => void; + }; let fixturesElement:HTMLElement; beforeEach(() => { - controller = Object.create(PageController.prototype) as PageController; + controller = Object.create(PageController.prototype) as PageController & Record; + privateController = controller as unknown as { + syncFilterValues:(formData:FormData, field:string) => void; + syncActiveFilters:(formData:FormData) => void; + }; fixturesElement = document.createElement('div'); document.body.appendChild(fixturesElement); }); @@ -44,6 +53,105 @@ describe('Reporting PageController filters', () => { fixturesElement.remove(); }); + function formDataValues(formData:FormData, key:string) { + return formData.getAll(key).map(String); + } + + it('serializes non-empty materialized inputs directly', () => { + fixturesElement.innerHTML = ` +
  • + +
  • + `; + + const formData = new FormData(); + + privateController.syncFilterValues(formData, 'user_id'); + + expect(formDataValues(formData, 'values[user_id][]')).toEqual(['me']); + }); + + it('serializes scalar filter inputs with their original name', () => { + fixturesElement.innerHTML = ` +
  • + +
  • + `; + + const formData = new FormData(); + + privateController.syncFilterValues(formData, 'subject'); + + expect(formDataValues(formData, 'values[subject]')).toEqual(['abc']); + expect(formDataValues(formData, 'values[subject][]')).toEqual([]); + }); + + it('falls back to the date picker dataset when the input is still empty', () => { + fixturesElement.innerHTML = ` +
  • + + + +
  • + `; + + const formData = new FormData(); + + privateController.syncFilterValues(formData, 'spent_on'); + + expect(formDataValues(formData, 'values[spent_on][]')).toEqual(['2026-03-07']); + }); + + it('falls back to autocompleter dataset values with numeric and string ids', () => { + fixturesElement.innerHTML = ` +
  • + + +
  • + `; + + const formData = new FormData(); + + privateController.syncFilterValues(formData, 'work_package_id'); + + expect(formDataValues(formData, 'values[work_package_id][]')).toEqual(['42', '77']); + }); + + it('ignores missing filter elements when syncing active filters', () => { + vi.spyOn(controller, 'visibleFilters').mockReturnValue(['missing']); + + const formData = new FormData(); + + expect(() => privateController.syncActiveFilters(formData)).not.toThrow(); + expect(formDataValues(formData, 'fields[]')).toEqual(['missing']); + expect(formDataValues(formData, 'values[missing][]')).toEqual([]); + }); + + it('skips filters with required operators when no value is present', () => { + fixturesElement.innerHTML = ` + +
  • + +
  • + `; + + vi.spyOn(controller, 'visibleFilters').mockReturnValue(['updated_on']); + + const formData = new FormData(); + + privateController.syncActiveFilters(formData); + + expect(formDataValues(formData, 'fields[]')).toEqual([]); + expect(formDataValues(formData, 'operators[updated_on]')).toEqual([]); + expect(formDataValues(formData, 'values[updated_on][]')).toEqual([]); + }); + it('falls back to the filter data attribute when the remove input is blank', () => { fixturesElement.innerHTML = `
  • diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts index 16af95e23a6..26a7faa537d 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts @@ -135,8 +135,14 @@ export default class PageController extends Controller { filterKeydown(evt:KeyboardEvent) { if (evt.key === 'Enter' || evt.key === ' ') { evt.preventDefault(); + evt.stopPropagation(); + + const removeBox = (evt.currentTarget as HTMLElement).closest('[id^="rm_box_"]'); + const filter = removeBox?.closest('li'); + if (!filter) { + return; + } - const filter = (evt.target as HTMLElement).closest('li') as HTMLElement; const filterName = filter.dataset.filterName; const prevVisibleFilter = jQuery(filter) .prevAll(':visible') @@ -343,9 +349,7 @@ export default class PageController extends Controller { postSelectValues = JSON.parse(jsonPostSelectValues.replace(/'/g, '"')) as string[]; } - if (window.global_prefix === undefined) { - window.global_prefix = ''; - } + window.global_prefix ??= ''; jQuery(`select[data-filter-name='${filterName}']`).prop('disabled', true); @@ -358,12 +362,12 @@ export default class PageController extends Controller { }) .then((response) => response.html) .then((html) => { - const tagName = select.prop('tagName') as string; + const tagName = select.prop('tagName') as string | undefined; select.html(html); jQuery(`select[data-filter-name='${filterName}']`).prop('disabled', false); - if (tagName && tagName.toLowerCase() === 'select') { + if (tagName?.toLowerCase() === 'select') { if (!postSelectValues || postSelectValues.length === 0) { (select[0] as HTMLSelectElement).selectedIndex = 0; } else { @@ -394,8 +398,7 @@ export default class PageController extends Controller { private showFilter(field:string, options:ShowFilterOptions = {}) { const defaultOptions = { - callback_func: () => { - }, + callback_func: () => undefined, slowly: false, show_filter: true, hide_only: false, @@ -405,9 +408,7 @@ export default class PageController extends Controller { const fieldEl = jQuery(`#filter_${field}`); if (fieldEl.length) { - if (!options.insert_after) { - options.insert_after = this.lastVisibleFilter(); - } + options.insert_after ??= this.lastVisibleFilter(); if (options.insert_after && options.show_filter) { if (fieldEl.attr('id') !== options.insert_after.id) { @@ -419,8 +420,7 @@ export default class PageController extends Controller { if (options.show_filter) { // eslint-disable-next-line @typescript-eslint/no-unused-expressions options.slowly ? fieldEl.fadeIn('slow') : fieldEl.show(); - this.filters.loadAvailableValuesForFilter(field, options.callback_func || (() => { - })); + this.filters.loadAvailableValuesForFilter(field, options.callback_func ?? (() => undefined)); jQuery(`#rm_${field}`).val(field); this.valueChanged(field); } else { @@ -496,7 +496,7 @@ export default class PageController extends Controller { } private setActiveState(selector:string, active:boolean) { - const input = document.querySelector(selector) as HTMLElement; + const input = document.querySelector(selector); if (!input) { return; @@ -542,7 +542,7 @@ export default class PageController extends Controller { const field = jselect.val() as string; const container = jselect.closest('.group-by--container'); const selectedOption = jselect.find(`[value='${field}']`).first(); - const caption = selectedOption.attr('data-label') || ''; + const caption = selectedOption.attr('data-label') ?? ''; this.groupBys.add_group_by(field, caption, container); jselect.find('[value=\'\']').first().attr('selected', 'selected'); @@ -578,7 +578,7 @@ export default class PageController extends Controller { } private createLabel(groupBy:JQuery, text:string) { - const groupById = groupBy.attr('id') || ''; + const groupById = groupBy.attr('id') ?? ''; return jQuery('') .attr('class', 'in_row group-by--label') .attr('for', groupById) @@ -685,13 +685,13 @@ export default class PageController extends Controller { toggle_delete_form: (e:Event) => { e.preventDefault(); - const offset = jQuery('#query-icon-delete').offset()?.left || 0; + const offset = jQuery('#query-icon-delete').offset()?.left ?? 0; jQuery('#delete_form').css('left', `${offset}px`).toggle(); }, toggle_save_as_form: (e:Event) => { e.preventDefault(); - const offset = jQuery('#query-icon-save-as').offset()?.left || 0; + const offset = jQuery('#query-icon-save-as').offset()?.left ?? 0; jQuery('#save_as_form').css('left', `${offset}px`).toggle(); }, }; @@ -738,12 +738,12 @@ export default class PageController extends Controller { element[0].addEventListener('click', (e:Event) => { e.preventDefault(); const target = jQuery(e.target as HTMLElement).closest('[data-target]').attr('data-target'); - this.sendSettingsData(target || '', callback, failureCallback); + this.sendSettingsData(target ?? '', callback, failureCallback); }); } private sendSettingsData(targetUrl:string, callback:(_result:string) => void, failureCallback?:(_error:unknown) => void) { - const errorCallback = failureCallback || this.defaultFailureCallback; + const errorCallback = failureCallback ?? this.defaultFailureCallback; this.clearFlash(); void post(targetUrl, { body: this.serializeSettingsForm() }) @@ -764,6 +764,7 @@ export default class PageController extends Controller { private serializeSettingsForm() { const queryForm = document.querySelector('#query_form')!; const formData = new FormData(queryForm); + this.syncActiveFilters(formData); ['rows', 'columns'].forEach((type) => { Array.from(document.querySelectorAll(`#group-by--${type} .group-by--selected-element`)) @@ -777,6 +778,178 @@ export default class PageController extends Controller { return formData; } + private syncActiveFilters(formData:FormData) { + formData.delete('fields[]'); + + this.visibleFilters().forEach((field) => { + const operator = this.filterOperator(field); + const hasValues = this.syncFilterValues(formData, field); + + if (operator && operator.arity > 0 && !hasValues) { + formData.delete(`operators[${field}]`); + return; + } + + formData.append('fields[]', field); + this.syncFilterOperator(formData, field, operator?.value); + }); + } + + private syncFilterOperator(formData:FormData, field:string, operatorValue?:string) { + const name = `operators[${field}]`; + const selectedOperator = operatorValue ?? this.filterOperator(field)?.value; + + if (!selectedOperator) { + return; + } + + formData.delete(name); + formData.append(name, selectedOperator); + } + + private syncFilterValues(formData:FormData, field:string) { + const arrayName = `values[${field}][]`; + const scalarName = `values[${field}]`; + const filter = document.querySelector(`#filter_${field}`); + + formData.delete(arrayName); + formData.delete(scalarName); + if (!filter) { + return false; + } + + const fields = Array.from(filter.querySelectorAll('input, select, textarea')) + .filter((element) => element.name === arrayName || element.name === scalarName) + .filter((element) => !element.disabled); + + const nonEmptyFields = fields.filter((element) => element.value !== ''); + if (nonEmptyFields.length === 0) { + return this.serializeFilterComponentValue(formData, filter, arrayName); + } + + let serializedValueCount = 0; + nonEmptyFields.forEach((element) => { + if (element instanceof HTMLSelectElement) { + const selectedOptions = Array.from(element.selectedOptions); + + if (selectedOptions.length === 0) { + formData.append(element.name, element.value); + serializedValueCount += 1; + return; + } + + selectedOptions.forEach((option) => { + formData.append(element.name, option.value); + serializedValueCount += 1; + }); + + return; + } + + if ((element instanceof HTMLInputElement) && ['checkbox', 'radio'].includes(element.type) && !element.checked) { + return; + } + + formData.append(element.name, element.value); + serializedValueCount += 1; + }); + + return serializedValueCount > 0; + } + + private serializeFilterComponentValue(formData:FormData, filter:HTMLElement, name:string) { + // Reporting filters embed Angular custom elements that may not materialize + // matching named inputs until the user interacts with them. + const datePicker = filter.querySelector('[data-name][data-value]'); + const normalizedName = this.normalizeQuotedDatasetValue(datePicker?.dataset.name); + const dateValue = this.normalizeQuotedDatasetValue(datePicker?.dataset.value); + + if (normalizedName === name && dateValue) { + formData.append(name, dateValue); + return true; + } + + const autocompleter = filter.querySelector('[data-input-name][data-model]'); + const inputName = this.normalizeQuotedDatasetValue(autocompleter?.dataset.inputName); + + if (inputName !== name.replace(/\[\]$/, '')) { + return false; + } + + const parsedModel = this.parseQuotedJson(autocompleter?.dataset.model); + if (!Array.isArray(parsedModel)) { + return false; + } + + let serializedValueCount = 0; + parsedModel + .map((value) => this.autocompleterValueId(value)) + .filter((value):value is string => typeof value === 'string' && value.length > 0) + .forEach((value) => { + formData.append(name, value); + serializedValueCount += 1; + }); + + return serializedValueCount > 0; + } + + private filterOperator(field:string) { + const operatorName = `operators[${field}]`; + const operatorSelect = document.querySelector(`[name="${operatorName}"]`); + const selectedValue = operatorSelect?.value; + + if (!operatorSelect || !selectedValue) { + return undefined; + } + + const selectedOption = operatorSelect.selectedOptions[0]; + const arity = parseInt(selectedOption?.dataset.arity ?? '0', 10); + + return { + value: selectedValue, + arity, + }; + } + + private autocompleterValueId(value:unknown) { + if (!value || typeof value !== 'object' || !('id' in value)) { + return undefined; + } + + const { id } = value as { id:unknown }; + if (typeof id === 'string') { + return id; + } + + if (typeof id === 'number') { + return String(id); + } + + return undefined; + } + + private normalizeQuotedDatasetValue(value?:string) { + if (!value) { + return value; + } + + // AngularHelper serializes string inputs with `.to_json`, so string + // dataset values arrive wrapped in literal double quotes. + return value.replace(/^"+|"+$/g, ''); + } + + private parseQuotedJson(value?:string):unknown { + if (!value) { + return undefined; + } + + try { + return JSON.parse(value); + } catch { + return undefined; + } + } + private defaultFailureCallback = (error:unknown) => { if (error instanceof ValidationError) { this.flash(error.message); From 12133fc84593659a91a61df0f4addee4675a80bd Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Tue, 26 May 2026 12:25:42 +0200 Subject: [PATCH 134/381] Rename roles section toggle helper Avoid shadowing the shared toggleEnabled helper import with a private controller method of the same name. This keeps the roles controller easier to read while preserving behavior. --- .../controllers/dynamic/admin/roles.controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts b/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts index b077e0c5677..f9817d667dc 100644 --- a/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/admin/roles.controller.ts @@ -55,12 +55,12 @@ export default class RolesController extends Controller { } globalRoleValueChanged() { - this.toggleEnabled(this.memberAttributesTarget, !this.globalRoleValue); - this.toggleEnabled(this.memberPermissionsTarget, !this.globalRoleValue); - this.toggleEnabled(this.globalPermissionsTarget, this.globalRoleValue); + this.togglePermissionSection(this.memberAttributesTarget, !this.globalRoleValue); + this.togglePermissionSection(this.memberPermissionsTarget, !this.globalRoleValue); + this.togglePermissionSection(this.globalPermissionsTarget, this.globalRoleValue); } - private toggleEnabled(target:HTMLElement, enabled:boolean) { + private togglePermissionSection(target:HTMLElement, enabled:boolean) { toggleEnabled(target, enabled, true); target .querySelectorAll('input,select') From 851337a8fdf596a45e9eaff49c4b6344d90b2a16 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Tue, 26 May 2026 12:25:47 +0200 Subject: [PATCH 135/381] Guard BIM direct upload form rewrite Use the selected file input's owning form when rewriting direct uploads for S3 and return early if the expected URI field is absent. This avoids throwing when the partial is rendered without the hidden direct-upload fields. --- .../views/bim/ifc_models/ifc_models/_form.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb index 75e23fa3f60..d7aebf3023f 100644 --- a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb +++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb @@ -129,18 +129,22 @@ See COPYRIGHT and LICENSE files for more details. void setDirectUploadFileName().catch(() => {}); <%# rebuild form to post to S3 directly %> - const authenticityToken = document.querySelector('input[name=authenticity_token]'); - if (authenticityToken) { + const form = fileInput.form; + if (form) { + const authenticityToken = form.querySelector('input[name=authenticity_token]'); + const uriInput = form.querySelector('input[name=uri]'); + if (!authenticityToken || !(uriInput instanceof HTMLInputElement)) { + return; + } + authenticityToken.remove(); - const methodInput = document.querySelector('input[name=_method]'); + const methodInput = form.querySelector('input[name=_method]'); if (methodInput) { methodInput.remove(); } - const uriInput = document.querySelector('input[name=uri]'); const url = uriInput.value; - const form = document.querySelector('form'); form.setAttribute('action', url); form.setAttribute('enctype', 'multipart/form-data'); From 677deacc17cecd999c8b10f72fb27f9a659c668f Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Tue, 26 May 2026 12:26:00 +0200 Subject: [PATCH 136/381] Remove redundant reporting assertion The preceding object and property guards already narrow the autocompleter value enough for TypeScript. Remove the unnecessary assertion reported by eslint without changing runtime behavior. --- .../stimulus/controllers/dynamic/reporting/page.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts index 26a7faa537d..7e47a2e397a 100644 --- a/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts @@ -916,7 +916,7 @@ export default class PageController extends Controller { return undefined; } - const { id } = value as { id:unknown }; + const { id } = value; if (typeof id === 'string') { return id; } From de62feddbddf5a5040770ce3c09a692a23abcd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 20 May 2026 16:40:13 +0200 Subject: [PATCH 137/381] Fix mention inside a markdown link parsing --- frontend/src/vendor/ckeditor/ckeditor.js | 2 +- frontend/src/vendor/ckeditor/ckeditor.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/vendor/ckeditor/ckeditor.js b/frontend/src/vendor/ckeditor/ckeditor.js index 8d989b79cd2..d996b0efdca 100644 --- a/frontend/src/vendor/ckeditor/ckeditor.js +++ b/frontend/src/vendor/ckeditor/ckeditor.js @@ -2,5 +2,5 @@ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OPEditor=t():e.OPEditor=t()}(self,(()=>(()=>{var e={428:e=>{var t=!0,i=!1,o=!1;function n(e,t,i){var o=e.attrIndex(t),n=[t,i];o<0?e.attrPush(n):e.attrs[o]=n}function s(e,t){for(var i=e[t].level-1,o=t-1;o>=0;o--)if(e[o].level===i)return o;return-1}function r(e,t){return"inline"===e[t].type&&function(e){return"paragraph_open"===e.type}(e[t-1])&&function(e){return"list_item_open"===e.type}(e[t-2])&&function(e){return 0===e.content.indexOf("[ ] ")||0===e.content.indexOf("[x] ")||0===e.content.indexOf("[X] ")}(e[t])}function a(e,n){if(e.children.unshift(function(e,i){var o=new i("html_inline","",0),n=t?' disabled="" ':"";0===e.content.indexOf("[ ] ")?o.content='':0!==e.content.indexOf("[x] ")&&0!==e.content.indexOf("[X] ")||(o.content='');return o}(e,n)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),i)if(o){e.children.pop();var s="task-item-"+Math.ceil(1e7*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+s+'">',e.children.push(function(e,t,i){var o=new i("html_inline","",0);return o.content='",o.attrs=[{for:t}],o}(e.content,s,n))}else e.children.unshift(function(e){var t=new e("html_inline","",0);return t.content="",t}(n))}e.exports=function(e,l){l&&(t=!l.enabled,i=!!l.label,o=!!l.labelAfter),e.core.ruler.after("inline","github-task-lists",(function(e){for(var i=e.tokens,o=2;o{var o,n=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function n(e,t){if(!o[e]){o[e]={};for(var i=0;i>>8,i[2*o+1]=r%256}return i},decompressFromUint8Array:function(t){if(null==t)return s.decompress(t);for(var i=new Array(t.length/2),o=0,n=i.length;o>=1}else{for(n=1,o=0;o>=1}0==--u&&(u=Math.pow(2,m),m++),delete a[d]}else for(n=r[d],o=0;o>=1;0==--u&&(u=Math.pow(2,m),m++),r[c]=h++,d=String(l)}if(""!==d){if(Object.prototype.hasOwnProperty.call(a,d)){if(d.charCodeAt(0)<256){for(o=0;o>=1}else{for(n=1,o=0;o>=1}0==--u&&(u=Math.pow(2,m),m++),delete a[d]}else for(n=r[d],o=0;o>=1;0==--u&&(u=Math.pow(2,m),m++)}for(n=2,o=0;o>=1;for(;;){if(p<<=1,f==t-1){g.push(i(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:s._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,i,o){var n,s,r,a,l,c,d,u=[],h=4,m=4,g=3,p="",f=[],b={val:o(0),position:i,index:1};for(n=0;n<3;n+=1)u[n]=n;for(r=0,l=Math.pow(2,2),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;switch(r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;d=e(r);break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;d=e(r);break;case 2:return""}for(u[3]=d,s=d,f.push(d);;){if(b.index>t)return"";for(r=0,l=Math.pow(2,g),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;switch(d=r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;u[m++]=e(r),d=m-1,h--;break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;u[m++]=e(r),d=m-1,h--;break;case 2:return f.join("")}if(0==h&&(h=Math.pow(2,g),g++),u[d])p=u[d];else{if(d!==m)return null;p=s+s.charAt(0)}f.push(p),u[m++]=s+p.charAt(0),s=p,0==--h&&(h=Math.pow(2,g),g++)}}};return s}();void 0===(o=function(){return n}.call(t,i,t,e))||(e.exports=o)}},t={};function i(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e={};i.r(e),i.d(e,{decode:()=>$x,encode:()=>Wx,format:()=>Ux,parse:()=>sE});var t={};i.r(t),i.d(t,{Any:()=>lE,Cc:()=>cE,Cf:()=>dE,P:()=>rE,S:()=>aE,Z:()=>uE});var o={};i.r(o),i.d(o,{arrayReplaceAt:()=>LE,assign:()=>BE,escapeHtml:()=>QE,escapeRE:()=>XE,fromCodePoint:()=>jE,has:()=>NE,isMdAsciiPunct:()=>oT,isPunctChar:()=>iT,isSpace:()=>eT,isString:()=>FE,isValidEntityCode:()=>zE,isWhiteSpace:()=>tT,lib:()=>sT,normalizeReference:()=>nT,unescapeAll:()=>UE,unescapeMd:()=>WE});var n={};function s(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function r(e){return"string"==typeof e||e instanceof String}function a(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function l(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function c(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i.r(n),i.d(n,{parseLinkDestination:()=>aT,parseLinkLabel:()=>rT,parseLinkTitle:()=>lT});const d="[object RegExp]",u="[object String]",h="[object Number]",m="[object Boolean]",g="[object Arguments]",p="[object Symbol]",f="[object Date]",b="[object Map]",w="[object Set]",y="[object Array]",k="[object ArrayBuffer]",v="[object Object]",C="[object DataView]",A="[object Uint8Array]",x="[object Uint8ClampedArray]",E="[object Uint16Array]",T="[object Uint32Array]",P="[object Int8Array]",S="[object Int16Array]",I="[object Int32Array]",R="[object Float32Array]",O="[object Float64Array]";function V(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function D(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function F(e,t,i,o=new Map,n=void 0){const s=n?.(e,t,i,o);if(void 0!==s)return s;if(V(e))return e;if(o.has(e))return o.get(e);if(Array.isArray(e)){const t=new Array(e.length);o.set(e,t);for(let s=0;s{const r=t?.(i,o,n,s);if(void 0!==r)return r;if("object"==typeof e){if(c(e)===v&&"function"!=typeof e.constructor){const t={};return s.set(e,t),M(t,e,n,s),t}switch(Object.prototype.toString.call(e)){case h:case u:case m:{const t=new e.constructor(e?.valueOf());return M(t,e),t}case g:{const t={};return M(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}}))}function B(e){return"object"==typeof e&&null!==e}function L(e){return B(e)&&1===e.nodeType&&!a(e)}function z(e){return"function"==typeof e}function j(e){return N(e)}function $(e){return"__proto__"===e}function q(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===c(e)}function H(e){return null!=e&&"function"!=typeof e&&function(e){return Number.isSafeInteger(e)&&e>=0}(e.length)}function W(e){return D(e)}function U(e,t,i,o){if(V(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(o.has(t))return function(e){if(V(e))return e;if(Array.isArray(e)||D(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(null==t)return Object.assign(Object.create(t),e);const i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new i(e.errors,e.message,{cause:e.cause}):new i(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(o.get(t));if(o.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e-1}function ee(e){return e.indexOf("windows")>-1}function te(e){return!!e.match(/gecko\/\d+/)}function ie(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function oe(e){return!!e.match(/iphone|ipad/i)||X(e)&&navigator.maxTouchPoints>0}function ne(e){return e.indexOf("android")>-1}function se(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function re(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch{}return e}function ae(e,t,i,o){i=i||function(e,t){return e===t};const n=Array.isArray(e)?e:Array.prototype.slice.call(e),s=Array.isArray(t)?t:Array.prototype.slice.call(t),r=function(e,t,i){const o=le(e,t,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=ce(e,o),s=ce(t,o),r=le(n,s,i),a=e.length-r,l=t.length-r;return{firstIndex:o,lastIndexOld:a,lastIndexNew:l}}(n,s,i),a=o?function(e,t){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(-1===i)return Array(t).fill("equal");let s=[];i>0&&(s=s.concat(Array(i).fill("equal")));n-i>0&&(s=s.concat(Array(n-i).fill("insert")));o-i>0&&(s=s.concat(Array(o-i).fill("delete")));n0&&i.push({index:o,type:"insert",values:e.slice(o,s)});n-o>0&&i.push({index:o+(s-o),type:"delete",howMany:n-o});return i}(s,r);return a}function le(e,t,i){for(let o=0;o200||n>200||o+n>300)return de.fastDiff(e,t,i,!0);let s,r;if(nc?-1:1;d[o+h]&&(d[o]=d[o+h].slice(0)),d[o]||(d[o]=[]),d[o].push(n>c?s:r);let m=Math.max(n,c),g=m-o;for(;gc;m--)u[m]=h(m);u[c]=h(c),g++}while(u[c]!==l);return d[c].slice(1)}de.fastDiff=ae;class ue{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const he=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function me(){const[e,t,i,o]=crypto.getRandomValues(new Uint32Array(4));return"e"+he[255&e]+he[e>>8&255]+he[e>>16&255]+he[e>>24&255]+he[255&t]+he[t>>8&255]+he[t>>16&255]+he[t>>24&255]+he[255&i]+he[i>>8&255]+he[i>>16&255]+he[i>>24&255]+he[255&o]+he[o>>8&255]+he[o>>16&255]+he[o>>24&255]}const ge={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function pe(e,t){const i=ge.get(t.priority);let o=0,n=e.length;for(;o>1;ge.get(e[t].priority){if("object"==typeof t&&null!==t){if(o.has(t))return`[object ${t.constructor.name}]`;o.add(t)}return t},s=t?` ${JSON.stringify(t,n)}`:"",r=we(e),a=i?`\nOriginal error: ${i.name}: ${i.message}`:"";return e+s+r+a}(e,i,o)),this.name="CKEditorError",this.context=t,this.data=i,o&&(this.stack=o.stack)}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;throw new fe("unexpected-error",t,void 0,e)}}function be(e,t){console.warn(...ye(e,t))}function we(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${e}`}function ye(e,t){const i=we(e);return t?[e,t,i]:[e,i]}const _e=new Date(2026,2,31);if(globalThis.CKEDITOR_VERSION)throw new fe("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="48.0.0";const ke=Symbol("listeningTo"),ve=Symbol("emitterId"),Ce=Symbol("delegations"),Ae=xe(Object);function xe(e){if(!e)return Ae;return class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let o=!1;this.listenTo(this,e,((e,...i)=>{o||(o=!0,e.off(),t.call(this,e,...i))}),i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,o={}){let n,s;this[ke]||(this[ke]={});const r=this[ke];Te(e)||Ee(e);const a=Te(e);(n=r[a])||(n=r[a]={emitter:e,callbacks:{}}),(s=n.callbacks[t])||(s=n.callbacks[t]=[]),s.push(i),function(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}(this,e,t,i,o)}stopListening(e,t,i){const o=this[ke];let n=e&&Te(e);const s=o&&n?o[n]:void 0,r=s&&t?s.callbacks[t]:void 0;if(!(!o||e&&!s||t&&!r))if(i){Re(this,e,t,i);-1!==r.indexOf(i)&&(1===r.length?delete s.callbacks[t]:Re(this,e,t,i))}else if(r){for(;i=r.pop();)Re(this,e,t,i);delete s.callbacks[t]}else if(s){for(t in s.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[ke]}}fire(e,...t){try{const i=e instanceof ue?e:new ue(this,e),o=i.name;let n=function(e,t){if(!e._events)return null;let i=t;do{const t=e._events[i];if(t&&t.callbacks&&t.callbacks.length)return t.callbacks;const o=i.lastIndexOf(":");i=o>-1?i.substring(0,o):""}while(i);return null}(this,o);if(i.path.push(this),n){n=n.slice();for(let e=0;e{this[Ce]||(this[Ce]=new Map),e.forEach((e=>{const o=this[Ce].get(e);o?o.set(t,i):this[Ce].set(e,new Map([[t,i]]))}))}}}stopDelegating(e,t){if(this[Ce])if(e)if(t){const i=this[Ce].get(e);i&&i.delete(t)}else this[Ce].delete(e);else this[Ce].clear()}_addEventListener(e,t,i){!function(e,t){const i=Pe(e);if(i[t])return;let o=t,n=null;const s=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},s.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of s)e.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(this,e);const o=Se(this,e),n={callback:t,priority:ge.get(i.priority)};for(const e of o)pe(e,n)}_removeEventListener(e,t){const i=Se(this,e);for(const e of i)for(let i=0;i{this.set(t,e[t])}),this);Le(this);const i=this[Oe];if(e in this&&!i.has(e))throw new fe("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i.get(e),set(t){const o=i.get(e);let n=this.fire(`set:${e}`,e,t,o);void 0===n&&(n=t),o===n&&i.has(e)||(i.set(e,n),this.fire(`change:${e}`,e,n,o))}}),this[e]=t}bind(...e){if(!e.length||!$e(e))throw new fe("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new fe("observable-bind-duplicate-properties",this);Le(this);const t=this[De];e.forEach((e=>{if(t.has(e))throw new fe("observable-bind-rebind",this)}));const i=new Map;return e.forEach((e=>{const o={property:e,to:[]};t.set(e,o),i.set(e,o)})),{to:ze,toMany:je,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[Oe])return;const t=this[De],i=this[Ve];if(e.length){if(!$e(e))throw new fe("observable-unbind-wrong-properties",this);e.forEach((e=>{const o=t.get(e);o&&(o.to.forEach((([e,t])=>{const n=i.get(e),s=n[t];s.delete(o),s.size||delete n[t],Object.keys(n).length||(i.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else i.forEach(((e,t)=>{this.stopListening(t,"change")})),i.clear(),t.clear()}decorate(e){Le(this);const t=this[e];if(!t)throw new fe("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,i)=>{e.return=t.apply(this,i)})),this[e]=function(...t){return this.fire(e,t)},this[e][Me]=t,this[Fe]||(this[Fe]=[]),this[Fe].push(e)}stopListening(e,t,i){if(!e&&this[Fe]){for(const e of this[Fe])this[e]=this[e][Me];delete this[Fe]}super.stopListening(e,t,i)}[Oe];[Fe];[De];[Ve]}}function Le(e){e[Oe]||(Object.defineProperty(e,Oe,{value:new Map}),Object.defineProperty(e,Ve,{value:new Map}),Object.defineProperty(e,De,{value:new Map}))}function ze(...e){const t=function(...e){if(!e.length)throw new fe("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach((e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new fe("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}})),t}(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new fe("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new fe("observable-bind-to-extra-callback",this);var n;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==o)throw new fe("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),n=this._observable,this._to.forEach((e=>{const t=n[Ve];let i;t.get(e.observable)||n.listenTo(e.observable,"change",((o,s)=>{i=t.get(e.observable)[s],i&&i.forEach((e=>{qe(n,e.property)}))}))})),function(e){let t;e._bindings.forEach(((i,o)=>{e._to.forEach((n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),function(e,t,i,o){const n=e[Ve],s=n.get(i),r=s||{};r[o]||(r[o]=new Set);r[o].add(t),s||n.set(i,r)}(e._observable,i,n.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{qe(this._observable,e)}))}function je(e,t,i){if(this._bindings.size>1)throw new fe("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map((e=>[e,t]));return Array.prototype.concat.apply([],i)}(e,t),i)}function $e(e){return e.every((e=>"string"==typeof e))}function qe(e,t){const i=e[De].get(t);let o;i.callback?o=i.callback.apply(e,i.to.map((e=>e[0][e[1]]))):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}function He(e){let t=0;for(const i of e)t++;return t}function We(e,t){const i=Math.min(e.length,t.length);for(let o=0;o{this._setToTarget(e,o,t[o],i)}))}}function Je(e){return N(e,Ze)}function Ze(e){return L(e)||"function"==typeof e?e:void 0}function Qe(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function Ye(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Xe=et(xe());function et(e){if(!e)return Xe;return class extends e{listenTo(e,t,i,o={}){if(Qe(e)||Ye(e)||e instanceof J.window.EventTarget){const n={capture:!!o.useCapture,passive:!!o.usePassive},s=this._getProxyEmitter(e,n)||new tt(e,n);this.listenTo(s,t,i,o)}else super.listenTo(e,t,i,o)}stopListening(e,t,i){if(Qe(e)||Ye(e)||e instanceof J.window.EventTarget){const o=this._getAllProxyEmitters(e);for(const e of o)this.stopListening(e,t,i)}else super.stopListening(e,t,i)}_getProxyEmitter(e,t){return function(e,t){const i=e[ke];return i&&i[t]?i[t].emitter:null}(this,it(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}}class tt extends(xe()){_domNode;_options;constructor(e,t){super(),Ee(this,it(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),xe().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){xe().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function it(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=me())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function ot(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}function nt(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function st(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,o=e.clientY;let n=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,o)?n=t.caretRangeFromPoint(i,o):e.rangeParent&&(n=t.createRange(),n.setStart(e.rangeParent,e.rangeOffset),n.collapse(!0)),n}function rt(e){return e&&e.parentNode?e.offsetParent===J.document.body?null:e.offsetParent:null}function at(e){return"[object Text]"==Object.prototype.toString.call(e)}function lt(e){return"[object Range]"==Object.prototype.toString.apply(e)}const ct=["top","right","bottom","left","width","height"],dt=new Set(["relative","absolute","fixed","sticky"]);class ut{top;right;bottom;left;width;height;_source;constructor(e){const t=lt(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),gt(e)||t)if(t){const t=ut.getDomRangeRects(e);ht(this,ut.getBoundingRect(t))}else ht(this,e.getBoundingClientRect());else if(Ye(e)){const{innerWidth:t,innerHeight:i}=e;ht(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else ht(this,e)}clone(){return new ut(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new ut(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(mt(e))return t;let i,o=e,n=e.parentNode||e.commonAncestorContainer;for(;n&&!mt(n);){const e="visible"===((s=n)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible");if(ft(o)&&(i=o),e||i&&"absolute"===pt(i)&&!ft(n)){o=n,n=n.parentNode;continue}const r=new ut(n),a=t.getIntersection(r);if(!a)return null;a.getArea(){const i=new ut(t);return i._source=e,i}))}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const o of e)i++,t.left=Math.min(t.left,o.left),t.top=Math.min(t.top,o.top),t.right=Math.max(t.right,o.right),t.bottom=Math.max(t.bottom,o.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new ut(t))}}function ht(e,t){for(const i of ct)e[i]=t[i]}function mt(e){return!!gt(e)&&e===e.ownerDocument.body}function gt(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect}function pt(e){return e.ownerDocument.defaultView.getComputedStyle(e).position}function ft(e){return e instanceof HTMLElement&&dt.has(pt(e))}class bt{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(e,t){bt._observerInstance||bt._createObserver(),this._element=e,this._callback=t,bt._addElementCallback(e,t),bt._observerInstance.observe(e)}get element(){return this._element}destroy(){bt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){bt._elementCallbacks||(bt._elementCallbacks=new Map);let i=bt._elementCallbacks.get(e);i||(i=new Set,bt._elementCallbacks.set(e,i)),i.add(t)}static _deleteElementCallback(e,t){const i=bt._getElementCallbacks(e);i&&(i.delete(t),i.size||(bt._elementCallbacks.delete(e),bt._observerInstance.unobserve(e))),bt._elementCallbacks&&!bt._elementCallbacks.size&&(bt._observerInstance=null,bt._elementCallbacks=null)}static _getElementCallbacks(e){return bt._elementCallbacks?bt._elementCallbacks.get(e):null}static _createObserver(){bt._observerInstance=new J.window.ResizeObserver((e=>{for(const t of e){const e=bt._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}}))}}function wt(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function yt(e){return t=>t+e}function _t(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function kt(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function vt(e){return e&&e.nodeType===Node.COMMENT_NODE}function Ct(e){return!!e&&(at(e)?Ct(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function At({element:e,target:t,positions:i,limiter:o,fitInViewport:n,viewportOffsetConfig:s}){z(t)&&(t=t()),z(o)&&(o=o());const r=rt(e),a=Et(s),l=new ut(e),c=xt(t,a);let d;if(!c||!a.getIntersection(c))return null;const u={targetRect:c,elementRect:l,positionedElementAncestor:r,viewportRect:a};if(o||n){if(o){const e=xt(o,a);e&&(u.limiterRect=e)}d=function(e,t){const{elementRect:i}=t,o=i.getArea(),n=e.map((e=>new Tt(e,t))).filter((e=>!!e.name));let s=0,r=null;for(const e of n){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===o)return e;const n=i**2+t**2;n>s&&(s=n,r=e)}return r}(i,u)}else d=new Tt(i[0],u);return d}function xt(e,t){const i=new ut(e).getVisible();return i?i.getIntersection(t):null}function Et(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new ut(J.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t.left+=e.left,t.right-=e.right,t.width-=e.left+e.right,t}class Tt{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:o,top:n,name:s,config:r}=i;this.name=s,this.config=r,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function Pt(e){const t=e.parentNode;t&&t.removeChild(e)}function St(){const e=J.window.visualViewport;if(!e||!Y.isiOS&&!Y.isSafari)return{left:0,top:0};return{left:Math.max(Math.round(e.offsetLeft),0),top:Math.max(Math.round(e.offsetTop),0)}}function It({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){const s=t.clone().moveBy(0,n.bottom),r=t.clone().moveBy(0,-n.top),a=new ut(e).excludeScrollbarsAndBorders(),l=i&&o,c=[r,s].every((e=>a.contains(e)));let{scrollX:d,scrollY:u}=e;const h=d,m=u;l?u-=a.top-t.top+n.top:c||(Vt(r,a)?u-=a.top-t.top+n.top:Ot(s,a)&&(u+=i?t.top-a.top-n.top:t.bottom-a.bottom+n.bottom)),c||(Dt(t,a)?d-=a.left-t.left+n.left:Ft(t,a)&&(d+=t.right-a.right+n.right)),d==h&&u===m||e.scrollTo(d,u)}function Rt({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:s}){const r=Mt(e),a=i&&o;let l,c,d;const u=s||r.document.body;for(;e!=u;)c=t(),l=new ut(e).excludeScrollbarsAndBorders(),d=l.contains(c),a?e.scrollTop-=l.top-c.top+n:d||(Vt(c,l)?e.scrollTop-=l.top-c.top+n:Ot(c,l)&&(e.scrollTop+=i?c.top-l.top-n:c.bottom-l.bottom+n)),d||(Dt(c,l)?e.scrollLeft-=l.left-c.left+n:Ft(c,l)&&(e.scrollLeft+=c.right-l.right+n)),e=e.parentNode}function Ot(e,t){return e.bottom>t.bottom}function Vt(e,t){return e.topt.right}function Mt(e){return lt(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Nt(e){if(lt(e)){let t=e.commonAncestorContainer;return at(t)&&(t=t.parentNode),t}return e.parentNode}function Bt(e,t){const i=Mt(e),o=new ut(e);if(i===t)return o;{let e=i;for(;e!=t;){const t=e.frameElement,i=new ut(t).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),e=e.parent}}return o}const Lt={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},zt={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},jt={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},$t=Gt(),qt=Object.fromEntries(Object.entries($t).map((([e,t])=>{let i;return i=t in jt?jt[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]})));function Ht(e){let t;if("string"==typeof e){if(t=$t[e.toLowerCase()],!t)throw new fe("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?$t.alt:0)+(e.ctrlKey?$t.ctrl:0)+(e.shiftKey?$t.shift:0)+(e.metaKey?$t.cmd:0);return t}function Wt(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Ht(e.slice(0,-1));const t=Ht(e);return(Y.isMac||Y.isiOS)&&t==$t.ctrl?$t.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function Ut(e,t){let i=Wt(e);const o=t?"Mac"===t:Y.isMac||Y.isiOS;return Object.entries(o?Lt:zt).reduce(((e,[t,o])=>(i&$t[t]&&(i&=~$t[t],e+=o),e)),"")+(i?qt[i]:"")}function Kt(e,t){const i="ltr"===t;switch(e){case $t.arrowleft:return i?"left":"right";case $t.arrowright:return i?"right":"left";case $t.arrowup:return"up";case $t.arrowdown:return"down"}}function Gt(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}const Jt=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function Zt(e){return Jt.includes(e)?"rtl":"ltr"}function Qt(e){return Array.isArray(e)?e:[e]}function Yt(e,t,i=1,o){if("number"!=typeof i)throw new fe("translation-service-quantity-not-a-number",null,{quantity:i});const n=o||J.window.CKEDITOR_TRANSLATIONS,s=function(e){return Object.keys(e).length}(n);1===s&&(e=Object.keys(n)[0]);const r=t.id||t.string;if(0===s||!function(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}(e,r,n))return 1!==i?t.plural:t.string;const a=n[e].dictionary,l=n[e].getPluralForm||(e=>1===e?0:1),c=a[r];if("string"==typeof c)return c;return c[Number(l(i))]}J.window.CKEDITOR_TRANSLATIONS||(J.window.CKEDITOR_TRANSLATIONS={});class Xt{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Zt(this.uiLanguage),this.contentLanguageDirection=Zt(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce(((e,t)=>G(e,t))):e}(i),this.t=(e,t)=>this._t(e,t)}_t(e,t=[]){t=Qt(t),"string"==typeof e&&(e={string:e});const i=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>ithis._items.length||t<0)throw new fe("collection-add-item-invalid-index",this);let i=0;for(const o of e){const e=this._getItemIdBeforeAdding(o),n=t+i;this._items.splice(n,0,o),this._itemMap.set(e,o),this.fire("add",o,n),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new fe("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new fe("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,i=(i,o,n)=>{const s=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(o);if(s&&r)this._bindToExternalToInternalMap.set(o,r),this._bindToInternalToExternalMap.set(r,o);else{const i=e(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let s=n;for(const e of this._skippedIndexesFromExternal)n>e&&s--;for(const e of t._skippedIndexesFromExternal)s>=e&&s++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,s);for(let e=0;e{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(it&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new fe("collection-add-invalid-id",this);if(this.get(i))throw new fe("collection-add-item-already-exists",this)}else e[t]=i=me();return i}_remove(e){let t,i,o,n=!1;const s=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[s])):(o=e,i=o[s],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new fe("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function ti(e){const t=e.next();return t.done?null:t.value}class ii extends(et(Be())){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(ni(e))this._addElement(e);else if(oi(e))this._addView(e);else{if(!e.element)throw new fe("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){ni(e)?this._removeElement(e):oi(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new fe("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>{const t=this.externalViews.find((t=>function(e,t){if(si(e,t))return!0;return!!t.focusTracker.externalViews.find((t=>si(e,t)))}(e,t)));t?this._focus(t.element):this._focus(e)}),{useCapture:!0}),this.listenTo(e,"blur",(()=>{this._blur()}),{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",(()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()})),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){if(this.elements.find((e=>e.contains(document.activeElement))))return;this.externalViews.find((e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout))||(this._clearBlurTimeout(),this._blurTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function oi(e){return"focusTracker"in e&&e.focusTracker instanceof ii}function ni(e){return L(e)}function si(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class ri{_listener;constructor(){this._listener=new(et())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+Ht(t),t)}))}set(e,t,i={}){const o=Wt(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,((e,o)=>{i.filter&&!i.filter(o)||(t(o,(()=>{o.preventDefault(),o.stopPropagation(),e.stop()})),e.return=!0)}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+Ht(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function ai(e){return Ue(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function li(e,t,i){const o=e.length,n=t.length;for(let t=o-1;t>=i;t--)e[t+n]=e[t];for(let o=0;oe(...n)),t)}return o.cancel=()=>{clearTimeout(i)},o}function di(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}function ui(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function hi(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const mi=pi();function gi(e,t){const i=String(e).matchAll(mi);return Array.from(i).some((e=>e.indexe.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}function fi(e){if(!e)return null;const t=function(e){const t=e.split(".");if(3!=t.length)return null;return t[1]}(e);return t?di(t):null}function bi(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function wi(e){return"string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function yi(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(yi).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function _i(e){if(Array.isArray(e))return e.map(wi);if("symbol"==typeof e)return[e];const t=[],i=(e=yi(e)).length;if(0===i)return t;let o=0,n="",s="",r=!1;for(46===e.charCodeAt(0)&&(t.push(""),o++);o{const o=e[t];Object.hasOwn(e,t)&&vi(o,i)&&(void 0!==i||t in e)||(e[t]=i)},Ai=/^(?:0|[1-9]\d*)$/;function xi(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&ei),(()=>{}))}function Ri(e){const t=e?.constructor;return e===("function"==typeof t?t.prototype:Object.prototype)}function Oi(e){if(!e)return 0===e?e:0;if((e=function(e){return Ei(e)?NaN:Number(e)}(e))===1/0||e===-1/0){return(e<0?-1:1)*Number.MAX_VALUE}return e==e?e:0}function Vi(e,t){if((e=function(e){const t=Oi(e),i=t%1;return i?t-i:t}(e))<1||!Number.isSafeInteger(e))return[];const i=new Array(e);for(let o=0;o`${e}`)),i=new Set(t);o=e,"undefined"!=typeof Buffer&&Buffer.isBuffer(o)&&(i.add("offset"),i.add("parent"));var o;W(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));const n=Fi(e).filter((e=>!i.has(e)));if(Array.isArray(e))return[...t,...n];return[...t.filter((t=>Object.hasOwn(e,t))),...n]}(e):Ri(e)?function(e){const t=Fi(e);return t.filter((e=>"constructor"!==e))}(e):Fi(e);default:return Fi(Object(e))}}function Fi(e){const t=[];for(const i in e)t.push(i);return t}function Mi(e,...t){for(let i=0;i{null!==s&&(e.apply(n,s),n=void 0,s=null)};let c=null;const d=()=>{null!=c&&clearTimeout(c),c=setTimeout((()=>{c=null,a&&l(),u()}),t)},u=()=>{null!==c&&(clearTimeout(c),c=null),n=void 0,s=null},h=function(...e){if(i?.aborted)return;n=this,s=e;const t=null==c;d(),r&&t&&l()};return h.schedule=d,h.cancel=u,h.flush=()=>{l()},i?.addEventListener("abort",u,{once:!0}),h}function Li(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:o=!1,trailing:n=!0,maxWait:s}=i,r=Array(2);let a;o&&(r[0]="leading"),n&&(r[1]="trailing");let l=null;const c=Bi((function(...t){a=e.apply(this,t),l=null}),t,{edges:r}),d=function(...t){return null!=s&&(null===l&&(l=Date.now()),Date.now()-l>=s)?(a=e.apply(this,t),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,t),a)};return d.cancel=c.cancel,d.flush=()=>(c.flush(),a),d}function zi(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return(...o)=>{if(++i>=e)return t(...o)}}function ji(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function $i(e,t,i){return qi(e,t,void 0,void 0,void 0,void 0,i)}function qi(e,t,i,o,n,s,r){const a=r(e,t,i,o,n,s);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Hi(e,t,s,r)}return Hi(e,t,s,r)}function Hi(e,t,i,o){if(Object.is(e,t))return!0;let n=c(e),s=c(t);if(n===g&&(n=v),s===g&&(s=v),n!==s)return!1;switch(n){case u:return e.toString()===t.toString();case h:return vi(e.valueOf(),t.valueOf());case m:case f:case p:return Object.is(e.valueOf(),t.valueOf());case d:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const r=(i=i??new Map).get(e),a=i.get(t);if(null!=r&&null!=a)return r===t;i.set(e,t),i.set(t,e);try{switch(n){case b:if(e.size!==t.size)return!1;for(const[n,s]of e.entries())if(!t.has(n)||!qi(s,t.get(n),n,e,t,i,o))return!1;return!0;case w:{if(e.size!==t.size)return!1;const n=Array.from(e.values()),s=Array.from(t.values());for(let r=0;rqi(a,n,void 0,e,t,i,o)));if(-1===l)return!1;s.splice(l,1)}return!0}case y:case A:case x:case E:case T:case"[object BigUint64Array]":case P:case S:case I:case"[object BigInt64Array]":case R:case O:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n{}),$i(e,t,((...o)=>{const n=i(...o);return void 0!==n?Boolean(n):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?Wi(Array.from(e),Array.from(t),zi(2,i)):void 0}))}function Ui(e,t){return $i(e,t,K)}function Ki(e){if(V(e))return e;const t=c(e);if(!function(e){switch(c(e)){case g:case y:case k:case C:case m:case f:case R:case O:case P:case S:case I:case b:case h:case v:case d:case w:case u:case p:case A:case x:case E:case T:return!0;default:return!1}}(e))return{};if(i=e,Array.isArray(i)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var i;if(W(e)){const t=e;return new(0,t.constructor)(t.buffer,t.byteOffset,t.length)}if(t===k)return new ArrayBuffer(e.byteLength);if(t===C){const t=e,i=t.buffer,o=t.byteOffset,n=t.byteLength,s=new ArrayBuffer(n),r=new Uint8Array(i,o,n);return new Uint8Array(s).set(r),new DataView(s)}if(t===m||t===h||t===u){const i=new(0,e.constructor)(e.valueOf());return t===u?function(e,t){const i=t.valueOf().length;for(const o in t)Object.hasOwn(t,o)&&(Number.isNaN(Number(o))||Number(o)>=i)&&(e[o]=t[o])}(i,e):Gi(i,e),i}if(t===f)return new Date(Number(e));if(t===d){const t=e,i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t===p)return Object(Symbol.prototype.valueOf.call(e));if(t===b){const t=e,i=new Map;return t.forEach(((e,t)=>{i.set(t,e)})),i}if(t===w){const t=e,i=new Set;return t.forEach((e=>{i.add(e)})),i}if(t===g){const t=e,i={};return Gi(i,t),i.length=t.length,i[Symbol.iterator]=t[Symbol.iterator],i}const o={};return function(e,t){const i=Object.getPrototypeOf(t);if(null!==i){"function"==typeof t.constructor&&Object.setPrototypeOf(e,i)}}(o,e),Gi(o,e),function(e,t){const i=Object.getOwnPropertySymbols(t);for(let o=0;oXi([[t,r]],e)))}Ji.has(s)||(Ji.set(s,new Map),s.registerPostFixer((e=>Xi(Ji.get(s),e))),s.on("change:isComposing",(()=>{e.change((e=>Xi(Ji.get(s),e)))}),{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",((e,t,i)=>r(i))),t.placeholder?r(t.placeholder):i&&r(i),i&&function(){Zi||be("enableViewPlaceholder-deprecated-text-option");Zi=!0}()}function Yi(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function Xi(e,t){const i=[];let o=!1;for(const[n,s]of e)s.isDirectHost&&(i.push(n),eo(t,n,s)&&(o=!0));for(const[n,s]of e){if(s.isDirectHost)continue;const e=to(n);e!==s.hostElement&&s.hostElement&&(t.removeAttribute("data-placeholder",s.hostElement),Yi(t,s.hostElement),s.hostElement=null,o=!0),e&&(i.includes(e)||(s.hostElement=e,eo(t,n,s)&&(o=!0)))}return o}function eo(e,t,i){const{text:o,isDirectHost:n,hostElement:s}=i;let r=!1;s.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,s),r=!0);return(n||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;if(function(e){for(const t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}(e))return!1;const i=e.document,o=i.selection.anchor;return!(i.isComposing&&o&&o.parent===e||!t&&i.isFocused&&(!o||o.parent===e))}(s,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,s)&&(r=!0):Yi(e,s)&&(r=!0),r}function to(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class io{is(){throw new Error("is() method is abstract")}}class oo extends(xe(io)){document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new fe("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=We(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]e.data.length)throw new fe("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new fe("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}so.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class ro{_consumables=new Map;add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new ao(e),this._consumables.set(e,i)),i.add(t?lo(t):e._getConsumables()))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(lo(t))}consume(e,t){if(e.is("$text")||e.is("documentFragment"))return!!this.test(e,t)&&(this._consumables.set(e,!1),!0);const i=this._consumables.get(e);return void 0!==i&&i.consume(lo(t))}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(lo(t)))}static createFrom(e,t){if(t||(t=new ro),e.is("$text"))t.add(e);else if(e.is("element")||e.is("documentFragment")){t.add(e);for(const i of e.getChildren())ro.createFrom(i,t)}return t}}class ao{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes)if(i){let e=this._attributes.get(t);e&&"boolean"!=typeof e||(e=new Map,this._attributes.set(t,e)),e.set(i,!0)}else{if("style"==t||"class"==t)throw new fe("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(void 0===e)return null;if(!1===e)return!1;if(!0!==e)if(i){const t=e.get(i);if(void 0===t)return null;if(!t)return!1}else for(const t of e.values())if(!t)return!1}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if("boolean"==typeof e)for(const[e]of this.element._getConsumables(t,i).attributes)this._attributes.set(e,!1);else if(i)for(const[,o]of this.element._getConsumables(t,i).attributes)e.set(o,!1);else for(const t of e.keys())e.set(t,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(!1!==e){if(void 0!==e&&!0!==e)if(i){!1===e.get(i)&&e.set(i,!0)}else for(const t of e.keys())e.set(t,!0)}else this._attributes.set(t,!0)}}}function lo(e){const t=[];return"attributes"in e&&e.attributes&&co(t,e.attributes),"classes"in e&&e.classes&&co(t,e.classes,"class"),"styles"in e&&e.styles&&co(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function co(e,t,i){if("string"!=typeof t)for(const o of t)Array.isArray(o)?e.push(o):e.push(i?[i,o]:[o]);else e.push(i?[i,t]:[t])}class uo{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const i=this._isElementMatching(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const o=this._isElementMatching(i,e);o&&t.push({element:i,pattern:e,match:o})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}_isElementMatching(e,t){if("function"==typeof t){const i=t(e);return i&&"object"==typeof i?lo(i):i}const i={};if(t.name&&(i.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!i.name))return null;const o=[];return t.attributes&&!function(e,t,i){let o;"object"!=typeof e||e instanceof RegExp||Array.isArray(e)?o=["class","style"]:(void 0!==e.style&&be("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&be("matcher-pattern-deprecated-attributes-class-key",e));return t._collectAttributesMatch(mo(e),i,o)}(t.attributes,e,o)||t.classes&&!function(e,t,i){return t._collectAttributesMatch(mo(e,"class"),i)}(t.classes,e,o)||t.styles&&!function(e,t,i){return t._collectAttributesMatch(mo(e,"style"),i)}(t.styles,e,o)?null:(o.length&&(i.attributes=o),i)}}function ho(e,t){return!0===e||e===t||e instanceof RegExp&&!!String(t).match(e)}function mo(e,t){if(Array.isArray(e))return e.map((e=>"object"!=typeof e||e instanceof RegExp?t?[t,e,!0]:[e,!0]:(void 0!==e.key&&void 0!==e.value||be("matcher-pattern-missing-key-or-value",e),t?[t,e.key,e.value]:[e.key,e.value])));if("object"!=typeof e||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];const i=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.push(t?[t,o,e[o]]:[o,e[o]]);return i}class go{_styles;_cachedStyleNames=null;_cachedExpandedStyleNames=null;_styleProcessor;constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=function(e){let t=null,i=0,o=0,n=null;const s=new Map;if(""===e)return s;";"!=e.charAt(e.length-1)&&(e+=";");for(let r=0;rt===e));return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,s(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t={};for(const i of Qt(e)){const e=fo(i),o=ki(this._styles,e);if(o)bo(t,e,o);else{const e=this.getAsString(i);void 0!==e&&this._styleProcessor.toNormalizedForm(i,e,t)}}Object.keys(t).length&&(wo(this._styles,t),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!s(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map((([e])=>e)),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){const e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){const i=[];for(const o of this.getStyleNames(!0))if(ho(e,o)){if(!0===t){i.push(o);continue}ho(t,this.getAsString(o))&&i.push(o)}return i.length?i:void 0}_getConsumables(e){const t=[];if(e){t.push(e);for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(const e of this.getStyleNames()){for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i);t.push(e)}return t}_canMergeFrom(e){for(const t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(const t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(const t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}}class po{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(s(t))bo(i,fo(e),t);else if(this._normalizers.has(e)){const o=this._normalizers.get(e),{path:n,value:s}=o(t);bo(i,n,s)}else bo(i,e,t)}getNormalized(e,t){if(!e)return G({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return ki(t,i);const o=i(e,t);if(o)return o}return ki(t,fo(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(void 0===i)return[];if(this._reducers.has(e)){return this._reducers.get(e)(i)}return[[e,i]]}getStyleNames(e){const t=new Set;for(const i of this._consumables.keys()){const o=this.getNormalized(i,e);o&&("object"!=typeof o||Object.keys(o).length)&&t.add(i)}for(const i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function fo(e){return e.replace("-",".")}function bo(e,t,i){let o=i;s(i)&&!Array.isArray(i)&&(o=G({},ki(e,t),i)),Ii(e,t,o)}function wo(e,t){for(const i of Object.keys(t))null===e[i]||Array.isArray(e[i])||"object"!=typeof e[i]||"object"!=typeof t[i]?delete e[i]:(wo(e[i],t[i]),Object.keys(e[i]).length||delete e[i])}class yo{_set=new Set;get isEmpty(){return 0==this._set.size}get size(){return this._set.size}has(e){return this._set.has(e)}keys(){return Array.from(this._set.keys())}setTo(e){this.clear();for(const t of e.split(/\s+/))t&&this._set.add(t);return this}set(e){for(const t of Qt(e))t&&this._set.add(t)}remove(e){for(const t of Qt(e))this._set.delete(t)}clear(){this._set.clear()}toString(){return Array.from(this._set).join(" ")}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.keys())if(!e.has(t))return!1;return!0}_clone(){const e=new this.constructor;return e._set=new Set(this._set),e}_getTokensMatch(e){const t=[];if(!0===e){for(const e of this._set.keys())t.push(e);return t}if("string"==typeof e){for(const i of e.split(/\s+/)){if(!this._set.has(i))return;t.push(i)}return t}for(const i of this._set.keys())i.match(e)&&t.push(i);return t.length?t:void 0}_getConsumables(e){return e?[e]:this.keys()}_canMergeFrom(){return!0}_mergeFrom(e){for(const t of e._set.keys())this._set.has(t)||this._set.add(t)}_isMatching(e){for(const t of e._set.keys())if(!this._set.has(t))return!1;return!0}}class _o extends oo{name;_unsafeAttributesToRender=[];_attrs;_children;_customProperties=new Map;get _classes(){return this._attrs.get("class")}get _styles(){return this._attrs.get("style")}constructor(e,t,i,o){super(e),this.name=t,this._attrs=this._parseAttributes(i),this._children=[],o&&this._insertChild(0,o)}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes&&(yield"class"),this._styles&&(yield"style");for(const e of this._attrs.keys())"class"!=e&&"style"!=e&&(yield e)}*getAttributes(){for(const[e,t]of this._attrs.entries())yield[e,String(t)]}getAttribute(e){return this._attrs.has(e)?String(this._attrs.get(e)):void 0}hasAttribute(e,t){return!!this._attrs.has(e)&&(void 0===t||(vo(this.name,e)||ko(this.name,e)?this._attrs.get(e).has(t):this._attrs.get(e)===t))}isSimilar(e){if(!(e instanceof _o))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size)return!1;for(const[t,i]of this._attrs){const o=e._attrs.get(t);if(void 0===o)return!1;if("string"==typeof i||"string"==typeof o){if(o!==i)return!1}else if(!i.isSimilar(o))return!1}return!0}hasClass(...e){for(const t of e)if(!this._classes||!this._classes.has(t))return!1;return!0}getClassNames(){const e=this._classes?this._classes.keys():[],t=e[Symbol.iterator]();return Object.assign(e,{next:t.next.bind(t)})}getStyle(e){return this._styles&&this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles&&this._styles.getNormalized(e)}getStyleNames(e){return this._styles?this._styles.getStyleNames(e):[]}hasStyle(...e){for(const t of e)if(!this._styles||!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new uo(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=this._classes?this._classes.keys().sort().join(","):"",t=this._styles&&String(this._styles),i=Array.from(this._attrs).filter((([e])=>"style"!=e&&"class"!=e)).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}toJSON(){const e=super.toJSON();if(e.name=this.name,e.type="Element",this._attrs.size&&(e.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const o=function(e,t){if("string"==typeof t)return[new no(e,t)];Ue(t)||(t=[t]);const i=[];for(const o of t)"string"==typeof o?i.push(new no(e,o)):o instanceof so?i.push(new no(e,o.data)):i.push(o);return i}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;it&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}toJSON(){const e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}}xo.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Eo=Symbol("rootName");class To extends xo{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Eo)}set rootName(e){this._setCustomProperty(Eo,e)}toJSON(){return this.rootName}set _name(e){this.name=e}}To.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Po{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new fe("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new fe("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=So._createAt(e.startPosition):this._position=So._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=So._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset}const n=new so(i,e.offset,o);return e.offset+=o,this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new So(o,0);return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new So(o,0),this._position=e,this._next();let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new so(o,0,n),e=So._createAfter(i)):(i=new so(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=So._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i.is("view:$text")){if(e.isAtStart)return this._position=So._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}e.offset-=o;const n=new so(i,e.offset,o);return this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new So(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new So(o,o.data.length),this._position=e,this._previous();let i,n=o.data.length;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new so(o,t,o.data.length-t),n=i.data.length,e=So._createBefore(i)}else i=new so(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=So._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=So._createAfter(t.textNode):(o=So._createAfter(t.textNode),this._position=o)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=So._createBefore(t.textNode):(o=So._createBefore(t.textNode),this._position=o))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}}class So extends io{parent;offset;constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof xo);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=So._createAt(this),i=t.offset+e;return t.offset=i<0?0:i,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Po(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const o=We(t,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]0?new this(i,o):new this(o,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(So._createBefore(e),t)}}function Ro(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}Io.prototype.is=function(e){return"range"===e||"view:range"===e};class Oo extends(xe(io)){_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=He(this.getRanges());if(t!=He(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),t.start.isEqual(o.start)&&t.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]),this._setFakeOptions(o);else if(t instanceof Oo||t instanceof Vo)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Io)this._setRanges([t],o&&o.backward),this._setFakeOptions(o);else if(t instanceof So)this._setRanges([new Io(t)]),this._setFakeOptions(o);else if(t instanceof oo){const e=!!o&&!!o.backward;let n;if(void 0===i)throw new fe("view-selection-setto-required-second-parameter",this);n="in"==i?Io._createIn(t):"on"==i?Io._createOn(t):new Io(So._createAt(t,i)),this._setRanges([n],e),this._setFakeOptions(o)}else{if(!Ue(t))throw new fe("view-selection-setto-not-selectable",this);this._setRanges(t,o&&o.backward),this._setFakeOptions(o)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new fe("view-selection-setfocus-no-ranges",this);const i=So._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new Io(i,o),!0):this._addRange(new Io(o,i)),this.fire("change")}toJSON(){const e={ranges:Array.from(this.getRanges()).map((e=>e.toJSON()))};return this.isBackward&&(e.isBackward=!0),this.isFake&&(e.isFake=!0),e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Io))throw new fe("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new fe("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Io(e.start,e.end))}}Oo.prototype.is=function(e){return"selection"===e||"view:selection"===e};class Vo extends(xe(io)){_selection;constructor(...e){super(),this._selection=new Oo,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}Vo.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class Do extends ue{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Fo=Symbol("bubblingEmitter"),Mo=Symbol("bubblingCallbacks"),No=Symbol("bubblingContexts");function Bo(e){return class extends e{fire(e,...t){try{const i=e instanceof ue?e:new ue(this,e),o=jo(this),n=qo(this);if(Lo(i,"capturing",this),zo(o,"$capture",i,...t))return i.return;const s=i.startRange||this.selection.getFirstRange(),r=s?s.getContainedElement():null,a=!!r&&function(e,t){for(const i of e)if(i(t))return!0;return!1}(n,r);let l=r||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}(s);if(Lo(i,"atTarget",l),!a){if(zo(o,"$text",i,...t))return i.return;Lo(i,"bubbling",l)}for(;l;){if(l.is("element")&&zo(o,l,i,...t))return i.return;l=l.parent,Lo(i,"bubbling",l)}return Lo(i,"bubbling",this),zo(o,"$document",i,...t),i.return}catch(e){fe.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const o=Qt(i.context||"$document"),n=jo(this),s=$o(this);for(const e of o)"function"==typeof e&&qo(this).add(e);const r=function(e,t,i){return function(o,n){const{currentTarget:s,eventArgs:r}=n;if("string"!=typeof s){if(s.is("rootElement")&&t.includes("$root"))i.call(e,o,...r);else if(t.includes(s.name))i.call(e,o,...r);else for(const n of t)if("function"==typeof n&&n(s))return void i.call(e,o,...r)}else t.includes(s)&&i.call(e,o,...r)}}(this,o,t);s.set(t,r),this.listenTo(n,e,r,i)}_removeEventListener(e,t){const i=jo(this),o=$o(this),n=o.get(t);n&&(o.delete(t),this.stopListening(i,e,n))}}}function Lo(e,t,i){e instanceof Do&&(e._eventPhase=t,e._currentTarget=i)}function zo(e,t,i,...o){return e.fire(i,{currentTarget:t,eventArgs:o}),!!i.stop.called}function jo(e){return e[Fo]||(e[Fo]=new(xe())),e[Fo]}function $o(e){return e[Mo]||(e[Mo]=new Map),e[Mo]}function qo(e){return e[No]||(e[No]=new Set),e[No]}class Ho extends(Bo(Be())){selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new Vo,this.roots=new ei({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach((e=>e.destroy())),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}class Wo extends _o{static DEFAULT_PRIORITY=10;_priority=10;_id=null;_clonesGroup=null;constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Uo}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new fe("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){const e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}_canMergeAttributesFrom(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canSubtractAttributesOf(e)}}function Uo(){if(Ko(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Ko(e)>1)return null;e=e.parent}return!e||Ko(e)>1?null:this.childCount}function Ko(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}Wo.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Go extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Jo}toJSON(){const e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-emptyelement-cannot-add",[this,t]);return 0}}function Jo(){return null}Go.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Zo extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Yo}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}toJSON(){const e=super.toJSON();return e.type="UIElement",e}}function Qo(e){e.document.on("arrowKey",((t,i)=>function(e,t,i){if(t.keyCode==$t.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,n=e.focusOffset,s=i.domPositionToView(t,n);if(null===s)return;let r=!1;const a=s.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(r){const t=i.viewPositionToDom(a);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,e.domConverter)),{priority:"low"})}function Yo(){return null}Zo.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Xo extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=en}toJSON(){const e=super.toJSON();return e.type="RawElement",e}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function en(){return null}Xo.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class tn extends(xe(io)){document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const o=function(e,t){if("string"==typeof t)return[new no(e,t)];Ue(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new no(e,t):t instanceof so?new no(e,t.data):t))}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i{const i=e[e.length-1],o=!t.is("uiElement");return i&&i.breakAttributes==o?i.nodes.push(t):e.push({breakAttributes:o,nodes:[t]}),e}),[]);let o=null,n=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(n,e,t);o||(o=i.start),n=i.end}return o?new Io(o,n):new Io(e)}remove(e){const t=e instanceof Io?e:Io._createOn(e);if(hn(t,this.document),t.isCollapsed)return new tn(this.document);const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,s=o.offset-i.offset,r=n._removeChildren(i.offset,s);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new tn(this.document,r)}clear(e,t){hn(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&t.isSimilar(i))n=Io._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(n=Io._createIn(e))}n&&(n.end.isAfter(e.end)&&(n.end=e.end),n.start.isBefore(e.start)&&(n.start=e.start),this.remove(n))}}move(e,t){let i;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof Wo))throw new fe("view-writer-wrap-invalid-attribute",this.document);if(hn(e,this.document),e.isCollapsed){let o=e.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some((e=>!e.is("uiElement"))))&&(o=o.getLastMatchingPosition((e=>e.item.is("uiElement")))),o=this._wrapPosition(o,t);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(e.start)&&this.setSelection(o),new Io(o)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof Wo))throw new fe("view-writer-unwrap-invalid-attribute",this.document);if(hn(e,this.document),e.isCollapsed)return e;const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,s=this._unwrapChildren(n,i.offset,o.offset,t),r=this.mergeAttributes(s.start);r.isEqual(s.start)||s.end.offset--;const a=this.mergeAttributes(s.end);return new Io(r,a)}rename(e,t){const i=new Co(this.document,e,t.getAttributes());return this.insert(So._createAfter(t),i),this.move(Io._createIn(t),So._createAt(i,0)),this.remove(Io._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}createSlot(e="children"){if(!this._slotFactory)throw new fe("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let o,n;if(o=i?nn(e):e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new fe("view-writer-invalid-position-container",this.document);n=i?this._breakAttributes(e,!0):e.parent.is("$text")?an(e):e;const s=o._insertChild(n.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=n.getShiftedBy(s),a=this.mergeAttributes(n);a.isEqual(n)||r.offset--;const l=this.mergeAttributes(r);return new Io(a,l)}_wrapChildren(e,t,i,o){let n=t;const s=[];for(;n!1,e.parent._insertChild(e.offset,i);const o=new Io(e,e.getShiftedBy(1));this.wrap(o,t);const n=new So(i.parent,i.index);i._remove();const s=n.nodeBefore,r=n.nodeAfter;return s&&s.is("view:$text")&&r&&r.is("view:$text")?ln(s,r):rn(n)}_breakAttributesRange(e,t=!1){const i=e.start,o=e.end;if(hn(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new Io(i,i)}const n=this._breakAttributes(o,t),s=n.parent.childCount,r=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-s,new Io(r,n)}_breakAttributes(e,t=!1){const i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new fe("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new fe("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new fe("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&un(o.parent))return e.clone();if(un(o))return e.clone();if(o.is("$text"))return this._breakAttributes(an(e),t);if(i==o.childCount){const e=new So(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new So(o.parent,o.index);return this._breakAttributes(e,t)}{const e=o.index+1,n=o._clone();o.parent._insertChild(e,n),this._addToClonedElementsGroup(n);const s=o.childCount-i,r=o._removeChildren(i,s);n._appendChild(r);const a=new So(o.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function nn(e){let t=e.parent;for(;!un(t);){if(!t)return;t=t.parent}return t}function sn(e,t){return e.priorityt.priority)&&e.getIdentity()i instanceof e)))throw new fe("view-writer-insert-invalid-node-type",t);i.is("$text")||dn(i.getChildren(),t)}}function un(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function hn(e,t){const i=nn(e.start),o=nn(e.end);if(!i||!o||i!==o)throw new fe("view-writer-invalid-range-container",t)}const mn=e=>e.createTextNode(" "),gn=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},pn=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},fn="⁠".repeat(7);function bn(e){return"string"==typeof e?e.substr(0,7)===fn:at(e)&&e.data.substr(0,7)===fn}function wn(e){return 7==e.data.length&&bn(e)}function yn(e){const t="string"==typeof e?e:e.data;return bn(e)?t.slice(7):t}function _n(e,t){if(t.keyCode==$t.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;bn(t)&&i<=7&&e.collapse(t,0)}}}class kn extends(Be()){domDocuments=new Set;domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),Y.isBlink&&!Y.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()}))}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new fe("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!Y.isAndroid)return;let e=null;const t=!(Y.isBlink&&!Y.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=So._createBefore(e.parent)));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),i=t.parent.ownerDocument;bn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=vn(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),s=this._findUpdateActions(n,i,o,Cn);if(-1!==s.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const n of s)if("update"===n){const n=t.equal+t.insert,s=t.equal+t.delete,r=e.getChild(n);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,i[s]),Pt(o[n]),t.equal++}else t[n]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?So._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&at(t.parent)&&bn(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!bn(e))throw new fe("view-renderer-filler-was-lost",this);wn(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;const o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof no||n instanceof no)&&(!!(i!==t.getFillerOffset()||o&&o.is("element","br"))&&(!Y.isAndroid||!o&&!n))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=fn+o),this._updateTextNode(i,o)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){for(const i of Array.from(t.attributes)){const o=i.name;e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(Y.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&at(e)&&at(t)){i.normalize();break}e=t}}const o=t.inlineFillerPosition,n=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&vn(i.ownerDocument,s,o.offset);const r=this._diffNodeLists(n,s),a=this._findUpdateActions(r,n,s,An);let l=0;const c=new Set;for(const e of a)"delete"===e?(c.add(n[l]),Pt(n[l])):"equal"!==e&&"update"!==e||l++;l=0;for(const e of a)"insert"===e?(kt(i,l,s[l]),l++):"update"===e?(this._updateTextNode(n[l],s[l].data),l++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const e of c)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return de(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;i[i.length-1]==t&&i.pop();return i}(e,this._fakeSelectionContainer),t,xn.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let n=[],s=[],r=[];const a={equal:0,insert:0,delete:0};for(const l of e)"insert"===l?r.push(i[a.equal+a.insert]):"delete"===l?s.push(t[a.equal+a.delete]):(n=n.concat(de(s,r,o).map((e=>"equal"===e?"update":e))),n.push("equal"),s=[],r=[]),a[l]++;return n.concat(de(s,r,o).map((e=>"equal"===e?"update":e)))}_updateTextNode(e,t){const i=e.data;i!=t&&(Y.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){const i=ae(e.data,t);for(const t of i)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(Y.isBlink&&!Y.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e?this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&Y.isAndroid||this._updateDomSelection(e):!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection()}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),n=t.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),Y.isGecko&&function(e,t){let i=e.parent,o=e.offset;at(i)&&wn(i)&&(o=_t(i)+1,i=i.parentNode);if(i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;const n=i.childNodes[o];n&&"BR"==n.tagName&&t.addRange(t.getRangeAt(0))}(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,o=this.domConverter.mapDomToView(i);i&&o&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function vn(e,t,i){const o=t instanceof Array?t:t.childNodes,n=o[i];if(at(n))return n.data=fn+n.data,n;{const n=e.createTextNode(fn);return Array.isArray(t)?o.splice(i,0,n):kt(t,i,n),n}}function Cn(e,t){return Qe(e)&&Qe(t)&&!at(e)&&!at(t)&&!vt(e)&&!vt(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function An(e,t){return Qe(e)&&Qe(t)&&at(e)&&at(t)}function xn(e,t,i){return t===i||(at(t)&&at(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}const En=pn(J.document),Tn=mn(J.document),Pn=gn(J.document),Sn="data-ck-unsafe-attribute-",In="data-ck-unsafe-element";class Rn{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new uo;_inlineObjectElementMatcher=new uo;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:t,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=t||("editing"===i?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?J.document:J.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Oo(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.children)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e&&("img"===i&&("src"===e||"srcset"===e)||("source"===i&&"srcset"===e||!t.replace(/\s+/g,"").match(/^(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const i=(new DOMParser).parseFromString(t,"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);const s=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=s.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(Bn(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return o="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(Bn(i.name),o=this._createReplacementDomElement(i.name)):o=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(o,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(e):o.appendChild(e);return o}}setDomElementAttribute(e,t,i,o){const n=this.shouldRenderAttribute(t,i,e.tagName.toLowerCase())||o&&o.shouldRenderUnsafeAttribute(t);n||be("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:i}),function(e){try{J.document.createAttribute(e)}catch{return!1}return!0}(t)?(e.hasAttribute(t)&&!n?e.removeAttribute(t):e.hasAttribute(Sn+t)&&n&&e.removeAttribute(Sn+t),e.setAttribute(n?t:Sn+t,i)):be("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:i})}removeDomElementAttribute(e,t){t!=In&&(e.removeAttribute(t),e.removeAttribute(Sn+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const n of e.getChildren()){i===o&&(yield this._getBlockFiller());const e=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!ti(n.getAttributes());if(e&&"data"==this.renderingMode)if(n.is("rawElement")){const e=this._domDocument.createElement(n.name);n.render(e,this),yield*[...e.childNodes]}else yield*this.viewChildrenToDom(n,t);else e&&be("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t);o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return bn(i)&&(o+=7),i.data&&o>i.data.length&&(o=i.data.length),{parent:i,offset:o}}{let i,o,n;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{const t=e.nodeBefore;if(o=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!o)return null;i=o.parentNode,n=o.nextSibling}if(at(n)&&bn(n))return{parent:n,offset:7};return{parent:i,offset:o?_t(o)+1:0}}}domToView(e,t={}){const i=[],o=this._domToView(e,t,i),n=o.next().value;return n?(o.next(),this._processDomInlineNodes(null,i,t),"br"==this.blockFillerMode&&Mn(n)||n.is("$text")&&0==n.data.length?null:n):null}*domChildrenToView(e,t={},i=[]){let o=[];o=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let n=0;n{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])})),t.focus({preventScroll:!0}),On(t,(e=>{const[t,i]=n.shift();e.scrollLeft=t,e.scrollTop=i})),J.window.scrollTo(i,o)}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(En):!!Nn(e,this.blockElements)||(e.isEqualNode(Pn)||function(e,t){const i=e.isEqualNode(Tn);return i&&Vn(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=ot(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return mn(this._domDocument);case"markedNbsp":return gn(this._domDocument);case"br":return pn(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(at(e)&&bn(e)&&t<7)return!1;if(this.isElement(e)&&bn(e.childNodes[t]))return!1;const i=this.mapDomToView(e);return!i||!i.is("uiElement")&&!i.is("rawElement")}*_domToView(e,t,i){if("br"!=this.blockFillerMode&&Nn(e,this.blockElements))return null;const o=this.getHostViewElement(e);if(o)return o;if(vt(e)&&t.skipComments)return null;if(at(e)){if(wn(e))return null;{const t=e.data;if(""===t)return null;const o=new no(this.document,t);return i.push(o),o}}{let o=this.mapDomToView(e);if(o)return this._isInlineObjectElement(o)&&i.push(o),o;if(this.isDocumentFragment(e))o=new tn(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const n=e.attributes;if(n)for(let e=n.length,t=0;t0?t[e-1]:null,l=e+1e.is("element")&&t.includes(e.name)))}(e,this.preElements))return!0;for(const t of e.getAncestors({parentFirst:!0}))if(t.is("element")&&t.hasStyle("white-space")&&"inherit"!==t.getStyle("white-space"))return["pre","pre-wrap","break-spaces"].includes(t.getStyle("white-space"));return!1}_getTouchingInlineViewNode(e,t){const i=new Po({startPosition:t?So._createAfter(e):So._createBefore(e),direction:t?"forward":"backward"});for(const{item:e}of i){if(e.is("$textProxy"))return e;if(!e.is("element")||!e.getCustomProperty("dataPipeline:transparentRendering")){if(e.is("element","br"))return null;if(this._isInlineObjectElement(e))return e;if(e.is("containerElement")||this._isBlockViewElement(e))return null}}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(vt(e))return new Zo(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new _o(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(In,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function On(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function Vn(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function Dn(e,t,i){return" "==t&&e&&e.is("element")&&1==e.childCount&&i.includes(e.name)}function Fn(e,t){return" "==t&&e&&e.is("element","span")&&1==e.childCount&&e.hasAttribute("data-cke-filler")}function Mn(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function Nn(e,t){return"BR"===e.tagName&&Vn(e,t)&&1===e.parentNode.childNodes.length}function Bn(e){"script"===e&&be("domconverter-unsafe-script-element-detected"),"style"===e&&be("domconverter-unsafe-style-element-detected")}class Ln extends(et()){view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}class zn{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Mi(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class jn extends Ln{useCapture=!1;usePassive=!1;observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture,usePassive:this.usePassive})}))}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new zn(this.view,t,i))}}class $n extends jn{domEventType=["keydown","keyup"];onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Ht(this)}};this.fire(e.type,e,t)}}class qn extends Ln{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Li((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new Oo(t.getRanges(),{backward:t.isBackward,fake:!1});e!=$t.arrowleft&&e!=$t.arrowup||i.setTo(i.getFirstPosition()),e!=$t.arrowright&&e!=$t.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class Hn extends Ln{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,i=new Set,o=new Set;for(const i of e){const e=t.mapDomToView(i.target);e&&(e.is("uiElement")||e.is("rawElement")||"childList"!==i.type||this._isBogusBrMutation(i)||o.add(e))}for(const n of e){const e=t.mapDomToView(n.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===n.type){const e=t.findCorrespondingViewText(n.target);e&&!o.has(e.parent)?i.add(e):!e&&bn(n.target)&&o.add(t.mapDomToView(n.target.parentNode))}}const n=[];for(const e of i)n.push({type:"text",node:e});for(const e of o){const i=t.mapViewToDom(e);Wi(Array.from(e.getChildren()),Array.from(t.domChildrenToView(i,{withChildren:!1})),Wn)||n.push({type:"children",node:e})}n.length&&this.document.fire("mutations",{mutations:n})}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}function Wn(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}class Un extends jn{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;const t=this.document;t.on("focus",(()=>this._handleFocus())),t.on("blur",((e,t)=>this._handleBlur(t))),t.on("beforeinput",(()=>{t.isFocused||this._handleFocus()}),{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this._renderTimeoutId=null,this.flush(),this.view.change((()=>{}))}),50)}_handleBlur(e){const t=this.document.selection.editableElement;null!==t&&t!==e.target||(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change((()=>{})))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class Kn extends Ln{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(Hn),this.focusObserver=e.getObserver(Un),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=Li((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Li((()=>this.document.isSelecting=!1),5e3),this.view.document.on("change:isFocused",((e,t,i)=>{if(i&&this._pendingSelectionChange.size){for(const e of Array.from(this._pendingSelectionChange))this._handleSelectionChange(e);this._pendingSelectionChange.clear()}}))}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(()=>{this.document.isComposing&&!Y.isAndroid||(this._handleSelectionChange(t),this._documentIsSelectingInactivityTimeoutDebounced())})),this.listenTo(this.view.document,"compositionstart",(()=>{this._handleSelectionChange(t)}),{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const t=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(t.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(t);if(0!=i.rangeCount)if(this.view.hasDomSelection=!0,this.focusObserver.flush(),this.view.document.isFocused||this.view.document.isReadOnly){if(this._pendingSelectionChange.delete(e),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(function(e){return Array.from(e.getRanges()).flatMap((e=>[e.start.root,e.end.root])).every((e=>e&&e.is("rootElement")))}(i))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}else this.view.forceRender()}else this._pendingSelectionChange.add(e);else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Gn extends jn{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0})),t.on("compositionend",(()=>{t.isComposing=!1}))}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class Jn{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?Zn(e):null,this._native=e}get files(){return this._files||(this._files=Zn(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function Zn(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class Qn extends jn{domEventType="beforeinput";onDomEvent(e){const t=e.getTargetRanges(),i=this.view,o=i.document;let n=null,s=null,r=[];if(e.dataTransfer&&(n=new Jn(e.dataTransfer)),null!==e.data?s=e.data:n&&(s=n.getData("text/plain")),o.selection.isFake)r=Array.from(o.selection.getRanges()),e.preventDefault();else if(t.length)r=t.map((t=>{let o=i.domConverter.domPositionToView(t.startContainer,t.startOffset);const n=i.domConverter.domPositionToView(t.endContainer,t.endOffset);if(o&&bn(t.startContainer)&&t.startOffset<7){e.preventDefault();let i=7-t.startOffset;o=o.getLastMatchingPosition((e=>!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))||!(!e.item.is("$textProxy")||!i--)),{direction:"backward",singleCharacters:!0})}return function(e,t){for(;e.parentNode;){if(at(e)){if(t!=e.data.length)return!1}else if(t!=e.childNodes.length)return!1;if((t=_t(e)+1)<(e=e.parentNode).childNodes.length&&bn(e.childNodes[t]))return!0}return!1}(t.endContainer,t.endOffset)&&e.preventDefault(),o?i.createRange(o,n):n?i.createRange(n):void 0})).filter((e=>!!e));else if(Y.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();r=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(Y.isAndroid&&"insertCompositionText"==e.inputType&&s&&s.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(r[0].end)]});else if(["insertText","insertReplacementText"].includes(e.inputType)&&s&&s.includes("\n")){const t=s.split(/\n{1,2}/g);let i=r;e.preventDefault();for(let s=0;s{if(this.isEnabled&&((i=t.keyCode)==$t.arrowright||i==$t.arrowleft||i==$t.arrowup||i==$t.arrowdown)){const i=new Do(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i}))}observe(){}stopObserving(){}}class Xn extends Ln{constructor(e){super(e);const t=this.document;t.on("keydown",((e,i)=>{if(!this.isEnabled||i.keyCode!=$t.tab||i.ctrlKey)return;const o=new Do(t,"tab",t.selection.getFirstRange());t.fire(o,i),o.stop.called&&e.stop()}))}observe(){}stopObserving(){}}class es extends(Be()){document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new Ho(e),this.domConverter=new Rn(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new kn(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new on(this.document),this.addObserver(Hn),this.addObserver(Un),this.addObserver(Kn),this.addObserver($n),this.addObserver(qn),this.addObserver(Gn),this.addObserver(Yn),this.addObserver(Qn),this.addObserver(Xn),this.document.on("arrowKey",_n,{priority:"low"}),Qo(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0})),Y.isiOS&&this.listenTo(this.document,"blur",((e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})),this.listenTo(this.document,"mutations",((e,{mutations:t})=>{t.forEach((e=>this._renderer.markToSync(e.type,e.node)))}),{priority:"low"}),this.listenTo(this.document,"mutations",(()=>{this.forceRender()}),{priority:"lowest"})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:n}of Array.from(e.attributes))o[t]=n,"class"===t?this._writer.addClass(n.split(" "),i):i.hasAttribute(t)||this._writer.setAttribute(t,n,i);this._initialDomRootAttributes.set(e,o);const n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),i.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),i.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),i.on("change:isReadOnly",(()=>this.change(n))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,i]of this.domRoots)t.observe(i,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){const n=this.document.selection.getFirstRange();if(!n)return;const s=j({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const r={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",r,s),function({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){const s=Mt(e);let r=s,a=null;for(t=function(e){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:e}(t);r;){let l;l=Nt(r==s?e:a),Rt({parent:l,getRect:()=>Bt(e,r),alignToTop:o,ancestorOffset:i,forceScroll:n});let c=Bt(e,r);const d=Bt(l,r);if(c.height>d.height){const e=c.getIntersection(d);e&&(c=e)}if(It({window:r,rect:c,viewportOffset:t,alignToTop:o,forceScroll:n}),r.parent!=r){if(a=r.frameElement,r=r.parent,!a)return}else r=null}}(r)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new fe("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){fe.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(Un).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class ts{is(){throw new Error("is() method is abstract")}}class is extends ts{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new fe("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new fe("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}is.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class os{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new fe("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new fe("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=ss._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i,o,n;do{o=this.position,n=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const o=rs(t,i),n=o||as(t,i,o);if(n&&n.is("model:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=n;return this._position=t,ns("elementStart",n,e,t,1)}if(n&&n.is("model:$text")){let o;if(this.singleCharacters)o=1;else{let e=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),o=t.offset-e}const n=t.offset-s.startOffset,r=new is(s,n-o,o);return t.offset-=o,this._position=t,ns("text",r,e,t,o)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,ns("elementStart",i,e,t,1)}}function ns(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}class ss extends ts{root;path;stickiness;constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new fe("model-position-root-invalid",e);if(!Array.isArray(t)||0===t.length)throw new fe("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(1===t)return cs(e,this,i);if(-1===t)return cs(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?ds(this.path,t):ds(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==We(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=ss._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?ss._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=ss._createAt(this);if(this.root!=e.root)return i;if("same"==We(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;i.offset-=t}}else if("prefix"==We(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;i.path[o]-=t}}return i}_getTransformedByInsertion(e,t){const i=ss._createAt(this);if(this.root!=e.root)return i;if("same"==We(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}(e,i+1))}function ds(e,t){for(;tt+1;){const t=o.maxOffset-i.offset;0!==t&&e.push(new us(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],o=t-i.offset;0!==o&&e.push(new us(i,i.getShiftedBy(o))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new os(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new os(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new os(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new us(this.start,this.end)]}getTransformedByOperations(e){const t=[new us(this.start,this.end)];for(const i of e)for(let e=0;e0?new this(i,o):new this(o,i)}static _createIn(e){return new this(ss._createAt(e,0),ss._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(ss._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new fe("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const i=e.indexOf(t),o=new this(t.start,t.end);for(let t=i-1;t>=0&&e[t].end.isEqual(o.start);t--)o.start=ss._createAt(e[t].start);for(let t=i+1;t{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new fe("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=ss._createAt(o,n)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);if(t.defer)this._deferredBindingRemovals.set(e,e.root);else{this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i)}}unbindModelElement(e){const t=this.toViewElement(e);if(this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),0==o.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new us(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Io(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e){return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let o=0;for(let i=0;i0;){const e=t.pop(),o=e.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(e.name);if(o)i+=o(e);else if(this._viewToModelMapping.has(e))i+=1;else if(e.is("$text"))i+=e.data.length;else{if(e.is("uiElement"))continue;for(const i of e.getChildren())t.push(i)}}return i}findPositionIn(e,t){if(0===t)return this._moveViewPositionToTextNode(new So(e,0));if(0==this._viewToModelLengthCallbacks.size&&this._viewToModelMapping.has(e)){const i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}return this._findPositionStartingFrom(new So(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,o,n){let s,r=e.parent,a=e.offset;if(r.is("$text"))return new So(r,i-t);let l=t,c=0;for(;l{this._clearCacheInsideParent(t,i.index)};_invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheAfter(t)};save(e,t,i,o){const n=this._cachedMapping.get(i),s=n.cacheMap.get(o);if(s){const i=e.getChild(t-1),o=s.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(s.viewPosition.nodeBefore):0;return void this._nodeToCacheListIndex.set(i,o)}const r={viewPosition:new So(e,t),modelOffset:o};n.maxModelOffset=o>n.maxModelOffset?o:n.maxModelOffset,n.cacheMap.set(o,r);let a=n.cacheList.length-1;for(;a>=0&&n.cacheList[a].modelOffset>o;)a--;if(n.cacheList.splice(a+1,0,r),t>0){const i=e.getChild(t-1);this._nodeToCacheListIndex.set(i,a+1)}}getClosest(e,t){const i=this._cachedMapping.get(e);let o;if(i)if(t>i.maxModelOffset)o=i.cacheList[i.cacheList.length-1];else{const e=i.cacheMap.get(t);o=e||this._findInCacheList(i.cacheList,t)}else o=this.startTracking(e);return{modelOffset:o.modelOffset,viewPosition:o.viewPosition.clone()}}startTracking(e){const t={viewPosition:new So(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(0==t)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{const i=e.getChild(t-1);this._clearCacheAfter(i)}}_clearCacheAll(e){const t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheAfter(e){const t=this._nodeToCacheListIndex.get(e);if(void 0===t){const t=e.parent;return void(this._cachedMapping.has(t)||this._clearCacheInsideParent(t.parent,t.index))}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,t)}_clearCacheFromCacheIndex(e,t){0===t&&(t=1);const i=this._cachedMapping.get(e),o=i.cacheList[t-1];if(!o)return;i.maxModelOffset=o.modelOffset;const n=i.cacheList.splice(t);for(const e of n){i.cacheMap.delete(e.modelOffset);const t=e.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(t)}}_findInCacheList(e,t){let i=0,o=e.length-1,n=o-i>>1,s=e[n];for(;i>1),s=e[n];return s.modelOffset<=t?s:e[n-1]}}class gs{_consumable=new Map;_textProxyRegistry=new Map;add(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(void 0===i)return null;const o=i.get(t);return void 0===o?null:o}revert(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e));const i=this.test(e,t);return!1===i?(this._consumable.get(e).set(t,!0),!0):!0!==i&&null}verifyAllConsumed(e){const t=[];for(const[i,o]of this._consumable)for(const[n,s]of o){const o=n.split(":")[0];s&&e==o&&t.push({event:n,item:i.name||i.description})}if(t.length)throw new fe("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){const t=e.startOffset,i=e.endOffset,o=e.parent,n=Symbol("$textProxy:"+e.data);let s,r;return s=this._textProxyRegistry.get(t),s||(s=new Map,this._textProxyRegistry.set(t,s)),r=s.get(i),r||(r=new Map,s.set(i,r)),r.set(o,n),n}}function ps(e){const t=e.split(":");return"insert"==t[0]?t[0]:"addMarker"==t[0]||"removeMarker"==t[0]?e:t.length>1?t[0]+":"+t[1]:t[0]}class fs extends(xe()){_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const o=e.getRefreshedItems(),n=this._createConversionApi(i,o);for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,n);const s=this._reduceChanges(e.getChanges(),o);for(const e of s)"insert"===e.type?this._convertInsert(us._createFromPositionAndShift(e.position,e.length),n):"reinsert"===e.type?this._convertReinsert(us._createFromPositionAndShift(e.position,e.length),n):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,n):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,n);n.mapper.flushDeferredBindings();for(const e of n.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,n),this._convertMarkerAdd(e,i,n)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,n);n.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){const n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(const[e,i]of t)this._convertMarkerAdd(e,i,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);const n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;const s=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,s),this.fire("selection",{selection:e},o),e.isCollapsed){for(const t of s)if(o.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!bs(e.getFirstPosition(),t,o.mapper))continue;const n={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,n,o)}for(const t of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of e.getWalker({shallow:!0}))this._testAndFire("insert",ws(i),t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(const s of e){const e={item:s.item,range:us._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,e,n)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(ws))this.fire(`remove:${e.item.is("element")?e.item.name:"$text"}`,{position:e.range.start,length:e.item.offsetSize,reconversion:!0},t),this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(const n of t.getItems()){if(!i.consumable.test(n,o))continue;const s={item:n,range:us._createOn(n),markerName:e,markerRange:t};this.fire(o,s,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e,t){const i={changes:e,refreshedItems:t};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const o of i)e.add(t,"addMarker:"+o.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const o=function(e,t){const i=t.item.is("element")?t.item.name:"$text";return`${e}:${i}`}(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(i),r=s.get(n);if(r){if(r.has(o))return;r.add(o)}else s.set(n,new Set([o]));this.fire(o,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:us._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const o={...this._conversionApi,consumable:new gs,writer:e,options:i,convertItem:e=>this._convertInsert(us._createOn(e),o),convertChildren:e=>this._convertInsert(us._createIn(e),o,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,o),canReuseView:e=>!t.has(o.mapper.toModelElement(e))};return this._firedEventsMap.set(o,new Map),o}}function bs(e,t,i){const o=t.getRange(),n=Array.from(e.getAncestors());n.shift(),n.reverse();return!n.some((e=>{if(o.containsItem(e)){return!!i.toViewElement(e).getCustomProperty("addHighlight")}}))}function ws(e){return{item:e.item,range:us._createFromPositionAndShift(e.previousPosition,e.length)}}class ys extends ts{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=ai(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=We(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o](e[t[0]]=t[1],e)),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=ai(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}ys.prototype.is=function(e){return"node"===e||"model:node"===e};class _s extends(xe(ts)){_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...e){super(),e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new us(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new us(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new us(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof _s)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof us)this._setRanges([t],!!o&&!!o.backward);else if(t instanceof ss)this._setRanges([new us(t)]);else if(t instanceof ys){const e=!!o&&!!o.backward;let n;if("in"==i)n=us._createIn(t);else if("on"==i)n=us._createOn(t);else{if(void 0===i)throw new fe("model-selection-setto-required-second-parameter",[this,t]);n=new us(ss._createAt(t,i))}this._setRanges([n],e)}else{if(!Ue(t))throw new fe("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,o&&!!o.backward)}}_setRanges(e,t=!1){const i=Array.from(e),o=i.some((t=>{if(!(t instanceof us))throw new fe("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(i.length!==this._ranges.length||o)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new fe("model-selection-setfocus-no-ranges",[this,e]);const i=ss._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new us(i,o)),this._lastRangeBackward=!0):(this._pushRange(new us(o,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Cs(t.start,e);xs(i,t)&&(yield i);const o=t.getWalker();for(const i of o){const n=i.item;"elementEnd"==i.type&&vs(n,e,t)?yield n:"elementStart"==i.type&&n.is("model:element")&&n.root.document.model.schema.isBlock(n)&&o.jumpTo(ss._createAt(n,"end"))}const n=Cs(t.end,e);Es(n,t)&&(yield n)}}containsEntireContent(e=this.anchor.root){const t=ss._createAt(e,0),i=ss._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}toJSON(){const e={ranges:Array.from(this.getRanges()).map((e=>e.toJSON()))},t=Object.fromEntries(this.getAttributes());return Object.keys(t).length&&(e.attributes=t),this.isBackward&&(e.isBackward=!0),e}_pushRange(e){this._checkRange(e),this._ranges.push(new us(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function ks(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function vs(e,t,i){return ks(e,t)&&As(e,i)}function Cs(e,t){const i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const s=o.find((e=>!n&&(n=i.isLimit(e),!n&&ks(e,t))));return o.forEach((e=>t.add(e))),s}function As(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);if(!i)return!0;return!t.containsRange(us._createOn(i),!0)}function xs(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(ss._createAt(e,e.maxOffset))&&As(e,t))}function Es(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(ss._createAt(e,0))&&As(e,t))}_s.prototype.is=function(e){return"selection"===e||"model:selection"===e};class Ts extends(xe(us)){constructor(e,t){super(e,t),Ps.call(this)}detach(){this.stopListening()}toRange(){return new us(this.start,this.end)}static fromRange(e){return new Ts(e.start,e.end)}}function Ps(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&Ss.call(this,i)}),{priority:"low"})}function Ss(e){const t=this.getTransformedByOperation(e),i=us._createFromRanges(t),o=!i.isEqual(this),n=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let s=null;if(o){"$graveyard"==i.root.rootName&&(s="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:s})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:s})}Ts.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};class Is extends ys{_data;constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Is(this.data,this.getAttributes())}static fromJSON(e){return new Is(e.data,e.attributes)}}Is.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};const Rs="selection:";class Os extends(xe(ts)){_selection;constructor(e){super(),this._selection=new Vs(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Rs+e}static _isStoreAttributeKey(e){return e.startsWith(Rs)}}Os.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Vs extends _s{markers=new ei({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,i,o)=>{this._updateMarker(t,o)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const i=e.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(i.getAttributeKeys()).filter((e=>e.startsWith(Rs)));for(const o of t)e.removeAttribute(o,i)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;ee.toJSON()))),e}_validateSelectionRanges(e){for(const t of e)if(!this._document._validateSelectionRange(t))throw new fe("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Ts.fromRange(e);return t.on("change:range",((e,i,o)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=t.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),s=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!s?(this.markers.add(e),o=!0):!i&&s&&(this.markers.remove(e),o=!0)}else s&&(this.markers.remove(e),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){const t=ai(this._getSurroundingAttributes()),i=ai(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const o=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||o.push(e);for(const[e]of i)this.hasAttribute(e)||o.push(e);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){const o=i?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}_removeAttribute(e,t=!0){const i=t?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,i),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,o]of e){this._setAttribute(i,o,!1)&&t.add(i)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Rs)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=Ds(o,t)),i||(i=Ds(n,t)),!this.isGravityOverridden&&!i){let e=o;for(;e&&!i;)e=e.previousSibling,i=Ds(e,t)}if(!i){let e=n;for(;e&&!i;)e=e.nextSibling,i=Ds(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const o of e){if(o.item.is("element")&&t.isObject(o.item)){i=Ds(o.item,t);break}if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Ds(e,t){if(!e)return null;if(e instanceof is||e instanceof Is)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[o,n]of e.getAttributes())t.checkAttribute("$text",o)&&!1!==t.getAttributeProperties(o).copyFromObject&&i.push([o,n]);return i}class Fs{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new fe("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const t=this._offsetToNode[e];if(!t)throw new fe("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){const i=[];for(const e of t){if(!(e instanceof ys))throw new fe("model-nodelist-insertnodes-not-node",this);i.push(e)}let o=this.indexToOffset(e);li(this._nodes,i,e),li(this._offsetToNode,function(e){const t=[];let i=0;for(const o of e)for(let e=0;enull!==e.index)),this._offsetToNode=this._offsetToNode.filter((e=>null!==e.index));let t=0;for(let e=0;ee.toJSON()))}}class Ms extends ys{name;_children=new Fs;constructor(e,t,i){super(t),this.name=e,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?function(e){const t=[];for(const i of e)t.push(i._clone(!0));return t}(this._children):void 0;return new Ms(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Is(e)];Ue(e)||(e=[e]);const t=[];for(const i of e)"string"==typeof i?t.push(new Is(i)):i instanceof is?t.push(new Is(i.data,i.getAttributes())):t.push(i);return t}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push(Ms.fromJSON(i)):t.push(Is.fromJSON(i))}return new Ms(e.name,e.attributes,t)}}Ms.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class Ns{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class Bs extends Ns{elementToElement(e){return this.add(function(e){const t=Us(e.model),i=Ks(e.view,"container");t.attributes.length&&(t.children=!0);return o=>{o.on(`insert:${t.name}`,js(i,Ys(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",Qs(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=Us(e.model),i=Ks(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new fe("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});var n,s;o.on(`insert:${t.name}`,(n=i,s=Ys(t),(e,t,i)=>{if(!s(t.item,i.consumable,{preflight:!0}))return;const o=new Map;i.writer._registerSlotFactory(function(e,t,i){return(o,n)=>{const s=o.createContainerElement("$slot");let r=null;if("children"===n)r=Array.from(e.getChildren());else{if("function"!=typeof n)throw new fe("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});r=Array.from(e.getChildren()).filter((e=>n(e)))}return t.set(s,r),s}}(t.item,o,i));const r=n(t.item,i,t);if(i.writer._clearSlotFactory(),!r)return;!function(e,t,i){const o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new fe("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new fe("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,o,i),s(t.item,i.consumable);const a=t.reconversion&&Hs(t.item,i)||i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,r),i.writer.insert(a,r),i.convertAttributes(t.item),function(e,t,i,o){i.mapper.on("modelToViewPosition",r,{priority:"highest"});let n=null,s=null;for([n,s]of t)Xs(e,s,i,o),i.writer.setCustomProperty("$structureSlotParent",!0,n.parent),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);function r(e,t){const i=t.modelPosition.nodeAfter,o=s.indexOf(i);o<0||(t.viewPosition=t.mapper.findPositionIn(n,o))}i.mapper.off("modelToViewPosition",r)}(r,o,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",Qs(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=j(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=Ks(e.view[i],"attribute");else e.view=Ks(e.view,"attribute");const o=Gs(e);return t=>{t.on(i,zs(o),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=j(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=Js(e.view[i]);else e.view=Js(e.view);const o=Gs(e);return t=>{var n;t.on(i,(n=o,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const o=n(t.attributeOldValue,i,t),s=n(t.attributeNewValue,i,t);if(!o&&!s)return;i.consumable.consume(t.item,e.name);const r=i.mapper.toViewElement(t.item),a=i.writer;if(!r)throw new fe("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&o){let e=o.value;"style"==o.key&&(e="string"==typeof o.value?new go(a.document.stylesProcessor).setTo(o.value).getStylesEntries().map((([e])=>e)):Object.keys(o.value)),a.removeAttribute(o.key,e,r)}if(null!==t.attributeNewValue&&s){let e=s.value;"style"==s.key&&"string"==typeof s.value&&(e=Object.fromEntries(new go(a.document.stylesProcessor).setTo(s.value).getStylesEntries())),a.setAttribute(s.key,e,!1,r)}}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=Ks(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,$s(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,((e,t,i)=>{const o=i.mapper.markerNameToElements(t.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,o)=>{if(!t.item)return;if(!(t.item instanceof _s||t.item instanceof Os||t.item.is("$textProxy")))return;const n=Zs(i,t,o);if(!n)return;if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,r=Ls(s,n),a=s.document.selection;if(t.item instanceof _s||t.item instanceof Os)s.wrap(a.getFirstRange(),r);else{const e=o.mapper.toViewRange(t.range),i=s.wrap(e,r);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){o.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,o)=>{if(!i.item)return;if(!(i.item instanceof Ms))return;const n=Zs(e,i,o);if(!n)return;if(!o.consumable.test(i.item,t.name))return;const s=o.mapper.toViewElement(i.item);if(s&&s.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(const e of us._createIn(i.item))o.consumable.consume(e.item,t.name);s.getCustomProperty("addHighlight")(s,n,o.writer),o.mapper.bindElementToMarker(s,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;const n=Zs(e,i,o);if(!n)return;const s=Ls(o.writer,n),r=o.mapper.markerNameToElements(i.markerName);if(r){for(const e of r)if(o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement"))o.writer.unwrap(o.writer.createRangeOn(e),s);else{e.getCustomProperty("removeHighlight")(e,n.id,o.writer)}o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=j(e);const t=e.model;let i=e.view;i||(i=i=>({group:t,name:i.substr(e.model.length+1)}));return o=>{var n;o.on(`addMarker:${t}`,(n=i,(e,t,i)=>{const o=n(t.markerName,i);if(!o)return;const s=t.markerRange;i.consumable.consume(s,e.name)&&(Ws(s,!1,i,t,o),Ws(s,!0,i,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,function(e){return(t,i,o)=>{const n=e(i.markerName,o);if(!n)return;const s=o.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(r(`data-${n.group}-start-before`,e),r(`data-${n.group}-start-after`,e),r(`data-${n.group}-end-before`,e),r(`data-${n.group}-end-after`,e)):o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(e,t):o.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function Ls(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function zs(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);const r=o.writer,a=r.document.selection;if(i.item instanceof _s||i.item instanceof Os)r.wrap(a.getFirstRange(),s);else{let e=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(e=r.unwrap(e,n)),null!==i.attributeNewValue&&s&&r.wrap(e,s)}}}function js(e,t=tr){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;const s=e(o.item,n,o);if(!s)return;t(o.item,n.consumable);const r=o.reconversion&&Hs(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,s),n.writer.insert(r,s),n.convertAttributes(o.item),Xs(s,o.item.getChildren(),n,{reconversion:o.reconversion})}}function $s(e){return(t,i,o)=>{i.isOpening=!0;const n=e(i,o);i.isOpening=!1;const s=e(i,o);if(!n||!s)return;const r=i.markerRange;if(r.isCollapsed&&!o.consumable.consume(r,t.name))return;for(const e of r)if(!o.consumable.consume(e.item,t.name))return;const a=o.mapper,l=o.writer;l.insert(a.toViewPosition(r.start),n),o.mapper.bindElementToMarker(n,i.markerName),r.isCollapsed||(l.insert(a.toViewPosition(r.end),s),o.mapper.bindElementToMarker(s,i.markerName)),t.stop()}}function qs(e,t){const i=t.writer.remove(e);for(const e of t.writer.createRangeIn(i).getItems())t.mapper.unbindViewElement(e,{defer:!0});return e.start}function Hs(e,t){const i=t.mapper.toViewElement(e);return i&&qs(t.writer.createRangeOn(i),t)}function Ws(e,t,i,o,n){const s=t?e.start:e.end,r=s.nodeAfter&&s.nodeAfter.is("element")?s.nodeAfter:null,a=s.nodeBefore&&s.nodeBefore.is("element")?s.nodeBefore:null;if(r||a){let e,s;t&&r||!t&&!a?(e=r,s=!0):(e=a,s=!1);const l=i.mapper.toViewElement(e);if(l)return void function(e,t,i,o,n,s){const r=`data-${s.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(s.name),o.writer.setAttribute(r,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}(l,t,s,i,o,n)}!function(e,t,i,o,n){const s=`${n.group}-${t?"start":"end"}`,r=n.name?{name:n.name}:null,a=i.writer.createUIElement(s,r);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(s),t,i,o,n)}function Us(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?Qt(e.attributes):[],children:!!e.children}}function Ks(e,t){return"function"==typeof e?e:(i,o)=>function(e,t,i){"string"==typeof e&&(e={name:e});let o;const n=t.writer,s=Object.assign({},e.attributes);if("container"==i)o=n.createContainerElement(e.name,s);else if("attribute"==i){const t={priority:e.priority||Wo.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,s,t)}else o=n.createUIElement(e.name,s);if(e.styles){const t=Object.keys(e.styles);for(const i of t)n.setStyle(i,e.styles[i],o)}if(e.classes){const t=e.classes;if("string"==typeof t)n.addClass(t,o);else for(const e of t)n.addClass(e,o)}return o}(e,o,t)}function Gs(e){return e.model.values?(t,i,o)=>{const n=e.view[t];return n?n(t,i,o):null}:e.view}function Js(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function Zs(e,t,i){const o="function"==typeof e?e(t,i):{...e};return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function Qs(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const o=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const n="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(n&&t(n,e)&&"reinsert"!=e.type){if("insert"==e.type&&"rename"==e.action&&i.refreshedItems.add(e.position.nodeAfter),!i.reconvertedElements.has(n)){i.reconvertedElements.add(n);const e=ss._createBefore(n);let t=o.length;for(let i=o.length-1;i>=0;i--){const n=o[i],s=("attribute"==n.type?n.range.start:n.position).compareWith(e);if("before"==s||"remove"==n.type&&"same"==s)break;t=i}o.splice(t,0,{type:"reinsert",name:n.name,position:e,length:1})}}else o.push(e)}i.changes=o}}function Ys(e){return(t,i,o={})=>{const n=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>i.test(t,e)))&&(o.preflight||n.forEach((e=>i.consume(t,e))),!0)}}function Xs(e,t,i,o){for(const n of t)er(e.root,n,i,o)||i.convertItem(n)}function er(e,t,i,o){const{writer:n,mapper:s}=i;if(!o.reconversion)return!1;const r=s.toViewElement(t);return!(!r||r.root==e)&&(!!i.canReuseView(r)&&(n.move(n.createRangeOn(r),s.toViewPosition(ss._createBefore(t))),!0))}function tr(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function ir(e){const{schema:t,document:i}=e.model;for(const o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function or(e,t,i){const o=i.createContext(e);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),t)}function nr(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class sr extends Ns{elementToElement(e){return this.add(rr(e))}elementToAttribute(e){return this.add(function(e){e=j(e),cr(e);const t=dr(e,!1),i=ar(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=j(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let o;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";o={[e]:i}}else o={attributes:{[t]:i}};e.view.name&&(o.name=e.view.name);return e.view=o,t}(e));cr(e,t);const i=dr(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(e.model);return rr({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=j(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=lr(ur(t,"start")),o=lr(ur(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});const s=ge.low,r=ge.highest,a=ge.get(e.converterPriority)/r;n.on("element",function(e){return(t,i,o)=>{const n=`data-${e.view}`;function s(t,n){for(const s of n){const n=e.model(s,o),r=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(r,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(o.consumable.test(i.viewItem,{attributes:n+"-end-after"})||o.consumable.test(i.viewItem,{attributes:n+"-start-after"})||o.consumable.test(i.viewItem,{attributes:n+"-end-before"})||o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))&&(i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(",")))}}(t),{priority:s+a})}}(e))}}function rr(e){const t=lr(e=j(e)),i=ar(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"normal"})}}function ar(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function lr(e){const t=new uo(e.view);return(i,o,n)=>{const s=t.match(o.viewItem);if(!s)return;const r=s.match;if(r.name=!0,!n.consumable.test(o.viewItem,r))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,r),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function cr(e,t=null){const i=null===t||(e=>e.getAttribute(t)),o="object"!=typeof e.model?e.model:e.model.key,n="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:o,value:n}}function dr(e,t){const i=new uo(e.view);return(o,n,s)=>{if(!n.modelRange&&t)return;const r=i.match(n.viewItem);if(!r)return;if(!function(e,t){const i="function"==typeof e?e(t):e;if("object"==typeof i&&!ar(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(e.view,n.viewItem)?delete r.match.name:r.match.name=!0,!s.consumable.test(n.viewItem,r.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(n.viewItem,s,n):e.model.value;if(null==l)return;n.modelRange||Object.assign(n,s.convertChildren(n.viewItem,n.modelCursor));const c=function(e,t,i,o){let n=!1;for(const s of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(s,t.key)&&(n=!0,s.hasAttribute(t.key)||o.writer.setAttribute(t.key,t.value,s));return n}(n.modelRange,{key:a,value:l},t,s);c&&(s.consumable.test(n.viewItem,{name:!0})&&(r.match.name=!0),s.consumable.consume(n.viewItem,r.match))}}function ur(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const o=t.getAttribute("name"),n=e.model(o,i);return i.writer.createElement("$marker",{"data-name":n})}}}class hr extends(Be()){model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new es(t),this.mapper=new hs,this.downcastDispatcher=new fs({mapper:this.mapper,schema:e.schema});const i=this.model.document,o=i.selection,n=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(i.differ,n,e),this.downcastDispatcher.convertSelection(o,n,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,o)=>{const n=o.newSelection,s=[];for(const e of n.getRanges())s.push(t.toModelRange(e));const r=e.createSelection(s,{backward:n.isBackward});r.isEqual(e.document.selection)||e.change((e=>{e.setSelection(r)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,i)=>{if(t.reconversion)return;const o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),s=i.mapper.toViewPosition(n,{isPhantom:!0});qs(i.writer.createRange(o,s).getTrimmed(),i)}),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",((e,t,i)=>{const o=i.writer,n=o.document.selection;for(const e of n.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);o.setSelection(null)})),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const e of o.getRanges())n.push(i.mapper.toViewRange(e));i.writer.setSelection(n,{backward:o.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,s=o.getFirstPosition(),r=i.mapper.toViewPosition(s),a=n.breakAttributes(r);n.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new To(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,i=this.model.markers.get(t);if(!i)throw new fe("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(i)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class mr extends(Be()){_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new gr(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new gr(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new fe("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new fe("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(e,t)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i)return!1;const o=this._evaluateAttributeChecks(e,t);return void 0!==o?o:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof ss){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof Ms))throw new fe("schema-check-merge-no-element-before",this);if(!(i instanceof Ms))throw new fe("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}if(this.isLimit(e)||this.isLimit(t))return!1;for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customChildChecks.get(i)||[];o.push(e),this._customChildChecks.set(i,o)}addAttributeCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customAttributeChecks.get(i)||[];o.push(e),this._customAttributeChecks.set(i,o)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;if(e instanceof ss)t=e.parent;else{t=(e instanceof us?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i}),null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new Is("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t,i={}){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const o of e)yield*this._getValidRangesForRange(o,t,i)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new us(e);let i,o;const n=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(i=new os({boundaries:us._createIn(n),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new os({boundaries:us._createIn(n),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,o)){const t=e.walker==i?"elementEnd":"elementStart",o=e.value;if(o.type==t&&this.isObject(o.item))return us._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new us(o.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const o=i.model;for(const[n,s]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,s,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))Tr(this,i,t);else{const e=us._createIn(i).getPositions();for(const i of e){Tr(this,i.nodeBefore||i.parent,t)}}}getAttributesWithProperty(e,t,i){const o={};for(const[n,s]of e.getAttributes()){const e=this.getAttributeProperties(n);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(o[n]=s))}return o}createContext(e){return new gr(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const o of i)e[o]=pr(t[o],o);const o=Object.values(e);for(const t of o)fr(e,t),br(e,t),wr(e,t),yr(e,t);for(const t of o)_r(e,t);for(const t of o)kr(e,t);for(const t of o)vr(e,t);for(const t of o)Cr(e,t);for(const t of o)Ar(e,t);this._compiledDefinitions=function(e){const t={};for(const i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter((t=>!!e[t])),allowChildren:Array.from(i.allowChildren).filter((t=>!!e[t])),allowAttributes:Array.from(i.allowAttributes)};return t}(e)}_checkContextMatch(e,t){const i=e.last;let o=this._evaluateChildChecks(e,t);if(o=void 0!==o?o:t.allowIn.includes(i.name),!o)return!1;const n=this.getDefinition(i),s=e.trimLast();return!!n&&(0==s.length||this._checkContextMatch(s,n))}_evaluateChildChecks(e,t){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],o=this._customChildChecks.get(t.name)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}_evaluateAttributeChecks(e,t){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],o=this._customAttributeChecks.get(t)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}*_getValidRangesForRange(e,t,i){let o=e.start,n=e.start;for(const s of e.getItems({shallow:!0})){if(s.is("element"))if(i.includeEmptyRanges&&s.isEmpty){const e=this.createContext(s);this.checkChild(e,"$text")&&this.checkAttribute(e.push("$text"),t)&&(yield us._createIn(s))}else yield*this._getValidRangesForRange(us._createIn(s),t,i);this.checkAttribute(s,t)||(o.isEqual(n)||(yield new us(o,n)),o=ss._createAfter(s)),n=ss._createAfter(s)}o.isEqual(n)||(yield new us(o,n))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new us(ss._createAt(i,t)):us._createOn(i);const o=ti(e.getSelectedBlocks());if(!o)return new us(e.focus);if(o.isEmpty)return new us(ss._createAt(o,0));const n=ss._createAfter(o);return e.focus.isTouching(n)?new us(n):new us(ss._createBefore(o))}}class gr{_items;constructor(e){if(e instanceof gr)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Er)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new gr([e]);return t._items=[...this._items,...t._items],t}trimLast(){const e=new gr([]);return e._items=this._items.slice(0,-1),e}getItem(e){return this._items[e]}*getNames(){yield*this._items.map((e=>e.name))}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function pr(e,t){const i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return function(e,t){for(const i of e){const e=Object.keys(i).filter((e=>e.startsWith("is")));for(const o of e)t[o]=!!i[o]}}(e,i),xr(e,i,"allowIn"),xr(e,i,"allowChildren"),xr(e,i,"disallowIn"),xr(e,i,"disallowChildren"),xr(e,i,"allowContentOf"),xr(e,i,"allowWhere"),xr(e,i,"allowAttributes"),xr(e,i,"disallowAttributes"),xr(e,i,"allowAttributesOf"),xr(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.add(e),t.allowWhere.add(e),t.allowAttributesOf.add(e),t.inheritTypesFrom.add(e))}}(e,i),i}function fr(e,t){for(const i of t.allowIn){const o=e[i];o?o.allowChildren.add(t.name):t.allowIn.delete(i)}}function br(e,t){for(const i of t.allowChildren){const o=e[i];o?o.allowIn.add(t.name):t.allowChildren.delete(i)}}function wr(e,t){for(const i of t.disallowIn){const o=e[i];o?o.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function yr(e,t){for(const i of t.disallowChildren){const o=e[i];o?o.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function _r(e,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function kr(e,t){for(const i of t.allowContentOf){const o=e[i];o&&(o.disallowChildren.forEach((i=>{t.allowChildren.has(i)||(t.disallowChildren.add(i),e[i].disallowIn.add(t.name))})),o.allowChildren.forEach((i=>{t.disallowChildren.has(i)||(t.allowChildren.add(i),e[i].allowIn.add(t.name))})))}}function vr(e,t){for(const i of t.allowWhere){const o=e[i];o&&(o.disallowIn.forEach((i=>{t.allowIn.has(i)||(t.disallowIn.add(i),e[i].disallowChildren.add(t.name))})),o.allowIn.forEach((i=>{t.disallowIn.has(i)||(t.allowIn.add(i),e[i].allowChildren.add(t.name))})))}}function Cr(e,t){for(const i of t.allowAttributesOf){const o=e[i];if(!o)return;o.allowAttributes.forEach((e=>{t.disallowAttributes.has(e)||t.allowAttributes.add(e)}))}}function Ar(e,t){for(const i of t.inheritTypesFrom){const o=e[i];if(o){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const i of e)i in t||(t[i]=o[i])}}}function xr(e,t,i){for(const o of e){let e=o[i];"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach((e=>t[i].add(e)))}}function Er(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Tr(e,t,i){for(const o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}class Pr extends(xe()){conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const o of new gr(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const n=t.createElement(o.name,e);i&&t.insert(n,i),i=ss._createAt(n,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=ro.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();const e=this._modelCursor.parent,i=e._removeChildren(0,e.childCount);n._insertChild(0,i),n.markers=function(e,t){const i=new Set,o=new Map,n=us._createIn(e).getItems();for(const e of n)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),n=t.createPositionBefore(e);o.has(i)?o.get(i).end=n.clone():o.set(i,new us(n.clone())),t.remove(e)}return o}(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof us))throw new fe("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:ss._createAt(t,0);const o=new us(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof us&&(o.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(e);t.modelCursor=n?o.createPositionAt(n,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return or(t,e,i)?{position:nr(t,o)}:null;const s=this.conversionApi.writer.split(t,n),r=[];for(const e of s.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),i=e.item;this._registerSplitPair(t,i)}const a=s.range.end.parent;return this._cursorParents.set(e,a),{position:s.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){const e=new Map;for(const t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){const i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(const[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}}class Sr{getHtml(e){const t=J.document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class Ir{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new Rn(e,{renderingMode:"data"}),this.htmlWriter=new Sr}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class Rr extends(xe()){model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new hs,this.downcastDispatcher=new fs({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Pr({schema:e.schema}),this.viewDocument=new Ho(t),this.stylesProcessor=t,this.htmlProcessor=new Ir(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new on(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:i,consumable:o,writer:n})=>{let s=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(s,"$text")){if(!or(s,"$text",i))return;if(0==t.viewItem.data.trim().length)return;s=nr(s,n)}o.consume(t.viewItem);const r=n.createText(t.viewItem.data);n.insert(r,s),t.modelRange=n.createRange(s,s.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),Be().prototype.decorate.call(this,"init"),Be().prototype.decorate.call(this,"set"),Be().prototype.decorate.call(this,"get"),Be().prototype.decorate.call(this,"toView"),Be().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},ir)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new fe("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(t);return o.isAttached()||be("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=us._createIn(e),s=new tn(i);this.mapper.bindElements(e,s);const r=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const o=us._createIn(e);for(const e of i.model.markers){const i=e.getRange(),n=i.isCollapsed,s=i.start.isEqual(o.start)||i.end.isEqual(o.end);if(n&&s)t.push([e.name,i]);else{const n=o.getIntersection(i);n&&t.push([e.name,n])}}return t.sort((([e,t],[i,o])=>{if("after"!==t.end.compareWith(o.start))return 1;if("before"!==t.start.compareWith(o.end))return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(n,r,o,t),s}init(e){if(this.model.document.version)throw new fe("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new fe("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const i of Object.keys(t)){const o=this.model.document.getRoot(i);e.insert(this.parse(t[i],o),o,0)}})),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new fe("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(i)){const o=this.model.document.getRoot(t);e.remove(e.createRangeIn(o)),e.insert(this.parse(i[t],o),o,0)}}))}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change((i=>this.upcastDispatcher.convert(e,i,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class Or{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=Qt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Qt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new fe("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new fe("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new fe("conversion-group-exists",this);const o=i?new Bs(t):new sr(t);this._helpers.set(e,o)}}function*Vr(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},o=e.view[t],n=e.upcastAlso?e.upcastAlso[t]:void 0;yield*Dr(i,o,n)}else yield*Dr(e.model,e.view,e.upcastAlso)}function*Dr(e,t,i){if(yield{model:e,view:t},i)for(const t of Qt(i))yield{model:e,view:t}}class Fr{baseVersion;isDocumentOperation;batch;constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function Mr(e,t){const i=Lr(t),o=i.reduce(((e,t)=>e+t.offsetSize),0),n=e.parent;jr(e);const s=e.index;return n._insertChild(s,i),zr(n,s+i.length),zr(n,s),new us(e,e.getShiftedBy(o))}function Nr(e){if(!e.isFlat)throw new fe("operation-utils-remove-range-not-flat",this);const t=e.start.parent;jr(e.start),jr(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return zr(t,e.start.index),i}function Br(e,t){if(!e.isFlat)throw new fe("operation-utils-move-range-not-flat",this);const i=Nr(e);return Mr(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function Lr(e){const t=[];!function e(i){if("string"==typeof i)t.push(new Is(i));else if(i instanceof is)t.push(new Is(i.data,i.getAttributes()));else if(i instanceof ys)t.push(i);else if(Ue(i))for(const t of i)e(t)}(e);for(let e=1;ee.maxOffset)throw new fe("move-operation-nodes-do-not-exist",this);if(e===t&&i=i&&this.targetPosition.path[e]e._clone(!0)))),t=new Hr(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new ss(e,[0]);return new qr(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),Mr(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes)t.name?i.push(Ms.fromJSON(t)):i.push(Is.fromJSON(t));const o=new Hr(ss.fromJSON(e.position,t),i,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class Wr extends Fr{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(e,t,i,o,n){super(n),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=o?o.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new ss(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new us(this.splitPosition,e)}get affectedSelectable(){const e=[us._createFromPositionAndShift(this.splitPosition,0),us._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(us._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new Wr(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new ss(e,[0]);return new Ur(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset1&&e.sourcePosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(t.deletionPosition)&&this._setRelation(e,t,"lastToMoveMerged"):t instanceof qr&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof Wr){if(t instanceof Ur)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof qr)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const o=i.end.offset-e.splitPosition.offset,n=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:o,offset:n})}}}else if(e instanceof Ur)t instanceof Ur?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof Wr?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof qr&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof Kr){const i=e.newRange;if(!i)return;if(t instanceof Ur){const o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),s=i.end.isEqual(t.deletionPosition),r=i.end.isEqual(t.sourcePosition);(o||n||s||r)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:s,wasInRightElement:r})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;const n=this.originalOperations.get(e),s=this._relations.get(n);return s&&s.get(o)||null}_setRelation(e,t,i){const o=this.originalOperations.get(e),n=this.originalOperations.get(t);let s=this._relations.get(o);s||(s=new Map,this._relations.set(o,s)),s.set(n,i)}}function aa(e,t){for(const i of e)i.baseVersion=t++}function la(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const o=e.range.getDifference(t.range).map((t=>new Gr(t,e.key,e.oldValue,e.newValue,0))),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new Gr(n,t.key,t.newValue,e.newValue,0)),0==o.length?[new Jr(0)]:o}return[e]})),ia(Gr,Hr,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const o=da(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),ia(Gr,Ur,((e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(us._createFromPositionAndShift(t.graveyardPosition,1));const o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),ia(Gr,qr,((e,t)=>{const i=function(e,t){const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];const s=[];for(let e of n){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),o=e.start.hasSameParentAs(i),n=e._getTransformedByInsertion(i,t.howMany,o);s.push(...n)}o&&s.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return s}(e.range,t);return i.map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),ia(Gr,Wr,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new us(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),ia(Hr,Gr,((e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=da(e,t.key,t.newValue);o&&i.push(o)}return i})),ia(Hr,Hr,((e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),ia(Hr,qr,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),ia(Hr,Wr,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),ia(Hr,Ur,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),ia(Kr,Hr,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),ia(Kr,Kr,((e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new Jr(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),ia(Kr,Ur,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),ia(Kr,qr,((e,t)=>{const i=[e];if(e.oldRange&&(e.oldRange=us._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){const o=e.newRange._getTransformedByMoveOperation(t);e.newRange=o[0];for(let t=1;t{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)?i.abRelation.wasStartBeforeMergedElement?e.newRange.start=ss._createAt(t.insertionPosition):i.abRelation.wasInLeftElement?e.newRange.start=ss._createAt(e.newRange.start):e.newRange.start=ss._createAt(t.moveTargetPosition):e.newRange.start=o.start,e.newRange.end.isEqual(t.splitPosition)?e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=ss._createAt(t.insertionPosition):i.abRelation.wasInRightElement?e.newRange.end=ss._createAt(t.moveTargetPosition):e.newRange.end=ss._createAt(e.newRange.end):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),ia(Ur,Hr,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),ia(Ur,Ur,((e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new ss(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new Jr(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==e.targetPosition.root.rootName,n="$graveyard"==t.targetPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),o=e.targetPosition._getTransformedByMergeOperation(t);return[new qr(i,e.howMany,o,0)]}return[new Jr(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),ia(Ur,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new Jr(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),ia(Ur,Wr,((e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){if(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),ia(qr,Hr,((e,t)=>{const i=us._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),ia(qr,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(e.sourcePosition,e.howMany),n=us._createFromPositionAndShift(t.sourcePosition,t.howMany);let s,r=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),s=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ua(e,t)&&ua(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ha([o],s);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),ha([o],s);const l=We(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ha([o],s);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(r=!1):r=!0;const c=[],d=o.getDifference(n);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==We(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);c.push(...o)}const u=o.getIntersection(n);return null!==u&&r&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new Jr(e.baseVersion)]:ha(c,s)})),ia(qr,Wr,((e,t,i)=>{let o=e.targetPosition.clone();if(e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t)),e.sourcePosition.isEqual(t.insertionPosition)&&"firstToMoveMerged"==i.abRelation)return e.howMany++,e.targetPosition=o,[e];const n=us._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return t.graveyardPosition&&"lastToMoveMerged"!=i.abRelation||e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let e=new us(t.splitPosition,n.end);e=e._getTransformedBySplitOperation(t);return ha([new us(n.start,t.splitPosition),e],o)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(o=e.targetPosition);const s=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&o&&!i.aWasUndone&&s.push(us._createFromPositionAndShift(t.insertionPosition,1))}return ha(s,o)})),ia(qr,Ur,((e,t,i)=>{const o=us._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Jr(0)]}else if(!i.aWasUndone){const i=[];let o=t.graveyardPosition.clone(),n=t.targetPosition._getTransformedByMergeOperation(t);const s=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(i.push(new qr(e.sourcePosition,e.howMany-1,s,0)),o=o._getTransformedByMove(e.sourcePosition,s,e.howMany-1),n=n._getTransformedByMove(e.sourcePosition,s,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,s),a=new qr(o,1,r,0),l=a.getMovedRangeStart().path.slice();l.push(0);const c=new ss(a.targetPosition.root,l);n=n._getTransformedByMove(o,r,1);const d=new qr(n,t.howMany,c,0);return i.push(a),i.push(d),i}const n=us._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),ia(Zr,Hr,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),ia(Zr,Ur,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),ia(Zr,qr,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),ia(Zr,Zr,((e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new Jr(0)];e.oldName=t.newName}return[e]})),ia(Zr,Wr,((e,t)=>{if("same"==We(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new Zr(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),ia(Qr,Qr,((e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong)return[new Jr(0)];e.oldValue=t.newValue}return[e]})),ia(Yr,Yr,((e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new Jr(0)]:[e])),ia(Wr,Hr,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const o=new ss(t.graveyardPosition.root,i),n=Wr.getInsertionPosition(new ss(t.graveyardPosition.root,i)),s=new Wr(o,0,n,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),e.graveyardPosition=s.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[s,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),ia(Wr,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&n){const i=e.splitPosition._getTransformedByMoveOperation(t),o=e.graveyardPosition._getTransformedByMoveOperation(t),n=o.path.slice();n.push(0);const s=new ss(o.root,n);return[new qr(i,e.howMany,s,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const n=e.splitPosition.isEqual(t.targetPosition);if(n&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:o}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(o),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Jr(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Jr(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o="$graveyard"==e.splitPosition.root.rootName,n="$graveyard"==t.splitPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new qr(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new qr(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new Jr(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const o=new ss(t.insertionPosition.root,i);return[e,new qr(e.insertionPosition,1,o,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const i=t[0];i.isDocumentOperation&&pa.call(this,i)}),{priority:"low"})}function pa(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}ma.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class fa{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},be("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:o=!1,isTyping:n=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=o,this.isTyping=n}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}}class ba{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(e){this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size&&0==this._changedRoots.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of o.getItems({shallow:!0}))this._setElementState(e,"move");break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=us._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._setElementState(t.position.nodeAfter,"rename");break}case"split":{const e=t.splitPosition.parent;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany);const i=us._createFromPositionAndShift(t.splitPosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&(this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1),this._setElementState(t.graveyardPosition.nodeAfter,"move"));break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1),this._setElementState(e,"move");const o=t.targetPosition.parent;if(!this._isInInsertedElement(o)){this._markInsert(o,t.targetPosition.offset,e.maxOffset);const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let o=this._changedMarkers.get(e);o?o.newMarkerData=i:(o={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,o)),null==o.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this.getChanges().length)return!0;if(this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const i=e.range&&!t.range,o=!e.range&&t.range,n=e.range&&t.range&&!e.range.isEqual(t.range);if(i||o||n)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(ka),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map((e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t}))}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e),this._setElementState(e,"refresh");const t=us._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,o){const n=this._changedRoots.get(e)||{name:e},s=n.attributes||{};if(s[t]){const e=s[t];o===e.oldValue?delete s[t]:e.newValue=o}else s[t]={oldValue:i,newValue:o};0===Object.entries(s).length?(delete n.attributes,void 0===n.state&&this._changedRoots.delete(e)):(n.attributes=s,this._changedRoots.set(e,n))}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;ei&&this._elementState.set(e,t)}_getDiffActionForNode(e,t){if(!e.is("element"))return t;if(!this._elementsSnapshots.has(e))return t;const i=this._elementState.get(e);return i&&"move"!=i?i:t}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const t=ya(e.getChildren());this._elementChildrenSnapshots.set(e,t);for(const e of t)this._elementsSnapshots.set(e.node,e)}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const i of t){const o=e.offset+e.howMany,n=i.offset+i.howMany;if("insert"==e.type&&("insert"==i.type&&(e.offset<=i.offset?i.offset+=e.howMany:e.offseti.offset){if(o>n){const e={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offsetn?(e.nodesToHandle=o-n,e.offset=n):e.nodesToHandle=0);if("remove"==i.type&&e.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,t),t.push(n),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&o<=n?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&o>=n&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i,o,n){const s={type:"insert",position:ss._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++,action:i};return"insert"!=i&&n&&(s.before={name:n.name,attributes:new Map(n.attributes)}),s}_getRemoveDiff(e,t,i,o){return{type:"remove",action:i,position:ss._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const o=[];i=new Map(i);for(const[n,s]of t){const t=i.has(n)?i.get(n):null;t!==s&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:n,attributeOldValue:s,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(n)}for(const[t,n]of i)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),o=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&o>=e.offset&&oo){for(let t=0;t1500)for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new fe("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const i=this._operations[0];void 0===e&&(e=i.baseVersion);let o=t-1;for(const[t,i]of this._gaps)e>t&&et&&othis.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);void 0===n&&(n=0);let s=this._baseVersionToOperationIndex.get(o);return void 0===s&&(s=this._operations.length-1),this._operations.slice(n,s+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Ca extends Ms{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Ca.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const Aa="$graveyard";class xa extends(xe()){model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new va,this.selection=new Os(this),this.roots=new ei({idProperty:"rootName"}),this.differ=new ba(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Aa),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,i,o,n)=>{const s={...t.getData(),range:o};this.differ.bufferMarkerChange(t.name,n,s),null===i&&t.on("change",((e,i)=>{const o=t.getData();this.differ.bufferMarkerChange(t.name,{...o,range:i},o)}))})),this.registerPostFixer((e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Aa)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new fe("model-document-createroot-name-exists",this,{name:t});const i=new Ca(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map((e=>e.rootName))}getRoots(e=!1){return this.roots.filter((t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ki(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Ea(e.start)&&Ea(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Ea(e){const t=e.textNode;if(t){const i=t.data,o=e.offset-t.startOffset;return!ui(i,o)&&!hi(i,o)}return!0}class Ta extends(xe()){_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Pa?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){const n=e instanceof Pa?e.name:e;if(n.includes(","))throw new fe("markercollection-incorrect-marker-name",this);const s=this._markers.get(n);if(s){const e=s.getData(),r=s.getRange();let a=!1;return r.isEqual(t)||(s._attachLiveRange(Ts.fromRange(t)),a=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,a=!0),"boolean"==typeof o&&o!=s.affectsData&&(s._affectsData=o,a=!0),a&&this.fire(`update:${n}`,s,r,t,e),s}const r=Ts.fromRange(t),a=new Pa(n,r,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Pa?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof Pa?e.name:e,i=this._markers.get(t);if(!i)throw new fe("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire(`update:${t}`,i,o,o,i.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Pa extends(xe(ts)){name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Pa.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Sa extends Fr{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new fe("detach-operation-on-document-node",this)}_execute(){Nr(us._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Ia extends ts{markers=new Map;_children=new Fs;constructor(e){super(),e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push(Ms.fromJSON(i)):t.push(Is.fromJSON(i));return new Ia(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Is(e)];Ue(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Is(e):e instanceof is?new Is(e.data,e.getAttributes()):e))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}}Ia.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Ra{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Is(e,t)}createElement(e,t){return new Ms(e,t)}createDocumentFragment(){return new Ia}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof Is&&""==e.data)return;const o=ss._createAt(t,i);if(e.parent){if(Ma(e.root,o.root))return void this.move(us._createOn(e),o);if(e.root.document)throw new fe("model-writer-insert-forbidden-move",this);this.remove(e)}const n=o.root.document?o.root.document.version:null,s=e instanceof Ia?e._removeChildren(0,e.childCount):e,r=new Hr(o,s,n);if(e instanceof Is&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof Ia)for(const[t,i]of e.markers){const e=ss._createAt(i.root,0),n={range:new us(i.start._getCombined(e,o),i.end._getCombined(e,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,n):this.addMarker(t,n)}}insertText(e,t,i,o){t instanceof Ia||t instanceof Ms||t instanceof ss?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof Ia||t instanceof Ms||t instanceof ss?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof Ia||t instanceof Ms?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof Ia||t instanceof Ms?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof us){const o=i.getMinimalFlatRanges();for(const i of o)Oa(this,e,t,i)}else Va(this,e,t,i)}setAttributes(e,t){for(const[i,o]of ai(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof us){const i=t.getMinimalFlatRanges();for(const t of i)Oa(this,e,null,t)}else Va(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof us)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof us))throw new fe("writer-move-invalid-range",this);if(!e.isFlat)throw new fe("writer-move-range-not-flat",this);const o=ss._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Ma(e.root,o.root))throw new fe("writer-move-different-document",this);const n=e.root.document?e.root.document.version:null,s=new qr(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof us?e:us._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Fa(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Ms))throw new fe("writer-merge-no-element-before",this);if(!(i instanceof Ms))throw new fe("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,i=e.nodeAfter;this.move(us._createIn(i),ss._createAt(t,"end")),this.remove(i)}_merge(e){const t=ss._createAt(e.nodeBefore,"end"),i=ss._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new ss(o,[0]),s=e.root.document.version,r=new Ur(i,e.nodeAfter.maxOffset,t,n,s);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Ms))throw new fe("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,o=new Zr(ss._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i,o,n=e.parent;if(!n.parent)throw new fe("writer-split-element-no-parent",this);if(t||(t=n.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new fe("writer-split-invalid-limit-element",this);do{const t=n.root.document?n.root.document.version:null,s=n.maxOffset-e.offset,r=Wr.getInsertionPosition(e),a=new Wr(e,s,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||o||(i=n,o=e.parent.nextSibling),n=(e=this.createPositionAfter(e.parent)).parent}while(n!==t);return{position:e,range:new us(ss._createAt(i,"end"),ss._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new fe("writer-wrap-range-not-flat",this);const i=t instanceof Ms?t:new Ms(t);if(i.childCount>0)throw new fe("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new fe("writer-wrap-element-attached",this);this.insert(i,e.start);const o=new us(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,ss._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new fe("writer-unwrap-element-no-parent",this);this.move(us._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new fe("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,o=t.range,n=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new fe("writer-addmarker-marker-exists",this);if(!o)throw new fe("writer-addmarker-no-range",this);return i?(Da(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,o=this.model.markers.get(i);if(!o)throw new fe("writer-updatemarker-marker-not-exists",this);if(!t)return be("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(o);const n="boolean"==typeof t.usingOperation,s="boolean"==typeof t.affectsData,r=s?t.affectsData:o.affectsData;if(!n&&!t.range&&!s)throw new fe("writer-updatemarker-wrong-options",this);const a=o.getRange(),l=t.range?t.range:a;n&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?Da(this,i,null,l,r):(Da(this,i,a,null,r),this.model.markers._set(i,l,void 0,r)):o.managedUsingOperations?Da(this,i,a,l,r):this.model.markers._set(i,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new fe("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);if(!i.managedUsingOperations)return void this.model.markers._remove(t);Da(this,t,i.getRange(),null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new fe("writer-addroot-root-exists",this);const o=this.model.document,n=new Yr(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new fe("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,o=new Yr(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,i]of ai(e))this._setSelectionAttribute(t,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=Os._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=Os._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new fe("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===e){const e=t;n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end)}else{const e=t,i=e.nodeBefore,s=e.nodeAfter,r=o.start.parent==i&&o.start.isAtEnd,a=o.end.parent==s&&0==o.end.offset,l=o.end.nodeAfter==s,c=o.start.nodeAfter==s;n=r||a||l||c}n&&this.updateMarker(i.name,{range:o})}}}function Oa(e,t,i,o){const n=e.model,s=n.document;let r,a,l,c=o.start;for(const e of o.getWalker({shallow:!0}))l=e.item.getAttribute(t),r&&a!=l&&(a!=i&&d(),c=r),r=e.nextPosition,a=l;function d(){const o=new us(c,r),l=o.root.document?s.version:null,d=new Gr(o,t,a,i,l);e.batch.addOperation(d),n.applyOperation(d)}r instanceof ss&&r!=c&&a!=i&&d()}function Va(e,t,i,o){const n=e.model,s=n.document,r=o.getAttribute(t);let a,l;if(r!=i){if(o.root===o){const e=o.document?s.version:null;l=new Qr(o,t,r,i,e)}else{a=new us(ss._createBefore(o),e.createPositionAfter(o));const n=a.root.document?s.version:null;l=new Gr(a,t,r,i,n)}e.batch.addOperation(l),n.applyOperation(l)}}function Da(e,t,i,o,n){const s=e.model,r=s.document,a=new Kr(t,i,o,s.markers,!!n,r.version);e.batch.addOperation(a),s.applyOperation(a)}function Fa(e,t,i,o){let n;if(e.root.document){const i=o.document,s=new ss(i.graveyard,[0]);n=new qr(e,t,s,i.version)}else n=new Sa(e,t);i.addOperation(n),o.applyOperation(n)}function Ma(e,t){return e===t||e instanceof Ca&&t instanceof Ca}function Na(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.selection,o=t.schema,n=[];let s=!1;for(const e of i.getRanges()){const t=Ba(e,o);t&&!t.isEqual(e)?(n.push(t),s=!0):n.push(e)}s&&e.setSelection(function(e){const t=[...e],i=new Set;let o=1;for(;o!i.has(t)))}(n),{backward:i.isBackward});return!1}(t,e)))}function Ba(e,t){return e.isCollapsed?function(e,t){const i=e.start,o=t.getNearestSelectionRange(i);if(!o){const e=i.getAncestors().reverse().find((e=>t.isObject(e)));return e?us._createOn(e):null}if(!o.isCollapsed)return o;const n=o.start;if(i.isEqual(n))return null;return new us(n)}(e,t):function(e,t){const{start:i,end:o}=e,n=t.checkChild(i,"$text"),s=t.checkChild(o,"$text"),r=t.getLimitElement(i),a=t.getLimitElement(o);if(r===a){if(n&&s)return null;if(function(e,t,i){const o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}(i,o,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),s=e?e.start:i,r=n?n.end:o;return new us(s,r)}}const l=r&&!r.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=l&&(!e||!za(i.nodeAfter,t)),s=c&&(!e||!za(o.nodeBefore,t));let d=i,u=o;return n&&(d=ss._createBefore(La(r,t))),s&&(u=ss._createAfter(La(a,t))),new us(d,u)}return null}(e,t)}function La(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function za(e,t){return e&&t.isSelectable(e)}function ja(e,t,i={}){if(t.isCollapsed)return;const o=t.getFirstRange();if("$graveyard"==o.root.rootName)return;const n=e.schema;e.change((e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const o=t.getFirstRange();if(o.start.parent==o.end.parent)return!1;return e.checkChild(i,"paragraph")}(n,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),Wa(e,e.createPositionAt(i,0),t)}(e,t);const s={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(s,n.getAttributesWithProperty(e,"copyOnReplace",!0))}let r,a;i.doNotFixSelection?(r=ma.fromPosition(o.start,"toPrevious"),a=ma.fromPosition(o.end,"toNext")):[r,a]=function(e){const t=e.root.document.model,i=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of o){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(o);if(i&&o.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const n=i.getLastPosition(),s=t.createRange(n,o);t.hasContent(s,{ignoreMarkers:!0})||(o=n)}}return[ma.fromPosition(i,"toPrevious"),ma.fromPosition(o,"toNext")]}(o),r.isTouching(a)||e.remove(e.createRange(r,a)),i.leaveUnmerged||(!function(e,t,i){const o=e.model;if(!Ha(e.model.schema,t,i))return;const[n,s]=function(e,t){const i=e.getAncestors(),o=t.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(t,i);if(!n||!s)return;!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(s,{ignoreMarkers:!0})?qa(e,t,i,n.parent):$a(e,t,i,n.parent)}(e,r,a),n.removeDisallowedAttributes(r.parent.getChildren(),e)),Ua(e,t,r),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}(n,r)&&Wa(e,r,t,s),r.detach(),a.detach()}))}function $a(e,t,i,o){const n=t.parent,s=i.parent;if(n!=o&&s!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(s,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}Ha(e.model.schema,t,i)&&$a(e,t,i,o)}}function qa(e,t,i,o){const n=t.parent,s=i.parent;if(n!=o&&s!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(n,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(s),function(e,t){const i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name);e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}(e,i),Ha(e.model.schema,t,i)&&qa(e,t,i,o)}}function Ha(e,t,i){const o=t.parent,n=i.parent;return o!=n&&(!e.isLimit(o)&&!e.isLimit(n)&&function(e,t,i){const o=new us(e,t);for(const e of o.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e))}function Wa(e,t,i,o={}){const n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),Ua(e,i,e.createPositionAt(n,0))}function Ua(e,t,i){t instanceof Os?e.setSelection(i):t.setTo(i)}function Ka(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{i.push(e.start.parent),t.remove(e)})),i.forEach((e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}}))}class Ga{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))t.offsetSize>0&&this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),!1!==this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){const t=Array.from(e);for(const e of t){if(!e.is("element"))continue;const i=[],o=[],n=this.writer.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(const{item:e}of n){const s=e.parent;this.schema.checkChild(s,e)||(e.is("element")&&!this.schema.isObject(e)?(o.push(e),t.push(s)):i.push(e),n.jumpTo(this.writer.createPositionAfter(e)))}for(const e of o)this.writer.unwrap(e);for(const e of i)this.writer.remove(e)}}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new fe("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?us._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new us(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this._checkAndSplitToAllowedPosition(e)?(e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this.schema.isObject(e)||this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=ma.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new fe("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=ma.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=ma.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Ms))return;if(!this._canMergeLeft(e))return;const t=ma._createBefore(e);t.stickiness="toNext";const i=ma.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=ma._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=ma._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Ms))return;if(!this._canMergeRight(e))return;const t=ma._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new fe("insertcontent-invalid-insertion-position",this);this.position=ss._createAt(t.nodeBefore,"end");const i=ma.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=ma._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=ma._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Ms&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Ms&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){const i=this.schema.createContext(e);return this.schema.checkChild(i,t)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function Ja(e,t,i,o={}){if(!e.schema.isObject(t))throw new fe("insertobject-element-not-an-object",e,{object:t});const n=i||e.document.selection;let s=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(s=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));const r=ti(n.getSelectedBlocks()),a={};return r&&Object.assign(a,e.schema.getAttributesWithProperty(r,"copyOnReplace",!0)),e.change((i=>{s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0});let n=t;const r=s.anchor.parent,l=e.schema.createContext(r);!e.schema.checkChild(l,t)&&e.schema.checkChild(l,"paragraph")&&e.schema.checkChild(l.push("paragraph"),t)&&(n=i.createElement("paragraph"),i.insert(t,n)),e.schema.setAllowedAttributes(n,a,i);const c=e.insertContent(n,s);return c.isCollapsed||o.setSelection&&function(e,t,i,o){const n=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new fe("insertobject-invalid-place-parameter-value",n);let s=t.nextSibling;if(n.schema.isInline(t))return void e.setSelection(t,"after");const r=s&&n.schema.checkChild(s,"$text");!r&&n.schema.checkChild(t.parent,"paragraph")&&(s=e.createElement("paragraph"),n.schema.setAllowedAttributes(s,o,e),n.insertContent(s,e.createPositionAfter(t)));s&&e.setSelection(s,0)}(i,t,o.setSelection,a),c}))}function Za(e,t){const{isForward:i,walker:o,unit:n,schema:s,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:c}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;i||(i=t?e.position.nodeAfter:e.position.nodeBefore);for(;i&&i.is("$text");){const o=e.position.offset-i.startOffset;if(Xa(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(Ya(i.data,o,t))break;e.next()}}return e.position}(o,i):function(e,t,i){const o=e.position.textNode;if(o){const n=o.data;let s=e.position.offset-o.startOffset;for(;ui(n,s)||"character"==t&&hi(n,s)||i&&gi(n,s);)e.next(),s=e.position.offset-o.startOffset}return e.position}(o,n,r);if(a==(i?"elementStart":"elementEnd")){if(s.isSelectable(l))return ss._createAt(l,i?"after":"before");if(s.checkChild(c,"$text"))return c}else{if(s.isLimit(l))return void o.skip((()=>!0));if(s.checkChild(c,"$text"))return c}}function Qa(e,t){const i=e.root,o=ss._createAt(i,t?"end":0);return t?new us(e,o):new us(o,e)}function Ya(e,t,i){const o=t+(i?0:-1);return' ,.?!:;"-()'.includes(e.charAt(o))}function Xa(e,t,i){return t===(i?e.offsetSize:0)}class el extends(Be()){markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new Ta,this.document=new xa(this),this.schema=new mr,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((()=>!0),"$marker"),Na(this),this.document.registerPostFixer(ir),this.on("insertContent",((e,[t,i])=>{e.return=function(e,t,i){return e.change((o=>{const n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const s=new Ga(e,o,n.anchor),r=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,o]of t.markers){const{start:t,end:n}=o,s=t.isEqual(n);e.push({position:t,name:i,isCollapsed:s},{position:n,name:i,isCollapsed:s})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:i,name:n,isCollapsed:s}of e){let e=null,a=null;const l=i.parent===t&&i.isAtStart,c=i.parent===t&&i.isAtEnd;l||c?s&&(a=l?"start":"end"):(e=o.createElement("$marker"),o.insert(e,i)),r.push({name:n,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];s.handleNodes(a);let l=s.getSelectionRange();if(t.is("documentFragment")&&r.length){const e=l?Ts.fromRange(l):null,t={};for(let e=r.length-1;e>=0;e--){const{name:i,element:n,collapsed:a}=r[e],l=!t[i];if(l&&(t[i]=[]),n){const e=o.createPositionAt(n,"before");t[i].push(e),o.remove(n)}else{const e=s.getAffectedRange();if(!e){a&&t[i].push(s.position);continue}a?t[i].push(e[a]):t[i].push(l?e.start:e.end)}}for(const[e,[i,n]]of Object.entries(t))i&&n&&i.root===n.root&&i.root.document&&!o.model.markers.has(e)&&o.addMarker(e,{usingOperation:!0,affectsData:!0,range:new us(i,n)});e&&(l=e.toRange(),e.detach())}l&&(n instanceof Os?o.setSelection(l):n.setTo(l));const c=s.getAffectedRange()||e.createRange(n.anchor);return s.destroy(),c}))}(this,t,i)})),this.on("insertObject",((e,[t,i,o])=>{e.return=Ja(this,t,i,o)})),this.on("canEditAt",(e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()}))}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new fa,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){fe.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new fa):e instanceof fa||(e=new fa(e)):e=new fa,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){fe.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){const n=tl(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){const s=tl(t,i);return this.fire("insertObject",[e,s,o,o,...n])}deleteContent(e,t){ja(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const o=e.schema,n="backward"!=i.direction,s=i.unit?i.unit:"character",r=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new os({boundaries:Qa(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:l,schema:o,isForward:n,unit:s,treatEmojiAsSingleUnit:r};let d;for(;d=l.next();){if(d.done)return;const i=Za(c,d.value);if(i)return void(t instanceof Os?e.change((e=>{e.setSelectionFocus(i)})):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const i=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,s=o.start.getCommonPath(o.end),r=n.getNodeByPath(s);let a;a=o.start.parent==o.end.parent?o:e.createRange(e.createPositionAt(r,o.start.path[s.length]),e.createPositionAt(r,o.end.path[s.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(i,0),l)[0],n=e.createRange(e.createPositionAt(i,0),t.start);Ka(e.createRange(t.end,e.createPositionAt(i,"end")),e),Ka(n,e)}return i}))}(this,e)}hasContent(e,t={}){let i;i=e.is("selection")?Array.from(e.getRanges()):e.is("range")?[e]:[us._createIn(e)];for(const e of i)if(this._rangeHasContent(e,t))return!0;return!1}_rangeHasContent(e,t){if(e.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o)for(const t of this.markers.getMarkersIntersectingRange(e))if(t.affectsData)return!0;for(const t of e.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!i)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}canEditAt(e){const t=tl(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new ss(e,t,i)}createPositionAt(e,t){return ss._createAt(e,t)}createPositionAfter(e){return ss._createAfter(e)}createPositionBefore(e){return ss._createBefore(e)}createRange(e,t){return new us(e,t)}createRangeIn(e){return us._createIn(e)}createRangeOn(e){return us._createOn(e)}createSelection(...e){return new _s(...e)}createBatch(e){return new fa(e)}createOperationFromJSON(e){return ea.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Ra(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function tl(e,t){if(e)return e instanceof _s||e instanceof Os?e:e instanceof ys?t||0===t?new _s(e,t):e.is("rootElement")?new _s(e,"in"):new _s(e,"on"):new _s(e)}class il extends jn{domEventType="click";onDomEvent(e){this.fire(e.type,e)}}class ol extends jn{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}}class nl extends jn{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}}class sl extends jn{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}}class rl{document;constructor(e){this.document=e}createDocumentFragment(e){return new tn(this.document,e)}createElement(e,t,i){return new _o(this.document,e,t,i)}createText(e){return new no(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new _o(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){a(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}}const al=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ll=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,cl=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,dl=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,ul=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,hl=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,ml=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function gl(e){return e.startsWith("#")?al.test(e):e.startsWith("rgb")?ll.test(e)||cl.test(e):e.startsWith("hsl")?dl.test(e)||ul.test(e):ml.has(e.toLowerCase())}const pl=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function fl(e){return pl.includes(e)}const bl=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function wl(e){return bl.test(e)}const yl=/^[+-]?[0-9]*([.][0-9]+)?%$/;function _l(e){return yl.test(e)}const kl=["auto","cover","contain"];const vl=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const Cl=["center","top","bottom","left","right"];function Al(e){return Cl.includes(e)}const xl=["fixed","scroll","local"];function El(e){return xl.includes(e)}const Tl=["border-box","padding-box","content-box"];function Pl(e){return Tl.includes(e)}const Sl=["border-box","padding-box","content-box","text"];function Il(e){return Sl.includes(e)}function Rl(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Fl(e),i=t[0],o=t[2]||i,n=t[1]||i;return{top:i,bottom:o,right:n,left:t[3]||n}}function Ol(e){return t=>{const{top:i,right:o,bottom:n,left:s}=t,r=[];return[i,o,s,n].every((e=>!!e))?r.push([e,Vl(t)]):(i&&r.push([e+"-top",i]),o&&r.push([e+"-right",o]),n&&r.push([e+"-bottom",n]),s&&r.push([e+"-left",s])),r}}function Vl({top:e,right:t,bottom:i,left:o}){const n=[];return o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e),n.join(" ")}function Dl(e){return t=>({path:e,value:Rl(t)})}function Fl(e){const t=e.trim().slice(0,1500).matchAll(hl);return Array.from(t).map((e=>e[0]))}const Ml={image:"none",repeat:"repeat",position:"0% 0%",size:"auto",origin:"padding-box",clip:"border-box",attachment:"scroll"},Nl=["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient","conic-gradient","repeating-conic-gradient","url"];function Bl(e){e.setNormalizer("background-color",(e=>({path:"background.color",value:e})));for(const t in Ml)e.setNormalizer(`background-${t}`,Ll(`background.${t}`)),e.setReducer(`background-${t}`,zl(`background-${t}`));e.setNormalizer("background",(e=>{const t=function(e){return ql(e).map(jl).filter((e=>null!==e))}(e);t.length||t.push({...$l(),color:e});const i=function(e){const t={image:[],position:[],size:[],repeat:[],attachment:[],origin:[],clip:[]};for(const i of e)t.position.push(i.position.join(" ")),t.size.push(i.size.join(" ")),t.repeat.push(i.repeat.join(" ")),t.image.push(i.image),t.attachment.push(i.attachment),t.origin.push(i.origin),t.clip.push(i.clip);return e.at(-1)?.color&&(t.color=e.at(-1).color),t}(t);return{path:"background",value:i}})),e.setReducer("background",(e=>{const t=e,i=Object.keys(Ml).every((e=>{const i=t[e];return void 0!==i&&(!Array.isArray(i)||i.length>0)}));return i?function(e){const t=[],i=function(e){const t=function(e){let t=0;for(const i of Object.values(e))Array.isArray(i)&&i.length>t&&(t=i.length);return t}(e),i=Array.from({length:t},((t,i)=>{const o=$l();return e.image?.[i]&&(o.image=e.image[i]),e.position?.[i]&&(o.position=e.position[i].split(" ")),e.size?.[i]&&(o.size=e.size[i].split(" ")),e.repeat?.[i]&&(o.repeat=e.repeat[i].split(" ")),e.attachment?.[i]&&(o.attachment=e.attachment[i]),e.origin?.[i]&&(o.origin=e.origin[i]),e.clip?.[i]&&(o.clip=e.clip[i]),o}));return e.color&&(i.at(-1).color=e.color),i}(e).map((e=>function(e){const t=[];e.image&&e.image!==Ml.image&&t.push(e.image);const i=e.position.join(" "),o=!i||i===Ml.position;o||t.push(i);const n=e.size.join(" ");n&&n!==Ml.size&&(o&&t.push("0% 0%"),t.push("/",n));const s=e.repeat.join(" ");s&&s!==Ml.repeat&&t.push(s),e.attachment&&e.attachment!==Ml.attachment&&t.push(e.attachment);const r=e.origin===Ml.origin,a=e.clip===Ml.clip;return r&&a||(t.push(e.origin),e.clip!==e.origin&&t.push(e.clip)),e.color&&t.push(e.color),t.join(" ")}(e).trim())).filter(Boolean).join(", ");return i&&t.push(["background",i]),t}(t):function(e){const t=[];for(const i in Ml){const o=e[i];Array.isArray(o)&&t.push([`background-${i}`,o.join(", ")])}return void 0!==e.color&&t.push(["background-color",e.color]),t}(t)})),e.setStyleRelation("background",["background-color","background-image","background-repeat","background-position","background-size","background-attachment","background-origin","background-clip"])}function Ll(e){return t=>({path:e,value:ql(t)})}function zl(e){return t=>{const i=t.join(", ");return[[e,i]]}}function jl(e){const t={},{value:i,image:o}=function(e){for(const t of Nl){const i=t+"(",o=e.indexOf(i);if(o<0)continue;let n=t,s=0;for(let i=o+t.length;i"constructor"!==e)).length:0===t.length}return!0}(t)?null:{...$l(),...t}}function $l(){return{attachment:Ml.attachment,image:Ml.image,origin:Ml.origin,clip:Ml.clip,position:Ml.position.split(" "),repeat:Ml.repeat.split(" "),size:Ml.size.split(" ")}}function ql(e){const t=[];let i="",o=0;for(const n of e){if("("===n)o++;else if(")"===n)o--;else if(","===n&&0===o){t.push(i.trim()),i="";continue}i+=n}return i.trim()&&t.push(i.trim()),t}function Hl(e){e.setNormalizer("border",(e=>{const{color:t,style:i,width:o}=Ql(e);return{path:"border",value:{color:Rl(t),style:Rl(i),width:Rl(o)}}})),e.setNormalizer("border-top",Wl("top")),e.setNormalizer("border-right",Wl("right")),e.setNormalizer("border-bottom",Wl("bottom")),e.setNormalizer("border-left",Wl("left")),e.setNormalizer("border-color",Ul("color")),e.setNormalizer("border-width",Ul("width")),e.setNormalizer("border-style",Ul("style")),e.setNormalizer("border-top-color",Gl("color","top")),e.setNormalizer("border-top-style",Gl("style","top")),e.setNormalizer("border-top-width",Gl("width","top")),e.setNormalizer("border-right-color",Gl("color","right")),e.setNormalizer("border-right-style",Gl("style","right")),e.setNormalizer("border-right-width",Gl("width","right")),e.setNormalizer("border-bottom-color",Gl("color","bottom")),e.setNormalizer("border-bottom-style",Gl("style","bottom")),e.setNormalizer("border-bottom-width",Gl("width","bottom")),e.setNormalizer("border-left-color",Gl("color","left")),e.setNormalizer("border-left-style",Gl("style","left")),e.setNormalizer("border-left-width",Gl("width","left")),e.setExtractor("border-top",Jl("top")),e.setExtractor("border-right",Jl("right")),e.setExtractor("border-bottom",Jl("bottom")),e.setExtractor("border-left",Jl("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Ol("border-color")),e.setReducer("border-style",Ol("border-style")),e.setReducer("border-width",Ol("border-width")),e.setReducer("border-top",Yl("top")),e.setReducer("border-right",Yl("right")),e.setReducer("border-bottom",Yl("bottom")),e.setReducer("border-left",Yl("left")),e.setReducer("border",function(){return t=>{const i=Zl(t,"top"),o=Zl(t,"right"),n=Zl(t,"bottom"),s=Zl(t,"left"),r=[i,o,n,s],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},l=Xl(a,"all");if(l.length)return l;const c=Object.entries(a).reduce(((e,[t,i])=>(i&&(e.push([`border-${t}`,i]),r.forEach((e=>delete e[t]))),e)),[]);return[...c,...Xl(i,"top"),...Xl(o,"right"),...Xl(n,"bottom"),...Xl(s,"left")]};function e(e,t){return e.map((e=>e[t])).reduce(((e,t)=>e==t?e:null))}}()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function Wl(e){return t=>{const{color:i,style:o,width:n}=Ql(t),s={};return void 0!==i&&(s.color={[e]:i}),void 0!==o&&(s.style={[e]:o}),void 0!==n&&(s.width={[e]:n}),{path:"border",value:s}}}function Ul(e){return t=>({path:"border",value:Kl(t,e)})}function Kl(e,t){return{[t]:Rl(e)}}function Gl(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function Jl(e){return(t,i)=>{if(i.border)return Zl(i.border,e)}}function Zl(e,t){const i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function Ql(e){const t={},i=Fl(e);for(const e of i)wl(e)||/thin|medium|thick/.test(e)?t.width=e:fl(e)?t.style=e:t.color=e;return t}function Yl(e){return t=>Xl(t,e)}function Xl(e,t){const i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),3==i.length){const o=i.map((t=>e[t])).join(" ");return["all"==t?["border",o]:[`border-${t}`,o]]}return"all"==t?[]:i.map((i=>[`border-${t}-${i}`,e[i]]))}function ec(e){e.setNormalizer("margin",Dl("margin")),e.setNormalizer("margin-top",(e=>({path:"margin.top",value:e}))),e.setNormalizer("margin-right",(e=>({path:"margin.right",value:e}))),e.setNormalizer("margin-bottom",(e=>({path:"margin.bottom",value:e}))),e.setNormalizer("margin-left",(e=>({path:"margin.left",value:e}))),e.setReducer("margin",Ol("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function tc(e){e.setNormalizer("padding",Dl("padding")),e.setNormalizer("padding-top",(e=>({path:"padding.top",value:e}))),e.setNormalizer("padding-right",(e=>({path:"padding.right",value:e}))),e.setNormalizer("padding-bottom",(e=>({path:"padding.bottom",value:e}))),e.setNormalizer("padding-left",(e=>({path:"padding.left",value:e}))),e.setReducer("padding",Ol("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}Symbol("_treeDump");function ic(e,t=0,i={}){const{leading:o=!0,trailing:n=!0}=i;return Li(e,t,{leading:o,maxWait:t,trailing:n})}class oc{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(e){if(this.crashes=[],this._crashNumberLimit="number"==typeof e.crashNumberLimit?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod="number"==typeof e.minimumNonErrorTimePeriod?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter((e=>e!==t))}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;return(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function nc(e,t=new Set){const i=[e],o=new Set;let n=0;for(;i.length>n;){const e=i[n++];if(!o.has(e)&&sc(e)&&!t.has(e))if(o.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch{}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return o}function sc(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function rc(e,t,i=new Set){if(e===t&&("object"==typeof(o=e)&&null!==o))return!0;var o;const n=nc(e,i),s=nc(t,i);for(const e of n)if(s.has(e))return!0;return!1}function ac(e,t,i){const o=t.root,n=t.roots||Object.create(null);i&&!n[i]&&(n[i]=o||Object.create(null));const s=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&(t=e,!L(t));var t}(e),r=function(e,t,i){return t||!i?e.initialData||Object.create(null):{[i]:e.initialData}}(t,s,i),a=Array.from(new Set([...s?Object.keys(e):[],...Object.keys(n),...Object.keys(r)]));for(const e of a){const i=n[e]||Object.create(null);i.initialData="",i.placeholder??=lc(t,"placeholder",e),i.label??=lc(t,"label",e),n[e]=i}t.roots=n}function lc(e,t,i){const o=e[t];if(o)return"string"==typeof o?o:o[i]}class cc extends oc{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_editorAttachTo=null;_isSingleRootEditor=!0;_isUsingConfigBasedCreator=!1;_editables={};_config;_excludedProps;constructor(e,t={}){super(t),this._throttledSave=ic(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>void 0===i?e.create(t):e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then((()=>(this.state="initializing",this._fire("stateChange"),this._destroy()))).catch((e=>{console.error("An error happened during the editor destroying.",e)})).then((()=>{this._isUsingConfigBasedCreator?ac(this._isSingleRootEditor?"":{},this._config,!!this._isSingleRootEditor&&"main"):ac(this._isSingleRootEditor?this._editorAttachTo||"":this._editables,this._config,!!this._isSingleRootEditor&&"main");const e={...this._config,extraPlugins:this._config.extraPlugins||[],_watchdogInitialData:this._data};e.extraPlugins.push(dc);const t={};for(const[i,o]of Object.entries(this._data.roots)){const n=e.roots[i]||Object.create(null);n.initialData="",o.isLoaded?n.lazyLoad=!1:delete n.modelAttributes,t[i]=n}if(e.roots=t,delete e.initialData,delete e.root,this._isUsingConfigBasedCreator)return this.create(e,e.context);const i=this._isSingleRootEditor?this._editorAttachTo||"":this._editables;return this.create(i,e,e.context)})).then((()=>{this._fire("restart")}))}create(e=(this._isUsingConfigBasedCreator?this._config:this._elementOrData),t=(this._isUsingConfigBasedCreator?void 0:this._config),i){const o=this._detectConfigBasedCreator(e,t),n=o?void 0:e,s=o?e:t,r=o?t:i;return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>{if(super._startErrorHandling(),this._isUsingConfigBasedCreator=o,this._elementOrData=n,this._config=this._cloneEditorConfiguration(s||{}),this._config.context=r,o){this._editorAttachTo=null;const e=this._config.roots?Object.keys(this._config.roots).length:0,t=this._config.initialData,i=t&&"object"==typeof t;this._isSingleRootEditor=!i&&e<=1}else this._editorAttachTo=uc(n)?n:null,this._isSingleRootEditor=uc(n)||"string"==typeof n;return o?this._creator(this._config):this._creator(n,this._config)})).then((e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._editorAttachTo||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)}))}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._editorAttachTo||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter((e=>e.isAttached()&&"$graveyard"!=e.rootName)),{plugins:i}=e,o=i.has("CommentsRepository")&&i.get("CommentsRepository"),n=i.has("TrackChanges")&&i.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach((e=>{s.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}}));for(const t of e.model.markers)t._affectsData&&(s.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return o&&(s.commentThreads=JSON.stringify(o.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),n&&(s.suggestions=JSON.stringify(n.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return rc(this._editor,e.context,this._excludedProps)}_detectConfigBasedCreator(e,t){if("string"==typeof e||uc(e))return!1;if(t&&"object"==typeof t&&!("destroy"in t)&&Object.keys(t).length>0)return!1;if(e&&"object"==typeof e){const t=Object.values(e);if(t.length>0&&t.every((e=>"string"==typeof e||uc(e))))return!1}return!0}_cloneEditorConfiguration(e){return N(e,((e,t)=>uc(e)||"context"===t?e:void 0))}}class dc{editor;_data;constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",(e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},(e=>{this._restoreCollaborationData(),this._restoreEditorData(e)})),this.editor.data.fire("ready")}),{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const o of t.children)i._appendChild(this._createNode(e,o));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach((([i,{content:o,attributes:n}])=>{const s=JSON.parse(o),r=JSON.parse(n),a=t.model.document.getRoot(i);for(const[t,i]of r)e.setAttribute(t,i,a);for(const t of s){const i=this._createNode(e,t);e.insert(i,a,"end")}})),Object.entries(this._data.markers).forEach((([i,o])=>{const{document:n}=t.model,{rangeJSON:{start:s,end:r},...a}=o,l=n.getRoot(s.root),c=e.createPositionFromPath(l,s.path,s.stickiness),d=e.createPositionFromPath(l,r.path,r.stickiness),u=e.createRange(c,d);e.addMarker(i,{range:u,...a})}))}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const t=this.editor.plugins.get("CommentsRepository");for(const e of t.getCommentThreads())t._removeCommentThread({threadId:e.id});e.forEach((e=>{const t=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:t,...e})}))}if(this.editor.plugins.has("TrackChangesEditing")){const e=this.editor.plugins.get("TrackChangesEditing");for(const t of e.getSuggestions())e._removeSuggestion(t);t.forEach((t=>{e.addSuggestionData(t)}))}}}function uc(e){return L(e)}const hc=Symbol("MainQueueId");class mc extends oc{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new gc;_contextConfig;_item;constructor(e,t={}){super(t),this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty((()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))}))}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(hc,(()=>(this._contextConfig=e,this._create())))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=pc(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e.id,(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new cc(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",((i,{error:o,causesRestart:n})=>{this._fire("itemError",{itemId:e.id,error:o}),n&&this._actionQueues.enqueue(e.id,(()=>new Promise((i=>{const o=()=>{t.off("restart",o),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",o)}))))})),void 0!==e.sourceElementOrData?t.create(e.sourceElementOrData,e.config,this._context):t.create(e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))))}remove(e){const t=pc(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e,(()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))))}destroy(){return this._actionQueues.enqueue(hc,(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())))}_restart(){return this._actionQueues.enqueue(hc,(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch((e=>{console.error("An error happened during destroying the context or items.",e)})).then((()=>this._create())).then((()=>this._fire("restart"))))))}_create(){return Promise.resolve().then((()=>(this._startErrorHandling(),this._creator(this._contextConfig)))).then((e=>(this._context=e,this._contextProps=nc(this._context),Promise.all(Array.from(this._watchdogs.values()).map((e=>(e._setExcludedProperties(this._contextProps),e._isUsingConfigBasedCreator?e.create(void 0,this._context):e.create(void 0,void 0,this._context))))))))}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map((e=>e.destroy()))).then((()=>this._destructor(e)))}))}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return rc(this._context,e.context)}}class gc{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===hc;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const o=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(hc),this._queues.get(e)])).then(t),n=o.catch((()=>{}));return this._queues.set(e,n),o.finally((()=>{this._activeActions--,this._queues.get(e)===n&&0===this._activeActions&&this._onEmptyCallbacks.forEach((e=>e()))}))}}function pc(e){return Array.isArray(e)?e:[e]}class fc extends(Be()){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",bc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",bc),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function bc(e){e.return=!1,e.stop()}class wc extends(Be()){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.listenTo(e,"change:isReadOnly",(()=>{this.refresh()})),this.on("set:isEnabled",(t=>{if(!this.affectsData)return;const i=e.model.document.selection,o=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())}),{priority:"highest"}),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",yc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",yc),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function yc(e){e.return=!1,e.stop()}class _c{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new fe("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class kc extends(xe()){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of i)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new fe("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){const o=this,n=this._context;!function e(t,i=new Set){t.forEach((t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!o._availablePlugins.has(t.pluginName)&&o._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))}))}(e),u(e);const s=[...function e(t,i=new Set){return t.map((e=>a(e)?e:o._availablePlugins.get(e))).reduce(((t,o)=>i.has(o)?t:(i.add(o),o.requires&&(u(o.requires,o),e(o.requires,i).forEach((e=>t.add(e)))),t.add(o))),new Set)}(e.filter((e=>!c(e,t))))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new fe("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new fe("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new fe("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=o._availablePlugins.get(t);if(!n)throw new fe("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const s=e.indexOf(n);if(-1===s){if(o._contextPlugins.has(n))return;throw new fe("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new fe("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(s,1,i),o._availablePlugins.set(t,i)}}(s,i);const r=function(e){return e.map((e=>{let t=o._contextPlugins.get(e);return t=t||new e(n),o._add(e,t),t}))}(s);return await h(r,"init"),await h(r,"afterInit"),r;function a(e){return"function"==typeof e}function l(e){return a(e)&&!!e.isContextPlugin}function c(e,t){return t.some((t=>t===e||(d(e)===t||d(t)===e)))}function d(e){return a(e)?e.pluginName||e.name:e}function u(e,i=null){e.map((e=>a(e)?e:o._availablePlugins.get(e)||e)).forEach((e=>{!function(e){if("function"!=typeof e)return;if(e._throwErrorWhenUsedAsAPlugin)throw new fe("plugincollection-plugin-invalid-constructor",n,{name:e.name})}(e),function(e,t){if(a(e))return;if(t)throw new fe("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:d(t)});throw new fe("plugincollection-plugin-not-found",n,{plugin:e})}(e,i),function(e,t){if(!l(t))return;if(l(e))return;throw new fe("plugincollection-context-required",n,{plugin:d(e),requiredBy:d(t)})}(e,i),function(e,i){if(!i)return;if(!c(e,t))return;throw new fe("plugincollection-required",n,{plugin:d(e),requiredBy:d(i)})}(e,i)}))}function h(e,t){return e.reduce(((e,i)=>i[t]?o._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new fe("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class vc{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new Ge(i,this.constructor.defaultConfig);const o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new kc(this,o);const n=this.config.get("language")||{};this.locale=new Xt({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new ei}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new fe("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new fe("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new fe("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const i=new this(e);t(i.initPlugins().then((()=>i)))}))}static get _throwErrorWhenUsedAsAPlugin(){return!0}}class Cc extends(Be()){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class Ac extends ri{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}const xc="contentEditing",Ec="common";class Tc{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:xc,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:Ec}),o&&o.forEach((t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})}))}addKeystrokeInfoGroup({categoryId:e=xc,id:t,label:i,keystrokes:o}){const n=this.keystrokeInfos.get(e);if(!n)throw new fe("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=xc,groupId:t=Ec,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new fe("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new fe("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}}function Pc(e){return Object.getPrototypeOf(e).constructor.editorName}function Sc(e){if(!e)return;const t=Array.isArray(e)?{items:e}:e,i=function e(t){return t.flatMap((t=>"string"==typeof t?[t]:e(t.items)))}(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:(o=i,o.filter((e=>"|"!==e&&"-"!==e)))};var o}function Ic(){let e="unknown",t="unknown";return Y.isMac?e="mac":Y.isWindows?e="windows":Y.isiOS?e="ios":Y.isAndroid&&(e="android"),Y.isGecko?t="gecko":Y.isBlink?t="blink":Y.isSafari&&(t="safari"),{os:e,browser:t}}function Rc(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",me()),localStorage.getItem("__ckeditor-session-id")}function Oc(){return J.window.CKEDITOR_PAGE_SESSION_ID=J.window.CKEDITOR_PAGE_SESSION_ID||me(),J.window.CKEDITOR_PAGE_SESSION_ID}class Vc extends(Be()){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),"object"!=typeof e||Array.isArray(e))throw new fe("editor-config-invalid-type");if("sanitizeHtml"in e)throw new fe("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...s}=e,r=e.language||o.language;this._context=e.context||new vc({language:r,translations:n}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new Ge(s,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),function(e){let t=e.get("licenseKey");!t&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(t=window.CKEDITOR_GLOBAL_LICENSE_KEY,e.set("licenseKey",t));if(!t)throw new fe("license-key-missing")}(this.config),this.plugins=new kc(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new _c,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new el(this.config),this.on("change:isReadOnly",(()=>{this.model.document.isReadOnly=this.isReadOnly}));const l=new po;this.data=new Rr(this.model,l),this.editing=new hr(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Or([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ac(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Tc(this),function(e){const t=e.config.get("licenseKey"),i=window[Symbol.for("cke distribution")]||"sh";function o(t,i){e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError(t,i)}if("GPL"==t)return void("cloud"==i&&o("distributionChannel"));const n=fi(t);if(!n)return void o("invalid");if(!function(e){return["exp","jti","vc"].every((t=>t in e))}(n))return void o("invalid");if(n.distributionChannel&&!Qt(n.distributionChannel).includes(i))return void o("distributionChannel");if(function(e){const t=Array.isArray(e)?e:[e],i=function(){const e=[];for(let t=0;t<256;t++){let i=t;for(let e=0;e<8;e++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}return e}();let o=-1;const n=t.map((e=>Array.isArray(e)?e.join(""):String(e))).join("");for(let e=0;e>>8^i[255&(o^n.charCodeAt(e))];return o=~o>>>0,o.toString(16).padStart(8,"0")}(function(e){return Object.getOwnPropertyNames(e).sort().filter((t=>"vc"!=t&&null!=e[t])).map((t=>e[t]))}(n))!=n.vc.toLowerCase())return void o("invalid");if(new Date(1e3*n.exp)<_e)return void o("expired");const s=n.licensedHosts;if(s&&s.length>0&&!function(e){const{hostname:t}=new URL(window.location.href);if(e.includes(t))return!0;const i=t.split(".");return e.filter((e=>e.includes("*"))).map((e=>e.split("."))).filter((e=>e.length<=i.length)).map((e=>Array(i.length-e.length).fill("*"===e[0]?"*":"").concat(e))).some((e=>i.every(((t,i)=>e[i]===t||"*"===e[i]))))}(s))return void o("domainLimit");if(["evaluation","trial"].includes(n.licenseType)&&1e3*n.exp{o("evaluationLimit")}),6e5);e.on("destroy",(()=>{clearTimeout(t)}))}n.usageEndpoint&&e.once("ready",(()=>{const i={requestId:me(),requestTime:Math.round(Date.now()/1e3),license:t,editor:Dc(e)};e._sendUsageRequest(n.usageEndpoint,i).then((e=>{const{status:t,message:i}=e;i&&console.warn(i),"ok"!=t&&o("usageLimit")}),(()=>{var e,t;e="license-key-validation-endpoint-not-reachable",t={url:n.usageEndpoint},console.error(...ye(e,t))}))}),{priority:"high"})}(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new fe("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new fe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new fe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),i,n).then((e=>(function(e){const t=e.config.get("licenseKey");if("GPL"===t)return;const i=fi(t);if(!i)return;const o=[...e.plugins].map((([e])=>e)).find((e=>{return!!e.pluginName&&(!!e.licenseFeatureCode&&(t=i,o=e.licenseFeatureCode,(t.removeFeatures||[]).includes(o)));var t,o}));o&&(e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError("pluginNotAllowed",o.pluginName))}(this),e)))}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),e.then((()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()})).then((()=>this.plugins.destroy())).then((()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})).then((()=>this._context._removeEditor(this)))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(e){fe.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=vc;static EditorWatchdog=cc;static ContextWatchdog=mc;_showLicenseError(e,t){setTimeout((()=>{if("invalid"==e)throw new fe("invalid-license-key");if("expired"==e)throw new fe("license-key-expired");if("domainLimit"==e)throw new fe("license-key-domain-limit");if("pluginNotAllowed"==e){const e=t.replace(/(Editing|UI)$/,""),i=this.plugins.has(e);throw new fe("license-key-plugin-not-allowed",null,{pluginName:i?e:t})}if("featureNotAllowed"==e)throw new fe("license-key-feature-not-allowed",null,{featureName:t});if("evaluationLimit"==e)throw new fe("license-key-evaluation-limit");if("trialLimit"==e)throw new fe("license-key-trial-limit");if("developmentLimit"==e)throw new fe("license-key-development-limit");if("usageLimit"==e)throw new fe("license-key-usage-limit");if("distributionChannel"==e)throw new fe("license-key-invalid-distribution-channel")}),0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),o=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok)throw new Error(`HTTP Response: ${o.status}`);return o.json()}}function Dc(e){const t=function(e){return{sessionId:Rc(),pageSessionId:Oc(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Pc(e),plugins:(t=e.plugins,Array.from(t).filter((([e])=>!!e.pluginName)).map((([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:o,isPremiumPlugin:n}=e;return{isContext:!!i,isOfficial:!!o,isPremium:!!n,name:t}}))),distribution:{channel:window[Symbol.for("cke distribution")]||"sh"},env:Ic(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:Sc(e.config.get("toolbar")),block:Sc(e.config.get("blockToolbar")),balloon:Sc(e.config.get("balloonToolbar"))}};var t}(e);return e.fire("collectUsageData",{setUsageData:function(e,i){if(void 0!==ki(t,e))throw new fe("editor-usage-data-path-already-set",{path:e});Ii(t,e,i)}}),t}function Fc(e){return class extends e{sourceElement;updateSourceElement(e){if(!this.sourceElement)throw new fe("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void wt(this.sourceElement,"");const o="string"==typeof e?e:this.data.get();wt(this.sourceElement,o)}}}function Mc(e,t,i="main",o=!1){const n=t.get("root"),s=t.get("roots")||Object.create(null);if(n){if(!i)throw new fe("editor-create-multi-root-with-main",null);if(i in s)throw new fe("editor-create-roots-with-main",null)}i&&!s[i]&&(s[i]=n||Object.create(null));const r=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&!Bc(e)}(e),a=function(e,t,i){return t||!i?e.get("initialData")||Object.create(null):{[i]:e.get("initialData")}}(t,r,i),l=Array.from(new Set([...r?Object.keys(e):[],...Object.keys(s),...Object.keys(a)]));for(const i of l){const n=s[i]||Object.create(null),l=r?e[i]:e;if(!o&&Bc(l)){if(n.element)throw new fe("editor-create-root-element-overspecified",null);n.element=l}if(o&&Bc(n.element)&&be("editor-create-root-element-not-supported"),void 0===n.initialData)if(void 0===a[i])n.initialData=Bc(d=l||n.element||o&&t.get("attachTo")||"")?(c=d)instanceof HTMLTextAreaElement?c.value:c.innerHTML:d;else{if(l&&!Bc(l))throw new fe("editor-create-initial-data-overspecified",null);n.initialData=a[i]}else{if(l&&!Bc(l))throw new fe("editor-create-root-initial-data-overspecified",null);if(void 0!==a[i])throw new fe("editor-create-legacy-initial-data-overspecified",null)}n.placeholder??=Nc(t,"placeholder",i),n.label??=Nc(t,"label",i),s[i]=n}var c,d;if(o&&Bc(e)){if(t.get("attachTo"))throw new fe("editor-create-attachto-overspecified",null);t.set("attachTo",e)}if(!o&&t.get("attachTo"))throw new fe("editor-create-attachto-ignored",null);t.set("roots",s)}function Nc(e,t,i){const o=e.get(t);if(o)return"string"==typeof o?o:o[i]}function Bc(e){return L(e)}class Lc extends Cc{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new ei({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new fe("pendingactions-add-invalid-message",this);const t=new(Be());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}var zc='',jc='',$c='',qc='',Hc='',Wc='',Uc='',Kc='',Gc='',Jc='',Zc='',Qc='',Yc='',Xc='',ed='',td='',id='',od='',nd='';const sd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in sd)Object.freeze(sd[e]);const rd=Object.freeze(sd),ad=function(e){var t,i,o=[],n=1;if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if(e=String(e).toLowerCase(),rd[e])o=rd[e].slice(),i="rgb";else if("transparent"===e)n=0,i="rgb",o=[0,0,0];else if("#"===e[0]){var s=e.slice(1),r=s.length;n=1,r<=4?(o=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===r&&(n=parseInt(s[3]+s[3],16)/255)):(o=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===r&&(n=parseInt(s[6]+s[7],16)/255)),o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0),i="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var a=t[1],l="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;o=t[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=o.shift()),n=(o=o.map((function(e,t){if("%"===e[e.length-1])return e=parseFloat(e)/100,3===t?e:"rgb"===i?255*e:"h"===i[0]?100*e:"l"!==i[0]||t?"lab"===i?125*e:"lch"===i?t<2?150*e:360*e:"o"!==i[0]||t?"oklab"===i?.4*e:"oklch"===i?t<2?.4*e:360*e:e:e:100*e;if("h"===i[t]||2===t&&"h"===i[i.length-1]){if(void 0!==ld[e])return ld[e];if(e.endsWith("deg"))return parseFloat(e);if(e.endsWith("turn"))return 360*parseFloat(e);if(e.endsWith("grad"))return 360*parseFloat(e)/400;if(e.endsWith("rad"))return 180*parseFloat(e)/Math.PI}return"none"===e?0:parseFloat(e)}))).length>l?o.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(o=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:o,alpha:n}};var ld={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};const cd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in cd)Object.freeze(cd[e]);const dd=Object.freeze(cd),ud={};for(const e of Object.keys(dd))ud[dd[e]]=e;const hd={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},md=hd,gd=(6/29)**3;function pd(e){const t=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e;return Math.min(Math.max(0,t),1)}function fd(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(hd)){if(!("channels"in hd[e]))throw new Error("missing channels property: "+e);if(!("labels"in hd[e]))throw new Error("missing channel labels property: "+e);if(hd[e].labels.length!==hd[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=hd[e];delete hd[e].channels,delete hd[e].labels,Object.defineProperty(hd[e],"channels",{value:t}),Object.defineProperty(hd[e],"labels",{value:i})}function bd(e){const t=function(){const e={},t=Object.keys(md);for(let{length:i}=t,o=0;o0;){const e=i.pop(),o=Object.keys(md[e]);for(let{length:n}=o,s=0;s1&&(n-=1)}return[360*n,100*s,100*c]},hd.rgb.hwb=function(e){const t=e[0],i=e[1];let o=e[2];const n=hd.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,100*s,100*o]},hd.rgb.oklab=function(e){const t=fd(e[0]/255),i=fd(e[1]/255),o=fd(e[2]/255),n=Math.cbrt(.4122214708*t+.5363325363*i+.0514459929*o),s=Math.cbrt(.2119034982*t+.6806995451*i+.1073969566*o),r=Math.cbrt(.0883024619*t+.2817188376*i+.6299787005*o);return[100*(.2104542553*n+.793617785*s-.0040720468*r),100*(1.9779984951*n-2.428592205*s+.4505937099*r),100*(.0259040371*n+.7827717662*s-.808675766*r)]},hd.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o);return[100*((1-t-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-o-n)/(1-n)||0),100*n]},hd.rgb.keyword=function(e){const t=ud[e];if(t)return t;let i,o=Number.POSITIVE_INFINITY;for(const t of Object.keys(dd)){const r=dd[t],a=(s=r,((n=e)[0]-s[0])**2+(n[1]-s[1])**2+(n[2]-s[2])**2);agd?i**(1/3):7.787*i+16/116,o=o>gd?o**(1/3):7.787*o+16/116,n=n>gd?n**(1/3):7.787*n+16/116;return[116*o-16,500*(i-o),200*(o-n)]},hd.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;let n,s;if(0===i)return s=255*o,[s,s,s];const r=o<.5?o*(1+i):o+i-o*i,a=2*o-r,l=[0,0,0];for(let e=0;e<3;e++)n=t+1/3*-(e-1),n<0&&n++,n>1&&n--,s=6*n<1?a+6*(r-a)*n:2*n<1?r:3*n<2?a+(r-a)*(2/3-n)*6:a,l[e]=255*s;return l},hd.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,o=e[2]/100,n=i;const s=Math.max(o,.01);o*=2,i*=o<=1?o:2-o,n*=s<=1?s:2-s;return[t,100*(0===o?2*n/(s+n):2*i/(o+i)),100*((o+i)/2)]},hd.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let o=e[2]/100;const n=Math.floor(t)%6,s=t-Math.floor(t),r=255*o*(1-i),a=255*o*(1-i*s),l=255*o*(1-i*(1-s));switch(o*=255,n){case 0:return[o,l,r];case 1:return[a,o,r];case 2:return[r,o,l];case 3:return[r,a,o];case 4:return[l,r,o];case 5:return[o,r,a]}},hd.hsv.hsl=function(e){const t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01);let s,r;r=(2-i)*o;const a=(2-i)*n;return s=i*n,s/=a<=1?a:2-a,s=s||0,r/=2,[t,100*s,100*r]},hd.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,o=e[2]/100;const n=i+o;let s;n>1&&(i/=n,o/=n);const r=Math.floor(6*t),a=1-o;s=6*t-r,1&r&&(s=1-s);const l=i+s*(a-i);let c,d,u;switch(r){default:case 6:case 0:c=a,d=l,u=i;break;case 1:c=l,d=a,u=i;break;case 2:c=i,d=a,u=l;break;case 3:c=i,d=l,u=a;break;case 4:c=l,d=i,u=a;break;case 5:c=a,d=i,u=l}return[255*c,255*d,255*u]},hd.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n))]},hd.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100;let n,s,r;return n=3.2404542*t+-1.5371385*i+-.4985314*o,s=-.969266*t+1.8760108*i+.041556*o,r=.0556434*t+-.2040259*i+1.0572252*o,n=pd(n),s=pd(s),r=pd(r),[255*n,255*s,255*r]},hd.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];t/=95.047,i/=100,o/=108.883,t=t>gd?t**(1/3):7.787*t+16/116,i=i>gd?i**(1/3):7.787*i+16/116,o=o>gd?o**(1/3):7.787*o+16/116;return[116*i-16,500*(t-i),200*(i-o)]},hd.xyz.oklab=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=Math.cbrt(.8189330101*t+.3618667424*i-.1288597137*o),s=Math.cbrt(.0329845436*t+.9293118715*i+.0361456387*o),r=Math.cbrt(.0482003018*t+.2643662691*i+.633851707*o);return[100*(.2104542553*n+.793617785*s-.0040720468*r),100*(1.9779984951*n-2.428592205*s+.4505937099*r),100*(.0259040371*n+.7827717662*s-.808675766*r)]},hd.oklab.oklch=function(e){return hd.lab.lch(e)},hd.oklab.xyz=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(.999999998*t+.396337792*i+.215803758*o)**3,s=(1.000000008*t-.105561342*i-.063854175*o)**3,r=(1.000000055*t-.089484182*i-1.291485538*o)**3;return[100*(1.227013851*n-.55779998*s+.281256149*r),100*(-.040580178*n+1.11225687*s-.071676679*r),100*(-.076381285*n-.421481978*s+1.58616322*r)]},hd.oklab.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(t+.3963377774*i+.2158037573*o)**3,s=(t-.1055613458*i-.0638541728*o)**3,r=(t-.0894841775*i-1.291485548*o)**3;return[255*pd(4.0767416621*n-3.3077115913*s+.2309699292*r),255*pd(-1.2684380046*n+2.6097574011*s-.3413193965*r),255*pd(-.0041960863*n-.7034186147*s+1.707614701*r)]},hd.oklch.oklab=function(e){return hd.lch.lab(e)},hd.lab.xyz=function(e){let t,i,o;i=(e[0]+16)/116,t=e[1]/500+i,o=i-e[2]/200;const n=i**3,s=t**3,r=o**3;return i=n>gd?n:(i-16/116)/7.787,t=s>gd?s:(t-16/116)/7.787,o=r>gd?r:(o-16/116)/7.787,t*=95.047,i*=100,o*=108.883,[t,i,o]},hd.lab.lch=function(e){const t=e[0],i=e[1],o=e[2];let n;n=360*Math.atan2(o,i)/2/Math.PI,n<0&&(n+=360);return[t,Math.sqrt(i*i+o*o),n]},hd.lch.lab=function(e){const t=e[0],i=e[1],o=e[2]/360*2*Math.PI;return[t,i*Math.cos(o),i*Math.sin(o)]},hd.rgb.ansi16=function(e,t=null){const[i,o,n]=e;let s=null===t?hd.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),0===s)return 30;let r=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return 2===s&&(r+=60),r},hd.hsv.ansi16=function(e){return hd.rgb.ansi16(hd.hsv.rgb(e),e[2])},hd.rgb.ansi256=function(e){const t=e[0],i=e[1],o=e[2];if(t>>4==i>>4&&i>>4==o>>4)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)},hd.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(Math.trunc(e>50)+1);return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},hd.ansi256.rgb=function(e){if((e=e[0])>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},hd.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(t.length)+t},hd.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=[...i].map((e=>e+e)).join(""));const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,255&o]},hd.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),s=Math.min(Math.min(t,i),o),r=n-s;let a;return a=r<=0?0:n===t?(i-o)/r%6:n===i?2+(o-t)/r:4+(t-i)/r,a/=6,a%=1,[360*a,100*r,100*(r<1?s/(1-r):0)]},hd.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i);let n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],100*o,100*n]},hd.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=t*i;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},hd.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;if(0===i)return[255*o,255*o,255*o];const n=[0,0,0],s=t%1*6,r=s%1,a=1-r;let l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=r,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=r;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=r,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-i)*o,[255*(i*n[0]+l),255*(i*n[1]+l),255*(i*n[2]+l)]},hd.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let o=0;return i>0&&(o=t/i),[e[0],100*o,100*i]},hd.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let o=0;return i>0&&i<.5?o=t/(2*i):i>=.5&&i<1&&(o=t/(2*(1-i))),[e[0],100*o,100*i]},hd.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},hd.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,o=i-t;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},hd.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},hd.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},hd.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},hd.gray.hsl=function(e){return[0,0,e[0]]},hd.gray.hsv=hd.gray.hsl,hd.gray.hwb=function(e){return[0,100,e[0]]},hd.gray.cmyk=function(e){return[0,0,0,e[0]]},hd.gray.lab=function(e){return[e[0],0,0]},hd.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i},hd.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const _d=function(e){const t=bd(e),i={},o=Object.keys(t);for(let{length:e}=o,n=0;n1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ad(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const o=e(t);if("object"==typeof o)for(let{length:e}=o,t=0;te>i?i:eMath.round(i*e)/i,Pd=(Math.PI,e=>("#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Td(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?Td(parseInt(e.substring(6,8),16)/255,2):1})),Sd=({h:e,s:t,v:i,a:o})=>{const n=(200-t)*i/100;return{h:Td(e),s:Td(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:Td(n/2),a:Td(o,2)}},Id=e=>{const{h:t,s:i,l:o}=Sd(e);return`hsl(${t}, ${i}%, ${o}%)`},Rd=({h:e,s:t,v:i,a:o})=>{e=e/360*6,t/=100,i/=100;const n=Math.floor(e),s=i*(1-t),r=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),l=n%6;return{r:Td(255*[i,r,s,s,a,i][l]),g:Td(255*[a,i,i,r,s,s][l]),b:Td(255*[s,s,a,i,i,r][l]),a:Td(o,2)}},Od=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},Vd=({r:e,g:t,b:i,a:o})=>{const n=o<1?Od(Td(255*o)):"";return"#"+Od(e)+Od(t)+Od(i)+n},Dd=({r:e,g:t,b:i,a:o})=>{const n=Math.max(e,t,i),s=n-Math.min(e,t,i),r=s?n===e?(t-i)/s:n===t?2+(i-e)/s:4+(e-t)/s:0;return{h:Td(60*(r<0?r+6:r)),s:Td(n?s/n*100:0),v:Td(n/255*100),a:o}},Fd=(e,t)=>{if(e===t)return!0;for(const i in e)if(e[i]!==t[i])return!1;return!0},Md={},Nd=e=>{let t=Md[e];return t||(t=document.createElement("template"),t.innerHTML=e,Md[e]=t),t},Bd=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};let Ld=!1;const zd=e=>"touches"in e,jd=(e,t)=>{const i=zd(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();Bd(e.el,"move",e.getMove({x:Ed((i.pageX-(o.left+window.pageXOffset))/o.width),y:Ed((i.pageY-(o.top+window.pageYOffset))/o.height)}))};class $d{constructor(e,t,i,o){const n=Nd(`
    `);e.appendChild(n.content.cloneNode(!0));const s=e.querySelector(`[part=${t}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=o,this.nodes=[s.firstChild,s]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(Ld?"touchmove":"mousemove",this),t(Ld?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(e=>!(Ld&&!zd(e)||(Ld||(Ld=zd(e)),0)))(e)||!Ld&&0!=e.button)return;this.el.focus(),jd(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),jd(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((e,t)=>{const i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),Bd(e.el,"move",e.getMove({x:39===i?.01:37===i?-.01:34===i?.05:33===i?-.05:35===i?1:36===i?-1:0,y:40===i?.01:38===i?-.01:0},!0)))})(this,e)}}style(e){e.forEach(((e,t)=>{for(const i in e)this.nodes[t].style.setProperty(i,e[i])}))}}class qd extends $d{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:Id({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Td(e)}`)}getMove(e,t){return{h:t?Ed(this.h+360*e.x,0,360):360*e.x}}}class Hd extends $d{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:Id(e)},{"background-color":Id({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Td(e.s)}%, Brightness ${Td(e.v)}%`)}getMove(e,t){return{s:t?Ed(this.hsva.s+100*e.x,0,100):100*e.x,v:t?Ed(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Wd=Symbol("same"),Ud=Symbol("color"),Kd=Symbol("hsva"),Gd=Symbol("update"),Jd=Symbol("parts"),Zd=Symbol("css"),Qd=Symbol("sliders");class Yd extends HTMLElement{static get observedAttributes(){return["color"]}get[Zd](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Qd](){return[Hd,qd]}get color(){return this[Ud]}set color(e){if(!this[Wd](e)){const t=this.colorModel.toHsva(e);this[Gd](t),this[Ud]=e}}constructor(){super();const e=Nd(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Jd]=this[Qd].map((e=>new e(t)))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){const o=this.colorModel.fromAttr(i);this[Wd](o)||(this.color=o)}handleEvent(e){const t=this[Kd],i={...t,...e.detail};let o;this[Gd](i),Fd(i,t)||this[Wd](o=this.colorModel.fromHsva(i))||(this[Ud]=o,Bd(this,"color-changed",{value:o}))}[Wd](e){return this.color&&this.colorModel.equal(e,this.color)}[Gd](e){this[Kd]=e,this[Jd].forEach((t=>t.update(e)))}}const Xd={defaultColor:"#000",toHsva:e=>Dd(Pd(e)),fromHsva:({h:e,s:t,v:i})=>Vd(Rd({h:e,s:t,v:i,a:1})),equal:(e,t)=>e.toLowerCase()===t.toLowerCase()||Fd(Pd(e),Pd(t)),fromAttr:e=>e};class eu extends Yd{get colorModel(){return Xd}}class tu extends ei{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,i)=>{this._renderViewIntoCollectionParent(t,i)})),this.on("remove",((e,t)=>{t.element&&this._parentElement&&t.element.remove()})),this._parentElement=null}destroy(){this.map((e=>e.destroy()))}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every((e=>"string"==typeof e)))throw new fe("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",((i,o)=>{for(const i of e)o.delegate(i).to(t)})),this.on("remove",((i,o)=>{for(const i of e)o.stopDelegating(i,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class iu extends(xe()){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,mu(hu(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new fe("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)yu(i)?yield i:_u(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,o)=>new nu({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o}),if:(i,o,n)=>new su({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}static extend(e,t){if(e._isRendered)throw new fe("template-extend-render",[this,e]);bu(e,mu(hu(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new fe("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),ru(this.text)?this._bindToObservable({schema:this.text,updater:cu(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),s=this.attributes[o];i&&(i.attributes[o]=n);const r=vu(s)?s[0].ns:null;if(ru(s)){const a=vu(s)?s[0].value:s;i&&Cu(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:du(t,o,r),data:e})}else if("style"==o&&"string"!=typeof s[0])this._renderStyleAttribute(s[0],e);else{i&&n&&Cu(o)&&s.unshift(n);const e=s.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(pu,"");wu(e)||t.setAttributeNS(r,o,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];ru(n)?this._bindToObservable({schema:[n],updater:uu(i,o),data:t}):au(o)?i.style.setProperty(o,n):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const s of this.children)if(ku(s)){if(!o){s.setParent(t);for(const e of s)i.appendChild(e.element)}}else if(yu(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if(Qe(s))i.appendChild(s);else if(o){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),s._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:t})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map((i=>{const[o,n]=t.split("@");return i.activateDomEventListener(o,n,e)}));e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;lu(e,t,i);const n=e.filter((e=>!wu(e))).filter((e=>e.observable)).map((o=>o.activateAttributeListener(e,t,i)));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const i=e;for(const e in t.attributes){const o=t.attributes[e];null===o?i.removeAttribute(e):i.setAttribute(e,o)}for(let e=0;elu(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class nu extends ou{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class su extends ou{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!wu(super.getValue(e))&&(this.valueIfTrue||!0)}}function ru(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(ru):e instanceof ou)}function au(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function lu(e,t,{node:i}){const o=function(e,t){return e.map((e=>e instanceof ou?e.getValue(t):e))}(e,i);let n;n=1==e.length&&e[0]instanceof su?o[0]:o.reduce(pu,""),wu(n)?t.remove():t.set(n)}function cu(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function du(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function uu(e,t){return{set(i){au(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){au(t)?e.style.removeProperty(t):e.style[t]=null}}}function hu(e){return N(e,(e=>{if(e&&(e instanceof ou||_u(e)||yu(e)||ku(e)))return e}))}function mu(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Qt(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)gu(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Qt(e[t].value)),gu(e,t)}(e.attributes);const t=[];if(e.children)if(ku(e.children))t.push(e.children);else for(const i of e.children)_u(i)||yu(i)||Qe(i)?t.push(i):t.push(new iu(i));e.children=t}return e}function gu(e,t){e[t]=Qt(e[t])}function pu(e,t){return wu(t)?e:wu(e)?t:`${e} ${t}`}function fu(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function bu(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),fu(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),fu(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new fe("ui-template-extend-children-mismatch",e);let i=0;for(const o of t.children)bu(e.children[i++],o)}}function wu(e){return!e&&0!==e}function yu(e){return e instanceof Au}function _u(e){return e instanceof iu}function ku(e){return e instanceof tu}function vu(e){return s(e[0])&&e[0].ns}function Cu(e){return"class"==e||"style"==e}class Au extends(et(Be())){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new ei,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,i)=>{i.locale=e,i.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=iu.bind(this,this)}createCollection(e){const t=new tu(e);return this._viewCollections.add(t),t}registerChild(e){Ue(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Ue(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new iu(e)}extendTemplate(e){iu.extend(this.template,e)}render(){if(this.isRendered)throw new fe("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}const xu={POLITE:"polite",ASSERTIVE:"assertive"};class Eu{editor;view;constructor(e){this.editor=e,e.once("ready",(()=>{for(const e of Object.values(xu))this.announce("",e)}))}announce(e,t=xu.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new Tu(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}="string"==typeof t?{politeness:t}:t;let s=this.view.regionViews.find((e=>e.politeness===o));s||(s=new Pu(i,o),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:n})}}class Tu extends Au{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class Pu extends Au{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",(()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)})),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval((()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()}),5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function Su({emitter:e,activator:t,callback:i,contextElements:o,listenerOptions:n}){e.listenTo(document,"mousedown",((e,n)=>{if(!t())return;const s="function"==typeof n.composedPath?n.composedPath():[],r="function"==typeof o?o():o;for(const e of r)if(e.contains(n.target)||s.includes(e))return;i()}),n)}function Iu(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function Ru(e){return class extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",(()=>{this._attachListeners()})),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(J.document,"mouseup",this._onDragEndBound),this.listenTo(J.document,"touchend",this._onDragEndBound),this.listenTo(J.document,"mousemove",this._onDragBound),this.listenTo(J.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(J.document,"mouseup",this._onDragEndBound),this.stopListening(J.document,"touchend",this._onDragEndBound),this.stopListening(J.document,"mousemove",this._onDragBound),this.stopListening(J.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:o},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(o-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:o}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}function Ou({view:e}){e.listenTo(e.element,"submit",((t,i)=>{i.preventDefault(),e.fire("submit")}),{useCapture:!0})}function Vu({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){const s="number"==typeof o?()=>o:o;function r(e){return o=>{const n=i.find((e=>e.element===t.focusedElement)),s=i.getIndex(n),r=e(s,i);i.get(r).focus(),o.stopPropagation(),o.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function l(e,t){return 0===e?t-1:e-1}e.set("arrowright",r(((e,t)=>"rtl"===n?l(e,t.length):a(e,t.length)))),e.set("arrowleft",r(((e,t)=>"rtl"===n?a(e,t.length):l(e,t.length)))),e.set("arrowup",r(((e,t)=>{let i=e-s();return i<0&&(i=e+s()*Math.floor(t.length/s()),i>t.length-1&&(i-=s())),i}))),e.set("arrowdown",r(((e,t)=>{let i=e+s();return i>t.length-1&&(i=e%s()),i})))}class Du extends Au{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${me()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class Fu extends Au{constructor(e,t){super(e);const i=e.t,o=new Du;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[Ke(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map((e=>{const t=[Ke(document,"h3",{},e.label),...Array.from(e.groups.values()).map((e=>this._createGroup(e))).flat()];return e.description&&t.splice(1,0,Ke(document,"p",{},e.description)),Ke(document,"section",{},t)}))}_createGroup(e){const t=e.keystrokes.sort(((e,t)=>e.label.localeCompare(t.label))).map((e=>this._createGroupRow(e))).flat(),i=[Ke(document,"dl",{},t)];return e.label&&i.unshift(Ke(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=Ke(document,"dt"),o=Ke(document,"dd"),n=function(e){if("string"==typeof e)return[[e]];if("string"==typeof e[0])return[e];return e}(e.keystroke),s=[];for(const e of n)s.push(e.map(Mu).join(""));return i.innerHTML=e.label,o.innerHTML=s.join(", ")+(e.mayRequireFn&&Y.isMac?` ${t("(may require Fn)")}`:""),[i,o]}}function Mu(e){return Ut(e).split("+").map((e=>`${e}`)).join("+")}class Nu extends Au{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",(e=>!e)),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(()=>{this._updateXMLContent(),this._colorFillPaths()})),this.on("change:fillColor",(()=>{this._colorFillPaths()}))}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!e)throw new fe("ui-iconview-invalid-svg",this);const t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:i}of Array.from(e.attributes))Nu.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}class Bu extends Au{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class Lu extends Au{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new Bu){super(e);const i=this.bindTemplate,o=me();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new Nu,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",(e=>!e)),i.if("isVisible","ck-hidden",(e=>!e)),i.to("isOn",(e=>e?"ck-on":"ck-off")),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",(e=>e||"button")),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,(e=>!e)),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||zu(i))&&String(!!e))),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||!zu(i))&&String(!!e))),Y.isSafari&&(this._focusDelayed||(this._focusDelayed=ci((()=>this.focus()),0)),n.on.mousedown=i.to((()=>{this._focusDelayed()})),n.on.mouseup=i.to((()=>{this._focusDelayed.cancel()}))),this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",((e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)})),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new Au;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>Ut(e)))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=Ut(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function zu(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class ju extends Au{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new Nu,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new Au(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class $u extends(xe()){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];"string"==typeof i&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,((e,i)=>{this[t](),i()}),e.keystrokeHandlerOptions)}this.on("forwardCycle",(()=>this.focusFirst()),{priority:"low"}),this.on("backwardCycle",(()=>this.focusLast()),{priority:"low"})}get first(){return this.focusables.find(qu)||null}get last(){return this.focusables.filter(qu).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o})),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",(e=>{const i=t();this.focusNext(),i!==t()&&e.stop()}),{priority:"low"}),this.listenTo(e,"backwardCycle",(e=>{const i=t();this.focusPrevious(),i!==t()&&e.stop()}),{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const i=this.focusables.get(n);if(qu(i)){o=i;break}n=(n+t+e)%t}while(n!==i);return o}}function qu(e){return Hu(e)&&Ct(e.element)}function Hu(e){return!(!("focus"in e)||"function"!=typeof e.focus)}class Wu extends Au{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new ri,this._focusTracker=new ii,this._focusables=new tu,this.focusCycler=new $u({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new Lu(this.locale);let i;for(i in e.on("execute",(()=>t.onExecute())),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}}class Uu extends Au{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const Ku="screen-center",Gu="editor-center",Ju="editor-top-side",Zu="editor-top-center",Qu="editor-bottom-center",Yu="editor-above-center",Xu="editor-below-center",eh=yt("px");class th extends(Ru(Au)){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const n=this.bindTemplate,s=e.t;this.set("className",""),this.set("ariaLabel",s("Editor dialog")),this.set("isModal",!1),this.set("position",Ku),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new ri,this.focusTracker=new ii,this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",(e=>!e)),n.if("_isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",(e=>eh(e))),left:n.to("_left",(e=>eh(e))),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",((e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())})),this.on("drag",((e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)})),this.listenTo(J.window,"resize",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.listenTo(J.document,"scroll",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.on("change:_isVisible",((e,t,i)=>{i&&(this._isTransparent=!0,setTimeout((()=>{this.updatePosition(),this._isTransparent=!1,this.focus()}),10))})),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new ju(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof Au&&(o=[o]),this.contentView=new Uu(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new Wu(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e{var t;this._focusables.add(e),this.focusTracker.add(e.element),Hu(t=e)&&"focusCycler"in t&&t.focusCycler instanceof $u&&this._focusCycler.chain(e.focusCycler)}))}_createCloseButton(){const e=new Lu(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:qc}),e.on("execute",(()=>this.fire("close",{source:"closeButton"}))),e}}class ih extends fc{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),ih._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",((e,t)=>{this._show(t)})),this.on("show",((e,t)=>{t.onShow&&t.onShow(this)}),{priority:"low"}),this.on("hide",(()=>{ih._visibleDialogPlugin&&ih._visibleDialogPlugin._hide()})),this.on("hide",(()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)}),{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",((t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())}))}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",(()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()}))}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:s,className:r,isModal:a,position:l,onHide:c,keystrokeHandlerOptions:d}){const u=this.editor;this.view=new th(u.locale,{getCurrentDomRoot:()=>u.editing.view.getDomRoot(u.model.document.selection.anchor.root.rootName),getViewportOffset:()=>u.ui.viewportOffset,keystrokeHandlerOptions:d});const h=this.view;h.on("close",(()=>{this.hide()})),u.ui.view.body.add(h),u.keystrokes.listenTo(h.element),l||(l=a?Ku:Gu),a&&this._lockBodyScroll(),h.set({position:l,_isVisible:!0,className:r,isModal:a}),h.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:s}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,ih._visibleDialogPlugin=this}hide(){ih._visibleDialogPlugin&&ih._visibleDialogPlugin.fire(`hide:${ih._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,ih._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class oh extends Lu{_checkIconHolderView=new nh;constructor(e,t=new Bu){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",((e,t)=>e||t))}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",(e=>this.isToggleable&&e)),this.on("change:_hasCheck",((e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)}))}}class nh extends Au{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",(e=>e?"ck-on":"ck-off"))]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",((e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)}))}_createCheckIconView(){const e=new Nu;return e.content=Hc,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class sh extends oh{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class rh extends fc{contentView=null;static get requires(){return[ih]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e})),e.ui.componentFactory.add("menuBar:accessibilityHelp",(()=>{const e=this._createButton(sh);return e.label=t("Accessibility"),e})),e.keystrokes.set("Alt+0",((e,t)=>{this._toggleDialog(),t()})),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=new e(t.locale);return o.set({keystroke:"Alt+0",icon:zc,isToggleable:!0}),o.on("execute",(()=>this._toggleDialog())),o.bind("isOn").to(i,"id",(e=>"accessibilityHelp"===e)),o}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function o(e,t){const o=[t.getAttribute("aria-label"),i("Press %0 for help.",[Ut("Alt+0")])].filter((e=>e)).join(". ");e.setAttribute("aria-label",o,t)}e.ui.on("ready",(()=>{t.change((e=>{for(const i of t.document.roots)o(e,i)})),e.on("addRoot",((i,n)=>{const s=e.editing.view.document.getRoot(n.rootName);t.change((e=>o(e,s)))}),{priority:"low"})}))}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new Fu(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:zc,hasCloseButton:!0,content:this.contentView})}}class ah extends tu{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new iu({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),ah._bodyWrapper&&ah._bodyWrapper.isConnected||(ah._bodyWrapper=Ke(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(ah._bodyWrapper)),ah._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),ah._bodyWrapper&&!ah._bodyWrapper.childElementCount&&(ah._bodyWrapper.remove(),delete ah._bodyWrapper)}}const lh=yt("px"),ch={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class dh extends Au{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",(e=>`ck-balloon-panel_${e}`)),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",lh),left:t.to("left",lh)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=uh(e.target);if(t&&!Ct(t))return!1;this.show();const i=dh.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:J.document.body,fitInViewport:!0},e),n=dh._getOptimalPosition(o)||ch,s=parseInt(n.left),r=parseInt(n.top),a=n.name,l=n.config||{},{withArrow:c=!0}=l;return this.top=r,this.left=s,this.position=a,this.withArrow=c,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=uh(e.target);const i=e.limiter?uh(e.limiter):J.document.body;if(this.listenTo(J.document,"scroll",((o,n)=>{const s=n.target,r=t&&s.contains(t),a=i&&s.contains(i);!r&&!a&&t&&i||this.attachTo(e)}),{useCapture:!0}),this.listenTo(J.window,"resize",(()=>{this.attachTo(e)})),!this._resizeObserver&&(t&&at(t)&&(t=t.parentElement),t)){const e=()=>{Ct(t)||this.unpin()};this._resizeObserver=new bt(t,e)}return!0}_stopPinning(){this.stopListening(J.document,"scroll"),this.stopListening(J.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=dh.arrowSideOffset,heightOffset:i=dh.arrowHeightOffset,stickyVerticalOffset:o=dh.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left-i.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(e,i)=>({top:s(e,i),left:e.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(e,i)=>({top:s(e,i),left:e.right-i.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:e=>({top:r(e),left:e.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(e,t)=>({top:r(e),left:e.left-t.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.left-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(e,i)=>({top:r(e),left:e.left-i.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:e=>({top:r(e),left:e.left+e.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(e,t)=>({top:r(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(e,i)=>({top:r(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:e=>({top:r(e),left:e.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(e,t)=>({top:r(e),left:e.right-t.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.right-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(e,i)=>({top:r(e),left:e.right-i.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(e,t,i)=>{const s=new ut(J.document.body).getIntersection(i.getVisible());if(!s)return null;const r=s.getVisible();return e.getIntersection(r)&&r.top-e.top-othis._showBalloon()),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",(()=>this._handleEditorReady()))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",((e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()})),e.ui.focusTracker.on("change:focusedElement",((e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()})),e.ui.on("update",(()=>{this._showBalloonThrottled()})))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new dh,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t="right"===e.side?function(e,t){return mh(e,t,((e,i)=>e.left+e.width-i.width-t.horizontalOffset))}(this._lastFocusedEditableElement,e):function(e,t){return mh(e,t,(e=>e.left+t.horizontalOffset))}(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const o=Array.from(e.ui.getEditableElementsNames()).map((t=>e.ui.getEditableElement(t)));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function mh(e,t,i){return(o,n)=>{const s=new ut(e);if(s.width<350||s.height<50)return null;let r;r="inside"===t.position?s.bottom-n.height:s.bottom-n.height/2,r-=t.verticalOffset;const a=i(s,n),l=o.clone().moveTo(a,r).getIntersection(n.clone().moveTo(a,r)).getVisible();return!l||l.getArea()\n',isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to((e=>e.preventDefault()))}}]})}}class fh extends Lu{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Au;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class bh extends(yh(Lu)){}class wh extends(yh(oh)){}function yh(e){return class extends e{_fileInputView;constructor(...e){super(...e),this._fileInputView=new _h(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",(()=>{this._fileInputView.open()})),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}}class _h extends Au{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to((()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}class kh extends Au{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new Lu(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:Uc}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",(e=>!e)),e.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),e}}function vh(e,t){const i=e.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map((e=>{const t=o[e.label];return t&&t!=e.label&&(e.label=t),e}))}function Ch(e){return e.map(Ah).filter((e=>!!e))}function Ah(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class xh extends Lu{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",(e=>Y.isMediaForcedColors?null:e))},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Eh extends Au{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),i.forEach((e=>{const t=new xh;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",(()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})})),this.items.add(t)})),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",((e,t,i)=>{for(const e of this.items)e.isOn=e.color===i}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",((e,t)=>{this.focusTracker.add(t.element)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t.element)})),this.keystrokes.listenTo(this.element),Vu({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function Th(e,t){if(!e)return"";const i=Ph(e);if(!i)return"";if(i.space===t)return e;if(o=i,!Object.keys(xd).includes(o.space))return"";var o;const n=xd[i.space][t];if(!n)return"";return function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}(n("hex"===i.space?i.hexValue:i.values),t)}function Ph(e){if(e.startsWith("#")){const t=ad(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}const t=ad(e);return t.space?t:null}class Sh extends Au{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${me()}`,o=`ck-labeled-field-view-status-${me()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((e,t)=>e||t));const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",(e=>!e)),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Du(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Au(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(e=>!e))],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Ih extends Au{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new ii,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class Rh extends Ih{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Oh extends Rh{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class Vh extends Rh{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}class Dh extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",(e=>`ck-dropdown__panel_${e}`)),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{const t=e.target;t instanceof Element&&"input"===t.tagName.toLocaleLowerCase()||e.preventDefault()}))}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():be("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class Fh extends Au{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ri,this.focusTracker=new ii,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",(e=>!e))],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.on("change:isOpen",((e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=Fh._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:s,southMiddleEast:r,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Fh.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,o,r,a,e,n,s,l,c,t]:[o,i,a,r,e,s,n,c,l,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})};static _getOptimalPosition=At}class Mh extends Lu{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Uc,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class Nh extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class Bh extends Au{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class Lh extends Au{labelView;items;children;constructor(e,t=new Du){super(e);const i=this.bindTemplate,o=new zh(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){if(this.items){const e=this.items.find((e=>!(e instanceof Bh)));e&&e.focus()}}}class zh extends Au{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new tu,this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this._focusCycler=new $u({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof Lh?this._registerFocusableItemsGroup(e):e instanceof Nh&&this._registerFocusableListItem(e);this.items.on("change",((e,t)=>{for(const e of t.removed)e instanceof Lh?this._deregisterFocusableItemsGroup(e):e instanceof Nh&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof Lh?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach(((e,i)=>{const o=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,o)}));const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class jh extends Au{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class $h extends Au{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function qh(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}const Hh=(()=>({alignLeft:jc,bold:$c,importExport:'',paragraph:'',plus:'',text:'',threeVerticalDots:od,pilcrow:'',dragIndicator:''}))();class Wh extends Au{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Uh(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n="rtl"===e.uiLanguageDirection;this._focusCycler=new $u({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to((e=>{e.target===r.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new Gh(this):new Kh(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",((e,t)=>{this.focusTracker.add(t)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),"dynamic"===e?(this._behavior=new Gh(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Kh(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const o=qh(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map((e=>s(e)?this._createNestedToolbarDropdown(e,t,n):"|"===e?new jh:"-"===e?new $h:t.create(e))).filter((e=>!!e))}_cleanItemsConfiguration(e,t,i){const o=e.filter(((e,o,n)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(be("toolbarview-line-break-ignored-when-grouping-items",n),!1):!(!s(e)&&!t.has(e))||(be("toolbarview-item-unavailable",{item:e}),!1))));return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,o=e.findIndex(t);if(-1===o)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter(((e,i,o)=>{if(t(e))return!0;return!(i>0&&o[i-1]===e)}))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:s,tooltip:r=!0,withText:a=!1}=e;if(s=this._cleanItemsConfiguration(s,t,i),!s.length)return null;const l=Zh(this.locale);return o||be("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:o,tooltip:r,withText:!!a}),!1!==n?l.buttonView.icon=Hh[n]||n||od:l.buttonView.withText=!0,Qh(l,(()=>l.toolbarView._buildItemsFromConfig(s,t,i))),l}}class Uh extends Au{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Kh{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using((e=>e)),e.focusables.bindTo(e.items).using((e=>Hu(e)?e:null))}render(){}destroy(){}}class Gh{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",((e,t)=>{const i=t.index,o=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()}))}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let t=0;to.right-this.cachedPadding:i.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new jh),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=Zh(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Qh(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:od}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{Hu(e)&&this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Jh extends Au{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new ri,this.focusTracker=new ii,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",(e=>!e)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new Lu;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new Lu,t=e.bindTemplate;return e.icon=Uc,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function Zh(e,t=Mh){const i="function"==typeof t?new t(e):t,o=new Dh(e),n=new Fh(e,i,o);return i.bind("isEnabled").to(n),i instanceof Jh?i.arrowView.bind("isOn").to(n,"isOpen"):i.bind("isOn").to(n,"isOpen"),function(e){(function(e){Su({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...im(e.focusTracker).filter((t=>!e.element.contains(t)))]})})(e),function(e){e.on("execute",(t=>{t.source instanceof fh||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,i,o)=>{!o&&e.isOpen&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isOpen&&(e.panelView.focus(),i())})),e.keystrokes.set("arrowup",((t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{if(o)return;e.focusTracker.elements.some((e=>e.contains(J.document.activeElement)))&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{o&&e.panelView.focus()}),{priority:"low"})}(e)}(n),n}function Qh(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Yh(e,t,i):e.once("change:isOpen",(()=>Yh(e,t,i)),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&tm(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function Yh(e,t,i){const o=e.locale,n=o.t,s=e.toolbarView=new Wh(o),r="function"==typeof t?t():t;s.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(s.maxWidth=i.maxWidth),i.class&&(s.class=i.class),i.isCompact&&(s.isCompact=i.isCompact),i.isVertical&&(s.isVertical=!0),r instanceof tu?s.items.bindTo(r).using((e=>e)):s.items.addMany(r),e.panelView.children.add(s),e.focusTracker.add(s),s.items.delegate("execute").to(e)}function Xh(e,t,i={}){e.isOpen?em(e,t,i):e.once("change:isOpen",(()=>em(e,t,i)),{priority:"highest"}),tm(e,(()=>e.listView.items.find((e=>e instanceof Nh&&e.children.first.isOn))))}function em(e,t,i){const o=e.locale,n=e.listView=new zh(o),s="function"==typeof t?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,om(e,n.items,s,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function tm(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():be("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))}),{priority:ge.low-10})}function im(e){return[...e.elements,...e.externalViews.flatMap((e=>im(e.focusTracker)))]}function om(e,t,i,o){!function(e){let t=0;const i=e=>e instanceof Nh&&e.children.first instanceof oh?e.children.first:null,o=e=>{const t=i(e);return t&&t.isToggleable?t:null},n=t=>{for(const o of e){const e=i(o);e&&(e.hasCheckSpace=t)}};e.on("change",((e,s)=>{const r=t>0;for(const e of s.removed)o(e)&&t--;for(const e of s.added){const o=i(e);o&&(o.isToggleable&&t++,o.hasCheckSpace=t>0)}const a=t>0;r!==a&&n(a)}))}(t),t.bindTo(i).using((t=>{if("separator"===t.type)return new Bh(o);if("group"===t.type){const i=new Lh(o);return i.set({label:t.label}),om(e,i.items,t.items,o),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e="menuitemcheckbox"===t.model.role||"menuitemradio"===t.model.role,i=new Nh(o);let n;return"button"===t.type?(n=new oh(o,t.labelView),n.set({isToggleable:e})):n=new fh(o),n.bind(...Object.keys(t.model)).to(t.model),n.delegate("execute").to(i),i.children.add(n),i}return null}))}const nm=(e,t,i)=>{const o=new Oh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},sm=(e,t,i)=>{const o=new Vh(e.locale);return o.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},rm=(e,t,i)=>{const o=Zh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o};class am extends Au{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=Li((e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})}),150,{leading:!0}),this.on("set:color",((e,t,i)=>{e.return=Th(i,this._config.format||"hsl")})),this.on("change:color",(()=>{this._hexColor=lm(this.color)})),this.on("change:_hexColor",(()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),lm(this.color)!=lm(this._hexColor)&&(this.color=this._hexColor)}))}render(){var e,t;if(super.render(),e="hex-color-picker",t=eu,void 0===customElements.get(e)&&customElements.define(e,t),this.picker=J.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",(e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)}))}focus(){if(!this._config.hideInput&&(Y.isGecko||Y.isiOS||Y.isSafari||Y.isBlink)){this.hexInputRow.children.get(1).focus()}this.slidersView.first.focus()}_createSlidersView(){const e=[...this.picker.shadowRoot.children].filter((e=>"slider"===e.getAttribute("role"))).map((e=>new cm(e)));this.slidersView=this.createCollection(),e.forEach((e=>{this.slidersView.add(e)}))}_createInputRow(){const e=this._createColorInput();return new um(this.locale,e)}_createColorInput(){const e=new Sh(this.locale,nm),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",(t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t)),e.fieldView.on("input",(()=>{const t=e.fieldView.element.value;if(t){const e=hm(t);e&&this._debounceColorPickerEvent(e)}})),e}isValid(){const{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function lm(e){let t=function(e){if(!e)return"";const t=Ph(e);return t?"hex"===t.space?t.hexValue:Th(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class cm extends Au{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class dm extends Au{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class um extends Au{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new dm,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return hm(this.inputView.fieldView.element.value)}}function hm(e){if(!e)return null;const t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class mm extends(Be(ei)){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(e,t){return this.find((t=>t.color===e.color))?this:super.add(e,t)}hasColor(e){return!!this.find((t=>t.color===e))}}class gm extends Au{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:a,focusables:l}){super(e);const c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new mm,this.documentColorsCount=s,this._focusables=l,this._removeButtonLabel=o,this._colorPickerLabel=r,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",(e=>!e))]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const i=e.createRangeIn(n);for(const e of i.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=iu.bind(this.documentColors,this.documentColors),t=new Au(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new Lu,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:'',class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",(()=>{this.fire("colorPicker:show")}))}_createRemoveColorButton(){const e=new Lu;return e.set({withText:!0,icon:'',label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",(()=>{this.fire("execute",{value:null,source:"removeColorButton"})})),e.render(),e}_createStaticColorsGrid(){const e=new Eh(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",((e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})})),e}_createDocumentColorsGrid(){const e=iu.bind(this.documentColors,this.documentColors),t=new Eh(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using((e=>{const t=new xh;return t.set({color:e.color,hasBorder:e.options?.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",(()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})})),t})),this.documentColors.on("change:isEmpty",((e,i,o)=>{o&&(t.selectedColor=null)})),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find((t=>t.color===e));t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class pm extends Au{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const s=this.bindTemplate,{saveButtonView:r,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=r,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:r,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",(e=>!e))]},children:this.items})}render(){super.render();const e=new am(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",((t,i,o)=>{e.color=o})),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",(e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())}))}_stopPropagationOnArrowsKeys(){const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new Au,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new Lu(e),o=new Lu(e);return i.set({icon:Hc,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:qc,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",(()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})})),o.on("execute",(()=>{this.fire("colorPicker:cancel")})),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",((e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)}))}}class fm extends Au{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this._focusables=new tu,this._colorPickerViewConfig=a,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new gm(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new pm(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",((e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)})),this.colorGridsFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.colorPickerFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{this.showColorPickerFragment()})),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class bm{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(wm(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new fe("componentfactory-item-missing",this,{name:e});return this._components.get(wm(e)).callback(this.editor.locale)}has(e){return this._components.has(wm(e))}}function wm(e){return String(e).toLowerCase()}const ym="ck-tooltip";class _m extends(et()){tooltipTextView;balloonPanelView;static defaultBalloonPositions=dh.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),_m._editors.add(e),_m._instance)return _m._instance;_m._instance=this,this.tooltipTextView=new Au(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new dh(e.locale),this.balloonPanelView.class=ym,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver((()=>{e()}));return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}((()=>{this._updateTooltipPosition()})),this._pinTooltipDebounced=Li(this._pinTooltip,600),this._unpinTooltipDebounced=Li(this._unpinTooltip,400),this.listenTo(J.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(J.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(J.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(J.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(J.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(J.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;_m._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),_m._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),_m._instance=null)}static getPositioningFunctions(e){const t=_m.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=km(t);i?i!==this._currentElementWithTooltip?(this._unpinTooltip(),"focus"===e.name&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,vm(i)):this._pinTooltipDebounced(i,vm(i))):this._unpinTooltipDebounced.cancel():"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!L(t))return;const e=this.balloonPanelView.element,o=e&&(e===i||e.contains(i)),n=!o&&t===e;if(o)return void this._unpinTooltipDebounced.cancel();if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const s=km(t),r=km(i);(n||s&&s!==r)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||s&&s.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=ti(_m._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[ym,o].filter((e=>e)).join(" "),this.balloonPanelView.pin({target:e,positions:_m.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const e of _m._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of _m._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=vm(this._currentElementWithTooltip);Ct(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:_m.getPositioningFunctions(e.position)}):this._unpinTooltip()}}function km(e){return L(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function vm(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}class Cm extends hh{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const e=xm(this.editor.config.get("licenseKey"));return Boolean(e&&this.licenseTypeMessage[e])}_createBadgeContent(){const e=xm(this.editor.config.get("licenseKey"));return new Am(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class Am extends Au{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function xm(e){if("GPL"==e)return"GPL";const t=di(e.split(".")[1]);return t?t.licenseType||"production":null}class Em extends Nh{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const Tm={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",(t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(const i of e.menus){const e=t.path[0],o=e instanceof Em&&e.children.first===i;i.isOpen=(t.path.includes(i)||o)&&i.isEnabled}t.source.focus()}}))},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const o=e.children.getIndex(t),n=t.isOpen,s=e.children.length,r=e.children.get((o+s+i)%s);t.isOpen=!1,n&&(r.isOpen=!0),r.buttonView.focus()}e.on("menu:arrowright",(e=>{i(e.source,t?-1:1)})),e.on("menu:arrowleft",(e=>{i(e.source,t?1:-1)}))},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",(()=>{e.isOpen||e.menus.forEach((e=>{e.isOpen=!1}))}))},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",((t,i,o)=>{o&&e.menus.filter((e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen)).forEach((e=>{e.isOpen=!1}))}))},closeOnClickOutside(e){Su({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map((e=>e.element))})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",((i,o,n)=>{n||(t||(e.isFocusBorderEnabled=!1),t=!1)})),e.listenTo(e.element,"keydown",(()=>{t=!0}),{useCapture:!0}),e.listenTo(e.element,"keyup",(()=>{t=!1}),{useCapture:!0}),e.listenTo(e.element,"focus",(()=>{t&&(e.isFocusBorderEnabled=!0)}),{useCapture:!0})}},Pm={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!0}))},toggleOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!e.isOpen}))},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",((t,i,o)=>{o||t.source!==e.parentMenuView||(e.isOpen=!1)}))}},Sm={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},Im=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Rm({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){const n=j(e);return Om(e,n,o),function(e,t){const i=t.removeItems,o=[];t.items=t.items.filter((({menuId:e})=>!i.includes(e)||(o.push(e),!1))),Mm(t.items,(e=>{e.groups=e.groups.filter((({groupId:e})=>!i.includes(e)||(o.push(e),!1)));for(const t of e.groups)t.items=t.items.filter((e=>{const t=zm(e);return!i.includes(t)||(o.push(t),!1)}))}));for(const t of i)o.includes(t)||be("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,n),Om(e,n,n.addItems),function(e,t,i){Mm(t.items,(o=>{for(const n of o.groups)n.items=n.items.filter((n=>{const s="string"==typeof n&&!i.has(n);return s&&!t.isUsingDefaultConfig&&be("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:j(o),componentName:n}),!s}))}))}(e,n,i),Dm(e,n),function(e,t){const i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Mm(e.items,(e=>{e.label in o&&(e.label=o[e.label])}))}(n,t),n}function Om(e,t,i){const o=[];if(0!=i.length){for(const e of i){const i=Bm(e.position),s=Lm(e.position);if("object"==typeof(n=e)&&"menu"in n)if(s){const n=t.items.findIndex((e=>e.menuId===s));if(-1!=n)"before"===i?(t.items.splice(n,0,e.menu),o.push(e)):"after"===i&&(t.items.splice(n+1,0,e.menu),o.push(e));else{Vm(t,e.menu,s,i)&&o.push(e)}}else"start"===i?(t.items.unshift(e.menu),o.push(e)):"end"===i&&(t.items.push(e.menu),o.push(e));else if(Nm(e))Mm(t.items,(t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),o.push(e)):"end"===i&&(t.groups.push(e.group),o.push(e));else{const n=t.groups.findIndex((e=>e.groupId===s));-1!==n&&("before"===i?(t.groups.splice(n,0,e.group),o.push(e)):"after"===i&&(t.groups.splice(n+1,0,e.group),o.push(e)))}}));else{Vm(t,e.item,s,i)&&o.push(e)}}var n;for(const t of i)o.includes(t)||be("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function Vm(e,t,i,o){let n=!1;return Mm(e.items,(e=>{for(const{groupId:s,items:r}of e.groups){if(n)return;if(s===i)"start"===o?(r.unshift(t),n=!0):"end"===o&&(r.push(t),n=!0);else{const e=r.findIndex((e=>zm(e)===i));-1!==e&&("before"===o?(r.splice(e,0,t),n=!0):"after"===o&&(r.splice(e+1,0,t),n=!0))}}})),n}function Dm(e,t){const i=t.isUsingDefaultConfig;let o=!1;t.items=t.items.filter((t=>!!t.groups.length||(Fm(e,t,i),!1))),t.items.length?(Mm(t.items,(t=>{t.groups=t.groups.filter((e=>!!e.items.length||(o=!0,!1)));for(const n of t.groups)n.items=n.items.filter((t=>!(jm(t)&&!t.groups.length)||(Fm(e,t,i),o=!0,!1)))})),o&&Dm(e,t)):Fm(e,e,i)}function Fm(e,t,i){i||be("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function Mm(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)jm(e)&&i(e)}}function Nm(e){return"object"==typeof e&&"group"in e}function Bm(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function Lm(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function zm(e){return"string"==typeof e?e:e.menuId}function jm(e){return"object"==typeof e&&"menuId"in e}class $m extends(Be()){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new bm(e),this.focusTracker=new ii,this.tooltipManager=new _m(e),this.poweredBy=new gh(e),this.evaluationBadge=new Cm(e),this.ariaLiveAnnouncer=new Eu(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",(()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0})),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:j(Im),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",((e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())})),this.editor.keystrokes.set("Alt+F9",((i,o)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),o())}))}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",((e,i)=>{this._saveLastFocusedForeignElement();const o=this._getCurrentFocusedToolbarDefinition();o&&t||(t=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const o=this._getCurrentFocusedToolbarDefinition();o&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),o.options.afterBlur&&o.options.afterBlur(),i())}))}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(Ct(i.element)||o.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>qm(e)-qm(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!Ct(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",((e,t)=>{this.focusTracker.add(t.element)})),e.on("remove",((e,t)=>{this.focusTracker.remove(t.element)}))}_initViewportOffset(e){this.on("set:viewportOffset",((e,t,i)=>{const o=this._getVisualViewportTopOffset(i);i.visualTop!==o&&(e.return={...i,visualTop:o})})),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!J.window.visualViewport)return;const e=()=>{const e=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==e&&(this.viewportOffset={...this.viewportOffset,visualTop:e})};this._domEmitter=new(et()),this._domEmitter.listenTo(J.window.visualViewport,"scroll",e),this._domEmitter.listenTo(J.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const t=St().top,i=e.top||0;return t>i?0:i-t}}function qm(e){const{toolbarView:t,options:i}=e;let o=10;return Ct(t.element)&&o--,i.isContextual&&(o-=2),o}class Hm extends Au{body;menuBarView;toolbar;constructor(e){super(e),this.body=new ah(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Wm extends Au{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((i=>{const o=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",o)}))}e.isRenderingInProgress?function i(o){e.once("change:isRenderingInProgress",((e,n,s)=>{s?i(o):t(o)}))}(this):t(this)}}class Um extends Wm{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change((t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)}))}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[o];if("function"==typeof t)return t(this);if(i){const e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",o)}}class Km extends Au{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...Qt(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach((e=>this.children.add(e))),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",(e=>e.join(" "))),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class Gm extends Cc{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",((e,t)=>{window.alert(t.message)}),{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Jm extends(Be()){constructor(e,t){super(),t&&Mi(this,t),e&&this.set(e)}}const Zm=yt("px");class Qm extends fc{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new fe("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new fe("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new fe("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new dh(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ym(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>1)),e.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((e,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,i])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new Xm(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?Math.min(e-1,2):0)),e.listenTo(this.view,"change:top",(()=>e.updatePosition())),e.listenTo(this.view,"change:left",(()=>e.updatePosition())),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Ym extends Au{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ii,this.buttonPrevView=this._createButtonView(t("Previous"),ed),this.buttonNextView=this._createButtonView(t("Next"),Kc),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Lu(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Xm extends Au{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:i.to("top",Zm),left:i.to("left",Zm),width:i.to("width",Zm),height:i.to("height",Zm)}},children:this.content}),this.on("change:numberOfPanels",((e,t,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new Au;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new ut(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}class eg extends oh{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Uc,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class tg extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",(e=>`ck-menu-bar__menu__panel_position_${e}`)),t.if("isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}class ig extends Au{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new eg(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new tg(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ri,this.focusTracker=new ii,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",(e=>!e)),t.if("parentMenuView","ck-menu-bar__menu_top-level",(e=>!e))]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Pm.closeOnEscKey(this),this._closeOnDisabled(),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Pm.openOnButtonClick(this),Pm.openOnArrowRightKey(this),Pm.closeOnArrowLeftKey(this),Pm.openAndFocusOnEnterKeyPress(this),Pm.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Pm.openAndFocusPanelOnArrowDownKey(this),Pm.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",((e,t)=>{this.fire("arrowright"),t()})),this.keystrokes.set("arrowleft",((e,t)=>{this.fire("arrowleft"),t()}))}_closeOnDisabled(){this.on("change:isEnabled",((e,t,i)=>{i||(this.isOpen=!1)}))}_repositionPanelOnOpen(){this.on("change:isOpen",((e,t,i)=>{if(!i)return;const o=ig._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName}))}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:s,westNorth:r,eastNorth:a}=Sm;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[s,a,n,r]:[e,t,i,o]:this.parentMenuView?[n,r,s,a]:[t,e,o,i]}get _defaultMenuPositionName(){return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=At}class og extends zh{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some((e=>{const t=ng(e);return t&&t.isToggleable}));this.items.forEach((t=>{const i=ng(t);i&&(i.hasCheckSpace=e)}))}}function ng(e){return e instanceof Nh?e.children.map((e=>function(e){return"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof Lu}(e)?e.buttonView:e)).find((e=>e instanceof oh)):null}class sg extends wh{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const rg=["mouseenter","arrowleft","arrowright","change:isOpen"];class ag extends Au{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=Rm({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map((e=>this._createMenu({componentFactory:t,menuDefinition:e})));this.children.addMany(o)}render(){super.render(),Tm.toggleMenusAndFocusItemsOnHover(this),Tm.closeMenusWhenTheBarCloses(this),Tm.closeMenuWhenAnotherOnTheSameLevelOpens(this),Tm.focusCycleMenusOnArrows(this),Tm.closeOnClickOutside(this),Tm.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...rg).to(t),e.parentMenuView=t):e.delegate(...rg).to(this,(e=>"menu:"+e)),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new ig(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",(()=>{const i=new og(o);i.ariaLabel=t.label,n.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))})),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const e of r.items){const r=new Em(o,t);if(s(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{const o=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!o)continue;r.children.add(o)}n.push(r)}r!==e.groups[e.groups.length-1]&&n.push(new Bh(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof ig||o instanceof sh||o instanceof sg?(this._registerMenuTree(o,t),o.on("execute",(()=>{this.close()})),o):(be("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof ig))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter((e=>e instanceof og))[0];if(!i)return void e.delegate("mouseenter").to(t);const o=i.items.filter((e=>e instanceof Nh));for(const t of o)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",((t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout((()=>{this.isOpen=Array.from(this.children).some((e=>e.isOpen))}),0)}))}}class lg extends $m{view;constructor(e,t){super(e),this.view=t}init(){const e=this.editor,t=this.view,i=e.editing.view,o=t.editable,n=i.document.getRoot();o.name=n.rootName,t.render();const s=o.element;this.setEditableElement(o.name,s),t.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(s),this._initPlaceholder(),this._initToolbar(),this.initMenuBar(this.view.menuBarView),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.editor,t=this.view;t.toolbar.fillFromConfig(e.config.get("toolbar"),this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.config.get("roots")[i.rootName].placeholder;o&&(i.placeholder=o),Qi({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}}class cg extends Hm{toolbar;editable;menuBarView;constructor(e,t,i={}){super(e),this.toolbar=new Wh(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.menuBarView=new ag(e),this.editable=new Um(e,t,i.editableElement,{label:i.label}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}}),this.menuBarView.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.menuBarView,this.toolbar,this.editable])}}class dg extends(Fc(Vc)){static get editorName(){return"DecoupledEditor"}ui;constructor(e,t={}){const{sourceElementOrData:i,editorConfig:o}=function(e,t){return"string"==typeof e||Bc(e)||t&&Object.keys(t).length?{sourceElementOrData:e,editorConfig:t}:{sourceElementOrData:"",editorConfig:e}}(e,t);super(o),Mc(i,this.config);const n=this.config.get("roots").main.element;if(L(n)){if("TEXTAREA"===n.tagName)throw new fe("editor-wrong-element",null);this.sourceElement=n,function(e,t){if(t.ckeditorInstance)throw new fe("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",(()=>{delete t.ckeditorInstance}))}(this,n)}this.model.document.createRoot();const s=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new cg(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:s,label:this.config.get("roots").main.label});this.ui=new lg(this,r)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(e)}))}static create(e,t={}){return new Promise((i=>{const o=new this(e,t);i(o.initPlugins().then((()=>o.ui.init())).then((()=>o.data.init(o.config.get("roots").main.initialData))).then((()=>o.fire("ready"))).then((()=>o)))}))}}class ug{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class hg extends wc{_buffer;constructor(e,t){super(e),this._buffer=new ug(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,o=e.text||"",n=o.length;let s=i.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const r=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(e.createText(o,a),s),r?e.setSelection(r):s.is("documentSelection")||e.setSelection(s),this._buffer.unlock(),this._buffer.input(n)}))}}const mg=["insertText","insertReplacementText"],gg=[...mg,"insertCompositionText"];class pg extends Ln{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(Un);const t=Y.isAndroid?gg:mg,i=e.document;i.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{data:s,targetRanges:r,inputType:a,domEvent:l,isComposing:c}=n;if(!t.includes(a))return;this.focusObserver.flush();const d=new ue(i,"insertText");i.fire(d,new zn(e,l,{text:s,selection:e.createSelection(r),isComposing:c})),d.stop.called&&o.stop()})),Y.isAndroid||i.on("compositionend",((t,{data:o,domEvent:n})=>{this.isEnabled&&o&&i.fire("insertText",new zn(e,n,{text:o,isComposing:!0}))}),{priority:"low"})}observe(){}stopObserving(){}}class fg extends fc{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.editing.mapper,n=t.document.selection;this._typingQueue=new bg(e),i.addObserver(pg);const s=new hg(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",(()=>{this._typingQueue.flush("next beforeinput")}),{priority:"high"}),this.listenTo(i.document,"insertText",((e,r)=>{const{text:a,selection:l}=r;if(i.document.selection.isFake&&l&&i.document.selection.isSimilar(l)&&r.preventDefault(),l&&Array.from(l.getRanges()).some((e=>!e.isCollapsed))&&r.preventDefault(),!s.isEnabled)return void r.preventDefault();let c;l&&(c=Array.from(l.getRanges()).filter((e=>e.root.is("rootElement"))).map((e=>o.toModelRange(e))).map((e=>Ba(e,t.schema)||e))),c&&c.length||(c=Array.from(n.getRanges()));let d=a;if(Y.isAndroid){const e=Array.from(c[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");if(e&&(e.length<=d.length?d.startsWith(e)&&(d=d.substring(e.length),c[0].start=c[0].start.getShiftedBy(e.length)):e.startsWith(d)&&(c[0].start=c[0].start.getShiftedBy(d.length),d="")),0==d.length&&c[0].isCollapsed)return}const u={text:d,selection:t.createSelection(c)};this._typingQueue.push(u,Boolean(r.isComposing)),r.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")})),Y.isAndroid?this.listenTo(i.document,"keydown",((e,o)=>{!n.isCollapsed&&229==o.keyCode&&i.document.isComposing&&wg(t,s)})):this.listenTo(i.document,"compositionstart",(()=>{n.isCollapsed||wg(t,s)}),{priority:"high"}),this.listenTo(i.document,"mutations",((e,{mutations:t})=>{if(this._typingQueue.hasAffectedElements())for(const{node:e}of t){const t=yg(e,o),i=o.toModelElement(t);if(this._typingQueue.isElementAffected(i))return void this._typingQueue.flush("mutations")}})),this.listenTo(i.document,"compositionend",(()=>{this._typingQueue.flush("before composition end")}),{priority:"high"}),this.listenTo(i.document,"compositionend",(()=>{this._typingQueue.flush("after composition end");const e=[];if(this._typingQueue.hasAffectedElements())for(const t of this._typingQueue.flushAffectedElements()){const i=o.toViewElement(t);i&&e.push({type:"children",node:i})}!e.length&&Y.isAndroid||i.document.fire("mutations",{mutations:e})}),{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class bg{editor;flushDebounced=Li((()=>this.flush("timeout")),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){const i={text:e.text};if(e.selection){i.selectionRanges=[];for(const t of e.selection.getRanges())i.selectionRanges.push(Ts.fromRange(t)),this._affectedElements.add(t.start.parent)}this._queue.push(i),this._isComposing||=t,this.flushDebounced()}shift(){const e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map((e=>function(e){const t=e.toRange();if(e.detach(),"$graveyard"==t.root.rootName)return null;return t}(e))).filter((e=>!!e));i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){const t=this.editor,i=t.model,o=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const n=t.commands.get("insertText").buffer;i.enqueueChange(n.batch,(()=>{for(n.lock();this._queue.length;){const e=this.shift();t.execute("insertText",e)}n.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1})),o.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}}function wg(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,(()=>{e.deleteContent(e.document.selection)})),i.unlock()}function yg(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}class _g extends wc{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new ug(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;const s=e.sequence||1,r=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(o);if(this._shouldReplaceFirstBlockWithParagraph(n,s))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{a+=He(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o)))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||!n.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const o=e.getFirstPosition(),n=i.schema.getLimitElement(o),s=n.getChild(0);return o.parent==s&&(!!e.containsEntireContent(s)&&(!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=s.name))}}const kg="word",vg="selection",Cg="backward",Ag="forward",xg={deleteContent:{unit:vg,direction:Cg},deleteContentBackward:{unit:"codePoint",direction:Cg},deleteWordBackward:{unit:kg,direction:Cg},deleteHardLineBackward:{unit:vg,direction:Cg},deleteSoftLineBackward:{unit:vg,direction:Cg},deleteContentForward:{unit:"character",direction:Ag},deleteWordForward:{unit:kg,direction:Ag},deleteHardLineForward:{unit:vg,direction:Ag},deleteSoftLineForward:{unit:vg,direction:Ag}};class Eg extends Ln{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",(()=>{i++})),t.on("keyup",(()=>{i=0})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:r,inputType:a}=n,l=xg[a];if(!l)return;const c={direction:l.direction,unit:l.unit,sequence:i};c.unit==vg&&(c.selectionToRemove=e.createSelection(s[0])),"deleteContentBackward"===a&&(Y.isAndroid&&(c.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:o}of t){if(e.parent.is("$text")){const t=e.parent.data,o=e.offset;if(ui(t,o)||hi(t,o)||gi(t,o))continue;i++}else(o.is("containerElement")||o.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(s)&&(c.unit=vg,c.selectionToRemove=e.createSelection(s)));const d=new Do(t,"delete",s[0]);t.fire(d,new zn(e,r,c)),d.stop.called&&o.stop()})),Y.isBlink&&function(e){const t=e.view,i=t.document;let o=null,n=!1;function s(e){return e==$t.backspace||e==$t.delete}function r(e){return e==$t.backspace?Cg:Ag}i.on("keydown",((e,{keyCode:t})=>{o=t,n=!1})),i.on("keyup",((a,{keyCode:l,domEvent:c})=>{const d=i.selection,u=e.isEnabled&&l==o&&s(l)&&!d.isCollapsed&&!n;if(o=null,u){const e=d.getFirstRange(),o=new Do(i,"delete",e),n={unit:vg,direction:r(l),selectionToRemove:d};i.fire(o,new zn(t,c,n))}})),i.on("beforeinput",((e,{inputType:t})=>{const i=xg[t];s(o)&&i&&i.direction==r(o)&&(n=!0)}),{priority:"high"}),i.on("beforeinput",((e,{inputType:t,data:i})=>{o==$t.delete&&"insertText"==t&&""==i&&e.stop()}),{priority:"high"})}(this)}observe(){}stopObserving(){}}class Tg extends fc{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(Eg),this._undoOnBackspace=!1;const n=new _g(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new _g(e,"backward")),this.listenTo(i,"delete",((o,n)=>{i.isComposing||n.preventDefault();const{direction:s,sequence:r,selectionToRemove:a,unit:l}=n,c="forward"===s?"deleteForward":"delete",d={sequence:r};if("selection"==l){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t))).map((t=>Ba(t,e.model.schema)||t));d.selection=e.model.createSelection(t)}else d.unit=l;e.execute(c,d),t.scrollToTheSelection()}),{priority:"low"}),this.listenTo(i,"keydown",((n,s)=>{if(i.isComposing||s.keyCode!=$t.backspace||!o.selection.isCollapsed)return;const r=e.model.schema.getLimitElement(o.selection),a=e.model.createPositionAt(r,0);if(a.isTouching(o.selection.getFirstPosition())){s.preventDefault();const o=e.model.schema.getNearestSelectionRange(a,"forward");if(!o)return;const n=t.createSelection(e.editing.mapper.toViewRange(o)),r=n.getFirstRange(),l=new Do(document,"delete",r),c={unit:"selection",direction:"backward",selectionToRemove:n};i.fire(l,new zn(t,s.domEvent,c))}})),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(o,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Pg extends fc{static get requires(){return[fg,Tg]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function Sg(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce(((e,{item:o})=>o.is("$text")||o.is("$textProxy")?e+o.data:(i=t.createPositionAfter(o),"")),""),range:t.createRange(i,e.end)}}class Ig extends(Be()){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:i})=>{i&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:r}=Sg(n,i),a=this.testCallback(s);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:s,range:r});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class Rg extends fc{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==$t.arrowright,s=t.keyCode==$t.arrowleft;if(!i&&!s)return;const r=o.contentLanguageDirection;let a=!1;a="ltr"===r&&i||"rtl"===r&&s?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()}),{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Ng(n.getFirstPosition(),this.attributes)||this._restoreGravity())})),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return!this._isGravityOverridden&&((!n.isAtStart||!Og(o,t))&&(!!Ng(n,t)&&(e&&Fg(e),Og(o,t)&&Ng(n,t,!0)?Dg(i,t):this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(e&&Fg(e),this._restoreGravity(),Ng(n,t,!0)?Dg(i,t):Vg(i,t,n),!0):n.isAtStart?!!Og(o,t)&&(e&&Fg(e),Vg(i,t,n),!0):!Og(o,t)&&Ng(n,t,!0)?(e&&Fg(e),Vg(i,t,n),!0):!!Mg(n,t)&&(n.isAtEnd&&!Og(o,t)&&Ng(n,t)?(e&&Fg(e),Vg(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(ol),e.editing.view.addObserver(nl);let n=!1,s=!1;this.listenTo(o,"touchstart",(()=>{s=!1,n=!0})),this.listenTo(o,"mousedown",(()=>{s=!0})),this.listenTo(o,"selectionChange",(()=>{const e=this.attributes;if(!s&&!n)return;if(s=!1,n=!1,!i.isCollapsed)return;if(!Og(i,e))return;const o=i.getFirstPosition();Ng(o,e)&&(o.isAtStart||Ng(o,e,!0)?Dg(t,e):this._isGravityOverridden||this._overrideGravity())}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",(()=>{const o=t.getFirstPosition();Og(t,i)&&Ng(o,i)&&Dg(e,i)}),{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view;let n=!1,s=!1;this.listenTo(o.document,"delete",((e,t)=>{n="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{if(!n)return;const e=i.getFirstPosition();s=Og(i,this.attributes)&&!Mg(e,this.attributes)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{n&&(n=!1,s||e.model.enqueueChange((()=>{const e=i.getFirstPosition();Og(i,this.attributes)&&Ng(e,this.attributes)&&(e.isAtStart||Ng(e,this.attributes,!0)?Dg(t,this.attributes):this._isGravityOverridden||this._overrideGravity())})))}),{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((e=>e.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}function Og(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function Vg(e,t,i){const o=i.nodeBefore;e.change((i=>{if(o){const t=[],n=e.schema.isObject(o)&&e.schema.isInline(o);for(const[i,s]of o.getAttributes())!e.schema.checkAttribute("$text",i)||n&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,s]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)}))}function Dg(e,t){e.change((e=>{e.removeSelectionAttribute(t)}))}function Fg(e){e.preventDefault()}function Mg(e,t){return Ng(e.getShiftedBy(-1),t)}function Ng(e,t,i=!1){const{nodeBefore:o,nodeAfter:n}=e;for(const e of t){const t=o?o.getAttribute(e):void 0,s=n?n.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==s)&&s!==t)return!0}return!1}Bg('"'),Bg("'"),Bg("'"),Bg('"'),Bg('"'),Bg("'");function Bg(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Lg(e,t,i,o){return o.createRange(zg(e,t,i,!0,o),zg(e,t,i,!1,o))}function zg(e,t,i,o,n){let s=e.textNode||(o?e.nodeBefore:e.nodeAfter),r=null;for(;s&&s.getAttribute(t)==i;)r=s,s=o?s.previousSibling:s.nextSibling;return r?n.createPositionAt(r,o?"before":"after"):e}function jg(e,t,i,o){const n=e.editing.view,s=new Set;n.document.registerPostFixer((n=>{const r=e.model.document.selection;let a=!1;if(r.hasAttribute(t)){const l=Lg(r.getFirstPosition(),t,r.getAttribute(t),e.model),c=e.editing.mapper.toViewRange(l);for(const e of c.getItems())e.is("element",i)&&!e.hasClass(o)&&(n.addClass(o,e),s.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){n.change((e=>{for(const t of s.values())e.removeClass(o,t),s.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}function*$g(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class qg extends wc{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,s=i.getFirstRange(),r=s.start.parent,a=s.end.parent;if(o.isLimit(r)||o.isLimit(a))return n||r!=a||t.deleteContent(i),!1;if(n){const t=$g(e.model.schema,i.getAttributes());return Hg(e,s.start),e.setSelectionAttribute(t),!0}{const o=!(s.start.isAtStart&&s.end.isAtEnd),n=r==a;if(t.deleteContent(i,{leaveUnmerged:o}),o){if(n)return Hg(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function Hg(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const Wg={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ug extends Ln{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",((e,t)=>{i=t.shiftKey})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;let s=n.inputType;Y.isSafari&&i&&"insertParagraph"==s&&(s="insertLineBreak");const r=n.domEvent,a=Wg[s];if(!a)return;const l=new Do(t,"enter",n.targetRanges[0]);t.fire(l,new zn(e,r,{isSoft:a.isSoft})),l.stop.called&&o.stop()}))}observe(){}stopObserving(){}}class Kg extends fc{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(Ug),e.commands.add("enter",new qg(e)),this.listenTo(i,"enter",((o,n)=>{i.isComposing||n.preventDefault(),n.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Gg extends wc{execute(){const e=this.editor.model,t=e.document;e.change((i=>{!function(e,t,i){const o=i.isCollapsed,n=i.getFirstRange(),s=n.start.parent,r=n.end.parent,a=s==r;if(o){const o=$g(e.schema,i.getAttributes());Jg(e,t,n.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:o}),a?Jg(e,t,i.focus):o&&t.setSelection(r,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const o=t.getFirstRange(),n=o.start.parent,s=o.end.parent;if((Zg(n,e)||Zg(s,e))&&n!==s)return!1;return!0}(e.schema,t.selection)}}function Jg(e,t,i){const o=t.createElement("softBreak");e.insertContent(o,i),t.setSelection(o,"after")}function Zg(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Zg(e.parent,t))}class Qg extends fc{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),o.addObserver(Ug),e.commands.add("shiftEnter",new Gg(e)),this.listenTo(n,"enter",((t,i)=>{n.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Yg extends(xe()){_stack=[];add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const n=i[0];o===n||Xg(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const n=i[0];o===n||Xg(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(Xg(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&ep(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function Xg(e,t){return e&&t&&e.priority==t.priority&&tp(e.classes)==tp(t.classes)}function ep(e,t){return e.priority>t.priority||!(e.prioritytp(t.classes)}function tp(e){return Array.isArray(e)?e.sort().join(","):e}const ip="ck-widget_selected";function op(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function np(e,t,i={}){if(!e.is("containerElement"))throw new fe("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=dp,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){const i=e.getCustomProperty("widgetLabel");i.push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),i=new Nu;return i.set("content",Wc),i.render(),t.appendChild(i.element),t}));t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),ap(e,t),e}function sp(e,t,i){if(t.classes&&i.addClass(Qt(t.classes),e),t.attributes)for(const o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function rp(e,t,i){if(t.classes&&i.removeClass(Qt(t.classes),e),t.attributes)for(const o in t.attributes)i.removeAttribute(o,e)}function ap(e,t,i=sp,o=rp){const n=new Yg;n.on("change:top",((t,n)=>{n.oldDescriptor&&o(e,n.oldDescriptor,n.writer),n.newDescriptor&&i(e,n.newDescriptor,n.writer)}));t.setCustomProperty("addHighlight",((e,t,i)=>n.add(t,i)),e),t.setCustomProperty("removeHighlight",((e,t,i)=>n.remove(t,i)),e)}function lp(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),!1!==i.withAriaRole&&t.setAttribute("role","textbox",e),e.isReadOnly||t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((i,o,n)=>{t.setAttribute("contenteditable",n?"false":"true",e),n?t.removeAttribute("tabindex",e):t.setAttribute("tabindex","-1",e)})),e.on("change:isFocused",((i,o,n)=>{n?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),ap(e,t),e}function cp(e,t){const i=e.getSelectedElement();if(i){const o=gp(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function dp(){return null}function up(e){const t=e=>{const{width:t,paddingLeft:i,paddingRight:o}=e.ownerDocument.defaultView.getComputedStyle(e);return parseFloat(t)-(parseFloat(i)||0)-(parseFloat(o)||0)},i=e.parentElement;if(!i)return 0;let o=t(i);let n=0,s=i;for(;isNaN(o);){if(s=s.parentElement,++n>5)return 0;o=t(s)}return o}const hp="widget-type-around";function mp(e,t,i){return!!e&&op(e)&&!i.isInline(t)}function gp(e){return e.getAttribute(hp)}const pp=["before","after"],fp=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,bp="ck-widget__type-around_disabled";class wp extends fc{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Kg,Tg]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((i,o,n)=>{t.change((e=>{for(const i of t.document.roots)n?e.removeClass(bp,i):e.addClass(bp,i)})),n||e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view,n=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:n}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,((...e)=>{this.isEnabled&&i(...e)}),o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=gp(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,n,s)=>{const r=s.mapper.toViewElement(n.item);if(r&&mp(r,n.item,t)){!function(e,t,i){const o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);return function(e,t){for(const i of pp){const o=new iu({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(fp,!0)]});e.appendChild(o.render())}}(i,t),function(e){const t=new iu({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i}));e.insert(e.createPositionAt(i,"end"),o)}(s.writer,o,r);r.getCustomProperty("widgetLabel").push((()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;function s(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(n.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[op,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,i)=>{i.directChange&&e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=i.getSelectedElement();if(t){if(mp(e.editing.mapper.toViewElement(t),t,o))return}e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(n.removeClass(pp.map(s),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=i.mapper.toViewElement(r);if(!mp(a,r,o))return;const l=gp(t.selection);l&&(n.addClass(s(l),a),this._currentFakeCaretModelElement=r)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,i,o)=>{o||e.model.change((e=>{e.removeSelectionAttribute(hp)}))}))}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,n=o.document.selection,s=o.schema,r=i.editing.view;if(t.shiftKey)return;const a=function(e,t){const i=Kt(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let c;mp(l,i.editing.mapper.toModelElement(l),s)?c=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(c=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=gp(t.document.selection);return t.change((t=>{if(!i)return t.setSelectionAttribute(hp,e?"after":"before"),!0;if(!(i===(e?"after":"before")))return t.removeSelectionAttribute(hp),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),s=n._getObjectElementNextToSelection(e);return!!mp(t.editing.mapper.toViewElement(s),s,o)&&(i.change((t=>{n._setSelectionOverElement(s),t.setSelectionAttribute(hp,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,s=i.document.selection,r=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!mp(n.toViewElement(r),r,o)&&(i.change((t=>{t.setSelection(r,"on"),t.setSelectionAttribute(hp,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const s=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(n),r=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(n,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,s),o.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",((i,o)=>{if("atTarget"!=i.eventPhase)return;const n=t.getSelectedElement(),s=e.editing.mapper.toViewElement(n),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:mp(s,n,r)&&(this._insertParagraph(n,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())}),{context:op})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)}),{priority:"high"}),Y.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",((t,n)=>{if("atTarget"!=t.eventPhase)return;const s=gp(i.document.selection);if(!s)return;const r=n.direction,a=i.document.selection.getSelectedElement(),l="forward"==r;if("before"===s===l)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=o.getNearestSelectionRange(i.createPositionAt(a,s),r);if(t)if(t.isCollapsed){const n=i.createSelection(t.start);if(i.modifySelection(n,{direction:r}),n.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}(o,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}n.preventDefault(),t.stop()}),{context:op})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[o,n])=>{if(n&&!n.is("documentSelection"))return;const s=gp(i);return s?(e.stop(),t.change((e=>{const n=i.getSelectedElement(),r=t.createPositionAt(n,s),a=e.createSelection(r),l=t.insertContent(o,a);return e.setSelection(a),l}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,i)=>{const[,o,n={}]=i;if(o&&!o.is("documentSelection"))return;const s=gp(t);s&&(n.findOptimalPosition=s,i[3]=n)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[i])=>{if(i&&!i.is("documentSelection"))return;gp(t)&&e.stop()}),{priority:"high"})}}function yp(e){const t=e.model;return(i,o)=>{const n=o.keyCode==$t.arrowup,s=o.keyCode==$t.arrowdown,r=o.shiftKey,a=t.document.selection;if(!n&&!s)return;const l=s,c=function(e,t,i){const o=e.model;if(i){const e=t.focus,i=_p(o,e,"forward");if(!i)return;const n=o.createRange(e,i),s=kp(o.schema,n,"backward");if(s)return o.createRange(e,s)}else{const e=t.focus,i=_p(o,e,"backward");if(!i)return;const n=o.createRange(i,e),s=kp(o.schema,n,"forward");if(s)return o.createRange(s,e)}}(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(r)return}(c.isCollapsed||function(e,t,i){const o=e.model,n=e.view.domConverter;if(i){const e=o.createSelection(t.start);o.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=o.createRange(e.focus,t.end))}const s=e.mapper.toViewRange(t),r=n.viewRangeToDom(s),a=ut.getDomRangeRects(r);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,c,l))&&(t.change((e=>{const i=l?c.end:c.start;if(r){const o=t.createSelection(a.anchor);o.setFocus(i),e.setSelection(o)}else e.setSelection(i)})),i.stop(),o.preventDefault(),o.stopPropagation())}}}function _p(e,t,i){const o=e.schema,n=e.createRangeIn(t.root),s="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(r)&&!o.isInline(r))return e;if(a==s&&o.isBlock(r))return null}return null}function kp(e,t,i){const o="backward"==i?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(const{nextPosition:o}of t.getWalker({direction:i}))if(e.checkChild(o,"$text"))return o}class vp extends fc{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[wp,Tg]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",((t,i,o)=>{const n=o.writer,s=i.selection;if(s.isCollapsed)return;const r=s.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);var l;op(a)&&(o.consumable.consume(s,"selection")&&n.setSelection(n.createRangeOn(a),{fake:!0,label:(l=a,l.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),""))}))})),this.editor.editing.downcastDispatcher.on("selection",((e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection;let s=null;for(const e of n.getRanges())for(const t of e){const e=t.item;op(e)&&!Cp(e,s)&&(o.addClass(ip,e),this._previouslySelected.add(e),s=e)}}),{priority:"low"}),t.addObserver(ol),t.addObserver(sl),this.listenTo(i,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(i,"pointerdown",((...e)=>this._onPointerdown(...e))),this.listenTo(i,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[op,"$text"]}),this.listenTo(i,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(i,"arrowKey",yp(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"}),this.listenTo(i,"tab",((e,i)=>{this._selectNextEditable(i.shiftKey?"backward":"forward")&&(t.scrollToTheSelection(),i.preventDefault(),e.stop())}),{context:e=>op(e)||e.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",((e,t)=>{t.keystroke==$t.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{context:e=>e.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary)return;const i=this.editor,o=i.editing.view,n=o.document;let s=t.target;if(!s)return;if(!op(s)){const e=function(e){let t=e;for(;t;){if(t.is("editableElement")||op(t))return t;t=t.parent}return null}(s);if(!e)return;if(op(e))s=e;else{const e=function(e,t){const i=st(t.domEvent);let o=null;o=i?e.domConverter.domRangeToView(i):e.createRange(e.createPositionAt(t.target,0));if(!o)return null;const n=o.start;if(!n.parent)return null;let s=n.parent;n.parent.is("editableElement")&&(n.isAtEnd&&n.nodeBefore?s=n.nodeBefore:n.isAtStart&&n.nodeAfter&&(s=n.nodeAfter));if(s.is("$text"))return s.parent;return s}(o,t);if(!e||!op(e))return;s=e}}(Y.isAndroid||Y.isiOS)&&t.preventDefault(),n.isFocused||o.focus();const r=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),r=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(o.toModelElement(s),i.schema);return!!r&&(i.change((e=>{const t=n.isLimit(r)?null:function(e,t){const i=new os({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(r),n),i=e.createPositionAt(r,0),o=t?e.createPositionAt(t,0):e.createPositionAt(r,"end");e.setSelection(e.createRange(i,o))})),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,n=o.schema,s=o.document.selection,r=s.getSelectedElement(),a=Kt(i,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,c="up"==a||"down"==a;if(!t.shiftKey&&!s.isCollapsed){if(function(e,t){const i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter,s=o.nodeBefore;return!!n&&t.isObject(n)||!!s&&t.isObject(s)}(s,n)){const i=l?s.getLastPosition():s.getFirstPosition(),r=n.getNearestSelectionRange(i,l?"forward":"backward");r&&(o.change((e=>{e.setSelection(r)})),t.preventDefault(),e.stop())}return}const d=function(e,t){const i=e.document.selection,o=i.getSelectedElement(),n=gp(i);if(o&&"before"==n)return e.createSelection(o,"before");if(o&&"after"==n)return e.createSelection(o,"after");return e.createSelection(i.getRanges(),{backward:o&&e.schema.isObject(o)?!t:i.isBackward})}(o,l),u=o.createSelection(d);if(o.modifySelection(u,{direction:l?"forward":"backward"}),u.isEqual(d))return;u.focus.isTouching(d.focus)&&n.checkChild(u.focus.parent,"$text")&&(l?!u.focus.isAtEnd:!u.focus.isAtStart)&&o.modifySelection(u,{direction:l?"forward":"backward"});const h=l?d.focus.nodeBefore:d.focus.nodeAfter,m=u.focus.nodeBefore,g=u.focus.nodeAfter,p=l?m:g;if(t.shiftKey)(r&&n.isObject(r)||p&&n.isObject(p)||h&&n.isObject(h))&&(o.change((e=>{e.setSelection(u)})),t.preventDefault(),e.stop());else if(p&&n.isObject(p)){if(n.isInline(p)&&c)return;o.change((e=>{e.setSelection(p,"on")})),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change((e=>{let o=t.anchor.parent;for(;o.isEmpty;){const t=o;o=t.parent,e.remove(t)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;const s=e?n.focus.nodeBefore:n.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(ip,t);this._previouslySelected.clear()}_selectNextEditable(e){const t=this.editor.editing,i=t.view,o=this.editor.model,n=i.document.selection,s=o.document.selection;let r;if(s.rangeCount>1){const i=s.isBackward?s.getFirstRange():s.getLastRange();r=t.mapper.toViewPosition("forward"==e?i.end:i.start)}else r="forward"==e?n.getFirstPosition():n.getLastPosition();const a=this._findNextFocusRange(r,e);return!!a&&(o.change((e=>{e.setSelection(a)})),!0)}_findNextFocusRange(e,t){const i=this.editor.editing,o=i.view,n=this.editor.model,s=o.document.selection,r=s.editableElement,a=r.getPath();let l=s.getSelectedElement();l&&!op(l)&&(l=null);const c="forward"==t?o.createRange(e,o.createPositionAt(e.root,"end")):o.createRange(o.createPositionAt(e.root,0),e);for(const{nextPosition:e}of c.getWalker({direction:t})){const o=e.parent;if(op(o)&&o!=l){const e=i.mapper.toModelElement(o);if(!n.schema.isBlock(e))continue;if("extension"!=We(a,o.getPath()))return n.createRangeOn(e)}else if(o.is("editableElement")){if(o==r&&!l)continue;const s=i.mapper.toModelPosition(e),c=n.schema.getNearestSelectionRange(s,t);if(!c)continue;return o==r&&l?c:"extension"!=We(a,o.getPath())?n.createRangeIn(n.schema.getLimitElement(c)):c}}return null}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(op);if(!o)return!1;const n=t.toModelElement(o);return!!n&&(e.model.change((e=>{e.setSelection(n,"on")})),!0)}}function Cp(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class Ap extends fc{_toolbarDefinitions=new Map;_balloon;static get requires(){return[Qm]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",(t=>{(function(e){const t=e.getSelectedElement();return!(!t||!op(t))})(e.editing.view.document.selection)&&t.stop()}),{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container",positions:s}){if(!i.length)return void be("widget-toolbar-no-items",{toolbarId:e});const r=this.editor,a=r.t,l=new Wh(r.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new fe("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:l,getRelatedElement:o,balloonClassName:n,itemsConfig:i,positions:s,initialized:!1};r.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const e=o(r.editing.view.document.selection);e&&this._showToolbar(c,e)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const s=n.getAncestors().length;s>e&&(e=s,t=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?xp(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Ep(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const i=t.getRelatedElement(this.editor.editing.view.document.selection);xp(this.editor,i,e.positions)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function xp(e,t,i){const o=e.plugins.get("ContextualBalloon"),n=Ep(e,t,i);o.updatePosition(n)}function Ep(e,t,i){const o=e.editing.view,n=dh.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:i||[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class Tp extends(Be()){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const o=new ut(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)if(e.classList.contains(Pp(i)))return i}(e),this._referenceCoordinates=function(e,t){const i=new ut(e),o=t.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}(t,function(e){const t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=function(e,t=new ut(e)){const i=up(e);return i?t.width/i*100:0}(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Pp(e){return`ck-widget__resizer__handle-${e}`}class Sp extends Au{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",(e=>e?`ck-orientation-${e}`:""))],style:{display:e.if("_isVisible","none",(e=>!e))}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",((e,t)=>null!==e&&null!==t)),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",((t,i,o)=>"px"===e.unit?`${t}×${i}`:`${o}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,i)=>t<50||i<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class Ip extends(Be()){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((e,t)=>e&&t)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((e=>{e.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change((i=>{const o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);return e._appendHandles(i),e._appendSizeUI(i),i}));i.insert(i.createPositionAt(t,"end"),o),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new Tp(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change((e=>{const i=this._options.unit||"%",o=("%"===i?t.widthPercents:t.width)+i;e.setStyle("width",o,this._options.viewElement)}));const i=this._getHandleHost(),o=new ut(i),n=Math.round(o.width),s=Math.round(o.height),r=new ut(i);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(o),this.state.update({...t,handleHostWidth:n,handleHostHeight:s})}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change((()=>{this._cleanup(),this._options.onCommit(t)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((i=t)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=t.parentElement,n=this._getHandleHost(),s=this._viewResizerWrapper,r=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let a;if(o.isSameNode(n)){const t=e||new ut(n);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==We(r,a)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},s)}))}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(e){const t=this.state,i={x:(o=e).pageX,y:o.pageY};var o;const n=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};n&&t.activeHandlePosition.endsWith("-right")&&(s.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),n&&(s.x*=2);let r=Math.abs(t.originalWidth+s.x),a=Math.abs(t.originalHeight+s.y);return"width"==(r/t.aspectRatio>a?"width":"height")?a=r/t.aspectRatio:r=a*t.aspectRatio,{width:Math.round(r),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const o of t)e.appendChild(new iu({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=o,`ck-widget__resizer__handle-${i}`)}}).render());var i}_appendSizeUI(e){this._sizeView=new Sp,this._sizeView.render(),e.appendChild(this._sizeView.element)}}class Rp extends fc{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,t=J.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(ol),this._observer=new(et()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=ic((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())}),{priority:"lowest"}),this._observer.listenTo(J.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",(()=>{const e=i.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new Ip(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const e=i.get("WidgetToolbarRepository");t.on("begin",(()=>{e.forceDisabled("resize")}),{priority:"lowest"}),t.on("cancel",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"}),t.on("commit",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(e.viewElement,t);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;Ip.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}class Op extends fc{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),i.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(e,{writer:t})=>np(this.createTocViewElement(t),t,{label:this.label})}),i.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(e,{writer:t})=>this.createTocDataElement(t)}),e.ui.componentFactory.add(Op.buttonName,(t=>{const i=new Lu(t);return i.set({label:this.label,withText:!0}),i.on("execute",(()=>{e.model.change((t=>{const i=t.createElement("op-macro-toc",{});e.model.insertContent(i,e.model.document.selection)}))})),i}))}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(e){const t=e.createText(this.label),i=e.createContainerElement("div");return e.insert(e.createPositionAt(i,0),t),i}createTocDataElement(e){return e.createContainerElement("macro",{class:"toc"})}}const Vp=Symbol("isOPEmbeddedTable");function Dp(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(Vp)&&op(e)}(t))}function Fp(e){return _.get(e.config,"_config.openProject.context.resource")}function Mp(e){return _.get(e.config,"_config.openProject.pluginContext")}function Np(e,t){return Mp(e).services[t]}function Bp(e){return Np(e,"pathHelperService")}function Lp(e){return Np(e,"i18n")}class zp extends fc{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const e=this.editor,t=e.model,i=e.conversion,o=Mp(e);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},t.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(e,{writer:t})=>{const i=e.getAttribute("data-query-props");return t.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:i?JSON.parse(i):{}})}}),i.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,{writer:t})=>{return i=this.createEmbeddedTableView(t),o=t,this.label,o.setCustomProperty(Vp,!0,i),np(i,o,{label:"your label here"});var i,o}}),i.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,{writer:t})=>this.createEmbeddedTableDataElement(e,t)}),e.ui.componentFactory.add(zp.buttonName,(t=>{const i=new Lu(t);return i.set({label:this.text.button,withText:!0}),i.on("execute",(()=>o.runInZone((()=>{o.services.externalQueryConfiguration.show({currentQuery:{},callback:t=>e.model.change((i=>{const o=i.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:t});e.model.insertContent(o,e.model.document.selection)}))})})))),i}))}createEmbeddedTableView(e){const t=e.createText(this.text.macro_text),i=e.createContainerElement("div");return e.insert(e.createPositionAt(i,0),t),i}createEmbeddedTableDataElement(e,t){const i=e.getAttribute("opEmbeddedTableQuery")||{};return t.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(i)})}}function jp(e,t,i){e.ui.componentFactory.add(t,(t=>{const o=new Lu(t);return o.set({label:I18n.t("js.button_edit"),icon:'\n',tooltip:!0}),o.on("execute",(()=>{const t=e.model.document.selection.getSelectedElement();t&&i(t)})),o}))}const $p="ck-toolbar-container";function qp(e,t,i,o){const n=t.config.get(i+".toolbar");if(!n||!n.length)return;const s=t.plugins.get("ContextualBalloon"),r=new Wh(t.locale);function a(){t.ui.focusTracker.isFocused&&o(t.editing.view.document.selection)?c()?function(e,t){const i=e.plugins.get("ContextualBalloon");if(t(e.editing.view.document.selection)){const t=Hp(e);i.updatePosition(t)}}(t,o):s.hasView(r)||s.add({view:r,position:Hp(t),balloonClassName:$p}):l()}function l(){c()&&s.remove(r)}function c(){return s.visibleView==r}r.fillFromConfig(n,t.ui.componentFactory),e.listenTo(t.editing.view,"render",a),e.listenTo(t.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function Hp(e){const t=e.editing.view,i=dh.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class Wp extends fc{static get requires(){return[Qm]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditEmbeddedTableQuery",(e=>{const o=i.services.externalQueryConfiguration,n=e.getAttribute("opEmbeddedTableQuery")||{};i.runInZone((()=>{o.show({currentQuery:n,callback:i=>t.change((t=>{t.setAttribute("opEmbeddedTableQuery",i,e)}))})}))}))}afterInit(){qp(this,this.editor,"OPMacroEmbeddedTable",Dp)}}const Up=Symbol("isWpButtonMacroSymbol");function Kp(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(Up)&&op(e)}(t))}class Gp extends fc{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const e=this.editor,t=e.model,i=e.conversion,o=Mp(e);t.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(e,{writer:t})=>{const i=e.getAttribute("data-type")||"",o=e.getAttribute("data-classes")||"";return t.createElement("op-macro-wp-button",{type:i,classes:o})}}),i.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(e,{writer:t})=>this.createMacroViewElement(e,t)}),i.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(e,{writer:t})=>t.createContainerElement("macro",{class:"create_work_package_link","data-type":e.getAttribute("type")||"","data-classes":e.getAttribute("classes")||""})}),e.ui.componentFactory.add(Gp.buttonName,(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),i.on("execute",(()=>{o.services.macros.configureWorkPackageButton().then((t=>e.model.change((i=>{const o=i.createElement("op-macro-wp-button",{});i.setAttribute("type",t.type,o),i.setAttribute("classes",t.classes,o),e.model.insertContent(o,e.model.document.selection)}))))})),i}))}macroLabel(e){return e?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:e}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(e,t){const i=e.getAttribute("classes")||"",o=this.macroLabel(),n=t.createText(o),s=t.createContainerElement("span",{class:i});return t.insert(t.createPositionAt(s,0),n),function(e,t,i){return t.setCustomProperty(Up,!0,e),np(e,t,{label:i})}(s,t,{label:o})}}class Jp extends fc{static get requires(){return[Qm]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const e=this.editor,t=Mp(e);jp(e,"opEditWpMacroButton",(i=>{const o=t.services.macros,n=i.getAttribute("type"),s=i.getAttribute("classes");o.configureWorkPackageButton(n,s).then((t=>e.model.change((e=>{e.setAttribute("classes",t.classes,i),e.setAttribute("type",t.type,i)}))))}))}afterInit(){qp(this,this.editor,"OPMacroWpButton",Kp)}}class Zp extends(Be()){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise(((i,o)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class Qp extends fc{loaders=new ei;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Lc]}init(){this.loaders.on("change",(()=>this._updatePendingAction())),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0))}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return be("filerepository-no-upload-adapter"),null;const t=new Yp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then((e=>{this._loadersMap.set(e,t)})).catch((()=>{})),t.on("change:uploaded",(()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e})),t.on("change:uploadTotal",(()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof Yp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,i)=>{e===t&&this._loadersMap.delete(i)}))}_updatePendingAction(){const e=this.editor.plugins.get(Lc);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class Yp extends(Be()){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=me(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Zp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0)),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new fe("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new fe("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,i(e)})).catch((e=>{t.isFulfilled=!0,o(e)}))})),t}}class Xp{constructor(e,t,i){this.loader=e,this.resource=t,this.editor=i}upload(){const e=this.resource,t=Np(this.editor,"attachmentsResourceService");return e?this.loader.file.then((i=>t.attachFiles(e,[i]).toPromise().then((e=>(this.editor.model.fire("op:attachment-added",e),this.buildResponse(e[0])))).catch((e=>{console.error("Failed upload %O",e)})))):(console.warn("resource not available in this CKEditor instance"),Promise.reject("Not possible to upload attachments without resource"))}buildResponse(e){return{default:e._links.staticDownloadLocation.href}}abort(){return!1}}function ef(e){return e}function tf(e,t,i){return"function"!=typeof i?tf(e,t,(()=>{})):of(e,t,(function e(t,o,n,s,r,a){const l=i(t,o,n,s,r,a);return void 0!==l?Boolean(l):of(t,o,e,a)}),new Map)}function of(e,t,i,o){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,i,o){if(null==t)return!0;if(Array.isArray(t))return nf(e,t,i,o);if(t instanceof Map)return function(e,t,i,o){if(0===t.size)return!0;if(!(e instanceof Map))return!1;for(const[n,s]of t.entries()){if(!1===i(e.get(n),s,n,e,t,o))return!1}return!0}(e,t,i,o);if(t instanceof Set)return function(e,t,i,o){if(0===t.size)return!0;if(!(e instanceof Set))return!1;return nf([...e],[...t],i,o)}(e,t,i,o);const n=Object.keys(t);if(null==e||V(e))return 0===n.length;if(0===n.length)return!0;if(o?.has(t))return o.get(t)===e;o?.set(t,e);try{for(let s=0;s0?of(e,{...t},i,o):vi(e,t);default:return s(e)?"string"!=typeof t||""===t:vi(e,t)}}function nf(e,t,i,o){if(0===t.length)return!0;if(!Array.isArray(e))return!1;const n=new Set;for(let s=0;s{}))}function rf(e){var t;return e=F(t=e,void 0,t,new Map,void 0),t=>sf(t,e)}function af(e,t){let i;if(i=Array.isArray(t)?t:"string"==typeof t&&bi(t)&&null==e?.[t]?_i(t):[t],0===i.length)return!1;let o=e;for(let e=0;e{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,s=new ue(t,e);t.fire(s,{dataTransfer:o.dataTransfer,method:i.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),s.stop.called&&o.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,o={dataTransfer:new Jn(t,{cacheFiles:i})};if("drop"==e.type||"dragover"==e.type){const t=st(e);o.dropRange=t&&this.view.domConverter.domRangeToView(t)}this.fire(e.type,e,o)}}const uf=["figcaption","li"],hf=["ol","ul"];function mf(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return"\n";let i="",o=null;for(const n of t.getChildren())i+=pf(n,o)+mf(e,n),o=n;if(t.is("rawElement")){const o=document.implementation.createHTMLDocument("").createElement("div");t.render(o,e),i+=gf(o)}return i}function gf(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if("BR"===e.tagName)return"\n";for(const i of e.childNodes)t+=gf(i);return t}function pf(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||hf.includes(e.name)&&hf.includes(t.name)?"\n\n":e.is("containerElement")||t.is("containerElement")?uf.includes(e.name)||uf.includes(t.name)?"\n":e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":"\n\n":"":""}class ff extends fc{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=e=>e.model.getSelectedContent(e.model.document.selection)){return this.editor.model.change((o=>{const n=o.model.document.selection;o.setSelection(t);const s=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),r=i(o),a=this._removeFakeMarkersInsideElement(o,r);for(const[e,t]of Object.entries(s)){a[e]||=o.createRangeIn(r);for(const e of t)o.remove(e)}r.markers.clear();for(const[e,t]of Object.entries(a))r.markers.set(e,t);return o.setSelection(n),r}))}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change((e=>{const o=this._insertFakeMarkersElements(e,i),n=t(e),s=this._removeFakeMarkersInsideElement(e,n);for(const t of Object.values(o).flat())e.remove(t);for(const[t,i]of Object.entries(s))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return n}))}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:o}=i;return"all"===o||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){const o=Array.from(t.getRanges()),n=new Set(o.flatMap((t=>Array.from(e.model.markers.getMarkersIntersectingRange(t)))));return Array.from(n).filter((e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return o.some((e=>e.containsRange(t,!0)))}return!0})).map((e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()})))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap((([e,o])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:o}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),n=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||n)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:o}]}return[]}))}_insertFakeMarkersElements(e,t){const i={},o=t.flatMap((e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]})).sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:t,marker:n,type:s}of o){const o=e.createElement("$marker",{"data-name":n.name,"data-type":s});i[n.name]||(i[n.name]=[]),i[n.name].push(o),e.insert(o,t)}return i}_removeFakeMarkersInsideElement(e,t){return cf(this._getAllFakeMarkersFromElement(e,t).reduce(((t,i)=>{const o=i.markerElement&&e.createPositionBefore(i.markerElement);let n=t[i.name],s=!1;if(n?.start&&n?.end){this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:s=!0,n=null}return s||(t[i.name]={...n,[i.type]:o}),i.markerElement&&e.remove(i.markerElement),t}),{}),(i=>new us(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end"))))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap((({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]})),o=[],n=[];for(const e of i){if("end"===e.type){i.some((t=>t.name===e.name&&"start"===t.type))||o.push({markerElement:null,name:e.name,type:"start"})}if("start"===e.type){i.some((t=>t.name===e.name&&"end"===t.type))||n.unshift({markerElement:null,name:e.name,type:"end"})}}return[...o,...i,...n]}_getUniqueMarkerName(e){const t=e.split(":"),i=me().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class bf extends fc{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[ff]}init(){this.editor.editing.view.addObserver(df),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},(()=>{const n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})}))}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",((t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()}),{priority:"highest"}),this.listenTo(o,"clipboardInput",((e,t)=>{const o=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";o.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(o.getData("text/html")):o.getData("text/plain")&&(((s=(s=o.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

    ").replace(/\r?\n/g,"
    ").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

    ")||s.includes("
    "))&&(s=`

    ${s}

    `),e=s),n=this.editor.data.htmlProcessor.toView(e)}var s;const r=new ue(this,"inputTransformation"),a=o.getData("application/ckeditor5-editor-id")||null;this.fire(r,{content:n,dataTransfer:o,sourceEditorId:a,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const o=this.editor.data.toModel(i.content,"$clipboardHolder");0!=o.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:o,method:i.method,sourceEditorId:i.sourceEditorId,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=n._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,o=(e,i)=>{const o=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(o,t.selection,e.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?o(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,o)=>{const n=e.data.toView(o.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:n,method:o.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",mf(e.data.htmlProcessor.domConverter,o.content)),o.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),"cut"==o.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}const wf=yt("px");class yf extends Au{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>wf(e))),top:e.to("top",(e=>wf(e))),width:e.to("width",(e=>wf(e)))}}})}}class _f extends fc{removeDropMarkerDelayed=ci((()=>this.removeDropMarker()),40);_updateDropMarkerThrottled=ic((e=>this._updateDropMarker(e)),40);_reconvertMarkerThrottled=ic((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0);_dropTargetLineView=new yf;_domEmitter=new(et());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,s){this.removeDropMarkerDelayed.cancel();const r=kf(this.editor,e,t,i,o,n,s);return r?s&&s.containsRange(r)||r&&!this.editor.model.canEditAt(r)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(r),r):null}getFinalDropRange(e,t,i,o,n,s){const r=kf(this.editor,e,t,i,o,n,s);return this.removeDropMarker(),r}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const t=this.editor.editing,i=e.start.nodeBefore,o=e.start.nodeAfter,n=e.start.parent,s=i?t.mapper.toViewElement(i):null,r=s?t.view.domConverter.mapViewToDom(s):null,a=o?t.mapper.toViewElement(o):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(n);if(!c)return;const d=t.view.domConverter.mapViewToDom(c),u=this._getScrollableRect(c),{scrollX:h,scrollY:m}=J.window,g=r?new ut(r):null,p=l?new ut(l):null,f=new ut(d).excludeScrollbarsAndBorders(),b=g?g.bottom:f.top,w=p?p.top:f.bottom,y=J.window.getComputedStyle(d),_=b<=w?(b+w)/2:w;if(u.top<_&&_a.schema.checkChild(s,e)))){if(a.schema.checkChild(s,"$text"))return a.createRange(s);if(t)return Cf(e,xf(e,t.parent),o,n)}}}else if(a.schema.isInline(c))return Cf(e,c,o,n);if(a.schema.isBlock(c))return Cf(e,c,o,n);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter((t=>t.is("element")&&!vf(e,t)));let i=0,s=t.length;if(0==s)return a.createRange(a.createPositionAt(c,"end"));for(;i{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),Y.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(J.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(J.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(J.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",((e,i,o)=>{t.setAttribute("draggable",o?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change((e=>e.setSelection(s))),this._isBlockDragging=!0,o.focus(),o.getObserver(df).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,o=document.elementFromPoint(t,i),n=this.editor.editing.view;o&&o.closest(".ck-editor__editable")&&n.getObserver(df).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class Tf extends fc{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=ci((()=>this._clearDraggableAttributes()),40);_blockMode=!1;_domEmitter=new(et());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[bf,vp,_f,Ef]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(df),t.addObserver(sl),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),Y.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=e.plugins.get(_f);this.listenTo(o,"dragstart",((i,o)=>{if(o.target?.is("editableElement"))return void o.preventDefault();if(this._prepareDraggedRange(o.target),!this._draggedRange)return void o.preventDefault();this._draggingUid=me();const n=this.isEnabled&&e.model.canEditAt(this._draggedRange);o.dataTransfer.effectAllowed=n?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const s=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(o.dataTransfer,s,"dragstart");const{dataTransfer:r,domTarget:a,domEvent:l}=o,{clientX:c}=l;this._updatePreview({dataTransfer:r,domTarget:a,clientX:c}),o.stopPropagation(),n||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(o,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(J.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(o,"dragenter",(()=>{this.isEnabled&&i.focus()})),this.listenTo(o,"dragleave",(()=>{n.removeDropMarkerDelayed()})),this.listenTo(o,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:o}=t.domEvent;n.updateDropMarker(t.target,t.targetRanges,i,o,this._blockMode,this._draggedRange)?(this._draggedRange||(t.dataTransfer.dropEffect="copy"),Y.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()):t.dataTransfer.dropEffect="none"}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(_f);this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const{clientX:n,clientY:s}=o.domEvent,r=i.getFinalDropRange(o.target,o.targetRanges,n,s,this._blockMode,this._draggedRange);if(!r)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==Pf(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void t.stop();o.targetRanges=[e.editing.mapper.toViewRange(r)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bf);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==Pf(t.dataTransfer),o=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(o&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"pointerdown",((o,n)=>{if(Y.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let s=Sf(n.target);if(Y.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&op(e)||(s=i.selection.editableElement)}s&&(t.change((e=>{e.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"pointerup",(()=>{Y.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_finalizeDragging(e){const t=this.editor,i=t.model;if(t.plugins.get(_f).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const o=t.getFirstPosition().parent;o.isEmpty&&!i.schema.checkChild(o,"$text")&&i.schema.checkChild(o,"paragraph")&&e.insertElement("paragraph",o,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,o=i.document.selection,n=e?Sf(e):null;if(n){const e=t.editing.mapper.toModelElement(n);if(this._draggedRange=Ts.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const s=Array.from(o.getSelectedBlocks()),r=o.getFirstRange();if(0==s.length)return void(this._draggedRange=Ts.fromRange(r));const a=If(i,s);if(s.length>1)this._draggedRange=Ts.fromRange(a),this._blockMode=!0;else if(1==s.length){const e=r.start.isTouching(a.start)&&r.end.isTouching(a.end);this._draggedRange=Ts.fromRange(e?a:r),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){const o=this.editor.editing.view,n=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(n),r=J.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Ke(J.document,"div",{style:"position: fixed; left: -999999px;"}),J.document.body.appendChild(this._previewContainer));const a=Ke(J.document,"div");a.className="ck ck-content ck-clipboard-preview";const l=new ut(s),c=parseFloat(r.paddingLeft),d=parseFloat(r.paddingRight),u=parseFloat(r.width)-c-d;if(s.contains(t)){if(!Y.isiOS)return;a.style.maxWidth=`${u}px`,a.style.padding="10px",a.style.minWidth="200px",a.style.minHeight="20px",a.style.boxSizing="border-box",a.style.backgroundColor="var(--ck-color-base-background)"}else if(Y.isiOS)a.style.width=`${u}px`,a.style.backgroundColor="var(--ck-color-base-background)";else{const e=l.left-i+c;a.style.width=`${u+e}px`,a.style.paddingLeft=`${e}px`}o.domConverter.setContentOf(a,e.getData("text/html")),e.setDragImage(a,0,0),this._previewContainer.appendChild(a)}}function Pf(e){return Y.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Sf(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(op);if(op(e))return e;const t=e.findAncestor((e=>op(e)||e.is("editableElement")));return op(t)?t:null}function If(e,t){const i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),s=e.createPositionBefore(i),r=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){const t=e.createRangeOn(n),i=s.isTouching(t.start),o=r.isTouching(t.end);if(i&&o)return If(e,[n])}return e.createRange(s,r)}class Rf extends fc{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[bf]}init(){const e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(df),e.plugins.get(bf).on("contentInsertion",((e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const o=e.getChild(0);o.is("element")&&t.schema.isBlock(o)&&!t.schema.isObject(o)&&!t.schema.isLimit(o)&&(i=t.createRangeIn(o))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find((e=>t.schema.getAttributeProperties(e).isFormatting)))return!1}return!0})(i.content,t)&&t.change((e=>{const n=Array.from(o.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),n.push(...o.getAttributes());const s=e.createRangeIn(i.content);for(const i of s.getItems())for(const o of n)t.schema.checkAttribute(i,o[0])&&e.setAttribute(o[0],o[1],i)}))}))}}class Of extends fc{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ff,bf,Tf,Rf]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Vf extends wc{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const o=this.editor.model,n=o.document,s=[],r=e.map((e=>e.getTransformedByOperations(i))),a=r.flat();for(const e of r){const t=e.filter((e=>e.root!=n.graveyard)).filter((e=>!Ff(e,a)));t.length&&(Df(t),s.push(t[0]))}s.length&&o.change((e=>{e.setSelection(s,{backward:t})}))}_undo(e,t){const i=this.editor.model,o=i.document;this._createdBatches.add(t);const n=e.operations.slice().filter((e=>e.isDocumentOperation));n.reverse();for(const e of n){const n=e.baseVersion+1,s=Array.from(o.history.getOperations(n)),r=sa([e.getReversed()],s,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let n of r){const s=n.affectedSelectable;s&&!i.canEditAt(s)&&(n=new Jr(n.baseVersion)),t.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(e,n)}}}}function Df(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class Mf extends Vf{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,(()=>{this._undo(i.batch,o);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,o),this.refresh()}}class Nf extends Vf{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)})),this.fire("revert",e.batch,t),this.refresh()}}class Bf extends fc{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new Mf(e),this._redoCommand=new Nf(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand.createdBatches.has(o),s=this._undoCommand.createdBatches.has(o);this._batchRegistry.has(o)||(this._batchRegistry.add(o),o.isUndoable&&(n?this._undoCommand.addBatch(o):s||(this._undoCommand.addBatch(o),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Lf extends fc{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,o="ltr"==t.uiLanguageDirection?nd:td,n="ltr"==t.uiLanguageDirection?td:nd;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(Lu,e,t,i,o);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(sh,e,t,i,o)))}_createButton(e,t,i,o,n){const s=this.editor,r=s.locale,a=s.commands.get(t),l=new e(r);return l.set({label:i,icon:n,keystroke:o}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",(()=>{s.execute(t),s.editing.view.focus()})),l}}class zf extends fc{static get requires(){return[Bf,Lf]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}function jf(e){return e}function $f(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function qf(e,t){const i=e.plugins.get("ImageUtils"),o=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>{if(!i.isInlineImageView(e))return null;if(!o)return n(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:n(e)};function n(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function Hf(e,t){const i=ti(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function Wf(e){return e&&e.endsWith("px")?parseInt(e):null}function Uf(e){const t=Wf(e.getStyle("width")),i=Wf(e.getStyle("height"));return!(!t||!i)}const Kf=/^(image|image-inline)$/;class Gf extends fc{_domEmitter=new(et());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,o={}){const n=this.editor,s=n.model,r=s.document.selection,a=Jf(n,t||r,i);e={...Object.fromEntries(r.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(a,t)||delete e[t];return s.change((i=>{const{setImageSizes:n=!0}=o,r=i.createElement(a,e);return s.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),r.parent?(n&&this.setImageNaturalSizeAttributes(r),r):null}))}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((i=>{const o=new J.window.Image;this._domEmitter.listenTo(o,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(i.batch,(t=>{t.setAttribute("width",o.naturalWidth,e),t.setAttribute("height",o.naturalHeight,e)})),this._domEmitter.stopListening(o,"load")})),o.src=t})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:Kf})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=Jf(e,t,null);if("imageBlock"==i){const i=function(e,t){const i=cp(e,t),o=i.start.parent;if(o.isEmpty&&!o.is("element","$root"))return o.parent;return o}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return np(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&op(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Jf(e,t,i){const o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"auto"!==n?"imageBlock":t.is("selection")?Hf(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class Zf extends wc{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change((t=>{t.setAttribute("alt",e.newValue,n)}))}}class Qf extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new Zf(this.editor))}}class Yf extends Au{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Km(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new tu,this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}}function Xf(e){const t=e.editing.view,i=dh.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class eb extends fc{_balloon;_form;static get requires(){return[Qm]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const o=e.commands.get("imageTextAlternative"),n=new Lu(i);return n.set({label:t("Change image text alternative"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._showForm()})),n}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Iu(Yf))(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=Xf(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),Su({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Xf(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class tb extends fc{static get requires(){return[Qf,eb]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function ib(e,t){const i=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,s=o.mapper.toViewElement(i.item),r=e.findViewImgElement(s);null===i.attributeNewValue?(n.removeAttribute("srcset",r),n.removeAttribute("sizes",r)):i.attributeNewValue&&(n.setAttribute("srcset",i.attributeNewValue,r),n.setAttribute("sizes","100vw",r))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function ob(e,t,i){const o=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,s=o.mapper.toViewElement(i.item),r=e.findViewImgElement(s);n.setAttribute(i.attributeKey,i.attributeNewValue||"",r)};return e=>{e.on(`attribute:${i}:${t}`,o)}}class nb extends Ln{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class sb extends wc{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&be("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&be("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Qt(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((t,s)=>{const r=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),s&&r&&o.isImage(r)){const i=this.editor.model.createPositionAfter(r);o.insertImage({...t,...n},i,e.imageType)}else e.breakBlock?o.insertImage({...t,...n},i.getFirstPosition(),e.imageType):o.insertImage({...t,...n},null,e.imageType)}))}}class rb extends wc{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class ab extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(nb),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new sb(e),o=new rb(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}}class lb extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o="imageBlock"===e?"figure":"img";function n(t,o,n,s,r=!1){t.on(`attribute:${o}:${e}`,((t,o,a)=>{if(!a.consumable.consume(o.item,t.name))return;const l=a.writer,c=a.mapper.toViewElement(o.item),d=i.findViewImgElement(c);null!==o.attributeNewValue?l.setAttribute(n,o.attributeNewValue,d):l.removeAttribute(n,d);const u=o.item.getAttribute("width"),h=o.item.getAttribute("height"),m=u&&h;if(m&&r&&l.setAttribute("loading","lazy",d),o.item.hasAttribute("sources"))return;const g=o.item.hasAttribute("resizedWidth");("imageInline"!==e||g||s)&&m&&l.setStyle("aspect-ratio",`${u}/${h}`,d)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:e=>Uf(e)?Wf(e.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:e=>Uf(e)?Wf(e.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{n(e,"width","width",!0,!0),n(e,"height","height",!0,!0)})),t.conversion.for("dataDowncast").add((e=>{n(e,"width","width",!1),n(e,"height","height",!1)})),t.conversion.for("upcast").add((e=>{e.on("element:img",((e,t,i)=>{const o=t.viewItem.getAttribute("width"),n=t.viewItem.getAttribute("height");o&&n&&i.consumable.consume(t.viewItem,{styles:["aspect-ratio"]})}))}))}}class cb extends wc{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(n.getAttributes());return s.src||s.uploadId?i.change((t=>{const{setImageSizes:r=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(n))),l=o.insertImage(s,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:r});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),o="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:o})}return{oldElement:n,newElement:l}})):null}}class db extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;o.consumable.consume(t.item,e.name);const n=o.writer,s=o.mapper.toViewElement(t.item),r=i.findViewImgElement(s);t.attributeNewValue?(n.addClass("image_placeholder",r),n.setStyle("background-image",`url(${t.attributeNewValue})`,r),n.setCustomProperty("editingPipeline:doNotReuseOnce",!0,r)):(n.removeClass("image_placeholder",r),n.removeStyle("background-image",r))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(nb),this.listenTo(o.document,"imageLoaded",((e,s)=>{const r=o.domConverter.mapDomToView(s.target);if(!r)return;const a=n.getImageWidgetFromImageView(r);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",l)}))}))}}class ub extends fc{static get requires(){return[ab,lb,Gf,db,bf]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new cb(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>$f(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>o.toImageWidget($f(i),i,t("image widget"))}),i.for("downcast").add(ob(o,"imageBlock","src")).add(ob(o,"imageBlock","alt")).add(ib(o,"imageBlock")),i.for("upcast").elementToElement({view:qf(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const n=e.findViewImgElement(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=ti(o.convertItem(n,i.modelCursor).modelRange.getItems());s?(o.convertChildren(i.viewItem,s),o.updateConversionResult(s,i)):o.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(o.isInlineImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Hf(t.schema,l)){const e=new rl(i.document),t=r.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(e)}))}))}}class hb extends Au{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this._focusables=new tu,this.children=this.createCollection(),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof kh&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),Ou({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class mb extends fc{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const o=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o),e.ui.componentFactory.add("menuBar:insertImage",(e=>this._createMenuBarComponent(e)))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,menuBarButtonViewCreator:n,requiresForm:s=!1,override:r=!1}){this._integrations.has(e)&&!r&&be("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:n,formViewCreator:o,requiresForm:s})}_createToolbarComponent(e){const t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n;const s=o[0];if(1==o.length){if(!s.requiresForm)return s.buttonViewCreator(!0);n=s.buttonViewCreator(!0)}else{const t=s.buttonViewCreator(!1);n=new Jh(e,t),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const r=this.dropdownView=Zh(e,n),a=o.map((({observable:e})=>"function"==typeof e?e():e));return r.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),r.once("change:isOpen",(()=>{const e=o.flatMap((({formViewCreator:e})=>e(1==o.length))),i=new hb(t.locale,e);r.panelView.children.add(i)})),r}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;const o=i.flatMap((({menuBarButtonViewCreator:e})=>e(1==i.length))),n=new ig(e),s=new og(e);n.panelView.children.add(s),n.buttonView.set({icon:'',label:t("Image")});for(const t of o){const i=new Em(e,n);i.children.add(t),s.items.add(i),t.delegate("execute").to(n)}return n}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return be("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||be("image-insert-unknown-integration",{item:i});return t.length||be("image-insert-integrations-not-registered"),t}}class gb extends fc{static get requires(){return[ub,vp,tb,mb]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class pb extends fc{static get requires(){return[ab,lb,Gf,db,bf]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new cb(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>o.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(ob(o,"imageInline","src")).add(ob(o,"imageInline","alt")).add(ib(o,"imageInline")),i.for("upcast").elementToElement({view:qf(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(o.isBlockImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Hf(t.schema,l)){const e=new rl(i.document),t=r.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,o.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&o.setImageNaturalSizeAttributes(e)}))}))}}class fb extends fc{static get requires(){return[pb,vp,tb,mb]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class bb extends fc{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class wb extends wc{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(ub))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,n=o.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(o);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(n),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils");let s=i.getSelectedElement();const r=o._getSavedCaption(s);n.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());const a=r||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils");let s,r=i.getSelectedElement();r?s=n.getCaptionFromImageModelElement(r):(s=n.getCaptionFromModelSelection(i),r=s.parent),o._saveCaption(r,s),e.setSelection(r,"on"),e.remove(s)}}class yb extends fc{static get requires(){return[Gf,bb]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new wb(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:e=>o.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:o})=>{if(!i.isBlockImage(e.parent))return null;const s=o.createEditableElement("figcaption");o.setCustomProperty("imageCaption",!0,s),s.placeholder=n("Enter image caption"),Qi({view:t,element:s,keepOnFocus:!0});const r=e.parent.getAttribute("alt");return lp(s,o,{label:r?n("Caption for image: %0",[r]):n("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),s=e=>{if(!e.return)return;const{oldElement:o,newElement:n}=e.return;if(!o)return;if(t.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(e)return void this._saveCaption(n,e)}const s=this._getSavedCaption(o);s&&this._saveCaption(n,s)};o&&this.listenTo(o,"execute",s,{priority:"low"}),n&&this.listenTo(n,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Ms.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const n=t.document.differ.getChanges();for(const t of n){if("alt"!==t.attributeKey)continue;const n=t.range.start.nodeAfter;if(i.isBlockImage(n)){const t=o.getCaptionFromImageModelElement(n);if(!t)return;e.editing.reconvertItem(t)}}}))}}class _b extends fc{static get requires(){return[bb]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",(n=>{const s=e.commands.get("toggleImageCaption"),r=new Lu(n);return r.set({icon:'',tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const o=i.getCaptionFromModelSelection(e.model.document.selection);if(o){const i=e.editing.mapper.toViewElement(o);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),r}))}}function kb(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function vb(e){return new Promise(((t,i)=>{const o=e.getAttribute("src");fetch(o).then((e=>e.blob())).then((e=>{const i=Cb(e,o),n=i.replace("image/",""),s=new File([e],`image.${n}`,{type:i});t(s)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const o=J.document.createElement("img");o.addEventListener("load",(()=>{const e=J.document.createElement("canvas");e.width=o.width,e.height=o.height;e.getContext("2d").drawImage(o,0,0),e.toBlob((e=>e?t(e):i()))})),o.addEventListener("error",(()=>i())),o.src=e}))}(e).then((t=>{const i=Cb(t,e),o=i.replace("image/","");return new File([t],`image.${o}`,{type:i})}))}(o).then(t).catch(i):i(e)))}))}function Cb(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Ab extends fc{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",(()=>this._createToolbarButton())),e.ui.componentFactory.add("imageUpload",(()=>this._createToolbarButton())),e.ui.componentFactory.add("menuBar:uploadImage",(()=>this._createMenuBarButton("standalone"))),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),s=kb(n),r=new e(t.locale),a=i.t;return r.set({acceptedType:n.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:''}),r.bind("isEnabled").to(o),r.on("done",((e,i)=>{const o=Array.from(i).filter((e=>s.test(e.type)));o.length&&(t.execute("uploadImage",{file:o}),t.editing.view.focus())})),r}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),o=this._createButton(bh);return o.tooltip=!0,o.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",((t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions."))),o}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(bh);return i.withText=!0,i.bind("label").to(t,"isImageSelected",(t=>e(t?"Replace from computer":"Upload from computer"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(sg);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}class xb extends fc{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{const o=this.editor,n=t.item,s=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const r=o.plugins.get("ImageUtils"),a=o.plugins.get(Qp),l=s?t.attributeNewValue:null,c=this.placeholder,d=o.editing.mapper.toViewElement(n),u=i.writer;if("reading"==l)return Eb(d,u),void Tb(r,c,d,u);if("uploading"==l){const e=a.loaders.get(s);return Eb(d,u),void(e?(Pb(d,u),function(e,t,i,o){const n=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),n),i.on("change:uploadedPercent",((e,t,i)=>{o.change((e=>{e.setStyle("width",i+"%",n)}))}))}(d,u,e,o.editing.view),function(e,t,i,o){if(o.data){const n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}(r,d,u,e)):Tb(r,c,d,u))}"complete"==l&&a.loaders.get(s)&&function(e,t,i){const o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(o))))}),3e3)}(d,u,o.editing.view),function(e,t){Ib(e,t,"progressBar")}(d,u),Pb(d,u),function(e,t){t.removeClass("ck-appear",e)}(d,u)}}function Eb(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Tb(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);const n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),Sb(i,"placeholder")||o.insert(o.createPositionAfter(n),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(o))}function Pb(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Ib(e,t,"placeholder")}function Sb(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function Ib(e,t,i){const o=Sb(e,i);o&&t.remove(t.createRangeOn(o))}class Rb extends wc{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Qt(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const s=i.getSelectedElement();if(t&&s&&o.isImage(s)){const t=this.editor.model.createPositionAfter(s);this._uploadImage(e,n,t)}else this._uploadImage(e,n)}))}_uploadImage(e,t,i){const o=this.editor,n=o.plugins.get(Qp).createLoader(e),s=o.plugins.get("ImageUtils");n&&s.insertImage({...t,uploadId:n.id},i)}}class Ob extends fc{static get requires(){return[Qp,Gm,bf,Gf]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,o=e.plugins.get(Qp),n=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),r=kb(e.config.get("image.upload.types")),a=new Rb(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add((e=>e.on("element:img",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{attributes:["data-ck-upload-id"]}))return;const n=t.viewItem.getAttribute("data-ck-upload-id");if(!n)return;const[s]=Array.from(t.modelRange.getItems({shallow:!0})),r=o.loaders.get(n);s&&(i.writer.setAttribute("uploadId",n,s),i.consumable.consume(t.viewItem,{attributes:["data-ck-upload-id"]}),r&&r.data&&i.writer.setAttribute("uploadStatus",r.status,s))}),{priority:"low"}))),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter((e=>!!e&&r.test(e.type)));if(!n.length)return;t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:n})}));if(!e.commands.get("uploadImage").isAccessAllowed){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}})),this.listenTo(s,"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).map((e=>e.item)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(n,e)&&!e.getAttribute("uploadProcessed"))).map((e=>({promise:vb(e),imageElement:e})));if(!s.length)return;const r=new rl(e.editing.view.document);for(const e of s){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=o.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),t.on("change",(()=>{const i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),n=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,s="$graveyard"==t.position.root.rootName;for(const t of Vb(e,i)){const i=t.getAttribute("uploadId"),r=t.getAttribute("uploadStatus");if(!i||"complete"==r)continue;const a=o.loaders.get(i);if(a)if(s){if(!n.has(i)){Array.from(this._uploadImageElements.get(i)).every((e=>"$graveyard"==e.root.rootName))&&a.abort()}}else n.add(i),this._uploadImageElements.has(i)?this._uploadImageElements.get(i).add(t):this._uploadImageElements.set(i,new Set([t])),"idle"==a.status&&this._readAndUpload(a);else!s&&this._uploadedImages.has(i)&&e.model.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:this._uploadedImages.get(i),imageElement:t})}))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const o=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",o.default,t),this._parseAndSetSrcsetAttributeOnImage(o,t,e),n.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(Qp),s=t.plugins.get(Gm),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{const i=a.get(e.id);for(const e of i)t.setAttribute("uploadStatus","reading",e)})),e.read().then((()=>{const n=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image"));for(const o of a.get(e.id)){if(Y.isSafari){const e=t.editing.mapper.toViewElement(o),i=r.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o}))}i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",o)}))}return n})).then((n=>{i.enqueueChange({isUndoable:!1},(i=>{for(const t of a.get(e.id))i.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:n,imageElement:t});t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this._uploadedImages.set(e.id,n)})),l()})).catch((n=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))"$graveyard"!==i.root.rootName&&t.remove(i)})),l()}));function l(){i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i);a.delete(e.id)})),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0;const n=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return o=Math.max(o,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=n){const e={srcset:n};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=o),i.setAttributes(e,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,o=i.get(Qp),n=i.get(Gf);t.for("dataDowncast").add((t=>{t.on(`attribute:uploadId:${e}`,((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const s=o.loaders.get(t.attributeNewValue);if(!s||!s.data)return null;const r=i.mapper.toViewElement(t.item),a=n.findViewImgElement(r);a&&(i.consumable.consume(t.item,e.name),i.writer.setAttribute("data-ck-upload-id",s.id,a))}))}))}}function Vb(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class Db extends fc{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[Ob,Ab,xb]}}class Fb extends wc{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change((t=>{t.setAttribute("resizedWidth",e.width,n),t.removeAttribute("resizedHeight",n),o.setImageNaturalSizeAttributes(n)}))}}class Mb extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Fb(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add((t=>t.on(`attribute:resizedWidth:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(o.setStyle("width",t.attributeNewValue,n),o.addClass("image_resized",n)):(o.removeStyle("width",n),o.removeClass("image_resized",n))})))),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add((t=>t.on(`attribute:resizedHeight:${e}`,((t,o,n)=>{if(!n.consumable.consume(o.item,t.name))return;const s=n.writer,r=n.mapper.toViewElement(o.item),a="imageInline"===e?i.findViewImgElement(r):r;null!==o.attributeNewValue?s.setStyle("height",o.attributeNewValue,a):s.removeStyle("height",a)})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>Uf(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>Uf(e)?null:e.getStyle("height")}}),t.conversion.for("upcast").add((t=>{t.on("element:"+("imageBlock"===e?"figure":"img"),((e,t,i)=>{i.consumable.consume(t.viewItem,{classes:["image_resized"]})}))}))}}const Nb=(()=>({small:'',medium:'',large:'',custom:'',original:''}))();class Bb extends fc{static get requires(){return[Mb]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:o,icon:n}=e;t.ui.componentFactory.add(i,(i=>{const s=new Lu(i),r=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!Nb[n])throw new fe("imageresizebuttons-missing-icon",t,e);if(s.set({label:a,icon:Nb[n],tooltip:a,isToggleable:!0}),s.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Lb(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(s,"execute",(()=>{e._showForm(this._resizeUnit)}))}else{const e=o?o+this._resizeUnit:null;s.bind("isOn").to(r,"value",r,"isEnabled",zb(e)),this.listenTo(s,"execute",(()=>{t.execute("resizeImage",{width:e})}))}return s}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,o=e.find((e=>!e.value)),n=n=>{const s=t.commands.get("resizeImage"),r=Zh(n,Mh),a=r.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:o.value,icon:Nb.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(s,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(o))),r.bind("isEnabled").to(this),Xh(r,(()=>this._getResizeDropdownListItemDefinitions(e,s)),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(r,"execute",(e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())})),r};t.ui.componentFactory.add("resizeImage",n),t.ui.componentFactory.add("imageResize",n)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?Lb(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Lb(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,o=new ei,n=e.map((e=>Lb(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null}));for(const e of n){let s=null;if(i.plugins.has("ImageCustomResizeUI")&&Lb(e)){const o=i.plugins.get("ImageCustomResizeUI");s={type:"button",model:new Jm({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{o._showForm(this._resizeUnit)}})};const r=Object.values(n).map((e=>e.valueWithUnits));s.model.bind("isOn").to(t,"value",t,"isEnabled",jb(r))}else s={type:"button",model:new Jm({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},s.model.bind("isOn").to(t,"value",t,"isEnabled",zb(e.valueWithUnits));s.model.bind("isEnabled").to(t,"isEnabled"),o.add(s)}return o}}function Lb(e){return"custom"===e.value}function zb(e){return(t,i)=>!(void 0===t||!i)&&(null===e&&t===e||null!==t&&t.width===e)}function jb(e){return(t,i)=>!e.some((e=>zb(e)(t,i)))}const $b="image_resized";class qb extends fc{static get requires(){return[Rp,Gf]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(nb),this.listenTo(t.document,"imageLoaded",((o,n)=>{if(!n.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,r=s.domToView(n.target),a=i.getImageWidgetFromImageView(r);let l=this.editor.plugins.get(Rp).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,d=c.toModelElement(a);l=e.plugins.get(Rp).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:d,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.mapViewToDom(c.toViewElement(d)),isCentered:()=>"alignCenter"==d.getAttribute("imageStyle"),onCommit(i){t.change((e=>{e.removeClass($b,a)})),e.execute("resizeImage",{width:i})}}),l.on("updateSize",(()=>{a.hasClass($b)||t.change((e=>{e.addClass($b,a)}));const e="imageInline"===d.name?r:a;e.getStyle("height")&&t.change((t=>{t.removeStyle("height",e)}))})),l.bind("isEnabled").to(this)}))}}function Hb(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],o=Number.parseFloat(t);return Number.isNaN(o)?null:{value:o,unit:i}}function Wb(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function Ub(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const o=t.mapper.toViewElement(i);return{model:i,view:o,dom:t.view.domConverter.mapViewToDom(o)}}class Kb extends Au{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this.unit=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Km(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new tu,this._validators=i,this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Sh(this.locale,sm);return t.label=e("Resize image (in %0)",this.unit),t.class="ck-labeled-field-view_full-width",t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class Gb extends fc{_balloon;_form;static get requires(){return[Qm]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Iu(Kb))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",(()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))})),this.listenTo(this._form.labeledInput,"change:errorText",(()=>{t.ui.update()})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),Su({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:Xf(t)});const o=function(e,t){const i=Ub(e);if(!i)return null;const o=Hb(i.model.getAttribute("resizedWidth")||null);return o?o.unit===t?o:Wb(up(i.dom),{value:new ut(i.dom).width},t):null}(t,e),n=o?o.value.toFixed(1):"",s=function(e,t){const i=Ub(e);if(!i)return null;const o=up(i.dom),n=Hb(window.getComputedStyle(i.dom).minWidth)||{value:1};return{unit:t,lower:Math.max(.1,Wb(o,n,t).value),upper:"px"===t?o:100}}(t,e);i.fieldView.value=i.fieldView.element.value=n,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Jb extends wc{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils");i.change((t=>{const n=e.value,{setImageSizes:s=!0}=e;let r=o.getClosestSelectedImageElement(i.document.selection);n&&this.shouldConvertImageType(n,r)&&(this.editor.execute(o.isBlockImage(r)?"imageTypeInline":"imageTypeBlock",{setImageSizes:s}),r=o.getClosestSelectedImageElement(i.document.selection)),!n||this._styles.get(n).isDefault?t.removeAttribute("imageStyle",r):t.setAttribute("imageStyle",n,r),s&&o.setImageNaturalSizeAttributes(r)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const Zb={get inline(){return{name:"inline",title:"In line",icon:Qc,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Jc,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Yc,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Gc,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Zc,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Xc,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Gc,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Zc,modelElements:["imageBlock"],className:"image-style-side"}}},Qb=(()=>({full:'',left:Yc,right:Xc,center:Gc,inlineLeft:Jc,inlineRight:Zc,inline:Qc}))(),Yb=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Xb(e){be("image-style-configuration-definition-invalid",e)}const ew={normalizeStyles:function(e){const t=(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?Zb[e]?{...Zb[e]}:{name:e}:function(e,t){const i={...t};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}(Zb[e.name],e);"string"==typeof e.icon&&(e.icon=Qb[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:o,name:n}=e;if(!(o&&o.length&&n))return Xb({style:e}),!1;{const n=[t?"imageBlock":null,i?"imageInline":null];if(!o.some((e=>n.includes(e))))return be("image-style-missing-dependency",{style:e,missingPlugins:o.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)));return t},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...Yb]:[]},warnInvalidStyle:Xb};function tw(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(i,o,n)=>{if(!o.modelRange)return;const s=o.viewItem,r=ti(o.modelRange.getItems());if(r&&n.schema.checkAttribute(r,"imageStyle")){for(const e of t[r.name])n.consumable.consume(s,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,r);!function(e,t,i,o){if(!e.consumable.test(t,{styles:["float"]}))return;let n=null;switch(t.getStyle("float")){case"left":n="alignLeft";break;case"right":n="alignRight"}if(!n)return;const s=iw(n,o);if(!s)return;const r=Zb[s.name];if(!Ui(s,r))return;e.writer.setAttribute("imageStyle",n,i),e.consumable.consume(t,{styles:["float"]})}(n,s,r,e)}}}function iw(e,t){for(const i of t)if(i.name===e)return i}class ow extends fc{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}normalizedStyles;init(){const e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",ew.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=ew.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new Jb(e,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,o=i.model.schema,n=(s=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=iw(t.attributeNewValue,s),n=iw(t.attributeOldValue,s),r=i.mapper.toViewElement(t.item),a=i.writer;n&&a.removeClass(n.className,r),o&&a.addClass(o.className,r)});var s;const r=tw(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:figure",r,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",r,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(Gf),o=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let n=!1;for(const s of t.differ.getChanges())if("insert"==s.type||"attribute"==s.type&&"imageStyle"==s.attributeKey){let t="insert"==s.type?s.position.nodeAfter:s.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const r=t.getAttribute("imageStyle");if(!r)continue;const a=o.get(r);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),n=!0)}return n}))}}class nw extends fc{static get requires(){return[ow]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=sw(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const o=sw([...t.filter(s),...ew.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of o)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(o=>{let n;const{defaultItem:s,items:r,title:a}=e,l=r.filter((e=>t.find((({name:t})=>rw(t)===e)))).map((e=>{const t=i.create(e);return e===s&&(n=t),t}));r.length!==l.length&&ew.warnInvalidStyle({dropdown:e});const c=Zh(o,Jh),d=c.buttonView,u=d.arrowView;return Qh(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:aw(a,n.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(jf);return t<0?n.icon:l[t].icon})),d.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(jf);return aw(a,t<0?n.label:l[t].label)})),d.bind("isOn").toMany(l,"isOn",((...e)=>e.some(jf))),d.bind("class").toMany(l,"isOn",((...e)=>e.some(jf)?"ck-splitbutton_flatten":void 0)),d.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:n.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(jf))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(rw(t),(i=>{const o=this.editor.commands.get("imageStyle"),n=new Lu(i);return n.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>e===t)),n.on("execute",this._executeCommand.bind(this,t)),n}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function sw(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function rw(e){return`imageStyle:${e}`}function aw(e,t){return(e?e+": ":"")+t}function lw(e){return e.map((e=>s(e)?e.name:e))}const cw=Symbol("isWpButtonMacroSymbol");function dw(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(cw)&&op(e)}(t))}class uw extends fc{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(e,{writer:t})=>{const i=e.getAttribute("data-page")||"",o="true"==e.getAttribute("data-include-parent");return t.createElement("op-macro-child-pages",{page:i,includeParent:o})}}),i.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(e,{writer:t})=>this.createMacroViewElement(e,t)}).add((e=>e.on("attribute:page",this.modelAttributeToView.bind(this)))).add((e=>e.on("attribute:includeParent",this.modelAttributeToView.bind(this)))),i.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(e,{writer:t})=>t.createContainerElement("macro",{class:"child_pages","data-page":e.getAttribute("page")||"","data-include-parent":e.getAttribute("includeParent")||""})}),e.ui.componentFactory.add(uw.buttonName,(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),i.on("execute",(()=>{e.model.change((t=>{const i=t.createElement("op-macro-child-pages",{});e.model.insertContent(i,e.model.document.selection)}))})),i}))}modelAttributeToView(e,t,i){const o=t.item;if(!o.is("element","op-macro-child-pages"))return;i.consumable.consume(t.item,e.name);const n=i.mapper.toViewElement(o);i.writer.remove(i.writer.createRangeIn(n)),this.setPlaceholderContent(i.writer,o,n)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(e){return e&&e.length>0?e:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(e){return e?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(e,t){const i=t.createContainerElement("div");return this.setPlaceholderContent(t,e,i),function(e,t,i){return t.setCustomProperty(cw,!0,e),np(e,t,{label:i})}(i,t,{label:this.macroLabel()})}setPlaceholderContent(e,t,i){const o=t.getAttribute("page"),n=t.getAttribute("includeParent"),s=this.macroLabel(),r=this.pageLabel(o),a=e.createContainerElement("span",{class:"macro-value"});let l=[e.createText(`${s} `)];e.insert(e.createPositionAt(a,0),e.createText(`${r}`)),l.push(a),l.push(e.createText(this.includeParentText(n))),e.insert(e.createPositionAt(i,0),l)}}class hw extends fc{static get requires(){return[Qm]}static get pluginName(){return"OPChildPagesToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditChildPagesMacroButton",(e=>{const o=i.services.macros,n=e.getAttribute("page"),s=e.getAttribute("includeParent"),r=n&&n.length>0?n:"";o.configureChildPages(r,s).then((i=>t.change((t=>{t.setAttribute("page",i.page,e),t.setAttribute("includeParent",i.includeParent,e)}))))}))}afterInit(){qp(this,this.editor,"OPChildPages",dw)}}class mw extends wc{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!gw(e.schema,i))do{if(i=i.parent,!i)return}while(!gw(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function gw(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const pw=Wt("Ctrl+A");class fw extends fc{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new mw(e)),this.listenTo(i,"keydown",((t,i)=>{Ht(i)===pw&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class bw extends fc{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton(sh)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),s=i.t;return n.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),n}}class ww extends fc{static get requires(){return[fw,bw]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}const yw="ckCsrfToken",_w="abcdefghijklmnopqrstuvwxyz0123456789";function kw(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const i of t){const t=i.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}(yw);var t,i;return e&&40==e.length||(e=function(e){let t="";const i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let e=0;e.5?o.toUpperCase():o}return t}(40),t=yw,i=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(i)+";path=/"),e}class vw{loader;url;t;xhr;constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then((e=>new Promise(((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){const o=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${i.name}.`;o.addEventListener("error",(()=>t(s))),o.addEventListener("abort",(()=>t())),o.addEventListener("load",(()=>{const i=o.response;if(!i||!i.uploaded)return t(i&&i.error&&i.error.message?i.error.message:s);e({default:i.url})})),o.upload&&o.upload.addEventListener("progress",(e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)}))}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",kw()),this.xhr.send(t)}}function Cw(e,t,i,o){let n,s=null;"function"==typeof o?n=o:(s=e.commands.get(o),n=()=>{e.execute(o)}),e.model.document.on("change:data",((r,a)=>{if(s&&!s.isEnabled||!t.isEnabled)return;const l=ti(e.model.document.selection.getRanges());if(!l.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const c=Array.from(e.model.document.differ.getChanges()),d=c[0];if(1!=c.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const u=d.position.parent;if(u.is("element","codeBlock"))return;if(u.is("element","listItem")&&"function"!=typeof o&&!["numberedList","bulletedList","todoList"].includes(o))return;if(s&&!0===s.value)return;const h=u.getChild(0),m=e.model.createRangeOn(h);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(h.data.substr(0,l.end.offset));g&&e.model.enqueueChange((t=>{const i=e.model.document.selection,o=t.createPositionAt(u,0),s=t.createPositionAt(u,g[0].length),r=new Ts(o,s);if(!1!==n({match:g})){const e=Array.from(i.getAttributes());t.remove(r);const o=i.getFirstRange(),n=t.createRangeIn(u);!u.isEmpty||n.isEqual(o)||n.containsRange(o,!0)||t.remove(u),function(e,t,i){const o=e.model.schema,n=t.getFirstPosition();let s=new gr(n);o.checkChild(s,"$text")&&(s=s.push("$text"));for(const[t,n]of i)o.checkAttribute(s,t)&&e.setSelectionAttribute(t,n)}(t,i,e)}r.detach(),e.model.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Aw(e,t,i,o){let n,s;i instanceof RegExp?n=i:s=i,s=s||(e=>{let t;const i=[],o=[];for(;null!==(t=n.exec(e))&&!(t&&t.length<4);){let{index:e,1:n,2:s,3:r}=t;const a=n+s+r;e+=t[0].length-a.length;const l=[e,e+n.length],c=[e+n.length+s.length,e+n.length+s.length+r.length];i.push(l),i.push(c),o.push([e+n.length,e+n.length+s.length])}return{remove:i,format:o}}),e.model.document.on("change:data",((i,n)=>{if(n.isUndo||!n.isLocal||!t.isEnabled)return;const r=e.model,a=r.document.selection;if(!a.isCollapsed)return;const l=Array.from(r.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,u=d.parent,{text:h,range:m}=function(e,t){let i=e.start;const o=Array.from(e.getItems()).reduce(((e,o)=>!o.is("$text")&&!o.is("$textProxy")||o.getAttribute("code")?(i=t.createPositionAfter(o),""):e+o.data),"");return{text:o,range:t.createRange(i,e.end)}}(r.createRange(r.createPositionAt(u,0),d),r),g=s(h),p=xw(m.start,g.format,r),f=xw(m.start,g.remove,r);p.length&&f.length&&r.enqueueChange((t=>{if(!1!==o(t,p)){for(const e of f.reverse())t.remove(e);r.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function xw(e,t,i){return t.filter((e=>void 0!==e[0]&&void 0!==e[1])).map((t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1]))))}function Ew(e,t){return(i,o)=>{if(!e.commands.get(t).isEnabled)return!1;const n=e.model.schema.getValidRanges(o,t);for(const e of n)i.setAttribute(t,!0,e);i.removeSelectionAttribute(t)}}class Tw extends wc{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const t of n){let i=t,n=this.attributeKey;t.isCollapsed&&(i=t.start.parent,n=Os._getStoreAttributeKey(this.attributeKey)),o?e.setAttribute(n,o,i):e.removeAttribute(n,i)}}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const Pw="bold";class Sw extends fc{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Pw}),e.model.schema.setAttributeProperties(Pw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Pw,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Pw,new Tw(e,Pw)),e.keystrokes.set("CTRL+B",Pw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function Iw({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:s}){return r=>{const a=e.commands.get(t),l=new r(e.locale);return l.set({label:n,icon:o,keystroke:s,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof sh?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",(()=>{e.execute(t),e.editing.view.focus()})),l}}const Rw="bold";class Ow extends fc{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Rw,plugin:this,icon:$c,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(Rw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Rw,(()=>i(sh)))}}const Vw="code";class Dw extends fc{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Rg]}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vw}),e.model.schema.setAttributeProperties(Vw,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:Vw,view:"code"}),e.commands.add(Vw,new Tw(e,Vw)),e.plugins.get(Rg).registerAttribute(Vw),jg(e,Vw,"code","ck-code_selected"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const Fw="code";class Mw extends fc{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Fw,plugin:this,icon:'',label:t("Code")});e.ui.componentFactory.add(Fw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Fw,(()=>i(sh)))}}const Nw="italic";class Bw extends fc{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Nw}),e.model.schema.setAttributeProperties(Nw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Nw,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Nw,new Tw(e,Nw)),e.keystrokes.set("CTRL+I",Nw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const Lw="italic";class zw extends fc{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Lw,plugin:this,icon:'',keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(Lw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Lw,(()=>i(sh)))}}const jw="strikethrough";class $w extends fc{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:jw}),e.model.schema.setAttributeProperties(jw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:jw,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(jw,new Tw(e,jw)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const qw="strikethrough";class Hw extends fc{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:qw,plugin:this,icon:'',keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(qw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+qw,(()=>i(sh)))}}class Ww extends wc{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),s=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(s){const t=n.filter((e=>Uw(e)||Gw(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,n.filter(Uw))}))}_getValue(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Uw(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=ti(e.getSelectedBlocks());return!!i&&Gw(t,i)}_removeQuote(e,t){Kw(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];Kw(e,t).reverse().forEach((t=>{let o=Uw(t.start);o||(o=e.createElement("blockQuote"),e.wrap(t,o)),i.push(o)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function Uw(e){return"blockQuote"==e.parent.name?e.parent:null}function Kw(e,t){let i,o=0;const n=[];for(;o{const o=e.model.document.differ.getChanges();for(const e of o)if("insert"==e.type){const o=e.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!t.checkChild(e.position,o))return i.unwrap(o),!0;if(o.is("element")){const e=i.createRangeIn(o);for(const o of e.getItems())if(o.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1}));const i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",((t,i)=>{if(!o.isCollapsed||!n.value)return;o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((t,i)=>{if("backward"!=i.direction||!o.isCollapsed||!n.value)return;const s=o.getLastPosition().parent;s.isEmpty&&!s.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"})}}class Zw extends fc{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:blockQuote",(()=>{const e=this._createButton(sh);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),s=i.t;return n.set({label:s("Block quote"),icon:'',isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value"),this.listenTo(n,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),n}}class Qw extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=ti(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Yw(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change((e=>{const i=o.getSelectedBlocks();for(const o of i)!o.is("element","paragraph")&&Yw(o,t.schema)&&e.rename(o,"paragraph")}))}}function Yw(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Xw extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let o=e.position;return t.canEditAt(o)?t.change((e=>{if(o=this._findPositionToInsertParagraph(o,e),!o)return null;const n=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(n,i,e),t.insertContent(n,o),e.setSelection(n,"in"),e.createPositionAt(n,0)})):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;const n=e.parent,s=i.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}}class ey extends fc{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Qw(e)),e.commands.add("insertParagraph",new Xw(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>ey.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class ty extends wc{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>iy(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,i=t.document,o=e.value;t.change((e=>{const n=Array.from(i.selection.getSelectedBlocks()).filter((e=>iy(e,o,t.schema)));for(const t of n)t.is("element",o)||e.rename(t,o)}))}}function iy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const oy="paragraph";class ny extends fc{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ey]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const o of t)"paragraph"!==o.model&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new ty(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,o)=>{const n=e.model.document.selection.getFirstPosition().parent;i.some((e=>n.is("element",e.model)))&&!n.is("element",oy)&&0===n.childCount&&o.writer.rename(n,oy)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ge.low+1})}}function sy(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e}))}class ry extends fc{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=sy(e),o=t("Choose heading"),n=t("Heading");e.ui.componentFactory.add("heading",(t=>{const s={},r=new ei,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of i){const t={type:"button",model:new Jm({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),s[e.model]=e.title}const d=Zh(t);return Xh(d,r,{ariaLabel:n,role:"menu"}),d.buttonView.set({ariaLabel:n,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some((e=>e)))),d.buttonView.bind("label").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?o:s[i]?s[i]:o})),d.buttonView.bind("ariaLabel").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:s[i]?`${s[i]}, ${n}`:n})),this.listenTo(d,"execute",(t=>{const{commandName:i,commandValue:o}=t.source;e.execute(i,o?{value:o}:void 0),e.editing.view.focus()})),d})),e.ui.componentFactory.add("menuBar:heading",(o=>{const n=new ig(o),s=e.commands.get("heading"),r=e.commands.get("paragraph"),a=[s],l=new og(o);n.set({class:"ck-heading-dropdown"}),l.set({ariaLabel:t("Heading"),role:"menu"}),n.buttonView.set({label:t("Heading")}),n.panelView.children.add(l);for(const t of i){const i=new Em(o,n),c=new sh(o);i.children.add(c),l.items.add(i),c.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),c.delegate("execute").to(n),c.on("execute",(()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(c.bind("isOn").to(r,"value"),a.push(r)):c.bind("isOn").to(s,"value",(e=>e===t.model))}return n.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),n}))}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class ay{_definitions=new Set;_conflictChecker;get length(){return this._definitions.size}setConflictChecker(e){this._conflictChecker=e}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{const t=(e,t)=>{const i=t.createAttributeElement("a",e.attributes,{priority:5});e.classes&&t.addClass(e.classes,i);for(const o in e.styles)t.setStyle(o,e.styles[o],i);return t.setCustomProperty("link",!0,i),i},i=e=>(i,o,n)=>{if(o.attributeKey.startsWith("link")&&("linkHref"!=o.attributeKey||n.consumable.test(o.item,"attribute:linkHref"))&&(o.item.is("selection")||n.schema.isInline(o.item)))for(const i of this._definitions)i.callback(o.item.getAttribute("linkHref"))&&!this._conflictChecker?.(i,o.item)&&e?o.item.is("selection")?n.writer.wrap(n.writer.document.selection.getFirstRange(),t(i,n.writer)):n.writer.wrap(n.mapper.toViewRange(o.range),t(i,n.writer)):n.writer.unwrap(n.mapper.toViewRange(o.range),t(i,n.writer))};e.on("attribute",i(!1),{priority:ge.high-1}),e.on("attribute",i(!0),{priority:ge.high-2})}}getDispatcherForLinkedImage(){return e=>{const t=e=>(t,i,{writer:o,mapper:n})=>{if(!i.item.is("element","imageBlock")||!i.attributeKey.startsWith("link"))return;const s=n.toViewElement(i.item),r=Array.from(s.getChildren()).find((e=>e.is("element","a")));if(r)for(const t of this._definitions){const n=ai(t.attributes);if(t.callback(i.item.getAttribute("linkHref"))&&!this._conflictChecker?.(t,i.item)&&e){for(const[e,t]of n)"class"===e?o.addClass(t,r):o.setAttribute(e,t,!1,r);t.classes&&o.addClass(t.classes,r);for(const e in t.styles)o.setStyle(e,t.styles[e],r)}else{for(const[e,t]of n)"class"===e?o.removeClass(t,r):o.removeAttribute(e,t,r);t.classes&&o.removeClass(t.classes,r);for(const e in t.styles)o.removeStyle(e,r)}}};e.on("attribute",t(!1),{priority:ge.high-1}),e.on("attribute",t(!0),{priority:ge.high-2})}}}const ly=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,cy=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,dy=/^((\w+:(\/{2,})?)|(\W))/i,uy=["https?","ftps?","mailto"],hy="Ctrl+K";function my(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function gy(e,t=uy){const i=String(e),o=t.join("|");return function(e,t){const i=e.replace(ly,"");return!!i.match(t)}(i,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",o)}`,"i"))?i:"#"}function py(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function fy(e,t){const i=(o=e,cy.test(o)?"mailto:":t);var o;const n=!!i&&!by(e);return e&&n?i+e:e}function by(e){return dy.test(e)}function wy(e){let t="";for(const i of e.getItems()){if(!i.is("$text")&&!i.is("$textProxy"))return;t+=i.data}return t}function yy(e,t){if(e.attributes&&t.attributes){if(Object.keys(e.attributes).some((e=>!function(e){return"class"===e||"style"===e||"rel"===e}(e)&&e in t.attributes)))return!0}if(e.styles&&t.styles){if(Object.keys(e.styles).some((e=>e in t.styles)))return!0}return!1}function _y(e,t){const i=t.find((t=>t.id===e));return i?t.filter((t=>t.id!==e&&yy(i,t))).map((e=>e.id)):[]}class ky extends wc{manualDecorators=new ei;automaticDecorators=new ay;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||ti(t.getSelectedBlocks());py(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={},i){const o=this.editor.model,n=o.document.selection,s=function({decoratorStates:e,allDecorators:t}){const i={...e};for(const n in e)if(e[n]&&o(n)){const e=_y(n,t);for(const t of e)i[t]=!1}function o(e){return t.some((t=>t.id===e&&!t.value))}return i}({allDecorators:Array.from(this.manualDecorators),decoratorStates:t}),r=[],a=[];for(const e in s)s[e]?r.push(e):a.push(e);o.change((t=>{const s=i=>{t.setAttribute("linkHref",e,i),r.forEach((e=>t.setAttribute(e,!0,i))),a.forEach((e=>t.removeAttribute(e,i)))},l=(n,r)=>{const a=wy(n);if(!a)return n;let l=i;if(l||(l=r&&r==a?e:a),l!=a){const e=t.createDocumentFragment();for(const i of n.getItems()){const o=i;t.append(t.createText(o.data,o.getAttributes()),e)}const i=t.createRangeIn(e),r=function(e,t){const i=de(e,t),o={equal:0,insert:0,delete:0},n=[];let s="",r="";for(const a of[...i,null])"insert"==a?r+=t[o.equal+o.insert]:"delete"==a?s+=e[o.equal+o.delete]:(s.length||r.length)&&(n.push({offset:o.equal,actual:s,expected:r}),s="",r=""),a&&o[a]++;return n}(a,l);let c=0;for(const{offset:e,actual:n,expected:a}of r){const r=e+c,l=t.createRange(i.start.getShiftedBy(r),i.start.getShiftedBy(r+n.length)),d=vy(l,i).getAttributes(),u=Array.from(d).filter((([e])=>o.schema.getAttributeProperties(e).isFormatting)),h=t.createText(a,u);s(h),t.remove(l),t.insert(h,l.start),c+=a.length}return o.insertContent(e,n),t.createRange(n.start,n.start.getShiftedBy(l.length))}},c=e=>{const{plugins:i}=this.editor;if(t.setSelection(e.end),i.has("TwoStepCaretMovement"))i.get("TwoStepCaretMovement")._handleForwardMovement();else for(const e of["linkHref",...r,...a])t.removeSelectionAttribute(e)};if(n.isCollapsed){const a=n.getFirstPosition();if(n.hasAttribute("linkHref")){const e=n.getAttribute("linkHref"),t=Lg(a,"linkHref",e,o),i=l(t,e);s(i||t),i&&c(i)}else if(""!==e){const s=ai(n.getAttributes());s.set("linkHref",e),r.forEach((e=>{s.set(e,!0)}));c(o.insertContent(t.createText(i||e,s),a))}}else{const e=Array.from(n.getRanges()),i=o.schema.getValidRanges(e,"linkHref"),r=[];for(const e of n.getSelectedBlocks())o.schema.checkAttribute(e,"linkHref")&&r.push(t.createRangeOn(e));const a=r.slice();for(const e of i)this._isRangeToUpdate(e,r)&&a.push(e);const c=e.map((e=>({start:ma.fromPosition(e.start,"toPrevious"),end:ma.fromPosition(e.end,"toNext")})));for(let e of a){e=l(e,(e.start.textNode||e.start.nodeAfter).getAttribute("linkHref"))||e,s(e)}t.setSelection(c.map((e=>{const t=e.start.toPosition(),i=e.end.toPosition();return e.start.detach(),e.end.detach(),o.createRange(t,i)})))}})),this.restoreManualDecoratorStates()}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return py(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}function vy(e,t){if(!e.isCollapsed)return ti(e.getItems());const i=e.start;return i.textNode?i.textNode:!i.nodeBefore||i.isEqual(t.start)?i.nodeAfter:i.nodeBefore}class Cy extends wc{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();py(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,o=e.commands.get("link");t.change((e=>{const n=i.isCollapsed?[Lg(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of n)if(e.removeAttribute("linkHref",t),o)for(const i of o.manualDecorators)e.removeAttribute(i.id,t)}))}}class Ay extends(Be()){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const xy="automatic",Ey=/^(https?:)?\/\//;class Ty extends fc{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Rg,fg,bf]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:my}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>my(gy(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new ky(e)),e.commands.add("unlink",new Cy(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[o,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${i=o,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}(yi(i))}`});t.push(e)}var i;return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===xy))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode)));e.plugins.get(Rg).registerAttribute("linkHref"),jg(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration(),this._enableDecoratorConflictPostfixer()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link"),o=i.automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&o.add({id:"linkIsExternal",mode:xy,callback:e=>!!e&&Ey.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),o.add(e),o.setConflictChecker(((e,t)=>{for(const o of i.manualDecorators)if(t.hasAttribute(o.id)&&yy(e,o))return!0})),o.length&&t.conversion.for("downcast").add(o.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const o=new Ay(e);i.add(o),t.conversion.for("downcast").add((e=>{const t=e=>{const t=e.createAttributeElement("a",o.attributes,{priority:5});o.classes&&e.addClass(o.classes,t);for(const i in o.styles)e.setStyle(i,o.styles[i],t);return e.setCustomProperty("link",!0,t),t},i=e=>(i,o,n)=>{if(o.item.is("selection")||n.schema.isInline(o.item)){if(!e&&o.attributeOldValue){if(!n.consumable.test(o.item,i.name))return;n.writer.unwrap(n.mapper.toViewRange(o.range),t(n.writer))}if(e&&o.attributeNewValue){if(!n.consumable.consume(o.item,i.name))return;o.item.is("selection")?n.writer.wrap(n.writer.document.selection.getFirstRange(),t(n.writer)):n.writer.wrap(n.mapper.toViewRange(o.range),t(n.writer))}}};e.on(`attribute:${o.id}`,i(!1),{priority:ge.high-1}),e.on(`attribute:${o.id}`,i(!0),{priority:ge.high-2})})),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=e=>{var t;this._linkOpeners.some((t=>t(e)))||(t=e,window.open(t,"_blank","noopener"))};this.listenTo(t,"click",((e,t)=>{if(!(Y.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let o=t.domTarget;if("a"!=o.tagName.toLowerCase()&&(o=o.closest("a")),!o)return;const n=o.getAttribute("href");n&&(e.stop(),t.preventDefault(),i(n))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,o)=>{const n=e.commands.get("link").value;!!n&&o.keyCode===$t.enter&&o.altKey&&(t.stop(),i(n))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,o)=>{t.change((e=>{const t=e.createRangeIn(o.content);for(const o of t.getItems())if(o.hasAttribute("linkHref")){const t=fy(o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,o)}}))}))}_enableDecoratorConflictPostfixer(){const e=this.editor,t=e.model,i=e.commands.get("link");t.document.registerPostFixer((e=>{let o=!1;const n=t.document.differ.getChanges(),s=new Set,r=new Set(i.manualDecorators.map((e=>e.id)));for(const e of n){if("attribute"===e.type){if("linkHref"!==e.attributeKey&&!r.has(e.attributeKey))continue;for(const t of e.range.getItems())t.hasAttribute("linkHref")&&s.add(t)}"insert"===e.type&&e.attributes.has("linkHref")&&e.position.nodeAfter&&s.add(e.position.nodeAfter)}for(const t of s){const n=[];for(const s of i.manualDecorators)if(t.hasAttribute(s.id)){for(let i=n.length-1;i>=0;i--){const r=n[i];yy(r,s)&&(e.removeAttribute(r.id,t),n.splice(i,1),o=!0)}n.push(s)}}return o}))}}class Py extends Lu{constructor(e){super(e);const t=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:t.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to((e=>{if(this.href){const t=()=>e.preventDefault();this.fire("navigate",this.href,t)}}))}}),this.template.tag="a"}}class Sy extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;saveButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new tu;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",(()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}_createDisplayedTextInput(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new Km(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new Km(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class Iy extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new tu;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",(()=>{this.hasItems=this.listChildren.length>0})),this.on("change:hasItems",((e,t,i)=>{i?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))})),this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render();[this.listView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){const e=new ju(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new Au(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}class Ry extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;children;listChildren;_focusables=new tu;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",((e,t)=>{this.fire("back"),t()}))}render(){super.render();[...this.listChildren,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}}class Oy extends Lu{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Kc,e}}const Vy="link-ui";class Dy extends fc{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new ei;static get requires(){return[Qm,Ty]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(il),this._balloon=e.plugins.get(Qm),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Vy,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vy,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:hy},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){const t=this._linksProviders.filter((t=>(t.order||0)<=(e.order||0))).length;this._linksProviders.add(e,t)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,t=new Wh(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let o=e.config.get("link.toolbar");return i.manualDecorators.length||(o=o.filter((e=>"linkProperties"!==e))),t.fillFromConfig(o,e.ui.componentFactory),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(hy,((e,t)=>{this._addFormView(),t()})),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){const e=this.editor,t=e.locale.t,i=e.commands.get("link"),o=e.config.get("link.defaultProtocol"),n=new(Iu(Sy))(e.locale,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return n.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",(e=>void 0!==e)),n.urlInputView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("label").to(i,"value",(e=>t(e?"Update":"Insert"))),this.listenTo(n,"submit",(()=>{if(n.isValid()){const t=fy(n.urlInputView.fieldView.element.value,o),i=n.displayedTextInputView.fieldView.element.value;e.execute("link",t,this._getDecoratorSwitchesState(),i!==this.selectedLinkableText?i:void 0),this._closeFormView()}})),this.listenTo(n.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n.providersListChildren.bindTo(this._linksProviders).using((e=>this._createLinksListProviderButton(e))),n}_createLinkProviderListView(e){return e.getListItems().map((({href:e,label:t,icon:i})=>{const o=new Lu;return o.set({label:t,icon:i,tooltip:!1,withText:!0}),o.on("execute",(()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=e,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()})),o}))}_createLinkProviderItemsView(e){const t=this.editor,i=t.locale.t,o=new Iy(t.locale),{emptyListPlaceholder:n,label:s}=e;return o.emptyListPlaceholder=n||i("No links available"),o.title=s,this.listenTo(o,"cancel",(()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()})),o}_createPropertiesView(){const e=this.editor,t=this.editor.commands.get("link"),i=new(Iu(Ry))(e.locale);return this.listenTo(i,"back",(()=>{e.editing.view.focus(),this._removePropertiesView()})),i.listChildren.bindTo(t.manualDecorators).using((i=>{const o=new fh(e.locale);return o.set({label:i.label,withText:!0}),o.bind("isOn").toMany([i,t],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),o.on("execute",(()=>{e.execute("link",t.value,{...this._getDecoratorSwitchesState(),[i.id]:!o.isOn})})),o})),i}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce(((t,i)=>{const o=void 0===e.value&&void 0===i.value?i.defaultValue:i.value;return{...t,[i.id]:!!o}}),{})}_registerEditingOpeners(){this.editor.plugins.get(Ty)._registerLinkOpener((e=>{const t=this._getLinkProviderLinkByHref(e);if(!t)return!1;const{item:i,provider:o}=t;return!!o.navigate&&o.navigate(i)}))}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:link",(()=>{const e=this._createButton(sh);return e.set({role:"menuitemcheckbox"}),e})),e.ui.componentFactory.add("linkPreview",(t=>{const i=new Py(t),o=e.config.get("link.allowedProtocols"),n=e.commands.get("link"),s=t.t;i.bind("isEnabled").to(n,"value",(e=>!!e)),i.bind("href").to(n,"value",(e=>e&&gy(e,o)));const r=e=>{if(!e)return i.label=void 0,i.icon=void 0,void(i.tooltip=s("Open link in new tab"));const t=this._getLinkProviderLinkByHref(e);if(t){const{label:e,tooltip:o,icon:n}=t.item;i.label=e,i.tooltip=o||!1,i.icon=n}else i.label=e,i.icon=void 0,i.tooltip=s("Open link in new tab")};return r(n.value),this.listenTo(n,"change:value",((e,t,i)=>{r(i)})),this.listenTo(i,"navigate",((e,t,i)=>{const o=this._getLinkProviderLinkByHref(t);if(!o)return;const{provider:n,item:s}=o,{navigate:r}=n;r&&r(s)&&(e.stop(),i())})),i})),e.ui.componentFactory.add("unlink",(t=>{const i=e.commands.get("unlink"),o=new Lu(t),n=t.t;return o.set({label:n("Unlink"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",(()=>{e.execute("unlink"),this._hideUI()})),o})),e.ui.componentFactory.add("editLink",(t=>{const i=e.commands.get("link"),o=new Lu(t),n=t.t;return o.set({label:n("Edit link"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",(()=>{this._addFormView()})),o})),e.ui.componentFactory.add("linkProperties",(t=>{const i=e.commands.get("link"),o=new Lu(t),n=t.t;return o.set({label:n("Link properties"),icon:'\n',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",((e,t,i)=>e&&!!t&&i.length>0)),this.listenTo(o,"execute",(()=>{this._addPropertiesView()})),o}))}_createLinksListProviderButton(e){const t=this.editor.locale,i=new Oy(t);return i.set({label:e.label}),this.listenTo(i,"execute",(()=>{this._showLinksProviderView(e)})),i}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),s=i.t;return n.set({label:s("Link"),icon:'',keystroke:hy,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()})),n}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(hy,((t,i)=>{i(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),Su({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),this._isToolbarInPanel||this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),this._arePropertiesInPanel||(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){const e=this.editor.commands.get("link");this.selectedLinkableText=void 0,void 0!==e.value?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){const t=this.editor;this._isUIInPanel&&(this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&t.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),o=s();const n=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,o=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(Vy)){const t=this.editor.editing.mapper.markerNameToElements(Vy);if(t){const i=Array.from(t),o=e.createRange(e.createPositionBefore(i[0]),e.createPositionAfter(i[i.length-1]));return{target:e.domConverter.viewRangeToDom(o)}}}return{target:()=>{const i=this._getSelectedLinkElement();return i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&op(i))return Fy(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=Fy(i.start),n=Fy(i.end);return o&&o==n&&e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_getSelectedLinkableText(){const e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return wy(e.document.selection.getFirstRange());const o=t.view.createRangeOn(i);return wy(t.mapper.toModelRange(o))}_getLinkProviderLinkByHref(e){if(!e)return null;for(const t of this._linksProviders){const i=t.getItem?t.getItem(e):t.getListItems().find((t=>t.href===e));if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(Vy))t.updateMarker(Vy,{range:i});else if(i.start.isAtEnd){const o=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(Vy,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(Vy,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vy)&&e.change((e=>{e.removeMarker(Vy)}))}}function Fy(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const My=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Ny extends fc{static get requires(){return[Tg,Ty]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Lg(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),s=o.getLastPosition();let r=t.getJoined(this._expandLinkRange(i,n)||t);r&&(r=r.getJoined(this._expandLinkRange(i,s)||t)),r&&(r.start.isBefore(n)||r.end.isAfter(s))&&e.setSelection(r)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",((e,o)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||"paste"!==o.method)return;if(i.rangeCount>1)return;const s=i.getFirstRange(),r=o.dataTransfer.getData("text/plain");if(!r)return;const a=r.match(My);a&&a[2]===r&&(t.change((e=>{this._selectEntireLinks(e,s),n.execute(r)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Ig(e.model,(e=>{let t=e;if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(t))return;t=t.slice(0,-1),"!.:,;?".includes(t[t.length-1])&&(t=t.slice(0,-1));const i=By(t);return i?{url:i,removedTrailingCharacters:e.length-t.length}:void 0}));t.on("matched:data",((t,i)=>{const{batch:o,range:n,url:s,removedTrailingCharacters:r}=i;if(!o.isTyping)return;const a=n.end.getShiftedBy(-r),l=a.getShiftedBy(-s.length),c=e.model.createRange(l,a);this._applyAutoLink(s,c)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();let i;i=e.parent.previousSibling?.is("element")?t.createRangeIn(e.parent.previousSibling):t.createRange(t.createPositionAt(e.parent,0),e),this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:o}=Sg(e,t),n=By(i);if(n){const e=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,e)}}_applyAutoLink(e,t){const i=this.editor.model,o=fy(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&by(o)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange((n=>{n.setAttribute("linkHref",e,t),i.enqueueChange((()=>{o.requestUndoOnBackspace()}))}))}}function By(e){const t=My.exec(e);return t?t[2]:null}function Ly(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return jy(e);var t;const i=function(e){return"string"==typeof e?zy[e]:zy[e.model]}(e);if(i)return jy(i);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new fe("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},jy(e)}(e)}(e))).filter((e=>void 0!==e))}const zy={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function jy(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}class $y{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Qt(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return ti(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of new qy(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some((e=>t.getAttribute(e)!==this._startElement.getAttribute(e))))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class qy{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward="forward"===t}[Symbol.iterator](){return this}next(){if(!Uy(this._node))return{done:!0,value:void 0};const e=this._node.getAttribute("listIndent");let t=null;if(this._previous){const i=this._previousNodeIndent;e>i?this._previousNodesByIndent[i]=this._previous:ee.getAttribute("listItemId")!=t))}function s_(e){return Array.from(e).filter((e=>"$graveyard"!==e.root.rootName)).sort(((e,t)=>e.index-t.index))}function r_(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function a_(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function l_(e){return"numbered"==e||"customNumbered"==e}function c_(e,t,i){return Gy(t,{direction:"forward"}).pop().index>e.index?t_(e,t,i):[]}class d_ extends wc{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor,t=e.model,i=u_(t.document.selection),o=e.plugins.get("ListEditing").getListAttributeNames();t.change((e=>{const t=[];n_(i)&&!Zy(i[0])?("forward"==this._direction&&t.push(...i_(i,e,{attributeNames:o})),t.push(...e_(i[0],e))):"forward"==this._direction?t.push(...i_(i,e,{expand:!0,attributeNames:o})):t.push(...function(e,t,{attributeNames:i}){const o=Yy(e=Qt(e)),n=new Set,s=Math.min(...o.map((e=>e.getAttribute("listIndent")))),r=new Map;for(const e of o)r.set(e,$y.first(e,{lowerIndent:!0}));for(const e of o){if(n.has(e))continue;n.add(e);const o=e.getAttribute("listIndent")-1;if(o<0)o_(e,t,i);else{if(e.getAttribute("listIndent")==s){const i=c_(e,r.get(e),t);for(const e of i)n.add(e);if(i.length)continue}t.setAttribute("listIndent",o,e)}}return s_(n)}(i,e,{attributeNames:o}));for(const i of t){if(!i.hasAttribute("listType"))continue;const t=$y.first(i,{sameIndent:!0});t&&e.setAttribute("listType",t.getAttribute("listType"),i)}this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",s_(new Set(e)))}_checkEnabled(){let e=u_(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if(n_(e)&&!Zy(e[0]))return!0;e=Yy(e),t=e[0];const i=$y.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function u_(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex((e=>!Uy(e)));return-1!=i&&(t.length=i),t}class h_ extends wc{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,o=r_(t),n=Array.from(i.selection.getSelectedBlocks()).filter((e=>t.schema.checkAttribute(e,"listType")||a_(e,t.schema))),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change((r=>{if(s){const e=n[n.length-1],t=this.editor.plugins.get("ListEditing").getListAttributeNames(),i=Gy(e,{direction:"forward"}),o=[];i.length>1&&o.push(...e_(i[1],r)),o.push(...o_(n,r,t)),o.push(...function(e,t){const i=[];let o=Number.POSITIVE_INFINITY;for(const{node:n}of new qy(e.nextSibling)){const e=n.getAttribute("listIndent");if(0==e)break;e{const{firstElement:r,lastElement:a}=this._getMergeSubjectElements(o,e),l=r.getAttribute("listIndent")||0,c=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(l!=c){const e=(u=a,Array.from(new $y(u,{direction:"forward",higherIndent:!0})));n.push(...i_([a,...e],t,{indentBy:l-c,expand:l{const t=e_(this._getStartBlock(),e);this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",s_(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&Uy(t)&&!Zy(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class p_ extends fc{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(e,t,i,o){t&&(e.addClass("ck-list-marker-bold",i),!Y.isSafari||o&&o.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-bold","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class f_ extends fc{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(e,t,i,o){t&&(e.addClass("ck-list-marker-italic",i),!Y.isSafari||o&&o.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-italic","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}class b_ extends fc{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const o=Ly(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(e,t,i,n){if(t){const s=o.find((e=>e.model==t));s&&s.view&&"string"!=typeof s.view?s.view.styles?(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",s.view.styles["font-size"],i)):s.view.classes&&(e.addClass(`ck-list-marker-font-size-${t}`,i),!Y.isSafari||n&&n.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-font-size","0",i)):(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",t,i))}}})}afterInit(){const e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:e=>e.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=Ly(e.config.get("fontSize.options"));for(const t of i)t.model&&t.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:t.model},view:{name:"li",classes:`ck-list-marker-font-size-${t.model}`}})}}class w_ extends fc{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-color",i),e.setStyle("--ck-content-list-marker-color",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:e=>e.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class y_ extends fc{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-font-family",i),e.setStyle("--ck-content-list-marker-font-family",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:e=>e.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}class __ extends fc{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[p_,f_,b_,w_,y_]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges(),o=new Set;let n=!1;for(const e of i)if("attribute"===e.type)("listItemId"==e.attributeKey||"listType"==e.attributeKey||this._isInlineOrSelectionFormatting(e.attributeKey)||Object.values(this._loadedFormatting).includes(e.attributeKey))&&(Uy(e.range.start.nodeAfter)?o.add(e.range.start.nodeAfter):Uy(e.range.start.parent)&&o.add(e.range.start.parent));else if(Uy(e.position.nodeAfter)&&o.add(e.position.nodeAfter),Uy(e.position.nodeBefore)&&o.add(e.position.nodeBefore),Uy(e.position.parent)&&o.add(e.position.parent),"insert"==e.type&&"$text"!=e.name){const i=t.createRangeIn(e.position.nodeAfter);for(const e of i.getItems())Uy(e)&&o.add(e)}for(const i of o){const o=k_(e,i,Object.keys(this._loadedFormatting));for(const[e,s]of Object.entries(o)){const o=this._loadedFormatting[e];(s&&C_(t,i,o,s)||!s&&A_(t,i,o))&&(n=!0)}}return n}))}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}}function k_(e,t,i){if(Zy(t))return v_(e,t,i);return v_(e,Ky(t)[0],i)}function v_(e,t,i){if(!function(e){return["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))}(t)||e.schema.isLimit(t))return Object.fromEntries(i.map((e=>[e])));if(t.isEmpty)return Object.fromEntries(i.map((e=>[e,t.getAttribute(`selection:${e}`)])));const o=new Set(i),n={},s=e.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:t}of s){for(const i of o)if(e.schema.checkAttribute(t,i)){const e=t.getAttribute(i);void 0===e?(o.delete(i),n[i]=void 0):void 0===n[i]?n[i]=e:n[i]!==e&&(o.delete(i),n[i]=void 0)}else i in n||(n[i]=void 0);if(!o.size)break;e.schema.isLimit(t)&&s.jumpTo(e.createPositionAfter(t))}return n}function C_(e,t,i,o){const n=Ky(t);let s=!1;for(const t of n)t.hasAttribute(i)&&t.getAttribute(i)===o||(e.setAttribute(i,o,t),s=!0);return s}function A_(e,t,i){const o=Ky(t);let n=!1;for(const t of o)t.hasAttribute(i)&&(e.removeAttribute(i,t),n=!0);return n}class x_ extends fc{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return Xy(e)}isFirstBlockOfListItem(e){return Zy(e)}isListItemBlock(e){return Uy(e)}expandListBlocksToCompleteItems(e,t={}){return Yy(e,t)}isNumberedListType(e){return l_(e)}isFirstListItemInList(e){return function(e){return!$y.first(e,{sameIndent:!0,sameAttributes:"listType"})}(e)}}function E_(e){return e.is("element","ol")||e.is("element","ul")}function T_(e){return e.is("element","li")}function P_(e,t,i,o=R_(i,t)){return e.createAttributeElement(I_(i),null,{priority:2*t/100-100,id:o})}function S_(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function I_(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function R_(e,t){return`list-${e}-${t}`}function O_(e,t,i){const o=e.nodeBefore;if(Uy(o)){let e=o;for(const{node:n}of new qy(e,"backward")){if(e=n,i.has(e))return;if(i.add(e),t.has(o))return}t.add(e)}else{const i=e.nodeAfter;Uy(i)&&t.add(i)}}function V_(){return(e,t,i)=>{const{writer:o,schema:n}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>n.checkAttribute(e,"listItemId")));if(!s.length)return;const r=t.viewItem.getAttribute("data-list-item-id")||Wy.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const a=function(e){let t=0,i=e.parent;for(;i;){if(T_(i))t++;else{const e=i.previousSibling;e&&T_(e)&&t++}i=i.parent}return t}(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=s[0].getAttribute("listType");c&&(l=c);const d={listItemId:r,listIndent:a,listType:l};for(const e of s)e.hasAttribute("listItemId")||o.setAttributes(d,e);s.length>1&&s[1].getAttribute("listItemId")!=d.listItemId&&i.keepEmptyElement(s[0])}}function D_(e,t,i,o){return()=>{const o=e.document.differ.getChanges(),r=[],a=new Set,l=new Set,c=new Set;for(const e of o)if("insert"==e.type&&"$text"!=e.name)O_(e.position,a,c),e.attributes.has("listItemId")?l.add(e.position.nodeAfter):O_(e.position.getShiftedBy(e.length),a,c);else if("remove"==e.type&&e.attributes.has("listItemId"))O_(e.position,a,c);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(O_(e.range.start,a,c),null===e.attributeNewValue?(O_(e.range.start.getShiftedBy(1),a,c),s(t)&&r.push(t)):l.add(t)):Uy(t)&&s(t)&&r.push(t)}for(const e of a.values())r.push(...n(e,l));for(const e of new Set(r))t.reconvertItem(e)};function n(e,t){const o=[],n=new Set,a=[];for(const{node:l,previous:c}of new qy(e)){if(n.has(l))continue;const e=l.getAttribute("listIndent");c&&ei.includes(e)))),modelElement:l};const d=Gy(l,{direction:"forward"});for(const e of d)n.add(e),(s(e,d)||r(e,a,t))&&o.push(e)}return o}function s(e,n){const s=t.mapper.toViewElement(e);if(!s)return!1;if(function(e){e=e.parent;for(;e.is("attributeElement")&&["ol","ul","li"].includes(e.name);)e=e.parent;if(e.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(e))return!0;return!1}(s))return!0;if(o.fire("checkElement",{modelElement:e,viewElement:s}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const r=B_(e,i,n);return!(!r||!s.is("element","p"))||!(r||!s.is("element","span"))}function r(e,i,n){if(n.has(e))return!1;const s=t.mapper.toViewElement(e);let r=i.length-1;for(let e=s.parent;!e.is("editableElement");e=e.parent){const t=T_(e),n=E_(e);if(!n&&!t)continue;const s="checkAttributes:"+(t?"item":"list");if(o.fire(s,{viewElement:e,modelAttributes:i[r].modelAttributes,modelReferenceElement:i[r].modelElement}))break;if(n&&(r--,r<0))return!1}return!0}}function F_(e,t,i,{dataPipeline:o}={}){const n=function(e,t){const i=t.filter((e=>!1===e.consume)).map((e=>e.attributeName));return(t,o)=>{const n=[];for(const o of e)t.hasAttribute(o)&&!i.includes(o)&&n.push(`attribute:${o}`);return!!n.every((e=>!1!==o.test(t,e)))&&(n.forEach((e=>o.consume(t,e))),!0)}}(e,t);return(s,r,a)=>{const{writer:l,mapper:c,consumable:d}=a,u=r.item;if(!e.includes(r.attributeKey))return;if(!n(u,d))return;const h={...a.options,dataPipeline:o},m=function(e,t,i,o){const n=i.createRangeOn(e),s=t.toViewRange(n).getTrimmed(),r=s.getWalker();for(const{item:e}of r)if(e.is("element")&&e.getCustomProperty("listItemMarker"))r.jumpTo(o.createPositionAfter(e));else if(e.is("element")&&!e.getCustomProperty("listItemWrapper"))return e}(u,c,i,l);N_(m,l,c),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const o=i.parent;t.unwrap(t.createRangeOn(e),i),i=o}}(m,l);const g=function(e,t,i,o,{dataPipeline:n}){let s=o.createRangeOn(t);if(!Zy(e))return s;for(const r of i){if("itemMarker"!=r.scope)continue;const i=r.createElement(o,e,{dataPipeline:n});if(!i)continue;if(o.setCustomProperty("listItemMarker",!0,i),r.canInjectMarkerIntoElement&&r.canInjectMarkerIntoElement(e)?o.insert(o.createPositionAt(t,0),i):(o.insert(s.start,i),s=o.createRange(o.createPositionBefore(i),o.createPositionAfter(t))),!r.createWrapperElement||!r.canWrapElement)continue;const a=r.createWrapperElement(o,e,{dataPipeline:n});o.setCustomProperty("listItemWrapper",!0,a),r.canWrapElement(e)?s=o.wrap(s,a):(s=o.wrap(o.createRangeOn(i),a),s=o.createRange(s.start,o.createPositionAfter(t)))}return s}(u,m,t,l,h);!function(e,t,i,o,n){if(!e.hasAttribute("listIndent"))return;const s=e.getAttribute("listIndent");let r=e;for(let e=s;e>=0;e--){const s=S_(o,e,r.getAttribute("listItemId")),a=P_(o,e,r.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!r.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(o,r.getAttribute(e.attributeName),"list"==e.scope?a:s,n,r);if(t=o.wrap(t,s),t=o.wrap(t,a),0==e)break;if(r=$y.first(r,{lowerIndent:!0}),!r)break}}(u,g,t,l,h)}}function M_(e,{dataPipeline:t}={}){return(i,{writer:o})=>{if(!B_(i,e))return null;if(!t)return o.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function N_(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const o=[];n(t.createPositionBefore(e).getWalker({direction:"backward"})),n(t.createRangeIn(e).getWalker());for(const e of o)t.remove(e);function n(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&o.push(t)}}}function B_(e,t,i=Ky(e)){if(!Uy(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!t.includes(i))return!1;return i.length<2}const L_=["listType","listIndent","listItemId"];class z_ extends fc{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Kg,Tg,x_,bf,__]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new fe("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:L_}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of L_)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new h_(e,"numbered")),e.commands.add("bulletedList",new h_(e,"bulleted")),e.commands.add("customNumberedList",new h_(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new h_(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new d_(e,"forward")),e.commands.add("outdentList",new d_(e,"backward")),e.commands.add("splitListItemBefore",new g_(e,"before")),e.commands.add("splitListItemAfter",new g_(e,"after")),i&&(e.commands.add("mergeListItemBackward",new m_(e,"backward")),e.commands.add("mergeListItemForward",new m_(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...L_,...this._downcastStrategies.map((e=>e.attributeName))]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",((o,n)=>{const s=e.model.document.selection;r_(e.model)||e.model.change((()=>{const r=s.getFirstPosition();if(s.isCollapsed&&"backward"==n.direction){if(!r.isAtStart)return;const i=r.parent;if(!Uy(i))return;if($y.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:j_(e.model,"backward")})}else Qy(i)||e.execute("splitListItemAfter"),e.execute("outdentList");n.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:j_(e.model,"forward")}),n.preventDefault(),o.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,o=i.get("enter");this.listenTo(e.editing.view.document,"enter",((i,o)=>{const n=t.document,s=n.selection.getFirstPosition().parent;if(n.selection.isCollapsed&&Uy(s)&&s.isEmpty&&!o.isSoft){const t=Zy(s),n=Qy(s);t&&n?(e.execute("outdentList"),o.preventDefault(),i.stop()):t&&!n?(e.execute("splitListItemAfter"),o.preventDefault(),i.stop()):n&&(e.execute("splitListItemBefore"),o.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(o,"afterExecute",(()=>{const t=i.get("splitListItemBefore");if(t.refresh(),!t.isEnabled)return;2===Ky(e.model.document.selection.getLastPosition().parent).length&&t.execute()}))}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",((t,i)=>{const o=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),n=o?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(n,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(n,{listType:""}):null,converterPriority:"high"}).add((e=>{e.on("element:li",V_())})),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:n,view:M_(i),converterPriority:"high"}).add((e=>{var o;e.on("attribute",F_(i,this._downcastStrategies,t)),e.on("remove",(o=t.schema,(e,t,i)=>{const{writer:n,mapper:s}=i,r=e.name.split(":")[1];if(!o.checkAttribute(r,"listItemId"))return;const a=s.toViewPosition(t.position),l=t.position.getShiftedBy(t.length),c=s.toViewPosition(l,{isPhantom:!0}),d=n.createRange(a,c).getTrimmed().end.nodeBefore;d&&N_(d,n,s)}))})),e.conversion.for("dataDowncast").elementToElement({model:n,view:M_(i,{dataPipeline:!0}),converterPriority:"high"}).add((e=>{e.on("attribute",F_(i,this._downcastStrategies,t,{dataPipeline:!0}))}));const s=(r=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!Uy(i))return;if(!r.some((e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i))))return;const o=t.mapper.toViewElement(i),n=a.createRangeIn(o),s=n.getWalker();let l=n.start;for(const{item:e}of s){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(e),s.skip((({previousPosition:e})=>!e.isEqual(l))))}t.viewPosition=l});var r,a;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",D_(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())})),this.on("checkAttributes:list",((e,{viewElement:t,modelAttributes:i})=>{t.name==I_(i.listType)&&t.id==R_(i.listType,i.listIndent)||(e.return=!0,e.stop())}))}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer((i=>function(e,t,i,o){const n=e.document.differ.getChanges(),s=new Set,r=new Set,a=o.editor.config.get("list.multiBlock");let l=!1;for(const o of n){if("insert"==o.type&&"$text"!=o.name){const n=o.position.nodeAfter;if(!e.schema.checkAttribute(n,"listItemId"))for(const e of Array.from(n.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,n),l=!0);O_(o.position,r,s),o.attributes.has("listItemId")||O_(o.position.getShiftedBy(o.length),r,s);for(const{item:t,previousPosition:i}of e.createRangeIn(n))Uy(t)&&O_(i,r,s)}else"remove"==o.type?O_(o.position,r,s):"attribute"==o.type&&i.includes(o.attributeKey)&&(O_(o.range.start,r,s),null===o.attributeNewValue&&O_(o.range.start.getShiftedBy(1),r,s));if(!a&&"attribute"==o.type&&L_.includes(o.attributeKey)){const e=o.range.start.nodeAfter;null===o.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),l=!0):null===o.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),l=!0)}}const c=new Set;for(const e of r.values())l=o.fire("postFixer",{listNodes:new Hy(e),listHead:e,writer:t,seenIds:c})||l;return l}(e,i,t,this))),this.on("postFixer",((e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,o=-1,n=null,s=!1;for(const{node:r}of e){const e=r.getAttribute("listIndent");if(e>i){let a;null===n?(n=e-i,a=i):(n>e&&(n=e),a=e-n),a>o+1&&(a=o+1),t.setAttribute("listIndent",a,r),s=!0,o=a}else n=null,i=e+1,o=e}return s}(t,i)||e.return}),{priority:"high"}),this.on("postFixer",((e,{listNodes:t,writer:i,seenIds:o})=>{e.return=function(e,t,i){const o=new Set;let n=!1;for(const{node:s}of e){if(o.has(s))continue;let e=s.getAttribute("listType"),r=s.getAttribute("listItemId");if(t.has(r)&&(r=Wy.next()),t.add(r),s.is("element","listItem"))s.getAttribute("listItemId")!=r&&(i.setAttribute("listItemId",r,s),n=!0);else for(const t of Gy(s,{direction:"forward"}))o.add(t),t.getAttribute("listType")!=e&&(r=Wy.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=r&&(i.setAttribute("listItemId",r,t),n=!0)}return n}(t,o,i)||e.return}),{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,o])=>{const n=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!n.length)return;const s=(o?e.createSelection(o):e.document.selection).getFirstPosition();let r;if(Uy(s.parent))r=s.parent;else{if(!Uy(s.nodeBefore)||!Uy(s.nodeAfter))return;r=s.nodeBefore}e.change((e=>{const t=r.getAttribute("listType"),i=r.getAttribute("listIndent"),o=n[0].getAttribute("listIndent")||0,s=Math.max(i-o,0);for(const i of n){const o=Uy(i);r.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(o?i.getAttribute("listIndent"):0)+s,listItemId:o?i.getAttribute("listItemId"):Wy.next(),listType:t},i)}}))}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",((t,i)=>{e.change((e=>{const t=Array.from(i.content.getChildren()),o=t[t.length-1];if(t.length>1&&o.is("element")&&o.isEmpty){t.slice(0,-1).every(Uy)&&e.remove(o)}if("copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());n_(t)&&o_(t,e,this.getListAttributeNames())}}))}))}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,o){o&&(o.skipListItemIds||o.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}}function j_(e,t){const i=e.document.selection;if(!i.isCollapsed)return!r_(e);if("forward"===t)return!0;const o=i.getFirstPosition().parent,n=o.previousSibling;return!e.schema.isObject(n)&&(!!n.isEmpty||n_([o,n]))}function $_(e,t,i,o){e.ui.componentFactory.add(t,(()=>{const n=q_(Lu,e,t,i,o);return n.set({tooltip:!0,isToggleable:!0}),n})),e.ui.componentFactory.add(`menuBar:${t}`,(()=>{const n=q_(sh,e,t,i,o);return n.set({role:"menuitemcheckbox",isToggleable:!0}),n}))}function q_(e,t,i,o,n){const s=t.commands.get(i),r=new e(t.locale);return r.set({label:o,icon:n}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),r}class H_ extends fc{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||$_(this.editor,"numberedList",e("Numbered List"),''),this.editor.ui.componentFactory.has("bulletedList")||$_(this.editor,"bulletedList",e("Bulleted List"),'')}}const W_={},U_={},K_={},G_=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(const{listStyle:e,typeAttribute:t,listType:i}of G_)W_[e]=i,U_[e]=t,t&&(K_[t]=e);class J_ extends wc{constructor(e){super(e),this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){const e=this._getSelectedItems();this.value=this._getValue(e),this.isEnabled=!!e.length}execute(e={}){this.editor.model.change((t=>{const i=this._getSelectedItems(),o=void 0===e.forceValue?!this._getValue(i):e.forceValue;for(const e of i)o?t.setAttribute("todoListChecked",!0,e):t.removeAttribute("todoListChecked",e)}))}_getValue(e){return e.every((e=>e.getAttribute("todoListChecked")))}_getSelectedItems(){const e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),o=i.start.parent,n=[];t.checkAttribute(o,"todoListChecked")&&n.push(...Ky(o));for(const e of i.getItems({shallow:!0}))t.checkAttribute(e,"todoListChecked")&&!n.includes(e)&&n.push(...Ky(e));return n}}class Z_ extends jn{domEventType=["change"];onDomEvent(e){if(e.target){const t=this.view.domConverter.mapDomToView(e.target);t&&t.is("element","input")&&"checkbox"==t.getAttribute("type")&&t.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",e)}}}const Q_=Wt("Ctrl+Enter");class Y_ extends fc{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.model,i=e.editing,o=e.plugins.get(z_),n=e.config.get("list.multiBlock")?"paragraph":"listItem";e.commands.add("todoList",new h_(e,"todo")),e.commands.add("checkTodoList",new J_(e)),i.view.addObserver(Z_),t.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),t.schema.addAttributeCheck((e=>{const t=e.last;if(!t.getAttribute("listItemId")||"todo"!=t.getAttribute("listType"))return!1}),"todoListChecked"),e.conversion.for("upcast").add((e=>{e.on("element:input",((e,t,i)=>{const o=t.modelCursor,n=o.parent,s=t.viewItem;if(!i.consumable.test(s,{name:!0}))return;if("checkbox"!=s.getAttribute("type")||!o.isAtStart||!n.hasAttribute("listType"))return;i.consumable.consume(s,{name:!0});const r=i.writer;r.setAttribute("listType","todo",n),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,n),t.modelRange=r.createRange(o)})),e.on("element:li",((e,t,i)=>{const{writer:o,schema:n}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>"todo"===e.getAttribute("listType")&&n.checkAttribute(e,"listItemId"))).reduce(((e,t)=>{const i=t.getAttribute("listItemId");return e.has(i)||e.set(i,Ky(t)),e}),new Map);for(const[,e]of s.entries())if(e.some((e=>e.getAttribute("todoListChecked"))))for(const t of e)o.setAttribute("todoListChecked",!0,t)}),{priority:"low"}),e.on("element:label",X_({name:"label",classes:"todo-list__label"})),e.on("element:label",X_({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),e.on("element:span",X_({name:"span",classes:"todo-list__label__description"})),e.on("element:ul",function(e){const t=new uo(e);return(e,i,o)=>{const n=t.match(i.viewItem);if(!n)return;const s=n.match;s.name=!1,o.consumable.consume(i.viewItem,s)}}({name:"ul",classes:"todo-list"}))})),e.conversion.for("downcast").elementToElement({model:n,view:(e,{writer:t})=>{if(ek(e,o.getListAttributeNames()))return t.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),o.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(e,t,i){"todo"==t?e.addClass("todo-list",i):e.removeClass("todo-list",i)}}),o.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(e,t,{dataPipeline:i}){if("todo"!=t.getAttribute("listType"))return null;const o=e.createUIElement("input",{type:"checkbox",...t.getAttribute("todoListChecked")?{checked:"checked"}:null,...i?{disabled:"disabled"}:{tabindex:"-1"}});if(i)return o;const n=e.createContainerElement("span",{contenteditable:"false"},o);return n.getFillerOffset=()=>null,n},canWrapElement:e=>ek(e,o.getListAttributeNames()),createWrapperElement(e,t,{dataPipeline:i}){const n=["todo-list__label"];return ek(t,o.getListAttributeNames())||n.push("todo-list__label_without-description"),e.createAttributeElement(i?"label":"span",{class:n.join(" ")})}}),o.on("checkElement",((e,{modelElement:t,viewElement:i})=>{const n=ek(t,o.getListAttributeNames());i.hasClass("todo-list__label__description")!=n&&(e.return=!0,e.stop())})),o.on("checkElement",((t,{modelElement:i,viewElement:o})=>{const n="todo"==i.getAttribute("listType")&&Zy(i);let s=!1;const r=e.editing.view.createPositionBefore(o).getWalker({direction:"backward"});for(const{item:t}of r){if(t.is("element")&&e.editing.mapper.toModelElement(t))break;t.is("element","input")&&"checkbox"==t.getAttribute("type")&&(s=!0)}s!=n&&(t.return=!0,t.stop())})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:o,previousNodeInList:n}of t){if(!n)continue;if(n.getAttribute("listItemId")!=o.getAttribute("listItemId"))continue;const t=n.hasAttribute("todoListChecked"),s=o.hasAttribute("todoListChecked");s&&!t?(i.removeAttribute("todoListChecked",o),e.return=!0):!s&&t&&(i.setAttribute("todoListChecked",!0,o),e.return=!0)}})),t.document.registerPostFixer((e=>{const i=t.document.differ.getChanges();let o=!1;for(const t of i)if("attribute"==t.type&&"listType"==t.attributeKey){const i=t.range.start.nodeAfter;"todo"==t.attributeOldValue&&i.hasAttribute("todoListChecked")&&(e.removeAttribute("todoListChecked",i),o=!0)}else if("insert"==t.type&&"$text"!=t.name)for(const{item:i}of e.createRangeOn(t.position.nodeAfter))i.is("element")&&"todo"!=i.getAttribute("listType")&&i.hasAttribute("todoListChecked")&&(e.removeAttribute("todoListChecked",i),o=!0);return o})),this.listenTo(i.view.document,"keydown",((t,i)=>{Ht(i)===Q_&&(e.execute("checkTodoList"),t.stop())}),{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",((e,t)=>{const o=t.target;if(!o||!o.is("element","input"))return;const n=i.view.createPositionAfter(o),s=i.mapper.toModelPosition(n).parent;s&&Uy(s)&&"todo"==s.getAttribute("listType")&&this._handleCheckmarkChange(s)})),this.listenTo(i.view.document,"arrowKey",function(e,t){return(i,o)=>{const n=Kt(o.keyCode,t.contentLanguageDirection),s=e.schema,r=e.document.selection;if(!r.isCollapsed)return;const a=r.getFirstPosition(),l=a.parent;if("right"==n&&a.isAtEnd){const t=s.getNearestSelectionRange(e.createPositionAfter(l),"forward");if(!t)return;const n=t.start.parent;n&&Uy(n)&&"todo"==n.getAttribute("listType")&&(e.change((e=>e.setSelection(t))),o.preventDefault(),o.stopPropagation(),i.stop())}else if("left"==n&&a.isAtStart&&Uy(l)&&"todo"==l.getAttribute("listType")){const t=s.getNearestSelectionRange(e.createPositionBefore(l),"backward");if(!t)return;e.change((e=>e.setSelection(t))),o.preventDefault(),o.stopPropagation(),i.stop()}}}(t,e.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",((e,i)=>{const o=i.viewPosition.parent,n=o.is("attributeElement","li")&&0==i.viewPosition.offset,s=tk(o)&&i.viewPosition.offset<=1,r=o.is("element","span")&&"false"==o.getAttribute("contenteditable")&&tk(o.parent);if(!n&&!s&&!r)return;const a=i.modelPosition.nodeAfter;a&&"todo"==a.getAttribute("listType")&&(i.modelPosition=t.createPositionAt(a,0))}),{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){const t=this.editor,i=t.model,o=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(e,"end"),t.execute("checkTodoList"),i.setSelection(o)}))}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor;let o=null;t&&e.document.selection.on("change:range",(()=>{const n=e.document.selection.focus.parent,s=ik(o),r=ik(n);s&&!r?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!s&&r&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),o=n}))}}function X_(e){const t=new uo(e);return(e,i,o)=>{const n=t.match(i.viewItem);n&&o.consumable.consume(i.viewItem,n.match)&&Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))}}function ek(e,t){return(e.is("element","paragraph")||e.is("element","listItem"))&&"todo"==e.getAttribute("listType")&&Zy(e)&&function(e,t){for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return!0}(e,t)}function tk(e){return!!e&&e.is("attributeElement")&&e.hasClass("todo-list__label")}function ik(e){return!!e&&(!(!e.is("element","paragraph")&&!e.is("element","listItem"))&&"todo"==e.getAttribute("listType"))}class ok extends fc{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;$_(this.editor,"todoList",e("To-do List"),'')}}const nk=Symbol("isOPCodeBlock");function sk(e){return!!e.getCustomProperty(nk)&&op(e)}function rk(e){const t=e.getSelectedElement();return!(!t||!sk(t))}function ak(e,t,i){const o=t.createContainerElement("pre",{title:window.I18n.t("js.editor.macro.toolbar_help")});return lk(t,e,o),function(e,t,i){return t.setCustomProperty(nk,!0,e),np(e,t,{label:i})}(o,t,i)}function lk(e,t,i){const o=(t.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),n=e.createContainerElement("div",{class:"op-uc-code-block--language"});ck(e,o,n,"text"),e.insert(e.createPositionAt(i,0),n);ck(e,t.getAttribute("opCodeblockContent"),i,"(empty)")}function ck(e,t,i,o){const n=e.createText(t||o);e.insert(e.createPositionAt(i,0),n)}class dk extends jn{constructor(e){super(e),this.domEventType="dblclick"}onDomEvent(e){this.fire(e.type,e)}}class uk extends fc{static get pluginName(){return"CodeBlockEditing"}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=Mp(e);var r,a;t.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),i.for("upcast").add(function(){return t=>{t.on("element:pre",e,{priority:"high"})};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:!0}))return;const o=Array.from(t.viewItem.getChildren()).find((e=>e.is("element","code")));if(!o||!i.consumable.consume(o,{name:!0}))return;const n=i.writer.createElement("codeblock");i.writer.setAttribute("opCodeblockLanguage",o.getAttribute("class"),n);const s=i.splitToAllowedParent(n,t.modelCursor);if(s){i.writer.insert(n,s.position);const e=o.getChild(0);if(e){i.consumable.consume(e,{name:!0});const t=e.data.replace(/\n$/,"");i.writer.setAttribute("opCodeblockContent",t,n)}t.modelRange=i.writer.createRange(i.writer.createPositionBefore(n),i.writer.createPositionAfter(n)),t.modelCursor=t.modelRange.end}}}()),i.for("editingDowncast").elementToElement({model:"codeblock",view:(e,{writer:t})=>ak(e,t,"Code block")}).add(function(){return t=>{t.on("attribute:opCodeblockContent",e),t.on("attribute:opCodeblockLanguage",e)};function e(e,t,i){const o=t.item;i.consumable.consume(t.item,e.name);const n=i.mapper.toViewElement(o);i.writer.remove(i.writer.createRangeOn(n.getChild(1))),i.writer.remove(i.writer.createRangeOn(n.getChild(0))),lk(i.writer,o,n)}}()),i.for("dataDowncast").add(function(){return t=>{t.on("insert:codeblock",e,{priority:"high"})};function e(e,t,i){const o=t.item,n=o.getAttribute("opCodeblockLanguage")||"language-text",s=o.getAttribute("opCodeblockContent");i.consumable.consume(o,"insert");const r=i.writer,a=r.createContainerElement("pre"),l=r.createContainerElement("div",{class:"op-uc-code-block--language"}),c=r.createContainerElement("code",{class:n}),d=r.createText(n),u=r.createText(s);r.insert(r.createPositionAt(c,0),u),r.insert(r.createPositionAt(l,0),d),r.insert(r.createPositionAt(a,0),l),r.insert(r.createPositionAt(a,0),c),i.mapper.bindElements(o,c),i.mapper.bindElements(o,a),i.mapper.bindElements(o,l);const h=i.mapper.toViewPosition(t.range.start);r.insert(h,a),e.stop()}}()),this.editor.editing.mapper.on("viewToModelPosition",(r=this.editor.model,a=e=>e.hasClass("op-uc-code-block"),(e,t)=>{const{mapper:i,viewPosition:o}=t,n=i.findMappedViewAncestor(o);if(!a(n))return;const s=i.toModelElement(n);t.modelPosition=r.createPositionAt(s,o.isAtStart?"before":"after")})),o.addObserver(dk),this.listenTo(n,"dblclick",((t,i)=>{let o=i.target,n=i.domEvent;if(n.shiftKey||n.altKey||n.metaKey)return;if(!sk(o)&&(o=o.findAncestor(sk),!o))return;i.preventDefault(),i.stopPropagation();const r=e.editing.mapper.toModelElement(o),a=s.services.macros,l=r.getAttribute("opCodeblockLanguage"),c=r.getAttribute("opCodeblockContent");a.editCodeBlock(c,l).then((t=>e.model.change((e=>{e.setAttribute("opCodeblockLanguage",t.languageClass,r),e.setAttribute("opCodeblockContent",t.content,r)}))))})),e.ui.componentFactory.add("insertCodeBlock",(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n\n',tooltip:!0}),i.on("execute",(()=>{s.services.macros.editCodeBlock().then((t=>e.model.change((i=>{const o=i.createElement("codeblock");i.setAttribute("opCodeblockLanguage",t.languageClass,o),i.setAttribute("opCodeblockContent",t.content,o),e.model.insertContent(o,e.model.document.selection)}))))})),i}))}}class hk extends fc{static get requires(){return[Qm]}static get pluginName(){return"CodeBlockToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditCodeBlock",(e=>{const o=i.services.macros,n=e.getAttribute("opCodeblockLanguage"),s=e.getAttribute("opCodeblockContent");o.editCodeBlock(s,n).then((i=>t.change((t=>{t.setAttribute("opCodeblockLanguage",i.languageClass,e),t.setAttribute("opCodeblockContent",i.content,e)}))))}))}afterInit(){qp(this,this.editor,"OPCodeBlock",rk)}}function mk(e){return e.__currentlyDisabled=e.__currentlyDisabled||[],e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]}function gk(e,t){mk(e).forEach((i=>{let o=i;i instanceof bh?o=i.buttonView:i!==t&&Object.prototype.hasOwnProperty.call(i,"isEnabled")||(o=null),o&&(o.isEnabled?o.isEnabled=!1:e.__currentlyDisabled.push(o))}))}function pk(e){mk(e).forEach((t=>{let i=t;t instanceof bh&&(i=t.buttonView),e.__currentlyDisabled.indexOf(i)<0&&(i.isEnabled=!0)})),e.__currentlyDisabled=[]}class fk{constructor(e){this.response=e}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return 401===this.statusCode}get unprocessableEntity(){return 422===this.statusCode}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(!this.isTurboStream)return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`));window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js")}async activeScript(){if(!this.isScript)return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`));{const e=document.createElement("script"),t=document.querySelector("meta[name=csp-nonce]");if(t){const i=""===t.nonce?t.content:t.nonce;i&&e.setAttribute("nonce",i)}e.innerHTML=await this.text,document.body.appendChild(e)}}}class bk{static register(e){this.interceptor=e}static get(){return this.interceptor}static reset(){this.interceptor=void 0}}function wk(e){const t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.content}class yk{constructor(e,t,i={}){this.method=e,this.options=i,this.originalUrl=t.toString()}async perform(){try{const e=bk.get();e&&await e(this)}catch(e){console.error(e)}const e=window.Turbo?window.Turbo.fetch:window.fetch,t=new fk(await e(this.url,this.fetchOptions));if(t.unauthenticated&&t.authenticationURL)return Promise.reject(window.location.href=t.authenticationURL);t.isScript&&await t.activeScript();return(t.ok||t.unprocessableEntity)&&t.isTurboStream&&await t.renderTurboStream(),t}addHeader(e,t){const i=this.additionalHeaders;i[e]=t,this.options.headers=i}sameHostname(){if(!this.originalUrl.startsWith("http:")&&!this.originalUrl.startsWith("https:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch(e){return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect,keepalive:this.keepalive}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(e["X-CSRF-Token"]=this.csrfToken),function(e){const t={};for(const i in e){const o=e[i];void 0!==o&&(t[i]=o)}return t}(Object.assign(e,this.additionalHeaders))}get csrfToken(){return function(e){const t=document.cookie?document.cookie.split("; "):[],i=`${encodeURIComponent(e)}=`,o=t.find((e=>e.startsWith(i)));if(o){const e=o.split("=").slice(1).join("=");if(e)return decodeURIComponent(e)}}(wk("csrf-param"))||wk("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:null==this.body||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){const e=(this.originalUrl.split("?")[1]||"").split("#")[0],t=new URLSearchParams(e);let i=this.options.query;var o;i instanceof window.FormData?(o=i,i=[...o].reduce(((e,[t,i])=>e.concat("string"==typeof i?[[t,i]]:[])),[])):i=i instanceof window.URLSearchParams?i.entries():Object.entries(i||{}),function(e,t){for(const[i,o]of t)o instanceof window.File||(e.has(i)&&!i.includes("[]")?(e.delete(i),e.set(i,o)):e.append(i,o))}(t,i);const n=t.toString();return n.length>0?`?${n}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get keepalive(){return this.options.keepalive||!1}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){const e="[object String]"===Object.prototype.toString.call(this.body);return"application/json"===this.headers["Content-Type"]&&!e?JSON.stringify(this.body):this.body}}async function _k(e,t){return new yk("get",e,t).perform()}function kk(e,t){const{modelAttribute:i,styleName:o,attributeName:n,attributeType:s,viewElement:r,defaultValue:a,shouldUpcast:l=()=>!0,reduceBoxSides:c=!1}=t;e.for("upcast").attributeToAttribute({view:{name:r,styles:{[o]:/[\s\S]+/}},model:{key:i,value:(e,t,i)=>{if(!l(e))return;const n=xk(a,"",i),s=e.getNormalizedStyle(o),r=c?Ek(s):s;if(n!==r)return r;t.consumable.consume(e,{styles:o})}}}),n&&e.for("upcast").attributeToAttribute({view:{name:r,attributes:{[n]:/.+/}},model:{key:i,value:(e,t,i)=>{if("figure"==e.name||e.hasStyle(o)||"table"==e.name&&"figure"==e.parent.name&&e.parent.hasStyle(o))return;const r=xk(a,"",i);let l=e.getAttribute(n);if(l&&"length"==s){const e=parseFloat(l);l=isNaN(e)?r:e+(l.includes("%")?"%":"px")}if(r!==l)return l;t.consumable.consume(e,{attributes:n})}}})}function vk(e,t,i,o){const{conversion:n}=e;n.for("upcast").add((e=>{e.on(`element:${t}`,((e,t,n)=>{const{modelRange:s,viewItem:r}=t;if(!s)return;const a=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter((e=>r.hasStyle(e))),l=r.is("element","table")?r:r.findAncestor("table"),c=l.hasAttribute("border");if(!a.length&&!c)return;const d={styles:a};if(!n.consumable.test(r,d))return;const u=ti(s.getItems({shallow:!0})),h=u.findAncestor("table",{includeSelf:!0});let m=o;h&&"layout"==h.getAttribute("tableType")&&(m={style:"none",color:"",width:""}),n.consumable.consume(r,d);const g={style:r.getNormalizedStyle("border-style"),color:r.getNormalizedStyle("border-color"),width:r.getNormalizedStyle("border-width")};if(c&&n.consumable.test(l,{attributes:"border"})){const e=parseFloat(l.getAttribute("border")||"1"),t=Number.isNaN(e)||!Number.isFinite(e)||e<0||"table"!=r.name&&e>1?"1px":`${e}px`;g.width={top:t,bottom:t,right:t,left:t,...g.width||{}},r.is("element","table")&&n.consumable.consume(l,{attributes:"border"})}const p={style:Ek(g.style),color:Ek(g.color),width:Ek(g.width)};p.style!==m.style&&n.writer.setAttribute(i.style,p.style,u),p.color!==m.color&&n.writer.setAttribute(i.color,p.color,u),p.width!==m.width&&n.writer.setAttribute(i.width,p.width,u)}))}))}function Ck(e,t){const{modelElement:i,modelAttribute:o,styleName:n}=t;e.for("downcast").attributeToAttribute({model:{name:i,key:o},view:e=>({key:"style",value:{[n]:e}})})}function Ak(e,t){const{modelAttribute:i,styleName:o}=t;e.for("downcast").add((e=>{e.on(`attribute:${i}:table`,((e,t,i)=>{const{item:n,attributeNewValue:s}=t,{mapper:r,writer:a}=i;if(!i.consumable.consume(t.item,e.name))return;const l=Array.from(r.toViewElement(n).getChildren()).find((e=>e.is("element","table")));s?a.setStyle(o,s,l):a.removeStyle(o,l)}))}))}function xk(e,t,i){const o=i.modelRange&&ti(i.modelRange.getItems({shallow:!0})),n=o&&o.is("element")&&o.findAncestor("table",{includeSelf:!0});return n&&"layout"===n.getAttribute("tableType")?t:e}function Ek(e){if(!e)return;const t=["top","right","bottom","left"];if(!t.every((t=>e[t])))return e;const i=e.top;return t.every((t=>e[t]===i))?i:e}function Tk(e,t,i){const{conversion:o}=e;o.for("upcast").add((e=>{e.on(`element:${t}`,((e,t,o)=>{const{modelRange:n,viewItem:s}=t;if(!n)return;if(s.is("element","table"))return void o.consumable.consume(s,{attributes:"cellpadding"});const r=s.findAncestor("table");if(!r.hasAttribute("cellpadding")||!o.consumable.test(r,{attributes:"cellpadding"}))return;const a=n?.start?.nodeAfter,l=parseFloat(r.getAttribute("cellpadding")||"1"),c=Number.isNaN(l)||!Number.isFinite(l)||l<0?"0px":`${l}px`,d=a.getAttribute("tableCellPadding");if(d){if("object"==typeof d){const e={...i!==c&&{top:c},...i!==c&&{right:c},...i!==c&&{bottom:c},...i!==c&&{left:c},...d};o.writer.setAttribute("tableCellPadding",e,a)}}else i!==c&&o.writer.setAttribute("tableCellPadding",c,a)}),{priority:"low"})}))}const Pk={className:"table-style-align-left"},Sk={className:"table-style-align-center"},Ik={className:"table-style-align-right"},Rk={className:"table-style-block-align-left"},Ok={className:"table-style-block-align-right"},Vk=[{view:{name:/^(table|figure)$/,styles:{float:/^(left|none|right)$/}},getAlign:e=>{let t=e.getStyle("float");return"none"===t&&(t="center"),t},getConsumables(e){const t=e.getStyle("float"),i=["float"];return"left"===t&&e.hasStyle("margin-right")?i.push("margin-right"):"right"===t&&e.hasStyle("margin-left")&&i.push("margin-left"),{styles:i}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"auto"}},getAlign:()=>"center",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,key:"class",value:"table-style-align-left"},getAlign:()=>"left",getConsumables:()=>({classes:Pk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Ik.className},getAlign:()=>"right",getConsumables:()=>({classes:Ik.className})},{view:{name:/^(table|figure)$/,key:"class",value:Sk.className},getAlign:()=>"center",getConsumables:()=>({classes:Sk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Rk.className},getAlign:()=>"blockLeft",getConsumables:()=>({classes:Rk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Ok.className},getAlign:()=>"blockRight",getConsumables:()=>({classes:Ok.className})},{view:{name:/^(table|figure)$/,styles:{"margin-left":"0","margin-right":"auto"}},getAlign:()=>"blockLeft",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"0"}},getAlign:()=>"blockRight",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:"table",attributes:{align:/^(left|center|right)$/}},getAlign:e=>e.getAttribute("align"),getConsumables:()=>({attributes:"align"})}],Dk={center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:Rk.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:Ok.className}};class Fk{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const o=parseInt(i.getAttribute("colspan")||"1"),n=parseInt(i.getAttribute("rowspan")||"1");(o>1||n>1)&&this._recordSpans(i,n,o),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new Mk(this,e,t,i)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||i||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class Mk{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Nk(e){return"header"===e||"header-row"===e||"header-column"===e}function Bk(e,t,i,o,n=1){null!=t&&null!=n&&t>n?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Lk(e,t,i={}){const o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function zk(e,t){const i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&n0){Bk("headingRows",s-i,e,n,0)}const r=parseInt(t.getAttribute("headingColumns")||"0");if(r>0){Bk("headingColumns",r-o,e,n,0)}}(a,e,o,n,i),function(e,t,i,o,n){const s=Array.from(t.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),r=parseInt(t.getAttribute("footerRows")||"0"),a=s-r;if(r<1)return;let l=0;o>=a&&(l=o-Math.max(a,i)+1);Bk("footerRows",l,e,n,0)}(a,e,o,s,i),a}function Uk(e,t,i=0){const o=[],n=new Fk(e,{startRow:i,endRow:t-1});for(const e of n){const{row:i,cellHeight:n}=e;i1&&(a.rowspan=l);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=s+r,u=[...new Fk(n,{startRow:s,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:n,cell:s}=t;s===e&&void 0===h&&(h=n),void 0!==h&&h===n&&o===d&&(m=Lk(i,t.getPositionBefore(),a))}return Bk("rowspan",r,e,i),m}function Gk(e,t){const i=[],o=new Fk(e);for(const e of o){const{column:o,cellWidth:n}=e;o1&&(s.colspan=r);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(s.rowspan=a);const l=Lk(o,o.createPositionAfter(e),s);return Bk("colspan",n,e,o),l}function Zk(e,t,i,o,n,s){const r=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(i+r-1>n){Bk("colspan",n-i+1,e,s,1)}if(t+a-1>o){Bk("rowspan",o-t+1,e,s,1)}}function Qk(e,t){const i=t.getColumns(e),o=new Array(i).fill(0);for(const{column:t}of new Fk(e))o[t]++;const n=o.reduce(((e,t,i)=>t?e:[...e,i]),[]);if(n.length>0){const i=n[n.length-1];return t.removeColumns(e,{at:i}),!0}return!1}function Yk(e,t){const i=[],o=t.getRows(e);for(let t=0;t0){const o=i[i.length-1];return t.removeRows(e,{at:o}),!0}return!1}function Xk(e,t){Qk(e,t)||Yk(e,t)}function ev(e,t){const i=Array.from(new Fk(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=i[0].cellHeight-1;return t.lastRow+o}function tv(e,t){const i=Array.from(new Fk(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=i[0].cellWidth-1;return t.lastColumn+o}function iv(e){for(const t of e.getChildren())if(t.is("element","table"))return t}function ov(e){return t=>{t.on("element:table",((t,i,o)=>{const n=i.viewItem;if(!o.consumable.test(n,{name:!0}))return;const{rows:s,headingRows:r,headingColumns:a,footerRows:l}=function(e){let t,i=!0;const o=[],n=[],s=[];let r=null,a=null;const l=Array.from(e.getChildren());for(let e=0;ee.is("element","tr")));let d=null,u=null;for(const h of c){const m=Array.from(h.getChildren()).filter((e=>e.is("element","td")||e.is("element","th")));if("tfoot"===t.name){a||={element:t,rows:c},i=!1;const o=a.element===t;if(!o&&null===u)for(let t=e;t0&&(null===d||m.length===d)&&m.every((e=>e.is("element","th")))&&i?(o.push(h),i=!0):(n.push(h),i=!1),d=Math.max(d||0,m.length)}}const c=function(e){let t=new Map,i=0;const o=e.map((e=>{const o=[],n=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name)),s=new Map;for(;n.length||o.length0)o.push(e.cell);else{const e=n.shift();if(!e){o.push(null);continue}{const t=parseInt(e.getAttribute("colspan")||"1"),i=parseInt(e.getAttribute("rowspan")||"1");for(let n=0;n1&&s.set(o.length,{cell:e,remaining:i-1}),o.push(e)}}}for(const[e,i]of t.entries())i.remaining-=1,i.remaining>0&&!s.has(e)&&s.set(e,i);return t=s,i=Math.max(i,o.length),o}));for(const e of o)for(;e.lengtho.convertItem(e,o.writer.createPositionAt(d,"end")))),o.convertChildren(n,o.writer.createPositionAt(d,"end")),d.isEmpty){const e=o.writer.createElement("tableRow");o.writer.insert(e,o.writer.createPositionAt(d,"end")),Lk(o.writer,o.writer.createPositionAt(e,"end"))}o.updateConversionResult(d,i)}}))}}function nv(e){return t=>{t.on(`element:${e}`,((e,t,{writer:i})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,n=i.createPositionAt(o,0);if(t.viewItem.isEmpty)return void i.insertElement("paragraph",n);const s=Array.from(o.getChildren());if(s.every((e=>e.is("element","$marker")))){const e=i.createElement("paragraph");i.insert(e,i.createPositionAt(o,0));for(const t of s)i.move(i.createRangeOn(t),i.createPositionAt(e,"end"))}}),{priority:"low"})}}function sv(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}function rv(e){const t=sv(e);return t?Array.from(t.getChildren()):[]}class av extends fc{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,i=t.parent,o=i.getChildIndex(t),n=new Fk(i,{row:o});for(const{cell:t,row:i,column:o}of n)if(t===e)return{row:i,column:o}}createTable(e,t){const i=e.createElement("table");return lv(e,i,0,t.rows||2,t.columns||2),t.footerRows&&this.setFooterRowsCount(e,i,t.footerRows),t.headingRows&&this.setHeadingRowsCount(e,i,t.headingRows),t.headingColumns&&this.setHeadingColumnsCount(e,i,t.headingColumns),i}insertRows(e,t={}){const i=this.editor.model,o=t.at||0,n=t.rows||1,s=void 0!==t.copyStructureFromAbove,r=t.copyStructureFromAbove?o-1:o,a=Hk(this.editor),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=this.getRows(e),d=this.getColumns(e);if(o>c)throw new fe("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change((t=>{let i=e.getAttribute("headingRows")||0,u=e.getAttribute("footerRows")||0;if(i>o&&(i+=n),u&&o>c-u&&(u+=n),s||0!==o&&o!==c){const i=s?Math.max(o,r):o,c=new Fk(e,{endRow:i}),u=new Array(d).fill(1);for(const{row:e,column:i,cellHeight:a,cellWidth:l,cell:d}of c){const c=e+a-1,h=e<=r&&r<=c;e0){const n=Lk(t,c,r>1?{colspan:r}:void 0);a&&hv({table:e,writer:t,cell:n,row:o+i,column:s,scopedHeaders:l})}s+=Math.abs(r)-1}}}else{const i=lv(t,e,o,n,d);if(a)for(let n=0;n{let i=e.getAttribute("headingColumns");on-1)throw new fe("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change((t=>{const i={first:s,last:r},{cellsToMove:o,cellsToTrim:a}=function(e,{first:t,last:i}){const o=new Map,n=[];for(const{row:s,column:r,cellHeight:a,cell:l}of new Fk(e,{endRow:i})){const e=s+a-1;if(s>=t&&s<=i&&e>i){const e=a-(i-s+1);o.set(r,{cell:l,rowspan:e})}if(s=t){let o;o=e>=i?i-t+1:e-t+1,n.push({cell:l,rowspan:a-o})}}return{cellsToMove:o,cellsToTrim:n}}(e,i);if(o.size){!function(e,t,i,o){const n=new Fk(e,{includeAllSlots:!0,row:t}),s=[...n],r=e.getChild(t);let a;for(const{column:e,cell:t,isAnchor:n}of s)if(i.has(e)){const{cell:t,rowspan:n}=i.get(e),s=a?o.createPositionAfter(a):o.createPositionAt(r,0);o.move(o.createRangeOn(t),s),Bk("rowspan",n,t,o),a=t}else n&&(a=t)}(e,r+1,o,t)}for(let i=r;i>=s;i--)t.remove(e.getChild(i));for(const{rowspan:e,cell:i}of a)Bk("rowspan",e,i,t);if(function(e,{first:t,last:i},o){const n=e.getAttribute("headingRows")||0;if(t=r){Bk("footerRows",i>=r?s-(o-i+1):t-1-o,e,n,0)}}(e,n,i,t),Qk(e,this)||Yk(e,this),Hk(this.editor)){let i=e.getAttribute("headingRows")||0;const o=this.getRows(e);for(;i{!function(e,t,i){const o=e.getAttribute("headingColumns")||0;if(o&&t.first=o;n--){for(const{cell:i,column:o,cellWidth:s}of[...new Fk(e)])o<=n&&s>1&&o+s>n?Bk("colspan",s-1,i,t):o===n&&t.remove(i);if(i[n]){const e=0===n?i[1]:i[n-1],o=parseFloat(i[n].getAttribute("columnWidth")),s=parseFloat(e.getAttribute("columnWidth"));t.remove(i[n]),t.setAttribute("columnWidth",o+s+"%",e)}}if(Yk(e,this)||Qk(e,this),Hk(this.editor)){let i=e.getAttribute("headingColumns")||0;const o=this.getColumns(e);for(;i{if(s>1){const{newCellsSpan:o,updatedSpan:r}=dv(s,t);Bk("colspan",r,e,i);const a={};o>1&&(a.colspan=o),n>1&&(a.rowspan=n);cv(s>t?t-1:s-1,i,i.createPositionAfter(e),a)}if(st===e)),c=a.filter((({cell:t,cellWidth:i,column:o})=>t!==e&&o===l||ol));for(const{cell:e,cellWidth:t}of c)i.setAttribute("colspan",t+r,e);const d={};n>1&&(d.rowspan=n),cv(r,i,i.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>l&&Bk("headingColumns",u+r,o,i)}}))}splitCellHorizontally(e,t=2){const i=this.editor.model,o=e.parent,n=o.parent,s=n.getChildIndex(o),r=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(r>1){const o=[...new Fk(n,{startRow:s,endRow:s+r-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=dv(r,t);Bk("rowspan",c,e,i);const{column:d}=o.find((({cell:t})=>t===e)),u={};l>1&&(u.rowspan=l),a>1&&(u.colspan=a);let h=0;for(const e of o){const{column:t,row:o}=e,n=t===d;h>=l&&n&&(h=0),o>=s+c&&n&&(h||cv(1,i,e.getPositionBefore(),u),h++)}}if(rs){const e=n+o;i.setAttribute("rowspan",e,t)}const d={};a>1&&(d.colspan=a),lv(i,n,s+1,o,1,d);const u=n.getAttribute("headingRows")||0;u>s&&Bk("headingRows",u+o,n,i);const h=n.getAttribute("footerRows")||0;l-h<=s&&Bk("footerRows",h+o,n,i)}}))}getColumns(e){return[...e.getChild(0).getChildren()].filter((e=>e.is("element","tableCell"))).reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new Fk(e,t)}getSelectedTableCells(e){const t=[];for(const i of this.sortRanges(e.getRanges())){const e=i.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}setFooterRowsCount(e,t,i){if(!this.editor.config.get("table.enableFooters"))return;const o=t.getAttribute("headingRows")||0,n=this.getRows(t),s=Math.min(i,n);if(Bk("footerRows",s,t,e,0),o+s>n){const i=n-s;this.setHeadingRowsCount(e,t,i)}}setHeadingRowsCount(e,t,i,o={}){const{updateCellType:n=!0,resetFormerHeadingCells:s=!0,autoExpand:r=!0}=o,a=this.getRows(t),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=t.getAttribute("headingRows")||0;let d=Math.min(i,a);if(d===c)return;Bk("headingRows",d,t,e,0);if(d+(t.getAttribute("footerRows")||0)>a){const i=a-d;this.setFooterRowsCount(e,t,i)}if(Hk(this.editor)){if(n){for(const{cell:i,row:o,column:n}of new Fk(t,{endRow:d-1}))hv({table:t,writer:e,cell:i,row:o,column:n,scopedHeaders:l});if(s&&dc){for(;dl){for(;de.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),i=[...new Fk(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,i=new Set;let o=0;for(const n of e){const{row:e,column:s}=this.getCellLocation(n),r=parseInt(n.getAttribute("rowspan"))||1,a=parseInt(n.getAttribute("colspan"))||1;t.add(e),i.add(s),r>1&&t.add(e+r-1),a>1&&i.add(s+a-1),o+=r*a}const n=function(e,t){const i=Array.from(e.values()),o=Array.from(t.values()),n=Math.max(...i),s=Math.min(...i),r=Math.max(...o),a=Math.min(...o);return(n-s+1)*(r-a+1)}(t,i);return n==o}sortRanges(e){return Array.from(e).sort(uv)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),i=this.getRows(t),o=this.getRowIndexes(e),n=parseInt(t.getAttribute("headingRows"))||0,s=parseInt(t.getAttribute("footerRows"))||0;if(!this._areIndexesInSameHeadingSection(o,n)||!this._areIndexesInSameFooterSection(o,i,s))return!1;const r=this.getColumnIndexes(e),a=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameHeadingSection(r,a)}_areIndexesInSameHeadingSection({first:e,last:t},i){return e=n===t>=n}}function lv(e,t,i,o,n,s={}){const r=[];for(let a=0;a=r&&o>=a)return void e.removeAttribute("tableCellType",n);let l="header";s&&(l=i{const n=i.getAttribute("headingRows")||0,s=i.getAttribute("footerRows")||0,r=o.createContainerElement("table",null,[]),a=o.createContainerElement("figure",{class:"table"},r),l=e.getRows(i);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=n&&e.index0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("tfoot",null,o.createSlot((e=>e.is("element","tableRow")&&e.index>=l-s))));for(const{positionOffset:e,filter:i}of t.additionalSlots)o.insert(o.createPositionAt(r,e),o.createSlot(i));return o.insert(o.createPositionAt(r,"after"),o.createSlot((e=>!e.is("element","tableRow")&&!t.additionalSlots.some((({filter:t})=>t(e)))))),t.asWidget?function(e,t){return t.setCustomProperty("table",!0,e),np(e,t,{hasSelectionHandle:!0})}(a,o):a}}function yv(e){return(i,{writer:o})=>{if(e.cellTypeEnabled?.()){return t(o,Nk(i.getAttribute("tableCellType"))?"th":"td")}const n=i.parent,s=n.parent,r=s.getChildIndex(n),a=new Fk(s,{row:r}),l=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0;let d=null;for(const e of a)if(e.cell==i){d=t(o,e.row{if(!t.parent.is("element","tableCell"))return null;if(!kv(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function kv(e){return 1==e.parent.childCount&&!function(e){for(const t of e.getAttributeKeys())if(!t.startsWith("selection:")&&"htmlEmptyBlock"!=t)return!0;return!1}(e)}function vv(e){return(t,i)=>{const o=e.plugins.has("PlainTableOutput"),n=i.options.isClipboardPipeline,s=Av(e,t);return o||s||n?function(e,t,i){const o=i.plugins.get(av),n=t.writer,s=o.getRows(e),r=e.getAttribute("headingRows")||0,a=e.getAttribute("footerRows")||0,l=s-a,c=n.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=r&&e.indexe.is("element","tableRow")&&e.index>=l)),h=n.createSlot((e=>!e.is("element","tableRow"))),m=n.createContainerElement("thead",null,c),g=n.createContainerElement("tbody",null,d),p=n.createContainerElement("tfoot",null,u),f=[];r&&f.push(m);r+a{const n=e.plugins.has("PlainTableOutput"),s=o.isClipboardPipeline,r=Av(e,t);return(n||r||s)&&"table"===t.parent.name?i.createContainerElement("caption"):null}}function Av(e,t){const i=e.plugins.has("TableLayoutEditing"),o=e.config.get("table.tableLayout.stripFigureFromContentTable")??!1,n=t.findAncestor("table",{includeSelf:!0}),s=n?.getAttribute("tableType");return i&&(o||"layout"===s)}class xv extends wc{refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=function(e,t){const i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}(t,i)}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("TableUtils"),n=!!t.config.get("table.enableFooters"),s=t.config.get("table.defaultHeadings.rows"),r=t.config.get("table.defaultHeadings.columns"),a=t.config.get("table.defaultFooters");void 0===e.headingRows&&s&&(e.headingRows=s),void 0===e.headingColumns&&r&&(e.headingColumns=r),n&&void 0===e.footerRows&&a&&(e.footerRows=a),!n&&"footerRows"in e&&delete e.footerRows,i.change((t=>{const n=o.createTable(t,e);i.insertObject(n,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(n.getNodeByPath([0,0,0]),0))}))}}class Ev extends wc{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="above"===this.order,n=i.getSelectionAffectedTableCells(t),s=i.getRowIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?r:r+1,copyStructureFromAbove:!o})}}class Tv extends wc{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="left"===this.order,n=i.getSelectionAffectedTableCells(t),s=i.getColumnIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?r:r+1})}}class Pv extends wc{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}class Sv extends wc{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change((e=>{const t="right"==n||"down"==n,s=t?i:o,r=t?o:i,a=r.parent;!function(e,t,i){Iv(e)||(Iv(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end")));i.remove(e)}(r,s,e);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(i.getAttribute(l)||"1"),d=parseInt(o.getAttribute(l)||"1");e.setAttribute(l,c+d,s),e.setSelection(e.createRangeIn(s));const u=this.editor.plugins.get("TableUtils");Xk(a.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;const o=this.isHorizontal?function(e,t,i){const o=e.parent,n=o.parent,s="right"==t?e.nextSibling:e.previousSibling,r=(n.getAttribute("headingColumns")||0)>0;if(!s)return;const a="right"==t?e:s,l="right"==t?s:e,{column:c}=i.getCellLocation(a),{column:d}=i.getCellLocation(l),u=parseInt(a.getAttribute("colspan")||"1"),h=zk(i,a),m=zk(i,l);if(r&&h!=m)return;return c+u===d?s:void 0}(i,this.direction,t):function(e,t,i){const o=e.parent,n=o.parent,s=n.getChildIndex(o),r=i.getRows(n);if("down"==t&&s===r-1||"up"==t&&0===s)return null;const a=parseInt(e.getAttribute("rowspan")||"1"),l=n.getAttribute("headingRows")||0,c=n.getAttribute("footerRows")||0,d=r-c,u="up"==t&&s===d,h="up"==t&&s===l,m="down"==t&&s+a===l,g="down"==t&&s+a===d;if(l&&(m||h))return null;if(c&&(u||g))return null;const p=parseInt(e.getAttribute("rowspan")||"1"),f="down"==t?s+p:s,b=[...new Fk(n,{endRow:f})],w=b.find((t=>t.cell===e)),y=w.column,_=b.find((({row:e,cellHeight:i,column:o})=>o===y&&("down"==t?e===f:f===e+i)));return _&&_.cell?_.cell:null}(i,this.direction,t);if(!o)return;const n=this.isHorizontal?"rowspan":"colspan",s=parseInt(i.getAttribute(n)||"1");return parseInt(o.getAttribute(n)||"1")===s?o:void 0}}function Iv(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class Rv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getRows(o)-1,s=e.getRowIndexes(t),r=0===s.first&&s.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],s=n.findAncestor("table"),r=t.getCellLocation(n).column;e.change((e=>{const i=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:i});const n=function(e,t,i,o){const n=e.getChild(Math.min(t,o-1));let s=n.getChild(0),r=0;for(const e of n.getChildren()){if(r>i)return s;s=e,r+=parseInt(e.getAttribute("colspan")||"1")}return s}(s,o.first,r,t.getRows(s));e.setSelection(e.createPositionAt(n,0))}))}}class Ov extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getColumns(o),{first:s,last:r}=e.getColumnIndexes(t);this.isEnabled=r-se.cell===t)).column,last:n.find((e=>e.cell===i)).column},r=function(e,t,i,o){const n=parseInt(i.getAttribute("colspan")||"1");return n>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>ee>o.last)).cell}(n,t,i,s);this.editor.model.change((t=>{const i=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:i}),t.setSelection(t.createPositionAt(r,0))}))}}class Vv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingRows"),this.value=i.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=this.value?s:r+1,l=n.getAttribute("headingRows")||0;i.change((e=>{if(a){const t=Uk(n,a,a>l?l:0);for(const{cell:i}of t)Kk(i,a,e)}t.setHeadingRowsCount(e,n,a)}))}_isInHeading(e,t){const i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.indexthis._isInFooter(e,o)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=t.getRows(n),l=this.value?a-(r+1):a-s,c=n.getAttribute("footerRows")||0;i.change((e=>{if(l){const t=a-l,i=a-c,o=Uk(n,t,t>i?i:0);for(const{cell:i}of o)Kk(i,t,e)}t.setFooterRowsCount(e,n,l)}))}_isInFooter(e,t){const i=parseInt(t.getAttribute("footerRows")||"0"),o=this.editor.plugins.get("TableUtils").getRows(t),n=e.parent.index;return!!i&&n>=o-i}}class Fv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingColumns"),this.value=i.every((t=>zk(e,t)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getColumnIndexes(o),a=this.value?s:r+1;i.change((e=>{if(a){const t=Gk(n,a);for(const{cell:i,column:o}of t)Jk(i,o,a,e)}t.setHeadingColumnsCount(e,n,a)}))}}class Mv extends wc{refresh(){const e=this.editor.plugins.get(av),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){const e=this.editor.model,t=this.editor.plugins.get(av);e.change((i=>{const o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:s,mergeHeight:r}=function(e,t,i){let o=0,n=0;for(const e of t){const{row:t,column:s}=i.getCellLocation(e);o=Lv(e,s,o,"colspan"),n=Lv(e,t,n,"rowspan")}const{row:s,column:r}=i.getCellLocation(e),a=o-r,l=n-s;return{mergeWidth:a,mergeHeight:l}}(n,o,t);Bk("colspan",s,n,i),Bk("rowspan",r,n,i);for(const e of o)Nv(e,n,i);Xk(n.findAncestor("table"),t),i.setSelection(n,"in")}))}}function Nv(e,t,i){Bv(e)||(Bv(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function Bv(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function Lv(e,t,i,o){const n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}class zv extends wc{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),s=[];for(let t=o.first;t<=o.last;t++)for(const i of n.getChild(t).getChildren())s.push(e.createRangeOn(i));e.change((e=>{e.setSelection(s)}))}}class jv extends wc{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),s=o.findAncestor("table"),r=e.getCellLocation(o),a=e.getCellLocation(n),l=Math.min(r.column,a.column),c=Math.max(r.column,a.column),d=[];for(const e of new Fk(s,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function $v(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;const n=new Set;for(const t of i){let i=null;"insert"==t.type&&"table"==t.name&&(i=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(i=t.position.findAncestor("table")),Wv(t)&&(i=t.range.start.findAncestor("table")),i&&!n.has(i)&&(o=qv(i,e)||o,o=Hv(i,e)||o,n.add(i))}return o}(t,e)))}function qv(e,t){let i=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),i=parseInt(e.getAttribute("footerRows")||"0"),o=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),n=o-i,s=[];for(const{row:i,cell:r,cellHeight:a}of new Fk(e)){if(a<2)continue;let e;if(e=i=n?o:n,i+a>e){const t=e-i;s.push({cell:r,rowspan:t})}}return s}(e);if(o.length){i=!0;for(const e of o)Bk("rowspan",e.rowspan,e.cell,t,1)}return i}function Hv(e,t){let i=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:i}of new Fk(e,{includeAllSlots:!0}))t[i]++;return t}(e),n=[];for(const[t,i]of o.entries())!i&&e.getChild(t).is("element","tableRow")&&n.push(t);if(n.length){i=!0;for(const i of n.reverse())t.remove(e.getChild(i)),o.splice(i,1)}const s=o.filter(((t,i)=>e.getChild(i).is("element","tableRow"))),r=s[0];if(!s.every((e=>e===r))){const o=s.reduce(((e,t)=>t>e?t:e),0);for(const[n,r]of s.entries()){const s=o-r;if(s){for(let i=0;ifunction(e,t){const i=t.document.differ.getChanges();let o=!1;for(const t of i)"insert"==t.type&&"table"==t.name&&(o=Kv(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=Gv(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=Jv(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!Zv(t)||(o=Jv(t.position.parent,e)||o);return o}(t,e)))}function Kv(e,t){let i=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(i=Gv(o,t)||i);return i}function Gv(e,t){let i=!1;for(const o of e.getChildren())i=Jv(o,t)||i;return i}function Jv(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const i=Array.from(e.getChildren()).filter((e=>e.is("$text")));for(const e of i)t.wrap(t.createRangeOn(e),"paragraph");return!!i.length}function Zv(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function Qv(e,t,i){const o=i.getAttribute("headingRows")||0,n=i.getAttribute("footerRows")||0,s=e.getRows(i);if(o+n>s){return Bk("footerRows",Math.max(0,s-o),i,t,0),!0}return!1}function Yv(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&kv(e)!==i.is("element","span")}class Xv extends fc{_additionalSlots;static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[av]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get(av);e.config.define("table.enableFooters",!1);const s=!!e.config.get("table.enableFooters");i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns",...s?["footerRows"]:[]]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=iv(t.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(t.viewItem,{name:!0,classes:"table"});const n=i.convertItem(o,t.modelCursor),s=ti(n.modelRange.getItems());if(!s||!s.is("element","table"))return i.consumable.revert(t.viewItem,{name:!0,classes:"table"}),void(n.modelRange&&!n.modelRange.isCollapsed&&(t.modelRange=n.modelRange,t.modelCursor=n.modelCursor));i.convertChildren(t.viewItem,i.writer.createPositionAt(s,"end")),i.updateConversionResult(s,t)}))})),o.for("upcast").add(ov({enableFooters:s})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:wv(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:wv(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(nv("td")),o.for("upcast").add(nv("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:yv({asWidget:!0,cellTypeEnabled:()=>Hk(this.editor)})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:yv({cellTypeEnabled:()=>Hk(this.editor)})}),o.for("editingDowncast").elementToElement({model:"paragraph",view:_v({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:_v(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:eC("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:eC("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.defaultFooters",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change((t=>{for(const i of e.editing.view.document.roots)t.addClass("ck-table-show-hidden-borders",i)})),e.commands.add("insertTable",new xv(e)),e.commands.add("insertTableRowAbove",new Ev(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Ev(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Tv(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Tv(e,{order:"right"})),e.commands.add("removeTableRow",new Rv(e)),e.commands.add("removeTableColumn",new Ov(e)),e.commands.add("splitTableCellVertically",new Pv(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Pv(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new Mv(e)),e.commands.add("mergeTableCellRight",new Sv(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Sv(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Sv(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Sv(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Fv(e)),e.commands.add("setTableRowHeader",new Vv(e)),s&&e.commands.add("setTableFooterRow",new Dv(e)),e.commands.add("selectTableRow",new zv(e)),e.commands.add("selectTableColumn",new jv(e)),$v(t),Uv(t),s&&function(e){const{model:t}=e,i=e.plugins.get(av);t.document.registerPostFixer((e=>{let o=!1;const n=t.document.differ.getChanges(),s=new Set;for(const e of n){let t=null;"attribute"!=e.type||"headingRows"!=e.attributeKey&&"footerRows"!=e.attributeKey?("insert"==e.type&&"tableRow"==e.name||"remove"==e.type&&"tableRow"==e.name)&&(t=e.position.parent):t=e.range.start.nodeAfter,t&&t.is("element","table")&&s.add(t)}for(const t of s)Qv(i,e,t)&&(o=!0);return o}))}(e),this.listenTo(t.document,"change:data",(()=>{Hk(e)||function(e,t){const i=e.document.differ,o=new Set,n=new Set,s=new Set;for(const e of i.getChanges()){let i;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey&&"footerRows"!=e.attributeKey)continue;i=t}else"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table"));if(!i)continue;"insert"==e.type&&"tableRow"==e.name&&t.mapper.toViewElement(e.position.nodeAfter)&&o.add(e.position.nodeAfter);const r=i.getAttribute("headingRows")||0,a=i.getAttribute("headingColumns")||0,l=new Fk(i);for(const e of l){const i=t.mapper.toViewElement(e.cell);if(!i||!i.is("element"))continue;const l=e.rowYv(e,t.mapper)));for(const e of i)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:vv(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:Cv(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&function(e){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[i,o]of Object.entries(t))e.conversion.for("dataDowncast").add((t=>t.on(`attribute:${o}:table`,((t,o,n)=>{const{item:s,attributeNewValue:r}=o,{mapper:a,writer:l}=n,c=e.plugins.has("PlainTableOutput"),d=n.options.isClipboardPipeline,u=Av(e,s);if(!(c||u||d))return;if(!n.consumable.consume(s,t.name))return;const h=a.toViewElement(s);r?l.setStyle(i,r,h):l.removeStyle(i,h)}),{priority:"high"})))}(e)}}function eC(e){return t=>{const i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}class tC extends Au{items;keystrokes;focusTracker;constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new ri,this.focusTracker=new ii,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:i,column:o}=t.target.dataset;this.items.get(10*(parseInt(i,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,i)=>{if(!i)return;const{row:o,column:n}=i.dataset;this.set({rows:parseInt(o),columns:parseInt(n)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),Vu({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((i,o)=>{const n=Math.floor(o/10){const o=e.commands.get("insertTable"),n=Zh(i);let s;return n.bind("isEnabled").to(o),n.buttonView.set({icon:id,label:t("Insert table"),tooltip:!0}),n.on("change:isOpen",(()=>{s||(s=new tC(i),n.panelView.children.add(s),s.delegate("execute").to(n),n.on("execute",(()=>{e.execute("insertTable",{rows:s.rows,columns:s.columns}),e.editing.view.focus()})))})),n})),e.ui.componentFactory.add("menuBar:insertTable",(i=>{const o=e.commands.get("insertTable"),n=new ig(i),s=new tC(i);return s.delegate("execute").to(n),n.on("change:isOpen",((e,t,i)=>{i||s.reset()})),s.on("execute",(()=>{e.execute("insertTable",{rows:s.rows,columns:s.columns}),e.editing.view.focus()})),n.buttonView.set({label:t("Table"),icon:id}),n.panelView.children.add(s),n.bind("isEnabled").to(o),n})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},o&&{type:"switchbutton",model:{commandName:"setTableFooterRow",label:t("Footer row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}].filter(Boolean);return this._prepareDropdown(t("Row"),'',i,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',o,e)}))}_prepareDropdown(e,t,i,o){const n=this.editor,s=Zh(o),r=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(r,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(s,"execute",(e=>{n.execute(e.source.commandName),e.source instanceof fh||n.editing.view.focus()})),s}_prepareMergeSplitButtonDropdown(e,t,i,o){const n=this.editor,s=Zh(o,Jh),r="mergeTableCells",a=n.commands.get(r),l=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([a,...l],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(s.buttonView,"execute",(()=>{n.execute(r),n.editing.view.focus()})),this.listenTo(s,"execute",(e=>{n.execute(e.source.commandName),n.editing.view.focus()})),s}_fillDropdownWithListOptions(e,t){const i=this.editor,o=[],n=new ei;for(const e of t)oC(e,i,o,n);return Xh(e,n),o}}function oC(e,t,i,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new Jm(e.model),{commandName:n,bindIsOn:s}=e.model,r=t.commands.get(n);i.push(r),o.set({commandName:n}),o.bind("isEnabled").to(r),s&&o.bind("isOn").to(r,"value"),o.set({withText:!0})}o.add(e)}class nC extends fc{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[av,av]}init(){const e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(i.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(av),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return 0==i.length?null:i}getSelectionAsFragment(){const e=this.editor.plugins.get(av),t=this.getSelectedTableCells();return t?this.editor.model.change((i=>{const o=i.createDocumentFragment(),{first:n,last:s}=e.getColumnIndexes(t),{first:r,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table");let c=a,d=s;if(e.isSelectionRectangular(t)){const e={firstColumn:n,lastColumn:s,firstRow:r,lastRow:a};c=ev(l,e),d=tv(l,e)}const u=Wk(l,{startRow:r,startColumn:n,endRow:c,endColumn:d},i);return i.insert(u,o,0),o})):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(i.cells.map((t=>e.createRangeOn(t))),{backward:i.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=ti(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,i,o)=>{const n=o.writer;!function(e){for(const i of t)e.removeClass("ck-editor__editable_selected",i);t.clear()}(n);const s=this.getSelectedTableCells();if(!s)return;for(const e of s){const i=o.mapper.toViewElement(e);n.addClass("ck-editor__editable_selected",i),t.add(i)}const r=o.mapper.toViewElement(s[s.length-1]);n.setSelection(r,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((i=>{const o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)}))}}))}_handleDeleteContent(e,t){const i=this.editor.plugins.get(av),o=t[0],n=t[1],s=this.editor.model,r=!n||"backward"==n.direction,a=i.getSelectedTableCells(o);a.length&&(e.stop(),s.change((e=>{const t=a[r?a.length-1:0];s.change((e=>{for(const t of a)s.deleteContent(e.createSelection(t,"in"))}));const i=s.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(i):o.setTo(i)})))}_handleInsertTextEvent(e,t){const i=this.editor,o=this.getSelectedTableCells();if(!o)return;const n=i.editing.view,s=i.editing.mapper,r=o.map((e=>n.createRangeOn(s.toViewElement(e))));t.selection=n.createSelection(r),t.preventDefault()}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),s=Math.min(o.row,n.row),r=Math.max(o.row,n.row),a=Math.min(o.column,n.column),l=parseInt(t.getAttribute("colspan")||"1")-1,c=Math.max(o.column,n.column+l),d=new Array(r-s+1).fill(null).map((()=>[])),u={startRow:s,endRow:r,startColumn:a,endColumn:c};for(const{row:t,cell:i}of new Fk(e.findAncestor("table"),u))d[t-s].push(i);const h=n.rowe.reverse())),{cells:d.flat(),backward:h||m}}}class sC extends fc{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ff,bf,nC,av]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e,"cut",((e,t)=>this._onCopyCut(e,t))),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){const{editor:e}=this,t=e.plugins.get(bf),i=e.plugins.get(nC);let o=!1;t.on("contentInsertion",((e,t)=>{o="paste"===t.method})),this.listenTo(e.model,"insertContent",((e,[t,n])=>{(o||null!==i.getSelectedTableCells())&&this._onInsertContent(e,t,n)}),{priority:"high"}),t.on("contentInsertion",(()=>{o=!1}),{priority:"lowest"})}_onCopyCut(e,t){const i=this.editor.editing.view,o=this.editor.plugins.get(nC),n=this.editor.plugins.get(ff);o.getSelectedTableCells()&&("cut"!=e.name||this.editor.model.canEditAt(this.editor.model.document.selection))&&(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:"cut"===e.name},(()=>{const s=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,(()=>o.getSelectionAsFragment()));i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(s),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;const o=this.editor.model,n=this.editor.plugins.get(av),s=this.editor.plugins.get(ff),r=this.getTableIfOnlyTableInContent(t,o);if(!r)return;const a=n.getSelectionAffectedTableCells(o.document.selection);a.length?(e.stop(),t.is("documentFragment")?s._pasteMarkersIntoTransformedElement(t.markers,(e=>this._replaceSelectedCells(r,a,e))):this.editor.model.change((e=>{this._replaceSelectedCells(r,a,e)}))):Xk(r,n)}_replaceSelectedCells(e,t,i){const o=this.editor.plugins.get(av),n={width:o.getColumns(e),height:o.getRows(e)},s=function(e,t,i,o){const n=e[0].findAncestor("table"),s=o.getColumnIndexes(e),r=o.getRowIndexes(e),a={firstColumn:s.first,lastColumn:s.last,firstRow:r.first,lastRow:r.last},l=1===e.length;l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,o){const n=o.getColumns(e),s=o.getRows(e);i>n&&o.insertColumns(e,{at:n,columns:i-n});t>s&&o.insertRows(e,{at:s,rows:t-s})}(n,a.lastRow+1,a.lastColumn+1,o));l||!o.isSelectionRectangular(e)?function(e,t,i){const{firstRow:o,lastRow:n,firstColumn:s,lastColumn:r}=t,a={first:o,last:n},l={first:s,last:r};aC(e,s,a,i),aC(e,r+1,a,i),rC(e,o,l,i),rC(e,n+1,l,i,o)}(n,a,i):(a.lastRow=ev(n,a),a.lastColumn=tv(n,a));return a}(t,n,i,o),r=s.lastRow-s.firstRow+1,a=s.lastColumn-s.firstColumn+1;e=Wk(e,{startRow:0,startColumn:0,endRow:Math.min(r,n.height)-1,endColumn:Math.min(a,n.width)-1},i);const l=t[0].findAncestor("table"),c=this._replaceSelectedCellsWithPasted(e,n,l,s,i,o);if(this.editor.plugins.get("TableSelection").isEnabled){const e=o.sortRanges(c.map((e=>i.createRangeOn(e))));i.setSelection(e)}else i.setSelection(c[0],0);return l}_replaceSelectedCellsWithPasted(e,t,i,o,n,s){const{width:r,height:a}=t,l=function(e,t,i){const o=new Array(i).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:i,cell:n}of new Fk(e))o[i][t]=n;return o}(e,r,a),c=[...new Fk(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],d=[];let u;for(const e of c){const{row:t,column:i}=e;i===o.firstColumn&&(u=e.getPositionBefore());const s=t-o.firstRow,c=i-o.firstColumn,h=l[s%a][c%r],m=h?n.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,u,n);g&&(Zk(g,t,i,o.lastRow,o.lastColumn,n),d.push(g),u=n.createPositionAfter(g))}const h=parseInt(i.getAttribute("headingRows")||"0"),m=parseInt(i.getAttribute("headingColumns")||"0"),g=parseInt(i.getAttribute("footerRows")||"0"),p=s.getRows(i)-g,f=o.firstRowlC(e,t,i))).map((({cell:e})=>Kk(e,t,o)))}function aC(e,t,i,o){if(t<1)return;return Gk(e,t).filter((({row:e,cellHeight:t})=>lC(e,t,i))).map((({cell:e,column:i})=>Jk(e,i,t,o)))}function lC(e,t,i){const o=e+t-1,{first:n,last:s}=i;return e>=n&&e<=s||e=n}class cC extends fc{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[nC,av]}init(){const e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(t,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(t,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){const i=this.editor.model.document.selection.getSelectedElement();i&&i.is("element","table")&&t.stopPropagation()}_handleTab(e,t){const i=this.editor,o=this.editor.plugins.get(av),n=this.editor.plugins.get("TableSelection"),s=i.model.document.selection,r=!t.shiftKey;let a=o.getTableCellsContainingSelection(s)[0];if(a||(a=n.getFocusCell()),!a)return;t.stopPropagation();const l=a.parent,c=l.parent,d=c.getChildIndex(l),u=l.getChildIndex(a)===l.childCount-1,h=d===o.getRows(c)-1;r&&h&&u&&i.execute("insertTableRowBelow")}_onArrowKey(e,t){const i=this.editor,o=Kt(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const i=this.editor.plugins.get(av),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,s=n.document.selection,r=["right","down"].includes(e),a=i.getSelectedTableCells(s);if(a.length){let i;return i=t?o.getFocusCell():r?a[a.length-1]:a[0],this._navigateFromCellInDirection(i,e,t),!0}const l=s.focus.findAncestor("tableCell");if(!l)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==r&&!s.containsEntireContent(l))return!1}else{const e=s.getSelectedElement();if(!e||!n.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(s,l,r)&&(this._navigateFromCellInDirection(l,e,t),!0)}_isSelectionAtCellEdge(e,t,i){const o=this.editor.model,n=this.editor.model.schema,s=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(s).is("element","tableCell")){return o.createPositionAt(t,i?"end":0).isTouching(s)}const r=o.createSelection(s);return o.modifySelection(r,{direction:i?"forward":"backward"}),s.isEqual(r.focus)}_navigateFromCellInDirection(e,t,i=!1){const o=this.editor.model,n=e.findAncestor("table"),s=[...new Fk(n,{includeAllSlots:!0})],{row:r,column:a}=s[s.length-1],l=s.find((({cell:t})=>t==e));let{row:c,column:d}=l;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>r||d<0&&c<=0||d>a&&c>=r)return void o.change((e=>{e.setSelection(e.createRangeOn(n))}));d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const u=s.find((e=>e.row==c&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}class dC extends jn{domEventType=["mousemove","mouseleave"];onDomEvent(e){this.fire(e.type,e)}}class uC extends fc{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[nC,av]}init(){this.editor.editing.view.addObserver(dC),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(av);let i=!1;const o=e.plugins.get(nC);this.listenTo(e.editing.view.document,"mousedown",((n,s)=>{const r=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!s.domEvent.shiftKey)return;const a=o.getAnchorCell()||t.getTableCellsContainingSelection(r)[0];if(!a)return;const l=this._getModelTableCellFromDomEvent(s);l&&hC(a,l)&&(i=!0,o.setCellSelection(a,l),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{i=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,i,o=!1,n=!1;const s=e.plugins.get(nC);this.listenTo(e.editing.view.document,"mousedown",((e,i)=>{this.isEnabled&&s.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(i)))})),this.listenTo(e.editing.view.document,"mousemove",((e,r)=>{if(!r.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(r);a&&hC(t,a)&&(i=a,o||i==t||(o=!0)),o&&(n=!0,s.setCellSelection(t,i),r.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,n=!1,t=null,i=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function hC(e,t){return e.parent.parent==t.parent.parent}class mC extends fc{static get requires(){return[Xv,iC,nC,uC,cC,sC,vp]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}}function gC(e){const t=pC(e);return t||fC(e)}function pC(e){const t=e.getSelectedElement();return t&&bC(t)?t:null}function fC(e){const t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&bC(i))return i;i=i.parent}return null}function bC(e){return e.is("element")&&!!e.getCustomProperty("table")&&op(e)}class wC extends Au{options;focusTracker;focusCycler;_focusables;dropdownView;inputView;keystrokes;_stillTyping;constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new ii,this._focusables=new tu,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new ri,this._stillTyping=!1,this.focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",((e,t,i)=>this._setInputValue(i)))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach((e=>{this.focusTracker.add(e.element),this._focusables.add(e)})),this.keystrokes.listenTo(this.element)}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){const e=this.locale,t=e.t,i=this.bindTemplate,o=this._createColorSelector(e),n=Zh(e),s=new Au;return s.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",(e=>""!=e))]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(s),n.buttonView.label=t("Color picker"),n.buttonView.tooltip=!0,n.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",(e=>!e)),n.on("change:isOpen",((e,t,i)=>{i&&(o.updateSelectedColors(),o.showColorGridsFragment())})),n}_createInputTextView(){const e=this.locale,t=new Oh(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",(()=>{const e=t.element.value,i=this.options.colorDefinitions.find((t=>e===t.label));this._stillTyping=!0,this.value=i&&i.color||e})),t.on("blur",(()=>{this._stillTyping=!1,this._setInputValue(t.element.value)})),t.delegate("input").to(this),t}_createColorSelector(e){const t=e.t,i=this.options.defaultColorValue||"",o=t(i?"Restore default":"Remove color"),n=new fm(e,{colors:this.options.colorDefinitions,columns:this.options.columns,removeButtonLabel:o,colorPickerLabel:t("Color picker"),colorPickerViewConfig:!1!==this.options.colorPickerConfig&&{...this.options.colorPickerConfig,hideInput:!0}});n.appendUI(),n.on("execute",((e,t)=>{"colorPickerSaveButton"!==t.source?(this.value=t.value||i,this.fire("input"),"colorPicker"!==t.source&&(this.dropdownView.isOpen=!1)):this.dropdownView.isOpen=!1}));let s=this.value;return n.on("colorPicker:cancel",(()=>{this.value=s,this.fire("input"),this.dropdownView.isOpen=!1})),n.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{s=this.value})),n.bind("selectedColor").to(this,"value"),n}_setInputValue(e){if(!this._stillTyping){const t=yC(e),i=this.options.colorDefinitions.find((e=>t===yC(e.color)));this.inputView.value=i?i.label:e||""}}}function yC(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}const _C=e=>""===e;function kC(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function vC(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}function CC(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}function AC(e){return e=e.trim().toLowerCase(),_C(e)||gl(e)}function xC(e){return e=e.trim(),_C(e)||RC(e)||wl(e)||_l(e)}function EC(e){return e=e.trim(),_C(e)||RC(e)||wl(e)}function TC(e,t){const i=new ei,o=kC(e.t);for(const n in o){const s={type:"button",model:new Jm({_borderStyleValue:n,label:o[n],role:"menuitemradio",withText:!0})};"none"===n?s.model.bind("isOn").to(e,"borderStyle",(e=>"none"===t?!e:e===n)):s.model.bind("isOn").to(e,"borderStyle",(e=>e===n)),i.add(s)}return i}function PC(e){const{view:t,icons:i,toolbar:o,labels:n,propertyName:s,nameToValue:r,defaultValue:a}=e;for(const e in n){const l=new Lu(t.locale);l.set({role:"radio",isToggleable:!0,label:n[e],icon:i[e],tooltip:n[e]});const c=r?r(e):e;l.bind("isOn").to(t,s,(e=>{let t=e;return""===e&&a&&(t=a),c===t})),l.on("execute",(()=>{!a&&c&&t[s]===c?t[s]=void 0:t[s]=c})),o.items.add(l)}}const SC=[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}];function IC(e){return(t,i,o)=>{const n=new wC(t.locale,{colorDefinitions:(s=e.colorConfig,s.map((e=>({color:e.model,label:e.label,options:{hasBorder:e.hasBorder}})))),columns:e.columns,defaultColorValue:e.defaultColorValue,colorPickerConfig:e.colorPickerConfig});var s;return n.inputView.set({id:i,ariaDescribedById:o}),n.bind("isReadOnly").to(t,"isEnabled",(e=>!e)),n.bind("hasError").to(t,"errorText",(e=>!!e)),n.on("input",(()=>{t.errorText=null})),t.bind("isEmpty","isFocused").to(n),n}}function RC(e){const t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}class OC extends Au{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;cellTypeDropdown;paddingInput;widthInput;heightInput;horizontalAlignmentToolbar;verticalAlignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",padding:"",backgroundColor:"",width:"",height:"",horizontalAlignment:"",verticalAlignment:"",cellType:""}),this.options=t;const{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{cellTypeRowLabel:l,cellTypeDropdown:c}=this._createCellTypeField(),{widthInput:d,operatorLabel:u,heightInput:h,dimensionsLabel:m}=this._createDimensionFields(),{horizontalAlignmentToolbar:g,verticalAlignmentToolbar:p,alignmentLabel:f}=this._createAlignmentFields();this.focusTracker=new ii,this.keystrokes=new ri,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.cellTypeDropdown=c,this.paddingInput=this._createPaddingField(),this.widthInput=d,this.heightInput=h,this.horizontalAlignmentToolbar=g,this.verticalAlignmentToolbar=p;const{saveButtonView:b,cancelButtonView:w}=this._createActionButtons();this.saveButtonView=b,this.cancelButtonView=w,this.backButtonView=this._createBackButton(),this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const y=new ju(e,{label:this.t("Cell properties")});y.children.add(this.backButtonView,0),this.children.add(y),this.children.add(new Km(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new Km(e,{children:[new Km(e,{labelView:l,children:[l,c],class:"ck-table-form__cell-type-row"}),new Km(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new Km(e,{children:[new Km(e,{labelView:m,children:[m,d,u,h],class:"ck-table-form__dimensions-row"}),new Km(e,{children:[this.paddingInput],class:"ck-table-cell-properties-form__padding-row"})]})),this.children.add(new Km(e,{labelView:f,children:[f,g,p],class:"ck-table-cell-properties-form__alignment-row"})),this.children.add(new Km(e,{children:[this.cancelButtonView,this.saveButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-cell-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this}),[this.borderColorInput,this.backgroundInput].forEach((e=>{this._focusCycler.chain(e.fieldView.focusCycler)})),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.cellTypeDropdown,this.backgroundInput,this.widthInput,this.heightInput,this.paddingInput,this.horizontalAlignmentToolbar,this.verticalAlignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){const e=this.options.defaultTableCellProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=IC({colorConfig:this.options.borderColors,columns:5,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new Du(o);r.text=n("Border");const a=kC(n),l=new Sh(o,rm);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",(e=>a[e||"none"])),l.fieldView.on("execute",(e=>{this.borderStyle=e.source._borderStyleValue})),l.bind("isEmpty").to(this,"borderStyle",(e=>!e)),Xh(l.fieldView,TC(this,t.style),{role:"menu",ariaLabel:s});const c=new Sh(o,nm);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",VC),c.fieldView.on("input",(()=>{this.borderWidth=c.fieldView.element.value}));const d=new Sh(o,i);return d.set({label:n("Color"),class:"ck-table-form__border-color"}),d.fieldView.bind("value").to(this,"borderColor"),d.bind("isEnabled").to(this,"borderStyle",VC),d.fieldView.on("input",(()=>{this.borderColor=d.fieldView.value})),this.on("change:borderStyle",((e,i,o,n)=>{VC(o)||(this.borderColor="",this.borderWidth=""),VC(n)||(this.borderColor=t.color,this.borderWidth=t.width)})),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:d,borderWidthInput:c}}_createBackgroundFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Background");const o=IC({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableCellProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new Sh(e,o);return n.set({label:t("Color"),class:"ck-table-cell-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",(()=>{this.backgroundColor=n.fieldView.value})),{backgroundRowLabel:i,backgroundInput:n}}_createCellTypeField(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Cell type");const o=this._cellTypeLabels,n=new Sh(e,rm);return n.set({label:t("Cell type"),class:"ck-table-cell-properties-form__cell-type"}),n.fieldView.buttonView.set({ariaLabel:t("Cell type"),ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:t("Cell type")}),n.fieldView.buttonView.bind("label").to(this,"cellType",(e=>o[e||"data"])),n.fieldView.on("execute",(e=>{this.cellType=e.source._cellTypeValue})),n.bind("isEmpty").to(this,"cellType",(e=>!e)),Xh(n.fieldView,this._getCellTypeDefinitions(),{role:"menu",ariaLabel:t("Cell type")}),{cellTypeRowLabel:i,cellTypeDropdown:n}}_createDimensionFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Dimensions");const o=new Sh(e,nm);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",(()=>{this.width=o.fieldView.element.value}));const n=new Au(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const s=new Sh(e,nm);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",(()=>{this.height=s.fieldView.element.value})),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createPaddingField(){const e=this.locale,t=this.t,i=new Sh(e,nm);return i.set({label:t("Padding"),class:"ck-table-cell-properties-form__padding"}),i.fieldView.bind("value").to(this,"padding"),i.fieldView.on("input",(()=>{this.padding=i.fieldView.element.value})),i}_createAlignmentFields(){const e=this.locale,t=this.t,i=new Du(e),o={left:jc,center:'',right:'',justify:'',top:'',middle:'',bottom:''};i.text=t("Table cell text alignment");const n=new Wh(e),s="rtl"===e.contentLanguageDirection;n.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Horizontal text alignment toolbar"),class:"ck-table-cell-properties-form__horizontal-alignment-toolbar"}),PC({view:this,icons:o,toolbar:n,labels:this._horizontalAlignmentLabels,propertyName:"horizontalAlignment",nameToValue:e=>{if(s){if("left"===e)return"right";if("right"===e)return"left"}return e},defaultValue:this.options.defaultTableCellProperties.horizontalAlignment});const r=new Wh(e);return r.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Vertical text alignment toolbar"),class:"ck-table-cell-properties-form__vertical-alignment-toolbar"}),PC({view:this,icons:o,toolbar:r,labels:this._verticalAlignmentLabels,propertyName:"verticalAlignment",defaultValue:this.options.defaultTableCellProperties.verticalAlignment}),{horizontalAlignmentToolbar:n,verticalAlignmentToolbar:r,alignmentLabel:i}}_createActionButtons(){const e=this.locale,t=this.t,i=new Lu(e),o=new Lu(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.paddingInput];return i.set({label:t("Save"),class:"ck-button-action",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",((...e)=>e.every((e=>!e)))),o.set({label:t("Cancel"),withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_getCellTypeDefinitions(){const e=new ei,t=this._cellTypeLabels,i=["data","header"];this.options.showScopedHeaderOptions&&i.push("header-column","header-row");for(const o of i){const i={type:"button",model:new Jm({_cellTypeValue:o,label:t[o],role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(this,"cellType",(e=>e===o)),e.add(i)}return e}get _horizontalAlignmentLabels(){const e=this.locale,t=this.t,i=t("Align cell text to the left"),o=t("Align cell text to the center"),n=t("Align cell text to the right"),s=t("Justify cell text");return"rtl"===e.uiLanguageDirection?{right:n,center:o,left:i,justify:s}:{left:i,center:o,right:n,justify:s}}get _verticalAlignmentLabels(){const e=this.t;return{top:e("Align cell text to the top"),middle:e("Align cell text to the middle"),bottom:e("Align cell text to the bottom")}}get _cellTypeLabels(){const e=this.t;return{data:e("Data cell"),header:e("Header cell"),"header-column":e("Column header"),"header-row":e("Row header")}}}function VC(e){return"none"!==e}const DC=(()=>[dh.defaultPositions.northArrowSouth,dh.defaultPositions.northArrowSouthWest,dh.defaultPositions.northArrowSouthEast,dh.defaultPositions.southArrowNorth,dh.defaultPositions.southArrowNorthWest,dh.defaultPositions.southArrowNorthEast,dh.defaultPositions.viewportStickyNorth])();function FC(e,t){const i=e.plugins.get("ContextualBalloon"),o=e.editing.view.document.selection;let n;"cell"===t?fC(o)&&(n=NC(e)):gC(o)&&(n=MC(e)),n&&i.updatePosition(n)}function MC(e){const t=$k(e.model.document.selection),i=e.editing.mapper.toViewElement(t);return{target:e.editing.view.domConverter.mapViewToDom(i),positions:DC}}function NC(e){const t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(o.rangeCount>1)return{target:()=>function(e,t){const i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map((e=>{const t=BC(e.start),n=i.toViewElement(t);return new ut(o.mapViewToDom(n))}));return ut.getBoundingRect(n)}(o.getRanges(),e),positions:DC};const n=BC(o.getFirstPosition()),s=t.toViewElement(n);return{target:i.mapViewToDom(s),positions:DC}}function BC(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}const LC={borderStyle:"tableCellBorderStyle",borderColor:"tableCellBorderColor",borderWidth:"tableCellBorderWidth",height:"tableCellHeight",width:"tableCellWidth",padding:"tableCellPadding",backgroundColor:"tableCellBackgroundColor",horizontalAlignment:"tableCellHorizontalAlignment",verticalAlignment:"tableCellVerticalAlignment",cellType:"tableCellType"};class zC extends fc{_defaultContentTableCellProperties;_defaultLayoutTableCellProperties;_balloon;view;_viewWithContentTableDefaults;_viewWithLayoutTableDefaults;_undoStepBatch;_isReady;static get requires(){return[Qm]}static get pluginName(){return"TableCellPropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableCellProperties",{borderColors:SC,backgroundColors:SC})}init(){const e=this.editor,t=e.t;this._defaultContentTableCellProperties=bv(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection}),this._defaultLayoutTableCellProperties=pv(void 0,{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection}),this._balloon=e.plugins.get(Qm),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellProperties",(i=>{const o=new Lu(i);o.set({label:t("Cell properties"),icon:'',tooltip:!0}),this.listenTo(o,"execute",(()=>this._showView()));const n=Object.values(LC).map((t=>e.commands.get(t))).filter((e=>!!e));return o.bind("isEnabled").toMany(n,"isEnabled",((...e)=>e.some((e=>e)))),o}))}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){const t=this.editor,i=t.config.get("table.tableCellProperties"),o=!!t.config.get("table.tableCellProperties.scopedHeaders"),n=Ch(i.borderColors),s=vh(t.locale,n),r=Ch(i.backgroundColors),a=vh(t.locale,r),l=!1!==i.colorPicker,c=new OC(t.locale,{borderColors:s,backgroundColors:a,defaultTableCellProperties:e,colorPickerConfig:!!l&&(i.colorPicker||{}),showScopedHeaderOptions:o}),d=t.t;c.render(),this.listenTo(c,"submit",(()=>{this._hideView()})),this.listenTo(c,"cancel",(()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()})),c.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),Su({emitter:c,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});const u=vC(d),h=CC(d);c.on("change:borderStyle",this._getPropertyChangeCallback("tableCellBorderStyle")),c.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:c.borderColorInput,commandName:"tableCellBorderColor",errorText:u,validator:AC})),c.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:c.borderWidthInput,commandName:"tableCellBorderWidth",errorText:h,validator:EC})),c.on("change:padding",this._getValidatedPropertyChangeCallback({viewField:c.paddingInput,commandName:"tableCellPadding",errorText:h,validator:xC})),c.on("change:width",this._getValidatedPropertyChangeCallback({viewField:c.widthInput,commandName:"tableCellWidth",errorText:h,validator:xC})),c.on("change:height",this._getValidatedPropertyChangeCallback({viewField:c.heightInput,commandName:"tableCellHeight",errorText:h,validator:xC})),c.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:c.backgroundInput,commandName:"tableCellBackgroundColor",errorText:u,validator:AC})),c.on("change:horizontalAlignment",this._getPropertyChangeCallback("tableCellHorizontalAlignment")),c.on("change:verticalAlignment",this._getPropertyChangeCallback("tableCellVerticalAlignment"));const m=t.commands.get("tableCellType");return m&&(c.cellTypeDropdown.bind("isEnabled").to(m,"isEnabled"),c.on("change:cellType",this._getPropertyChangeCallback("tableCellType"))),c}_fillViewFormFromCommandValues(){const e=this.editor.commands,t=e.get("tableCellBorderStyle");Object.entries(LC).flatMap((([t,i])=>{const o=e.get(i);if(!o)return[];const n=t;let s;s="cellType"===n?"":this.view===this._viewWithContentTableDefaults?this._defaultContentTableCellProperties[n]||"":this._defaultLayoutTableCellProperties[n]||"";return[[t,o.value||s]]})).forEach((([e,i])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==t.value)&&this.view.set(e,i)})),this._isReady=!0}_showView(){const e=this.editor,t=gC(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||"layout"!==i.getAttribute("tableType");o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableCellProperties):o||this._viewWithLayoutTableDefaults||(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableCellProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",(()=>{this._updateView()})),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:NC(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;fC(e.editing.view.document.selection)?this._isViewVisible&&FC(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:t,viewField:i,validator:o,errorText:n}=e,s=Li((()=>{i.errorText=n}),500);return(e,n,r)=>{s.cancel(),this._isReady&&(o(r)?(this.editor.execute(t,{value:r,batch:this._undoStepBatch}),i.errorText=null):s())}}}class jC extends wc{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){switch(super(e),this.attributeName=t,this._defaultContentTableValue=i,t){case"tableCellType":this._defaultLayoutTableValue="data";break;case"tableCellBorderStyle":this._defaultLayoutTableValue="none";break;case"tableCellHorizontalAlignment":this._defaultLayoutTableValue="left";break;case"tableCellVerticalAlignment":this._defaultLayoutTableValue="middle";break;default:this._defaultLayoutTableValue=void 0}}refresh(){const e=this.editor.model.document.selection,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e),i=$k(e);this._defaultValue=i&&"layout"===i.getAttribute("tableType")?this._defaultLayoutTableValue:this._defaultContentTableValue,this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){const{value:t,batch:i}=e,o=this.editor.model,n=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(i,(e=>{s?n.forEach((t=>e.setAttribute(this.attributeName,s,t))):n.forEach((t=>e.removeAttribute(this.attributeName,t))),this.fire("afterExecute",{writer:e,tableCells:n,valueToSet:s})}))}_getAttribute(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){const t=this._getAttribute(e[0]);return e.every((e=>this._getAttribute(e)===t))?t:void 0}}class $C extends jC{constructor(e,t){super(e,"tableCellWidth",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class qC extends fc{static get pluginName(){return"TableCellWidthEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xv]}init(){const e=this.editor,t=bv(e.config.get("table.tableCellProperties.defaultProperties"));jk(e.model.schema,e.conversion,{modelAttribute:"tableCellWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:t.width}),e.commands.add("tableCellWidth",new $C(e,t.width))}}class HC extends jC{constructor(e,t){super(e,"tableCellPadding",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class WC extends jC{constructor(e,t){super(e,"tableCellHeight",t)}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class UC extends jC{constructor(e,t){super(e,"tableCellBackgroundColor",t)}}class KC extends jC{constructor(e,t){super(e,"tableCellVerticalAlignment",t)}}class GC extends jC{constructor(e,t){super(e,"tableCellHorizontalAlignment",t)}}class JC extends jC{constructor(e,t){super(e,"tableCellBorderStyle",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class ZC extends jC{constructor(e,t){super(e,"tableCellBorderColor",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class QC extends jC{constructor(e,t){super(e,"tableCellBorderWidth",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class YC extends jC{constructor(e){super(e,"tableCellType","data"),this.on("afterExecute",((e,t)=>{const{writer:i,tableCells:o}=t,n=this.editor.plugins.get(av),s=function(e){const t=new Map;for(const i of e){const e=i.findAncestor("table");t.has(e)||t.set(e,[]),t.get(e).push(i)}return t}(o);XC(n,i,s.keys())}))}refresh(){super.refresh();const e=$k(this.editor.model.document.selection);this.isEnabled&&e&&"layout"===e.getAttribute("tableType")&&(this.isEnabled=!1)}_getAttribute(e){return e?.getAttribute(this.attributeName)||"data"}}function XC(e,t,i){let o=!1;for(const n of i){let i=n.getAttribute("headingRows")||0,s=n.getAttribute("headingColumns")||0;const r=n.getAttribute("footerRows")||0,a=e.getRows(n)-r,l=s>i;if(l){const r=eA(e,n,"column",s,i);r!==s&&(e.setHeadingColumnsCount(t,n,r,{updateCellType:!1}),s=r,o=!0)}let c=eA(e,n,"row",i,s);if(r>0&&(c=Math.min(c,a)),c!==i&&(e.setHeadingRowsCount(t,n,c,{updateCellType:!1}),i=c,o=!0),!l){const r=eA(e,n,"column",s,i);r!==s&&(e.setHeadingColumnsCount(t,n,r,{updateCellType:!1}),o=!0)}}return o}function eA(e,t,i,o,n){const s="row"===i?e.getRows(t):e.getColumns(t);let r=o;for(let e=0;e=n&&(a=!0)}if(!s)return Math.min(r,e);a&&(r=Math.max(r,e+1))}return Math.min(r,s)}const tA=/^(top|middle|bottom)$/,iA=/^(left|center|right|justify)$/;class oA extends fc{static get pluginName(){return"TableCellPropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Xv,qC]}init(){const e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableCellProperties.defaultProperties",{});const o=bv(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection});e.data.addStyleProcessorRules(Hl),function(e,t){const{conversion:i}=e,{schema:o}=e.model,n={width:"tableCellBorderWidth",color:"tableCellBorderColor",style:"tableCellBorderStyle"};o.extend("tableCell",{allowAttributes:Object.values(n)});for(const e of Object.values(n))o.setAttributeProperties(e,{isFormatting:!0});vk(e,"td",n,t),vk(e,"th",n,t),Ck(i,{modelElement:"tableCell",modelAttribute:n.style,styleName:"border-style"}),Ck(i,{modelElement:"tableCell",modelAttribute:n.color,styleName:"border-color"}),Ck(i,{modelElement:"tableCell",modelAttribute:n.width,styleName:"border-width"})}(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableCellBorderStyle",new JC(e,o.borderStyle)),e.commands.add("tableCellBorderColor",new ZC(e,o.borderColor)),e.commands.add("tableCellBorderWidth",new QC(e,o.borderWidth)),jk(t,i,{modelAttribute:"tableCellHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableCellHeight",new WC(e,o.height)),e.data.addStyleProcessorRules(tc),jk(t,i,{modelAttribute:"tableCellPadding",styleName:"padding",reduceBoxSides:!0,defaultValue:o.padding}),function(e,t){Tk(e,"td",t),Tk(e,"th",t)}(e,o.padding),e.commands.add("tableCellPadding",new HC(e,o.padding)),e.data.addStyleProcessorRules(Bl),jk(t,i,{modelAttribute:"tableCellBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableCellBackgroundColor",new UC(e,o.backgroundColor)),function(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellHorizontalAlignment"]}),e.setAttributeProperties("tableCellHorizontalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellHorizontalAlignment"},view:e=>({key:"style",value:{"text-align":e}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"text-align":iA}},model:{key:"tableCellHorizontalAlignment",value:(e,t,o)=>{const n=xk(i,"left",o),s=e.getStyle("text-align");if(s!==n)return s;t.consumable.consume(e,{styles:"text-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{align:iA}},model:{key:"tableCellHorizontalAlignment",value:(e,t,o)=>{const n=xk(i,"left",o),s=e.getAttribute("align");if(s!==n)return s;t.consumable.consume(e,{attributes:"align"})}}})}(t,i,o.horizontalAlignment),e.commands.add("tableCellHorizontalAlignment",new GC(e,o.horizontalAlignment)),function(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellVerticalAlignment"]}),e.setAttributeProperties("tableCellVerticalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellVerticalAlignment"},view:e=>({key:"style",value:{"vertical-align":e}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"vertical-align":tA}},model:{key:"tableCellVerticalAlignment",value:(e,t,o)=>{const n=xk(i,"middle",o),s=e.getStyle("vertical-align");if(s!==n)return s;t.consumable.consume(e,{styles:"vertical-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{valign:tA}},model:{key:"tableCellVerticalAlignment",value:(e,t,o)=>{const n=xk(i,"middle",o),s=e.getAttribute("valign");if(s!==n)return s;t.consumable.consume(e,{attributes:"valign"})}}})}(t,i,o.verticalAlignment),e.commands.add("tableCellVerticalAlignment",new KC(e,o.verticalAlignment)),function(e){const{model:t,conversion:i,editing:o,config:n}=e,{schema:s}=t;n.define("table.tableCellProperties.scopedHeaders",!0);const r=!!n.get("table.tableCellProperties.scopedHeaders"),a=e.plugins.get(av);s.extend("tableCell",{allowAttributes:["tableCellType"]}),s.setAttributeProperties("tableCellType",{isFormatting:!0}),s.addAttributeCheck((e=>{const t=Array.from(e).reverse().find((e=>"table"===e.name));if("layout"===t?.getAttribute("tableType"))return!1}),"tableCellType"),i.for("upcast").add((e=>{e.on("element:th",((e,t,i)=>{const{writer:o}=i,{modelRange:n}=t,s=n?.start.nodeAfter;s?.is("element","tableCell")&&!s.hasAttribute("tableCellType")&&o.setAttribute("tableCellType","header",s)})),e.on("element:table",((e,t,i)=>{const{writer:o}=i,{modelRange:n}=t,s=n?.start.nodeAfter;if(s?.is("element","table")&&"layout"===s.getAttribute("tableType"))for(const{cell:e}of new Fk(s)){if(Nk(e.getAttribute("tableCellType"))){o.setAttribute("tableType","content",s);break}}}),{priority:ge.low-1})})),r&&(i.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellType"},view:e=>{switch(e){case"header-row":return{key:"scope",value:"row"};case"header-column":return{key:"scope",value:"col"}}}}),i.for("upcast").add((e=>{e.on("element:th",((e,t,i)=>{const{writer:o,consumable:n}=i,{viewItem:s,modelRange:r}=t,a=r.start.nodeAfter,l=a?.getAttribute("tableCellType");if("header"===l&&n.consume(s,{attributes:["scope"]})){switch(s.getAttribute("scope")){case"row":o.setAttribute("tableCellType","header-row",a);break;case"col":o.setAttribute("tableCellType","header-column",a)}}}))})));t.document.registerPostFixer((e=>{const i=t.document.differ.getChanges(),o=new Set;for(const e of i){if("attribute"===e.type&&("headingRows"===e.attributeKey||"headingColumns"===e.attributeKey)){const t=e.range.start.nodeAfter;t?.is("element","table")&&"$graveyard"!==t.root.rootName&&o.add(t)}if("attribute"===e.type&&"tableCellType"===e.attributeKey){const t=e.range.start.nodeAfter;if(t?.is("element","tableCell")&&"$graveyard"!==t.root.rootName){const e=t.findAncestor("table");e&&o.add(e)}}if("insert"===e.type&&e.position.nodeAfter)for(const{item:i}of t.createRangeOn(e.position.nodeAfter))if(i.is("element","tableCell")&&i.getAttribute("tableCellType")&&"$graveyard"!==i.root.rootName){const e=i.findAncestor("table");e&&o.add(e)}}return XC(a,e,o)})),t.document.on("change:data",(()=>{const{differ:e}=t.document,i=new Set;for(const t of e.getChanges())if("attribute"===t.type&&"tableCellType"===t.attributeKey){const e=t.range.start.nodeAfter;e.is("element","tableCell")&&i.add(e)}for(const e of i){const t=o.mapper.toViewElement(e),i=Nk(e.getAttribute("tableCellType"))?"th":"td";t?.name!==i&&o.reconvertItem(e)}}))}(e),e.commands.add("tableCellType",new YC(e))}}class nA extends wc{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){super(e),this.attributeName=t,this._defaultContentTableValue=i,this._defaultLayoutTableValue="tableBorderStyle"===t?"none":void 0}refresh(){const e=$k(this.editor.model.document.selection);this._defaultValue=e&&"layout"===e.getAttribute("tableType")?this._defaultLayoutTableValue:this._defaultContentTableValue,this.isEnabled=!!e,this.value=this._getValue(e)}execute(e={}){const t=this.editor.model,i=t.document.selection,{value:o,batch:n}=e,s=$k(i),r=this._getValueToSet(o);t.enqueueChange(n,(e=>{r?e.setAttribute(this.attributeName,r,s):e.removeAttribute(this.attributeName,s)}))}_getValue(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}}class sA extends nA{constructor(e,t){super(e,"tableBackgroundColor",t)}}class rA extends nA{constructor(e,t){super(e,"tableBorderColor",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class aA extends nA{constructor(e,t){super(e,"tableBorderStyle",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class lA extends nA{constructor(e,t){super(e,"tableBorderWidth",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class cA extends nA{constructor(e,t){super(e,"tableWidth",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class dA extends nA{constructor(e,t){super(e,"tableHeight",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class uA extends nA{constructor(e,t){super(e,"tableAlignment",t)}}class hA extends fc{static get pluginName(){return"TablePropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Xv]}init(){const e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});const o=fv(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),n=!0===e.config.get("table.tableProperties.alignment.useInlineStyles");e.data.addStyleProcessorRules(ec),e.data.addStyleProcessorRules(Hl),function(e,t){const{conversion:i}=e,{schema:o}=e.model,n={width:"tableBorderWidth",color:"tableBorderColor",style:"tableBorderStyle"};o.extend("table",{allowAttributes:Object.values(n)});for(const e of Object.values(n))o.setAttributeProperties(e,{isFormatting:!0});vk(e,"table",n,t),Ak(i,{modelAttribute:n.color,styleName:"border-color"}),Ak(i,{modelAttribute:n.style,styleName:"border-style"}),Ak(i,{modelAttribute:n.width,styleName:"border-width"})}(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableBorderColor",new rA(e,o.borderColor)),e.commands.add("tableBorderStyle",new aA(e,o.borderStyle)),e.commands.add("tableBorderWidth",new lA(e,o.borderWidth)),function(e,t,i,o){e.extend("table",{allowAttributes:["tableAlignment"]}),e.setAttributeProperties("tableAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"table",key:"tableAlignment",values:["left","center","right","blockLeft","blockRight"]},view:{left:o?{key:"style",value:{float:"left","margin-right":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:Pk.className},right:o?{key:"style",value:{float:"right","margin-left":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:Ik.className},center:o?{key:"style",value:{"margin-left":"auto","margin-right":"auto"}}:{key:"class",value:Sk.className},blockLeft:o?{key:"style",value:{"margin-left":"0","margin-right":"auto"}}:{key:"class",value:Rk.className},blockRight:o?{key:"style",value:{"margin-left":"auto","margin-right":"0"}}:{key:"class",value:Ok.className}},converterPriority:"high"}),Vk.forEach((e=>{t.for("upcast").attributeToAttribute({view:e.view,model:{key:"tableAlignment",value:(t,o,n)=>{if(function(e){return"figure"==e.name&&!e.hasClass("table")}(t))return;const s=xk(i,"",n),r=e.getAlign(t),a=e.getConsumables(t);return o.consumable.consume(t,a),r!==s?r:void 0}}})})),t.for("upcast").add(function(e){return t=>{t.on("element:div",((t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,attributes:"align"}))return;const n=iv(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,attributes:"align"});const s=o.convertItem(n,i.modelCursor),r=ti(s.modelRange.getItems());if(!r||!r.is("element","table"))return o.consumable.revert(i.viewItem,{name:!0,attributes:"align"}),void(s.modelRange&&!s.modelRange.isCollapsed&&(i.modelRange=s.modelRange,i.modelCursor=s.modelCursor));const a=function(e,t,i){if(e)switch(e){case"right":return"right"===t?"right":"left"===t?"left":"blockRight";case"center":return"center";case"left":return void 0===t?"blockLeft":"left";default:return i}return}(i.viewItem.getAttribute("align"),n.getAttribute("align"),xk(e,"",i));a&&o.writer.setAttribute("tableAlignment",a,r),o.convertChildren(i.viewItem,o.writer.createPositionAt(r,"end")),o.updateConversionResult(r,i)}))}}(i))}(t,i,o.alignment,n),e.commands.add("tableAlignment",new uA(e,o.alignment)),pA(t,i,{modelAttribute:"tableWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:o.width}),e.commands.add("tableWidth",new cA(e,o.width)),pA(t,i,{modelAttribute:"tableHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableHeight",new dA(e,o.height)),e.data.addStyleProcessorRules(Bl),function(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),kk(t,{viewElement:"table",...i}),Ak(t,i)}(t,i,{modelAttribute:"tableBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableBackgroundColor",new sA(e,o.backgroundColor)),Tk(e,"table");const s=e.editing.view.document;this.listenTo(s,"clipboardOutput",((t,i)=>{e.editing.view.change((e=>{for(const{item:t}of e.createRangeIn(i.content))mA(t,e);i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content))}))}),{priority:"lowest"})}}function mA(e,t){if(!e.is("element","table"))return;const i=e.getAttribute("align"),o=e.getStyle("float"),n=e.getStyle("margin-left"),s=e.getStyle("margin-right");i&&"center"===i||o&&"right"===o&&i&&"right"===i?gA(t,i,e):void 0===o&&"auto"===n&&"0"===s&&gA(t,"right",e)}function gA(e,t,i){const o=e.createPositionBefore(i),n=e.createContainerElement("div",{align:t},i);e.insert(o,n)}function pA(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),kk(t,{viewElement:/^(table|figure)$/,shouldUpcast:e=>!("table"==e.name&&"figure"==e.parent.name||"figure"==e.name&&!e.hasClass("table")),...i}),Ck(t,{modelElement:"table",...i})}class fA extends Au{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;widthInput;heightInput;alignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;const{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:d,dimensionsLabel:u}=this._createDimensionFields(),{alignmentToolbar:h,alignmentLabel:m}=this._createAlignmentFields();this.focusTracker=new ii,this.keystrokes=new ri,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=d,this.alignmentToolbar=h;const{saveButtonView:g,cancelButtonView:p}=this._createActionButtons();this.saveButtonView=g,this.cancelButtonView=p,this.backButtonView=this._createBackButton(),this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const f=new ju(e,{label:this.t("Table properties")});f.children.add(this.backButtonView,0),this.children.add(f),this.children.add(new Km(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new Km(e,{children:[new Km(e,{labelView:u,children:[u,l,c,d],class:"ck-table-form__dimensions-row"}),new Km(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new Km(e,{labelView:m,children:[m,h],class:"ck-table-properties-form__alignment-row"})),this.children.add(new Km(e,{children:[this.cancelButtonView,this.saveButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this}),[this.borderColorInput,this.backgroundInput].forEach((e=>{this._focusCycler.chain(e.fieldView.focusCycler)})),[this.borderStyleDropdown,this.borderWidthInput,this.borderColorInput,this.widthInput,this.heightInput,this.backgroundInput,this.alignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){const e=this.options.defaultTableProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=IC({colorConfig:this.options.borderColors,columns:5,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new Du(o);r.text=n("Border");const a=kC(n),l=new Sh(o,rm);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",(e=>a[e||"none"])),l.fieldView.on("execute",(e=>{this.borderStyle=e.source._borderStyleValue})),l.bind("isEmpty").to(this,"borderStyle",(e=>!e)),Xh(l.fieldView,TC(this,t.style),{role:"menu",ariaLabel:s});const c=new Sh(o,nm);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",bA),c.fieldView.on("input",(()=>{this.borderWidth=c.fieldView.element.value}));const d=new Sh(o,i);return d.set({label:n("Color"),class:"ck-table-form__border-color"}),d.fieldView.bind("value").to(this,"borderColor"),d.bind("isEnabled").to(this,"borderStyle",bA),d.fieldView.on("input",(()=>{this.borderColor=d.fieldView.value})),this.on("change:borderStyle",((e,i,o,n)=>{bA(o)||(this.borderColor="",this.borderWidth=""),bA(n)||(this.borderColor=t.color,this.borderWidth=t.width)})),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:d,borderWidthInput:c}}_createBackgroundFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Background");const o=IC({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new Sh(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",(()=>{this.backgroundColor=n.fieldView.value})),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Dimensions");const o=new Sh(e,nm);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",(()=>{this.width=o.fieldView.element.value}));const n=new Au(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const s=new Sh(e,nm);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",(()=>{this.height=s.fieldView.element.value})),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createAlignmentFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Table Alignment");const o=new Wh(e);return o.set({role:"radiogroup",isCompact:!0,ariaLabel:t("Table alignment toolbar")}),PC({view:this,icons:{left:Jc,center:Gc,right:Zc,blockLeft:Yc,blockRight:Xc},toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){const e=this.locale,t=this.t,i=new Lu(e),o=new Lu(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),class:"ck-button-action",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",((...e)=>e.every((e=>!e)))),o.set({label:t("Cancel"),withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}get _alignmentLabels(){const e=this.locale,t=this.t,i=t("Align table to the left with no text wrapping"),o=t("Align table to the right with no text wrapping"),n=t("Align table to the left with text wrapping"),s=t("Center table with no text wrapping"),r=t("Align table to the right with text wrapping");return"rtl"===e.uiLanguageDirection?{right:r,left:n,blockRight:o,center:s,blockLeft:i}:{blockLeft:i,center:s,blockRight:o,left:n,right:r}}}function bA(e){return"none"!==e}const wA={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"};class yA extends fc{_defaultContentTableProperties;_defaultLayoutTableProperties;_balloon;view=null;_viewWithContentTableDefaults=null;_viewWithLayoutTableDefaults=null;_undoStepBatch;_isReady;static get requires(){return[Qm]}static get pluginName(){return"TablePropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableProperties",{borderColors:SC,backgroundColors:SC})}init(){const e=this.editor;this._defaultContentTableProperties=fv(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._defaultLayoutTableProperties=pv(),this._balloon=e.plugins.get(Qm),e.ui.componentFactory.add("tableProperties",(()=>this._createTablePropertiesButton()))}_createTablePropertiesButton(){const e=this.editor,t=e.t,i=new Lu(e.locale);i.set({label:t("Table properties"),icon:'',tooltip:!0}),this.listenTo(i,"execute",(()=>this._showView()));const o=Object.values(wA).map((t=>e.commands.get(t)));return i.bind("isEnabled").toMany(o,"isEnabled",((...e)=>e.some((e=>e)))),i}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){const t=this.editor,i=t.config.get("table.tableProperties"),o=Ch(i.borderColors),n=vh(t.locale,o),s=Ch(i.backgroundColors),r=vh(t.locale,s),a=!1!==i.colorPicker,l=new fA(t.locale,{borderColors:n,backgroundColors:r,defaultTableProperties:e,colorPickerConfig:!!a&&(i.colorPicker||{})}),c=t.t;l.render(),this.listenTo(l,"submit",(()=>{this._hideView()})),this.listenTo(l,"cancel",(()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()})),l.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),Su({emitter:l,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});const d=vC(c),u=CC(c);return l.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle")),l.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:l.borderColorInput,commandName:"tableBorderColor",errorText:d,validator:AC})),l.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:l.borderWidthInput,commandName:"tableBorderWidth",errorText:u,validator:EC})),l.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:l.backgroundInput,commandName:"tableBackgroundColor",errorText:d,validator:AC})),l.on("change:width",this._getValidatedPropertyChangeCallback({viewField:l.widthInput,commandName:"tableWidth",errorText:u,validator:xC})),l.on("change:height",this._getValidatedPropertyChangeCallback({viewField:l.heightInput,commandName:"tableHeight",errorText:u,validator:xC})),l.on("change:alignment",this._getPropertyChangeCallback("tableAlignment")),l}_fillViewFormFromCommandValues(){const e=this.editor.commands,t=e.get("tableBorderStyle");Object.entries(wA).map((([t,i])=>{const o=t,n=this.view===this._viewWithContentTableDefaults?this._defaultContentTableProperties[o]||"":this._defaultLayoutTableProperties[o]||"";return[o,e.get(i).value||n]})).forEach((([e,i])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==t.value)&&this.view.set(e,i)})),this._isReady=!0}_showView(){const e=this.editor,t=gC(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||"layout"!==i.getAttribute("tableType");o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableProperties):o||this._viewWithLayoutTableDefaults||(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",(()=>{this._updateView()})),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:MC(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;gC(e.editing.view.document.selection)?this._isViewVisible&&FC(e,"table"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:t,viewField:i,validator:o,errorText:n}=e,s=Li((()=>{i.errorText=n}),500);return(e,n,r)=>{s.cancel(),this._isReady&&(o(r)?(this.editor.execute(t,{value:r,batch:this._undoStepBatch}),i.errorText=null):s())}}}function _A(e){const t=parseFloat(e);return e.endsWith("pt")?kA(96*t/72):e.endsWith("pc")?kA(12*t*96/72):e.endsWith("in")?kA(96*t):e.endsWith("cm")?kA(96*t/2.54):e.endsWith("mm")?kA(t/10*96/2.54):e}function kA(e){return Math.round(e)+"px"}function vA(e,t,i){if(!e.childCount)return;const o=new rl(e.document),n=function(e,t){const i=t.createRangeIn(e),o=[],n=new Set;for(const e of i.getItems()){if(!e.is("element")||!e.name.match(/^(p|h\d+|li|div)$/))continue;let t=VA(e);if(void 0===t||0!=parseFloat(t)||Array.from(e.getClassNames()).find((e=>e.startsWith("MsoList")))||(t=void 0),e.hasStyle("mso-list")&&"none"!==e.getStyle("mso-list")||void 0!==t&&n.has(t)){const i=RA(e);o.push({element:e,id:i.id,order:i.order,indent:i.indent,marginLeft:t}),void 0!==t&&n.add(t)}else n.clear()}return o}(e,o);if(!n.length)return;const s={},r=[];let a=AA();for(const e of n)if(void 0!==e.indent){EA(e)||(xA(o,r,a),a=AA(),r.length=0);const n=`${e.id}:${e.indent}`,l=Math.min(e.indent-1,r.length);if(lr.length-1||r[l].listElement.name!=a.type){0==l&&"ol"==a.type&&void 0!==e.id&&s[n]&&(a.startIndex=s[n]);const t=IA(a,o,i);if(0==r.length){const i=e.element.parent,n=i.getChildIndex(e.element)+1;o.insertChild(n,t,i)}else{const e=r[l-1].listItemElements;o.appendChild(t,e[e.length-1])}r[l]={...e,listElement:t,listItemElements:[]},0==l&&void 0!==e.id&&(s[n]=a.startIndex||1)}}const c="li"==e.element.name?e.element:o.createElement("li");CA(o,r,a,e,c,l),o.appendChild(c,r[l].listElement),r[l].listItemElements.push(c),0==l&&void 0!==e.id&&s[n]++,e.element!=c&&o.appendChild(e.element,c),OA(e.element,o),o.removeStyle("text-indent",e.element),o.removeStyle("margin-left",e.element)}else{const t=r.find((t=>t.marginLeft==e.marginLeft));if(t){const i=t.listItemElements;o.appendChild(e.element,i[i.length-1]),o.removeStyle("margin-left",e.element)}else r.length=0}xA(o,r,a)}function CA(e,t,i,o,n,s){if(void 0===o.marginLeft)return void(0==s&&(i.canApplyMarginOnList=!1));const r=parseFloat(o.marginLeft);let a=0;if(t.length>1){const e=t[t.length-2].listItemElements;if(e.length>0){const t=e[e.length-1].getStyle("margin-left");void 0!==t&&(a+=parseFloat(t))}}a+=40*t.length;const l=r-a,c=0!==l?kA(l):void 0;c&&(e.setStyle("margin-left",c,n),0==s&&i.canApplyMarginOnList&&(void 0===i.marginLeft&&(i.marginLeft=c),c!==i.marginLeft&&(i.canApplyMarginOnList=!1),i.topLevelListItemElements.push(n)))}function AA(){return{marginLeft:void 0,canApplyMarginOnList:!0,topLevelListItemElements:[]}}function xA(e,t,i){if(i.canApplyMarginOnList&&i.marginLeft&&i.topLevelListItemElements.length>0){e.setStyle("margin-left",i.marginLeft,t[0].listElement);for(const t of i.topLevelListItemElements)e.removeStyle("margin-left",t)}}function EA(e){const t=e.element.previousSibling;if(!t){const t=e.element.parent;return TA(t)&&(!t.previousSibling||TA(t.previousSibling))}return TA(t)}function TA(e){return e.is("element","ol")||e.is("element","ul")}function PA(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),o=/mso-level-number-format:([^;]{0,100});/gi,n=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),r=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=r.exec(t),c=a&&!l,d=i.exec(t);let u="decimal",h="ol",m=null;if(d&&d[1]){const t=o.exec(d[1]);if(t&&t[1]&&(u=t[1].trim(),h="bullet"!==u&&"image"!==u?"ol":"ul"),"bullet"===u){const t=function(e){if("li"==e.name&&"ul"==e.parent.name&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const i=t._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(e.element);t&&(u=t)}else{const e=n.exec(d[1]);e&&e[1]&&(m=parseInt(e[1]))}c&&(h="ol")}return{type:h,startIndex:m,style:SA(u),isLegalStyleList:c}}function SA(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function IA(e,t,i){const o=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,o),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,o),e.isLegalStyleList&&i&&t.addClass("legal-list",o),o}function RA(e){const t=e.getStyle("mso-list");if(void 0===t)return{};const i=t.match(/(^|\s{1,100})l(\d+)/i),o=t.match(/\s{0,100}lfo(\d+)/i),n=t.match(/\s{0,100}level(\d+)/i);return i&&o&&n?{id:i[2],order:o[1],indent:parseInt(n[1])}:{indent:1}}function OA(e,t){const i=new uo({name:"span",styles:{"mso-list":"Ignore"}}),o=t.createRangeIn(e);for(const e of o)"elementStart"===e.type&&i.match(e.item)&&t.remove(e.item)}function VA(e){const t=e.getStyle("margin-left");return void 0===t||t.endsWith("px")?t:_A(t)}function DA(e,t){if(!e.childCount)return;const i=new rl(e.document),o=function(e,t){const i=t.createRangeIn(e),o=new uo({name:/v:(.+)/}),n=[];for(const e of i){if("elementStart"!=e.type)continue;const t=e.item,i=t.previousSibling,s=i&&i.is("element")?i.name:null,r=["Chart"],a=o.match(t),l=t.getAttribute("o:gfxdata"),c="v:shapetype"===s,d=l&&r.some((e=>t.getAttribute("id").includes(e)));a&&l&&!c&&!d&&n.push(e.item.getAttribute("id"))}return n}(e,i);!function(e,t,i){const o=i.createRangeIn(t),n=new uo({name:"img"}),s=[];for(const t of o)if(t.item.is("element")&&n.match(t.item)){const i=t.item,o=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];o.length&&o.every((t=>e.indexOf(t)>-1))?s.push(i):i.getAttribute("src")||s.push(i)}for(const e of s)i.remove(e)}(o,e,i),function(e,t,i){const o=i.createRangeIn(t),n=[];for(const t of o)if("elementStart"==t.type&&t.item.is("element","v:shape")){const i=t.item.getAttribute("id");if(e.includes(i))continue;s(t.item.parent.getChildren(),i)||n.push(t.item)}for(const e of n){const t={src:r(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const o=i.createElement("img",t);i.insertChild(e.index+1,o,e.parent)}function s(e,t){for(const i of e)if(i.is("element")){if("img"==i.name&&i.getAttribute("v:shapes")==t)return!0;if(s(i.getChildren(),t))return!0}return!1}function r(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(o,e,i),function(e,t){const i=t.createRangeIn(e),o=new uo({name:/v:(.+)/}),n=[];for(const e of i)"elementStart"==e.type&&o.match(e.item)&&n.push(e.item);for(const e of n)t.remove(e)}(e,i);const n=function(e,t){const i=t.createRangeIn(e),o=new uo({name:"img"}),n=[];let s=0;for(const e of i)e.item.is("element")&&o.match(e.item)&&(e.item.getAttribute("src").startsWith("file://")&&n.push({element:e.item,imageIndex:s}),s++);return n}(e,i);n.length&&function(e,t,i){for(let o=0;oString.fromCharCode(parseInt(e,16)))).join(""))}function MA(e,t){for(const i of t.createRangeIn(e).getItems())i.is("element","table")&&("0px"===i.getStyle("width")&&t.removeStyle("width",i),"0"===i.getAttribute("width")&&t.removeAttribute("width",i))}function NA(e,t){const i=[],o=[];for(const{item:n}of e.createRangeIn(t))if(n.is("element")&&n.getStyle("mso-footnote-id")){i.unshift(n);const{nextSibling:e}=n;e?.is("$text")&&e.data.startsWith(" ")&&o.unshift(e)}for(const t of i)e.remove(t);for(const t of o){const i=t.data.substring(1);if(i.length>0){const o=t.parent,n=o.getChildIndex(t),s=e.createText(i);e.remove(t),e.insertChild(n,s,o)}else e.remove(t)}return t}function BA(e,t){const i=e.createElement("sup",{class:"footnote"}),o=e.createElement("a",{id:`ref-${t}`,href:`#${t}`});return e.appendChild(o,i),i}function LA(e,t){const i=e.createElement("li",{id:t,class:"footnote-definition"}),o=e.createElement("a",{href:`#ref-${t}`,class:"footnote-backlink"}),n=e.createElement("div",{class:"footnote-content"});return e.appendChild(e.createText("^"),o),e.appendChild(o,i),e.appendChild(n,i),{listItem:i,content:n}}const zA=//i,jA=/xmlns:o="urn:schemas-microsoft-com/i;class $A{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;constructor(e,t=!1,i=!1){this.document=e,this.hasMultiLevelListPlugin=t,this.hasTablePropertiesPlugin=i}isActive(e){return zA.test(e)||jA.test(e)}execute(e){const t=new rl(this.document),{body:i,stylesString:o}=e._parsedData;!function(e,t){const i=[];for(const o of t.createRangeIn(e)){const e=o.item;e.is("element","a")&&!e.hasAttribute("href")&&(e.hasAttribute("id")||e.hasAttribute("name"))&&i.push(e)}for(const e of i){const i=e.parent.getChildIndex(e)+1,o=e.getChildren();t.insertChild(i,o,e.parent)}}(i,t),vA(i,o,this.hasMultiLevelListPlugin),DA(i,e.dataTransfer.getData("text/rtf")),function(e,t,i=!1){for(const o of t.createRangeIn(e).getItems()){if(!o.is("element","table")&&!o.is("element","td")&&!o.is("element","th"))continue;if(i&&o.is("element","table")){const e=o.parent?.is("element","div")?o.parent:null,i=o.parent?.parent?.is("element","div")?o.parent.parent:null,n=e??i;n&&"center"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","auto",o)):n&&"right"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","0",o)):n||o.getAttribute("align")||(t.setStyle("margin-left","0",o),t.setStyle("margin-right","auto",o))}const e=["left","top","right","bottom"];if(e.every((e=>!o.hasStyle(`border-${e}-style`))))t.setStyle("border-style","none",o);else for(const i of e)o.hasStyle(`border-${i}-style`)||t.setStyle(`border-${i}-style`,"none",o);const n=["width","height",...e.map((e=>`border-${e}-width`)),...e.map((e=>`padding-${e}`))];for(const e of n)o.hasStyle(e)&&t.setStyle(e,_A(o.getStyle(e)),o)}}(i,t,this.hasTablePropertiesPlugin),MA(i,t),function(e,t){const i=new Map,o=new Map;let n=null;for(const{item:s}of t.createRangeIn(e))if(s.is("element"))if("footnote-list"!==s.getStyle("mso-element")){if(s.hasStyle("mso-footnote-id")){const e=s.findAncestor("element",(e=>"footnote"===e.getStyle("mso-element")));if(e){const t=e.getAttribute("id");o.set(t,e)}else{const e=s.getStyle("mso-footnote-id");i.set(e,s)}}}else n=s;if(!i.size||!n)return;const s=function(e){return e.createElement("ol",{class:"footnotes"})}(t);t.replace(n,s);for(const[e,n]of i){const i=o.get(e);if(!i)continue;t.replace(n,BA(t,e));const r=LA(t,e);NA(t,i);for(const e of i.getChildren()){let i=e;e.is("element")&&(i=t.clone(e,!0)),t.appendChild(i,r.content)}t.appendChild(r.listItem,s)}}(i,t),function(e){const t=[],i=new rl(e.document);for(const{item:o}of i.createRangeIn(e))if(o.is("element")){for(const e of o.getClassNames())/\bmso/gi.exec(e)&&i.removeClass(e,o);for(const e of o.getStyleNames())/\bmso/gi.exec(e)&&i.removeStyle(e,o);(o.is("element","w:sdt")||o.is("element","w:sdtpr")&&o.isEmpty||o.is("element","o:p")&&o.isEmpty)&&t.push(o)}for(const e of t){const t=e.parent,o=t.getChildIndex(e);i.insertChild(o,e.getChildren(),t),i.remove(e)}}(i),e.content=i}}function qA(e,t,i,{blockElements:o,inlineObjectElements:n}){let s=i.createPositionAt(e,"forward"==t?"after":"before");return s=s.getLastMatchingPosition((({item:e})=>e.is("element")&&!o.includes(e.name)&&!n.includes(e.name)),{direction:t}),"forward"==t?s.nodeAfter:s.nodeBefore}function HA(e,t){return!!e&&e.is("element")&&t.includes(e.name)}function WA(e){let t=e;for(;t;){if(t.is("element")){const e=t.getStyle?.("white-space");if("pre-wrap"===e)return!0}t=t.parent}return!1}function UA(e,t,i){const{parent:o,data:n}=e,s=n.replaceAll("\t"," ".repeat(i)),r=o.getChildIndex(e);t.remove(e),t.insertChild(r,t.createText(s),o)}const KA=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class GA{document;constructor(e){this.document=e}isActive(e){return KA.test(e)}execute(e){const t=new rl(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}(i,t),function(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","li")){const i=e.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}(i,t),function(e,t){const i=new Ho(t.document.stylesProcessor),o=new Rn(i,{renderingMode:"data"}),n=o.blockElements,s=o.inlineObjectElements,r=[];for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","br")){const i=qA(e,"forward",t,{blockElements:n,inlineObjectElements:s}),o=qA(e,"backward",t,{blockElements:n,inlineObjectElements:s}),a=HA(i,n);(HA(o,n)||a)&&r.push(e)}}for(const e of r)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(i,t),function(e,t,i){const o=new Set;for(const i of t.createRangeIn(e).getItems())i.is("view:$textProxy")&&i.data.includes("\t")&&WA(i.parent)&&o.add(i.textNode);for(const e of o)UA(e,t,i)}(i,t,8),e.content=i}}const JA=/(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length)))}function YA(e,t){const i=new DOMParser,o=function(e){return QA(QA(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(e){const t="",i="",o=e.indexOf(t);if(o<0)return e;const n=e.indexOf(i,o+t.length);return e.substring(0,o+t.length)+(n>=0?e.substring(n):"")}(e=(e=e.replace(//,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(HT.source+"\\s*$"),/^$/,!1]];const UT=[["table",function(e,t,i,o){if(t+2>i)return!1;let n=t+1;if(e.sCount[n]=4)return!1;let s=e.bMarks[n]+e.tShift[n];if(s>=e.eMarks[n])return!1;const r=e.src.charCodeAt(s++);if(124!==r&&45!==r&&58!==r)return!1;if(s>=e.eMarks[n])return!1;const a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a&&!eT(a))return!1;if(45===r&&eT(a))return!1;for(;s=4)return!1;c=BT(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const u=c.length;if(0===u||u!==d.length)return!1;if(o)return!0;const h=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),g=[t,0];e.push("table_open","table",1).map=g,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t=4)break;if(c=BT(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),f+=u-c.length,f>65536)break;if(n===t+2){e.push("tbody_open","tbody",1).map=p=[t+2,0]}e.push("tr_open","tr",1).map=[n,n+1];for(let t=0;t=4))break;o++,n=o}e.line=n;const s=e.push("code_block","code",0);return s.content=e.getLines(t,n,4+e.blkIndent,!1)+"\n",s.map=[t,e.line],!0}],["fence",function(e,t,i,o){let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(n+3>s)return!1;const r=e.src.charCodeAt(n);if(126!==r&&96!==r)return!1;let a=n;n=e.skipChars(n,r);let l=n-a;if(l<3)return!1;const c=e.src.slice(a,n),d=e.src.slice(n,s);if(96===r&&d.indexOf(String.fromCharCode(r))>=0)return!1;if(o)return!0;let u=t,h=!1;for(;(u++,!(u>=i))&&(n=a=e.bMarks[u]+e.tShift[u],s=e.eMarks[u],!(n=4||(n=e.skipChars(n,r),n-a=4)return!1;if(62!==e.src.charCodeAt(n))return!1;if(o)return!0;const a=[],l=[],c=[],d=[],u=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let m,g=!1;for(m=t;m=s)break;if(62===e.src.charCodeAt(n++)&&!t){let t,i,o=e.sCount[m]+1;32===e.src.charCodeAt(n)?(n++,o++,i=!1,t=!0):9===e.src.charCodeAt(n)?(t=!0,(e.bsCount[m]+o)%4==3?(n++,o++,i=!1):i=!0):t=!1;let r=o;for(a.push(e.bMarks[m]),e.bMarks[m]=n;n=s,l.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(t?1:0),c.push(e.sCount[m]),e.sCount[m]=r-o,d.push(e.tShift[m]),e.tShift[m]=n-e.bMarks[m];continue}if(g)break;let o=!1;for(let t=0,n=u.length;t";const b=[t,0];f.map=b,e.md.block.tokenize(e,t,m),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=r,e.parentType=h,b[1]=e.line;for(let i=0;i=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(42!==r&&45!==r&&95!==r)return!1;let a=1;for(;s=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(m=!0),(h=zT(e,l))>=0){if(d=!0,r=e.bMarks[l]+e.tShift[l],u=Number(e.src.slice(r,h-1)),m&&1!==u)return!1}else{if(!((h=LT(e,l))>=0))return!1;d=!1}if(m&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(o)return!0;const g=e.src.charCodeAt(h-1),p=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),1!==u&&(a.attrs=[["start",u]])):a=e.push("bullet_list_open","ul",1);const f=[l,0];a.map=f,a.markup=String.fromCharCode(g);let b=!1;const w=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";l=n?1:o-t,m>4&&(m=1);const p=t+m;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(g);const f=[l,0];a.map=f,d&&(a.info=e.src.slice(r,h-1));const y=e.tight,_=e.tShift[l],k=e.sCount[l],v=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=p,e.tight=!0,e.tShift[l]=u-e.bMarks[l],e.sCount[l]=o,u>=n&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,l,i,!0),e.tight&&!b||(c=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=v,e.tShift[l]=_,e.sCount[l]=k,e.tight=y,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(g),l=e.line,f[1]=l,l>=i)break;if(e.sCount[l]=4)break;let C=!1;for(let t=0,o=w.length;t=4)return!1;if(91!==e.src.charCodeAt(n))return!1;function a(t){const i=e.lineMax;if(t>=i||e.isEmpty(t))return null;let o=!1;if(e.sCount[t]-e.blkIndent>3&&(o=!0),e.sCount[t]<0&&(o=!0),!o){const o=e.md.block.ruler.getRules("reference"),n=e.parentType;e.parentType="reference";let s=!1;for(let n=0,r=o.length;n=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(n))return!1;let r=e.src.slice(n,s),a=0;for(;a=4)return!1;let r=e.src.charCodeAt(n);if(35!==r||n>=s)return!1;let a=1;for(r=e.src.charCodeAt(++n);35===r&&n6||nn&&eT(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const d=e.push("inline","",0);return d.content=e.src.slice(n,s).trim(),d.map=[t,e.line],d.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,i){const o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const n=e.parentType;e.parentType="paragraph";let s,r=0,a=t+1;for(;a3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const i=e.eMarks[a];if(t=i))){r=61===s?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let n=0,s=o.length;n3)continue;if(e.sCount[s]<0)continue;let t=!1;for(let n=0,r=o.length;n=i))&&!(e.sCount[r]=s){e.line=i;break}const t=e.line;let l=!1;for(let s=0;s=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),r=e.line,r0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(n),o},JT.prototype.scanDelims=function(e,t){const i=this.posMax,o=this.src.charCodeAt(e),n=e>0?this.src.charCodeAt(e-1):32;let s=e;for(;s?@[]^_`{|}~-".split("").forEach((function(e){XT[e.charCodeAt(0)]=1}));const tP={tokenize:function(e,t){const i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(126!==o)return!1;const n=e.scanDelims(e.pos,!0);let s=n.length;const r=String.fromCharCode(o);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=r,s--);for(let t=0;t=0;i--){const o=t[i];if(95!==o.marker&&42!==o.marker)continue;if(-1===o.end)continue;const n=t[o.end],s=i>0&&t[i-1].end===o.end+1&&t[i-1].marker===o.marker&&t[i-1].token===o.token-1&&t[o.end+1].token===n.token+1,r=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?r+r:r,a.content="";const l=e.tokens[n.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?r+r:r,l.content="",s&&(e.tokens[t[i-1].token].content="",e.tokens[t[o.end+1].token].content="",i--)}}const oP={tokenize:function(e,t){const i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;const n=e.scanDelims(e.pos,42===o);for(let t=0;t\x00-\x20]*)$/;const rP=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,aP=/^&([a-z][a-z0-9]{1,31});/i;function lP(e){const t={},i=e.length;if(!i)return;let o=0,n=-2;const s=[];for(let r=0;ra;l-=s[l]+1){const t=e[l];if(t.marker===i.marker&&(t.open&&t.end<0)){let o=!1;if((t.close||i.open)&&(t.length+i.length)%3==0&&(t.length%3==0&&i.length%3==0||(o=!0)),!o){const o=l>0&&!e[l-1].open?s[l-1]+1:0;s[r]=r-l+o,s[l]=o,i.open=!1,t.end=r,t.close=!1,c=-1,n=-2;break}}}-1!==c&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=c)}}const cP=[["text",function(e,t){let i=e.pos;for(;i0)return!1;const i=e.pos;if(i+3>e.posMax)return!1;if(58!==e.src.charCodeAt(i))return!1;if(47!==e.src.charCodeAt(i+1))return!1;if(47!==e.src.charCodeAt(i+2))return!1;const o=e.pending.match(YT);if(!o)return!1;const n=o[1],s=e.md.linkify.matchAtStart(e.src.slice(i-n.length));if(!s)return!1;let r=s.url;if(r.length<=n.length)return!1;r=r.replace(/\*+$/,"");const a=e.md.normalizeLink(r);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-n.length);const t=e.push("link_open","a",1);t.attrs=[["href",a]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(r);const i=e.push("link_close","a",-1);i.markup="linkify",i.info="auto"}return e.pos+=r.length-n.length,!0}],["newline",function(e,t){let i=e.pos;if(10!==e.src.charCodeAt(i))return!1;const o=e.pending.length-1,n=e.posMax;if(!t)if(o>=0&&32===e.pending.charCodeAt(o))if(o>=1&&32===e.pending.charCodeAt(o-1)){let t=o-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i=o)return!1;let n=e.src.charCodeAt(i);if(10===n){for(t||e.push("hardbreak","br",0),i++;i=55296&&n<=56319&&i+1=56320&&t<=57343&&(s+=e.src[i+1],i++)}const r="\\"+s;if(!t){const t=e.push("text_special","",0);n<256&&0!==XT[n]?t.content=s:t.content=r,t.markup=r,t.info="escape"}return e.pos=i+1,!0}],["backticks",function(e,t){let i=e.pos;if(96!==e.src.charCodeAt(i))return!1;const o=i;i++;const n=e.posMax;for(;i=u)return!1;if(l=g,n=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),n.ok){for(r=e.md.normalizeLink(n.str),e.md.validateLink(r)?g=n.pos:r="",l=g;g=u||41!==e.src.charCodeAt(g))&&(c=!0),g++}if(c){if(void 0===e.env.references)return!1;if(g=0?o=e.src.slice(l,g++):g=m+1):g=m+1,o||(o=e.src.slice(h,m)),s=e.env.references[nT(o)],!s)return e.pos=d,!1;r=s.href,a=s.title}if(!t){e.pos=h,e.posMax=m;const t=[["href",r]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=u,!0}],["image",function(e,t){let i,o,n,s,r,a,l,c,d="";const u=e.pos,h=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const m=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(s=g+1,s=h)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(d=e.md.normalizeLink(a.str),e.md.validateLink(d)?s=a.pos:d=""),c=s;s=h||41!==e.src.charCodeAt(s))return e.pos=u,!1;s++}else{if(void 0===e.env.references)return!1;if(s=0?n=e.src.slice(c,s++):s=g+1):s=g+1,n||(n=e.src.slice(m,g)),r=e.env.references[nT(n)],!r)return e.pos=u,!1;d=r.href,l=r.title}if(!t){o=e.src.slice(m,g);const t=[];e.md.inline.parse(o,e.md,e.env,t);const i=e.push("image","img",0),n=[["src",d],["alt",""]];i.attrs=n,i.children=t,i.content=o,l&&n.push(["title",l])}return e.pos=s,e.posMax=h,!0}],["autolink",function(e,t){let i=e.pos;if(60!==e.src.charCodeAt(i))return!1;const o=e.pos,n=e.posMax;for(;;){if(++i>=n)return!1;const t=e.src.charCodeAt(i);if(60===t)return!1;if(62===t)break}const s=e.src.slice(o+1,i);if(sP.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const o=e.push("link_close","a",-1);o.markup="autolink",o.info="auto"}return e.pos+=s.length+2,!0}if(nP.test(s)){const i=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const o=e.push("link_close","a",-1);o.markup="autolink",o.info="auto"}return e.pos+=s.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const i=e.posMax,o=e.pos;if(60!==e.src.charCodeAt(o)||o+2>=i)return!1;const n=e.src.charCodeAt(o+1);if(33!==n&&63!==n&&47!==n&&!function(e){const t=32|e;return t>=97&&t<=122}(n))return!1;const s=e.src.slice(o).match(qT);if(!s)return!1;if(!t){const t=e.push("html_inline","",0);t.content=s[0],r=t.content,/^\s]/i.test(r)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}var r;return e.pos+=s[0].length,!0}],["entity",function(e,t){const i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1>=o)return!1;if(35===e.src.charCodeAt(i+1)){const o=e.src.slice(i).match(rP);if(o){if(!t){const t="x"===o[1][0].toLowerCase()?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=zE(t)?jE(t):jE(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(i).match(aP);if(o){const i=SE(o[0]);if(i!==o[0]){if(!t){const t=e.push("text_special","",0);t.content=i,t.markup=o[0],t.info="entity"}return e.pos+=o[0].length,!0}}}return!1}]],dP=[["balance_pairs",function(e){const t=e.tokens_meta,i=e.tokens_meta.length;lP(e.delimiters);for(let e=0;e0&&o++,"text"===n[t].type&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,s[t]=e.pos},uP.prototype.tokenize=function(e){const t=this.ruler.getRules(""),i=t.length,o=e.posMax,n=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(r){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},uP.prototype.parse=function(e,t,i,o){const n=new this.State(e,t,i,o);this.tokenize(n);const s=this.ruler2.getRules(""),r=s.length;for(let e=0;e=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:o.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,i){const o=e.slice(t);return i.re.mailto||(i.re.mailto=new RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(o)?o.match(i.re.mailto)[0].length:0}}},yP="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function _P(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=lE.source,t.src_Cc=cE.source,t.src_Z=uE.source,t.src_P=rE.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const i="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+i+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),i=e.__tlds__.slice();function o(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||i.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),i.push(t.src_xn),t.src_tlds=i.join("|"),t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const n=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){const i=e.__schemas__[t];if(null===i)return;const o={validate:null,link:null};if(e.__compiled__[t]=o,"[object Object]"===gP(i))return!function(e){return"[object RegExp]"===gP(e)}(i.validate)?pP(i.validate)?o.validate=i.validate:s(t,i):o.validate=function(e){return function(t,i){const o=t.slice(i);return e.test(o)?o.match(e)[0].length:0}}(i.validate),void(pP(i.normalize)?o.normalize=i.normalize:i.normalize?s(t,i):o.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===gP(e)}(i)?s(t,i):n.push(t)})),n.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const r=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(fP).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function kP(e,t){const i=e.__index__,o=e.__last_index__,n=e.__text_cache__.slice(i,o);this.schema=e.__schema__.toLowerCase(),this.index=i+t,this.lastIndex=o+t,this.raw=n,this.text=n,this.url=n}function vP(e,t){const i=new kP(e,t);return e.__compiled__[i.schema].normalize(i,e),i}function CP(e,t){if(!(this instanceof CP))return new CP(e,t);var i;t||(i=e,Object.keys(i||{}).reduce((function(e,t){return e||bP.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=mP({},bP,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=mP({},wP,e),this.__compiled__={},this.__tlds__=yP,this.__tlds_replaced__=!1,this.re={},_P(this)}CP.prototype.add=function(e,t){return this.__schemas__[e]=t,_P(this),this},CP.prototype.set=function(e){return this.__opts__=mP(this.__opts__,e),this},CP.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,i,o,n,s,r,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(n=this.testSchemaAt(e,t[2],a.lastIndex),n){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(o=e.match(this.re.email_fuzzy))&&(s=o.index+o[1].length,r=o.index+o[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=r))),this.__index__>=0},CP.prototype.pretest=function(e){return this.re.pretest.test(e)},CP.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0},CP.prototype.match=function(e){const t=[];let i=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(vP(this,i)),i=this.__last_index__);let o=i?e.slice(i):e;for(;this.test(o);)t.push(vP(this,i)),o=o.slice(this.__last_index__),i+=this.__last_index__;return t.length?t:null},CP.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const i=this.testSchemaAt(e,t[2],t[0].length);return i?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i,vP(this,0)):null},CP.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,i){return e!==i[t-1]})).reverse(),_P(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,_P(this),this)},CP.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},CP.prototype.onCompile=function(){};const AP=CP,xP=2147483647,EP=36,TP=/^xn--/,PP=/[^\0-\x7F]/,SP=/[\x2E\u3002\uFF0E\uFF61]/g,IP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},RP=Math.floor,OP=String.fromCharCode;function VP(e){throw new RangeError(IP[e])}function DP(e,t){const i=e.split("@");let o="";i.length>1&&(o=i[0]+"@",e=i[1]);const n=function(e,t){const i=[];let o=e.length;for(;o--;)i[o]=t(e[o]);return i}((e=e.replace(SP,".")).split("."),t).join(".");return o+n}function FP(e){const t=[];let i=0;const o=e.length;for(;i=55296&&n<=56319&&i>1,e+=RP(e/t);e>455;o+=EP)e=RP(e/35);return RP(o+36*e/(e+38))},BP=function(e){const t=[],i=e.length;let o=0,n=128,s=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let i=0;i=128&&VP("not-basic"),t.push(e.charCodeAt(i));for(let l=r>0?r+1:0;l=i&&VP("invalid-input");const r=(a=e.charCodeAt(l++))>=48&&a<58?a-48+26:a>=65&&a<91?a-65:a>=97&&a<123?a-97:EP;r>=EP&&VP("invalid-input"),r>RP((xP-o)/t)&&VP("overflow"),o+=r*t;const c=n<=s?1:n>=s+26?26:n-s;if(rRP(xP/d)&&VP("overflow"),t*=d}const c=t.length+1;s=NP(o-r,c,0==r),RP(o/c)>xP-n&&VP("overflow"),n+=RP(o/c),o%=c,t.splice(o++,0,n)}var a;return String.fromCodePoint(...t)},LP=function(e){const t=[],i=(e=FP(e)).length;let o=128,n=0,s=72;for(const i of e)i<128&&t.push(OP(i));const r=t.length;let a=r;for(r&&t.push("-");a=o&&tRP((xP-n)/l)&&VP("overflow"),n+=(i-o)*l,o=i;for(const i of e)if(ixP&&VP("overflow"),i===o){let e=n;for(let i=EP;;i+=EP){const o=i<=s?1:i>=s+26?26:i-s;if(eString.fromCodePoint(...e)},decode:BP,encode:LP,toASCII:function(e){return DP(e,(function(e){return PP.test(e)?"xn--"+LP(e):e}))},toUnicode:function(e){return DP(e,(function(e){return TP.test(e)?BP(e.slice(4).toLowerCase()):e}))}},jP={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},$P=/^(vbscript|javascript|file|data):/,qP=/^data:image\/(gif|png|jpeg|webp);/;function HP(e){const t=e.trim().toLowerCase();return!$P.test(t)||qP.test(t)}const WP=["http:","https:","mailto:"];function UP(e){const t=sE(e,!0);if(t.hostname&&(!t.protocol||WP.indexOf(t.protocol)>=0))try{t.hostname=zP.toASCII(t.hostname)}catch(e){}return Wx(Ux(t))}function KP(e){const t=sE(e,!0);if(t.hostname&&(!t.protocol||WP.indexOf(t.protocol)>=0))try{t.hostname=zP.toUnicode(t.hostname)}catch(e){}return $x(Ux(t),$x.defaultChars+"%")}function GP(e,t){if(!(this instanceof GP))return new GP(e,t);t||FE(e)||(t=e||{},e="default"),this.inline=new hP,this.block=new GT,this.core=new DT,this.renderer=new uT,this.linkify=new AP,this.validateLink=HP,this.normalizeLink=UP,this.normalizeLinkText=KP,this.utils=o,this.helpers=BE({},n),this.options={},this.configure(e),t&&this.set(t)}GP.prototype.set=function(e){return BE(this.options,e),this},GP.prototype.configure=function(e){const t=this;if(FE(e)){const t=e;if(!(e=jP[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(i){e.components[i].rules&&t[i].ruler.enableOnly(e.components[i].rules),e.components[i].rules2&&t[i].ruler2.enableOnly(e.components[i].rules2)})),this},GP.prototype.enable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.enable(e,!0))}),this),i=i.concat(this.inline.ruler2.enable(e,!0));const o=e.filter((function(e){return i.indexOf(e)<0}));if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},GP.prototype.disable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.disable(e,!0))}),this),i=i.concat(this.inline.ruler2.disable(e,!0));const o=e.filter((function(e){return i.indexOf(e)<0}));if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},GP.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},GP.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const i=new this.core.State(e,this,t);return this.core.process(i),i.tokens},GP.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},GP.prototype.parseInline=function(e,t){const i=new this.core.State(e,this,t);return i.inlineMode=!0,this.core.process(i),i.tokens},GP.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const JP=GP;var ZP=i(428),QP=i.n(ZP);const YP=/^(#{1,3})(\d+|[A-Z][A-Z0-9_]*-\d+)(?!\w)/;function XP(e,t){const i=e.pos,o=e.src;if(35!==o.charCodeAt(i))return!1;if(i>0&&/[\w#]/.test(o[i-1]))return!1;const n=YP.exec(o.slice(i));if(!n)return!1;if(t)return!0;if(function(e){if(!e.some((e=>"html_inline"===e.type&&e.content.startsWith("=0;t--){const i=e[t];if("html_inline"!==i.type)continue;const o=i.content;if(o.startsWith("${a}`:`${a}`;return e.push("html_inline","",0).content=l,e.pos=i+n[0].length,!0}const eS=/(?:\\\[){3}([0-9]+):([^\\\n]+)(?:\\\]){3}/;class tS{constructor(e){const t=e.editing.view.document;this._htmlDP=new Ir(t),this._domConverter=new Rn(t),this.editor=e}toView(e){const t=JP({html:!0,breaks:!0,langPrefix:"language-"});let i=t.use(QP(),{label:!0});i.inline.ruler.before("text","op_workpackage_ref",XP),i.inline.ruler.before("text","op_wiki_page_link",((e,t)=>function(e,t,i){const o=e.pos,n=e.src;if(92!==n.charCodeAt(o))return!1;const s=n.slice(o),r=eS.exec(s);if(!r)return!1;if(t)return!0;const a=r[1],l=r[2],c=crypto.randomUUID(),d=`\n`;return e.push("html_inline","",0).content=d,e.pos=o+r[0].length,!0}(e,t,this.editor)));const o=i.renderer.rules.code_block;t.renderer.rules.code_block=function(e,t,i,n,s){return e[t].content=e[t].content.replace(/\n$/,""),o(e,t,i,n,s)};const n=i.render(e),s=this._htmlDP._toDom(n);!function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(;t=i.nextNode();)t.previousElementSibling&&t.previousElementSibling.classList.contains("task-list-item-checkbox")&&(t.textContent=t.textContent.replace(/^\s+/,""))}(s),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("BR"===e.tagName&&!e.parentElement)return NodeFilter.FILTER_ACCEPT}}),o=[];for(;t=i.nextNode();)o.push(t);for(const t of o){const i=document.createElement("p");e.insertBefore(i,t),Lx(t)?i.appendChild(t):t.remove()}}(s),function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("P"===e.tagName&&e.parentElement&&"TD"===e.parentElement.tagName&&1===e.childNodes.length&&"BR"===e.childNodes[0].nodeName)return NodeFilter.FILTER_ACCEPT}});let i;for(;i=t.nextNode();)i.childNodes[0].remove()}(s),function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("BR"===e.tagName&&e.parentElement&&"LI"===e.parentElement.tagName)return NodeFilter.FILTER_ACCEPT}});let i,o=[];for(;i=t.nextNode();)o.push(i);for(const e of o)e.parentElement.insertBefore(document.createElement("p"),e),e.remove()}(s),s.querySelectorAll("input.task-list-item-checkbox").forEach((e=>{const t=e.closest("li.task-list-item");t&&e.parentElement!==t&&(e.parentElement&&e.parentElement.removeChild(e),t.insertBefore(e,t.firstChild))}));return this._domConverter.domToView(s)}toData(e){const t=this._domConverter.viewToDom(e,document);!function(e,t,i){t=t.map((e=>e.toUpperCase())),i=i.map((e=>e.toUpperCase()));let o,n=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(;o=n.nextNode();)o.parentElement&&t.indexOf(o.parentElement.nodeName)>=0&&(o.nodeValue=o.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")),Nx(o,i)||(o.nodeValue=_.escape(o.nodeValue))}(t,["strong","em"],["pre","code","table"]),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,(function(e){return"a"===e.nodeName.toLowerCase()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}));for(;t=i.nextNode();)t.setAttribute("href",t.href)}(t),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("P"===e.tagName&&0===e.childNodes.length&&(!e.parentElement||"LI"===e.parentElement.tagName))return NodeFilter.FILTER_ACCEPT}});for(;t=i.nextNode();)t.appendChild(document.createElement("br"))}(t);const i=new Mx({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){if("CODE"===t.tagName){const e=(t.getAttribute("class")||"").replace("language-",""),i=t.textContent||"";return"```"+e+"\n"+(i.length?i:"\n")+"```\n"}return"PRE"===t.tagName?e:t.isBlock?"\n\n":""}});return i.use([ex]),i.addRule("taskListItems",{filter:function(e){const t="checkbox"===e.type,i=e.parentNode&&"LI"===e.parentNode.nodeName,o=e.parentNode&&e.parentNode.parentNode&&"LI"===e.parentNode.parentNode.nodeName;return t&&(i||o)},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}}),i.addRule("orderedListItems",{filter:function(e){return"LI"===e.nodeName&&!!e.closest("ol")},replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n");var o=t.parentNode,n=i.bulletListMarker+" ";if("OL"===o.nodeName){var s=o.getAttribute("start"),r=Array.prototype.indexOf.call(o.children,t);n=(s?Number(s)+r:r+1)+". "}var a=n.length,l=" ".repeat(a);return n+(e=e.replace(/\n/gm,"\n"+l))+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}}),i.addRule("imageFigure",{filter:"img",replacement:function(e,t){const i=t.parentElement;return i&&i.classList.contains("op-uc-figure--content")?i.parentElement.outerHTML:t.outerHTML}}),i.addRule("figcaption",{filter:"figcaption",replacement:function(e,t){return""}}),i.addRule("markdownTables",{filter:function(e){return"TABLE"===e.nodeName&&(!e.parentElement||"FIGURE"!==e.parentElement.nodeName)},replacement:function(e,t){return t.outerHTML}}),i.addRule("htmlTables",{filter:function(e){const t=e.getElementsByTagName("table");return"FIGURE"===e.nodeName&&t.length},replacement:function(e,t){return t.querySelectorAll("td br[data-cke-filler]").forEach((e=>{e.nextElementSibling&&e.removeAttribute("data-cke-filler")})),t.outerHTML}}),i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}}),i.addRule("workPackageQuickinfo",{filter:e=>"OPCE-MACRO-WP-QUICKINFO"===e.nodeName,replacement:(e,t)=>{const i=t.getAttribute("data-display-id")||t.getAttribute("data-id")||"";if(!i)return"";return"true"===t.getAttribute("data-detailed")?`###${i}`:`##${i}`}}),i.addRule("wikiPageLink",{filter:e=>"TURBO-FRAME"===e.nodeName&&"wiki-page-link"===e.getAttribute("data-type"),replacement:(e,t)=>`\\[\\[\\[${t.getAttribute("data-provider-id")||""}:${t.getAttribute("data-page-identifier")||""}\\]\\]\\]`}),i.addRule("openProjectMacros",{filter:["macro"],replacement:(e,t)=>{t.innerHTML="";return t.outerHTML.replace("","\n")}}),i.addRule("mentions",{filter:e=>"MENTION"===e.nodeName&&e.classList.contains("mention"),replacement:(e,t)=>"work_package"===t.getAttribute("data-type")?t.getAttribute("data-display-id")?t.outerHTML:t.getAttribute("data-text")||t.textContent||"":t.outerHTML}),i.addRule("emptyParagraphs",{filter:e=>"P"===e.nodeName&&(0===e.childNodes.length||1===e.childNodes.length&&"BR"===e.childNodes[0].nodeName),replacement:(e,t)=>t.parentElement||t.nextSibling||t.previousSibling?1===t.childNodes.length&&Lx(t.childNodes[0])?Bx+"\n\n":"
    \n\n":""}),i.addRule("openProjectPageBreak",{filter:e=>"DIV"===e.nodeName&&e.classList.contains("page-break"),replacement:(e,t)=>Bx}),i.turndown(t).replace(/\u00A0/," ").replace("###turndown-ignore###\n","")}}const iS='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n\n';const oS={"(":")","[":"]","{":"}"};class nS extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"mention")}execute(e){const t=this.editor.model,i=t.document.selection,o="string"==typeof e.mention?{id:e.mention}:e.mention,n=o.id,s=e.range||i.getFirstRange();if(!t.canEditAt(s))return;const r=e.text||n,a=rS({_text:r,id:n},o);if(!n.startsWith(e.marker))throw new fe("mentioncommand-incorrect-id",this);t.change((e=>{const o=ai(i.getAttributes()),n=new Map(o.entries());n.set("mention",a);const l=t.insertContent(e.createText(r,n),s),c=l.start.nodeBefore,d=l.end.nodeAfter,u=d&&d.is("$text")&&d.data.startsWith(" ");let h=!1;if(c&&d&&c.is("$text")&&d.is("$text")){const e=c.data.slice(-1),t=e in oS,i=t&&d.data.startsWith(oS[e]);h=t&&i}h||u||t.insertContent(e.createText(" ",o),s.start.getShiftedBy(r.length))}))}}class sS extends fc{static get pluginName(){return"MentionEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=t.document;t.schema.extend("$text",{allowAttributes:"mention"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",attributes:"data-mention",classes:"mention"},model:{key:"mention",value:e=>aS(e)}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:cS}),e.conversion.for("downcast").add(lS),i.registerPostFixer((e=>function(e,t,i){const o=t.differ.getChanges();let n=!1;for(const t of o){if("attribute"==t.type)continue;const o=t.position;if("$text"==t.name){const t=o.textNode&&o.textNode.nextSibling;n=uS(o.textNode,e)||n,n=uS(t,e)||n,n=uS(o.nodeBefore,e)||n,n=uS(o.nodeAfter,e)||n}if("$text"!=t.name&&"insert"==t.type){const t=o.nodeAfter;for(const i of e.createRangeIn(t).getItems())n=uS(i,e)||n}if("insert"==t.type&&i.isInline(t.name)){const t=o.nodeAfter&&o.nodeAfter.nextSibling;n=uS(o.nodeBefore,e)||n,n=uS(t,e)||n}}return n}(e,i,t.schema))),i.registerPostFixer((e=>function(e,t){const i=t.differ.getChanges();let o=!1;for(const t of i)if("attribute"===t.type&&"mention"!=t.attributeKey){const i=t.range.start.nodeBefore,n=t.range.end.nodeAfter;for(const s of[i,n])dS(s)&&s.getAttribute(t.attributeKey)!=t.attributeNewValue&&(e.setAttribute(t.attributeKey,t.attributeNewValue,s),o=!0)}return o}(e,i))),i.registerPostFixer((e=>function(e,t){const i=t.selection,o=i.focus;if(i.isCollapsed&&i.hasAttribute("mention")&&function(e){const t=e.isAtStart;return e.nodeBefore&&e.nodeBefore.is("$text")||t}(o))return e.removeSelectionAttribute("mention"),!0;return!1}(e,i))),e.commands.add("mention",new nS(e))}}function rS(e,t){return Object.assign({uid:me().slice(0,8)},e,t||{})}function aS(e,t){const i=e.getAttribute("data-mention"),o=e.getChild(0);if(!o)return;const n=e.getAttribute("data-mention-uid");return rS({id:i,_text:o.data},n?{uid:n,...t}:t)}function lS(e){e.on("attribute:mention",((e,t,i)=>{const o=t.attributeNewValue;if(!t.item.is("$textProxy")||!o)return;const n=t.range.start;(n.textNode||n.nodeAfter).data!=o._text&&i.consumable.consume(t.item,e.name)}),{priority:"highest"})}function cS(e,{writer:t,options:i}){if(e)return t.createAttributeElement("span",{class:"mention","data-mention":e.id,...!i.isClipboardPipeline&&{"data-mention-uid":e.uid}},{id:e.uid,priority:20})}function dS(e){if(!e||!e.is("$text")&&!e.is("$textProxy")||!e.hasAttribute("mention"))return!1;return e.data!=e.getAttribute("mention")._text}function uS(e,t){return!!dS(e)&&(t.removeAttribute("mention",e),!0)}class hS extends zh{selected;position;constructor(e){super(e),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const e=this.selected,t=this.items.getIndex(e);this.select(t+1)}selectPrevious(){const e=this.selected,t=this.items.getIndex(e);this.select(t-1)}select(e){let t=0;e>0&&e{i?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))})),this.listenTo(this.domElement,"click",(()=>{this.fire("execute")}))}render(){super.render(),this.element=this.domElement}focus(){this.domElement.focus()}}class gS extends Nh{item;marker;highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const pS=[$t.arrowup,$t.arrowdown,$t.esc],fS=[$t.enter,$t.tab];class bS extends fc{_mentionsView;_mentionsConfigurations;_balloon;_items=new ei;_lastRequested;_requestFeedDebounced;static get pluginName(){return"MentionUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Qm]}constructor(e){super(e),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=Li(this._requestFeed,100),e.config.define("mention",{feeds:[]})}init(){const e=this.editor,t=e.config.get("mention.commitKeys")||fS,i=pS.concat(t);this._balloon=e.plugins.get(Qm),e.editing.view.document.on("keydown",((e,o)=>{var n;n=o.keyCode,i.includes(n)&&this._isUIVisible&&(o.preventDefault(),e.stop(),o.keyCode==$t.arrowdown&&this._mentionsView.selectNext(),o.keyCode==$t.arrowup&&this._mentionsView.selectPrevious(),t.includes(o.keyCode)&&this._mentionsView.executeSelected(),o.keyCode==$t.esc&&this._hideUIAndRemoveMarker())}),{priority:"highest"}),Su({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const o=e.config.get("mention.feeds");for(const e of o){const{feed:t,marker:i,dropdownLimit:o}=e;if(!vS(i))throw new fe("mentionconfig-incorrect-marker",null,{marker:i});const n={marker:i,feedCallback:"function"==typeof t?t.bind(this.editor):kS(t),itemRenderer:e.itemRenderer,dropdownLimit:o};this._mentionsConfigurations.set(i,n)}this._setupTextWatcher(o),this.listenTo(e,"change:isReadOnly",(()=>{this._hideUIAndRemoveMarker()})),this.on("requestFeed:response",((e,t)=>this._handleFeedResponse(t))),this.on("requestFeed:error",(()=>this._hideUIAndRemoveMarker()))}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const e=this.editor.locale,t=new hS(e);return t.items.bindTo(this._items).using((i=>{const{item:o,marker:n}=i,{dropdownLimit:s}=this._mentionsConfigurations.get(n),r=s||this.editor.config.get("mention.dropdownLimit")||10;if(t.items.length>=r)return null;const a=new gS(e),l=this._renderItem(o,n);return l.delegate("execute").to(a),a.children.add(l),a.item=o,a.marker=n,a.on("execute",(()=>{t.fire("execute",{item:o,marker:n})})),a})),t.on("execute",((e,t)=>{const i=this.editor,o=i.model,n=t.item,s=t.marker,r=i.model.markers.get("mention"),a=o.createPositionAt(o.document.selection.focus),l=o.createPositionAt(r.getStart()),c=o.createRange(l,a);this._hideUIAndRemoveMarker(),i.execute("mention",{mention:n,text:n.text,marker:s,range:c}),i.editing.view.focus()})),t}_getItemRenderer(e){const{itemRenderer:t}=this._mentionsConfigurations.get(e);return t}_requestFeed(e,t){this._lastRequested=t;const{feedCallback:i}=this._mentionsConfigurations.get(e),o=i(t);o instanceof Promise?o.then((i=>{this._lastRequested==t?this.fire("requestFeed:response",{feed:i,marker:e,feedText:t}):this.fire("requestFeed:discarded",{feed:i,marker:e,feedText:t})})).catch((t=>{this.fire("requestFeed:error",{error:t}),be("mention-feed-callback-error",{marker:e})})):this.fire("requestFeed:response",{feed:o,marker:e,feedText:t})}_setupTextWatcher(e){const t=this.editor,i=e.map((e=>({...e,pattern:_S(e.marker,e.minimumCharacters||0)}))),o=new Ig(t.model,function(e){const t=t=>{const i=yS(e,t);if(!i)return!1;let o=0;0!==i.position&&(o=i.position-1);const n=t.substring(o);return i.pattern.test(n)};return t}(i));o.on("matched",((e,o)=>{const n=yS(i,o.text),s=t.model.document.selection.focus,r=t.model.createPositionAt(s.parent,n.position);if(function(e){const t=e.textNode&&e.textNode.hasAttribute("mention"),i=e.nodeBefore;return t||i&&i.is("$text")&&i.hasAttribute("mention")}(s)||function(e){const t=e.nodeAfter;return t&&t.is("$text")&&t.hasAttribute("mention")}(r))return void this._hideUIAndRemoveMarker();const a=function(e,t){let i=0;0!==e.position&&(i=e.position-1);const o=_S(e.marker,0),n=t.substring(i);return n.match(o)[2]}(n,o.text),l=n.marker.length+a.length,c=s.getShiftedBy(-l),d=s.getShiftedBy(-a.length),u=t.model.createRange(c,d);if(CS(t)){const e=t.model.markers.get("mention");t.model.change((t=>{t.updateMarker(e,{range:u})}))}else t.model.change((e=>{e.addMarker("mention",{range:u,usingOperation:!1,affectsData:!1})}));this._requestFeedDebounced(n.marker,a)})),o.on("unmatched",(()=>{this._hideUIAndRemoveMarker()}));const n=t.commands.get("mention");return o.bind("isEnabled").to(n),o}_handleFeedResponse(e){const{feed:t,marker:i}=e;if(!CS(this.editor))return;this._items.clear();for(const e of t){const t="object"!=typeof e?{id:e,text:e}:e;this._items.add({item:t,marker:i})}const o=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(o):this._hideUIAndRemoveMarker()}_showOrUpdateUI(e){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(e,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(e,this._mentionsView.position),singleViewMode:!0,balloonClassName:"ck-mention-balloon"}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),CS(this.editor)&&this.editor.model.change((e=>e.removeMarker("mention"))),this._mentionsView.position=void 0}_renderItem(e,t){const i=this.editor;let o,n=e.id;const s=this._getItemRenderer(t);if(s){const t=s(e);"string"!=typeof t?o=new mS(i.locale,t):n=t}if(!o){const e=new Lu(i.locale);e.label=n,e.withText=!0,o=e}return o}_getBalloonPanelPositionData(e,t){const i=this.editor,o=i.editing,n=o.view.domConverter,s=o.mapper;return{target:()=>{let t=e.getRange();"$graveyard"==t.start.root.rootName&&(t=i.model.document.selection.getFirstRange());const o=s.toViewRange(t);return ut.getDomRangeRects(n.viewRangeToDom(o)).pop()},limiter:()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},positions:wS(t,i.locale.uiLanguageDirection)}}}function wS(e,t){const i={caret_se:e=>({top:e.bottom+3,left:e.right,name:"caret_se",config:{withArrow:!1}}),caret_ne:(e,t)=>({top:e.top-t.height-3,left:e.right,name:"caret_ne",config:{withArrow:!1}}),caret_sw:(e,t)=>({top:e.bottom+3,left:e.right-t.width,name:"caret_sw",config:{withArrow:!1}}),caret_nw:(e,t)=>({top:e.top-t.height-3,left:e.right-t.width,name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(i,e)?[i[e]]:"rtl"!==t?[i.caret_se,i.caret_sw,i.caret_ne,i.caret_nw]:[i.caret_sw,i.caret_se,i.caret_nw,i.caret_ne]}function yS(e,t){let i;for(const o of e){const e=t.lastIndexOf(o.marker);e>0&&!t.substring(e-1).match(o.pattern)||(!i||e>=i.position)&&(i={marker:o.marker,position:e,minimumCharacters:o.minimumCharacters,pattern:o.pattern})}return i}function _S(e,t){const i=0==t?"*":`{${t},}`,o=Y.features.isRegExpUnicodePropertySupported?"\\p{Ps}\\p{Pi}\"'":"\\(\\[{\"'";e=e.replace(/[.*+?^${}()\-|[\]\\]/g,"\\$&");return new RegExp(`(?:^|[ ${o}])(${e})([^#@]${i})$`,"u")}function kS(e){return t=>e.filter((e=>("string"==typeof e?e:String(e.id)).toLowerCase().includes(t.toLowerCase())))}function vS(e){return!!e}function CS(e){return e.model.markers.has("mention")}const AS=/^#{2,3}/;function xS(e){if("work_package"!==e.getAttribute("data-type"))return!1;const t=e.getAttribute("data-text");return!!t&&AS.test(t)}class ES extends wc{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const o=function(e,t){const i=cp(e,t),o=i.start.parent;if(o.isEmpty&&!o.is("element","$root"))return o.parent;return o}(e,i);return t.checkChild(o,"pageBreak")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("pageBreak");e.insertObject(i,null,null,{setSelection:"after"})}))}}class TS extends fc{static get pluginName(){return"PageBreakEditing"}static get licenseFeatureCode(){return"PB"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},t.createContainerElement("span",{style:"display: none"}))}),o.for("editingDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>{const o=i("Page break"),n=t.createContainerElement("div"),s=t.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=i("Page break")}));return t.addClass("page-break",n),t.insert(t.createPositionAt(n,0),s),function(e,t,i){return t.setCustomProperty("pageBreak",!0,e),np(e,t,{label:i})}(n,t,o)}}),o.for("upcast").elementToElement({view:e=>{const t="always"==e.getStyle("page-break-before"),i="always"==e.getStyle("page-break-after");if(!t&&!i)return null;if(1==e.childCount){const t=e.getChild(0);if(!t.is("element","span")||"none"!=t.getStyle("display"))return null}else if(e.childCount>1)return null;return{name:!0,styles:[...t?["page-break-before"]:[],...i?["page-break-after"]:[]],...e.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new ES(e))}}class PS extends fc{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("pageBreak",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:pageBreak",(()=>this._createButton(sh)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("pageBreak"),n=new e(t.locale),s=i.t;return n.set({label:s("Page break"),icon:''}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("pageBreak"),t.editing.view.focus()})),n}}class SS extends fc{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[Lc]}constructor(e){super(e);const t=e.config.get("autosave")||{},i=t.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=Li(this._save.bind(this),i),this._lastDocumentVersion=e.model.document.version,this._savePromise=null,this._domEmitter=new(et()),this._config=t,this._pendingActions=e.plugins.get(Lc),this._makeImmediateSave=!1}init(){const e=this.editor,t=e.model.document;this.listenTo(e,"ready",(()=>{this.listenTo(t,"change:data",((e,t)=>{this._saveCallbacks.length&&t.isLocal&&("synchronized"===this.state&&(this.state="waiting",this._setPendingAction()),"waiting"===this.state&&this._debouncedSave())}))})),this.listenTo(e,"destroy",(()=>this._flush()),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",((e,t)=>{this._pendingActions.hasAny&&(t.returnValue=this._pendingActions.first.message)}))}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then((()=>Promise.all(this._saveCallbacks.map((e=>e(this.editor)))))).finally((()=>{this._savePromise=null})).then((()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)})).catch((e=>{throw this.state="error",this.state="saving",this._debouncedSave(),e})),this._savePromise)}_setPendingAction(){const e=this.editor.t;this._action||(this._action=this._pendingActions.add(e("Saving changes")))}get _saveCallbacks(){const e=[];return this.adapter&&this.adapter.save&&e.push(this.adapter.save),this._config.save&&e.push(this._config.save),e}}var IS=i(992);function RS(e){return e.trim().split(/\s+/).length}function OS(e){const t=e.length;let i=5381;for(let o=0;o>>0}function VS(e){const t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(IS.decompress(t))}catch(e){return console.error("Failed to load CKEditor revisions from localStorage: "+e.toString()),null}}class DS extends fc{init(){const e=this.editor,t=Lp(e);e.ui.componentFactory.add("opContentRevisions",(i=>{const o=Zh(i),n=new ei;return Xh(o,n,{role:"menu",ariaLabel:t.t("js.editor.revisions")}),o.buttonView.set({label:t.t("js.editor.revisions"),icon:'\n\n\n',tooltip:!0}),this.listenTo(o.buttonView,"execute",(async()=>{n.clear(),function(e,t){const i=e.config.get(MS),o=VS(i),n=Lp(e),s=Np(e,"timezone");if(!o?.items||o.items.count<=0){const e={type:"button",model:{label:n.t("js.editor.no_revisions"),withText:!0}};return void t.add(e)}const r=e.getData(),a=OS(r);for(let e=o.items.length;e>0;){e--;const i=o.items[e],r=s.formattedRelativeDateTime(i.timestamp),l=n.t("js.units.word",{count:RS(i.content)}),c=`${i.hash===a?`${n.t("js.label_current")} - `:""}${r} (${l})`,d={type:"button",model:{timestamp:i.timestamp,label:c,withText:!0}};t.add(d)}}(e,n)})),o.on("execute",(t=>{const{timestamp:i}=t.source;i&&e.execute("opContentRevisionApply",i)})),o}))}}class FS extends wc{async execute(e){const t=this.editor,i=t.config.get(MS),o=await VS(i);if(!o)return void console.error(`Trying to load revision ${e} but no record present.`);const n=o.items.find((t=>t.timestamp===e));n&&(t.setData(n.content),setTimeout((()=>{t.editing.view.focus()})))}}const MS="opContentRevisionKey",NS="op_ckeditor_rev";const BS="op-macro-wp-quickinfo",LS="opce-macro-wp-quickinfo";const zS="op-macro-wiki-page-link";const jS=[Op,class extends fc{static get requires(){return[zp,vp,Wp]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return zp.buttonName}},class extends fc{static get requires(){return[Gp,vp,Jp]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return Gp.buttonName}},class extends fc{static get requires(){return[uw,vp,hw]}static get pluginName(){return"OPChildPages"}static get buttonName(){return uw.buttonName}}],$S=[class extends fc{static get requires(){return[Qp,Db]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=e=>{const t=Fp(this.editor);return new Xp(e,t,this.editor)}}},class extends fc{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",((e,t)=>{this.removeDeletedImage(t)}))}removeDeletedImage(e){let t=this.editor.model.document.getRoot();for(const i of Array.from(t.getChildren()))if("image"===i.name&&e.indexOf(i.getAttribute("src"))>-1){const e=this.editor.model.createSelection(i,"on");this.editor.model.deleteContent(e)}}}],qS=[class extends fc{static get requires(){return[rh,Of,Kg,ww,Qg,Pg,zf]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Qp]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(Qp).createUploadAdapter=t=>new vw(t,e,this.editor.t))}},class extends fc{static get requires(){return[Tg]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Cw(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Cw(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Cw(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Cw(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=Ew(this.editor,"bold");Aw(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Aw(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=Ew(this.editor,"italic");Aw(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Aw(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=Ew(this.editor,"code");Aw(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=Ew(this.editor,"strikethrough");Aw(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter((e=>e.match(/^heading[1-6]$/))).forEach((t=>{const i=t[7],o=new RegExp(`^(#{${i}})\\s$`);Cw(this.editor,this,o,(()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Cw(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Cw(e,this,/^```$/,(()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Cw(this.editor,this,/^---$/,"horizontalLine")}},SS,class extends fc{static get requires(){return[Sw,Ow]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Dw,Mw]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Bw,zw]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[$w,Hw]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Jw,Zw]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[ny,ry]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}},gb,fb,class extends fc{static get requires(){return[yb,_b]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[ow,nw]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Mb,qb,Gb,Bb]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Ap,Gf]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Ap),o=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:lw(e.config.get("image.toolbar")||[]),getRelatedElement:e=>o.getClosestSelectedImageWidget(e)})}},class extends fc{static get pluginName(){return"OpImageAttachmentLookup"}init(){const e=this.editor,t=e.conversion,i=Fp(e);t.for("editingDowncast").add(function(e){return e=>{e.on("attribute:src:imageBlock",t,{priority:"highest"}),e.on("attribute:src:imageInline",t,{priority:"highest"})};function t(t,i,o){let n=i.attributeNewValue;if(!n||!e.lookupDownloadLocationByName)return;const s=e.lookupDownloadLocationByName(n);i.attributeNewValue=s||n}}(i)),t.for("dataDowncast").add(function(e){return e=>{e.on("attribute:src:imageBlock",t,{priority:"highest"}),e.on("attribute:src:imageInline",t,{priority:"highest"})};function t(t,i,o){let n=i.attributeNewValue;if(!n||!e.lookupDownloadLocationByName)return;const s=e.lookupDownloadLocationByName(n);i.attributeNewValue=s||n;const r=o.writer,a=o.mapper.toViewElement(i.item);let l;l="imageInline"===i.item.name?a:a.getChild(0),s&&r.setAttribute("data-original-src",n,l)}}(i));const o=e.plugins.get("ImageUtils");o.decorate("setImageNaturalSizeAttributes"),o.on("setImageNaturalSizeAttributes",((e,[t])=>{console.log("model image element:",{element:t}),e.stop()}),{priority:"highest"})}},class extends fc{static get requires(){return[Ty,Dy,Ny]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[z_,H_]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Y_,ok]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[TS,PS,vp]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}},ey,Pg,class extends fc{toMentionAttribute(e,t){return aS(e,t)}static get pluginName(){return"Mention"}static get isOfficialPlugin(){return!0}static get requires(){return[sS,bS]}},function(e){const t=Mp(e),i=e.editing.view,o=i.document;i.addObserver(il),e.listenTo(o,"click",((e,t)=>{if("A"===t.domTarget.nodeName&&t.domTarget.classList.contains("mention")){const e=document.createElement("a");e.target="_blank",e.href=t.domTarget.attributes.href.value,e.click()}})),e.conversion.for("upcast").elementToAttribute({view:{name:"mention",key:"data-mention",classes:"mention"},model:{key:"mention",value:i=>{const o=i.getAttribute("data-id"),n=i.getAttribute("data-display-id"),s=i.getAttribute("data-type"),r=i.getAttribute("data-text");if(xS(i))return null;const a=function(e,i){const o=t.services.apiV3Service[`${i}s`].segment,n=window.OpenProject.urlRoot;return`${n}/${o}/${e}`}(n||o,s);return e.plugins.get("Mention").toMentionAttribute(i,{dataId:o,dataDisplayId:n,link:a,text:r,type:s})}},converterPriority:"high"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:e=>{const t=[...e.getChildren()][0],i=t&&t.data;if(i){const e=`[Invalid mention: ${i}]`;t._data=e}}},converterPriority:"high"}),e.conversion.for("editingDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(e,{writer:t})=>{if(!e)return;if("emoji"===e.type)return t.createAttributeElement("span");return t.createAttributeElement("a",{class:"mention",href:e.link,"data-mention":e.text,title:e.text})}}),e.conversion.for("dataDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(e,{writer:t})=>{if(!e)return;if("emoji"===e.type)return t.createAttributeElement("span");const i={class:"mention","data-id":e.dataId,"data-type":e.type,"data-text":e.text};e.dataDisplayId&&(i["data-display-id"]=e.dataDisplayId);return t.createAttributeElement("mention",i)}})},class extends fc{static get pluginName(){return"PasteFromOffice"}static get licenseFeatureCode(){return"PFO"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[bf]}init(){const e=this.editor,t=e.plugins.get("ClipboardPipeline"),i=e.editing.view.document,o=[],n=this.editor.plugins.has("MultiLevelListEditing"),s=this.editor.plugins.has("TablePropertiesEditing");o.push(new $A(i,n,s)),o.push(new GA(i)),o.push(new ZA(i)),t.on("inputTransformation",((t,n)=>{if(n._isTransformedWithPasteFromOffice)return;if(e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const s=n.dataTransfer.getData("text/html"),r=o.find((e=>e.isActive(s)));r&&(n._parsedData||(n._parsedData=YA(s,i.stylesProcessor)),r.execute(n),n._isTransformedWithPasteFromOffice=!0)}),{priority:"high"})}},class extends fc{static get pluginName(){return"OPHelpLinkPlugin"}init(){const e=this.editor,t=e.config.get("openProject.helpURL");e.ui.componentFactory.add("openProjectShowFormattingHelp",(e=>{const i=new Lu(e);return i.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:'',tooltip:!0}),i.on("execute",(()=>{window.open(t,"_blank")})),i}))}},class extends fc{static get pluginName(){return"OPPreview"}init(){const e=this.editor;let t=!1,i=null;e.ui.componentFactory.add("preview",(o=>{const n=new Lu(o);n.set({label:this.label,icon:'\n',tooltip:!0});let s=function(t){const o=e.ui.getEditableElement(),s=o?.parentElement;if(!s?.parentElement)return void console.error("Cannot show preview: invalid editor structure");const r=document.createElement("div");r.className="ck-editor__preview op-uc-container";Array.from(s.parentElement.children).filter((e=>e!==s&&e.classList.contains("ck-editor__preview"))).forEach((e=>e.remove()));const a=Np(e,"ckEditorPreview");i=a.render(r,t),s.style.display="none",s.parentElement.insertBefore(r,s.nextSibling),gk(e,n)},r=function(){let i=function(e){return _.get(e.config,"_config.openProject.context.previewContext")}(e);(async function(e,t){return new yk("post",e,t).perform()})(Bp(e).api.v3.previewMarkup(i),{contentType:"text/plain; charset=UTF-8",responseKind:"html",body:e.getData()}).then((e=>e.html)).then(s).catch((i=>{console.error("Error fetching preview:",i),t=!1,pk(e)}))};return n.on("execute",(()=>{t?(t=!1,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot disable preview: invalid editor structure");i&&i(),Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__preview"))).forEach((e=>e.remove())),o.style.display="",pk(e)}()):(t=!0,r())})),n}))}get label(){return window.I18n.t("js.editor.preview")}},class extends fc{static get pluginName(){return"OPSourceCode"}init(){const e=this.editor;let t=!1,i={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};e.ui.componentFactory.add("opShowSource",(o=>{const n=new Lu(o);n.set({label:i.source,class:"",icon:iS,tooltip:!0});return n.on("execute",(()=>{t?(t=!1,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot hide source: invalid editor structure");e.fire("op:source-code-disabled"),Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__source"))).forEach((e=>e.remove())),o.style.display="",pk(e),n.set({label:i.source,class:"",icon:iS,tooltip:!0})}()):(t=!0,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot show source: invalid editor structure");const s=document.createElement("div");s.className="ck-editor__source",Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__source"))).forEach((e=>e.remove())),o.style.display="none",o.parentElement.insertBefore(s,o.nextSibling),gk(e,n),e.fire("op:source-code-enabled"),n.set({label:i.wysiwyg,class:"-source-enabled",icon:'\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',tooltip:!0})}())})),n}))}},class extends fc{static get requires(){return[SS,DS]}static get pluginName(){return"OpContentRevisions"}constructor(e){super(e);const t=this.getStorageKey(e);e.config.define(MS,t)}init(){const e=this.editor;e.commands.add("opContentRevisionApply",new FS(e)),e.once("ready",(()=>{const t=Date.now();e.plugins.get("Autosave")._domEmitter.stopListening(window,"beforeunload"),Object.keys(localStorage).forEach((e=>{if(e.startsWith(NS)){const i=VS(e);i?.updatedAt&&t-i.updatedAt>=288e5&&localStorage.removeItem(e)}}))}))}getStorageKey(e){const t=e.config.get("storageKey");return t||this.createLocalStorageKey(e)}createLocalStorageKey(e){const t=Fp(e),i=function(e){return _.get(e.config,"_config.openProject.context.field")}(e);let o="";return o=t?.href?t.href:location.pathname,i&&(o+=`_${i}`),`${NS}_${o}`}},class extends fc{static get requires(){return[vp]}static get pluginName(){return"OPMacroWpQuickinfo"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register(BS,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["wpId","wpDisplayId","detailed","markerText"]}),i.for("upcast").elementToElement({view:{name:LS},model:(e,{writer:t})=>{const i=e.getAttribute("data-id")||"",o=e.getAttribute("data-display-id")||""||i,n={wpDisplayId:o,detailed:"true"===e.getAttribute("data-detailed")};return i&&i!==o&&(n.wpId=i),t.createElement(BS,n)},converterPriority:"high"}),i.for("upcast").elementToElement({view:{name:"mention",classes:"mention"},model:(e,{writer:t})=>{if(!xS(e))return null;const i=e.getAttribute("data-text"),o=i.startsWith("###"),n=e.getAttribute("data-id")||"",s=e.getAttribute("data-display-id")||n;return t.createElement(BS,{wpId:n,wpDisplayId:s,detailed:o,markerText:i})},converterPriority:"highest"}),i.for("editingDowncast").elementToElement({model:BS,view:(e,{writer:t})=>{const i=e.getAttribute("wpDisplayId")||"",o=!!e.getAttribute("detailed"),n=e.getAttribute("wpId")||i,s=e.getAttribute("markerText")||`${o?"###":"##"}${i}`,r=t.createContainerElement("span",{class:"op-macro-wp-quickinfo-widget"}),a=t.createRawElement(LS,{"data-id":n,"data-display-id":i,"data-detailed":String(o)},(()=>{}));return t.insert(t.createPositionAt(r,0),a),np(r,t,{label:s})}}),i.for("dataDowncast").elementToElement({model:BS,view:(e,{writer:t})=>{const i=e.getAttribute("wpDisplayId")||"",o=!!e.getAttribute("detailed"),n=e.getAttribute("wpId"),s=e.getAttribute("markerText")||`${o?"###":"##"}${i}`;if(n){const e=t.createContainerElement("mention",{class:"mention","data-id":n,"data-type":"work_package","data-text":s,"data-display-id":i});return t.insert(t.createPositionAt(e,0),t.createText(s)),e}const r=t.createContainerElement(LS,{"data-id":n||i,"data-display-id":i,"data-detailed":String(o)});return t.insert(t.createPositionAt(r,0),t.createText(s)),r}})}afterInit(){const e=this.editor,t=e.commands.get("mention");t&&t.on("execute",((t,i)=>{const o=i&&i[0];if(!o||!o.mention)return;if("work_package"!==o.mention.type)return;const n=o.marker;if("##"!==n&&"###"!==n)return;t.stop();const s="###"===n,r=String(o.mention.dataDisplayId),a=null!=o.mention.dataId?String(o.mention.dataId):null,l=o.mention.text||`${n}${r}`;e.model.change((t=>{const i=o.range||e.model.document.selection.getFirstRange();i&&t.remove(i);const n={wpDisplayId:r,detailed:s,markerText:l};a&&(n.wpId=a);const c=t.createElement(BS,n);e.model.insertContent(c,e.model.document.selection),t.setSelection(t.createPositionAfter(c))}))}),{priority:"high"})}},class extends fc{static get pluginName(){return"OpMacroWikiPageLink"}init(){const e=this.editor,t=e.conversion;e.model.schema.register(zS,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["providerId","pageIdentifier"]}),t.for("upcast").elementToElement({view:{name:"turbo-frame",attributes:{"data-type":"wiki-page-link"}},model:(e,{writer:t})=>{const i=e.getAttribute("data-provider-id"),o=e.getAttribute("data-page-identifier");return t.createElement(zS,{providerId:i,pageIdentifier:o})}}),t.for("dataDowncast").elementToElement({model:zS,view:(e,{writer:t})=>{const i=e.getAttribute("providerId"),o=e.getAttribute("pageIdentifier"),n=crypto.randomUUID(),s=t.createContainerElement("turbo-frame",{id:n,src:this.macroUrl(i,o,n),"data-provider-id":i,"data-page-identifier":o,"data-type":"wiki-page-link"}),r=`[[[${i}:${o}]]]`;return t.insert(t.createPositionAt(s,0),t.createText(r)),s}}),t.for("editingDowncast").elementToElement({model:zS,view:(e,{writer:t})=>{const i=e.getAttribute("providerId"),o=e.getAttribute("pageIdentifier"),n=crypto.randomUUID(),s=t.createContainerElement("span",{class:"my-wiki-page-link-widget"}),r=t.createRawElement("turbo-frame",{id:n,src:this.macroUrl(i,o,n),"data-provider-id":i,"data-page-identifier":o,"data-type":"wiki-page-link"},(()=>{}));return t.insert(t.createPositionAt(s,0),r),np(s,t,{label:`[[[${i}:${o}]]]`})}})}macroUrl(e,t,i){return Bp(this.editor).wikiPageLinkMacro(e,t,i)}},class extends fc{static get pluginName(){return"CodeBlock"}static get requires(){return[uk,hk]}},function(e){e.data.processor=new tS(e)},mC,class extends fc{static get requires(){return[Ap]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Ap),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:fC}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:pC})}},class extends fc{static get pluginName(){return"TableProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[hA,yA]}},class extends fc{static get pluginName(){return"TableCellProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[oA,zC]}},class extends fc{init(){const e=this.editor,t=(e.config.get("removePlugins")||[]).map((e=>e.pluginName)),i=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==e.config.get("openProject.disableAllMacros")&&e.ui.componentFactory.add("macroList",(o=>{const n=[];for(const i of jS){if(-1!==t.indexOf(i.pluginName))continue;const o=e.ui.componentFactory.create(i.buttonName);n.push(o)}const s=Zh(o);return Qh(s,n,{isVertical:!0,class:"op-macro-list-button"}),s.buttonView.set({isOn:!1,withText:!0,tooltip:i,label:window.I18n.t("js.editor.macro.dropdown.macros")}),s}))}},class extends fc{get config(){const e="op-uc-";return{preFix:e,editorClasses:[`${e}container`,`${e}container_editing`],elementsWithCustomClassesMap:{paragraph:`${e}p`,heading1:`${e}h1`,heading2:`${e}h2`,heading3:`${e}h3`,heading4:`${e}h4`,heading5:`${e}h5`,heading6:`${e}h6`,blockQuote:`${e}blockquote`,figure:`${e}figure`,table:`${e}table`,thead:`${e}table--head`,tr:`${e}table--row`,td:`${e}table--cell`,th:[`${e}table--cell`,`${e}table--cell_head`],tableCell:`${e}table--cell`,tableRow:`${e}table--row`,ol:`${e}list`,ul:`${e}list`,list:`${e}list`,todo:`${e}list ${e}list_task-list`,listItem:`${e}list--item`,li:`${e}list--item`,imageInline:`${e}image ${e}image_inline`,imageBlock:`${e}image`,img:`${e}image`,codeblock:`${e}code-block`,caption:`${e}figure--description`,"op-macro-embedded-table":[`${e}placeholder`,`${e}embedded-table`],"op-macro-wp-button":[`${e}placeholder`,`${e}wp-button`],"op-macro-child-pages":[`${e}placeholder`,`${e}child-pages`],"op-macro-toc":[`${e}placeholder`,`${e}toc`],content:`${e}figure--content`},attributesWithCustomClassesMap:{code:`${e}code`,linkHref:`${e}link`,alignment:`${e}figure_align-`,tableAlignment:`${e}figure_align-`,todo:`${e}list_task-list`,numbered:`${e}list`,bulleted:`${e}list`,listType:null,headingColumns:null,width:null,uploadStatus:null},alignmentValuesMap:{left:"start",right:"end",blockLeft:"start",blockRight:"end",center:"center",default:"center"}}}init(){this._addCustomCSSClassesToTheEditorContainer(this.editor),this._addCustomCSSClassesToElements(this.config),this._addCustomCSSClassesToAttributes(this.config)}_addCustomCSSClassesToTheEditorContainer(e){e.sourceElement.classList.add(...this.config.editorClasses)}_addCustomCSSClassesToElements(e){this.editor.model.schema.extend("table",{allowAttributes:["figureClasses"]}),this.editor.conversion.for("upcast").add((t=>t.on("element:table",this._manageTableUpcast(e))),{priority:"high"}),this.editor.conversion.for("downcast").add((t=>t.on("insert",this._manageElementsInsertion(e),{priority:"low"})))}_addCustomCSSClassesToAttributes(e){this.editor.conversion.for("downcast").add((t=>t.on("attribute",this._manageAttributesInsertion(e),{priority:"low"})))}_manageTableUpcast(e){return(t,i,o)=>{const n=o.writer,s=i.viewItem,r=i.modelRange,a=r&&r.start.nodeAfter;if(!a)return;let l=a.getAttribute("figureClasses")||[],c=s.parent.getClassNames&&s.parent.getClassNames();const d=c?[...c].filter((e=>!!e)):[];l=[...l,...d];const u=d.filter((t=>t.startsWith(e.attributesWithCustomClassesMap.alignment)))[0],h=u&&u.replace(e.attributesWithCustomClassesMap.alignment,"")||e.alignmentValuesMap.default,m=Object.keys(e.alignmentValuesMap).find((t=>e.alignmentValuesMap[t]===h))||"center";if(!u){const t=`${e.attributesWithCustomClassesMap.alignment}${h}`;l=[...l,t]}n.setAttribute("figureClasses",l,a),"center"===m?n.setAttribute("alignment",null,a):n.setAttribute("alignment",m,a)}}_manageElementsInsertion(e){return(t,i,o)=>{const n=Object.keys(e.elementsWithCustomClassesMap),s=o.writer,r=i.item.name,a=i.item,l=o.mapper.toViewElement(a);let c=[l];const d=["imageBlock","table","tableCell","tableRow","listItem"].includes(r);if(n.includes(r)&&l){if(d)if("listItem"===r)c=this._manageListItems(s,a,l,c,e);else{const t=l,i=Array.from(s.createRangeIn(l).getItems());if("imageBlock"===r){const o=i.find((e=>e.is("element","img")));this._wrapInFigureContentContainer(o,t,e,s),c=[...c,o]}else if("table"===r||"tableRow"===r){const o=i.filter((e=>n.includes(e.name)));if(c=[...c,...o],"table"===r){if(!a.getAttribute("tableAlignment")){const i=`${e.attributesWithCustomClassesMap.alignment}${e.alignmentValuesMap.default}`;s.addClass(i,t)}}}}c.forEach((t=>{const i=d?t.name:r,o=e.elementsWithCustomClassesMap[i];s.addClass(o,t)}))}}}_manageAttributesInsertion(e){return(t,i,o)=>{const n=Object.keys(e.attributesWithCustomClassesMap),s=i.attributeKey,r=o.writer,a=i.item,l=o.mapper.toViewElement(a);if(n.includes(s))if("linkHref"===s||"code"===s){const t="linkHref"===s?"a":s,n="linkHref"===s?5:10,l=r.document.selection,c=r.createAttributeElement(t,{class:e.attributesWithCustomClassesMap[s]},{priority:n});a.is("selection")?r.wrap(l.getFirstRange(),c):r.wrap(o.mapper.toViewRange(i.range),c)}else if("tableAlignment"===s){const t=l,o=e.alignmentValuesMap[i.attributeNewValue]||e.alignmentValuesMap.default;Array.from(new Set(Object.values(e.alignmentValuesMap))).map((t=>`${e.attributesWithCustomClassesMap[s]}${t}`)).filter((e=>t.hasClass(e))).forEach((e=>r.removeClass(e,t))),t.hasStyle("float")&&r.removeStyle("float",t),r.addClass(`${e.attributesWithCustomClassesMap[s]}${o}`,t)}else if("listType"===s){this._manageListItems(r,a,l,[l],e).forEach((t=>{const i=t.name,o=e.elementsWithCustomClassesMap[i];r.addClass(o,t)}))}else if("headingColumns"===s){const t=i.attributeNewValue,o=Array.from(r.createRangeIn(l).getItems()).filter((t=>Object.keys(e.elementsWithCustomClassesMap).includes(t.name)));t?o.forEach((t=>{const i=t.name,o=e.elementsWithCustomClassesMap[i];r.addClass(o,t)})):o.filter((t=>t.hasClass(e.elementsWithCustomClassesMap.th[1]))).forEach((t=>{const i=t.nextSibling;i&&"th"!==i.name&&r.removeClass(e.elementsWithCustomClassesMap.th[1],t)}))}else if("width"===s)l.hasClass("image_resized")&&r.removeClass("image_resized",l);else if("uploadStatus"===s&&"complete"===i.attributeNewValue){let e=Array.from(r.createRangeIn(l).getItems()).find((e=>e.hasClass("ck-upload-placeholder-loader")));e&&r.remove(r.createRangeOn(e))}}}_manageListItems(e,t,i,o,n){const s=i.findAncestor("li"),r=i.findAncestor(/^(ul|ol)$/);if(!r)return o;const a=t.getAttribute("listType"),l=n.attributesWithCustomClassesMap[a];if("todo"===a)e.addClass(l,r);else{const t=n.attributesWithCustomClassesMap.todo;r.hasClass(t)&&e.removeClass(t,r)}return[...o,r,s]}_wrapInFigureContentContainer(e,t,i,o){const n=o.createContainerElement("div",{class:i.elementsWithCustomClassesMap.content});o.insert(o.createPositionAt(n,0),e),o.insert(o.createPositionAt(t,0),n)}}].concat(jS,$S);function HS(e){return function(t){const i=window.OpenProject.urlRoot,o=`${i}/work_packages/auto_complete.json`;return this.config.get("disabledMentions").includes("work_package")?[]:new Promise(((n,s)=>{_k(o,{responseKind:"json",query:{q:t,scope:"all"}}).then((e=>e.json)).then((t=>{n(t.map((t=>{const o=t.displayId||t.id,n=`${e}${o}`;return{id:n,dataId:t.id,dataDisplayId:o,type:"work_package",text:n,name:t.to_s,link:`${i}/work_packages/${o}`}})))})).catch((e=>{console.error("Error fetching work package mentions:",e),s(e)}))}))}}function WS(e){const t=document.createElement("span");return"user"!==e.type&&"work_package"!==e.type||(t.setAttribute("data-hover-card-trigger-target","trigger"),t.setAttribute("data-hover-card-url",`${e.link}/hover_card`)),t.classList.add("mention-list-item"),t.textContent=e.name,t}const US=JSON.parse('[{"id":":grinning_face:","symbol":"😀","group":"people","keywords":["face","grin","grinning face"]},{"id":":beaming_face_with_smiling_eyes:","symbol":"😁","group":"people","keywords":["beaming face with smiling eyes","eye","face","grin","smile"]},{"id":":face_with_tears_of_joy:","symbol":"😂","group":"people","keywords":["face","face with tears of joy","joy","laugh","tear"]},{"id":":rolling_on_the_floor_laughing:","symbol":"🤣","group":"people","keywords":["face","floor","laugh","rolling","rolling on the floor laughing"]},{"id":":grinning_face_with_big_eyes:","symbol":"😃","group":"people","keywords":["face","grinning face with big eyes","mouth","open","smile"]},{"id":":grinning_face_with_smiling_eyes:","symbol":"😄","group":"people","keywords":["eye","face","grinning face with smiling eyes","mouth","open","smile"]},{"id":":grinning_face_with_sweat:","symbol":"😅","group":"people","keywords":["cold","face","grinning face with sweat","open","smile","sweat"]},{"id":":grinning_squinting_face:","symbol":"😆","group":"people","keywords":["face","grinning squinting face","laugh","mouth","satisfied","smile"]},{"id":":winking_face:","symbol":"😉","group":"people","keywords":["face","wink","winking face"]},{"id":":smiling_face_with_smiling_eyes:","symbol":"😊","group":"people","keywords":["blush","eye","face","smile","smiling face with smiling eyes"]},{"id":":face_savoring_food:","symbol":"😋","group":"people","keywords":["delicious","face","face savoring food","savouring","smile","yum"]},{"id":":smiling_face_with_sunglasses:","symbol":"😎","group":"people","keywords":["bright","cool","face","smiling face with sunglasses","sun","sunglasses"]},{"id":":smiling_face_with_heart-eyes:","symbol":"😍","group":"people","keywords":["eye","face","love","smile","smiling face with heart-eyes"]},{"id":":face_blowing_a_kiss:","symbol":"😘","group":"people","keywords":["face","face blowing a kiss","kiss"]},{"id":":kissing_face:","symbol":"😗","group":"people","keywords":["face","kiss","kissing face"]},{"id":":kissing_face_with_smiling_eyes:","symbol":"😙","group":"people","keywords":["eye","face","kiss","kissing face with smiling eyes","smile"]},{"id":":kissing_face_with_closed_eyes:","symbol":"😚","group":"people","keywords":["closed","eye","face","kiss","kissing face with closed eyes"]},{"id":":smiling_face:","symbol":"☺","group":"people","keywords":["face","outlined","relaxed","smile","smiling face"]},{"id":":slightly_smiling_face:","symbol":"🙂","group":"people","keywords":["face","slightly smiling face","smile"]},{"id":":hugging_face:","symbol":"🤗","group":"people","keywords":["face","hug","hugging"]},{"id":":star-struck:","symbol":"🤩","group":"people","keywords":["eyes","face","grinning","star","star-struck",""]},{"id":":thinking_face:","symbol":"🤔","group":"people","keywords":["face","thinking"]},{"id":":face_with_raised_eyebrow:","symbol":"🤨","group":"people","keywords":["distrust","face with raised eyebrow","skeptic",""]},{"id":":neutral_face:","symbol":"😐","group":"people","keywords":["deadpan","face","neutral"]},{"id":":expressionless_face:","symbol":"😑","group":"people","keywords":["expressionless","face","inexpressive","unexpressive"]},{"id":":face_without_mouth:","symbol":"😶","group":"people","keywords":["face","face without mouth","mouth","quiet","silent"]},{"id":":face_with_rolling_eyes:","symbol":"🙄","group":"people","keywords":["eyes","face","face with rolling eyes","rolling"]},{"id":":smirking_face:","symbol":"😏","group":"people","keywords":["face","smirk","smirking face"]},{"id":":persevering_face:","symbol":"😣","group":"people","keywords":["face","persevere","persevering face"]},{"id":":sad_but_relieved_face:","symbol":"😥","group":"people","keywords":["disappointed","face","relieved","sad but relieved face","whew"]},{"id":":face_with_open_mouth:","symbol":"😮","group":"people","keywords":["face","face with open mouth","mouth","open","sympathy"]},{"id":":zipper-mouth_face:","symbol":"🤐","group":"people","keywords":["face","mouth","zipper","zipper-mouth face"]},{"id":":hushed_face:","symbol":"😯","group":"people","keywords":["face","hushed","stunned","surprised"]},{"id":":sleepy_face:","symbol":"😪","group":"people","keywords":["face","sleep","sleepy face"]},{"id":":tired_face:","symbol":"😫","group":"people","keywords":["face","tired"]},{"id":":sleeping_face:","symbol":"😴","group":"people","keywords":["face","sleep","sleeping face","zzz"]},{"id":":relieved_face:","symbol":"😌","group":"people","keywords":["face","relieved"]},{"id":":face_with_tongue:","symbol":"😛","group":"people","keywords":["face","face with tongue","tongue"]},{"id":":winking_face_with_tongue:","symbol":"😜","group":"people","keywords":["eye","face","joke","tongue","wink","winking face with tongue"]},{"id":":squinting_face_with_tongue:","symbol":"😝","group":"people","keywords":["eye","face","horrible","squinting face with tongue","taste","tongue"]},{"id":":drooling_face:","symbol":"🤤","group":"people","keywords":["drooling","face"]},{"id":":unamused_face:","symbol":"😒","group":"people","keywords":["face","unamused","unhappy"]},{"id":":downcast_face_with_sweat:","symbol":"😓","group":"people","keywords":["cold","downcast face with sweat","face","sweat"]},{"id":":pensive_face:","symbol":"😔","group":"people","keywords":["dejected","face","pensive"]},{"id":":confused_face:","symbol":"😕","group":"people","keywords":["confused","face"]},{"id":":upside-down_face:","symbol":"🙃","group":"people","keywords":["face","upside-down"]},{"id":":money-mouth_face:","symbol":"🤑","group":"people","keywords":["face","money","money-mouth face","mouth"]},{"id":":astonished_face:","symbol":"😲","group":"people","keywords":["astonished","face","shocked","totally"]},{"id":":frowning_face:","symbol":"☹","group":"people","keywords":["face","frown","frowning face"]},{"id":":slightly_frowning_face:","symbol":"🙁","group":"people","keywords":["face","frown","slightly frowning face"]},{"id":":confounded_face:","symbol":"😖","group":"people","keywords":["confounded","face"]},{"id":":disappointed_face:","symbol":"😞","group":"people","keywords":["disappointed","face"]},{"id":":worried_face:","symbol":"😟","group":"people","keywords":["face","worried"]},{"id":":face_with_steam_from_nose:","symbol":"😤","group":"people","keywords":["face","face with steam from nose","triumph","won"]},{"id":":crying_face:","symbol":"😢","group":"people","keywords":["cry","crying face","face","sad","tear"]},{"id":":loudly_crying_face:","symbol":"😭","group":"people","keywords":["cry","face","loudly crying face","sad","sob","tear"]},{"id":":frowning_face_with_open_mouth:","symbol":"😦","group":"people","keywords":["face","frown","frowning face with open mouth","mouth","open"]},{"id":":anguished_face:","symbol":"😧","group":"people","keywords":["anguished","face"]},{"id":":fearful_face:","symbol":"😨","group":"people","keywords":["face","fear","fearful","scared"]},{"id":":weary_face:","symbol":"😩","group":"people","keywords":["face","tired","weary"]},{"id":":exploding_head:","symbol":"🤯","group":"people","keywords":["exploding head","shocked"]},{"id":":grimacing_face:","symbol":"😬","group":"people","keywords":["face","grimace","grimacing face"]},{"id":":anxious_face_with_sweat:","symbol":"😰","group":"people","keywords":["anxious face with sweat","blue","cold","face","rushed","sweat"]},{"id":":face_screaming_in_fear:","symbol":"😱","group":"people","keywords":["face","face screaming in fear","fear","munch","scared","scream"]},{"id":":flushed_face:","symbol":"😳","group":"people","keywords":["dazed","face","flushed"]},{"id":":zany_face:","symbol":"🤪","group":"people","keywords":["eye","goofy","large","small","zany face"]},{"id":":dizzy_face:","symbol":"😵","group":"people","keywords":["dizzy","face"]},{"id":":pouting_face:","symbol":"😡","group":"people","keywords":["angry","face","mad","pouting","rage","red"]},{"id":":angry_face:","symbol":"😠","group":"people","keywords":["angry","face","mad"]},{"id":":face_with_symbols_on_mouth:","symbol":"🤬","group":"people","keywords":["face with symbols on mouth","swearing",""]},{"id":":face_with_medical_mask:","symbol":"😷","group":"people","keywords":["cold","doctor","face","face with medical mask","mask","sick"]},{"id":":face_with_thermometer:","symbol":"🤒","group":"people","keywords":["face","face with thermometer","ill","sick","thermometer"]},{"id":":face_with_head-bandage:","symbol":"🤕","group":"people","keywords":["bandage","face","face with head-bandage","hurt","injury"]},{"id":":nauseated_face:","symbol":"🤢","group":"people","keywords":["face","nauseated","vomit"]},{"id":":face_vomiting:","symbol":"🤮","group":"people","keywords":["face vomiting","sick","vomit"]},{"id":":sneezing_face:","symbol":"🤧","group":"people","keywords":["face","gesundheit","sneeze","sneezing face"]},{"id":":smiling_face_with_halo:","symbol":"😇","group":"people","keywords":["angel","face","fantasy","halo","innocent","smiling face with halo"]},{"id":":cowboy_hat_face:","symbol":"🤠","group":"people","keywords":["cowboy","cowgirl","face","hat"]},{"id":":lying_face:","symbol":"🤥","group":"people","keywords":["face","lie","lying face","pinocchio"]},{"id":":shushing_face:","symbol":"🤫","group":"people","keywords":["quiet","shush","shushing face"]},{"id":":face_with_hand_over_mouth:","symbol":"🤭","group":"people","keywords":["face with hand over mouth","whoops",""]},{"id":":face_with_monocle:","symbol":"🧐","group":"people","keywords":["face with monocle","stuffy",""]},{"id":":nerd_face:","symbol":"🤓","group":"people","keywords":["face","geek","nerd"]},{"id":":smiling_face_with_horns:","symbol":"😈","group":"people","keywords":["face","fairy tale","fantasy","horns","smile","smiling face with horns"]},{"id":":angry_face_with_horns:","symbol":"👿","group":"people","keywords":["angry face with horns","demon","devil","face","fantasy","imp"]},{"id":":clown_face:","symbol":"🤡","group":"people","keywords":["clown","face"]},{"id":":ogre:","symbol":"👹","group":"people","keywords":["creature","face","fairy tale","fantasy","monster","ogre",""]},{"id":":goblin:","symbol":"👺","group":"people","keywords":["creature","face","fairy tale","fantasy","goblin","monster"]},{"id":":skull:","symbol":"💀","group":"people","keywords":["death","face","fairy tale","monster","skull"]},{"id":":skull_and_crossbones:","symbol":"☠","group":"people","keywords":["crossbones","death","face","monster","skull","skull and crossbones"]},{"id":":ghost:","symbol":"👻","group":"people","keywords":["creature","face","fairy tale","fantasy","ghost","monster"]},{"id":":alien:","symbol":"👽","group":"people","keywords":["alien","creature","extraterrestrial","face","fantasy","ufo"]},{"id":":alien_monster:","symbol":"👾","group":"people","keywords":["alien","creature","extraterrestrial","face","monster","ufo"]},{"id":":robot_face:","symbol":"🤖","group":"people","keywords":["face","monster","robot"]},{"id":":pile_of_poo:","symbol":"💩","group":"people","keywords":["dung","face","monster","pile of poo","poo","poop"]},{"id":":grinning_cat_face:","symbol":"😺","group":"people","keywords":["cat","face","grinning cat face","mouth","open","smile"]},{"id":":grinning_cat_face_with_smiling_eyes:","symbol":"😸","group":"people","keywords":["cat","eye","face","grin","grinning cat face with smiling eyes","smile"]},{"id":":cat_face_with_tears_of_joy:","symbol":"😹","group":"people","keywords":["cat","cat face with tears of joy","face","joy","tear"]},{"id":":smiling_cat_face_with_heart-eyes:","symbol":"😻","group":"people","keywords":["cat","eye","face","love","smile","smiling cat face with heart-eyes"]},{"id":":cat_face_with_wry_smile:","symbol":"😼","group":"people","keywords":["cat","cat face with wry smile","face","ironic","smile","wry"]},{"id":":kissing_cat_face:","symbol":"😽","group":"people","keywords":["cat","eye","face","kiss","kissing cat face"]},{"id":":weary_cat_face:","symbol":"🙀","group":"people","keywords":["cat","face","oh","surprised","weary"]},{"id":":crying_cat_face:","symbol":"😿","group":"people","keywords":["cat","cry","crying cat face","face","sad","tear"]},{"id":":pouting_cat_face:","symbol":"😾","group":"people","keywords":["cat","face","pouting"]},{"id":":see-no-evil_monkey:","symbol":"🙈","group":"people","keywords":["evil","face","forbidden","monkey","see","see-no-evil monkey"]},{"id":":hear-no-evil_monkey:","symbol":"🙉","group":"people","keywords":["evil","face","forbidden","hear","hear-no-evil monkey","monkey"]},{"id":":speak-no-evil_monkey:","symbol":"🙊","group":"people","keywords":["evil","face","forbidden","monkey","speak","speak-no-evil monkey"]},{"id":":baby:","symbol":"👶","group":"people","keywords":["baby","young"]},{"id":":child:","symbol":"🧒","group":"people","keywords":["child","gender-neutral","unspecified gender","young"]},{"id":":boy:","symbol":"👦","group":"people","keywords":["boy","young"]},{"id":":girl:","symbol":"👧","group":"people","keywords":["girl","Virgo","young","zodiac"]},{"id":":person:","symbol":"🧑","group":"people","keywords":["adult","gender-neutral","person","unspecified gender"]},{"id":":person_blond_hair:","symbol":"👱","group":"people","keywords":["blond","blond-haired person","person: blond hair"]},{"id":":man:","symbol":"👨","group":"people","keywords":["adult","man"]},{"id":":man_blond_hair:","symbol":"👱‍♂️","group":"people","keywords":["blond","blond-haired man","man","man: blond hair"]},{"id":":man_beard:","symbol":"🧔","group":"people","keywords":["beard","man: beard","person",""]},{"id":":woman:","symbol":"👩","group":"people","keywords":["adult","woman"]},{"id":":woman_blond_hair:","symbol":"👱‍♀️","group":"people","keywords":["blond-haired woman","blonde","woman","woman: blond hair"]},{"id":":older_person:","symbol":"🧓","group":"people","keywords":["adult","gender-neutral","old","older person","unspecified gender"]},{"id":":old_man:","symbol":"👴","group":"people","keywords":["adult","man","old"]},{"id":":old_woman:","symbol":"👵","group":"people","keywords":["adult","old","woman"]},{"id":":man_health_worker:","symbol":"👨‍⚕️","group":"people","keywords":["doctor","healthcare","man","man health worker","nurse","therapist"]},{"id":":woman_health_worker:","symbol":"👩‍⚕️","group":"people","keywords":["doctor","healthcare","nurse","therapist","woman","woman health worker"]},{"id":":man_student:","symbol":"👨‍🎓","group":"people","keywords":["graduate","man","student"]},{"id":":woman_student:","symbol":"👩‍🎓","group":"people","keywords":["graduate","student","woman"]},{"id":":man_teacher:","symbol":"👨‍🏫","group":"people","keywords":["instructor","man","professor","teacher"]},{"id":":woman_teacher:","symbol":"👩‍🏫","group":"people","keywords":["instructor","professor","teacher","woman"]},{"id":":man_judge:","symbol":"👨‍⚖️","group":"people","keywords":["justice","man","man judge","scales"]},{"id":":woman_judge:","symbol":"👩‍⚖️","group":"people","keywords":["judge","scales","woman"]},{"id":":man_farmer:","symbol":"👨‍🌾","group":"people","keywords":["farmer","gardener","man","rancher"]},{"id":":woman_farmer:","symbol":"👩‍🌾","group":"people","keywords":["farmer","gardener","rancher","woman"]},{"id":":man_cook:","symbol":"👨‍🍳","group":"people","keywords":["chef","cook","man"]},{"id":":woman_cook:","symbol":"👩‍🍳","group":"people","keywords":["chef","cook","woman"]},{"id":":man_mechanic:","symbol":"👨‍🔧","group":"people","keywords":["electrician","man","mechanic","plumber","tradesperson"]},{"id":":woman_mechanic:","symbol":"👩‍🔧","group":"people","keywords":["electrician","mechanic","plumber","tradesperson","woman"]},{"id":":man_factory_worker:","symbol":"👨‍🏭","group":"people","keywords":["assembly","factory","industrial","man","worker"]},{"id":":woman_factory_worker:","symbol":"👩‍🏭","group":"people","keywords":["assembly","factory","industrial","woman","worker"]},{"id":":man_office_worker:","symbol":"👨‍💼","group":"people","keywords":["architect","business","man","man office worker","manager","white-collar"]},{"id":":woman_office_worker:","symbol":"👩‍💼","group":"people","keywords":["architect","business","manager","white-collar","woman","woman office worker"]},{"id":":man_scientist:","symbol":"👨‍🔬","group":"people","keywords":["biologist","chemist","engineer","man","physicist","scientist"]},{"id":":woman_scientist:","symbol":"👩‍🔬","group":"people","keywords":["biologist","chemist","engineer","physicist","scientist","woman"]},{"id":":man_technologist:","symbol":"👨‍💻","group":"people","keywords":["coder","developer","inventor","man","software","technologist"]},{"id":":woman_technologist:","symbol":"👩‍💻","group":"people","keywords":["coder","developer","inventor","software","technologist","woman"]},{"id":":man_singer:","symbol":"👨‍🎤","group":"people","keywords":["actor","entertainer","man","rock","singer","star"]},{"id":":woman_singer:","symbol":"👩‍🎤","group":"people","keywords":["actor","entertainer","rock","singer","star","woman"]},{"id":":man_artist:","symbol":"👨‍🎨","group":"people","keywords":["artist","man","palette"]},{"id":":woman_artist:","symbol":"👩‍🎨","group":"people","keywords":["artist","palette","woman"]},{"id":":man_pilot:","symbol":"👨‍✈️","group":"people","keywords":["man","pilot","plane"]},{"id":":woman_pilot:","symbol":"👩‍✈️","group":"people","keywords":["pilot","plane","woman"]},{"id":":man_astronaut:","symbol":"👨‍🚀","group":"people","keywords":["astronaut","man","rocket"]},{"id":":woman_astronaut:","symbol":"👩‍🚀","group":"people","keywords":["astronaut","rocket","woman"]},{"id":":man_firefighter:","symbol":"👨‍🚒","group":"people","keywords":["firefighter","firetruck","man"]},{"id":":woman_firefighter:","symbol":"👩‍🚒","group":"people","keywords":["firefighter","firetruck","woman"]},{"id":":police_officer:","symbol":"👮","group":"people","keywords":["cop","officer","police"]},{"id":":man_police_officer:","symbol":"👮‍♂️","group":"people","keywords":["cop","man","officer","police"]},{"id":":woman_police_officer:","symbol":"👮‍♀️","group":"people","keywords":["cop","officer","police","woman"]},{"id":":detective:","symbol":"🕵","group":"people","keywords":["detective","sleuth","spy"]},{"id":":man_detective:","symbol":"🕵️‍♂️","group":"people","keywords":["detective","man","sleuth","spy"]},{"id":":woman_detective:","symbol":"🕵️‍♀️","group":"people","keywords":["detective","sleuth","spy","woman"]},{"id":":guard:","symbol":"💂","group":"people","keywords":["guard"]},{"id":":man_guard:","symbol":"💂‍♂️","group":"people","keywords":["guard","man"]},{"id":":woman_guard:","symbol":"💂‍♀️","group":"people","keywords":["guard","woman"]},{"id":":construction_worker:","symbol":"👷","group":"people","keywords":["construction","hat","worker"]},{"id":":man_construction_worker:","symbol":"👷‍♂️","group":"people","keywords":["construction","man","worker"]},{"id":":woman_construction_worker:","symbol":"👷‍♀️","group":"people","keywords":["construction","woman","worker"]},{"id":":prince:","symbol":"🤴","group":"people","keywords":["prince"]},{"id":":princess:","symbol":"👸","group":"people","keywords":["fairy tale","fantasy","princess"]},{"id":":person_wearing_turban:","symbol":"👳","group":"people","keywords":["person wearing turban","turban"]},{"id":":man_wearing_turban:","symbol":"👳‍♂️","group":"people","keywords":["man","man wearing turban","turban"]},{"id":":woman_wearing_turban:","symbol":"👳‍♀️","group":"people","keywords":["turban","woman","woman wearing turban"]},{"id":":man_with_chinese_cap:","symbol":"👲","group":"people","keywords":["gua pi mao","hat","man","man with Chinese cap"]},{"id":":woman_with_headscarf:","symbol":"🧕","group":"people","keywords":["headscarf","hijab","mantilla","tichel","woman with headscarf",""]},{"id":":man_in_tuxedo:","symbol":"🤵","group":"people","keywords":["groom","man","man in tuxedo","tuxedo"]},{"id":":bride_with_veil:","symbol":"👰","group":"people","keywords":["bride","bride with veil","veil","wedding"]},{"id":":pregnant_woman:","symbol":"🤰","group":"people","keywords":["pregnant","woman"]},{"id":":breast-feeding:","symbol":"🤱","group":"people","keywords":["baby","breast","breast-feeding","nursing"]},{"id":":baby_angel:","symbol":"👼","group":"people","keywords":["angel","baby","face","fairy tale","fantasy"]},{"id":":santa_claus:","symbol":"🎅","group":"people","keywords":["celebration","Christmas","claus","father","santa","Santa Claus"]},{"id":":mrs._claus:","symbol":"🤶","group":"people","keywords":["celebration","Christmas","claus","mother","Mrs.","Mrs. Claus"]},{"id":":mage:","symbol":"🧙","group":"people","keywords":["mage","sorcerer","sorceress","witch","wizard"]},{"id":":man_mage:","symbol":"🧙‍♂️","group":"people","keywords":["man mage","sorcerer","wizard"]},{"id":":woman_mage:","symbol":"🧙‍♀️","group":"people","keywords":["sorceress","witch","woman mage"]},{"id":":fairy:","symbol":"🧚","group":"people","keywords":["fairy","Oberon","Puck","Titania"]},{"id":":man_fairy:","symbol":"🧚‍♂️","group":"people","keywords":["man fairy","Oberon","Puck"]},{"id":":woman_fairy:","symbol":"🧚‍♀️","group":"people","keywords":["Titania","woman fairy"]},{"id":":vampire:","symbol":"🧛","group":"people","keywords":["Dracula","undead","vampire"]},{"id":":man_vampire:","symbol":"🧛‍♂️","group":"people","keywords":["Dracula","man vampire","undead"]},{"id":":woman_vampire:","symbol":"🧛‍♀️","group":"people","keywords":["undead","woman vampire"]},{"id":":merperson:","symbol":"🧜","group":"people","keywords":["mermaid","merman","merperson","merwoman"]},{"id":":merman:","symbol":"🧜‍♂️","group":"people","keywords":["merman","Triton"]},{"id":":mermaid:","symbol":"🧜‍♀️","group":"people","keywords":["mermaid","merwoman"]},{"id":":elf:","symbol":"🧝","group":"people","keywords":["elf","magical",""]},{"id":":man_elf:","symbol":"🧝‍♂️","group":"people","keywords":["magical","man elf"]},{"id":":woman_elf:","symbol":"🧝‍♀️","group":"people","keywords":["magical","woman elf"]},{"id":":genie:","symbol":"🧞","group":"people","keywords":["djinn","genie",""]},{"id":":man_genie:","symbol":"🧞‍♂️","group":"people","keywords":["djinn","man genie"]},{"id":":woman_genie:","symbol":"🧞‍♀️","group":"people","keywords":["djinn","woman genie"]},{"id":":zombie:","symbol":"🧟","group":"people","keywords":["undead","walking dead","zombie",""]},{"id":":man_zombie:","symbol":"🧟‍♂️","group":"people","keywords":["man zombie","undead","walking dead"]},{"id":":woman_zombie:","symbol":"🧟‍♀️","group":"people","keywords":["undead","walking dead","woman zombie"]},{"id":":person_frowning:","symbol":"🙍","group":"people","keywords":["frown","gesture","person frowning"]},{"id":":man_frowning:","symbol":"🙍‍♂️","group":"people","keywords":["frowning","gesture","man"]},{"id":":woman_frowning:","symbol":"🙍‍♀️","group":"people","keywords":["frowning","gesture","woman"]},{"id":":person_pouting:","symbol":"🙎","group":"people","keywords":["gesture","person pouting","pouting"]},{"id":":man_pouting:","symbol":"🙎‍♂️","group":"people","keywords":["gesture","man","pouting"]},{"id":":woman_pouting:","symbol":"🙎‍♀️","group":"people","keywords":["gesture","pouting","woman"]},{"id":":person_gesturing_no:","symbol":"🙅","group":"people","keywords":["forbidden","gesture","hand","person gesturing NO","prohibited"]},{"id":":man_gesturing_no:","symbol":"🙅‍♂️","group":"people","keywords":["forbidden","gesture","hand","man","man gesturing NO","prohibited"]},{"id":":woman_gesturing_no:","symbol":"🙅‍♀️","group":"people","keywords":["forbidden","gesture","hand","prohibited","woman","woman gesturing NO"]},{"id":":person_gesturing_ok:","symbol":"🙆","group":"people","keywords":["gesture","hand","OK","person gesturing OK"]},{"id":":man_gesturing_ok:","symbol":"🙆‍♂️","group":"people","keywords":["gesture","hand","man","man gesturing OK","OK"]},{"id":":woman_gesturing_ok:","symbol":"🙆‍♀️","group":"people","keywords":["gesture","hand","OK","woman","woman gesturing OK"]},{"id":":person_tipping_hand:","symbol":"💁","group":"people","keywords":["hand","help","information","person tipping hand","sassy","tipping"]},{"id":":man_tipping_hand:","symbol":"💁‍♂️","group":"people","keywords":["man","man tipping hand","sassy","tipping hand"]},{"id":":woman_tipping_hand:","symbol":"💁‍♀️","group":"people","keywords":["sassy","tipping hand","woman","woman tipping hand"]},{"id":":person_raising_hand:","symbol":"🙋","group":"people","keywords":["gesture","hand","happy","person raising hand","raised"]},{"id":":man_raising_hand:","symbol":"🙋‍♂️","group":"people","keywords":["gesture","man","man raising hand","raising hand"]},{"id":":woman_raising_hand:","symbol":"🙋‍♀️","group":"people","keywords":["gesture","raising hand","woman","woman raising hand"]},{"id":":person_bowing:","symbol":"🙇","group":"people","keywords":["apology","bow","gesture","person bowing","sorry"]},{"id":":man_bowing:","symbol":"🙇‍♂️","group":"people","keywords":["apology","bowing","favor","gesture","man","sorry"]},{"id":":woman_bowing:","symbol":"🙇‍♀️","group":"people","keywords":["apology","bowing","favor","gesture","sorry","woman"]},{"id":":person_facepalming:","symbol":"🤦","group":"people","keywords":["disbelief","exasperation","face","palm","person facepalming"]},{"id":":man_facepalming:","symbol":"🤦‍♂️","group":"people","keywords":["disbelief","exasperation","facepalm","man","man facepalming"]},{"id":":woman_facepalming:","symbol":"🤦‍♀️","group":"people","keywords":["disbelief","exasperation","facepalm","woman","woman facepalming"]},{"id":":person_shrugging:","symbol":"🤷","group":"people","keywords":["doubt","ignorance","indifference","person shrugging","shrug"]},{"id":":man_shrugging:","symbol":"🤷‍♂️","group":"people","keywords":["doubt","ignorance","indifference","man","man shrugging","shrug"]},{"id":":woman_shrugging:","symbol":"🤷‍♀️","group":"people","keywords":["doubt","ignorance","indifference","shrug","woman","woman shrugging"]},{"id":":person_getting_massage:","symbol":"💆","group":"people","keywords":["face","massage","person getting massage","salon"]},{"id":":man_getting_massage:","symbol":"💆‍♂️","group":"people","keywords":["face","man","man getting massage","massage"]},{"id":":woman_getting_massage:","symbol":"💆‍♀️","group":"people","keywords":["face","massage","woman","woman getting massage"]},{"id":":person_getting_haircut:","symbol":"💇","group":"people","keywords":["barber","beauty","haircut","parlor","person getting haircut"]},{"id":":man_getting_haircut:","symbol":"💇‍♂️","group":"people","keywords":["haircut","man","man getting haircut"]},{"id":":woman_getting_haircut:","symbol":"💇‍♀️","group":"people","keywords":["haircut","woman","woman getting haircut"]},{"id":":person_walking:","symbol":"🚶","group":"people","keywords":["hike","person walking","walk","walking"]},{"id":":man_walking:","symbol":"🚶‍♂️","group":"people","keywords":["hike","man","man walking","walk"]},{"id":":woman_walking:","symbol":"🚶‍♀️","group":"people","keywords":["hike","walk","woman","woman walking"]},{"id":":person_running:","symbol":"🏃","group":"people","keywords":["marathon","person running","running"]},{"id":":man_running:","symbol":"🏃‍♂️","group":"people","keywords":["man","marathon","racing","running"]},{"id":":woman_running:","symbol":"🏃‍♀️","group":"people","keywords":["marathon","racing","running","woman"]},{"id":":woman_dancing:","symbol":"💃","group":"people","keywords":["dancing","woman"]},{"id":":man_dancing:","symbol":"🕺","group":"people","keywords":["dance","man","man dancing"]},{"id":":people_with_bunny_ears:","symbol":"👯","group":"people","keywords":["bunny ear","dancer","partying","people with bunny ears"]},{"id":":men_with_bunny_ears:","symbol":"👯‍♂️","group":"people","keywords":["bunny ear","dancer","men","men with bunny ears","partying"]},{"id":":women_with_bunny_ears:","symbol":"👯‍♀️","group":"people","keywords":["bunny ear","dancer","partying","women","women with bunny ears"]},{"id":":person_in_steamy_room:","symbol":"🧖","group":"people","keywords":["person in steamy room","sauna","steam room",""]},{"id":":man_in_steamy_room:","symbol":"🧖‍♂️","group":"people","keywords":["man in steamy room","sauna","steam room"]},{"id":":woman_in_steamy_room:","symbol":"🧖‍♀️","group":"people","keywords":["sauna","steam room","woman in steamy room"]},{"id":":person_climbing:","symbol":"🧗","group":"people","keywords":["climber","person climbing"]},{"id":":man_climbing:","symbol":"🧗‍♂️","group":"people","keywords":["climber","man climbing"]},{"id":":woman_climbing:","symbol":"🧗‍♀️","group":"people","keywords":["climber","woman climbing"]},{"id":":person_in_lotus_position:","symbol":"🧘","group":"people","keywords":["meditation","person in lotus position","yoga",""]},{"id":":man_in_lotus_position:","symbol":"🧘‍♂️","group":"people","keywords":["man in lotus position","meditation","yoga"]},{"id":":woman_in_lotus_position:","symbol":"🧘‍♀️","group":"people","keywords":["meditation","woman in lotus position","yoga"]},{"id":":person_taking_bath:","symbol":"🛀","group":"people","keywords":["bath","bathtub","person taking bath"]},{"id":":person_in_bed:","symbol":"🛌","group":"people","keywords":["hotel","person in bed","sleep"]},{"id":":man_in_suit_levitating:","symbol":"🕴","group":"people","keywords":["business","man","man in suit levitating","suit"]},{"id":":speaking_head:","symbol":"🗣","group":"people","keywords":["face","head","silhouette","speak","speaking"]},{"id":":bust_in_silhouette:","symbol":"👤","group":"people","keywords":["bust","bust in silhouette","silhouette"]},{"id":":busts_in_silhouette:","symbol":"👥","group":"people","keywords":["bust","busts in silhouette","silhouette"]},{"id":":person_fencing:","symbol":"🤺","group":"people","keywords":["fencer","fencing","person fencing","sword"]},{"id":":horse_racing:","symbol":"🏇","group":"people","keywords":["horse","jockey","racehorse","racing"]},{"id":":skier:","symbol":"⛷","group":"people","keywords":["ski","skier","snow"]},{"id":":snowboarder:","symbol":"🏂","group":"people","keywords":["ski","snow","snowboard","snowboarder"]},{"id":":person_golfing:","symbol":"🏌","group":"people","keywords":["ball","golf","person golfing"]},{"id":":man_golfing:","symbol":"🏌️‍♂️","group":"people","keywords":["golf","man","man golfing"]},{"id":":woman_golfing:","symbol":"🏌️‍♀️","group":"people","keywords":["golf","woman","woman golfing"]},{"id":":person_surfing:","symbol":"🏄","group":"people","keywords":["person surfing","surfing"]},{"id":":man_surfing:","symbol":"🏄‍♂️","group":"people","keywords":["man","surfing"]},{"id":":woman_surfing:","symbol":"🏄‍♀️","group":"people","keywords":["surfing","woman"]},{"id":":person_rowing_boat:","symbol":"🚣","group":"people","keywords":["boat","person rowing boat","rowboat"]},{"id":":man_rowing_boat:","symbol":"🚣‍♂️","group":"people","keywords":["boat","man","man rowing boat","rowboat"]},{"id":":woman_rowing_boat:","symbol":"🚣‍♀️","group":"people","keywords":["boat","rowboat","woman","woman rowing boat"]},{"id":":person_swimming:","symbol":"🏊","group":"people","keywords":["person swimming","swim"]},{"id":":man_swimming:","symbol":"🏊‍♂️","group":"people","keywords":["man","man swimming","swim"]},{"id":":woman_swimming:","symbol":"🏊‍♀️","group":"people","keywords":["swim","woman","woman swimming"]},{"id":":person_bouncing_ball:","symbol":"⛹","group":"people","keywords":["ball","person bouncing ball"]},{"id":":man_bouncing_ball:","symbol":"⛹️‍♂️","group":"people","keywords":["ball","man","man bouncing ball"]},{"id":":woman_bouncing_ball:","symbol":"⛹️‍♀️","group":"people","keywords":["ball","woman","woman bouncing ball"]},{"id":":person_lifting_weights:","symbol":"🏋","group":"people","keywords":["lifter","person lifting weights","weight"]},{"id":":man_lifting_weights:","symbol":"🏋️‍♂️","group":"people","keywords":["man","man lifting weights","weight lifter"]},{"id":":woman_lifting_weights:","symbol":"🏋️‍♀️","group":"people","keywords":["weight lifter","woman","woman lifting weights"]},{"id":":person_biking:","symbol":"🚴","group":"people","keywords":["bicycle","biking","cyclist","person biking"]},{"id":":man_biking:","symbol":"🚴‍♂️","group":"people","keywords":["bicycle","biking","cyclist","man"]},{"id":":woman_biking:","symbol":"🚴‍♀️","group":"people","keywords":["bicycle","biking","cyclist","woman"]},{"id":":person_mountain_biking:","symbol":"🚵","group":"people","keywords":["bicycle","bicyclist","bike","cyclist","mountain","person mountain biking"]},{"id":":man_mountain_biking:","symbol":"🚵‍♂️","group":"people","keywords":["bicycle","bike","cyclist","man","man mountain biking","mountain"]},{"id":":woman_mountain_biking:","symbol":"🚵‍♀️","group":"people","keywords":["bicycle","bike","biking","cyclist","mountain","woman"]},{"id":":racing_car:","symbol":"🏎","group":"people","keywords":["car","racing"]},{"id":":motorcycle:","symbol":"🏍","group":"people","keywords":["motorcycle","racing"]},{"id":":person_cartwheeling:","symbol":"🤸","group":"people","keywords":["cartwheel","gymnastics","person cartwheeling"]},{"id":":man_cartwheeling:","symbol":"🤸‍♂️","group":"people","keywords":["cartwheel","gymnastics","man","man cartwheeling"]},{"id":":woman_cartwheeling:","symbol":"🤸‍♀️","group":"people","keywords":["cartwheel","gymnastics","woman","woman cartwheeling"]},{"id":":people_wrestling:","symbol":"🤼","group":"people","keywords":["people wrestling","wrestle","wrestler"]},{"id":":men_wrestling:","symbol":"🤼‍♂️","group":"people","keywords":["men","men wrestling","wrestle"]},{"id":":women_wrestling:","symbol":"🤼‍♀️","group":"people","keywords":["women","women wrestling","wrestle"]},{"id":":person_playing_water_polo:","symbol":"🤽","group":"people","keywords":["person playing water polo","polo","water"]},{"id":":man_playing_water_polo:","symbol":"🤽‍♂️","group":"people","keywords":["man","man playing water polo","water polo"]},{"id":":woman_playing_water_polo:","symbol":"🤽‍♀️","group":"people","keywords":["water polo","woman","woman playing water polo"]},{"id":":person_playing_handball:","symbol":"🤾","group":"people","keywords":["ball","handball","person playing handball"]},{"id":":man_playing_handball:","symbol":"🤾‍♂️","group":"people","keywords":["handball","man","man playing handball"]},{"id":":woman_playing_handball:","symbol":"🤾‍♀️","group":"people","keywords":["handball","woman","woman playing handball"]},{"id":":person_juggling:","symbol":"🤹","group":"people","keywords":["balance","juggle","multitask","person juggling","skill"]},{"id":":man_juggling:","symbol":"🤹‍♂️","group":"people","keywords":["juggling","man","multitask"]},{"id":":woman_juggling:","symbol":"🤹‍♀️","group":"people","keywords":["juggling","multitask","woman"]},{"id":":man_and_woman_holding_hands:","symbol":"👫","group":"people","keywords":["couple","hand","hold","man","man and woman holding hands","woman"]},{"id":":two_men_holding_hands:","symbol":"👬","group":"people","keywords":["couple","Gemini","man","twins","two men holding hands","zodiac"]},{"id":":two_women_holding_hands:","symbol":"👭","group":"people","keywords":["couple","hand","two women holding hands","woman"]},{"id":":kiss:","symbol":"💏","group":"people","keywords":["couple","kiss"]},{"id":":kiss_woman_man:","symbol":"👩‍❤️‍💋‍👨","group":"people","keywords":["couple","kiss","man","woman"]},{"id":":kiss_man_man:","symbol":"👨‍❤️‍💋‍👨","group":"people","keywords":["couple","kiss","man"]},{"id":":kiss_woman_woman:","symbol":"👩‍❤️‍💋‍👩","group":"people","keywords":["couple","kiss","woman"]},{"id":":couple_with_heart:","symbol":"💑","group":"people","keywords":["couple","couple with heart","love"]},{"id":":couple_with_heart_woman_man:","symbol":"👩‍❤️‍👨","group":"people","keywords":["couple","couple with heart","love","man","woman"]},{"id":":couple_with_heart_man_man:","symbol":"👨‍❤️‍👨","group":"people","keywords":["couple","couple with heart","love","man"]},{"id":":couple_with_heart_woman_woman:","symbol":"👩‍❤️‍👩","group":"people","keywords":["couple","couple with heart","love","woman"]},{"id":":family:","symbol":"👪","group":"people","keywords":["family"]},{"id":":family_man_woman_boy:","symbol":"👨‍👩‍👦","group":"people","keywords":["boy","family","man","woman"]},{"id":":family_man_woman_girl:","symbol":"👨‍👩‍👧","group":"people","keywords":["family","girl","man","woman"]},{"id":":family_man_woman_girl_boy:","symbol":"👨‍👩‍👧‍👦","group":"people","keywords":["boy","family","girl","man","woman"]},{"id":":family_man_woman_boy_boy:","symbol":"👨‍👩‍👦‍👦","group":"people","keywords":["boy","family","man","woman"]},{"id":":family_man_woman_girl_girl:","symbol":"👨‍👩‍👧‍👧","group":"people","keywords":["family","girl","man","woman"]},{"id":":family_man_man_boy:","symbol":"👨‍👨‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_man_girl:","symbol":"👨‍👨‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_man_man_girl_boy:","symbol":"👨‍👨‍👧‍👦","group":"people","keywords":["boy","family","girl","man"]},{"id":":family_man_man_boy_boy:","symbol":"👨‍👨‍👦‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_man_girl_girl:","symbol":"👨‍👨‍👧‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_woman_woman_boy:","symbol":"👩‍👩‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_woman_girl:","symbol":"👩‍👩‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_woman_woman_girl_boy:","symbol":"👩‍👩‍👧‍👦","group":"people","keywords":["boy","family","girl","woman"]},{"id":":family_woman_woman_boy_boy:","symbol":"👩‍👩‍👦‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_woman_girl_girl:","symbol":"👩‍👩‍👧‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_man_boy:","symbol":"👨‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_boy_boy:","symbol":"👨‍👦‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_girl:","symbol":"👨‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_man_girl_boy:","symbol":"👨‍👧‍👦","group":"people","keywords":["boy","family","girl","man"]},{"id":":family_man_girl_girl:","symbol":"👨‍👧‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_woman_boy:","symbol":"👩‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_boy_boy:","symbol":"👩‍👦‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_girl:","symbol":"👩‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_woman_girl_boy:","symbol":"👩‍👧‍👦","group":"people","keywords":["boy","family","girl","woman"]},{"id":":family_woman_girl_girl:","symbol":"👩‍👧‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":selfie:","symbol":"🤳","group":"people","keywords":["camera","phone","selfie"]},{"id":":flexed_biceps:","symbol":"💪","group":"people","keywords":["biceps","comic","flex","flexed biceps","muscle"]},{"id":":backhand_index_pointing_left:","symbol":"👈","group":"people","keywords":["backhand","backhand index pointing left","finger","hand","index","point"]},{"id":":backhand_index_pointing_right:","symbol":"👉","group":"people","keywords":["backhand","backhand index pointing right","finger","hand","index","point"]},{"id":":index_pointing_up:","symbol":"☝","group":"people","keywords":["finger","hand","index","index pointing up","point","up"]},{"id":":backhand_index_pointing_up:","symbol":"👆","group":"people","keywords":["backhand","backhand index pointing up","finger","hand","point","up"]},{"id":":middle_finger:","symbol":"🖕","group":"people","keywords":["finger","hand","middle finger"]},{"id":":backhand_index_pointing_down:","symbol":"👇","group":"people","keywords":["backhand","backhand index pointing down","down","finger","hand","point"]},{"id":":victory_hand:","symbol":"✌","group":"people","keywords":["hand","v","victory"]},{"id":":crossed_fingers:","symbol":"🤞","group":"people","keywords":["cross","crossed fingers","finger","hand","luck"]},{"id":":vulcan_salute:","symbol":"🖖","group":"people","keywords":["finger","hand","spock","vulcan","vulcan salute"]},{"id":":sign_of_the_horns:","symbol":"🤘","group":"people","keywords":["finger","hand","horns","rock-on","sign of the horns"]},{"id":":call_me_hand:","symbol":"🤙","group":"people","keywords":["call","call me hand","hand"]},{"id":":hand_with_fingers_splayed:","symbol":"🖐","group":"people","keywords":["finger","hand","hand with fingers splayed","splayed"]},{"id":":raised_hand:","symbol":"✋","group":"people","keywords":["hand","raised hand"]},{"id":":ok_hand:","symbol":"👌","group":"people","keywords":["hand","OK"]},{"id":":thumbs_up:","symbol":"👍","group":"people","keywords":["+1","hand","thumb","thumbs up","up"]},{"id":":thumbs_down:","symbol":"👎","group":"people","keywords":["-1","down","hand","thumb","thumbs down"]},{"id":":raised_fist:","symbol":"✊","group":"people","keywords":["clenched","fist","hand","punch","raised fist"]},{"id":":oncoming_fist:","symbol":"👊","group":"people","keywords":["clenched","fist","hand","oncoming fist","punch"]},{"id":":left-facing_fist:","symbol":"🤛","group":"people","keywords":["fist","left-facing fist","leftwards"]},{"id":":right-facing_fist:","symbol":"🤜","group":"people","keywords":["fist","right-facing fist","rightwards"]},{"id":":raised_back_of_hand:","symbol":"🤚","group":"people","keywords":["backhand","raised","raised back of hand"]},{"id":":waving_hand:","symbol":"👋","group":"people","keywords":["hand","wave","waving"]},{"id":":love-you_gesture:","symbol":"🤟","group":"people","keywords":["hand","ILY","love-you gesture"]},{"id":":writing_hand:","symbol":"✍","group":"people","keywords":["hand","write","writing hand"]},{"id":":clapping_hands:","symbol":"👏","group":"people","keywords":["clap","clapping hands","hand"]},{"id":":open_hands:","symbol":"👐","group":"people","keywords":["hand","open","open hands"]},{"id":":raising_hands:","symbol":"🙌","group":"people","keywords":["celebration","gesture","hand","hooray","raised","raising hands"]},{"id":":palms_up_together:","symbol":"🤲","group":"people","keywords":["palms up together","prayer",""]},{"id":":folded_hands:","symbol":"🙏","group":"people","keywords":["ask","folded hands","hand","please","pray","thanks"]},{"id":":handshake:","symbol":"🤝","group":"people","keywords":["agreement","hand","handshake","meeting","shake"]},{"id":":nail_polish:","symbol":"💅","group":"people","keywords":["care","cosmetics","manicure","nail","polish"]},{"id":":ear:","symbol":"👂","group":"people","keywords":["body","ear"]},{"id":":nose:","symbol":"👃","group":"people","keywords":["body","nose"]},{"id":":footprints:","symbol":"👣","group":"people","keywords":["clothing","footprint","footprints","print"]},{"id":":eyes:","symbol":"👀","group":"people","keywords":["eye","eyes","face"]},{"id":":eye:","symbol":"👁","group":"people","keywords":["body","eye"]},{"id":":eye_in_speech_bubble:","symbol":"👁️‍🗨️","group":"people","keywords":["eye","eye in speech bubble","speech bubble","witness"]},{"id":":brain:","symbol":"🧠","group":"people","keywords":["brain","intelligent"]},{"id":":tongue:","symbol":"👅","group":"people","keywords":["body","tongue"]},{"id":":mouth:","symbol":"👄","group":"people","keywords":["lips","mouth"]},{"id":":kiss_mark:","symbol":"💋","group":"people","keywords":["kiss","kiss mark","lips"]},{"id":":heart_with_arrow:","symbol":"💘","group":"people","keywords":["arrow","cupid","heart with arrow"]},{"id":":heart_with_ribbon:","symbol":"💝","group":"people","keywords":["heart with ribbon","ribbon","valentine"]},{"id":":sparkling_heart:","symbol":"💖","group":"people","keywords":["excited","sparkle","sparkling heart"]},{"id":":growing_heart:","symbol":"💗","group":"people","keywords":["excited","growing","growing heart","nervous","pulse"]},{"id":":beating_heart:","symbol":"💓","group":"people","keywords":["beating","beating heart","heartbeat","pulsating"]},{"id":":revolving_hearts:","symbol":"💞","group":"people","keywords":["revolving","revolving hearts"]},{"id":":two_hearts:","symbol":"💕","group":"people","keywords":["love","two hearts"]},{"id":":love_letter:","symbol":"💌","group":"people","keywords":["heart","letter","love","mail"]},{"id":":heavy_heart_exclamation:","symbol":"❣","group":"people","keywords":["exclamation","heavy heart exclamation","mark","punctuation"]},{"id":":broken_heart:","symbol":"💔","group":"people","keywords":["break","broken","broken heart"]},{"id":":red_heart:","symbol":"❤","group":"people","keywords":["heart","red heart"]},{"id":":orange_heart:","symbol":"🧡","group":"people","keywords":["orange","orange heart"]},{"id":":yellow_heart:","symbol":"💛","group":"people","keywords":["yellow","yellow heart"]},{"id":":green_heart:","symbol":"💚","group":"people","keywords":["green","green heart"]},{"id":":blue_heart:","symbol":"💙","group":"people","keywords":["blue","blue heart"]},{"id":":purple_heart:","symbol":"💜","group":"people","keywords":["purple","purple heart"]},{"id":":black_heart:","symbol":"🖤","group":"people","keywords":["black","black heart","evil","wicked"]},{"id":":heart_decoration:","symbol":"💟","group":"people","keywords":["heart","heart decoration"]},{"id":":zzz:","symbol":"💤","group":"people","keywords":["comic","sleep","zzz"]},{"id":":anger_symbol:","symbol":"💢","group":"people","keywords":["anger symbol","angry","comic","mad"]},{"id":":bomb:","symbol":"💣","group":"people","keywords":["bomb","comic"]},{"id":":collision:","symbol":"💥","group":"people","keywords":["boom","collision","comic"]},{"id":":sweat_droplets:","symbol":"💦","group":"people","keywords":["comic","splashing","sweat","sweat droplets"]},{"id":":dashing_away:","symbol":"💨","group":"people","keywords":["comic","dash","dashing away","running"]},{"id":":dizzy:","symbol":"💫","group":"people","keywords":["comic","dizzy","star"]},{"id":":speech_balloon:","symbol":"💬","group":"people","keywords":["balloon","bubble","comic","dialog","speech"]},{"id":":left_speech_bubble:","symbol":"🗨","group":"people","keywords":["dialog","left speech bubble","speech"]},{"id":":right_anger_bubble:","symbol":"🗯","group":"people","keywords":["angry","balloon","bubble","mad","right anger bubble"]},{"id":":thought_balloon:","symbol":"💭","group":"people","keywords":["balloon","bubble","comic","thought"]},{"id":":hole:","symbol":"🕳","group":"people","keywords":["hole"]},{"id":":glasses:","symbol":"👓","group":"people","keywords":["clothing","eye","eyeglasses","eyewear","glasses"]},{"id":":sunglasses:","symbol":"🕶","group":"people","keywords":["dark","eye","eyewear","glasses","sunglasses"]},{"id":":necktie:","symbol":"👔","group":"people","keywords":["clothing","necktie","tie"]},{"id":":t-shirt:","symbol":"👕","group":"people","keywords":["clothing","shirt","t-shirt","tshirt"]},{"id":":jeans:","symbol":"👖","group":"people","keywords":["clothing","jeans","pants","trousers"]},{"id":":scarf:","symbol":"🧣","group":"people","keywords":["neck","scarf"]},{"id":":gloves:","symbol":"🧤","group":"people","keywords":["gloves","hand"]},{"id":":coat:","symbol":"🧥","group":"people","keywords":["coat","jacket"]},{"id":":socks:","symbol":"🧦","group":"people","keywords":["socks","stocking"]},{"id":":dress:","symbol":"👗","group":"people","keywords":["clothing","dress"]},{"id":":kimono:","symbol":"👘","group":"people","keywords":["clothing","kimono"]},{"id":":bikini:","symbol":"👙","group":"people","keywords":["bikini","clothing","swim"]},{"id":":woman’s_clothes:","symbol":"👚","group":"people","keywords":["clothing","woman","woman’s clothes"]},{"id":":purse:","symbol":"👛","group":"people","keywords":["clothing","coin","purse"]},{"id":":handbag:","symbol":"👜","group":"people","keywords":["bag","clothing","handbag","purse"]},{"id":":clutch_bag:","symbol":"👝","group":"people","keywords":["bag","clothing","clutch bag","pouch"]},{"id":":shopping_bags:","symbol":"🛍","group":"people","keywords":["bag","hotel","shopping","shopping bags"]},{"id":":backpack:","symbol":"🎒","group":"people","keywords":["backpack","bag","rucksack","satchel","school"]},{"id":":man’s_shoe:","symbol":"👞","group":"people","keywords":["clothing","man","man’s shoe","shoe"]},{"id":":running_shoe:","symbol":"👟","group":"people","keywords":["athletic","clothing","running shoe","shoe","sneaker"]},{"id":":high-heeled_shoe:","symbol":"👠","group":"people","keywords":["clothing","heel","high-heeled shoe","shoe","woman"]},{"id":":woman’s_sandal:","symbol":"👡","group":"people","keywords":["clothing","sandal","shoe","woman","woman’s sandal"]},{"id":":woman’s_boot:","symbol":"👢","group":"people","keywords":["boot","clothing","shoe","woman","woman’s boot"]},{"id":":crown:","symbol":"👑","group":"people","keywords":["clothing","crown","king","queen"]},{"id":":woman’s_hat:","symbol":"👒","group":"people","keywords":["clothing","hat","woman","woman’s hat"]},{"id":":top_hat:","symbol":"🎩","group":"people","keywords":["clothing","hat","top","tophat"]},{"id":":graduation_cap:","symbol":"🎓","group":"people","keywords":["cap","celebration","clothing","graduation","hat"]},{"id":":billed_cap:","symbol":"🧢","group":"people","keywords":["baseball cap","billed cap"]},{"id":":rescue_worker’s_helmet:","symbol":"⛑","group":"people","keywords":["aid","cross","face","hat","helmet","rescue worker’s helmet"]},{"id":":prayer_beads:","symbol":"📿","group":"people","keywords":["beads","clothing","necklace","prayer","religion"]},{"id":":lipstick:","symbol":"💄","group":"people","keywords":["cosmetics","lipstick","makeup"]},{"id":":ring:","symbol":"💍","group":"people","keywords":["diamond","ring"]},{"id":":gem_stone:","symbol":"💎","group":"people","keywords":["diamond","gem","gem stone","jewel"]},{"id":":monkey_face:","symbol":"🐵","group":"nature","keywords":["face","monkey"]},{"id":":monkey:","symbol":"🐒","group":"nature","keywords":["monkey"]},{"id":":gorilla:","symbol":"🦍","group":"nature","keywords":["gorilla"]},{"id":":dog_face:","symbol":"🐶","group":"nature","keywords":["dog","face","pet"]},{"id":":dog:","symbol":"🐕","group":"nature","keywords":["dog","pet"]},{"id":":poodle:","symbol":"🐩","group":"nature","keywords":["dog","poodle"]},{"id":":wolf_face:","symbol":"🐺","group":"nature","keywords":["face","wolf"]},{"id":":fox_face:","symbol":"🦊","group":"nature","keywords":["face","fox"]},{"id":":cat_face:","symbol":"🐱","group":"nature","keywords":["cat","face","pet"]},{"id":":cat:","symbol":"🐈","group":"nature","keywords":["cat","pet"]},{"id":":lion_face:","symbol":"🦁","group":"nature","keywords":["face","Leo","lion","zodiac"]},{"id":":tiger_face:","symbol":"🐯","group":"nature","keywords":["face","tiger"]},{"id":":tiger:","symbol":"🐅","group":"nature","keywords":["tiger"]},{"id":":leopard:","symbol":"🐆","group":"nature","keywords":["leopard"]},{"id":":horse_face:","symbol":"🐴","group":"nature","keywords":["face","horse"]},{"id":":horse:","symbol":"🐎","group":"nature","keywords":["equestrian","horse","racehorse","racing"]},{"id":":unicorn_face:","symbol":"🦄","group":"nature","keywords":["face","unicorn"]},{"id":":zebra:","symbol":"🦓","group":"nature","keywords":["stripe","zebra"]},{"id":":deer:","symbol":"🦌","group":"nature","keywords":["deer"]},{"id":":cow_face:","symbol":"🐮","group":"nature","keywords":["cow","face"]},{"id":":ox:","symbol":"🐂","group":"nature","keywords":["bull","ox","Taurus","zodiac"]},{"id":":water_buffalo:","symbol":"🐃","group":"nature","keywords":["buffalo","water"]},{"id":":cow:","symbol":"🐄","group":"nature","keywords":["cow"]},{"id":":pig_face:","symbol":"🐷","group":"nature","keywords":["face","pig"]},{"id":":pig:","symbol":"🐖","group":"nature","keywords":["pig","sow"]},{"id":":boar:","symbol":"🐗","group":"nature","keywords":["boar","pig"]},{"id":":pig_nose:","symbol":"🐽","group":"nature","keywords":["face","nose","pig"]},{"id":":ram:","symbol":"🐏","group":"nature","keywords":["Aries","male","ram","sheep","zodiac"]},{"id":":ewe:","symbol":"🐑","group":"nature","keywords":["ewe","female","sheep"]},{"id":":goat:","symbol":"🐐","group":"nature","keywords":["Capricorn","goat","zodiac"]},{"id":":camel:","symbol":"🐪","group":"nature","keywords":["camel","dromedary","hump"]},{"id":":two-hump_camel:","symbol":"🐫","group":"nature","keywords":["bactrian","camel","hump","two-hump camel"]},{"id":":giraffe:","symbol":"🦒","group":"nature","keywords":["giraffe","spots"]},{"id":":elephant:","symbol":"🐘","group":"nature","keywords":["elephant"]},{"id":":rhinoceros:","symbol":"🦏","group":"nature","keywords":["rhinoceros"]},{"id":":mouse_face:","symbol":"🐭","group":"nature","keywords":["face","mouse"]},{"id":":mouse:","symbol":"🐁","group":"nature","keywords":["mouse"]},{"id":":rat:","symbol":"🐀","group":"nature","keywords":["rat"]},{"id":":hamster_face:","symbol":"🐹","group":"nature","keywords":["face","hamster","pet"]},{"id":":rabbit_face:","symbol":"🐰","group":"nature","keywords":["bunny","face","pet","rabbit"]},{"id":":rabbit:","symbol":"🐇","group":"nature","keywords":["bunny","pet","rabbit"]},{"id":":chipmunk:","symbol":"🐿","group":"nature","keywords":["chipmunk","squirrel"]},{"id":":hedgehog:","symbol":"🦔","group":"nature","keywords":["hedgehog","spiny"]},{"id":":bat:","symbol":"🦇","group":"nature","keywords":["bat","vampire"]},{"id":":bear_face:","symbol":"🐻","group":"nature","keywords":["bear","face"]},{"id":":koala:","symbol":"🐨","group":"nature","keywords":["bear","koala"]},{"id":":panda_face:","symbol":"🐼","group":"nature","keywords":["face","panda"]},{"id":":paw_prints:","symbol":"🐾","group":"nature","keywords":["feet","paw","paw prints","print"]},{"id":":turkey:","symbol":"🦃","group":"nature","keywords":["bird","turkey"]},{"id":":chicken:","symbol":"🐔","group":"nature","keywords":["bird","chicken"]},{"id":":rooster:","symbol":"🐓","group":"nature","keywords":["bird","rooster"]},{"id":":hatching_chick:","symbol":"🐣","group":"nature","keywords":["baby","bird","chick","hatching"]},{"id":":baby_chick:","symbol":"🐤","group":"nature","keywords":["baby","bird","chick"]},{"id":":front-facing_baby_chick:","symbol":"🐥","group":"nature","keywords":["baby","bird","chick","front-facing baby chick"]},{"id":":bird:","symbol":"🐦","group":"nature","keywords":["bird"]},{"id":":penguin:","symbol":"🐧","group":"nature","keywords":["bird","penguin"]},{"id":":dove:","symbol":"🕊","group":"nature","keywords":["bird","dove","fly","peace"]},{"id":":eagle:","symbol":"🦅","group":"nature","keywords":["bird","eagle"]},{"id":":duck:","symbol":"🦆","group":"nature","keywords":["bird","duck"]},{"id":":owl:","symbol":"🦉","group":"nature","keywords":["bird","owl","wise"]},{"id":":frog_face:","symbol":"🐸","group":"nature","keywords":["face","frog"]},{"id":":crocodile:","symbol":"🐊","group":"nature","keywords":["crocodile"]},{"id":":turtle:","symbol":"🐢","group":"nature","keywords":["terrapin","tortoise","turtle"]},{"id":":lizard:","symbol":"🦎","group":"nature","keywords":["lizard","reptile"]},{"id":":snake:","symbol":"🐍","group":"nature","keywords":["bearer","Ophiuchus","serpent","snake","zodiac"]},{"id":":dragon_face:","symbol":"🐲","group":"nature","keywords":["dragon","face","fairy tale"]},{"id":":dragon:","symbol":"🐉","group":"nature","keywords":["dragon","fairy tale"]},{"id":":sauropod:","symbol":"🦕","group":"nature","keywords":["brachiosaurus","brontosaurus","diplodocus","sauropod"]},{"id":":t-rex:","symbol":"🦖","group":"nature","keywords":["T-Rex","Tyrannosaurus Rex"]},{"id":":spouting_whale:","symbol":"🐳","group":"nature","keywords":["face","spouting","whale"]},{"id":":whale:","symbol":"🐋","group":"nature","keywords":["whale"]},{"id":":dolphin:","symbol":"🐬","group":"nature","keywords":["dolphin","flipper"]},{"id":":fish:","symbol":"🐟","group":"nature","keywords":["fish","Pisces","zodiac"]},{"id":":tropical_fish:","symbol":"🐠","group":"nature","keywords":["fish","tropical"]},{"id":":blowfish:","symbol":"🐡","group":"nature","keywords":["blowfish","fish"]},{"id":":shark:","symbol":"🦈","group":"nature","keywords":["fish","shark"]},{"id":":octopus:","symbol":"🐙","group":"nature","keywords":["octopus"]},{"id":":spiral_shell:","symbol":"🐚","group":"nature","keywords":["shell","spiral"]},{"id":":crab:","symbol":"🦀","group":"nature","keywords":["Cancer","crab","zodiac"]},{"id":":shrimp:","symbol":"🦐","group":"nature","keywords":["food","shellfish","shrimp","small"]},{"id":":squid:","symbol":"🦑","group":"nature","keywords":["food","molusc","squid"]},{"id":":snail:","symbol":"🐌","group":"nature","keywords":["snail"]},{"id":":butterfly:","symbol":"🦋","group":"nature","keywords":["butterfly","insect","pretty"]},{"id":":bug:","symbol":"🐛","group":"nature","keywords":["bug","insect"]},{"id":":ant:","symbol":"🐜","group":"nature","keywords":["ant","insect"]},{"id":":honeybee:","symbol":"🐝","group":"nature","keywords":["bee","honeybee","insect"]},{"id":":lady_beetle:","symbol":"🐞","group":"nature","keywords":["beetle","insect","lady beetle","ladybird","ladybug"]},{"id":":cricket:","symbol":"🦗","group":"nature","keywords":["cricket","grasshopper",""]},{"id":":spider:","symbol":"🕷","group":"nature","keywords":["insect","spider"]},{"id":":spider_web:","symbol":"🕸","group":"nature","keywords":["spider","web"]},{"id":":scorpion:","symbol":"🦂","group":"nature","keywords":["scorpio","Scorpio","scorpion","zodiac"]},{"id":":bouquet:","symbol":"💐","group":"nature","keywords":["bouquet","flower"]},{"id":":cherry_blossom:","symbol":"🌸","group":"nature","keywords":["blossom","cherry","flower"]},{"id":":white_flower:","symbol":"💮","group":"nature","keywords":["flower","white flower"]},{"id":":rosette:","symbol":"🏵","group":"nature","keywords":["plant","rosette"]},{"id":":rose:","symbol":"🌹","group":"nature","keywords":["flower","rose"]},{"id":":wilted_flower:","symbol":"🥀","group":"nature","keywords":["flower","wilted"]},{"id":":hibiscus:","symbol":"🌺","group":"nature","keywords":["flower","hibiscus"]},{"id":":sunflower:","symbol":"🌻","group":"nature","keywords":["flower","sun","sunflower"]},{"id":":blossom:","symbol":"🌼","group":"nature","keywords":["blossom","flower"]},{"id":":tulip:","symbol":"🌷","group":"nature","keywords":["flower","tulip"]},{"id":":seedling:","symbol":"🌱","group":"nature","keywords":["seedling","young"]},{"id":":evergreen_tree:","symbol":"🌲","group":"nature","keywords":["evergreen tree","tree"]},{"id":":deciduous_tree:","symbol":"🌳","group":"nature","keywords":["deciduous","shedding","tree"]},{"id":":palm_tree:","symbol":"🌴","group":"nature","keywords":["palm","tree"]},{"id":":cactus:","symbol":"🌵","group":"nature","keywords":["cactus","plant"]},{"id":":sheaf_of_rice:","symbol":"🌾","group":"nature","keywords":["ear","grain","rice","sheaf of rice"]},{"id":":herb:","symbol":"🌿","group":"nature","keywords":["herb","leaf"]},{"id":":shamrock:","symbol":"☘","group":"nature","keywords":["plant","shamrock"]},{"id":":four_leaf_clover:","symbol":"🍀","group":"nature","keywords":["4","clover","four","four-leaf clover","leaf"]},{"id":":maple_leaf:","symbol":"🍁","group":"nature","keywords":["falling","leaf","maple"]},{"id":":fallen_leaf:","symbol":"🍂","group":"nature","keywords":["fallen leaf","falling","leaf"]},{"id":":leaf_fluttering_in_wind:","symbol":"🍃","group":"nature","keywords":["blow","flutter","leaf","leaf fluttering in wind","wind"]},{"id":":grapes:","symbol":"🍇","group":"food","keywords":["fruit","grape","grapes"]},{"id":":melon:","symbol":"🍈","group":"food","keywords":["fruit","melon"]},{"id":":watermelon:","symbol":"🍉","group":"food","keywords":["fruit","watermelon"]},{"id":":tangerine:","symbol":"🍊","group":"food","keywords":["fruit","orange","tangerine"]},{"id":":lemon:","symbol":"🍋","group":"food","keywords":["citrus","fruit","lemon"]},{"id":":banana:","symbol":"🍌","group":"food","keywords":["banana","fruit"]},{"id":":pineapple:","symbol":"🍍","group":"food","keywords":["fruit","pineapple"]},{"id":":red_apple:","symbol":"🍎","group":"food","keywords":["apple","fruit","red"]},{"id":":green_apple:","symbol":"🍏","group":"food","keywords":["apple","fruit","green"]},{"id":":pear:","symbol":"🍐","group":"food","keywords":["fruit","pear"]},{"id":":peach:","symbol":"🍑","group":"food","keywords":["fruit","peach"]},{"id":":cherries:","symbol":"🍒","group":"food","keywords":["berries","cherries","cherry","fruit","red"]},{"id":":strawberry:","symbol":"🍓","group":"food","keywords":["berry","fruit","strawberry"]},{"id":":kiwi_fruit:","symbol":"🥝","group":"food","keywords":["food","fruit","kiwi"]},{"id":":tomato:","symbol":"🍅","group":"food","keywords":["fruit","tomato","vegetable"]},{"id":":coconut:","symbol":"🥥","group":"food","keywords":["coconut","palm","piña colada"]},{"id":":avocado:","symbol":"🥑","group":"food","keywords":["avocado","food","fruit"]},{"id":":eggplant:","symbol":"🍆","group":"food","keywords":["aubergine","eggplant","vegetable"]},{"id":":potato:","symbol":"🥔","group":"food","keywords":["food","potato","vegetable"]},{"id":":carrot:","symbol":"🥕","group":"food","keywords":["carrot","food","vegetable"]},{"id":":ear_of_corn:","symbol":"🌽","group":"food","keywords":["corn","ear","ear of corn","maize","maze"]},{"id":":hot_pepper:","symbol":"🌶","group":"food","keywords":["hot","pepper"]},{"id":":cucumber:","symbol":"🥒","group":"food","keywords":["cucumber","food","pickle","vegetable"]},{"id":":broccoli:","symbol":"🥦","group":"food","keywords":["broccoli","wild cabbage"]},{"id":":mushroom:","symbol":"🍄","group":"food","keywords":["mushroom","toadstool"]},{"id":":peanuts:","symbol":"🥜","group":"food","keywords":["food","nut","peanut","peanuts","vegetable"]},{"id":":chestnut:","symbol":"🌰","group":"food","keywords":["chestnut","plant"]},{"id":":bread:","symbol":"🍞","group":"food","keywords":["bread","loaf"]},{"id":":croissant:","symbol":"🥐","group":"food","keywords":["bread","crescent roll","croissant","food","french"]},{"id":":baguette_bread:","symbol":"🥖","group":"food","keywords":["baguette","bread","food","french"]},{"id":":pretzel:","symbol":"🥨","group":"food","keywords":["pretzel","twisted",""]},{"id":":pancakes:","symbol":"🥞","group":"food","keywords":["crêpe","food","hotcake","pancake","pancakes"]},{"id":":cheese_wedge:","symbol":"🧀","group":"food","keywords":["cheese","cheese wedge"]},{"id":":meat_on_bone:","symbol":"🍖","group":"food","keywords":["bone","meat","meat on bone"]},{"id":":poultry_leg:","symbol":"🍗","group":"food","keywords":["bone","chicken","drumstick","leg","poultry"]},{"id":":cut_of_meat:","symbol":"🥩","group":"food","keywords":["chop","cut of meat","lambchop","porkchop","steak"]},{"id":":bacon:","symbol":"🥓","group":"food","keywords":["bacon","food","meat"]},{"id":":hamburger:","symbol":"🍔","group":"food","keywords":["burger","hamburger"]},{"id":":french_fries:","symbol":"🍟","group":"food","keywords":["french","fries"]},{"id":":pizza:","symbol":"🍕","group":"food","keywords":["cheese","pizza","slice"]},{"id":":hot_dog:","symbol":"🌭","group":"food","keywords":["frankfurter","hot dog","hotdog","sausage"]},{"id":":sandwich:","symbol":"🥪","group":"food","keywords":["bread","sandwich"]},{"id":":taco:","symbol":"🌮","group":"food","keywords":["mexican","taco"]},{"id":":burrito:","symbol":"🌯","group":"food","keywords":["burrito","mexican","wrap"]},{"id":":stuffed_flatbread:","symbol":"🥙","group":"food","keywords":["falafel","flatbread","food","gyro","kebab","stuffed"]},{"id":":egg:","symbol":"🥚","group":"food","keywords":["egg","food"]},{"id":":cooking:","symbol":"🍳","group":"food","keywords":["cooking","egg","frying","pan"]},{"id":":shallow_pan_of_food:","symbol":"🥘","group":"food","keywords":["casserole","food","paella","pan","shallow","shallow pan of food"]},{"id":":pot_of_food:","symbol":"🍲","group":"food","keywords":["pot","pot of food","stew"]},{"id":":bowl_with_spoon:","symbol":"🥣","group":"food","keywords":["bowl with spoon","breakfast","cereal","congee",""]},{"id":":green_salad:","symbol":"🥗","group":"food","keywords":["food","green","salad"]},{"id":":popcorn:","symbol":"🍿","group":"food","keywords":["popcorn"]},{"id":":canned_food:","symbol":"🥫","group":"food","keywords":["can","canned food"]},{"id":":bento_box:","symbol":"🍱","group":"food","keywords":["bento","box"]},{"id":":rice_cracker:","symbol":"🍘","group":"food","keywords":["cracker","rice"]},{"id":":rice_ball:","symbol":"🍙","group":"food","keywords":["ball","Japanese","rice"]},{"id":":cooked_rice:","symbol":"🍚","group":"food","keywords":["cooked","rice"]},{"id":":curry_rice:","symbol":"🍛","group":"food","keywords":["curry","rice"]},{"id":":steaming_bowl:","symbol":"🍜","group":"food","keywords":["bowl","noodle","ramen","steaming"]},{"id":":spaghetti:","symbol":"🍝","group":"food","keywords":["pasta","spaghetti"]},{"id":":roasted_sweet_potato:","symbol":"🍠","group":"food","keywords":["potato","roasted","sweet"]},{"id":":oden:","symbol":"🍢","group":"food","keywords":["kebab","oden","seafood","skewer","stick"]},{"id":":sushi:","symbol":"🍣","group":"food","keywords":["sushi"]},{"id":":fried_shrimp:","symbol":"🍤","group":"food","keywords":["fried","prawn","shrimp","tempura"]},{"id":":fish_cake_with_swirl:","symbol":"🍥","group":"food","keywords":["cake","fish","fish cake with swirl","pastry","swirl"]},{"id":":dango:","symbol":"🍡","group":"food","keywords":["dango","dessert","Japanese","skewer","stick","sweet"]},{"id":":dumpling:","symbol":"🥟","group":"food","keywords":["dumpling","empanada","gyōza","jiaozi","pierogi","potsticker"]},{"id":":fortune_cookie:","symbol":"🥠","group":"food","keywords":["fortune cookie","prophecy"]},{"id":":takeout_box:","symbol":"🥡","group":"food","keywords":["oyster pail","takeout box"]},{"id":":soft_ice_cream:","symbol":"🍦","group":"food","keywords":["cream","dessert","ice","icecream","soft","sweet"]},{"id":":shaved_ice:","symbol":"🍧","group":"food","keywords":["dessert","ice","shaved","sweet"]},{"id":":ice_cream:","symbol":"🍨","group":"food","keywords":["cream","dessert","ice","sweet"]},{"id":":doughnut:","symbol":"🍩","group":"food","keywords":["dessert","donut","doughnut","sweet"]},{"id":":cookie:","symbol":"🍪","group":"food","keywords":["cookie","dessert","sweet"]},{"id":":birthday_cake:","symbol":"🎂","group":"food","keywords":["birthday","cake","celebration","dessert","pastry","sweet"]},{"id":":shortcake:","symbol":"🍰","group":"food","keywords":["cake","dessert","pastry","shortcake","slice","sweet"]},{"id":":pie:","symbol":"🥧","group":"food","keywords":["filling","pastry","pie",""]},{"id":":chocolate_bar:","symbol":"🍫","group":"food","keywords":["bar","chocolate","dessert","sweet"]},{"id":":candy:","symbol":"🍬","group":"food","keywords":["candy","dessert","sweet"]},{"id":":lollipop:","symbol":"🍭","group":"food","keywords":["candy","dessert","lollipop","sweet"]},{"id":":custard:","symbol":"🍮","group":"food","keywords":["custard","dessert","pudding","sweet"]},{"id":":honey_pot:","symbol":"🍯","group":"food","keywords":["honey","honeypot","pot","sweet"]},{"id":":baby_bottle:","symbol":"🍼","group":"food","keywords":["baby","bottle","drink","milk"]},{"id":":glass_of_milk:","symbol":"🥛","group":"food","keywords":["drink","glass","glass of milk","milk"]},{"id":":hot_beverage:","symbol":"☕","group":"food","keywords":["beverage","coffee","drink","hot","steaming","tea"]},{"id":":teacup_without_handle:","symbol":"🍵","group":"food","keywords":["beverage","cup","drink","tea","teacup","teacup without handle"]},{"id":":sake:","symbol":"🍶","group":"food","keywords":["bar","beverage","bottle","cup","drink","sake"]},{"id":":bottle_with_popping_cork:","symbol":"🍾","group":"food","keywords":["bar","bottle","bottle with popping cork","cork","drink","popping"]},{"id":":wine_glass:","symbol":"🍷","group":"food","keywords":["bar","beverage","drink","glass","wine"]},{"id":":cocktail_glass:","symbol":"🍸","group":"food","keywords":["bar","cocktail","drink","glass"]},{"id":":tropical_drink:","symbol":"🍹","group":"food","keywords":["bar","drink","tropical"]},{"id":":beer_mug:","symbol":"🍺","group":"food","keywords":["bar","beer","drink","mug"]},{"id":":clinking_beer_mugs:","symbol":"🍻","group":"food","keywords":["bar","beer","clink","clinking beer mugs","drink","mug"]},{"id":":clinking_glasses:","symbol":"🥂","group":"food","keywords":["celebrate","clink","clinking glasses","drink","glass"]},{"id":":tumbler_glass:","symbol":"🥃","group":"food","keywords":["glass","liquor","shot","tumbler","whisky"]},{"id":":cup_with_straw:","symbol":"🥤","group":"food","keywords":["cup with straw","juice","soda",""]},{"id":":chopsticks:","symbol":"🥢","group":"food","keywords":["chopsticks","hashi",""]},{"id":":fork_and_knife_with_plate:","symbol":"🍽","group":"food","keywords":["cooking","fork","fork and knife with plate","knife","plate"]},{"id":":fork_and_knife:","symbol":"🍴","group":"food","keywords":["cooking","cutlery","fork","fork and knife","knife"]},{"id":":spoon:","symbol":"🥄","group":"food","keywords":["spoon","tableware"]},{"id":":kitchen_knife:","symbol":"🔪","group":"food","keywords":["cooking","hocho","kitchen knife","knife","tool","weapon"]},{"id":":amphora:","symbol":"🏺","group":"food","keywords":["amphora","Aquarius","cooking","drink","jug","zodiac"]},{"id":":globe_showing_europe-africa:","symbol":"🌍","group":"travel","keywords":["Africa","earth","Europe","globe","globe showing Europe-Africa","world"]},{"id":":globe_showing_americas:","symbol":"🌎","group":"travel","keywords":["Americas","earth","globe","globe showing Americas","world"]},{"id":":globe_showing_asia-australia:","symbol":"🌏","group":"travel","keywords":["Asia","Australia","earth","globe","globe showing Asia-Australia","world"]},{"id":":globe_with_meridians:","symbol":"🌐","group":"travel","keywords":["earth","globe","globe with meridians","meridians","world"]},{"id":":world_map:","symbol":"🗺","group":"travel","keywords":["map","world"]},{"id":":map_of_japan:","symbol":"🗾","group":"travel","keywords":["Japan","map","map of Japan"]},{"id":":snow-capped_mountain:","symbol":"🏔","group":"travel","keywords":["cold","mountain","snow","snow-capped mountain"]},{"id":":mountain:","symbol":"⛰","group":"travel","keywords":["mountain"]},{"id":":volcano:","symbol":"🌋","group":"travel","keywords":["eruption","mountain","volcano"]},{"id":":mount_fuji:","symbol":"🗻","group":"travel","keywords":["fuji","mount fuji","mountain"]},{"id":":camping:","symbol":"🏕","group":"travel","keywords":["camping"]},{"id":":beach_with_umbrella:","symbol":"🏖","group":"travel","keywords":["beach","beach with umbrella","umbrella"]},{"id":":desert:","symbol":"🏜","group":"travel","keywords":["desert"]},{"id":":desert_island:","symbol":"🏝","group":"travel","keywords":["desert","island"]},{"id":":national_park:","symbol":"🏞","group":"travel","keywords":["national park","park"]},{"id":":stadium:","symbol":"🏟","group":"travel","keywords":["stadium"]},{"id":":classical_building:","symbol":"🏛","group":"travel","keywords":["classical","classical building"]},{"id":":building_construction:","symbol":"🏗","group":"travel","keywords":["building construction","construction"]},{"id":":houses:","symbol":"🏘","group":"travel","keywords":["houses"]},{"id":":derelict_house:","symbol":"🏚","group":"travel","keywords":["derelict","house"]},{"id":":house:","symbol":"🏠","group":"travel","keywords":["home","house"]},{"id":":house_with_garden:","symbol":"🏡","group":"travel","keywords":["garden","home","house","house with garden"]},{"id":":office_building:","symbol":"🏢","group":"travel","keywords":["building","office building"]},{"id":":japanese_post_office:","symbol":"🏣","group":"travel","keywords":["Japanese","Japanese post office","post"]},{"id":":post_office:","symbol":"🏤","group":"travel","keywords":["European","post","post office"]},{"id":":hospital:","symbol":"🏥","group":"travel","keywords":["doctor","hospital","medicine"]},{"id":":bank:","symbol":"🏦","group":"travel","keywords":["bank","building"]},{"id":":hotel:","symbol":"🏨","group":"travel","keywords":["building","hotel"]},{"id":":love_hotel:","symbol":"🏩","group":"travel","keywords":["hotel","love"]},{"id":":convenience_store:","symbol":"🏪","group":"travel","keywords":["convenience","store"]},{"id":":school:","symbol":"🏫","group":"travel","keywords":["building","school"]},{"id":":department_store:","symbol":"🏬","group":"travel","keywords":["department","store"]},{"id":":factory:","symbol":"🏭","group":"travel","keywords":["building","factory"]},{"id":":japanese_castle:","symbol":"🏯","group":"travel","keywords":["castle","Japanese"]},{"id":":castle:","symbol":"🏰","group":"travel","keywords":["castle","European"]},{"id":":wedding:","symbol":"💒","group":"travel","keywords":["chapel","romance","wedding"]},{"id":":tokyo_tower:","symbol":"🗼","group":"travel","keywords":["Tokyo","tower"]},{"id":":statue_of_liberty:","symbol":"🗽","group":"travel","keywords":["liberty","statue","Statue of Liberty"]},{"id":":church:","symbol":"⛪","group":"travel","keywords":["Christian","church","cross","religion"]},{"id":":mosque:","symbol":"🕌","group":"travel","keywords":["islam","mosque","Muslim","religion"]},{"id":":synagogue:","symbol":"🕍","group":"travel","keywords":["Jew","Jewish","religion","synagogue","temple"]},{"id":":shinto_shrine:","symbol":"⛩","group":"travel","keywords":["religion","shinto","shrine"]},{"id":":kaaba:","symbol":"🕋","group":"travel","keywords":["islam","kaaba","Muslim","religion"]},{"id":":fountain:","symbol":"⛲","group":"travel","keywords":["fountain"]},{"id":":tent:","symbol":"⛺","group":"travel","keywords":["camping","tent"]},{"id":":foggy:","symbol":"🌁","group":"travel","keywords":["fog","foggy"]},{"id":":night_with_stars:","symbol":"🌃","group":"travel","keywords":["night","night with stars","star"]},{"id":":cityscape:","symbol":"🏙","group":"travel","keywords":["city","cityscape"]},{"id":":sunrise_over_mountains:","symbol":"🌄","group":"travel","keywords":["morning","mountain","sun","sunrise","sunrise over mountains"]},{"id":":sunrise:","symbol":"🌅","group":"travel","keywords":["morning","sun","sunrise"]},{"id":":cityscape_at_dusk:","symbol":"🌆","group":"travel","keywords":["city","cityscape at dusk","dusk","evening","landscape","sunset"]},{"id":":sunset:","symbol":"🌇","group":"travel","keywords":["dusk","sun","sunset"]},{"id":":bridge_at_night:","symbol":"🌉","group":"travel","keywords":["bridge","bridge at night","night"]},{"id":":hot_springs:","symbol":"♨","group":"travel","keywords":["hot","hotsprings","springs","steaming"]},{"id":":milky_way:","symbol":"🌌","group":"travel","keywords":["milky way","space"]},{"id":":carousel_horse:","symbol":"🎠","group":"travel","keywords":["carousel","horse"]},{"id":":ferris_wheel:","symbol":"🎡","group":"travel","keywords":["amusement park","ferris","wheel"]},{"id":":roller_coaster:","symbol":"🎢","group":"travel","keywords":["amusement park","coaster","roller"]},{"id":":barber_pole:","symbol":"💈","group":"travel","keywords":["barber","haircut","pole"]},{"id":":circus_tent:","symbol":"🎪","group":"travel","keywords":["circus","tent"]},{"id":":locomotive:","symbol":"🚂","group":"travel","keywords":["engine","locomotive","railway","steam","train"]},{"id":":railway_car:","symbol":"🚃","group":"travel","keywords":["car","electric","railway","train","tram","trolleybus"]},{"id":":high-speed_train:","symbol":"🚄","group":"travel","keywords":["high-speed train","railway","shinkansen","speed","train"]},{"id":":bullet_train:","symbol":"🚅","group":"travel","keywords":["bullet","railway","shinkansen","speed","train"]},{"id":":train:","symbol":"🚆","group":"travel","keywords":["railway","train"]},{"id":":metro:","symbol":"🚇","group":"travel","keywords":["metro","subway"]},{"id":":light_rail:","symbol":"🚈","group":"travel","keywords":["light rail","railway"]},{"id":":station:","symbol":"🚉","group":"travel","keywords":["railway","station","train"]},{"id":":tram:","symbol":"🚊","group":"travel","keywords":["tram","trolleybus"]},{"id":":monorail:","symbol":"🚝","group":"travel","keywords":["monorail","vehicle"]},{"id":":mountain_railway:","symbol":"🚞","group":"travel","keywords":["car","mountain","railway"]},{"id":":tram_car:","symbol":"🚋","group":"travel","keywords":["car","tram","trolleybus"]},{"id":":bus:","symbol":"🚌","group":"travel","keywords":["bus","vehicle"]},{"id":":oncoming_bus:","symbol":"🚍","group":"travel","keywords":["bus","oncoming"]},{"id":":trolleybus:","symbol":"🚎","group":"travel","keywords":["bus","tram","trolley","trolleybus"]},{"id":":minibus:","symbol":"🚐","group":"travel","keywords":["bus","minibus"]},{"id":":ambulance:","symbol":"🚑","group":"travel","keywords":["ambulance","vehicle"]},{"id":":fire_engine:","symbol":"🚒","group":"travel","keywords":["engine","fire","truck"]},{"id":":police_car:","symbol":"🚓","group":"travel","keywords":["car","patrol","police"]},{"id":":oncoming_police_car:","symbol":"🚔","group":"travel","keywords":["car","oncoming","police"]},{"id":":taxi:","symbol":"🚕","group":"travel","keywords":["taxi","vehicle"]},{"id":":oncoming_taxi:","symbol":"🚖","group":"travel","keywords":["oncoming","taxi"]},{"id":":automobile:","symbol":"🚗","group":"travel","keywords":["automobile","car"]},{"id":":oncoming_automobile:","symbol":"🚘","group":"travel","keywords":["automobile","car","oncoming"]},{"id":":sport_utility_vehicle:","symbol":"🚙","group":"travel","keywords":["recreational","sport utility","sport utility vehicle"]},{"id":":delivery_truck:","symbol":"🚚","group":"travel","keywords":["delivery","truck"]},{"id":":articulated_lorry:","symbol":"🚛","group":"travel","keywords":["articulated lorry","lorry","semi","truck"]},{"id":":tractor:","symbol":"🚜","group":"travel","keywords":["tractor","vehicle"]},{"id":":bicycle:","symbol":"🚲","group":"travel","keywords":["bicycle","bike"]},{"id":":kick_scooter:","symbol":"🛴","group":"travel","keywords":["kick","scooter"]},{"id":":motor_scooter:","symbol":"🛵","group":"travel","keywords":["motor","scooter"]},{"id":":bus_stop:","symbol":"🚏","group":"travel","keywords":["bus","busstop","stop"]},{"id":":motorway:","symbol":"🛣","group":"travel","keywords":["highway","motorway","road"]},{"id":":railway_track:","symbol":"🛤","group":"travel","keywords":["railway","railway track","train"]},{"id":":oil_drum:","symbol":"🛢","group":"travel","keywords":["drum","oil"]},{"id":":fuel_pump:","symbol":"⛽","group":"travel","keywords":["diesel","fuel","fuelpump","gas","pump","station"]},{"id":":police_car_light:","symbol":"🚨","group":"travel","keywords":["beacon","car","light","police","revolving"]},{"id":":horizontal_traffic_light:","symbol":"🚥","group":"travel","keywords":["horizontal traffic light","light","signal","traffic"]},{"id":":vertical_traffic_light:","symbol":"🚦","group":"travel","keywords":["light","signal","traffic","vertical traffic light"]},{"id":":stop_sign:","symbol":"🛑","group":"travel","keywords":["octagonal","sign","stop"]},{"id":":construction:","symbol":"🚧","group":"travel","keywords":["barrier","construction"]},{"id":":anchor:","symbol":"⚓","group":"travel","keywords":["anchor","ship","tool"]},{"id":":sailboat:","symbol":"⛵","group":"travel","keywords":["boat","resort","sailboat","sea","yacht"]},{"id":":canoe:","symbol":"🛶","group":"travel","keywords":["boat","canoe"]},{"id":":speedboat:","symbol":"🚤","group":"travel","keywords":["boat","speedboat"]},{"id":":passenger_ship:","symbol":"🛳","group":"travel","keywords":["passenger","ship"]},{"id":":ferry:","symbol":"⛴","group":"travel","keywords":["boat","ferry","passenger"]},{"id":":motor_boat:","symbol":"🛥","group":"travel","keywords":["boat","motor boat","motorboat"]},{"id":":ship:","symbol":"🚢","group":"travel","keywords":["boat","passenger","ship"]},{"id":":airplane:","symbol":"✈","group":"travel","keywords":["aeroplane","airplane"]},{"id":":small_airplane:","symbol":"🛩","group":"travel","keywords":["aeroplane","airplane","small airplane"]},{"id":":airplane_departure:","symbol":"🛫","group":"travel","keywords":["aeroplane","airplane","check-in","departure","departures"]},{"id":":airplane_arrival:","symbol":"🛬","group":"travel","keywords":["aeroplane","airplane","airplane arrival","arrivals","arriving","landing"]},{"id":":seat:","symbol":"💺","group":"travel","keywords":["chair","seat"]},{"id":":helicopter:","symbol":"🚁","group":"travel","keywords":["helicopter","vehicle"]},{"id":":suspension_railway:","symbol":"🚟","group":"travel","keywords":["railway","suspension"]},{"id":":mountain_cableway:","symbol":"🚠","group":"travel","keywords":["cable","gondola","mountain","mountain cableway"]},{"id":":aerial_tramway:","symbol":"🚡","group":"travel","keywords":["aerial","cable","car","gondola","tramway"]},{"id":":satellite:","symbol":"🛰","group":"travel","keywords":["satellite","space"]},{"id":":rocket:","symbol":"🚀","group":"travel","keywords":["rocket","space"]},{"id":":flying_saucer:","symbol":"🛸","group":"travel","keywords":["flying saucer","UFO"]},{"id":":bellhop_bell:","symbol":"🛎","group":"travel","keywords":["bell","bellhop","hotel"]},{"id":":hourglass_done:","symbol":"⌛","group":"travel","keywords":["hourglass done","sand","timer"]},{"id":":hourglass_not_done:","symbol":"⏳","group":"travel","keywords":["hourglass","hourglass not done","sand","timer"]},{"id":":watch:","symbol":"⌚","group":"travel","keywords":["clock","watch"]},{"id":":alarm_clock:","symbol":"⏰","group":"travel","keywords":["alarm","clock"]},{"id":":stopwatch:","symbol":"⏱","group":"travel","keywords":["clock","stopwatch"]},{"id":":timer_clock:","symbol":"⏲","group":"travel","keywords":["clock","timer"]},{"id":":mantelpiece_clock:","symbol":"🕰","group":"travel","keywords":["clock","mantelpiece clock"]},{"id":":twelve_o’clock:","symbol":"🕛","group":"travel","keywords":["00","12","12:00","clock","o’clock","twelve"]},{"id":":twelve-thirty:","symbol":"🕧","group":"travel","keywords":["12","12:30","clock","thirty","twelve","twelve-thirty"]},{"id":":one_o’clock:","symbol":"🕐","group":"travel","keywords":["00","1","1:00","clock","o’clock","one"]},{"id":":one-thirty:","symbol":"🕜","group":"travel","keywords":["1","1:30","clock","one","one-thirty","thirty"]},{"id":":two_o’clock:","symbol":"🕑","group":"travel","keywords":["00","2","2:00","clock","o’clock","two"]},{"id":":two-thirty:","symbol":"🕝","group":"travel","keywords":["2","2:30","clock","thirty","two","two-thirty"]},{"id":":three_o’clock:","symbol":"🕒","group":"travel","keywords":["00","3","3:00","clock","o’clock","three"]},{"id":":three-thirty:","symbol":"🕞","group":"travel","keywords":["3","3:30","clock","thirty","three","three-thirty"]},{"id":":four_o’clock:","symbol":"🕓","group":"travel","keywords":["00","4","4:00","clock","four","o’clock"]},{"id":":four-thirty:","symbol":"🕟","group":"travel","keywords":["4","4:30","clock","four","four-thirty","thirty"]},{"id":":five_o’clock:","symbol":"🕔","group":"travel","keywords":["00","5","5:00","clock","five","o’clock"]},{"id":":five-thirty:","symbol":"🕠","group":"travel","keywords":["5","5:30","clock","five","five-thirty","thirty"]},{"id":":six_o’clock:","symbol":"🕕","group":"travel","keywords":["00","6","6:00","clock","o’clock","six"]},{"id":":six-thirty:","symbol":"🕡","group":"travel","keywords":["6","6:30","clock","six","six-thirty","thirty"]},{"id":":seven_o’clock:","symbol":"🕖","group":"travel","keywords":["00","7","7:00","clock","o’clock","seven"]},{"id":":seven-thirty:","symbol":"🕢","group":"travel","keywords":["7","7:30","clock","seven","seven-thirty","thirty"]},{"id":":eight_o’clock:","symbol":"🕗","group":"travel","keywords":["00","8","8:00","clock","eight","o’clock"]},{"id":":eight-thirty:","symbol":"🕣","group":"travel","keywords":["8","8:30","clock","eight","eight-thirty","thirty"]},{"id":":nine_o’clock:","symbol":"🕘","group":"travel","keywords":["00","9","9:00","clock","nine","o’clock"]},{"id":":nine-thirty:","symbol":"🕤","group":"travel","keywords":["9","9:30","clock","nine","nine-thirty","thirty"]},{"id":":ten_o’clock:","symbol":"🕙","group":"travel","keywords":["00","10","10:00","clock","o’clock","ten"]},{"id":":ten-thirty:","symbol":"🕥","group":"travel","keywords":["10","10:30","clock","ten","ten-thirty","thirty"]},{"id":":eleven_o’clock:","symbol":"🕚","group":"travel","keywords":["00","11","11:00","clock","eleven","o’clock"]},{"id":":eleven-thirty:","symbol":"🕦","group":"travel","keywords":["11","11:30","clock","eleven","eleven-thirty","thirty"]},{"id":":new_moon:","symbol":"🌑","group":"travel","keywords":["dark","moon","new moon"]},{"id":":waxing_crescent_moon:","symbol":"🌒","group":"travel","keywords":["crescent","moon","waxing"]},{"id":":first_quarter_moon:","symbol":"🌓","group":"travel","keywords":["first quarter moon","moon","quarter"]},{"id":":waxing_gibbous_moon:","symbol":"🌔","group":"travel","keywords":["gibbous","moon","waxing"]},{"id":":full_moon:","symbol":"🌕","group":"travel","keywords":["full","moon"]},{"id":":waning_gibbous_moon:","symbol":"🌖","group":"travel","keywords":["gibbous","moon","waning"]},{"id":":last_quarter_moon:","symbol":"🌗","group":"travel","keywords":["last quarter moon","moon","quarter"]},{"id":":waning_crescent_moon:","symbol":"🌘","group":"travel","keywords":["crescent","moon","waning"]},{"id":":crescent_moon:","symbol":"🌙","group":"travel","keywords":["crescent","moon"]},{"id":":new_moon_face:","symbol":"🌚","group":"travel","keywords":["face","moon","new moon face"]},{"id":":first_quarter_moon_face:","symbol":"🌛","group":"travel","keywords":["face","first quarter moon face","moon","quarter"]},{"id":":last_quarter_moon_face:","symbol":"🌜","group":"travel","keywords":["face","last quarter moon face","moon","quarter"]},{"id":":thermometer:","symbol":"🌡","group":"travel","keywords":["thermometer","weather"]},{"id":":sun:","symbol":"☀","group":"travel","keywords":["bright","rays","sun","sunny"]},{"id":":full_moon_face:","symbol":"🌝","group":"travel","keywords":["bright","face","full","moon"]},{"id":":sun_with_face:","symbol":"🌞","group":"travel","keywords":["bright","face","sun","sun with face"]},{"id":":star:","symbol":"⭐","group":"travel","keywords":["star"]},{"id":":glowing_star:","symbol":"🌟","group":"travel","keywords":["glittery","glow","glowing star","shining","sparkle","star"]},{"id":":shooting_star:","symbol":"🌠","group":"travel","keywords":["falling","shooting","star"]},{"id":":cloud:","symbol":"☁️","group":"travel","keywords":["cloud","weather"]},{"id":":sun_behind_cloud:","symbol":"⛅","group":"travel","keywords":["cloud","sun","sun behind cloud"]},{"id":":cloud_with_lightning_and_rain:","symbol":"⛈️","group":"travel","keywords":["cloud","cloud with lightning and rain","rain","thunder"]},{"id":":sun_behind_small_cloud:","symbol":"🌤","group":"travel","keywords":["cloud","sun","sun behind small cloud"]},{"id":":sun_behind_large_cloud:","symbol":"🌥","group":"travel","keywords":["cloud","sun","sun behind large cloud"]},{"id":":sun_behind_rain_cloud:","symbol":"🌦","group":"travel","keywords":["cloud","rain","sun","sun behind rain cloud"]},{"id":":cloud_with_rain:","symbol":"🌧","group":"travel","keywords":["cloud","cloud with rain","rain"]},{"id":":cloud_with_snow:","symbol":"🌨","group":"travel","keywords":["cloud","cloud with snow","cold","snow"]},{"id":":cloud_with_lightning:","symbol":"🌩","group":"travel","keywords":["cloud","cloud with lightning","lightning"]},{"id":":tornado:","symbol":"🌪","group":"travel","keywords":["cloud","tornado","whirlwind"]},{"id":":fog:","symbol":"🌫","group":"travel","keywords":["cloud","fog"]},{"id":":wind_face:","symbol":"🌬","group":"travel","keywords":["blow","cloud","face","wind"]},{"id":":cyclone:","symbol":"🌀","group":"travel","keywords":["cyclone","dizzy","hurricane","twister","typhoon"]},{"id":":rainbow:","symbol":"🌈","group":"travel","keywords":["rain","rainbow"]},{"id":":closed_umbrella:","symbol":"🌂","group":"travel","keywords":["closed umbrella","clothing","rain","umbrella"]},{"id":":umbrella:","symbol":"☂","group":"travel","keywords":["clothing","rain","umbrella"]},{"id":":umbrella_with_rain_drops:","symbol":"☔","group":"travel","keywords":["clothing","drop","rain","umbrella","umbrella with rain drops"]},{"id":":umbrella_on_ground:","symbol":"⛱","group":"travel","keywords":["rain","sun","umbrella","umbrella on ground"]},{"id":":high_voltage:","symbol":"⚡","group":"travel","keywords":["danger","electric","high voltage","lightning","voltage","zap"]},{"id":":snowflake:","symbol":"❄","group":"travel","keywords":["cold","snow","snowflake"]},{"id":":snowman:","symbol":"☃","group":"travel","keywords":["cold","snow","snowman"]},{"id":":snowman_without_snow:","symbol":"⛄","group":"travel","keywords":["cold","snow","snowman","snowman without snow"]},{"id":":comet:","symbol":"☄","group":"travel","keywords":["comet","space"]},{"id":":fire:","symbol":"🔥","group":"travel","keywords":["fire","flame","tool"]},{"id":":droplet:","symbol":"💧","group":"travel","keywords":["cold","comic","drop","droplet","sweat"]},{"id":":water_wave:","symbol":"🌊","group":"travel","keywords":["ocean","water","wave"]},{"id":":jack-o-lantern:","symbol":"🎃","group":"activities","keywords":["celebration","halloween","jack","jack-o-lantern","lantern"]},{"id":":christmas_tree:","symbol":"🎄","group":"activities","keywords":["celebration","Christmas","tree"]},{"id":":fireworks:","symbol":"🎆","group":"activities","keywords":["celebration","fireworks"]},{"id":":sparkler:","symbol":"🎇","group":"activities","keywords":["celebration","fireworks","sparkle","sparkler"]},{"id":":sparkles:","symbol":"✨","group":"activities","keywords":["sparkle","sparkles","star"]},{"id":":balloon:","symbol":"🎈","group":"activities","keywords":["balloon","celebration"]},{"id":":party_popper:","symbol":"🎉","group":"activities","keywords":["celebration","party","popper","tada"]},{"id":":confetti_ball:","symbol":"🎊","group":"activities","keywords":["ball","celebration","confetti"]},{"id":":tanabata_tree:","symbol":"🎋","group":"activities","keywords":["banner","celebration","Japanese","tanabata tree","tree"]},{"id":":pine_decoration:","symbol":"🎍","group":"activities","keywords":["bamboo","celebration","Japanese","pine","pine decoration"]},{"id":":japanese_dolls:","symbol":"🎎","group":"activities","keywords":["celebration","doll","festival","Japanese","Japanese dolls"]},{"id":":carp_streamer:","symbol":"🎏","group":"activities","keywords":["carp","celebration","streamer"]},{"id":":wind_chime:","symbol":"🎐","group":"activities","keywords":["bell","celebration","chime","wind"]},{"id":":moon_viewing_ceremony:","symbol":"🎑","group":"activities","keywords":["celebration","ceremony","moon","moon viewing ceremony"]},{"id":":ribbon:","symbol":"🎀","group":"activities","keywords":["celebration","ribbon"]},{"id":":wrapped_gift:","symbol":"🎁","group":"activities","keywords":["box","celebration","gift","present","wrapped"]},{"id":":reminder_ribbon:","symbol":"🎗","group":"activities","keywords":["celebration","reminder","ribbon"]},{"id":":admission_tickets:","symbol":"🎟","group":"activities","keywords":["admission","admission tickets","ticket"]},{"id":":ticket:","symbol":"🎫","group":"activities","keywords":["admission","ticket"]},{"id":":military_medal:","symbol":"🎖","group":"activities","keywords":["celebration","medal","military"]},{"id":":trophy:","symbol":"🏆","group":"activities","keywords":["prize","trophy"]},{"id":":sports_medal:","symbol":"🏅","group":"activities","keywords":["medal","sports medal"]},{"id":":1st_place_medal:","symbol":"🥇","group":"activities","keywords":["1st place medal","first","gold","medal"]},{"id":":2nd_place_medal:","symbol":"🥈","group":"activities","keywords":["2nd place medal","medal","second","silver"]},{"id":":3rd_place_medal:","symbol":"🥉","group":"activities","keywords":["3rd place medal","bronze","medal","third"]},{"id":":soccer_ball:","symbol":"⚽","group":"activities","keywords":["ball","football","soccer"]},{"id":":baseball:","symbol":"⚾","group":"activities","keywords":["ball","baseball"]},{"id":":basketball:","symbol":"🏀","group":"activities","keywords":["ball","basketball","hoop"]},{"id":":volleyball:","symbol":"🏐","group":"activities","keywords":["ball","game","volleyball"]},{"id":":american_football:","symbol":"🏈","group":"activities","keywords":["american","ball","football"]},{"id":":rugby_football:","symbol":"🏉","group":"activities","keywords":["ball","football","rugby"]},{"id":":tennis:","symbol":"🎾","group":"activities","keywords":["ball","racquet","tennis"]},{"id":":bowling:","symbol":"🎳","group":"activities","keywords":["ball","bowling","game"]},{"id":":cricket_game:","symbol":"🏏","group":"activities","keywords":["ball","bat","cricket game","game"]},{"id":":field_hockey:","symbol":"🏑","group":"activities","keywords":["ball","field","game","hockey","stick"]},{"id":":ice_hockey:","symbol":"🏒","group":"activities","keywords":["game","hockey","ice","puck","stick"]},{"id":":ping_pong:","symbol":"🏓","group":"activities","keywords":["ball","bat","game","paddle","ping pong","table tennis"]},{"id":":badminton:","symbol":"🏸","group":"activities","keywords":["badminton","birdie","game","racquet","shuttlecock"]},{"id":":boxing_glove:","symbol":"🥊","group":"activities","keywords":["boxing","glove"]},{"id":":martial_arts_uniform:","symbol":"🥋","group":"activities","keywords":["judo","karate","martial arts","martial arts uniform","taekwondo","uniform"]},{"id":":goal_net:","symbol":"🥅","group":"activities","keywords":["goal","net"]},{"id":":flag_in_hole:","symbol":"⛳","group":"activities","keywords":["flag in hole","golf","hole"]},{"id":":ice_skate:","symbol":"⛸","group":"activities","keywords":["ice","skate"]},{"id":":fishing_pole:","symbol":"🎣","group":"activities","keywords":["fish","fishing pole","pole"]},{"id":":running_shirt:","symbol":"🎽","group":"activities","keywords":["athletics","running","sash","shirt"]},{"id":":skis:","symbol":"🎿","group":"activities","keywords":["ski","skis","snow"]},{"id":":sled:","symbol":"🛷","group":"activities","keywords":["sled","sledge","sleigh",""]},{"id":":curling_stone:","symbol":"🥌","group":"activities","keywords":["curling stone","game","rock"]},{"id":":direct_hit:","symbol":"🎯","group":"activities","keywords":["bullseye","dart","direct hit","game","hit","target"]},{"id":":pool_8_ball:","symbol":"🎱","group":"activities","keywords":["8","ball","billiard","eight","game","pool 8 ball"]},{"id":":crystal_ball:","symbol":"🔮","group":"activities","keywords":["ball","crystal","fairy tale","fantasy","fortune","tool"]},{"id":":video_game:","symbol":"🎮","group":"activities","keywords":["controller","game","video game"]},{"id":":joystick:","symbol":"🕹","group":"activities","keywords":["game","joystick","video game"]},{"id":":slot_machine:","symbol":"🎰","group":"activities","keywords":["game","slot","slot machine"]},{"id":":game_die:","symbol":"🎲","group":"activities","keywords":["dice","die","game"]},{"id":":spade_suit:","symbol":"♠","group":"activities","keywords":["card","game","spade suit"]},{"id":":heart_suit:","symbol":"♥","group":"activities","keywords":["card","game","heart suit"]},{"id":":diamond_suit:","symbol":"♦","group":"activities","keywords":["card","diamond suit","game"]},{"id":":club_suit:","symbol":"♣","group":"activities","keywords":["card","club suit","game"]},{"id":":joker:","symbol":"🃏","group":"activities","keywords":["card","game","joker","wildcard"]},{"id":":mahjong_red_dragon:","symbol":"🀄","group":"activities","keywords":["game","mahjong","mahjong red dragon","red"]},{"id":":flower_playing_cards:","symbol":"🎴","group":"activities","keywords":["card","flower","flower playing cards","game","Japanese","playing"]},{"id":":performing_arts:","symbol":"🎭","group":"activities","keywords":["art","mask","performing","performing arts","theater","theatre"]},{"id":":framed_picture:","symbol":"🖼","group":"activities","keywords":["art","frame","framed picture","museum","painting","picture"]},{"id":":artist_palette:","symbol":"🎨","group":"activities","keywords":["art","artist palette","museum","painting","palette"]},{"id":":muted_speaker:","symbol":"🔇","group":"objects","keywords":["mute","muted speaker","quiet","silent","speaker"]},{"id":":speaker_low_volume:","symbol":"🔈","group":"objects","keywords":["soft","speaker low volume"]},{"id":":speaker_medium_volume:","symbol":"🔉","group":"objects","keywords":["medium","speaker medium volume"]},{"id":":speaker_high_volume:","symbol":"🔊","group":"objects","keywords":["loud","speaker high volume"]},{"id":":loudspeaker:","symbol":"📢","group":"objects","keywords":["loud","loudspeaker","public address"]},{"id":":megaphone:","symbol":"📣","group":"objects","keywords":["cheering","megaphone"]},{"id":":postal_horn:","symbol":"📯","group":"objects","keywords":["horn","post","postal"]},{"id":":bell:","symbol":"🔔","group":"objects","keywords":["bell"]},{"id":":bell_with_slash:","symbol":"🔕","group":"objects","keywords":["bell","bell with slash","forbidden","mute","quiet","silent"]},{"id":":musical_score:","symbol":"🎼","group":"objects","keywords":["music","musical score","score"]},{"id":":musical_note:","symbol":"🎵","group":"objects","keywords":["music","musical note","note"]},{"id":":musical_notes:","symbol":"🎶","group":"objects","keywords":["music","musical notes","note","notes"]},{"id":":studio_microphone:","symbol":"🎙","group":"objects","keywords":["mic","microphone","music","studio"]},{"id":":level_slider:","symbol":"🎚","group":"objects","keywords":["level","music","slider"]},{"id":":control_knobs:","symbol":"🎛","group":"objects","keywords":["control","knobs","music"]},{"id":":microphone:","symbol":"🎤","group":"objects","keywords":["karaoke","mic","microphone"]},{"id":":headphone:","symbol":"🎧","group":"objects","keywords":["earbud","headphone"]},{"id":":radio:","symbol":"📻","group":"objects","keywords":["radio","video"]},{"id":":saxophone:","symbol":"🎷","group":"objects","keywords":["instrument","music","sax","saxophone"]},{"id":":guitar:","symbol":"🎸","group":"objects","keywords":["guitar","instrument","music"]},{"id":":musical_keyboard:","symbol":"🎹","group":"objects","keywords":["instrument","keyboard","music","musical keyboard","piano"]},{"id":":trumpet:","symbol":"🎺","group":"objects","keywords":["instrument","music","trumpet"]},{"id":":violin:","symbol":"🎻","group":"objects","keywords":["instrument","music","violin"]},{"id":":drum:","symbol":"🥁","group":"objects","keywords":["drum","drumsticks","music"]},{"id":":mobile_phone:","symbol":"📱","group":"objects","keywords":["cell","mobile","phone","telephone"]},{"id":":mobile_phone_with_arrow:","symbol":"📲","group":"objects","keywords":["arrow","cell","mobile","mobile phone with arrow","phone","receive"]},{"id":":telephone:","symbol":"☎","group":"objects","keywords":["phone","telephone"]},{"id":":telephone_receiver:","symbol":"📞","group":"objects","keywords":["phone","receiver","telephone"]},{"id":":pager:","symbol":"📟","group":"objects","keywords":["pager"]},{"id":":fax_machine:","symbol":"📠","group":"objects","keywords":["fax","fax machine"]},{"id":":battery:","symbol":"🔋","group":"objects","keywords":["battery"]},{"id":":electric_plug:","symbol":"🔌","group":"objects","keywords":["electric","electricity","plug"]},{"id":":laptop_computer:","symbol":"💻","group":"objects","keywords":["computer","laptop computer","pc","personal"]},{"id":":desktop_computer:","symbol":"🖥","group":"objects","keywords":["computer","desktop"]},{"id":":printer:","symbol":"🖨","group":"objects","keywords":["computer","printer"]},{"id":":keyboard:","symbol":"⌨","group":"objects","keywords":["computer","keyboard"]},{"id":":computer_mouse:","symbol":"🖱","group":"objects","keywords":["computer","computer mouse"]},{"id":":trackball:","symbol":"🖲","group":"objects","keywords":["computer","trackball"]},{"id":":computer_disk:","symbol":"💽","group":"objects","keywords":["computer","disk","minidisk","optical"]},{"id":":floppy_disk:","symbol":"💾","group":"objects","keywords":["computer","disk","floppy"]},{"id":":optical_disk:","symbol":"💿","group":"objects","keywords":["cd","computer","disk","optical"]},{"id":":dvd:","symbol":"📀","group":"objects","keywords":["blu-ray","computer","disk","dvd","optical"]},{"id":":movie_camera:","symbol":"🎥","group":"objects","keywords":["camera","cinema","movie"]},{"id":":film_frames:","symbol":"🎞","group":"objects","keywords":["cinema","film","frames","movie"]},{"id":":film_projector:","symbol":"📽","group":"objects","keywords":["cinema","film","movie","projector","video"]},{"id":":clapper_board:","symbol":"🎬","group":"objects","keywords":["clapper","clapper board","movie"]},{"id":":television:","symbol":"📺","group":"objects","keywords":["television","tv","video"]},{"id":":camera:","symbol":"📷","group":"objects","keywords":["camera","video"]},{"id":":camera_with_flash:","symbol":"📸","group":"objects","keywords":["camera","camera with flash","flash","video"]},{"id":":video_camera:","symbol":"📹","group":"objects","keywords":["camera","video"]},{"id":":videocassette:","symbol":"📼","group":"objects","keywords":["tape","vhs","video","videocassette"]},{"id":":magnifying_glass_tilted_left:","symbol":"🔍","group":"objects","keywords":["glass","magnifying","magnifying glass tilted left","search","tool"]},{"id":":magnifying_glass_tilted_right:","symbol":"🔎","group":"objects","keywords":["glass","magnifying","magnifying glass tilted right","search","tool"]},{"id":":candle:","symbol":"🕯","group":"objects","keywords":["candle","light"]},{"id":":light_bulb:","symbol":"💡","group":"objects","keywords":["bulb","comic","electric","idea","light"]},{"id":":flashlight:","symbol":"🔦","group":"objects","keywords":["electric","flashlight","light","tool","torch"]},{"id":":red_paper_lantern:","symbol":"🏮","group":"objects","keywords":["bar","lantern","light","red","red paper lantern"]},{"id":":notebook_with_decorative_cover:","symbol":"📔","group":"objects","keywords":["book","cover","decorated","notebook","notebook with decorative cover"]},{"id":":closed_book:","symbol":"📕","group":"objects","keywords":["book","closed"]},{"id":":open_book:","symbol":"📖","group":"objects","keywords":["book","open"]},{"id":":green_book:","symbol":"📗","group":"objects","keywords":["book","green"]},{"id":":blue_book:","symbol":"📘","group":"objects","keywords":["blue","book"]},{"id":":orange_book:","symbol":"📙","group":"objects","keywords":["book","orange"]},{"id":":books:","symbol":"📚","group":"objects","keywords":["book","books"]},{"id":":notebook:","symbol":"📓","group":"objects","keywords":["notebook"]},{"id":":ledger:","symbol":"📒","group":"objects","keywords":["ledger","notebook"]},{"id":":page_with_curl:","symbol":"📃","group":"objects","keywords":["curl","document","page","page with curl"]},{"id":":scroll:","symbol":"📜","group":"objects","keywords":["paper","scroll"]},{"id":":page_facing_up:","symbol":"📄","group":"objects","keywords":["document","page","page facing up"]},{"id":":newspaper:","symbol":"📰","group":"objects","keywords":["news","newspaper","paper"]},{"id":":rolled-up_newspaper:","symbol":"🗞","group":"objects","keywords":["news","newspaper","paper","rolled","rolled-up newspaper"]},{"id":":bookmark_tabs:","symbol":"📑","group":"objects","keywords":["bookmark","mark","marker","tabs"]},{"id":":bookmark:","symbol":"🔖","group":"objects","keywords":["bookmark","mark"]},{"id":":label:","symbol":"🏷","group":"objects","keywords":["label"]},{"id":":money_bag:","symbol":"💰","group":"objects","keywords":["bag","dollar","money","moneybag"]},{"id":":yen_banknote:","symbol":"💴","group":"objects","keywords":["banknote","bill","currency","money","note","yen"]},{"id":":dollar_banknote:","symbol":"💵","group":"objects","keywords":["banknote","bill","currency","dollar","money","note"]},{"id":":euro_banknote:","symbol":"💶","group":"objects","keywords":["banknote","bill","currency","euro","money","note"]},{"id":":pound_banknote:","symbol":"💷","group":"objects","keywords":["banknote","bill","currency","money","note","pound"]},{"id":":money_with_wings:","symbol":"💸","group":"objects","keywords":["banknote","bill","fly","money","money with wings","wings"]},{"id":":credit_card:","symbol":"💳","group":"objects","keywords":["card","credit","money"]},{"id":":chart_increasing_with_yen:","symbol":"💹","group":"objects","keywords":["chart","chart increasing with yen","graph","growth","money","yen"]},{"id":":currency_exchange:","symbol":"💱","group":"objects","keywords":["bank","currency","exchange","money"]},{"id":":heavy_dollar_sign:","symbol":"💲","group":"objects","keywords":["currency","dollar","heavy dollar sign","money"]},{"id":":envelope:","symbol":"✉","group":"objects","keywords":["email","envelope","letter"]},{"id":":e-mail:","symbol":"📧","group":"objects","keywords":["e-mail","email","letter","mail"]},{"id":":incoming_envelope:","symbol":"📨","group":"objects","keywords":["e-mail","email","envelope","incoming","letter","receive"]},{"id":":envelope_with_arrow:","symbol":"📩","group":"objects","keywords":["arrow","e-mail","email","envelope","envelope with arrow","outgoing"]},{"id":":outbox_tray:","symbol":"📤","group":"objects","keywords":["box","letter","mail","outbox","sent","tray"]},{"id":":inbox_tray:","symbol":"📥","group":"objects","keywords":["box","inbox","letter","mail","receive","tray"]},{"id":":package:","symbol":"📦","group":"objects","keywords":["box","package","parcel"]},{"id":":closed_mailbox_with_raised_flag:","symbol":"📫","group":"objects","keywords":["closed","closed mailbox with raised flag","mail","mailbox","postbox"]},{"id":":closed_mailbox_with_lowered_flag:","symbol":"📪","group":"objects","keywords":["closed","closed mailbox with lowered flag","lowered","mail","mailbox","postbox"]},{"id":":open_mailbox_with_raised_flag:","symbol":"📬","group":"objects","keywords":["mail","mailbox","open","open mailbox with raised flag","postbox"]},{"id":":open_mailbox_with_lowered_flag:","symbol":"📭","group":"objects","keywords":["lowered","mail","mailbox","open","open mailbox with lowered flag","postbox"]},{"id":":postbox:","symbol":"📮","group":"objects","keywords":["mail","mailbox","postbox"]},{"id":":ballot_box_with_ballot:","symbol":"🗳","group":"objects","keywords":["ballot","ballot box with ballot","box"]},{"id":":pencil:","symbol":"✏","group":"objects","keywords":["pencil"]},{"id":":black_nib:","symbol":"✒","group":"objects","keywords":["black nib","nib","pen"]},{"id":":fountain_pen:","symbol":"🖋","group":"objects","keywords":["fountain","pen"]},{"id":":pen:","symbol":"🖊","group":"objects","keywords":["ballpoint","pen"]},{"id":":paintbrush:","symbol":"🖌","group":"objects","keywords":["paintbrush","painting"]},{"id":":crayon:","symbol":"🖍","group":"objects","keywords":["crayon"]},{"id":":memo:","symbol":"📝","group":"objects","keywords":["memo","pencil"]},{"id":":briefcase:","symbol":"💼","group":"objects","keywords":["briefcase"]},{"id":":file_folder:","symbol":"📁","group":"objects","keywords":["file","folder"]},{"id":":open_file_folder:","symbol":"📂","group":"objects","keywords":["file","folder","open"]},{"id":":card_index_dividers:","symbol":"🗂","group":"objects","keywords":["card","dividers","index"]},{"id":":calendar:","symbol":"📅","group":"objects","keywords":["calendar","date"]},{"id":":tear-off_calendar:","symbol":"📆","group":"objects","keywords":["calendar","tear-off calendar"]},{"id":":spiral_notepad:","symbol":"🗒","group":"objects","keywords":["note","pad","spiral","spiral notepad"]},{"id":":spiral_calendar:","symbol":"🗓","group":"objects","keywords":["calendar","pad","spiral"]},{"id":":card_index:","symbol":"📇","group":"objects","keywords":["card","index","rolodex"]},{"id":":chart_increasing:","symbol":"📈","group":"objects","keywords":["chart","chart increasing","graph","growth","trend","upward"]},{"id":":chart_decreasing:","symbol":"📉","group":"objects","keywords":["chart","chart decreasing","down","graph","trend"]},{"id":":bar_chart:","symbol":"📊","group":"objects","keywords":["bar","chart","graph"]},{"id":":clipboard:","symbol":"📋","group":"objects","keywords":["clipboard"]},{"id":":pushpin:","symbol":"📌","group":"objects","keywords":["pin","pushpin"]},{"id":":round_pushpin:","symbol":"📍","group":"objects","keywords":["pin","pushpin","round pushpin"]},{"id":":paperclip:","symbol":"📎","group":"objects","keywords":["paperclip"]},{"id":":linked_paperclips:","symbol":"🖇","group":"objects","keywords":["link","linked paperclips","paperclip"]},{"id":":straight_ruler:","symbol":"📏","group":"objects","keywords":["ruler","straight edge","straight ruler"]},{"id":":triangular_ruler:","symbol":"📐","group":"objects","keywords":["ruler","set","triangle","triangular ruler"]},{"id":":scissors:","symbol":"✂","group":"objects","keywords":["cutting","scissors","tool"]},{"id":":card_file_box:","symbol":"🗃","group":"objects","keywords":["box","card","file"]},{"id":":file_cabinet:","symbol":"🗄","group":"objects","keywords":["cabinet","file","filing"]},{"id":":wastebasket:","symbol":"🗑","group":"objects","keywords":["wastebasket"]},{"id":":locked:","symbol":"🔒","group":"objects","keywords":["closed","locked"]},{"id":":unlocked:","symbol":"🔓","group":"objects","keywords":["lock","open","unlock","unlocked"]},{"id":":locked_with_pen:","symbol":"🔏","group":"objects","keywords":["ink","lock","locked with pen","nib","pen","privacy"]},{"id":":locked_with_key:","symbol":"🔐","group":"objects","keywords":["closed","key","lock","locked with key","secure"]},{"id":":key:","symbol":"🔑","group":"objects","keywords":["key","lock","password"]},{"id":":old_key:","symbol":"🗝","group":"objects","keywords":["clue","key","lock","old"]},{"id":":hammer:","symbol":"🔨","group":"objects","keywords":["hammer","tool"]},{"id":":pick:","symbol":"⛏","group":"objects","keywords":["mining","pick","tool"]},{"id":":hammer_and_pick:","symbol":"⚒","group":"objects","keywords":["hammer","hammer and pick","pick","tool"]},{"id":":hammer_and_wrench:","symbol":"🛠","group":"objects","keywords":["hammer","hammer and wrench","spanner","tool","wrench"]},{"id":":dagger:","symbol":"🗡","group":"objects","keywords":["dagger","knife","weapon"]},{"id":":crossed_swords:","symbol":"⚔","group":"objects","keywords":["crossed","swords","weapon"]},{"id":":pistol:","symbol":"🔫","group":"objects","keywords":["gun","handgun","pistol","revolver","tool","weapon"]},{"id":":bow_and_arrow:","symbol":"🏹","group":"objects","keywords":["archer","arrow","bow","bow and arrow","Sagittarius","zodiac"]},{"id":":shield:","symbol":"🛡","group":"objects","keywords":["shield","weapon"]},{"id":":wrench:","symbol":"🔧","group":"objects","keywords":["spanner","tool","wrench"]},{"id":":nut_and_bolt:","symbol":"🔩","group":"objects","keywords":["bolt","nut","nut and bolt","tool"]},{"id":":gear:","symbol":"⚙","group":"objects","keywords":["cog","cogwheel","gear","tool"]},{"id":":clamp:","symbol":"🗜","group":"objects","keywords":["clamp","compress","tool","vice"]},{"id":":balance_scale:","symbol":"⚖","group":"objects","keywords":["balance","justice","Libra","scale","zodiac"]},{"id":":link:","symbol":"🔗","group":"objects","keywords":["link"]},{"id":":chains:","symbol":"⛓","group":"objects","keywords":["chain","chains"]},{"id":":alembic:","symbol":"⚗","group":"objects","keywords":["alembic","chemistry","tool"]},{"id":":microscope:","symbol":"🔬","group":"objects","keywords":["microscope","science","tool"]},{"id":":telescope:","symbol":"🔭","group":"objects","keywords":["science","telescope","tool"]},{"id":":satellite_antenna:","symbol":"📡","group":"objects","keywords":["antenna","dish","satellite"]},{"id":":syringe:","symbol":"💉","group":"objects","keywords":["medicine","needle","shot","sick","syringe"]},{"id":":pill:","symbol":"💊","group":"objects","keywords":["doctor","medicine","pill","sick"]},{"id":":door:","symbol":"🚪","group":"objects","keywords":["door"]},{"id":":bed:","symbol":"🛏","group":"objects","keywords":["bed","hotel","sleep"]},{"id":":couch_and_lamp:","symbol":"🛋","group":"objects","keywords":["couch","couch and lamp","hotel","lamp"]},{"id":":toilet:","symbol":"🚽","group":"objects","keywords":["toilet"]},{"id":":shower:","symbol":"🚿","group":"objects","keywords":["shower","water"]},{"id":":bathtub:","symbol":"🛁","group":"objects","keywords":["bath","bathtub"]},{"id":":shopping_cart:","symbol":"🛒","group":"objects","keywords":["cart","shopping","trolley"]},{"id":":cigarette:","symbol":"🚬","group":"objects","keywords":["cigarette","smoking"]},{"id":":coffin:","symbol":"⚰","group":"objects","keywords":["coffin","death"]},{"id":":funeral_urn:","symbol":"⚱","group":"objects","keywords":["ashes","death","funeral","urn"]},{"id":":moai:","symbol":"🗿","group":"objects","keywords":["face","moai","moyai","statue"]},{"id":":atm_sign:","symbol":"🏧","group":"symbols","keywords":["atm","ATM sign","automated","bank","teller"]},{"id":":litter_in_bin_sign:","symbol":"🚮","group":"symbols","keywords":["litter","litter bin","litter in bin sign"]},{"id":":potable_water:","symbol":"🚰","group":"symbols","keywords":["drinking","potable","water"]},{"id":":wheelchair_symbol:","symbol":"♿","group":"symbols","keywords":["access","wheelchair symbol"]},{"id":":men’s_room:","symbol":"🚹","group":"symbols","keywords":["lavatory","man","men’s room","restroom","wc"]},{"id":":women’s_room:","symbol":"🚺","group":"symbols","keywords":["lavatory","restroom","wc","woman","women’s room"]},{"id":":restroom:","symbol":"🚻","group":"symbols","keywords":["lavatory","restroom","WC"]},{"id":":baby_symbol:","symbol":"🚼","group":"symbols","keywords":["baby","baby symbol","changing"]},{"id":":water_closet:","symbol":"🚾","group":"symbols","keywords":["closet","lavatory","restroom","water","wc"]},{"id":":passport_control:","symbol":"🛂","group":"symbols","keywords":["control","passport"]},{"id":":customs:","symbol":"🛃","group":"symbols","keywords":["customs"]},{"id":":baggage_claim:","symbol":"🛄","group":"symbols","keywords":["baggage","claim"]},{"id":":left_luggage:","symbol":"🛅","group":"symbols","keywords":["baggage","left luggage","locker","luggage"]},{"id":":warning:","symbol":"⚠","group":"symbols","keywords":["warning"]},{"id":":children_crossing:","symbol":"🚸","group":"symbols","keywords":["child","children crossing","crossing","pedestrian","traffic"]},{"id":":no_entry:","symbol":"⛔","group":"symbols","keywords":["entry","forbidden","no","not","prohibited","traffic"]},{"id":":prohibited:","symbol":"🚫","group":"symbols","keywords":["entry","forbidden","no","not","prohibited"]},{"id":":no_bicycles:","symbol":"🚳","group":"symbols","keywords":["bicycle","bike","forbidden","no","no bicycles","prohibited"]},{"id":":no_smoking:","symbol":"🚭","group":"symbols","keywords":["forbidden","no","not","prohibited","smoking"]},{"id":":no_littering:","symbol":"🚯","group":"symbols","keywords":["forbidden","litter","no","no littering","not","prohibited"]},{"id":":non-potable_water:","symbol":"🚱","group":"symbols","keywords":["non-drinking","non-potable","water"]},{"id":":no_pedestrians:","symbol":"🚷","group":"symbols","keywords":["forbidden","no","no pedestrians","not","pedestrian","prohibited"]},{"id":":no_mobile_phones:","symbol":"📵","group":"symbols","keywords":["cell","forbidden","mobile","no","no mobile phones","phone"]},{"id":":no_one_under_eighteen:","symbol":"🔞","group":"symbols","keywords":["18","age restriction","eighteen","no one under eighteen","prohibited","underage"]},{"id":":radioactive:","symbol":"☢","group":"symbols","keywords":["radioactive","sign"]},{"id":":biohazard:","symbol":"☣","group":"symbols","keywords":["biohazard","sign"]},{"id":":up_arrow:","symbol":"⬆","group":"symbols","keywords":["arrow","cardinal","direction","north","up arrow"]},{"id":":up-right_arrow:","symbol":"↗","group":"symbols","keywords":["arrow","direction","intercardinal","northeast","up-right arrow"]},{"id":":right_arrow:","symbol":"➡","group":"symbols","keywords":["arrow","cardinal","direction","east","right arrow"]},{"id":":down-right_arrow:","symbol":"↘","group":"symbols","keywords":["arrow","direction","down-right arrow","intercardinal","southeast"]},{"id":":down_arrow:","symbol":"⬇","group":"symbols","keywords":["arrow","cardinal","direction","down","south"]},{"id":":down-left_arrow:","symbol":"↙","group":"symbols","keywords":["arrow","direction","down-left arrow","intercardinal","southwest"]},{"id":":left_arrow:","symbol":"⬅","group":"symbols","keywords":["arrow","cardinal","direction","left arrow","west"]},{"id":":up-left_arrow:","symbol":"↖","group":"symbols","keywords":["arrow","direction","intercardinal","northwest","up-left arrow"]},{"id":":up-down_arrow:","symbol":"↕","group":"symbols","keywords":["arrow","up-down arrow"]},{"id":":left-right_arrow:","symbol":"↔","group":"symbols","keywords":["arrow","left-right arrow"]},{"id":":right_arrow_curving_left:","symbol":"↩","group":"symbols","keywords":["arrow","right arrow curving left"]},{"id":":left_arrow_curving_right:","symbol":"↪","group":"symbols","keywords":["arrow","left arrow curving right"]},{"id":":right_arrow_curving_up:","symbol":"⤴","group":"symbols","keywords":["arrow","right arrow curving up"]},{"id":":right_arrow_curving_down:","symbol":"⤵","group":"symbols","keywords":["arrow","down","right arrow curving down"]},{"id":":clockwise_vertical_arrows:","symbol":"🔃","group":"symbols","keywords":["arrow","clockwise","clockwise vertical arrows","reload"]},{"id":":counterclockwise_arrows_button:","symbol":"🔄","group":"symbols","keywords":["anticlockwise","arrow","counterclockwise","counterclockwise arrows button","withershins"]},{"id":":back_arrow:","symbol":"🔙","group":"symbols","keywords":["arrow","back","BACK arrow"]},{"id":":end_arrow:","symbol":"🔚","group":"symbols","keywords":["arrow","end","END arrow"]},{"id":":on!_arrow:","symbol":"🔛","group":"symbols","keywords":["arrow","mark","on","ON! arrow"]},{"id":":soon_arrow:","symbol":"🔜","group":"symbols","keywords":["arrow","soon","SOON arrow"]},{"id":":top_arrow:","symbol":"🔝","group":"symbols","keywords":["arrow","top","TOP arrow","up"]},{"id":":place_of_worship:","symbol":"🛐","group":"symbols","keywords":["place of worship","religion","worship"]},{"id":":atom_symbol:","symbol":"⚛","group":"symbols","keywords":["atheist","atom","atom symbol"]},{"id":":om:","symbol":"🕉","group":"symbols","keywords":["Hindu","om","religion"]},{"id":":star_of_david:","symbol":"✡","group":"symbols","keywords":["David","Jew","Jewish","religion","star","star of David"]},{"id":":wheel_of_dharma:","symbol":"☸","group":"symbols","keywords":["Buddhist","dharma","religion","wheel","wheel of dharma"]},{"id":":yin_yang:","symbol":"☯","group":"symbols","keywords":["religion","tao","taoist","yang","yin"]},{"id":":latin_cross:","symbol":"✝","group":"symbols","keywords":["Christian","cross","latin cross","religion"]},{"id":":orthodox_cross:","symbol":"☦","group":"symbols","keywords":["Christian","cross","orthodox cross","religion"]},{"id":":star_and_crescent:","symbol":"☪","group":"symbols","keywords":["islam","Muslim","religion","star and crescent"]},{"id":":peace_symbol:","symbol":"☮","group":"symbols","keywords":["peace","peace symbol"]},{"id":":menorah:","symbol":"🕎","group":"symbols","keywords":["candelabrum","candlestick","menorah","religion"]},{"id":":dotted_six-pointed_star:","symbol":"🔯","group":"symbols","keywords":["dotted six-pointed star","fortune","star"]},{"id":":aries:","symbol":"♈","group":"symbols","keywords":["Aries","ram","zodiac"]},{"id":":taurus:","symbol":"♉","group":"symbols","keywords":["bull","ox","Taurus","zodiac"]},{"id":":gemini:","symbol":"♊","group":"symbols","keywords":["Gemini","twins","zodiac"]},{"id":":cancer:","symbol":"♋","group":"symbols","keywords":["Cancer","crab","zodiac"]},{"id":":leo:","symbol":"♌","group":"symbols","keywords":["Leo","lion","zodiac"]},{"id":":virgo:","symbol":"♍","group":"symbols","keywords":["Virgo","zodiac"]},{"id":":libra:","symbol":"♎","group":"symbols","keywords":["balance","justice","Libra","scales","zodiac"]},{"id":":scorpio:","symbol":"♏","group":"symbols","keywords":["Scorpio","scorpion","scorpius","zodiac"]},{"id":":sagittarius:","symbol":"♐","group":"symbols","keywords":["archer","Sagittarius","zodiac"]},{"id":":capricorn:","symbol":"♑","group":"symbols","keywords":["Capricorn","goat","zodiac"]},{"id":":aquarius:","symbol":"♒","group":"symbols","keywords":["Aquarius","bearer","water","zodiac"]},{"id":":pisces:","symbol":"♓","group":"symbols","keywords":["fish","Pisces","zodiac"]},{"id":":ophiuchus:","symbol":"⛎","group":"symbols","keywords":["bearer","Ophiuchus","serpent","snake","zodiac"]},{"id":":shuffle_tracks_button:","symbol":"🔀","group":"symbols","keywords":["arrow","crossed","shuffle tracks button"]},{"id":":repeat_button:","symbol":"🔁","group":"symbols","keywords":["arrow","clockwise","repeat","repeat button"]},{"id":":repeat_single_button:","symbol":"🔂","group":"symbols","keywords":["arrow","clockwise","once","repeat single button"]},{"id":":play_button:","symbol":"▶","group":"symbols","keywords":["arrow","play","play button","right","triangle"]},{"id":":fast-forward_button:","symbol":"⏩","group":"symbols","keywords":["arrow","double","fast","fast-forward button","forward"]},{"id":":next_track_button:","symbol":"⏭","group":"symbols","keywords":["arrow","next scene","next track","next track button","triangle"]},{"id":":play_or_pause_button:","symbol":"⏯","group":"symbols","keywords":["arrow","pause","play","play or pause button","right","triangle"]},{"id":":reverse_button:","symbol":"◀","group":"symbols","keywords":["arrow","left","reverse","reverse button","triangle"]},{"id":":fast_reverse_button:","symbol":"⏪","group":"symbols","keywords":["arrow","double","fast reverse button","rewind"]},{"id":":last_track_button:","symbol":"⏮","group":"symbols","keywords":["arrow","last track button","previous scene","previous track","triangle"]},{"id":":upwards_button:","symbol":"🔼","group":"symbols","keywords":["arrow","button","red","upwards button"]},{"id":":fast_up_button:","symbol":"⏫","group":"symbols","keywords":["arrow","double","fast up button"]},{"id":":downwards_button:","symbol":"🔽","group":"symbols","keywords":["arrow","button","down","downwards button","red"]},{"id":":fast_down_button:","symbol":"⏬","group":"symbols","keywords":["arrow","double","down","fast down button"]},{"id":":pause_button:","symbol":"⏸","group":"symbols","keywords":["bar","double","pause","pause button","vertical"]},{"id":":stop_button:","symbol":"⏹","group":"symbols","keywords":["square","stop","stop button"]},{"id":":record_button:","symbol":"⏺","group":"symbols","keywords":["circle","record","record button"]},{"id":":eject_button:","symbol":"⏏","group":"symbols","keywords":["eject","eject button"]},{"id":":cinema:","symbol":"🎦","group":"symbols","keywords":["camera","cinema","film","movie"]},{"id":":dim_button:","symbol":"🔅","group":"symbols","keywords":["brightness","dim","dim button","low"]},{"id":":bright_button:","symbol":"🔆","group":"symbols","keywords":["bright","bright button","brightness"]},{"id":":antenna_bars:","symbol":"📶","group":"symbols","keywords":["antenna","antenna bars","bar","cell","mobile","phone"]},{"id":":vibration_mode:","symbol":"📳","group":"symbols","keywords":["cell","mobile","mode","phone","telephone","vibration"]},{"id":":mobile_phone_off:","symbol":"📴","group":"symbols","keywords":["cell","mobile","off","phone","telephone"]},{"id":":female_sign:","symbol":"♀","group":"symbols","keywords":["female sign","woman"]},{"id":":male_sign:","symbol":"♂","group":"symbols","keywords":["male sign","man"]},{"id":":medical_symbol:","symbol":"⚕","group":"symbols","keywords":["aesculapius","medical symbol","medicine","staff"]},{"id":":recycling_symbol:","symbol":"♻","group":"symbols","keywords":["recycle","recycling symbol"]},{"id":":fleur-de-lis:","symbol":"⚜","group":"symbols","keywords":["fleur-de-lis"]},{"id":":trident_emblem:","symbol":"🔱","group":"symbols","keywords":["anchor","emblem","ship","tool","trident"]},{"id":":name_badge:","symbol":"📛","group":"symbols","keywords":["badge","name"]},{"id":":japanese_symbol_for_beginner:","symbol":"🔰","group":"symbols","keywords":["beginner","chevron","Japanese","Japanese symbol for beginner","leaf"]},{"id":":heavy_large_circle:","symbol":"⭕","group":"symbols","keywords":["circle","heavy large circle","o"]},{"id":":white_heavy_check_mark:","symbol":"✅","group":"symbols","keywords":["check","mark","white heavy check mark"]},{"id":":ballot_box_with_check:","symbol":"☑","group":"symbols","keywords":["ballot","ballot box with check","box","check"]},{"id":":heavy_check_mark:","symbol":"✔","group":"symbols","keywords":["check","heavy check mark","mark"]},{"id":":heavy_multiplication_x:","symbol":"✖","group":"symbols","keywords":["cancel","heavy multiplication x","multiplication","multiply","x"]},{"id":":cross_mark:","symbol":"❌","group":"symbols","keywords":["cancel","cross mark","mark","multiplication","multiply","x"]},{"id":":cross_mark_button:","symbol":"❎","group":"symbols","keywords":["cross mark button","mark","square"]},{"id":":heavy_plus_sign:","symbol":"➕","group":"symbols","keywords":["heavy plus sign","math","plus"]},{"id":":heavy_minus_sign:","symbol":"➖","group":"symbols","keywords":["heavy minus sign","math","minus"]},{"id":":heavy_division_sign:","symbol":"➗","group":"symbols","keywords":["division","heavy division sign","math"]},{"id":":curly_loop:","symbol":"➰","group":"symbols","keywords":["curl","curly loop","loop"]},{"id":":double_curly_loop:","symbol":"➿","group":"symbols","keywords":["curl","double","double curly loop","loop"]},{"id":":part_alternation_mark:","symbol":"〽","group":"symbols","keywords":["mark","part","part alternation mark"]},{"id":":eight-spoked_asterisk:","symbol":"✳","group":"symbols","keywords":["asterisk","eight-spoked asterisk"]},{"id":":eight-pointed_star:","symbol":"✴","group":"symbols","keywords":["eight-pointed star","star"]},{"id":":sparkle:","symbol":"❇","group":"symbols","keywords":["sparkle"]},{"id":":double_exclamation_mark:","symbol":"‼","group":"symbols","keywords":["bangbang","double exclamation mark","exclamation","mark","punctuation"]},{"id":":exclamation_question_mark:","symbol":"⁉","group":"symbols","keywords":["exclamation","interrobang","mark","punctuation","question"]},{"id":":question_mark:","symbol":"❓","group":"symbols","keywords":["mark","punctuation","question"]},{"id":":white_question_mark:","symbol":"❔","group":"symbols","keywords":["mark","outlined","punctuation","question","white question mark"]},{"id":":white_exclamation_mark:","symbol":"❕","group":"symbols","keywords":["exclamation","mark","outlined","punctuation","white exclamation mark"]},{"id":":exclamation_mark:","symbol":"❗","group":"symbols","keywords":["exclamation","mark","punctuation"]},{"id":":wavy_dash:","symbol":"〰","group":"symbols","keywords":["dash","punctuation","wavy"]},{"id":":copyright:","symbol":"©","group":"symbols","keywords":["copyright"]},{"id":":registered:","symbol":"®","group":"symbols","keywords":["registered"]},{"id":":trade_mark:","symbol":"™","group":"symbols","keywords":["mark","tm","trade mark","trademark"]},{"id":":keycap_#:","symbol":"#️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_*:","symbol":"*️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_0:","symbol":"0️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_1:","symbol":"1️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_2:","symbol":"2️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_3:","symbol":"3️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_4:","symbol":"4️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_5:","symbol":"5️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_6:","symbol":"6️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_7:","symbol":"7️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_8:","symbol":"8️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_9:","symbol":"9️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_10:","symbol":"🔟","group":"symbols","keywords":["keycap"]},{"id":":hundred_points:","symbol":"💯","group":"symbols","keywords":["100","full","hundred","hundred points","score"]},{"id":":input_latin_uppercase:","symbol":"🔠","group":"symbols","keywords":["ABCD","input","latin","letters","uppercase"]},{"id":":input_latin_lowercase:","symbol":"🔡","group":"symbols","keywords":["abcd","input","latin","letters","lowercase"]},{"id":":input_numbers:","symbol":"🔢","group":"symbols","keywords":["1234","input","numbers"]},{"id":":input_symbols:","symbol":"🔣","group":"symbols","keywords":["〒♪&%","input","input symbols"]},{"id":":input_latin_letters:","symbol":"🔤","group":"symbols","keywords":["abc","alphabet","input","latin","letters"]},{"id":":a_button_(blood_type):","symbol":"🅰","group":"symbols","keywords":["a","A button (blood type)","blood type"]},{"id":":ab_button_(blood_type):","symbol":"🆎","group":"symbols","keywords":["ab","AB button (blood type)","blood type"]},{"id":":b_button_(blood_type):","symbol":"🅱","group":"symbols","keywords":["b","B button (blood type)","blood type"]},{"id":":cl_button:","symbol":"🆑","group":"symbols","keywords":["cl","CL button"]},{"id":":cool_button:","symbol":"🆒","group":"symbols","keywords":["cool","COOL button"]},{"id":":free_button:","symbol":"🆓","group":"symbols","keywords":["free","FREE button"]},{"id":":information:","symbol":"ℹ","group":"symbols","keywords":["i","information"]},{"id":":id_button:","symbol":"🆔","group":"symbols","keywords":["id","ID button","identity"]},{"id":":circled_m:","symbol":"Ⓜ","group":"symbols","keywords":["circle","circled M","m"]},{"id":":new_button:","symbol":"🆕","group":"symbols","keywords":["new","NEW button"]},{"id":":ng_button:","symbol":"🆖","group":"symbols","keywords":["ng","NG button"]},{"id":":o_button_(blood_type):","symbol":"🅾","group":"symbols","keywords":["blood type","o","O button (blood type)"]},{"id":":ok_button:","symbol":"🆗","group":"symbols","keywords":["OK","OK button"]},{"id":":p_button:","symbol":"🅿","group":"symbols","keywords":["P button","parking"]},{"id":":sos_button:","symbol":"🆘","group":"symbols","keywords":["help","sos","SOS button"]},{"id":":up!_button:","symbol":"🆙","group":"symbols","keywords":["mark","up","UP! button"]},{"id":":vs_button:","symbol":"🆚","group":"symbols","keywords":["versus","vs","VS button"]},{"id":":japanese_“here”_button:","symbol":"🈁","group":"symbols","keywords":["“here”","Japanese","Japanese “here” button","katakana","ココ"]},{"id":":japanese_“service_charge”_button:","symbol":"🈂","group":"symbols","keywords":["“service charge”","Japanese","Japanese “service charge” button","katakana","サ"]},{"id":":japanese_“monthly_amount”_button:","symbol":"🈷","group":"symbols","keywords":["“monthly amount”","ideograph","Japanese","Japanese “monthly amount” button","月"]},{"id":":japanese_“not_free_of_charge”_button:","symbol":"🈶","group":"symbols","keywords":["“not free of charge”","ideograph","Japanese","Japanese “not free of charge” button","有"]},{"id":":japanese_“reserved”_button:","symbol":"🈯","group":"symbols","keywords":["“reserved”","ideograph","Japanese","Japanese “reserved” button","指"]},{"id":":japanese_“bargain”_button:","symbol":"🉐","group":"symbols","keywords":["“bargain”","ideograph","Japanese","Japanese “bargain” button","得"]},{"id":":japanese_“discount”_button:","symbol":"🈹","group":"symbols","keywords":["“discount”","ideograph","Japanese","Japanese “discount” button","割"]},{"id":":japanese_“free_of_charge”_button:","symbol":"🈚","group":"symbols","keywords":["“free of charge”","ideograph","Japanese","Japanese “free of charge” button","無"]},{"id":":japanese_“prohibited”_button:","symbol":"🈲","group":"symbols","keywords":["“prohibited”","ideograph","Japanese","Japanese “prohibited” button","禁"]},{"id":":japanese_“acceptable”_button:","symbol":"🉑","group":"symbols","keywords":["“acceptable”","ideograph","Japanese","Japanese “acceptable” button","可"]},{"id":":japanese_“application”_button:","symbol":"🈸","group":"symbols","keywords":["“application”","ideograph","Japanese","Japanese “application” button","申"]},{"id":":japanese_“passing_grade”_button:","symbol":"🈴","group":"symbols","keywords":["“passing grade”","ideograph","Japanese","Japanese “passing grade” button","合"]},{"id":":japanese_“vacancy”_button:","symbol":"🈳","group":"symbols","keywords":["“vacancy”","ideograph","Japanese","Japanese “vacancy” button","空"]},{"id":":japanese_“congratulations”_button:","symbol":"㊗","group":"symbols","keywords":["“congratulations”","ideograph","Japanese","Japanese “congratulations” button","祝"]},{"id":":japanese_“secret”_button:","symbol":"㊙","group":"symbols","keywords":["“secret”","ideograph","Japanese","Japanese “secret” button","秘"]},{"id":":japanese_“open_for_business”_button:","symbol":"🈺","group":"symbols","keywords":["“open for business”","ideograph","Japanese","Japanese “open for business” button","営"]},{"id":":japanese_“no_vacancy”_button:","symbol":"🈵","group":"symbols","keywords":["“no vacancy”","ideograph","Japanese","Japanese “no vacancy” button","満"]},{"id":":red_circle:","symbol":"🔴","group":"symbols","keywords":["circle","geometric","red"]},{"id":":blue_circle:","symbol":"🔵","group":"symbols","keywords":["blue","circle","geometric"]},{"id":":white_circle:","symbol":"⚪","group":"symbols","keywords":["circle","geometric","white circle"]},{"id":":black_circle:","symbol":"⚫","group":"symbols","keywords":["black circle","circle","geometric"]},{"id":":white_large_square:","symbol":"⬜","group":"symbols","keywords":["geometric","square","white large square"]},{"id":":black_large_square:","symbol":"⬛","group":"symbols","keywords":["black large square","geometric","square"]},{"id":":black_medium_square:","symbol":"◼","group":"symbols","keywords":["black medium square","geometric","square"]},{"id":":white_medium_square:","symbol":"◻","group":"symbols","keywords":["geometric","square","white medium square"]},{"id":":white_medium-small_square:","symbol":"◽","group":"symbols","keywords":["geometric","square","white medium-small square"]},{"id":":black_medium-small_square:","symbol":"◾","group":"symbols","keywords":["black medium-small square","geometric","square"]},{"id":":white_small_square:","symbol":"▫","group":"symbols","keywords":["geometric","square","white small square"]},{"id":":black_small_square:","symbol":"▪","group":"symbols","keywords":["black small square","geometric","square"]},{"id":":large_orange_diamond:","symbol":"🔶","group":"symbols","keywords":["diamond","geometric","large orange diamond","orange"]},{"id":":large_blue_diamond:","symbol":"🔷","group":"symbols","keywords":["blue","diamond","geometric","large blue diamond"]},{"id":":small_orange_diamond:","symbol":"🔸","group":"symbols","keywords":["diamond","geometric","orange","small orange diamond"]},{"id":":small_blue_diamond:","symbol":"🔹","group":"symbols","keywords":["blue","diamond","geometric","small blue diamond"]},{"id":":red_triangle_pointed_up:","symbol":"🔺","group":"symbols","keywords":["geometric","red","red triangle pointed up"]},{"id":":red_triangle_pointed_down:","symbol":"🔻","group":"symbols","keywords":["down","geometric","red","red triangle pointed down"]},{"id":":diamond_with_a_dot:","symbol":"💠","group":"symbols","keywords":["comic","diamond","diamond with a dot","geometric","inside"]},{"id":":radio_button:","symbol":"🔘","group":"symbols","keywords":["button","geometric","radio"]},{"id":":black_square_button:","symbol":"🔲","group":"symbols","keywords":["black square button","button","geometric","square"]},{"id":":white_square_button:","symbol":"🔳","group":"symbols","keywords":["button","geometric","outlined","square","white square button"]},{"id":":chequered_flag:","symbol":"🏁","group":"flags","keywords":["checkered","chequered","chequered flag","racing"]},{"id":":triangular_flag:","symbol":"🚩","group":"flags","keywords":["post","triangular flag"]},{"id":":crossed_flags:","symbol":"🎌","group":"flags","keywords":["celebration","cross","crossed","crossed flags","Japanese"]},{"id":":black_flag:","symbol":"🏴","group":"flags","keywords":["black flag","waving"]},{"id":":white_flag:","symbol":"🏳","group":"flags","keywords":["waving","white flag"]},{"id":":rainbow_flag:","symbol":"🏳️‍🌈","group":"flags","keywords":["rainbow","rainbow flag"]},{"id":":flag_ascension_island:","symbol":"🇦🇨","group":"flags","keywords":["flag"]},{"id":":flag_andorra:","symbol":"🇦🇩","group":"flags","keywords":["flag"]},{"id":":flag_united_arab_emirates:","symbol":"🇦🇪","group":"flags","keywords":["flag"]},{"id":":flag_afghanistan:","symbol":"🇦🇫","group":"flags","keywords":["flag"]},{"id":":flag_antigua_&_barbuda:","symbol":"🇦🇬","group":"flags","keywords":["flag"]},{"id":":flag_anguilla:","symbol":"🇦🇮","group":"flags","keywords":["flag"]},{"id":":flag_albania:","symbol":"🇦🇱","group":"flags","keywords":["flag"]},{"id":":flag_armenia:","symbol":"🇦🇲","group":"flags","keywords":["flag"]},{"id":":flag_angola:","symbol":"🇦🇴","group":"flags","keywords":["flag"]},{"id":":flag_antarctica:","symbol":"🇦🇶","group":"flags","keywords":["flag"]},{"id":":flag_argentina:","symbol":"🇦🇷","group":"flags","keywords":["flag"]},{"id":":flag_american_samoa:","symbol":"🇦🇸","group":"flags","keywords":["flag"]},{"id":":flag_austria:","symbol":"🇦🇹","group":"flags","keywords":["flag"]},{"id":":flag_australia:","symbol":"🇦🇺","group":"flags","keywords":["flag"]},{"id":":flag_aruba:","symbol":"🇦🇼","group":"flags","keywords":["flag"]},{"id":":flag_åland_islands:","symbol":"🇦🇽","group":"flags","keywords":["flag"]},{"id":":flag_azerbaijan:","symbol":"🇦🇿","group":"flags","keywords":["flag"]},{"id":":flag_bosnia_&_herzegovina:","symbol":"🇧🇦","group":"flags","keywords":["flag"]},{"id":":flag_barbados:","symbol":"🇧🇧","group":"flags","keywords":["flag"]},{"id":":flag_bangladesh:","symbol":"🇧🇩","group":"flags","keywords":["flag"]},{"id":":flag_belgium:","symbol":"🇧🇪","group":"flags","keywords":["flag"]},{"id":":flag_burkina_faso:","symbol":"🇧🇫","group":"flags","keywords":["flag"]},{"id":":flag_bulgaria:","symbol":"🇧🇬","group":"flags","keywords":["flag"]},{"id":":flag_bahrain:","symbol":"🇧🇭","group":"flags","keywords":["flag"]},{"id":":flag_burundi:","symbol":"🇧🇮","group":"flags","keywords":["flag"]},{"id":":flag_benin:","symbol":"🇧🇯","group":"flags","keywords":["flag"]},{"id":":flag_st._barthélemy:","symbol":"🇧🇱","group":"flags","keywords":["flag"]},{"id":":flag_bermuda:","symbol":"🇧🇲","group":"flags","keywords":["flag"]},{"id":":flag_brunei:","symbol":"🇧🇳","group":"flags","keywords":["flag"]},{"id":":flag_bolivia:","symbol":"🇧🇴","group":"flags","keywords":["flag"]},{"id":":flag_caribbean_netherlands:","symbol":"🇧🇶","group":"flags","keywords":["flag"]},{"id":":flag_brazil:","symbol":"🇧🇷","group":"flags","keywords":["flag"]},{"id":":flag_bahamas:","symbol":"🇧🇸","group":"flags","keywords":["flag"]},{"id":":flag_bhutan:","symbol":"🇧🇹","group":"flags","keywords":["flag"]},{"id":":flag_bouvet_island:","symbol":"🇧🇻","group":"flags","keywords":["flag"]},{"id":":flag_botswana:","symbol":"🇧🇼","group":"flags","keywords":["flag"]},{"id":":flag_belarus:","symbol":"🇧🇾","group":"flags","keywords":["flag"]},{"id":":flag_belize:","symbol":"🇧🇿","group":"flags","keywords":["flag"]},{"id":":flag_canada:","symbol":"🇨🇦","group":"flags","keywords":["flag"]},{"id":":flag_cocos_(keeling)_islands:","symbol":"🇨🇨","group":"flags","keywords":["flag"]},{"id":":flag_congo_-_kinshasa:","symbol":"🇨🇩","group":"flags","keywords":["flag"]},{"id":":flag_central_african_republic:","symbol":"🇨🇫","group":"flags","keywords":["flag"]},{"id":":flag_congo_-_brazzaville:","symbol":"🇨🇬","group":"flags","keywords":["flag"]},{"id":":flag_switzerland:","symbol":"🇨🇭","group":"flags","keywords":["flag"]},{"id":":flag_côte_d’ivoire:","symbol":"🇨🇮","group":"flags","keywords":["flag"]},{"id":":flag_cook_islands:","symbol":"🇨🇰","group":"flags","keywords":["flag"]},{"id":":flag_chile:","symbol":"🇨🇱","group":"flags","keywords":["flag"]},{"id":":flag_cameroon:","symbol":"🇨🇲","group":"flags","keywords":["flag"]},{"id":":flag_china:","symbol":"🇨🇳","group":"flags","keywords":["flag"]},{"id":":flag_colombia:","symbol":"🇨🇴","group":"flags","keywords":["flag"]},{"id":":flag_clipperton_island:","symbol":"🇨🇵","group":"flags","keywords":["flag"]},{"id":":flag_costa_rica:","symbol":"🇨🇷","group":"flags","keywords":["flag"]},{"id":":flag_cuba:","symbol":"🇨🇺","group":"flags","keywords":["flag"]},{"id":":flag_cape_verde:","symbol":"🇨🇻","group":"flags","keywords":["flag"]},{"id":":flag_curaçao:","symbol":"🇨🇼","group":"flags","keywords":["flag"]},{"id":":flag_christmas_island:","symbol":"🇨🇽","group":"flags","keywords":["flag"]},{"id":":flag_cyprus:","symbol":"🇨🇾","group":"flags","keywords":["flag"]},{"id":":flag_czechia:","symbol":"🇨🇿","group":"flags","keywords":["flag"]},{"id":":flag_germany:","symbol":"🇩🇪","group":"flags","keywords":["flag"]},{"id":":flag_diego_garcia:","symbol":"🇩🇬","group":"flags","keywords":["flag"]},{"id":":flag_djibouti:","symbol":"🇩🇯","group":"flags","keywords":["flag"]},{"id":":flag_denmark:","symbol":"🇩🇰","group":"flags","keywords":["flag"]},{"id":":flag_dominica:","symbol":"🇩🇲","group":"flags","keywords":["flag"]},{"id":":flag_dominican_republic:","symbol":"🇩🇴","group":"flags","keywords":["flag"]},{"id":":flag_algeria:","symbol":"🇩🇿","group":"flags","keywords":["flag"]},{"id":":flag_ceuta_&_melilla:","symbol":"🇪🇦","group":"flags","keywords":["flag"]},{"id":":flag_ecuador:","symbol":"🇪🇨","group":"flags","keywords":["flag"]},{"id":":flag_estonia:","symbol":"🇪🇪","group":"flags","keywords":["flag"]},{"id":":flag_egypt:","symbol":"🇪🇬","group":"flags","keywords":["flag"]},{"id":":flag_western_sahara:","symbol":"🇪🇭","group":"flags","keywords":["flag"]},{"id":":flag_eritrea:","symbol":"🇪🇷","group":"flags","keywords":["flag"]},{"id":":flag_spain:","symbol":"🇪🇸","group":"flags","keywords":["flag"]},{"id":":flag_ethiopia:","symbol":"🇪🇹","group":"flags","keywords":["flag"]},{"id":":flag_european_union:","symbol":"🇪🇺","group":"flags","keywords":["flag"]},{"id":":flag_finland:","symbol":"🇫🇮","group":"flags","keywords":["flag"]},{"id":":flag_fiji:","symbol":"🇫🇯","group":"flags","keywords":["flag"]},{"id":":flag_falkland_islands:","symbol":"🇫🇰","group":"flags","keywords":["flag"]},{"id":":flag_micronesia:","symbol":"🇫🇲","group":"flags","keywords":["flag"]},{"id":":flag_faroe_islands:","symbol":"🇫🇴","group":"flags","keywords":["flag"]},{"id":":flag_france:","symbol":"🇫🇷","group":"flags","keywords":["flag"]},{"id":":flag_gabon:","symbol":"🇬🇦","group":"flags","keywords":["flag"]},{"id":":flag_united_kingdom:","symbol":"🇬🇧","group":"flags","keywords":["flag"]},{"id":":flag_grenada:","symbol":"🇬🇩","group":"flags","keywords":["flag"]},{"id":":flag_georgia:","symbol":"🇬🇪","group":"flags","keywords":["flag"]},{"id":":flag_french_guiana:","symbol":"🇬🇫","group":"flags","keywords":["flag"]},{"id":":flag_guernsey:","symbol":"🇬🇬","group":"flags","keywords":["flag"]},{"id":":flag_ghana:","symbol":"🇬🇭","group":"flags","keywords":["flag"]},{"id":":flag_gibraltar:","symbol":"🇬🇮","group":"flags","keywords":["flag"]},{"id":":flag_greenland:","symbol":"🇬🇱","group":"flags","keywords":["flag"]},{"id":":flag_gambia:","symbol":"🇬🇲","group":"flags","keywords":["flag"]},{"id":":flag_guinea:","symbol":"🇬🇳","group":"flags","keywords":["flag"]},{"id":":flag_guadeloupe:","symbol":"🇬🇵","group":"flags","keywords":["flag"]},{"id":":flag_equatorial_guinea:","symbol":"🇬🇶","group":"flags","keywords":["flag"]},{"id":":flag_greece:","symbol":"🇬🇷","group":"flags","keywords":["flag"]},{"id":":flag_south_georgia_&_south_sandwich_islands:","symbol":"🇬🇸","group":"flags","keywords":["flag"]},{"id":":flag_guatemala:","symbol":"🇬🇹","group":"flags","keywords":["flag"]},{"id":":flag_guam:","symbol":"🇬🇺","group":"flags","keywords":["flag"]},{"id":":flag_guinea-bissau:","symbol":"🇬🇼","group":"flags","keywords":["flag"]},{"id":":flag_guyana:","symbol":"🇬🇾","group":"flags","keywords":["flag"]},{"id":":flag_hong_kong_sar_china:","symbol":"🇭🇰","group":"flags","keywords":["flag"]},{"id":":flag_heard_&_mcdonald_islands:","symbol":"🇭🇲","group":"flags","keywords":["flag"]},{"id":":flag_honduras:","symbol":"🇭🇳","group":"flags","keywords":["flag"]},{"id":":flag_croatia:","symbol":"🇭🇷","group":"flags","keywords":["flag"]},{"id":":flag_haiti:","symbol":"🇭🇹","group":"flags","keywords":["flag"]},{"id":":flag_hungary:","symbol":"🇭🇺","group":"flags","keywords":["flag"]},{"id":":flag_canary_islands:","symbol":"🇮🇨","group":"flags","keywords":["flag"]},{"id":":flag_indonesia:","symbol":"🇮🇩","group":"flags","keywords":["flag"]},{"id":":flag_ireland:","symbol":"🇮🇪","group":"flags","keywords":["flag"]},{"id":":flag_israel:","symbol":"🇮🇱","group":"flags","keywords":["flag"]},{"id":":flag_isle_of_man:","symbol":"🇮🇲","group":"flags","keywords":["flag"]},{"id":":flag_india:","symbol":"🇮🇳","group":"flags","keywords":["flag"]},{"id":":flag_british_indian_ocean_territory:","symbol":"🇮🇴","group":"flags","keywords":["flag"]},{"id":":flag_iraq:","symbol":"🇮🇶","group":"flags","keywords":["flag"]},{"id":":flag_iran:","symbol":"🇮🇷","group":"flags","keywords":["flag"]},{"id":":flag_iceland:","symbol":"🇮🇸","group":"flags","keywords":["flag"]},{"id":":flag_italy:","symbol":"🇮🇹","group":"flags","keywords":["flag"]},{"id":":flag_jersey:","symbol":"🇯🇪","group":"flags","keywords":["flag"]},{"id":":flag_jamaica:","symbol":"🇯🇲","group":"flags","keywords":["flag"]},{"id":":flag_jordan:","symbol":"🇯🇴","group":"flags","keywords":["flag"]},{"id":":flag_japan:","symbol":"🇯🇵","group":"flags","keywords":["flag"]},{"id":":flag_kenya:","symbol":"🇰🇪","group":"flags","keywords":["flag"]},{"id":":flag_kyrgyzstan:","symbol":"🇰🇬","group":"flags","keywords":["flag"]},{"id":":flag_cambodia:","symbol":"🇰🇭","group":"flags","keywords":["flag"]},{"id":":flag_kiribati:","symbol":"🇰🇮","group":"flags","keywords":["flag"]},{"id":":flag_comoros:","symbol":"🇰🇲","group":"flags","keywords":["flag"]},{"id":":flag_st._kitts_&_nevis:","symbol":"🇰🇳","group":"flags","keywords":["flag"]},{"id":":flag_north_korea:","symbol":"🇰🇵","group":"flags","keywords":["flag"]},{"id":":flag_south_korea:","symbol":"🇰🇷","group":"flags","keywords":["flag"]},{"id":":flag_kuwait:","symbol":"🇰🇼","group":"flags","keywords":["flag"]},{"id":":flag_cayman_islands:","symbol":"🇰🇾","group":"flags","keywords":["flag"]},{"id":":flag_kazakhstan:","symbol":"🇰🇿","group":"flags","keywords":["flag"]},{"id":":flag_laos:","symbol":"🇱🇦","group":"flags","keywords":["flag"]},{"id":":flag_lebanon:","symbol":"🇱🇧","group":"flags","keywords":["flag"]},{"id":":flag_st._lucia:","symbol":"🇱🇨","group":"flags","keywords":["flag"]},{"id":":flag_liechtenstein:","symbol":"🇱🇮","group":"flags","keywords":["flag"]},{"id":":flag_sri_lanka:","symbol":"🇱🇰","group":"flags","keywords":["flag"]},{"id":":flag_liberia:","symbol":"🇱🇷","group":"flags","keywords":["flag"]},{"id":":flag_lesotho:","symbol":"🇱🇸","group":"flags","keywords":["flag"]},{"id":":flag_lithuania:","symbol":"🇱🇹","group":"flags","keywords":["flag"]},{"id":":flag_luxembourg:","symbol":"🇱🇺","group":"flags","keywords":["flag"]},{"id":":flag_latvia:","symbol":"🇱🇻","group":"flags","keywords":["flag"]},{"id":":flag_libya:","symbol":"🇱🇾","group":"flags","keywords":["flag"]},{"id":":flag_morocco:","symbol":"🇲🇦","group":"flags","keywords":["flag"]},{"id":":flag_monaco:","symbol":"🇲🇨","group":"flags","keywords":["flag"]},{"id":":flag_moldova:","symbol":"🇲🇩","group":"flags","keywords":["flag"]},{"id":":flag_montenegro:","symbol":"🇲🇪","group":"flags","keywords":["flag"]},{"id":":flag_st._martin:","symbol":"🇲🇫","group":"flags","keywords":["flag"]},{"id":":flag_madagascar:","symbol":"🇲🇬","group":"flags","keywords":["flag"]},{"id":":flag_marshall_islands:","symbol":"🇲🇭","group":"flags","keywords":["flag"]},{"id":":flag_macedonia:","symbol":"🇲🇰","group":"flags","keywords":["flag"]},{"id":":flag_mali:","symbol":"🇲🇱","group":"flags","keywords":["flag"]},{"id":":flag_myanmar_(burma):","symbol":"🇲🇲","group":"flags","keywords":["flag"]},{"id":":flag_mongolia:","symbol":"🇲🇳","group":"flags","keywords":["flag"]},{"id":":flag_macau_sar_china:","symbol":"🇲🇴","group":"flags","keywords":["flag"]},{"id":":flag_northern_mariana_islands:","symbol":"🇲🇵","group":"flags","keywords":["flag"]},{"id":":flag_martinique:","symbol":"🇲🇶","group":"flags","keywords":["flag"]},{"id":":flag_mauritania:","symbol":"🇲🇷","group":"flags","keywords":["flag"]},{"id":":flag_montserrat:","symbol":"🇲🇸","group":"flags","keywords":["flag"]},{"id":":flag_malta:","symbol":"🇲🇹","group":"flags","keywords":["flag"]},{"id":":flag_mauritius:","symbol":"🇲🇺","group":"flags","keywords":["flag"]},{"id":":flag_maldives:","symbol":"🇲🇻","group":"flags","keywords":["flag"]},{"id":":flag_malawi:","symbol":"🇲🇼","group":"flags","keywords":["flag"]},{"id":":flag_mexico:","symbol":"🇲🇽","group":"flags","keywords":["flag"]},{"id":":flag_malaysia:","symbol":"🇲🇾","group":"flags","keywords":["flag"]},{"id":":flag_mozambique:","symbol":"🇲🇿","group":"flags","keywords":["flag"]},{"id":":flag_namibia:","symbol":"🇳🇦","group":"flags","keywords":["flag"]},{"id":":flag_new_caledonia:","symbol":"🇳🇨","group":"flags","keywords":["flag"]},{"id":":flag_niger:","symbol":"🇳🇪","group":"flags","keywords":["flag"]},{"id":":flag_norfolk_island:","symbol":"🇳🇫","group":"flags","keywords":["flag"]},{"id":":flag_nigeria:","symbol":"🇳🇬","group":"flags","keywords":["flag"]},{"id":":flag_nicaragua:","symbol":"🇳🇮","group":"flags","keywords":["flag"]},{"id":":flag_netherlands:","symbol":"🇳🇱","group":"flags","keywords":["flag"]},{"id":":flag_norway:","symbol":"🇳🇴","group":"flags","keywords":["flag"]},{"id":":flag_nepal:","symbol":"🇳🇵","group":"flags","keywords":["flag"]},{"id":":flag_nauru:","symbol":"🇳🇷","group":"flags","keywords":["flag"]},{"id":":flag_niue:","symbol":"🇳🇺","group":"flags","keywords":["flag"]},{"id":":flag_new_zealand:","symbol":"🇳🇿","group":"flags","keywords":["flag"]},{"id":":flag_oman:","symbol":"🇴🇲","group":"flags","keywords":["flag"]},{"id":":flag_panama:","symbol":"🇵🇦","group":"flags","keywords":["flag"]},{"id":":flag_peru:","symbol":"🇵🇪","group":"flags","keywords":["flag"]},{"id":":flag_french_polynesia:","symbol":"🇵🇫","group":"flags","keywords":["flag"]},{"id":":flag_papua_new_guinea:","symbol":"🇵🇬","group":"flags","keywords":["flag"]},{"id":":flag_philippines:","symbol":"🇵🇭","group":"flags","keywords":["flag"]},{"id":":flag_pakistan:","symbol":"🇵🇰","group":"flags","keywords":["flag"]},{"id":":flag_poland:","symbol":"🇵🇱","group":"flags","keywords":["flag"]},{"id":":flag_st._pierre_&_miquelon:","symbol":"🇵🇲","group":"flags","keywords":["flag"]},{"id":":flag_pitcairn_islands:","symbol":"🇵🇳","group":"flags","keywords":["flag"]},{"id":":flag_puerto_rico:","symbol":"🇵🇷","group":"flags","keywords":["flag"]},{"id":":flag_palestinian_territories:","symbol":"🇵🇸","group":"flags","keywords":["flag"]},{"id":":flag_portugal:","symbol":"🇵🇹","group":"flags","keywords":["flag"]},{"id":":flag_palau:","symbol":"🇵🇼","group":"flags","keywords":["flag"]},{"id":":flag_paraguay:","symbol":"🇵🇾","group":"flags","keywords":["flag"]},{"id":":flag_qatar:","symbol":"🇶🇦","group":"flags","keywords":["flag"]},{"id":":flag_réunion:","symbol":"🇷🇪","group":"flags","keywords":["flag"]},{"id":":flag_romania:","symbol":"🇷🇴","group":"flags","keywords":["flag"]},{"id":":flag_serbia:","symbol":"🇷🇸","group":"flags","keywords":["flag"]},{"id":":flag_russia:","symbol":"🇷🇺","group":"flags","keywords":["flag"]},{"id":":flag_rwanda:","symbol":"🇷🇼","group":"flags","keywords":["flag"]},{"id":":flag_saudi_arabia:","symbol":"🇸🇦","group":"flags","keywords":["flag"]},{"id":":flag_solomon_islands:","symbol":"🇸🇧","group":"flags","keywords":["flag"]},{"id":":flag_seychelles:","symbol":"🇸🇨","group":"flags","keywords":["flag"]},{"id":":flag_sudan:","symbol":"🇸🇩","group":"flags","keywords":["flag"]},{"id":":flag_sweden:","symbol":"🇸🇪","group":"flags","keywords":["flag"]},{"id":":flag_singapore:","symbol":"🇸🇬","group":"flags","keywords":["flag"]},{"id":":flag_st._helena:","symbol":"🇸🇭","group":"flags","keywords":["flag"]},{"id":":flag_slovenia:","symbol":"🇸🇮","group":"flags","keywords":["flag"]},{"id":":flag_svalbard_&_jan_mayen:","symbol":"🇸🇯","group":"flags","keywords":["flag"]},{"id":":flag_slovakia:","symbol":"🇸🇰","group":"flags","keywords":["flag"]},{"id":":flag_sierra_leone:","symbol":"🇸🇱","group":"flags","keywords":["flag"]},{"id":":flag_san_marino:","symbol":"🇸🇲","group":"flags","keywords":["flag"]},{"id":":flag_senegal:","symbol":"🇸🇳","group":"flags","keywords":["flag"]},{"id":":flag_somalia:","symbol":"🇸🇴","group":"flags","keywords":["flag"]},{"id":":flag_suriname:","symbol":"🇸🇷","group":"flags","keywords":["flag"]},{"id":":flag_south_sudan:","symbol":"🇸🇸","group":"flags","keywords":["flag"]},{"id":":flag_são_tomé_&_príncipe:","symbol":"🇸🇹","group":"flags","keywords":["flag"]},{"id":":flag_el_salvador:","symbol":"🇸🇻","group":"flags","keywords":["flag"]},{"id":":flag_sint_maarten:","symbol":"🇸🇽","group":"flags","keywords":["flag"]},{"id":":flag_syria:","symbol":"🇸🇾","group":"flags","keywords":["flag"]},{"id":":flag_swaziland:","symbol":"🇸🇿","group":"flags","keywords":["flag"]},{"id":":flag_tristan_da_cunha:","symbol":"🇹🇦","group":"flags","keywords":["flag"]},{"id":":flag_turks_&_caicos_islands:","symbol":"🇹🇨","group":"flags","keywords":["flag"]},{"id":":flag_chad:","symbol":"🇹🇩","group":"flags","keywords":["flag"]},{"id":":flag_french_southern_territories:","symbol":"🇹🇫","group":"flags","keywords":["flag"]},{"id":":flag_togo:","symbol":"🇹🇬","group":"flags","keywords":["flag"]},{"id":":flag_thailand:","symbol":"🇹🇭","group":"flags","keywords":["flag"]},{"id":":flag_tajikistan:","symbol":"🇹🇯","group":"flags","keywords":["flag"]},{"id":":flag_tokelau:","symbol":"🇹🇰","group":"flags","keywords":["flag"]},{"id":":flag_timor-leste:","symbol":"🇹🇱","group":"flags","keywords":["flag"]},{"id":":flag_turkmenistan:","symbol":"🇹🇲","group":"flags","keywords":["flag"]},{"id":":flag_tunisia:","symbol":"🇹🇳","group":"flags","keywords":["flag"]},{"id":":flag_tonga:","symbol":"🇹🇴","group":"flags","keywords":["flag"]},{"id":":flag_turkey:","symbol":"🇹🇷","group":"flags","keywords":["flag"]},{"id":":flag_trinidad_&_tobago:","symbol":"🇹🇹","group":"flags","keywords":["flag"]},{"id":":flag_tuvalu:","symbol":"🇹🇻","group":"flags","keywords":["flag"]},{"id":":flag_taiwan:","symbol":"🇹🇼","group":"flags","keywords":["flag"]},{"id":":flag_tanzania:","symbol":"🇹🇿","group":"flags","keywords":["flag"]},{"id":":flag_ukraine:","symbol":"🇺🇦","group":"flags","keywords":["flag"]},{"id":":flag_uganda:","symbol":"🇺🇬","group":"flags","keywords":["flag"]},{"id":":flag_u.s._outlying_islands:","symbol":"🇺🇲","group":"flags","keywords":["flag"]},{"id":":flag_united_nations:","symbol":"🇺🇳","group":"flags","keywords":["flag"]},{"id":":flag_united_states:","symbol":"🇺🇸","group":"flags","keywords":["flag"]},{"id":":flag_uruguay:","symbol":"🇺🇾","group":"flags","keywords":["flag"]},{"id":":flag_uzbekistan:","symbol":"🇺🇿","group":"flags","keywords":["flag"]},{"id":":flag_vatican_city:","symbol":"🇻🇦","group":"flags","keywords":["flag"]},{"id":":flag_st._vincent_&_grenadines:","symbol":"🇻🇨","group":"flags","keywords":["flag"]},{"id":":flag_venezuela:","symbol":"🇻🇪","group":"flags","keywords":["flag"]},{"id":":flag_british_virgin_islands:","symbol":"🇻🇬","group":"flags","keywords":["flag"]},{"id":":flag_u.s._virgin_islands:","symbol":"🇻🇮","group":"flags","keywords":["flag"]},{"id":":flag_vietnam:","symbol":"🇻🇳","group":"flags","keywords":["flag"]},{"id":":flag_vanuatu:","symbol":"🇻🇺","group":"flags","keywords":["flag"]},{"id":":flag_wallis_&_futuna:","symbol":"🇼🇫","group":"flags","keywords":["flag"]},{"id":":flag_samoa:","symbol":"🇼🇸","group":"flags","keywords":["flag"]},{"id":":flag_kosovo:","symbol":"🇽🇰","group":"flags","keywords":["flag"]},{"id":":flag_yemen:","symbol":"🇾🇪","group":"flags","keywords":["flag"]},{"id":":flag_mayotte:","symbol":"🇾🇹","group":"flags","keywords":["flag"]},{"id":":flag_south_africa:","symbol":"🇿🇦","group":"flags","keywords":["flag"]},{"id":":flag_zambia:","symbol":"🇿🇲","group":"flags","keywords":["flag"]},{"id":":flag_zimbabwe:","symbol":"🇿🇼","group":"flags","keywords":["flag"]},{"id":":flag_england:","symbol":"🏴󠁧󠁢󠁥󠁮󠁧󠁿","group":"flags","keywords":["flag"]},{"id":":flag_scotland:","symbol":"🏴󠁧󠁢󠁳󠁣󠁴󠁿","group":"flags","keywords":["flag"]},{"id":":flag_wales:","symbol":"🏴󠁧󠁢󠁷󠁬󠁳󠁿","group":"flags","keywords":["flag"]}]');const KS={autosave:{waitingTime:5e3,save:e=>async function(e){const t=Date.now(),i=e.config.get(MS),o=await e.getData();o||console.warn("Trying to save snapshot but data is not defined.");const n={timestamp:t,hash:OS(o),content:o},s=VS(i),r=s?.items||[];r.find((e=>n.hash===e.hash))||r.push(n);try{const e=IS.compress(JSON.stringify({items:r,updatedAt:t}));localStorage.setItem(i,e)}catch(t){Np(e,"notifications").addError("Failed to save CKEditor data to localStorage: "+t.toString())}return!0}(e)},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{insert:{type:"inline"},resizeUnit:"px",resizeOptions:[{name:"imageResize:original",value:null,icon:"original"},{name:"imageResize:50",value:"50",icon:"medium"},{name:"imageResize:75",value:"75",icon:"large"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","|","imageResize:original"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells","tableProperties","tableCellProperties"]},mention:{feeds:[{marker:"@",feed:function(e){const t=this;let i=Fp(t);if(i&&"Activity::Comment"===i._type){const e=i.$embedded.workPackage;e&&(i=e)}if(!i||"WorkPackage"!==i._type)return[];if(t.config.get("disabledMentions").includes("user"))return[];const o=Bp(t).api.v3.principals(i,e),n=Mp(t),s=window.OpenProject.urlRoot;return new Promise(((e,t)=>{_k(o,{responseKind:"json",query:{select:"elements/_type,elements/id,elements/name"}}).then((e=>e.json)).then((t=>{e(_.uniqBy(t._embedded.elements,(e=>e.id)).map((e=>{const t=e._type.toLowerCase(),i=`@${e.name}`,o=`@${e.id}`,r=n.services.apiV3Service[`${t}s`].segment;return{type:t,id:o,text:i,link:`${s}/${r}/${e.id}`,dataId:e.id,name:e.name}})))})).catch((e=>{console.error("Error fetching user mentions:",e),t(e)}))}))},itemRenderer:WS,minimumCharacters:0},{marker:"###",feed:HS("###"),itemRenderer:WS,minimumCharacters:1},{marker:"##",feed:HS("##"),itemRenderer:WS,minimumCharacters:1},{marker:"#",feed:HS("#"),itemRenderer:WS,minimumCharacters:1},{marker:":",feed:function(e){return new Promise(((t,i)=>{const o=US.filter((t=>function(e,t,i){if(t.includes(e))return!0;if(0!==i.length)for(let t=0;t({id:e.id,name:e.id.replace(/:/g,""),text:e.symbol,type:"emoji"})));t(o)}))},itemRenderer:function(e){const t=document.createElement("span");return t.classList.add("mention-list-item"),t.textContent=`${e.text} ${e.name}`,t},minimumCharacters:1}]},language:"en",licenseKey:"GPL"};function GS(e){return(t,i)=>{const o=i.openProject.context;i.removePlugins=i.removePlugins||[];const n=o.resource;if(n&&n.canAddAttachments||i.removePlugins.push(...$S.map((e=>e.pluginName))),!1===o.macros&&(i.openProject.disableAllMacros=!0,i.removePlugins.push(...jS.map((e=>e.pluginName)))),Array.isArray(o.macros)){const e=jS.filter((e=>-1===o.macros.indexOf(e.pluginName)));i.removePlugins.push(...e)}i.disabledMentions=[];const s=o.disabledMentions;return Array.isArray(s)&&(i.disabledMentions=s),e.create(t,i).then((e=>e))}}class JS extends dg{}class ZS extends dg{}window.OPConstrainedEditor=JS,window.OPClassicEditor=ZS,window.OPEditorWatchdog=cc,ZS.createCustomized=GS(ZS),ZS.builtinPlugins=qS,ZS.defaultConfig=Object.assign({},KS),ZS.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","insertTable","macroList","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","|","pageBreak","|","preview","opShowSource"]},JS.createCustomized=GS(JS),JS.builtinPlugins=qS,JS.defaultConfig=Object.assign({},KS),JS.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","preview","opShowSource"]}})(),o=o.default})())); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OPEditor=t():e.OPEditor=t()}(self,(()=>(()=>{var e={428:e=>{var t=!0,i=!1,o=!1;function n(e,t,i){var o=e.attrIndex(t),n=[t,i];o<0?e.attrPush(n):e.attrs[o]=n}function s(e,t){for(var i=e[t].level-1,o=t-1;o>=0;o--)if(e[o].level===i)return o;return-1}function r(e,t){return"inline"===e[t].type&&function(e){return"paragraph_open"===e.type}(e[t-1])&&function(e){return"list_item_open"===e.type}(e[t-2])&&function(e){return 0===e.content.indexOf("[ ] ")||0===e.content.indexOf("[x] ")||0===e.content.indexOf("[X] ")}(e[t])}function a(e,n){if(e.children.unshift(function(e,i){var o=new i("html_inline","",0),n=t?' disabled="" ':"";0===e.content.indexOf("[ ] ")?o.content='':0!==e.content.indexOf("[x] ")&&0!==e.content.indexOf("[X] ")||(o.content='');return o}(e,n)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),i)if(o){e.children.pop();var s="task-item-"+Math.ceil(1e7*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+s+'">',e.children.push(function(e,t,i){var o=new i("html_inline","",0);return o.content='",o.attrs=[{for:t}],o}(e.content,s,n))}else e.children.unshift(function(e){var t=new e("html_inline","",0);return t.content="",t}(n))}e.exports=function(e,l){l&&(t=!l.enabled,i=!!l.label,o=!!l.labelAfter),e.core.ruler.after("inline","github-task-lists",(function(e){for(var i=e.tokens,o=2;o{var o,n=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function n(e,t){if(!o[e]){o[e]={};for(var i=0;i>>8,i[2*o+1]=r%256}return i},decompressFromUint8Array:function(t){if(null==t)return s.decompress(t);for(var i=new Array(t.length/2),o=0,n=i.length;o>=1}else{for(n=1,o=0;o>=1}0==--u&&(u=Math.pow(2,m),m++),delete a[d]}else for(n=r[d],o=0;o>=1;0==--u&&(u=Math.pow(2,m),m++),r[c]=h++,d=String(l)}if(""!==d){if(Object.prototype.hasOwnProperty.call(a,d)){if(d.charCodeAt(0)<256){for(o=0;o>=1}else{for(n=1,o=0;o>=1}0==--u&&(u=Math.pow(2,m),m++),delete a[d]}else for(n=r[d],o=0;o>=1;0==--u&&(u=Math.pow(2,m),m++)}for(n=2,o=0;o>=1;for(;;){if(p<<=1,f==t-1){g.push(i(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:s._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,i,o){var n,s,r,a,l,c,d,u=[],h=4,m=4,g=3,p="",f=[],b={val:o(0),position:i,index:1};for(n=0;n<3;n+=1)u[n]=n;for(r=0,l=Math.pow(2,2),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;switch(r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;d=e(r);break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;d=e(r);break;case 2:return""}for(u[3]=d,s=d,f.push(d);;){if(b.index>t)return"";for(r=0,l=Math.pow(2,g),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;switch(d=r){case 0:for(r=0,l=Math.pow(2,8),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;u[m++]=e(r),d=m-1,h--;break;case 1:for(r=0,l=Math.pow(2,16),c=1;c!=l;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=i,b.val=o(b.index++)),r|=(a>0?1:0)*c,c<<=1;u[m++]=e(r),d=m-1,h--;break;case 2:return f.join("")}if(0==h&&(h=Math.pow(2,g),g++),u[d])p=u[d];else{if(d!==m)return null;p=s+s.charAt(0)}f.push(p),u[m++]=s+p.charAt(0),s=p,0==--h&&(h=Math.pow(2,g),g++)}}};return s}();void 0===(o=function(){return n}.call(t,i,t,e))||(e.exports=o)}},t={};function i(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e={};i.r(e),i.d(e,{decode:()=>$x,encode:()=>Wx,format:()=>Ux,parse:()=>sE});var t={};i.r(t),i.d(t,{Any:()=>lE,Cc:()=>cE,Cf:()=>dE,P:()=>rE,S:()=>aE,Z:()=>uE});var o={};i.r(o),i.d(o,{arrayReplaceAt:()=>LE,assign:()=>BE,escapeHtml:()=>QE,escapeRE:()=>XE,fromCodePoint:()=>jE,has:()=>NE,isMdAsciiPunct:()=>oT,isPunctChar:()=>iT,isSpace:()=>eT,isString:()=>FE,isValidEntityCode:()=>zE,isWhiteSpace:()=>tT,lib:()=>sT,normalizeReference:()=>nT,unescapeAll:()=>UE,unescapeMd:()=>WE});var n={};function s(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function r(e){return"string"==typeof e||e instanceof String}function a(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function l(e){return Object.getOwnPropertySymbols(e).filter((t=>Object.prototype.propertyIsEnumerable.call(e,t)))}function c(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i.r(n),i.d(n,{parseLinkDestination:()=>aT,parseLinkLabel:()=>rT,parseLinkTitle:()=>lT});const d="[object RegExp]",u="[object String]",h="[object Number]",m="[object Boolean]",g="[object Arguments]",p="[object Symbol]",f="[object Date]",b="[object Map]",w="[object Set]",y="[object Array]",k="[object ArrayBuffer]",v="[object Object]",C="[object DataView]",A="[object Uint8Array]",x="[object Uint8ClampedArray]",E="[object Uint16Array]",T="[object Uint32Array]",P="[object Int8Array]",S="[object Int16Array]",I="[object Int32Array]",R="[object Float32Array]",O="[object Float64Array]";function V(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function D(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function F(e,t,i,o=new Map,n=void 0){const s=n?.(e,t,i,o);if(void 0!==s)return s;if(V(e))return e;if(o.has(e))return o.get(e);if(Array.isArray(e)){const t=new Array(e.length);o.set(e,t);for(let s=0;s{const r=t?.(i,o,n,s);if(void 0!==r)return r;if("object"==typeof e){if(c(e)===v&&"function"!=typeof e.constructor){const t={};return s.set(e,t),M(t,e,n,s),t}switch(Object.prototype.toString.call(e)){case h:case u:case m:{const t=new e.constructor(e?.valueOf());return M(t,e),t}case g:{const t={};return M(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}}))}function B(e){return"object"==typeof e&&null!==e}function L(e){return B(e)&&1===e.nodeType&&!a(e)}function z(e){return"function"==typeof e}function j(e){return N(e)}function $(e){return"__proto__"===e}function q(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===c(e)}function H(e){return null!=e&&"function"!=typeof e&&function(e){return Number.isSafeInteger(e)&&e>=0}(e.length)}function W(e){return D(e)}function U(e,t,i,o){if(V(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(o.has(t))return function(e){if(V(e))return e;if(Array.isArray(e)||D(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(null==t)return Object.assign(Object.create(t),e);const i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new i(e.errors,e.message,{cause:e.cause}):new i(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(o.get(t));if(o.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e-1}function ee(e){return e.indexOf("windows")>-1}function te(e){return!!e.match(/gecko\/\d+/)}function ie(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function oe(e){return!!e.match(/iphone|ipad/i)||X(e)&&navigator.maxTouchPoints>0}function ne(e){return e.indexOf("android")>-1}function se(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function re(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch{}return e}function ae(e,t,i,o){i=i||function(e,t){return e===t};const n=Array.isArray(e)?e:Array.prototype.slice.call(e),s=Array.isArray(t)?t:Array.prototype.slice.call(t),r=function(e,t,i){const o=le(e,t,i);if(-1===o)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const n=ce(e,o),s=ce(t,o),r=le(n,s,i),a=e.length-r,l=t.length-r;return{firstIndex:o,lastIndexOld:a,lastIndexNew:l}}(n,s,i),a=o?function(e,t){const{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(-1===i)return Array(t).fill("equal");let s=[];i>0&&(s=s.concat(Array(i).fill("equal")));n-i>0&&(s=s.concat(Array(n-i).fill("insert")));o-i>0&&(s=s.concat(Array(o-i).fill("delete")));n0&&i.push({index:o,type:"insert",values:e.slice(o,s)});n-o>0&&i.push({index:o+(s-o),type:"delete",howMany:n-o});return i}(s,r);return a}function le(e,t,i){for(let o=0;o200||n>200||o+n>300)return de.fastDiff(e,t,i,!0);let s,r;if(nc?-1:1;d[o+h]&&(d[o]=d[o+h].slice(0)),d[o]||(d[o]=[]),d[o].push(n>c?s:r);let m=Math.max(n,c),g=m-o;for(;gc;m--)u[m]=h(m);u[c]=h(c),g++}while(u[c]!==l);return d[c].slice(1)}de.fastDiff=ae;class ue{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const he=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function me(){const[e,t,i,o]=crypto.getRandomValues(new Uint32Array(4));return"e"+he[255&e]+he[e>>8&255]+he[e>>16&255]+he[e>>24&255]+he[255&t]+he[t>>8&255]+he[t>>16&255]+he[t>>24&255]+he[255&i]+he[i>>8&255]+he[i>>16&255]+he[i>>24&255]+he[255&o]+he[o>>8&255]+he[o>>16&255]+he[o>>24&255]}const ge={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function pe(e,t){const i=ge.get(t.priority);let o=0,n=e.length;for(;o>1;ge.get(e[t].priority){if("object"==typeof t&&null!==t){if(o.has(t))return`[object ${t.constructor.name}]`;o.add(t)}return t},s=t?` ${JSON.stringify(t,n)}`:"",r=we(e),a=i?`\nOriginal error: ${i.name}: ${i.message}`:"";return e+s+r+a}(e,i,o)),this.name="CKEditorError",this.context=t,this.data=i,o&&(this.stack=o.stack)}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;throw new fe("unexpected-error",t,void 0,e)}}function be(e,t){console.warn(...ye(e,t))}function we(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${e}`}function ye(e,t){const i=we(e);return t?[e,t,i]:[e,i]}const _e=new Date(2026,2,31);if(globalThis.CKEDITOR_VERSION)throw new fe("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="48.0.0";const ke=Symbol("listeningTo"),ve=Symbol("emitterId"),Ce=Symbol("delegations"),Ae=xe(Object);function xe(e){if(!e)return Ae;return class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let o=!1;this.listenTo(this,e,((e,...i)=>{o||(o=!0,e.off(),t.call(this,e,...i))}),i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,o={}){let n,s;this[ke]||(this[ke]={});const r=this[ke];Te(e)||Ee(e);const a=Te(e);(n=r[a])||(n=r[a]={emitter:e,callbacks:{}}),(s=n.callbacks[t])||(s=n.callbacks[t]=[]),s.push(i),function(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}(this,e,t,i,o)}stopListening(e,t,i){const o=this[ke];let n=e&&Te(e);const s=o&&n?o[n]:void 0,r=s&&t?s.callbacks[t]:void 0;if(!(!o||e&&!s||t&&!r))if(i){Re(this,e,t,i);-1!==r.indexOf(i)&&(1===r.length?delete s.callbacks[t]:Re(this,e,t,i))}else if(r){for(;i=r.pop();)Re(this,e,t,i);delete s.callbacks[t]}else if(s){for(t in s.callbacks)this.stopListening(e,t);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[ke]}}fire(e,...t){try{const i=e instanceof ue?e:new ue(this,e),o=i.name;let n=function(e,t){if(!e._events)return null;let i=t;do{const t=e._events[i];if(t&&t.callbacks&&t.callbacks.length)return t.callbacks;const o=i.lastIndexOf(":");i=o>-1?i.substring(0,o):""}while(i);return null}(this,o);if(i.path.push(this),n){n=n.slice();for(let e=0;e{this[Ce]||(this[Ce]=new Map),e.forEach((e=>{const o=this[Ce].get(e);o?o.set(t,i):this[Ce].set(e,new Map([[t,i]]))}))}}}stopDelegating(e,t){if(this[Ce])if(e)if(t){const i=this[Ce].get(e);i&&i.delete(t)}else this[Ce].delete(e);else this[Ce].clear()}_addEventListener(e,t,i){!function(e,t){const i=Pe(e);if(i[t])return;let o=t,n=null;const s=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},s.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const e of s)e.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(this,e);const o=Se(this,e),n={callback:t,priority:ge.get(i.priority)};for(const e of o)pe(e,n)}_removeEventListener(e,t){const i=Se(this,e);for(const e of i)for(let i=0;i{this.set(t,e[t])}),this);Le(this);const i=this[Oe];if(e in this&&!i.has(e))throw new fe("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i.get(e),set(t){const o=i.get(e);let n=this.fire(`set:${e}`,e,t,o);void 0===n&&(n=t),o===n&&i.has(e)||(i.set(e,n),this.fire(`change:${e}`,e,n,o))}}),this[e]=t}bind(...e){if(!e.length||!$e(e))throw new fe("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new fe("observable-bind-duplicate-properties",this);Le(this);const t=this[De];e.forEach((e=>{if(t.has(e))throw new fe("observable-bind-rebind",this)}));const i=new Map;return e.forEach((e=>{const o={property:e,to:[]};t.set(e,o),i.set(e,o)})),{to:ze,toMany:je,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[Oe])return;const t=this[De],i=this[Ve];if(e.length){if(!$e(e))throw new fe("observable-unbind-wrong-properties",this);e.forEach((e=>{const o=t.get(e);o&&(o.to.forEach((([e,t])=>{const n=i.get(e),s=n[t];s.delete(o),s.size||delete n[t],Object.keys(n).length||(i.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else i.forEach(((e,t)=>{this.stopListening(t,"change")})),i.clear(),t.clear()}decorate(e){Le(this);const t=this[e];if(!t)throw new fe("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,i)=>{e.return=t.apply(this,i)})),this[e]=function(...t){return this.fire(e,t)},this[e][Me]=t,this[Fe]||(this[Fe]=[]),this[Fe].push(e)}stopListening(e,t,i){if(!e&&this[Fe]){for(const e of this[Fe])this[e]=this[e][Me];delete this[Fe]}super.stopListening(e,t,i)}[Oe];[Fe];[De];[Ve]}}function Le(e){e[Oe]||(Object.defineProperty(e,Oe,{value:new Map}),Object.defineProperty(e,Ve,{value:new Map}),Object.defineProperty(e,De,{value:new Map}))}function ze(...e){const t=function(...e){if(!e.length)throw new fe("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach((e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new fe("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}})),t}(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new fe("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new fe("observable-bind-to-extra-callback",this);var n;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==o)throw new fe("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),n=this._observable,this._to.forEach((e=>{const t=n[Ve];let i;t.get(e.observable)||n.listenTo(e.observable,"change",((o,s)=>{i=t.get(e.observable)[s],i&&i.forEach((e=>{qe(n,e.property)}))}))})),function(e){let t;e._bindings.forEach(((i,o)=>{e._to.forEach((n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),function(e,t,i,o){const n=e[Ve],s=n.get(i),r=s||{};r[o]||(r[o]=new Set);r[o].add(t),s||n.set(i,r)}(e._observable,i,n.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{qe(this._observable,e)}))}function je(e,t,i){if(this._bindings.size>1)throw new fe("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map((e=>[e,t]));return Array.prototype.concat.apply([],i)}(e,t),i)}function $e(e){return e.every((e=>"string"==typeof e))}function qe(e,t){const i=e[De].get(t);let o;i.callback?o=i.callback.apply(e,i.to.map((e=>e[0][e[1]]))):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}function He(e){let t=0;for(const i of e)t++;return t}function We(e,t){const i=Math.min(e.length,t.length);for(let o=0;o{this._setToTarget(e,o,t[o],i)}))}}function Je(e){return N(e,Ze)}function Ze(e){return L(e)||"function"==typeof e?e:void 0}function Qe(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function Ye(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Xe=et(xe());function et(e){if(!e)return Xe;return class extends e{listenTo(e,t,i,o={}){if(Qe(e)||Ye(e)||e instanceof J.window.EventTarget){const n={capture:!!o.useCapture,passive:!!o.usePassive},s=this._getProxyEmitter(e,n)||new tt(e,n);this.listenTo(s,t,i,o)}else super.listenTo(e,t,i,o)}stopListening(e,t,i){if(Qe(e)||Ye(e)||e instanceof J.window.EventTarget){const o=this._getAllProxyEmitters(e);for(const e of o)this.stopListening(e,t,i)}else super.stopListening(e,t,i)}_getProxyEmitter(e,t){return function(e,t){const i=e[ke];return i&&i[t]?i[t].emitter:null}(this,it(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}}class tt extends(xe()){_domNode;_options;constructor(e,t){super(),Ee(this,it(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),xe().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){xe().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function it(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=me())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function ot(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}function nt(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function st(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,o=e.clientY;let n=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,o)?n=t.caretRangeFromPoint(i,o):e.rangeParent&&(n=t.createRange(),n.setStart(e.rangeParent,e.rangeOffset),n.collapse(!0)),n}function rt(e){return e&&e.parentNode?e.offsetParent===J.document.body?null:e.offsetParent:null}function at(e){return"[object Text]"==Object.prototype.toString.call(e)}function lt(e){return"[object Range]"==Object.prototype.toString.apply(e)}const ct=["top","right","bottom","left","width","height"],dt=new Set(["relative","absolute","fixed","sticky"]);class ut{top;right;bottom;left;width;height;_source;constructor(e){const t=lt(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),gt(e)||t)if(t){const t=ut.getDomRangeRects(e);ht(this,ut.getBoundingRect(t))}else ht(this,e.getBoundingClientRect());else if(Ye(e)){const{innerWidth:t,innerHeight:i}=e;ht(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else ht(this,e)}clone(){return new ut(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new ut(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(mt(e))return t;let i,o=e,n=e.parentNode||e.commonAncestorContainer;for(;n&&!mt(n);){const e="visible"===((s=n)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible");if(ft(o)&&(i=o),e||i&&"absolute"===pt(i)&&!ft(n)){o=n,n=n.parentNode;continue}const r=new ut(n),a=t.getIntersection(r);if(!a)return null;a.getArea(){const i=new ut(t);return i._source=e,i}))}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const o of e)i++,t.left=Math.min(t.left,o.left),t.top=Math.min(t.top,o.top),t.right=Math.max(t.right,o.right),t.bottom=Math.max(t.bottom,o.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new ut(t))}}function ht(e,t){for(const i of ct)e[i]=t[i]}function mt(e){return!!gt(e)&&e===e.ownerDocument.body}function gt(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect}function pt(e){return e.ownerDocument.defaultView.getComputedStyle(e).position}function ft(e){return e instanceof HTMLElement&&dt.has(pt(e))}class bt{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(e,t){bt._observerInstance||bt._createObserver(),this._element=e,this._callback=t,bt._addElementCallback(e,t),bt._observerInstance.observe(e)}get element(){return this._element}destroy(){bt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){bt._elementCallbacks||(bt._elementCallbacks=new Map);let i=bt._elementCallbacks.get(e);i||(i=new Set,bt._elementCallbacks.set(e,i)),i.add(t)}static _deleteElementCallback(e,t){const i=bt._getElementCallbacks(e);i&&(i.delete(t),i.size||(bt._elementCallbacks.delete(e),bt._observerInstance.unobserve(e))),bt._elementCallbacks&&!bt._elementCallbacks.size&&(bt._observerInstance=null,bt._elementCallbacks=null)}static _getElementCallbacks(e){return bt._elementCallbacks?bt._elementCallbacks.get(e):null}static _createObserver(){bt._observerInstance=new J.window.ResizeObserver((e=>{for(const t of e){const e=bt._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}}))}}function wt(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function yt(e){return t=>t+e}function _t(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function kt(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function vt(e){return e&&e.nodeType===Node.COMMENT_NODE}function Ct(e){return!!e&&(at(e)?Ct(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function At({element:e,target:t,positions:i,limiter:o,fitInViewport:n,viewportOffsetConfig:s}){z(t)&&(t=t()),z(o)&&(o=o());const r=rt(e),a=Et(s),l=new ut(e),c=xt(t,a);let d;if(!c||!a.getIntersection(c))return null;const u={targetRect:c,elementRect:l,positionedElementAncestor:r,viewportRect:a};if(o||n){if(o){const e=xt(o,a);e&&(u.limiterRect=e)}d=function(e,t){const{elementRect:i}=t,o=i.getArea(),n=e.map((e=>new Tt(e,t))).filter((e=>!!e.name));let s=0,r=null;for(const e of n){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===o)return e;const n=i**2+t**2;n>s&&(s=n,r=e)}return r}(i,u)}else d=new Tt(i[0],u);return d}function xt(e,t){const i=new ut(e).getVisible();return i?i.getIntersection(t):null}function Et(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new ut(J.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t.left+=e.left,t.right-=e.right,t.width-=e.left+e.right,t}class Tt{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:o,top:n,name:s,config:r}=i;this.name=s,this.config=r,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function Pt(e){const t=e.parentNode;t&&t.removeChild(e)}function St(){const e=J.window.visualViewport;if(!e||!Y.isiOS&&!Y.isSafari)return{left:0,top:0};return{left:Math.max(Math.round(e.offsetLeft),0),top:Math.max(Math.round(e.offsetTop),0)}}function It({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){const s=t.clone().moveBy(0,n.bottom),r=t.clone().moveBy(0,-n.top),a=new ut(e).excludeScrollbarsAndBorders(),l=i&&o,c=[r,s].every((e=>a.contains(e)));let{scrollX:d,scrollY:u}=e;const h=d,m=u;l?u-=a.top-t.top+n.top:c||(Vt(r,a)?u-=a.top-t.top+n.top:Ot(s,a)&&(u+=i?t.top-a.top-n.top:t.bottom-a.bottom+n.bottom)),c||(Dt(t,a)?d-=a.left-t.left+n.left:Ft(t,a)&&(d+=t.right-a.right+n.right)),d==h&&u===m||e.scrollTo(d,u)}function Rt({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:s}){const r=Mt(e),a=i&&o;let l,c,d;const u=s||r.document.body;for(;e!=u;)c=t(),l=new ut(e).excludeScrollbarsAndBorders(),d=l.contains(c),a?e.scrollTop-=l.top-c.top+n:d||(Vt(c,l)?e.scrollTop-=l.top-c.top+n:Ot(c,l)&&(e.scrollTop+=i?c.top-l.top-n:c.bottom-l.bottom+n)),d||(Dt(c,l)?e.scrollLeft-=l.left-c.left+n:Ft(c,l)&&(e.scrollLeft+=c.right-l.right+n)),e=e.parentNode}function Ot(e,t){return e.bottom>t.bottom}function Vt(e,t){return e.topt.right}function Mt(e){return lt(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Nt(e){if(lt(e)){let t=e.commonAncestorContainer;return at(t)&&(t=t.parentNode),t}return e.parentNode}function Bt(e,t){const i=Mt(e),o=new ut(e);if(i===t)return o;{let e=i;for(;e!=t;){const t=e.frameElement,i=new ut(t).excludeScrollbarsAndBorders();o.moveBy(i.left,i.top),e=e.parent}}return o}const Lt={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},zt={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},jt={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},$t=Gt(),qt=Object.fromEntries(Object.entries($t).map((([e,t])=>{let i;return i=t in jt?jt[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]})));function Ht(e){let t;if("string"==typeof e){if(t=$t[e.toLowerCase()],!t)throw new fe("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?$t.alt:0)+(e.ctrlKey?$t.ctrl:0)+(e.shiftKey?$t.shift:0)+(e.metaKey?$t.cmd:0);return t}function Wt(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Ht(e.slice(0,-1));const t=Ht(e);return(Y.isMac||Y.isiOS)&&t==$t.ctrl?$t.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function Ut(e,t){let i=Wt(e);const o=t?"Mac"===t:Y.isMac||Y.isiOS;return Object.entries(o?Lt:zt).reduce(((e,[t,o])=>(i&$t[t]&&(i&=~$t[t],e+=o),e)),"")+(i?qt[i]:"")}function Kt(e,t){const i="ltr"===t;switch(e){case $t.arrowleft:return i?"left":"right";case $t.arrowright:return i?"right":"left";case $t.arrowup:return"up";case $t.arrowdown:return"down"}}function Gt(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}const Jt=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function Zt(e){return Jt.includes(e)?"rtl":"ltr"}function Qt(e){return Array.isArray(e)?e:[e]}function Yt(e,t,i=1,o){if("number"!=typeof i)throw new fe("translation-service-quantity-not-a-number",null,{quantity:i});const n=o||J.window.CKEDITOR_TRANSLATIONS,s=function(e){return Object.keys(e).length}(n);1===s&&(e=Object.keys(n)[0]);const r=t.id||t.string;if(0===s||!function(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}(e,r,n))return 1!==i?t.plural:t.string;const a=n[e].dictionary,l=n[e].getPluralForm||(e=>1===e?0:1),c=a[r];if("string"==typeof c)return c;return c[Number(l(i))]}J.window.CKEDITOR_TRANSLATIONS||(J.window.CKEDITOR_TRANSLATIONS={});class Xt{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Zt(this.uiLanguage),this.contentLanguageDirection=Zt(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce(((e,t)=>G(e,t))):e}(i),this.t=(e,t)=>this._t(e,t)}_t(e,t=[]){t=Qt(t),"string"==typeof e&&(e={string:e});const i=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>ithis._items.length||t<0)throw new fe("collection-add-item-invalid-index",this);let i=0;for(const o of e){const e=this._getItemIdBeforeAdding(o),n=t+i;this._items.splice(n,0,o),this._itemMap.set(e,o),this.fire("add",o,n),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new fe("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new fe("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,i=(i,o,n)=>{const s=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(o);if(s&&r)this._bindToExternalToInternalMap.set(o,r),this._bindToInternalToExternalMap.set(r,o);else{const i=e(o);if(!i)return void this._skippedIndexesFromExternal.push(n);let s=n;for(const e of this._skippedIndexesFromExternal)n>e&&s--;for(const e of t._skippedIndexesFromExternal)s>=e&&s++;this._bindToExternalToInternalMap.set(o,i),this._bindToInternalToExternalMap.set(i,o),this.add(i,s);for(let e=0;e{const o=this._bindToExternalToInternalMap.get(t);o&&this.remove(o),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(it&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new fe("collection-add-invalid-id",this);if(this.get(i))throw new fe("collection-add-item-already-exists",this)}else e[t]=i=me();return i}_remove(e){let t,i,o,n=!1;const s=this._idProperty;if("string"==typeof e?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):"number"==typeof e?(t=e,o=this._items[t],n=!o,o&&(i=o[s])):(o=e,i=o[s],t=this._items.indexOf(o),n=-1==t||!this._itemMap.get(i)),n)throw new fe("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function ti(e){const t=e.next();return t.done?null:t.value}class ii extends(et(Be())){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(ni(e))this._addElement(e);else if(oi(e))this._addView(e);else{if(!e.element)throw new fe("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){ni(e)?this._removeElement(e):oi(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new fe("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>{const t=this.externalViews.find((t=>function(e,t){if(si(e,t))return!0;return!!t.focusTracker.externalViews.find((t=>si(e,t)))}(e,t)));t?this._focus(t.element):this._focus(e)}),{useCapture:!0}),this.listenTo(e,"blur",(()=>{this._blur()}),{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",(()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()})),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){if(this.elements.find((e=>e.contains(document.activeElement))))return;this.externalViews.find((e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout))||(this._clearBlurTimeout(),this._blurTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function oi(e){return"focusTracker"in e&&e.focusTracker instanceof ii}function ni(e){return L(e)}function si(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class ri{_listener;constructor(){this._listener=new(et())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+Ht(t),t)}))}set(e,t,i={}){const o=Wt(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,((e,o)=>{i.filter&&!i.filter(o)||(t(o,(()=>{o.preventDefault(),o.stopPropagation(),e.stop()})),e.return=!0)}),{priority:n})}press(e){return!!this._listener.fire("_keydown:"+Ht(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function ai(e){return Ue(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function li(e,t,i){const o=e.length,n=t.length;for(let t=o-1;t>=i;t--)e[t+n]=e[t];for(let o=0;oe(...n)),t)}return o.cancel=()=>{clearTimeout(i)},o}function di(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}function ui(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function hi(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const mi=pi();function gi(e,t){const i=String(e).matchAll(mi);return Array.from(i).some((e=>e.indexe.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}function fi(e){if(!e)return null;const t=function(e){const t=e.split(".");if(3!=t.length)return null;return t[1]}(e);return t?di(t):null}function bi(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function wi(e){return"string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function yi(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(yi).join(",");const t=String(e);return"0"===t&&Object.is(Number(e),-0)?"-0":t}function _i(e){if(Array.isArray(e))return e.map(wi);if("symbol"==typeof e)return[e];const t=[],i=(e=yi(e)).length;if(0===i)return t;let o=0,n="",s="",r=!1;for(46===e.charCodeAt(0)&&(t.push(""),o++);o{const o=e[t];Object.hasOwn(e,t)&&vi(o,i)&&(void 0!==i||t in e)||(e[t]=i)},Ai=/^(?:0|[1-9]\d*)$/;function xi(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&ei),(()=>{}))}function Ri(e){const t=e?.constructor;return e===("function"==typeof t?t.prototype:Object.prototype)}function Oi(e){if(!e)return 0===e?e:0;if((e=function(e){return Ei(e)?NaN:Number(e)}(e))===1/0||e===-1/0){return(e<0?-1:1)*Number.MAX_VALUE}return e==e?e:0}function Vi(e,t){if((e=function(e){const t=Oi(e),i=t%1;return i?t-i:t}(e))<1||!Number.isSafeInteger(e))return[];const i=new Array(e);for(let o=0;o`${e}`)),i=new Set(t);o=e,"undefined"!=typeof Buffer&&Buffer.isBuffer(o)&&(i.add("offset"),i.add("parent"));var o;W(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));const n=Fi(e).filter((e=>!i.has(e)));if(Array.isArray(e))return[...t,...n];return[...t.filter((t=>Object.hasOwn(e,t))),...n]}(e):Ri(e)?function(e){const t=Fi(e);return t.filter((e=>"constructor"!==e))}(e):Fi(e);default:return Fi(Object(e))}}function Fi(e){const t=[];for(const i in e)t.push(i);return t}function Mi(e,...t){for(let i=0;i{null!==s&&(e.apply(n,s),n=void 0,s=null)};let c=null;const d=()=>{null!=c&&clearTimeout(c),c=setTimeout((()=>{c=null,a&&l(),u()}),t)},u=()=>{null!==c&&(clearTimeout(c),c=null),n=void 0,s=null},h=function(...e){if(i?.aborted)return;n=this,s=e;const t=null==c;d(),r&&t&&l()};return h.schedule=d,h.cancel=u,h.flush=()=>{l()},i?.addEventListener("abort",u,{once:!0}),h}function Li(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:o=!1,trailing:n=!0,maxWait:s}=i,r=Array(2);let a;o&&(r[0]="leading"),n&&(r[1]="trailing");let l=null;const c=Bi((function(...t){a=e.apply(this,t),l=null}),t,{edges:r}),d=function(...t){return null!=s&&(null===l&&(l=Date.now()),Date.now()-l>=s)?(a=e.apply(this,t),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,t),a)};return d.cancel=c.cancel,d.flush=()=>(c.flush(),a),d}function zi(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return(...o)=>{if(++i>=e)return t(...o)}}function ji(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function $i(e,t,i){return qi(e,t,void 0,void 0,void 0,void 0,i)}function qi(e,t,i,o,n,s,r){const a=r(e,t,i,o,n,s);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Hi(e,t,s,r)}return Hi(e,t,s,r)}function Hi(e,t,i,o){if(Object.is(e,t))return!0;let n=c(e),s=c(t);if(n===g&&(n=v),s===g&&(s=v),n!==s)return!1;switch(n){case u:return e.toString()===t.toString();case h:return vi(e.valueOf(),t.valueOf());case m:case f:case p:return Object.is(e.valueOf(),t.valueOf());case d:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const r=(i=i??new Map).get(e),a=i.get(t);if(null!=r&&null!=a)return r===t;i.set(e,t),i.set(t,e);try{switch(n){case b:if(e.size!==t.size)return!1;for(const[n,s]of e.entries())if(!t.has(n)||!qi(s,t.get(n),n,e,t,i,o))return!1;return!0;case w:{if(e.size!==t.size)return!1;const n=Array.from(e.values()),s=Array.from(t.values());for(let r=0;rqi(a,n,void 0,e,t,i,o)));if(-1===l)return!1;s.splice(l,1)}return!0}case y:case A:case x:case E:case T:case"[object BigUint64Array]":case P:case S:case I:case"[object BigInt64Array]":case R:case O:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n{}),$i(e,t,((...o)=>{const n=i(...o);return void 0!==n?Boolean(n):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?Wi(Array.from(e),Array.from(t),zi(2,i)):void 0}))}function Ui(e,t){return $i(e,t,K)}function Ki(e){if(V(e))return e;const t=c(e);if(!function(e){switch(c(e)){case g:case y:case k:case C:case m:case f:case R:case O:case P:case S:case I:case b:case h:case v:case d:case w:case u:case p:case A:case x:case E:case T:return!0;default:return!1}}(e))return{};if(i=e,Array.isArray(i)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var i;if(W(e)){const t=e;return new(0,t.constructor)(t.buffer,t.byteOffset,t.length)}if(t===k)return new ArrayBuffer(e.byteLength);if(t===C){const t=e,i=t.buffer,o=t.byteOffset,n=t.byteLength,s=new ArrayBuffer(n),r=new Uint8Array(i,o,n);return new Uint8Array(s).set(r),new DataView(s)}if(t===m||t===h||t===u){const i=new(0,e.constructor)(e.valueOf());return t===u?function(e,t){const i=t.valueOf().length;for(const o in t)Object.hasOwn(t,o)&&(Number.isNaN(Number(o))||Number(o)>=i)&&(e[o]=t[o])}(i,e):Gi(i,e),i}if(t===f)return new Date(Number(e));if(t===d){const t=e,i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t===p)return Object(Symbol.prototype.valueOf.call(e));if(t===b){const t=e,i=new Map;return t.forEach(((e,t)=>{i.set(t,e)})),i}if(t===w){const t=e,i=new Set;return t.forEach((e=>{i.add(e)})),i}if(t===g){const t=e,i={};return Gi(i,t),i.length=t.length,i[Symbol.iterator]=t[Symbol.iterator],i}const o={};return function(e,t){const i=Object.getPrototypeOf(t);if(null!==i){"function"==typeof t.constructor&&Object.setPrototypeOf(e,i)}}(o,e),Gi(o,e),function(e,t){const i=Object.getOwnPropertySymbols(t);for(let o=0;oXi([[t,r]],e)))}Ji.has(s)||(Ji.set(s,new Map),s.registerPostFixer((e=>Xi(Ji.get(s),e))),s.on("change:isComposing",(()=>{e.change((e=>Xi(Ji.get(s),e)))}),{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",((e,t,i)=>r(i))),t.placeholder?r(t.placeholder):i&&r(i),i&&function(){Zi||be("enableViewPlaceholder-deprecated-text-option");Zi=!0}()}function Yi(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function Xi(e,t){const i=[];let o=!1;for(const[n,s]of e)s.isDirectHost&&(i.push(n),eo(t,n,s)&&(o=!0));for(const[n,s]of e){if(s.isDirectHost)continue;const e=to(n);e!==s.hostElement&&s.hostElement&&(t.removeAttribute("data-placeholder",s.hostElement),Yi(t,s.hostElement),s.hostElement=null,o=!0),e&&(i.includes(e)||(s.hostElement=e,eo(t,n,s)&&(o=!0)))}return o}function eo(e,t,i){const{text:o,isDirectHost:n,hostElement:s}=i;let r=!1;s.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,s),r=!0);return(n||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;if(function(e){for(const t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}(e))return!1;const i=e.document,o=i.selection.anchor;return!(i.isComposing&&o&&o.parent===e||!t&&i.isFocused&&(!o||o.parent===e))}(s,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,s)&&(r=!0):Yi(e,s)&&(r=!0),r}function to(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class io{is(){throw new Error("is() method is abstract")}}class oo extends(xe(io)){document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new fe("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=We(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]e.data.length)throw new fe("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new fe("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}}so.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class ro{_consumables=new Map;add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new ao(e),this._consumables.set(e,i)),i.add(t?lo(t):e._getConsumables()))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(lo(t))}consume(e,t){if(e.is("$text")||e.is("documentFragment"))return!!this.test(e,t)&&(this._consumables.set(e,!1),!0);const i=this._consumables.get(e);return void 0!==i&&i.consume(lo(t))}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(lo(t)))}static createFrom(e,t){if(t||(t=new ro),e.is("$text"))t.add(e);else if(e.is("element")||e.is("documentFragment")){t.add(e);for(const i of e.getChildren())ro.createFrom(i,t)}return t}}class ao{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes)if(i){let e=this._attributes.get(t);e&&"boolean"!=typeof e||(e=new Map,this._attributes.set(t,e)),e.set(i,!0)}else{if("style"==t||"class"==t)throw new fe("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(void 0===e)return null;if(!1===e)return!1;if(!0!==e)if(i){const t=e.get(i);if(void 0===t)return null;if(!t)return!1}else for(const t of e.values())if(!t)return!1}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if("boolean"==typeof e)for(const[e]of this.element._getConsumables(t,i).attributes)this._attributes.set(e,!1);else if(i)for(const[,o]of this.element._getConsumables(t,i).attributes)e.set(o,!1);else for(const t of e.keys())e.set(t,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(const[t,i]of e.attributes){const e=this._attributes.get(t);if(!1!==e){if(void 0!==e&&!0!==e)if(i){!1===e.get(i)&&e.set(i,!0)}else for(const t of e.keys())e.set(t,!0)}else this._attributes.set(t,!0)}}}function lo(e){const t=[];return"attributes"in e&&e.attributes&&co(t,e.attributes),"classes"in e&&e.classes&&co(t,e.classes,"class"),"styles"in e&&e.styles&&co(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function co(e,t,i){if("string"!=typeof t)for(const o of t)Array.isArray(o)?e.push(o):e.push(i?[i,o]:[o]);else e.push(i?[i,t]:[t])}class uo{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const i=this._isElementMatching(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const o=this._isElementMatching(i,e);o&&t.push({element:i,pattern:e,match:o})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}_isElementMatching(e,t){if("function"==typeof t){const i=t(e);return i&&"object"==typeof i?lo(i):i}const i={};if(t.name&&(i.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!i.name))return null;const o=[];return t.attributes&&!function(e,t,i){let o;"object"!=typeof e||e instanceof RegExp||Array.isArray(e)?o=["class","style"]:(void 0!==e.style&&be("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&be("matcher-pattern-deprecated-attributes-class-key",e));return t._collectAttributesMatch(mo(e),i,o)}(t.attributes,e,o)||t.classes&&!function(e,t,i){return t._collectAttributesMatch(mo(e,"class"),i)}(t.classes,e,o)||t.styles&&!function(e,t,i){return t._collectAttributesMatch(mo(e,"style"),i)}(t.styles,e,o)?null:(o.length&&(i.attributes=o),i)}}function ho(e,t){return!0===e||e===t||e instanceof RegExp&&!!String(t).match(e)}function mo(e,t){if(Array.isArray(e))return e.map((e=>"object"!=typeof e||e instanceof RegExp?t?[t,e,!0]:[e,!0]:(void 0!==e.key&&void 0!==e.value||be("matcher-pattern-missing-key-or-value",e),t?[t,e.key,e.value]:[e.key,e.value])));if("object"!=typeof e||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];const i=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.push(t?[t,o,e[o]]:[o,e[o]]);return i}class go{_styles;_cachedStyleNames=null;_cachedExpandedStyleNames=null;_styleProcessor;constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=function(e){let t=null,i=0,o=0,n=null;const s=new Map;if(""===e)return s;";"!=e.charAt(e.length-1)&&(e+=";");for(let r=0;rt===e));return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,s(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t={};for(const i of Qt(e)){const e=fo(i),o=ki(this._styles,e);if(o)bo(t,e,o);else{const e=this.getAsString(i);void 0!==e&&this._styleProcessor.toNormalizedForm(i,e,t)}}Object.keys(t).length&&(wo(this._styles,t),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!s(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map((([e])=>e)),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){const e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){const i=[];for(const o of this.getStyleNames(!0))if(ho(e,o)){if(!0===t){i.push(o);continue}ho(t,this.getAsString(o))&&i.push(o)}return i.length?i:void 0}_getConsumables(e){const t=[];if(e){t.push(e);for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(const e of this.getStyleNames()){for(const i of this._styleProcessor.getRelatedStyles(e))t.push(i);t.push(e)}return t}_canMergeFrom(e){for(const t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(const t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(const t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}}class po{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(s(t))bo(i,fo(e),t);else if(this._normalizers.has(e)){const o=this._normalizers.get(e),{path:n,value:s}=o(t);bo(i,n,s)}else bo(i,e,t)}getNormalized(e,t){if(!e)return G({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return ki(t,i);const o=i(e,t);if(o)return o}return ki(t,fo(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(void 0===i)return[];if(this._reducers.has(e)){return this._reducers.get(e)(i)}return[[e,i]]}getStyleNames(e){const t=new Set;for(const i of this._consumables.keys()){const o=this.getNormalized(i,e);o&&("object"!=typeof o||Object.keys(o).length)&&t.add(i)}for(const i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function fo(e){return e.replace("-",".")}function bo(e,t,i){let o=i;s(i)&&!Array.isArray(i)&&(o=G({},ki(e,t),i)),Ii(e,t,o)}function wo(e,t){for(const i of Object.keys(t))null===e[i]||Array.isArray(e[i])||"object"!=typeof e[i]||"object"!=typeof t[i]?delete e[i]:(wo(e[i],t[i]),Object.keys(e[i]).length||delete e[i])}class yo{_set=new Set;get isEmpty(){return 0==this._set.size}get size(){return this._set.size}has(e){return this._set.has(e)}keys(){return Array.from(this._set.keys())}setTo(e){this.clear();for(const t of e.split(/\s+/))t&&this._set.add(t);return this}set(e){for(const t of Qt(e))t&&this._set.add(t)}remove(e){for(const t of Qt(e))this._set.delete(t)}clear(){this._set.clear()}toString(){return Array.from(this._set).join(" ")}isSimilar(e){if(this.size!==e.size)return!1;for(const t of this.keys())if(!e.has(t))return!1;return!0}_clone(){const e=new this.constructor;return e._set=new Set(this._set),e}_getTokensMatch(e){const t=[];if(!0===e){for(const e of this._set.keys())t.push(e);return t}if("string"==typeof e){for(const i of e.split(/\s+/)){if(!this._set.has(i))return;t.push(i)}return t}for(const i of this._set.keys())i.match(e)&&t.push(i);return t.length?t:void 0}_getConsumables(e){return e?[e]:this.keys()}_canMergeFrom(){return!0}_mergeFrom(e){for(const t of e._set.keys())this._set.has(t)||this._set.add(t)}_isMatching(e){for(const t of e._set.keys())if(!this._set.has(t))return!1;return!0}}class _o extends oo{name;_unsafeAttributesToRender=[];_attrs;_children;_customProperties=new Map;get _classes(){return this._attrs.get("class")}get _styles(){return this._attrs.get("style")}constructor(e,t,i,o){super(e),this.name=t,this._attrs=this._parseAttributes(i),this._children=[],o&&this._insertChild(0,o)}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes&&(yield"class"),this._styles&&(yield"style");for(const e of this._attrs.keys())"class"!=e&&"style"!=e&&(yield e)}*getAttributes(){for(const[e,t]of this._attrs.entries())yield[e,String(t)]}getAttribute(e){return this._attrs.has(e)?String(this._attrs.get(e)):void 0}hasAttribute(e,t){return!!this._attrs.has(e)&&(void 0===t||(vo(this.name,e)||ko(this.name,e)?this._attrs.get(e).has(t):this._attrs.get(e)===t))}isSimilar(e){if(!(e instanceof _o))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size)return!1;for(const[t,i]of this._attrs){const o=e._attrs.get(t);if(void 0===o)return!1;if("string"==typeof i||"string"==typeof o){if(o!==i)return!1}else if(!i.isSimilar(o))return!1}return!0}hasClass(...e){for(const t of e)if(!this._classes||!this._classes.has(t))return!1;return!0}getClassNames(){const e=this._classes?this._classes.keys():[],t=e[Symbol.iterator]();return Object.assign(e,{next:t.next.bind(t)})}getStyle(e){return this._styles&&this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles&&this._styles.getNormalized(e)}getStyleNames(e){return this._styles?this._styles.getStyleNames(e):[]}hasStyle(...e){for(const t of e)if(!this._styles||!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new uo(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=this._classes?this._classes.keys().sort().join(","):"",t=this._styles&&String(this._styles),i=Array.from(this._attrs).filter((([e])=>"style"!=e&&"class"!=e)).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}toJSON(){const e=super.toJSON();if(e.name=this.name,e.type="Element",this._attrs.size&&(e.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const o=function(e,t){if("string"==typeof t)return[new no(e,t)];Ue(t)||(t=[t]);const i=[];for(const o of t)"string"==typeof o?i.push(new no(e,o)):o instanceof so?i.push(new no(e,o.data)):i.push(o);return i}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;it&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}toJSON(){const e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}}xo.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Eo=Symbol("rootName");class To extends xo{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Eo)}set rootName(e){this._setCustomProperty(Eo,e)}toJSON(){return this.rootName}set _name(e){this.name=e}}To.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Po{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new fe("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new fe("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=So._createAt(e.startPosition):this._position=So._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=So._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{o=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset}const n=new so(i,e.offset,o);return e.offset+=o,this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new So(o,0);return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new So(o,0),this._position=e,this._next();let i,n=o.data.length;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,i=new so(o,0,n),e=So._createAfter(i)):(i=new so(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=So._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i.is("view:$text")){if(e.isAtStart)return this._position=So._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if("string"==typeof o){let o;if(this.singleCharacters)o=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-t}e.offset-=o;const n=new so(i,e.offset,o);return this._position=e,this._formatReturnValue("text",n,t,e,o)}if(o&&o.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new So(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new So(o,o.data.length),this._position=e,this._previous();let i,n=o.data.length;if(o==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new so(o,t,o.data.length-t),n=i.data.length,e=So._createBefore(i)}else i=new so(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,n)}return e=So._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=So._createAfter(t.textNode):(o=So._createAfter(t.textNode),this._position=o)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=So._createBefore(t.textNode):(o=So._createBefore(t.textNode),this._position=o))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}}class So extends io{parent;offset;constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof xo);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=So._createAt(this),i=t.offset+e;return t.offset=i<0?0:i,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Po(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let o=0;for(;t[o]==i[o]&&t[o];)o++;return 0===o?null:t[o-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const o=We(t,i);switch(o){case"prefix":return"before";case"extension":return"after";default:return t[o]0?new this(i,o):new this(o,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(So._createBefore(e),t)}}function Ro(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}Io.prototype.is=function(e){return"range"===e||"view:range"===e};class Oo extends(xe(io)){_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=He(this.getRanges());if(t!=He(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),t.start.isEqual(o.start)&&t.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]),this._setFakeOptions(o);else if(t instanceof Oo||t instanceof Vo)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Io)this._setRanges([t],o&&o.backward),this._setFakeOptions(o);else if(t instanceof So)this._setRanges([new Io(t)]),this._setFakeOptions(o);else if(t instanceof oo){const e=!!o&&!!o.backward;let n;if(void 0===i)throw new fe("view-selection-setto-required-second-parameter",this);n="in"==i?Io._createIn(t):"on"==i?Io._createOn(t):new Io(So._createAt(t,i)),this._setRanges([n],e),this._setFakeOptions(o)}else{if(!Ue(t))throw new fe("view-selection-setto-not-selectable",this);this._setRanges(t,o&&o.backward),this._setFakeOptions(o)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new fe("view-selection-setfocus-no-ranges",this);const i=So._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.pop(),"before"==i.compareWith(o)?this._addRange(new Io(i,o),!0):this._addRange(new Io(o,i)),this.fire("change")}toJSON(){const e={ranges:Array.from(this.getRanges()).map((e=>e.toJSON()))};return this.isBackward&&(e.isBackward=!0),this.isFake&&(e.isFake=!0),e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Io))throw new fe("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new fe("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Io(e.start,e.end))}}Oo.prototype.is=function(e){return"selection"===e||"view:selection"===e};class Vo extends(xe(io)){_selection;constructor(...e){super(),this._selection=new Oo,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}}Vo.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class Do extends ue{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Fo=Symbol("bubblingEmitter"),Mo=Symbol("bubblingCallbacks"),No=Symbol("bubblingContexts");function Bo(e){return class extends e{fire(e,...t){try{const i=e instanceof ue?e:new ue(this,e),o=jo(this),n=qo(this);if(Lo(i,"capturing",this),zo(o,"$capture",i,...t))return i.return;const s=i.startRange||this.selection.getFirstRange(),r=s?s.getContainedElement():null,a=!!r&&function(e,t){for(const i of e)if(i(t))return!0;return!1}(n,r);let l=r||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}(s);if(Lo(i,"atTarget",l),!a){if(zo(o,"$text",i,...t))return i.return;Lo(i,"bubbling",l)}for(;l;){if(l.is("element")&&zo(o,l,i,...t))return i.return;l=l.parent,Lo(i,"bubbling",l)}return Lo(i,"bubbling",this),zo(o,"$document",i,...t),i.return}catch(e){fe.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const o=Qt(i.context||"$document"),n=jo(this),s=$o(this);for(const e of o)"function"==typeof e&&qo(this).add(e);const r=function(e,t,i){return function(o,n){const{currentTarget:s,eventArgs:r}=n;if("string"!=typeof s){if(s.is("rootElement")&&t.includes("$root"))i.call(e,o,...r);else if(t.includes(s.name))i.call(e,o,...r);else for(const n of t)if("function"==typeof n&&n(s))return void i.call(e,o,...r)}else t.includes(s)&&i.call(e,o,...r)}}(this,o,t);s.set(t,r),this.listenTo(n,e,r,i)}_removeEventListener(e,t){const i=jo(this),o=$o(this),n=o.get(t);n&&(o.delete(t),this.stopListening(i,e,n))}}}function Lo(e,t,i){e instanceof Do&&(e._eventPhase=t,e._currentTarget=i)}function zo(e,t,i,...o){return e.fire(i,{currentTarget:t,eventArgs:o}),!!i.stop.called}function jo(e){return e[Fo]||(e[Fo]=new(xe())),e[Fo]}function $o(e){return e[Mo]||(e[Mo]=new Map),e[Mo]}function qo(e){return e[No]||(e[No]=new Set),e[No]}class Ho extends(Bo(Be())){selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new Vo,this.roots=new ei({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach((e=>e.destroy())),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}}class Wo extends _o{static DEFAULT_PRIORITY=10;_priority=10;_id=null;_clonesGroup=null;constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Uo}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new fe("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){const e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}_canMergeAttributesFrom(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return null===this.id&&null===e.id&&this.priority===e.priority&&super._canSubtractAttributesOf(e)}}function Uo(){if(Ko(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Ko(e)>1)return null;e=e.parent}return!e||Ko(e)>1?null:this.childCount}function Ko(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}Wo.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Go extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Jo}toJSON(){const e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-emptyelement-cannot-add",[this,t]);return 0}}function Jo(){return null}Go.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Zo extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=Yo}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}toJSON(){const e=super.toJSON();return e.type="UIElement",e}}function Qo(e){e.document.on("arrowKey",((t,i)=>function(e,t,i){if(t.keyCode==$t.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),o=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(o||t.shiftKey){const t=e.focusNode,n=e.focusOffset,s=i.domPositionToView(t,n);if(null===s)return;let r=!1;const a=s.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(r){const t=i.viewPositionToDom(a);o?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,e.domConverter)),{priority:"low"})}function Yo(){return null}Zo.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Xo extends _o{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=en}toJSON(){const e=super.toJSON();return e.type="RawElement",e}_insertChild(e,t){if(t&&(t instanceof oo||Array.from(t).length>0))throw new fe("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function en(){return null}Xo.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class tn extends(xe(io)){document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0;const o=function(e,t){if("string"==typeof t)return[new no(e,t)];Ue(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new no(e,t):t instanceof so?new no(e,t.data):t))}(this.document,t);for(const t of o)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;i{const i=e[e.length-1],o=!t.is("uiElement");return i&&i.breakAttributes==o?i.nodes.push(t):e.push({breakAttributes:o,nodes:[t]}),e}),[]);let o=null,n=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(n,e,t);o||(o=i.start),n=i.end}return o?new Io(o,n):new Io(e)}remove(e){const t=e instanceof Io?e:Io._createOn(e);if(hn(t,this.document),t.isCollapsed)return new tn(this.document);const{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,s=o.offset-i.offset,r=n._removeChildren(i.offset,s);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new tn(this.document,r)}clear(e,t){hn(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const o of i){const i=o.item;let n;if(i.is("element")&&t.isSimilar(i))n=Io._createOn(i);else if(!o.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(n=Io._createIn(e))}n&&(n.end.isAfter(e.end)&&(n.end=e.end),n.start.isBefore(e.start)&&(n.start=e.start),this.remove(n))}}move(e,t){let i;if(t.isAfter(e.end)){const o=(t=this._breakAttributes(t,!0)).parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof Wo))throw new fe("view-writer-wrap-invalid-attribute",this.document);if(hn(e,this.document),e.isCollapsed){let o=e.start;o.parent.is("element")&&(i=o.parent,!Array.from(i.getChildren()).some((e=>!e.is("uiElement"))))&&(o=o.getLastMatchingPosition((e=>e.item.is("uiElement")))),o=this._wrapPosition(o,t);const n=this.document.selection;return n.isCollapsed&&n.getFirstPosition().isEqual(e.start)&&this.setSelection(o),new Io(o)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof Wo))throw new fe("view-writer-unwrap-invalid-attribute",this.document);if(hn(e,this.document),e.isCollapsed)return e;const{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,s=this._unwrapChildren(n,i.offset,o.offset,t),r=this.mergeAttributes(s.start);r.isEqual(s.start)||s.end.offset--;const a=this.mergeAttributes(s.end);return new Io(r,a)}rename(e,t){const i=new Co(this.document,e,t.getAttributes());return this.insert(So._createAfter(t),i),this.move(Io._createIn(t),So._createAt(i,0)),this.remove(Io._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}createSlot(e="children"){if(!this._slotFactory)throw new fe("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let o,n;if(o=i?nn(e):e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new fe("view-writer-invalid-position-container",this.document);n=i?this._breakAttributes(e,!0):e.parent.is("$text")?an(e):e;const s=o._insertChild(n.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=n.getShiftedBy(s),a=this.mergeAttributes(n);a.isEqual(n)||r.offset--;const l=this.mergeAttributes(r);return new Io(a,l)}_wrapChildren(e,t,i,o){let n=t;const s=[];for(;n!1,e.parent._insertChild(e.offset,i);const o=new Io(e,e.getShiftedBy(1));this.wrap(o,t);const n=new So(i.parent,i.index);i._remove();const s=n.nodeBefore,r=n.nodeAfter;return s&&s.is("view:$text")&&r&&r.is("view:$text")?ln(s,r):rn(n)}_breakAttributesRange(e,t=!1){const i=e.start,o=e.end;if(hn(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new Io(i,i)}const n=this._breakAttributes(o,t),s=n.parent.childCount,r=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-s,new Io(r,n)}_breakAttributes(e,t=!1){const i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new fe("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new fe("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new fe("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&un(o.parent))return e.clone();if(un(o))return e.clone();if(o.is("$text"))return this._breakAttributes(an(e),t);if(i==o.childCount){const e=new So(o.parent,o.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new So(o.parent,o.index);return this._breakAttributes(e,t)}{const e=o.index+1,n=o._clone();o.parent._insertChild(e,n),this._addToClonedElementsGroup(n);const s=o.childCount-i,r=o._removeChildren(i,s);n._appendChild(r);const a=new So(o.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function nn(e){let t=e.parent;for(;!un(t);){if(!t)return;t=t.parent}return t}function sn(e,t){return e.priorityt.priority)&&e.getIdentity()i instanceof e)))throw new fe("view-writer-insert-invalid-node-type",t);i.is("$text")||dn(i.getChildren(),t)}}function un(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function hn(e,t){const i=nn(e.start),o=nn(e.end);if(!i||!o||i!==o)throw new fe("view-writer-invalid-range-container",t)}const mn=e=>e.createTextNode(" "),gn=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},pn=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},fn="⁠".repeat(7);function bn(e){return"string"==typeof e?e.substr(0,7)===fn:at(e)&&e.data.substr(0,7)===fn}function wn(e){return 7==e.data.length&&bn(e)}function yn(e){const t="string"==typeof e?e:e.data;return bn(e)?t.slice(7):t}function _n(e,t){if(t.keyCode==$t.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;bn(t)&&i<=7&&e.collapse(t,0)}}}class kn extends(Be()){domDocuments=new Set;domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),Y.isBlink&&!Y.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()}))}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new fe("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!Y.isAndroid)return;let e=null;const t=!(Y.isBlink&&!Y.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=So._createBefore(e.parent)));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),i=t.parent.ownerDocument;bn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=vn(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),s=this._findUpdateActions(n,i,o,Cn);if(-1!==s.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const n of s)if("update"===n){const n=t.equal+t.insert,s=t.equal+t.delete,r=e.getChild(n);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,i[s]),Pt(o[n]),t.equal++}else t[n]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?So._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&at(t.parent)&&bn(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!bn(e))throw new fe("view-renderer-filler-was-lost",this);wn(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;const o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof no||n instanceof no)&&(!!(i!==t.getFillerOffset()||o&&o.is("element","br"))&&(!Y.isAndroid||!o&&!n))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=fn+o),this._updateTextNode(i,o)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){for(const i of Array.from(t.attributes)){const o=i.name;e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(Y.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&at(e)&&at(t)){i.normalize();break}e=t}}const o=t.inlineFillerPosition,n=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&vn(i.ownerDocument,s,o.offset);const r=this._diffNodeLists(n,s),a=this._findUpdateActions(r,n,s,An);let l=0;const c=new Set;for(const e of a)"delete"===e?(c.add(n[l]),Pt(n[l])):"equal"!==e&&"update"!==e||l++;l=0;for(const e of a)"insert"===e?(kt(i,l,s[l]),l++):"update"===e?(this._updateTextNode(n[l],s[l].data),l++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const e of c)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return de(e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;i[i.length-1]==t&&i.pop();return i}(e,this._fakeSelectionContainer),t,xn.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let n=[],s=[],r=[];const a={equal:0,insert:0,delete:0};for(const l of e)"insert"===l?r.push(i[a.equal+a.insert]):"delete"===l?s.push(t[a.equal+a.delete]):(n=n.concat(de(s,r,o).map((e=>"equal"===e?"update":e))),n.push("equal"),s=[],r=[]),a[l]++;return n.concat(de(s,r,o).map((e=>"equal"===e?"update":e)))}_updateTextNode(e,t){const i=e.data;i!=t&&(Y.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){const i=ae(e.data,t);for(const t of i)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(Y.isBlink&&!Y.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e?this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&Y.isAndroid||this._updateDomSelection(e):!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection()}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const o=t.getSelection(),n=t.createRange();o.removeAllRanges(),n.selectNodeContents(i),o.addRange(n)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),Y.isGecko&&function(e,t){let i=e.parent,o=e.offset;at(i)&&wn(i)&&(o=_t(i)+1,i=i.parentNode);if(i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;const n=i.childNodes[o];n&&"BR"==n.tagName&&t.addRange(t.getRangeAt(0))}(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,o=this.domConverter.mapDomToView(i);i&&o&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function vn(e,t,i){const o=t instanceof Array?t:t.childNodes,n=o[i];if(at(n))return n.data=fn+n.data,n;{const n=e.createTextNode(fn);return Array.isArray(t)?o.splice(i,0,n):kt(t,i,n),n}}function Cn(e,t){return Qe(e)&&Qe(t)&&!at(e)&&!at(t)&&!vt(e)&&!vt(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function An(e,t){return Qe(e)&&Qe(t)&&at(e)&&at(t)}function xn(e,t,i){return t===i||(at(t)&&at(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}const En=pn(J.document),Tn=mn(J.document),Pn=gn(J.document),Sn="data-ck-unsafe-attribute-",In="data-ck-unsafe-element";class Rn{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new uo;_inlineObjectElementMatcher=new uo;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:t,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=t||("editing"===i?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?J.document:J.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Oo(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.children)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e&&("img"===i&&("src"===e||"srcset"===e)||("source"===i&&"srcset"===e||!t.replace(/\s+/g,"").match(/^(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const i=(new DOMParser).parseFromString(t,"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);const s=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=s.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(Bn(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return o="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(Bn(i.name),o=this._createReplacementDomElement(i.name)):o=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(o,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(e):o.appendChild(e);return o}}setDomElementAttribute(e,t,i,o){const n=this.shouldRenderAttribute(t,i,e.tagName.toLowerCase())||o&&o.shouldRenderUnsafeAttribute(t);n||be("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:i}),function(e){try{J.document.createAttribute(e)}catch{return!1}return!0}(t)?(e.hasAttribute(t)&&!n?e.removeAttribute(t):e.hasAttribute(Sn+t)&&n&&e.removeAttribute(Sn+t),e.setAttribute(n?t:Sn+t,i)):be("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:i})}removeDomElementAttribute(e,t){t!=In&&(e.removeAttribute(t),e.removeAttribute(Sn+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const n of e.getChildren()){i===o&&(yield this._getBlockFiller());const e=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!ti(n.getAttributes());if(e&&"data"==this.renderingMode)if(n.is("rawElement")){const e=this._domDocument.createElement(n.name);n.render(e,this),yield*[...e.childNodes]}else yield*this.viewChildrenToDom(n,t);else e&&be("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t);o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return bn(i)&&(o+=7),i.data&&o>i.data.length&&(o=i.data.length),{parent:i,offset:o}}{let i,o,n;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{const t=e.nodeBefore;if(o=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!o)return null;i=o.parentNode,n=o.nextSibling}if(at(n)&&bn(n))return{parent:n,offset:7};return{parent:i,offset:o?_t(o)+1:0}}}domToView(e,t={}){const i=[],o=this._domToView(e,t,i),n=o.next().value;return n?(o.next(),this._processDomInlineNodes(null,i,t),"br"==this.blockFillerMode&&Mn(n)||n.is("$text")&&0==n.data.length?null:n):null}*domChildrenToView(e,t={},i=[]){let o=[];o=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let n=0;n{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])})),t.focus({preventScroll:!0}),On(t,(e=>{const[t,i]=n.shift();e.scrollLeft=t,e.scrollTop=i})),J.window.scrollTo(i,o)}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(En):!!Nn(e,this.blockElements)||(e.isEqualNode(Pn)||function(e,t){const i=e.isEqualNode(Tn);return i&&Vn(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=ot(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return mn(this._domDocument);case"markedNbsp":return gn(this._domDocument);case"br":return pn(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(at(e)&&bn(e)&&t<7)return!1;if(this.isElement(e)&&bn(e.childNodes[t]))return!1;const i=this.mapDomToView(e);return!i||!i.is("uiElement")&&!i.is("rawElement")}*_domToView(e,t,i){if("br"!=this.blockFillerMode&&Nn(e,this.blockElements))return null;const o=this.getHostViewElement(e);if(o)return o;if(vt(e)&&t.skipComments)return null;if(at(e)){if(wn(e))return null;{const t=e.data;if(""===t)return null;const o=new no(this.document,t);return i.push(o),o}}{let o=this.mapDomToView(e);if(o)return this._isInlineObjectElement(o)&&i.push(o),o;if(this.isDocumentFragment(e))o=new tn(this.document),t.bind&&this.bindDocumentFragments(e,o);else{o=this._createViewElement(e,t),t.bind&&this.bindElements(e,o);const n=e.attributes;if(n)for(let e=n.length,t=0;t0?t[e-1]:null,l=e+1e.is("element")&&t.includes(e.name)))}(e,this.preElements))return!0;for(const t of e.getAncestors({parentFirst:!0}))if(t.is("element")&&t.hasStyle("white-space")&&"inherit"!==t.getStyle("white-space"))return["pre","pre-wrap","break-spaces"].includes(t.getStyle("white-space"));return!1}_getTouchingInlineViewNode(e,t){const i=new Po({startPosition:t?So._createAfter(e):So._createBefore(e),direction:t?"forward":"backward"});for(const{item:e}of i){if(e.is("$textProxy"))return e;if(!e.is("element")||!e.getCustomProperty("dataPipeline:transparentRendering")){if(e.is("element","br"))return null;if(this._isInlineObjectElement(e))return e;if(e.is("containerElement")||this._isBlockViewElement(e))return null}}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(vt(e))return new Zo(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new _o(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(In,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function On(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function Vn(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function Dn(e,t,i){return" "==t&&e&&e.is("element")&&1==e.childCount&&i.includes(e.name)}function Fn(e,t){return" "==t&&e&&e.is("element","span")&&1==e.childCount&&e.hasAttribute("data-cke-filler")}function Mn(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function Nn(e,t){return"BR"===e.tagName&&Vn(e,t)&&1===e.parentNode.childNodes.length}function Bn(e){"script"===e&&be("domconverter-unsafe-script-element-detected"),"style"===e&&be("domconverter-unsafe-style-element-detected")}class Ln extends(et()){view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}class zn{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Mi(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class jn extends Ln{useCapture=!1;usePassive=!1;observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture,usePassive:this.usePassive})}))}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new zn(this.view,t,i))}}class $n extends jn{domEventType=["keydown","keyup"];onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Ht(this)}};this.fire(e.type,e,t)}}class qn extends Ln{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Li((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new Oo(t.getRanges(),{backward:t.isBackward,fake:!1});e!=$t.arrowleft&&e!=$t.arrowup||i.setTo(i.getFirstPosition()),e!=$t.arrowright&&e!=$t.arrowdown||i.setTo(i.getLastPosition());const o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}class Hn extends Ln{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,i=new Set,o=new Set;for(const i of e){const e=t.mapDomToView(i.target);e&&(e.is("uiElement")||e.is("rawElement")||"childList"!==i.type||this._isBogusBrMutation(i)||o.add(e))}for(const n of e){const e=t.mapDomToView(n.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===n.type){const e=t.findCorrespondingViewText(n.target);e&&!o.has(e.parent)?i.add(e):!e&&bn(n.target)&&o.add(t.mapDomToView(n.target.parentNode))}}const n=[];for(const e of i)n.push({type:"text",node:e});for(const e of o){const i=t.mapViewToDom(e);Wi(Array.from(e.getChildren()),Array.from(t.domChildrenToView(i,{withChildren:!1})),Wn)||n.push({type:"children",node:e})}n.length&&this.document.fire("mutations",{mutations:n})}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}function Wn(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}class Un extends jn{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;const t=this.document;t.on("focus",(()=>this._handleFocus())),t.on("blur",((e,t)=>this._handleBlur(t))),t.on("beforeinput",(()=>{t.isFocused||this._handleFocus()}),{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this._renderTimeoutId=null,this.flush(),this.view.change((()=>{}))}),50)}_handleBlur(e){const t=this.document.selection.editableElement;null!==t&&t!==e.target||(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change((()=>{})))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class Kn extends Ln{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(Hn),this.focusObserver=e.getObserver(Un),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=Li((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Li((()=>this.document.isSelecting=!1),5e3),this.view.document.on("change:isFocused",((e,t,i)=>{if(i&&this._pendingSelectionChange.size){for(const e of Array.from(this._pendingSelectionChange))this._handleSelectionChange(e);this._pendingSelectionChange.clear()}}))}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(()=>{this.document.isComposing&&!Y.isAndroid||(this._handleSelectionChange(t),this._documentIsSelectingInactivityTimeoutDebounced())})),this.listenTo(this.view.document,"compositionstart",(()=>{this._handleSelectionChange(t)}),{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const t=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(t.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(t);if(0!=i.rangeCount)if(this.view.hasDomSelection=!0,this.focusObserver.flush(),this.view.document.isFocused||this.view.document.isReadOnly){if(this._pendingSelectionChange.delete(e),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(function(e){return Array.from(e.getRanges()).flatMap((e=>[e.start.root,e.end.root])).every((e=>e&&e.is("rootElement")))}(i))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}else this.view.forceRender()}else this._pendingSelectionChange.add(e);else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Gn extends jn{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0})),t.on("compositionend",(()=>{t.isComposing=!1}))}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class Jn{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?Zn(e):null,this._native=e}get files(){return this._files||(this._files=Zn(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function Zn(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class Qn extends jn{domEventType="beforeinput";onDomEvent(e){const t=e.getTargetRanges(),i=this.view,o=i.document;let n=null,s=null,r=[];if(e.dataTransfer&&(n=new Jn(e.dataTransfer)),null!==e.data?s=e.data:n&&(s=n.getData("text/plain")),o.selection.isFake)r=Array.from(o.selection.getRanges()),e.preventDefault();else if(t.length)r=t.map((t=>{let o=i.domConverter.domPositionToView(t.startContainer,t.startOffset);const n=i.domConverter.domPositionToView(t.endContainer,t.endOffset);if(o&&bn(t.startContainer)&&t.startOffset<7){e.preventDefault();let i=7-t.startOffset;o=o.getLastMatchingPosition((e=>!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))||!(!e.item.is("$textProxy")||!i--)),{direction:"backward",singleCharacters:!0})}return function(e,t){for(;e.parentNode;){if(at(e)){if(t!=e.data.length)return!1}else if(t!=e.childNodes.length)return!1;if((t=_t(e)+1)<(e=e.parentNode).childNodes.length&&bn(e.childNodes[t]))return!0}return!1}(t.endContainer,t.endOffset)&&e.preventDefault(),o?i.createRange(o,n):n?i.createRange(n):void 0})).filter((e=>!!e));else if(Y.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();r=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(Y.isAndroid&&"insertCompositionText"==e.inputType&&s&&s.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(r[0].end)]});else if(["insertText","insertReplacementText"].includes(e.inputType)&&s&&s.includes("\n")){const t=s.split(/\n{1,2}/g);let i=r;e.preventDefault();for(let s=0;s{if(this.isEnabled&&((i=t.keyCode)==$t.arrowright||i==$t.arrowleft||i==$t.arrowup||i==$t.arrowdown)){const i=new Do(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i}))}observe(){}stopObserving(){}}class Xn extends Ln{constructor(e){super(e);const t=this.document;t.on("keydown",((e,i)=>{if(!this.isEnabled||i.keyCode!=$t.tab||i.ctrlKey)return;const o=new Do(t,"tab",t.selection.getFirstRange());t.fire(o,i),o.stop.called&&e.stop()}))}observe(){}stopObserving(){}}class es extends(Be()){document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new Ho(e),this.domConverter=new Rn(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new kn(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new on(this.document),this.addObserver(Hn),this.addObserver(Un),this.addObserver(Kn),this.addObserver($n),this.addObserver(qn),this.addObserver(Gn),this.addObserver(Yn),this.addObserver(Qn),this.addObserver(Xn),this.document.on("arrowKey",_n,{priority:"low"}),Qo(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0})),Y.isiOS&&this.listenTo(this.document,"blur",((e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})),this.listenTo(this.document,"mutations",((e,{mutations:t})=>{t.forEach((e=>this._renderer.markToSync(e.type,e.node)))}),{priority:"low"}),this.listenTo(this.document,"mutations",(()=>{this.forceRender()}),{priority:"lowest"})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const o={};for(const{name:t,value:n}of Array.from(e.attributes))o[t]=n,"class"===t?this._writer.addClass(n.split(" "),i):i.hasAttribute(t)||this._writer.setAttribute(t,n,i);this._initialDomRootAttributes.set(e,o);const n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),i.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),i.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),i.on("change:isReadOnly",(()=>this.change(n))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,i]of this.domRoots)t.observe(i,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){const n=this.document.selection.getFirstRange();if(!n)return;const s=j({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const r={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",r,s),function({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){const s=Mt(e);let r=s,a=null;for(t=function(e){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:e}(t);r;){let l;l=Nt(r==s?e:a),Rt({parent:l,getRect:()=>Bt(e,r),alignToTop:o,ancestorOffset:i,forceScroll:n});let c=Bt(e,r);const d=Bt(l,r);if(c.height>d.height){const e=c.getIntersection(d);e&&(c=e)}if(It({window:r,rect:c,viewportOffset:t,alignToTop:o,forceScroll:n}),r.parent!=r){if(a=r.frameElement,r=r.parent,!a)return}else r=null}}(r)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new fe("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){fe.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(Un).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class ts{is(){throw new Error("is() method is abstract")}}class is extends ts{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new fe("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new fe("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}is.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class os{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new fe("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new fe("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=ss._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i,o,n;do{o=this.position,n=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const o=rs(t,i),n=o||as(t,i,o);if(n&&n.is("model:element")){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=n;return this._position=t,ns("elementStart",n,e,t,1)}if(n&&n.is("model:$text")){let o;if(this.singleCharacters)o=1;else{let e=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),o=t.offset-e}const n=t.offset-s.startOffset,r=new is(s,n-o,o);return t.offset-=o,this._position=t,ns("text",r,e,t,o)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,ns("elementStart",i,e,t,1)}}function ns(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}class ss extends ts{root;path;stickiness;constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new fe("model-position-root-invalid",e);if(!Array.isArray(t)||0===t.length)throw new fe("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(1===t)return cs(e,this,i);if(-1===t)return cs(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?ds(this.path,t):ds(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==We(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=ss._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?ss._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=ss._createAt(this);if(this.root!=e.root)return i;if("same"==We(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;i.offset-=t}}else if("prefix"==We(e.getParentPath(),this.getParentPath())){const o=e.path.length-1;if(e.offset<=this.path[o]){if(e.offset+t>this.path[o])return null;i.path[o]-=t}}return i}_getTransformedByInsertion(e,t){const i=ss._createAt(this);if(this.root!=e.root)return i;if("same"==We(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}(e,i+1))}function ds(e,t){for(;tt+1;){const t=o.maxOffset-i.offset;0!==t&&e.push(new us(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,o=o.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],o=t-i.offset;0!==o&&e.push(new us(i,i.getShiftedBy(o))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new os(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new os(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new os(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new us(this.start,this.end)]}getTransformedByOperations(e){const t=[new us(this.start,this.end)];for(const i of e)for(let e=0;e0?new this(i,o):new this(o,i)}static _createIn(e){return new this(ss._createAt(e,0),ss._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(ss._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new fe("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const i=e.indexOf(t),o=new this(t.start,t.end);for(let t=i-1;t>=0&&e[t].end.isEqual(o.start);t--)o.start=ss._createAt(e[t].start);for(let t=i+1;t{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new fe("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=ss._createAt(o,n)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);if(t.defer)this._deferredBindingRemovals.set(e,e.root);else{this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i)}}unbindModelElement(e){const t=this.toViewElement(e);if(this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e){this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const o=this._elementToMarkerNames.get(e);o&&(o.delete(t),0==o.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new us(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Io(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e){return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let o=0;for(let i=0;i0;){const e=t.pop(),o=e.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(e.name);if(o)i+=o(e);else if(this._viewToModelMapping.has(e))i+=1;else if(e.is("$text"))i+=e.data.length;else{if(e.is("uiElement"))continue;for(const i of e.getChildren())t.push(i)}}return i}findPositionIn(e,t){if(0===t)return this._moveViewPositionToTextNode(new So(e,0));if(0==this._viewToModelLengthCallbacks.size&&this._viewToModelMapping.has(e)){const i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}return this._findPositionStartingFrom(new So(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,o,n){let s,r=e.parent,a=e.offset;if(r.is("$text"))return new So(r,i-t);let l=t,c=0;for(;l{this._clearCacheInsideParent(t,i.index)};_invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheAfter(t)};save(e,t,i,o){const n=this._cachedMapping.get(i),s=n.cacheMap.get(o);if(s){const i=e.getChild(t-1),o=s.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(s.viewPosition.nodeBefore):0;return void this._nodeToCacheListIndex.set(i,o)}const r={viewPosition:new So(e,t),modelOffset:o};n.maxModelOffset=o>n.maxModelOffset?o:n.maxModelOffset,n.cacheMap.set(o,r);let a=n.cacheList.length-1;for(;a>=0&&n.cacheList[a].modelOffset>o;)a--;if(n.cacheList.splice(a+1,0,r),t>0){const i=e.getChild(t-1);this._nodeToCacheListIndex.set(i,a+1)}}getClosest(e,t){const i=this._cachedMapping.get(e);let o;if(i)if(t>i.maxModelOffset)o=i.cacheList[i.cacheList.length-1];else{const e=i.cacheMap.get(t);o=e||this._findInCacheList(i.cacheList,t)}else o=this.startTracking(e);return{modelOffset:o.modelOffset,viewPosition:o.viewPosition.clone()}}startTracking(e){const t={viewPosition:new So(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(0==t)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{const i=e.getChild(t-1);this._clearCacheAfter(i)}}_clearCacheAll(e){const t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheAfter(e){const t=this._nodeToCacheListIndex.get(e);if(void 0===t){const t=e.parent;return void(this._cachedMapping.has(t)||this._clearCacheInsideParent(t.parent,t.index))}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,t)}_clearCacheFromCacheIndex(e,t){0===t&&(t=1);const i=this._cachedMapping.get(e),o=i.cacheList[t-1];if(!o)return;i.maxModelOffset=o.modelOffset;const n=i.cacheList.splice(t);for(const e of n){i.cacheMap.delete(e.modelOffset);const t=e.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(t)}}_findInCacheList(e,t){let i=0,o=e.length-1,n=o-i>>1,s=e[n];for(;i>1),s=e[n];return s.modelOffset<=t?s:e[n-1]}}class gs{_consumable=new Map;_textProxyRegistry=new Map;add(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(void 0===i)return null;const o=i.get(t);return void 0===o?null:o}revert(e,t){t=ps(t),e instanceof is&&(e=this._getSymbolForTextProxy(e));const i=this.test(e,t);return!1===i?(this._consumable.get(e).set(t,!0),!0):!0!==i&&null}verifyAllConsumed(e){const t=[];for(const[i,o]of this._consumable)for(const[n,s]of o){const o=n.split(":")[0];s&&e==o&&t.push({event:n,item:i.name||i.description})}if(t.length)throw new fe("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){const t=e.startOffset,i=e.endOffset,o=e.parent,n=Symbol("$textProxy:"+e.data);let s,r;return s=this._textProxyRegistry.get(t),s||(s=new Map,this._textProxyRegistry.set(t,s)),r=s.get(i),r||(r=new Map,s.set(i,r)),r.set(o,n),n}}function ps(e){const t=e.split(":");return"insert"==t[0]?t[0]:"addMarker"==t[0]||"removeMarker"==t[0]?e:t.length>1?t[0]+":"+t[1]:t[0]}class fs extends(xe()){_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const o=e.getRefreshedItems(),n=this._createConversionApi(i,o);for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,n);const s=this._reduceChanges(e.getChanges(),o);for(const e of s)"insert"===e.type?this._convertInsert(us._createFromPositionAndShift(e.position,e.length),n):"reinsert"===e.type?this._convertReinsert(us._createFromPositionAndShift(e.position,e.length),n):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,n):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,n);n.mapper.flushDeferredBindings();for(const e of n.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,n),this._convertMarkerAdd(e,i,n)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,n);n.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){const n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(const[e,i]of t)this._convertMarkerAdd(e,i,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);const n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;const s=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,s),this.fire("selection",{selection:e},o),e.isCollapsed){for(const t of s)if(o.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!bs(e.getFirstPosition(),t,o.mapper))continue;const n={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,n,o)}for(const t of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of e.getWalker({shallow:!0}))this._testAndFire("insert",ws(i),t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(const s of e){const e={item:s.item,range:us._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,e,n)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(ws))this.fire(`remove:${e.item.is("element")?e.item.name:"$text"}`,{position:e.range.start,length:e.item.offsetSize,reconversion:!0},t),this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(const n of t.getItems()){if(!i.consumable.test(n,o))continue;const s={item:n,range:us._createOn(n),markerName:e,markerRange:t};this.fire(o,s,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e,t){const i={changes:e,refreshedItems:t};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const o of i)e.add(t,"addMarker:"+o.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const o=function(e,t){const i=t.item.is("element")?t.item.name:"$text";return`${e}:${i}`}(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(i),r=s.get(n);if(r){if(r.has(o))return;r.add(o)}else s.set(n,new Set([o]));this.fire(o,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:us._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const o={...this._conversionApi,consumable:new gs,writer:e,options:i,convertItem:e=>this._convertInsert(us._createOn(e),o),convertChildren:e=>this._convertInsert(us._createIn(e),o,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,o),canReuseView:e=>!t.has(o.mapper.toModelElement(e))};return this._firedEventsMap.set(o,new Map),o}}function bs(e,t,i){const o=t.getRange(),n=Array.from(e.getAncestors());n.shift(),n.reverse();return!n.some((e=>{if(o.containsItem(e)){return!!i.toViewElement(e).getCustomProperty("addHighlight")}}))}function ws(e){return{item:e.item,range:us._createFromPositionAndShift(e.previousPosition,e.length)}}class ys extends ts{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=ai(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),o=e.getAncestors(t);let n=0;for(;i[n]==o[n]&&i[n];)n++;return 0===n?null:i[n-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),o=We(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o](e[t[0]]=t[1],e)),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=ai(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}ys.prototype.is=function(e){return"node"===e||"model:node"===e};class _s extends(xe(ts)){_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...e){super(),e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const o of e._ranges)if(t.isEqual(o)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new us(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new us(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new us(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,i,o]=e;if("object"==typeof i&&(o=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof _s)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof us)this._setRanges([t],!!o&&!!o.backward);else if(t instanceof ss)this._setRanges([new us(t)]);else if(t instanceof ys){const e=!!o&&!!o.backward;let n;if("in"==i)n=us._createIn(t);else if("on"==i)n=us._createOn(t);else{if(void 0===i)throw new fe("model-selection-setto-required-second-parameter",[this,t]);n=new us(ss._createAt(t,i))}this._setRanges([n],e)}else{if(!Ue(t))throw new fe("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,o&&!!o.backward)}}_setRanges(e,t=!1){const i=Array.from(e),o=i.some((t=>{if(!(t instanceof us))throw new fe("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(i.length!==this._ranges.length||o)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new fe("model-selection-setfocus-no-ranges",[this,e]);const i=ss._createAt(e,t);if("same"==i.compareWith(this.focus))return;const o=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(o)?(this._pushRange(new us(i,o)),this._lastRangeBackward=!0):(this._pushRange(new us(o,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Cs(t.start,e);xs(i,t)&&(yield i);const o=t.getWalker();for(const i of o){const n=i.item;"elementEnd"==i.type&&vs(n,e,t)?yield n:"elementStart"==i.type&&n.is("model:element")&&n.root.document.model.schema.isBlock(n)&&o.jumpTo(ss._createAt(n,"end"))}const n=Cs(t.end,e);Es(n,t)&&(yield n)}}containsEntireContent(e=this.anchor.root){const t=ss._createAt(e,0),i=ss._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}toJSON(){const e={ranges:Array.from(this.getRanges()).map((e=>e.toJSON()))},t=Object.fromEntries(this.getAttributes());return Object.keys(t).length&&(e.attributes=t),this.isBackward&&(e.isBackward=!0),e}_pushRange(e){this._checkRange(e),this._ranges.push(new us(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function ks(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function vs(e,t,i){return ks(e,t)&&As(e,i)}function Cs(e,t){const i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let n=!1;const s=o.find((e=>!n&&(n=i.isLimit(e),!n&&ks(e,t))));return o.forEach((e=>t.add(e))),s}function As(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);if(!i)return!0;return!t.containsRange(us._createOn(i),!0)}function xs(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(ss._createAt(e,e.maxOffset))&&As(e,t))}function Es(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(ss._createAt(e,0))&&As(e,t))}_s.prototype.is=function(e){return"selection"===e||"model:selection"===e};class Ts extends(xe(us)){constructor(e,t){super(e,t),Ps.call(this)}detach(){this.stopListening()}toRange(){return new us(this.start,this.end)}static fromRange(e){return new Ts(e.start,e.end)}}function Ps(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&Ss.call(this,i)}),{priority:"low"})}function Ss(e){const t=this.getTransformedByOperation(e),i=us._createFromRanges(t),o=!i.isEqual(this),n=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let s=null;if(o){"$graveyard"==i.root.rootName&&(s="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:s})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:s})}Ts.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};class Is extends ys{_data;constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Is(this.data,this.getAttributes())}static fromJSON(e){return new Is(e.data,e.attributes)}}Is.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};const Rs="selection:";class Os extends(xe(ts)){_selection;constructor(e){super(),this._selection=new Vs(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Rs+e}static _isStoreAttributeKey(e){return e.startsWith(Rs)}}Os.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Vs extends _s{markers=new ei({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,i,o)=>{this._updateMarker(t,o)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const i=e.document.differ;for(const o of i.getChanges()){if("insert"!=o.type)continue;const i=o.position.parent;o.length===i.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(i.getAttributeKeys()).filter((e=>e.startsWith(Rs)));for(const o of t)e.removeAttribute(o,i)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;ee.toJSON()))),e}_validateSelectionRanges(e){for(const t of e)if(!this._document._validateSelectionRange(t))throw new fe("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Ts.fromRange(e);return t.on("change:range",((e,i,o)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const o=t.getRange();for(const i of this.getRanges())o.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1;const n=Array.from(this.markers),s=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!s?(this.markers.add(e),o=!0):!i&&s&&(this.markers.remove(e),o=!0)}else s&&(this.markers.remove(e),o=!0);o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){const t=ai(this._getSurroundingAttributes()),i=ai(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const o=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||o.push(e);for(const[e]of i)this.hasAttribute(e)||o.push(e);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){const o=i?"normal":"low";if("low"==o&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}_removeAttribute(e,t=!0){const i=t?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,i),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,o]of e){this._setAttribute(i,o,!1)&&t.add(i)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Rs)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=Ds(o,t)),i||(i=Ds(n,t)),!this.isGravityOverridden&&!i){let e=o;for(;e&&!i;)e=e.previousSibling,i=Ds(e,t)}if(!i){let e=n;for(;e&&!i;)e=e.nextSibling,i=Ds(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const o of e){if(o.item.is("element")&&t.isObject(o.item)){i=Ds(o.item,t);break}if("text"==o.type){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function Ds(e,t){if(!e)return null;if(e instanceof is||e instanceof Is)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[o,n]of e.getAttributes())t.checkAttribute("$text",o)&&!1!==t.getAttributeProperties(o).copyFromObject&&i.push([o,n]);return i}class Fs{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new fe("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const t=this._offsetToNode[e];if(!t)throw new fe("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){const i=[];for(const e of t){if(!(e instanceof ys))throw new fe("model-nodelist-insertnodes-not-node",this);i.push(e)}let o=this.indexToOffset(e);li(this._nodes,i,e),li(this._offsetToNode,function(e){const t=[];let i=0;for(const o of e)for(let e=0;enull!==e.index)),this._offsetToNode=this._offsetToNode.filter((e=>null!==e.index));let t=0;for(let e=0;ee.toJSON()))}}class Ms extends ys{name;_children=new Fs;constructor(e,t,i){super(t),this.name=e,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?function(e){const t=[];for(const i of e)t.push(i._clone(!0));return t}(this._children):void 0;return new Ms(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Is(e)];Ue(e)||(e=[e]);const t=[];for(const i of e)"string"==typeof i?t.push(new Is(i)):i instanceof is?t.push(new Is(i.data,i.getAttributes())):t.push(i);return t}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push(Ms.fromJSON(i)):t.push(Is.fromJSON(i))}return new Ms(e.name,e.attributes,t)}}Ms.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class Ns{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class Bs extends Ns{elementToElement(e){return this.add(function(e){const t=Us(e.model),i=Ks(e.view,"container");t.attributes.length&&(t.children=!0);return o=>{o.on(`insert:${t.name}`,js(i,Ys(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",Qs(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=Us(e.model),i=Ks(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new fe("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});var n,s;o.on(`insert:${t.name}`,(n=i,s=Ys(t),(e,t,i)=>{if(!s(t.item,i.consumable,{preflight:!0}))return;const o=new Map;i.writer._registerSlotFactory(function(e,t,i){return(o,n)=>{const s=o.createContainerElement("$slot");let r=null;if("children"===n)r=Array.from(e.getChildren());else{if("function"!=typeof n)throw new fe("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});r=Array.from(e.getChildren()).filter((e=>n(e)))}return t.set(s,r),s}}(t.item,o,i));const r=n(t.item,i,t);if(i.writer._clearSlotFactory(),!r)return;!function(e,t,i){const o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new fe("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new fe("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,o,i),s(t.item,i.consumable);const a=t.reconversion&&Hs(t.item,i)||i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,r),i.writer.insert(a,r),i.convertAttributes(t.item),function(e,t,i,o){i.mapper.on("modelToViewPosition",r,{priority:"highest"});let n=null,s=null;for([n,s]of t)Xs(e,s,i,o),i.writer.setCustomProperty("$structureSlotParent",!0,n.parent),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);function r(e,t){const i=t.modelPosition.nodeAfter,o=s.indexOf(i);o<0||(t.viewPosition=t.mapper.findPositionIn(n,o))}i.mapper.off("modelToViewPosition",r)}(r,o,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",Qs(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=j(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=Ks(e.view[i],"attribute");else e.view=Ks(e.view,"attribute");const o=Gs(e);return t=>{t.on(i,zs(o),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=j(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=Js(e.view[i]);else e.view=Js(e.view);const o=Gs(e);return t=>{var n;t.on(i,(n=o,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const o=n(t.attributeOldValue,i,t),s=n(t.attributeNewValue,i,t);if(!o&&!s)return;i.consumable.consume(t.item,e.name);const r=i.mapper.toViewElement(t.item),a=i.writer;if(!r)throw new fe("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&o){let e=o.value;"style"==o.key&&(e="string"==typeof o.value?new go(a.document.stylesProcessor).setTo(o.value).getStylesEntries().map((([e])=>e)):Object.keys(o.value)),a.removeAttribute(o.key,e,r)}if(null!==t.attributeNewValue&&s){let e=s.value;"style"==s.key&&"string"==typeof s.value&&(e=Object.fromEntries(new go(a.document.stylesProcessor).setTo(s.value).getStylesEntries())),a.setAttribute(s.key,e,!1,r)}}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=Ks(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,$s(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,((e,t,i)=>{const o=i.mapper.markerNameToElements(t.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,o)=>{if(!t.item)return;if(!(t.item instanceof _s||t.item instanceof Os||t.item.is("$textProxy")))return;const n=Zs(i,t,o);if(!n)return;if(!o.consumable.consume(t.item,e.name))return;const s=o.writer,r=Ls(s,n),a=s.document.selection;if(t.item instanceof _s||t.item instanceof Os)s.wrap(a.getFirstRange(),r);else{const e=o.mapper.toViewRange(t.range),i=s.wrap(e,r);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){o.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,o)=>{if(!i.item)return;if(!(i.item instanceof Ms))return;const n=Zs(e,i,o);if(!n)return;if(!o.consumable.test(i.item,t.name))return;const s=o.mapper.toViewElement(i.item);if(s&&s.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(const e of us._createIn(i.item))o.consumable.consume(e.item,t.name);s.getCustomProperty("addHighlight")(s,n,o.writer),o.mapper.bindElementToMarker(s,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;const n=Zs(e,i,o);if(!n)return;const s=Ls(o.writer,n),r=o.mapper.markerNameToElements(i.markerName);if(r){for(const e of r)if(o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement"))o.writer.unwrap(o.writer.createRangeOn(e),s);else{e.getCustomProperty("removeHighlight")(e,n.id,o.writer)}o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=j(e);const t=e.model;let i=e.view;i||(i=i=>({group:t,name:i.substr(e.model.length+1)}));return o=>{var n;o.on(`addMarker:${t}`,(n=i,(e,t,i)=>{const o=n(t.markerName,i);if(!o)return;const s=t.markerRange;i.consumable.consume(s,e.name)&&(Ws(s,!1,i,t,o),Ws(s,!0,i,t,o),e.stop())}),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,function(e){return(t,i,o)=>{const n=e(i.markerName,o);if(!n)return;const s=o.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)o.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(r(`data-${n.group}-start-before`,e),r(`data-${n.group}-start-after`,e),r(`data-${n.group}-end-before`,e),r(`data-${n.group}-end-after`,e)):o.writer.clear(o.writer.createRangeOn(e),e);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(n.name),0==i.size?o.writer.removeAttribute(e,t):o.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function Ls(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function zs(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;const n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);const r=o.writer,a=r.document.selection;if(i.item instanceof _s||i.item instanceof Os)r.wrap(a.getFirstRange(),s);else{let e=o.mapper.toViewRange(i.range);null!==i.attributeOldValue&&n&&(e=r.unwrap(e,n)),null!==i.attributeNewValue&&s&&r.wrap(e,s)}}}function js(e,t=tr){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;const s=e(o.item,n,o);if(!s)return;t(o.item,n.consumable);const r=o.reconversion&&Hs(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,s),n.writer.insert(r,s),n.convertAttributes(o.item),Xs(s,o.item.getChildren(),n,{reconversion:o.reconversion})}}function $s(e){return(t,i,o)=>{i.isOpening=!0;const n=e(i,o);i.isOpening=!1;const s=e(i,o);if(!n||!s)return;const r=i.markerRange;if(r.isCollapsed&&!o.consumable.consume(r,t.name))return;for(const e of r)if(!o.consumable.consume(e.item,t.name))return;const a=o.mapper,l=o.writer;l.insert(a.toViewPosition(r.start),n),o.mapper.bindElementToMarker(n,i.markerName),r.isCollapsed||(l.insert(a.toViewPosition(r.end),s),o.mapper.bindElementToMarker(s,i.markerName)),t.stop()}}function qs(e,t){const i=t.writer.remove(e);for(const e of t.writer.createRangeIn(i).getItems())t.mapper.unbindViewElement(e,{defer:!0});return e.start}function Hs(e,t){const i=t.mapper.toViewElement(e);return i&&qs(t.writer.createRangeOn(i),t)}function Ws(e,t,i,o,n){const s=t?e.start:e.end,r=s.nodeAfter&&s.nodeAfter.is("element")?s.nodeAfter:null,a=s.nodeBefore&&s.nodeBefore.is("element")?s.nodeBefore:null;if(r||a){let e,s;t&&r||!t&&!a?(e=r,s=!0):(e=a,s=!1);const l=i.mapper.toViewElement(e);if(l)return void function(e,t,i,o,n,s){const r=`data-${s.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(s.name),o.writer.setAttribute(r,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}(l,t,s,i,o,n)}!function(e,t,i,o,n){const s=`${n.group}-${t?"start":"end"}`,r=n.name?{name:n.name}:null,a=i.writer.createUIElement(s,r);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}(i.mapper.toViewPosition(s),t,i,o,n)}function Us(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?Qt(e.attributes):[],children:!!e.children}}function Ks(e,t){return"function"==typeof e?e:(i,o)=>function(e,t,i){"string"==typeof e&&(e={name:e});let o;const n=t.writer,s=Object.assign({},e.attributes);if("container"==i)o=n.createContainerElement(e.name,s);else if("attribute"==i){const t={priority:e.priority||Wo.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,s,t)}else o=n.createUIElement(e.name,s);if(e.styles){const t=Object.keys(e.styles);for(const i of t)n.setStyle(i,e.styles[i],o)}if(e.classes){const t=e.classes;if("string"==typeof t)n.addClass(t,o);else for(const e of t)n.addClass(e,o)}return o}(e,o,t)}function Gs(e){return e.model.values?(t,i,o)=>{const n=e.view[t];return n?n(t,i,o):null}:e.view}function Js(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function Zs(e,t,i){const o="function"==typeof e?e(t,i):{...e};return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function Qs(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const o=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const n="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(n&&t(n,e)&&"reinsert"!=e.type){if("insert"==e.type&&"rename"==e.action&&i.refreshedItems.add(e.position.nodeAfter),!i.reconvertedElements.has(n)){i.reconvertedElements.add(n);const e=ss._createBefore(n);let t=o.length;for(let i=o.length-1;i>=0;i--){const n=o[i],s=("attribute"==n.type?n.range.start:n.position).compareWith(e);if("before"==s||"remove"==n.type&&"same"==s)break;t=i}o.splice(t,0,{type:"reinsert",name:n.name,position:e,length:1})}}else o.push(e)}i.changes=o}}function Ys(e){return(t,i,o={})=>{const n=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>i.test(t,e)))&&(o.preflight||n.forEach((e=>i.consume(t,e))),!0)}}function Xs(e,t,i,o){for(const n of t)er(e.root,n,i,o)||i.convertItem(n)}function er(e,t,i,o){const{writer:n,mapper:s}=i;if(!o.reconversion)return!1;const r=s.toViewElement(t);return!(!r||r.root==e)&&(!!i.canReuseView(r)&&(n.move(n.createRangeOn(r),s.toViewPosition(ss._createBefore(t))),!0))}function tr(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function ir(e){const{schema:t,document:i}=e.model;for(const o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function or(e,t,i){const o=i.createContext(e);return!!i.checkChild(o,"paragraph")&&!!i.checkChild(o.push("paragraph"),t)}function nr(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class sr extends Ns{elementToElement(e){return this.add(rr(e))}elementToAttribute(e){return this.add(function(e){e=j(e),cr(e);const t=dr(e,!1),i=ar(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=j(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let o;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";o={[e]:i}}else o={attributes:{[t]:i}};e.view.name&&(o.name=e.view.name);return e.view=o,t}(e));cr(e,t);const i=dr(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const o="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}(e.model);return rr({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=j(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=lr(ur(t,"start")),o=lr(ur(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});const s=ge.low,r=ge.highest,a=ge.get(e.converterPriority)/r;n.on("element",function(e){return(t,i,o)=>{const n=`data-${e.view}`;function s(t,n){for(const s of n){const n=e.model(s,o),r=o.writer.createElement("$marker",{"data-name":n});o.writer.insert(r,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(o.consumable.test(i.viewItem,{attributes:n+"-end-after"})||o.consumable.test(i.viewItem,{attributes:n+"-start-after"})||o.consumable.test(i.viewItem,{attributes:n+"-end-before"})||o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))&&(i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(",")))}}(t),{priority:s+a})}}(e))}}function rr(e){const t=lr(e=j(e)),i=ar(e.view),o=i?`element:${i}`:"element";return i=>{i.on(o,t,{priority:e.converterPriority||"normal"})}}function ar(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function lr(e){const t=new uo(e.view);return(i,o,n)=>{const s=t.match(o.viewItem);if(!s)return;const r=s.match;if(r.name=!0,!n.consumable.test(o.viewItem,r))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,r),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function cr(e,t=null){const i=null===t||(e=>e.getAttribute(t)),o="object"!=typeof e.model?e.model:e.model.key,n="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:o,value:n}}function dr(e,t){const i=new uo(e.view);return(o,n,s)=>{if(!n.modelRange&&t)return;const r=i.match(n.viewItem);if(!r)return;if(!function(e,t){const i="function"==typeof e?e(t):e;if("object"==typeof i&&!ar(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(e.view,n.viewItem)?delete r.match.name:r.match.name=!0,!s.consumable.test(n.viewItem,r.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(n.viewItem,s,n):e.model.value;if(null==l)return;n.modelRange||Object.assign(n,s.convertChildren(n.viewItem,n.modelCursor));const c=function(e,t,i,o){let n=!1;for(const s of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(s,t.key)&&(n=!0,s.hasAttribute(t.key)||o.writer.setAttribute(t.key,t.value,s));return n}(n.modelRange,{key:a,value:l},t,s);c&&(s.consumable.test(n.viewItem,{name:!0})&&(r.match.name=!0),s.consumable.consume(n.viewItem,r.match))}}function ur(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const o=t.getAttribute("name"),n=e.model(o,i);return i.writer.createElement("$marker",{"data-name":n})}}}class hr extends(Be()){model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new es(t),this.mapper=new hs,this.downcastDispatcher=new fs({mapper:this.mapper,schema:e.schema});const i=this.model.document,o=i.selection,n=this.model.markers;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(i.differ,n,e),this.downcastDispatcher.convertSelection(o,n,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,o)=>{const n=o.newSelection,s=[];for(const e of n.getRanges())s.push(t.toModelRange(e));const r=e.createSelection(s,{backward:n.isBackward});r.isEqual(e.document.selection)||e.change((e=>{e.setSelection(r)}))}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,i)=>{if(t.reconversion)return;const o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),s=i.mapper.toViewPosition(n,{isPhantom:!0});qs(i.writer.createRange(o,s).getTrimmed(),i)}),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",((e,t,i)=>{const o=i.writer,n=o.document.selection;for(const e of n.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);o.setSelection(null)})),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=[];for(const e of o.getRanges())n.push(i.mapper.toViewRange(e));i.writer.setSelection(n,{backward:o.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,i)=>{const o=t.selection;if(!o.isCollapsed)return;if(!i.consumable.consume(o,"selection"))return;const n=i.writer,s=o.getFirstPosition(),r=i.mapper.toViewPosition(s),a=n.breakAttributes(r);n.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new To(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,i=this.model.markers.get(t);if(!i)throw new fe("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(i)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class mr extends(Be()){_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new gr(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new gr(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new fe("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new fe("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(e,t)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i)return!1;const o=this._evaluateAttributeChecks(e,t);return void 0!==o?o:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof ss){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof Ms))throw new fe("schema-check-merge-no-element-before",this);if(!(i instanceof Ms))throw new fe("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}if(this.isLimit(e)||this.isLimit(t))return!1;for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customChildChecks.get(i)||[];o.push(e),this._customChildChecks.set(i,o)}addAttributeCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,o=this._customAttributeChecks.get(i)||[];o.push(e),this._customAttributeChecks.set(i,o)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;if(e instanceof ss)t=e.parent;else{t=(e instanceof us?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i}),null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new Is("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t,i={}){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const o of e)yield*this._getValidRangesForRange(o,t,i)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new us(e);let i,o;const n=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(i=new os({boundaries:us._createIn(n),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(o=new os({boundaries:us._createIn(n),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,o)){const t=e.walker==i?"elementEnd":"elementStart",o=e.value;if(o.type==t&&this.isObject(o.item))return us._createOn(o.item);if(this.checkChild(o.nextPosition,"$text"))return new us(o.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const o=i.model;for(const[n,s]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,s,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))Tr(this,i,t);else{const e=us._createIn(i).getPositions();for(const i of e){Tr(this,i.nodeBefore||i.parent,t)}}}getAttributesWithProperty(e,t,i){const o={};for(const[n,s]of e.getAttributes()){const e=this.getAttributeProperties(n);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(o[n]=s))}return o}createContext(e){return new gr(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const o of i)e[o]=pr(t[o],o);const o=Object.values(e);for(const t of o)fr(e,t),br(e,t),wr(e,t),yr(e,t);for(const t of o)_r(e,t);for(const t of o)kr(e,t);for(const t of o)vr(e,t);for(const t of o)Cr(e,t);for(const t of o)Ar(e,t);this._compiledDefinitions=function(e){const t={};for(const i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter((t=>!!e[t])),allowChildren:Array.from(i.allowChildren).filter((t=>!!e[t])),allowAttributes:Array.from(i.allowAttributes)};return t}(e)}_checkContextMatch(e,t){const i=e.last;let o=this._evaluateChildChecks(e,t);if(o=void 0!==o?o:t.allowIn.includes(i.name),!o)return!1;const n=this.getDefinition(i),s=e.trimLast();return!!n&&(0==s.length||this._checkContextMatch(s,n))}_evaluateChildChecks(e,t){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],o=this._customChildChecks.get(t.name)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}_evaluateAttributeChecks(e,t){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],o=this._customAttributeChecks.get(t)||[];for(const n of[...i,...o]){const i=n(e,t);if(void 0!==i)return i}}*_getValidRangesForRange(e,t,i){let o=e.start,n=e.start;for(const s of e.getItems({shallow:!0})){if(s.is("element"))if(i.includeEmptyRanges&&s.isEmpty){const e=this.createContext(s);this.checkChild(e,"$text")&&this.checkAttribute(e.push("$text"),t)&&(yield us._createIn(s))}else yield*this._getValidRangesForRange(us._createIn(s),t,i);this.checkAttribute(s,t)||(o.isEqual(n)||(yield new us(o,n)),o=ss._createAfter(s)),n=ss._createAfter(s)}o.isEqual(n)||(yield new us(o,n))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new us(ss._createAt(i,t)):us._createOn(i);const o=ti(e.getSelectedBlocks());if(!o)return new us(e.focus);if(o.isEmpty)return new us(ss._createAt(o,0));const n=ss._createAfter(o);return e.focus.isTouching(n)?new us(n):new us(ss._createBefore(o))}}class gr{_items;constructor(e){if(e instanceof gr)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Er)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new gr([e]);return t._items=[...this._items,...t._items],t}trimLast(){const e=new gr([]);return e._items=this._items.slice(0,-1),e}getItem(e){return this._items[e]}*getNames(){yield*this._items.map((e=>e.name))}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function pr(e,t){const i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return function(e,t){for(const i of e){const e=Object.keys(i).filter((e=>e.startsWith("is")));for(const o of e)t[o]=!!i[o]}}(e,i),xr(e,i,"allowIn"),xr(e,i,"allowChildren"),xr(e,i,"disallowIn"),xr(e,i,"disallowChildren"),xr(e,i,"allowContentOf"),xr(e,i,"allowWhere"),xr(e,i,"allowAttributes"),xr(e,i,"disallowAttributes"),xr(e,i,"allowAttributesOf"),xr(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.add(e),t.allowWhere.add(e),t.allowAttributesOf.add(e),t.inheritTypesFrom.add(e))}}(e,i),i}function fr(e,t){for(const i of t.allowIn){const o=e[i];o?o.allowChildren.add(t.name):t.allowIn.delete(i)}}function br(e,t){for(const i of t.allowChildren){const o=e[i];o?o.allowIn.add(t.name):t.allowChildren.delete(i)}}function wr(e,t){for(const i of t.disallowIn){const o=e[i];o?o.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function yr(e,t){for(const i of t.disallowChildren){const o=e[i];o?o.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function _r(e,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function kr(e,t){for(const i of t.allowContentOf){const o=e[i];o&&(o.disallowChildren.forEach((i=>{t.allowChildren.has(i)||(t.disallowChildren.add(i),e[i].disallowIn.add(t.name))})),o.allowChildren.forEach((i=>{t.disallowChildren.has(i)||(t.allowChildren.add(i),e[i].allowIn.add(t.name))})))}}function vr(e,t){for(const i of t.allowWhere){const o=e[i];o&&(o.disallowIn.forEach((i=>{t.allowIn.has(i)||(t.disallowIn.add(i),e[i].disallowChildren.add(t.name))})),o.allowIn.forEach((i=>{t.disallowIn.has(i)||(t.allowIn.add(i),e[i].allowChildren.add(t.name))})))}}function Cr(e,t){for(const i of t.allowAttributesOf){const o=e[i];if(!o)return;o.allowAttributes.forEach((e=>{t.disallowAttributes.has(e)||t.allowAttributes.add(e)}))}}function Ar(e,t){for(const i of t.inheritTypesFrom){const o=e[i];if(o){const e=Object.keys(o).filter((e=>e.startsWith("is")));for(const i of e)i in t||(t[i]=o[i])}}}function xr(e,t,i){for(const o of e){let e=o[i];"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach((e=>t[i].add(e)))}}function Er(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Tr(e,t,i){for(const o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}class Pr extends(xe()){conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const o of new gr(e)){const e={};for(const t of o.getAttributeKeys())e[t]=o.getAttribute(t);const n=t.createElement(o.name,e);i&&t.insert(n,i),i=ss._createAt(n,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=ro.createFrom(e),this.conversionApi.store={};const{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();const e=this._modelCursor.parent,i=e._removeChildren(0,e.childCount);n._insertChild(0,i),n.markers=function(e,t){const i=new Set,o=new Map,n=us._createIn(e).getItems();for(const e of n)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),n=t.createPositionBefore(e);o.has(i)?o.get(i).end=n.clone():o.set(i,new us(n.clone())),t.remove(e)}return o}(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof us))throw new fe("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:ss._createAt(t,0);const o=new us(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof us&&(o.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));const n=this._cursorParents.get(e);t.modelCursor=n?o.createPositionAt(n,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:o}=this.conversionApi;let n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return or(t,e,i)?{position:nr(t,o)}:null;const s=this.conversionApi.writer.split(t,n),r=[];for(const e of s.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),i=e.item;this._registerSplitPair(t,i)}const a=s.range.end.parent;return this._cursorParents.set(e,a),{position:s.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){const e=new Map;for(const t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){const i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(const[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}}class Sr{getHtml(e){const t=J.document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class Ir{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new Rn(e,{renderingMode:"data"}),this.htmlWriter=new Sr}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}}class Rr extends(xe()){model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new hs,this.downcastDispatcher=new fs({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Pr({schema:e.schema}),this.viewDocument=new Ho(t),this.stylesProcessor=t,this.htmlProcessor=new Ir(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new on(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:i,consumable:o,writer:n})=>{let s=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(s,"$text")){if(!or(s,"$text",i))return;if(0==t.viewItem.data.trim().length)return;s=nr(s,n)}o.consume(t.viewItem);const r=n.createText(t.viewItem.data);n.insert(r,s),t.modelRange=n.createRange(s,s.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:o}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=o}}),{priority:"lowest"}),Be().prototype.decorate.call(this,"init"),Be().prototype.decorate.call(this,"set"),Be().prototype.decorate.call(this,"get"),Be().prototype.decorate.call(this,"toView"),Be().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},ir)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new fe("datacontroller-get-non-existent-root",this);const o=this.model.document.getRoot(t);return o.isAttached()||be("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(o,{ignoreWhitespaces:!0})?this.stringify(o,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();const n=us._createIn(e),s=new tn(i);this.mapper.bindElements(e,s);const r=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const o=us._createIn(e);for(const e of i.model.markers){const i=e.getRange(),n=i.isCollapsed,s=i.start.isEqual(o.start)||i.end.isEqual(o.end);if(n&&s)t.push([e.name,i]);else{const n=o.getIntersection(i);n&&t.push([e.name,n])}}return t.sort((([e,t],[i,o])=>{if("after"!==t.end.compareWith(o.start))return 1;if("before"!==t.start.compareWith(o.end))return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(n,r,o,t),s}init(e){if(this.model.document.version)throw new fe("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new fe("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const i of Object.keys(t)){const o=this.model.document.getRoot(i);e.insert(this.parse(t[i],o),o,0)}})),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new fe("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(i)){const o=this.model.document.getRoot(t);e.remove(e.createRangeIn(o)),e.insert(this.parse(i[t],o),o,0)}}))}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change((i=>this.upcastDispatcher.convert(e,i,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class Or{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=Qt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Qt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new fe("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new fe("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of Vr(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new fe("conversion-group-exists",this);const o=i?new Bs(t):new sr(t);this._helpers.set(e,o)}}function*Vr(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},o=e.view[t],n=e.upcastAlso?e.upcastAlso[t]:void 0;yield*Dr(i,o,n)}else yield*Dr(e.model,e.view,e.upcastAlso)}function*Dr(e,t,i){if(yield{model:e,view:t},i)for(const t of Qt(i))yield{model:e,view:t}}class Fr{baseVersion;isDocumentOperation;batch;constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function Mr(e,t){const i=Lr(t),o=i.reduce(((e,t)=>e+t.offsetSize),0),n=e.parent;jr(e);const s=e.index;return n._insertChild(s,i),zr(n,s+i.length),zr(n,s),new us(e,e.getShiftedBy(o))}function Nr(e){if(!e.isFlat)throw new fe("operation-utils-remove-range-not-flat",this);const t=e.start.parent;jr(e.start),jr(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return zr(t,e.start.index),i}function Br(e,t){if(!e.isFlat)throw new fe("operation-utils-move-range-not-flat",this);const i=Nr(e);return Mr(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function Lr(e){const t=[];!function e(i){if("string"==typeof i)t.push(new Is(i));else if(i instanceof is)t.push(new Is(i.data,i.getAttributes()));else if(i instanceof ys)t.push(i);else if(Ue(i))for(const t of i)e(t)}(e);for(let e=1;ee.maxOffset)throw new fe("move-operation-nodes-do-not-exist",this);if(e===t&&i=i&&this.targetPosition.path[e]e._clone(!0)))),t=new Hr(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new ss(e,[0]);return new qr(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),Mr(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes)t.name?i.push(Ms.fromJSON(t)):i.push(Is.fromJSON(t));const o=new Hr(ss.fromJSON(e.position,t),i,e.baseVersion);return o.shouldReceiveAttributes=e.shouldReceiveAttributes,o}}class Wr extends Fr{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(e,t,i,o,n){super(n),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=o?o.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new ss(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new us(this.splitPosition,e)}get affectedSelectable(){const e=[us._createFromPositionAndShift(this.splitPosition,0),us._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(us._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new Wr(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new ss(e,[0]);return new Ur(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset1&&e.sourcePosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(t.deletionPosition)&&this._setRelation(e,t,"lastToMoveMerged"):t instanceof qr&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof Wr){if(t instanceof Ur)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof qr)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const o=i.end.offset-e.splitPosition.offset,n=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:o,offset:n})}}}else if(e instanceof Ur)t instanceof Ur?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof Wr?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof qr&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof Kr){const i=e.newRange;if(!i)return;if(t instanceof Ur){const o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),s=i.end.isEqual(t.deletionPosition),r=i.end.isEqual(t.sourcePosition);(o||n||s||r)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:s,wasInRightElement:r})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;const n=this.originalOperations.get(e),s=this._relations.get(n);return s&&s.get(o)||null}_setRelation(e,t,i){const o=this.originalOperations.get(e),n=this.originalOperations.get(t);let s=this._relations.get(o);s||(s=new Map,this._relations.set(o,s)),s.set(n,i)}}function aa(e,t){for(const i of e)i.baseVersion=t++}function la(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const o=e.range.getDifference(t.range).map((t=>new Gr(t,e.key,e.oldValue,e.newValue,0))),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new Gr(n,t.key,t.newValue,e.newValue,0)),0==o.length?[new Jr(0)]:o}return[e]})),ia(Gr,Hr,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const o=da(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),ia(Gr,Ur,((e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(us._createFromPositionAndShift(t.graveyardPosition,1));const o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),ia(Gr,qr,((e,t)=>{const i=function(e,t){const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);let o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];const s=[];for(let e of n){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),o=e.start.hasSameParentAs(i),n=e._getTransformedByInsertion(i,t.howMany,o);s.push(...n)}o&&s.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return s}(e.range,t);return i.map((t=>new Gr(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),ia(Gr,Wr,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new us(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),ia(Hr,Gr,((e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const o=da(e,t.key,t.newValue);o&&i.push(o)}return i})),ia(Hr,Hr,((e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),ia(Hr,qr,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),ia(Hr,Wr,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),ia(Hr,Ur,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),ia(Kr,Hr,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),ia(Kr,Kr,((e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new Jr(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),ia(Kr,Ur,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),ia(Kr,qr,((e,t)=>{const i=[e];if(e.oldRange&&(e.oldRange=us._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){const o=e.newRange._getTransformedByMoveOperation(t);e.newRange=o[0];for(let t=1;t{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)?i.abRelation.wasStartBeforeMergedElement?e.newRange.start=ss._createAt(t.insertionPosition):i.abRelation.wasInLeftElement?e.newRange.start=ss._createAt(e.newRange.start):e.newRange.start=ss._createAt(t.moveTargetPosition):e.newRange.start=o.start,e.newRange.end.isEqual(t.splitPosition)?e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=ss._createAt(t.insertionPosition):i.abRelation.wasInRightElement?e.newRange.end=ss._createAt(t.moveTargetPosition):e.newRange.end=ss._createAt(e.newRange.end):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),ia(Ur,Hr,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),ia(Ur,Ur,((e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new ss(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new Jr(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const o="$graveyard"==e.targetPosition.root.rootName,n="$graveyard"==t.targetPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),o=e.targetPosition._getTransformedByMergeOperation(t);return[new qr(i,e.howMany,o,0)]}return[new Jr(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),ia(Ur,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new Jr(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),ia(Ur,Wr,((e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){if(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),ia(qr,Hr,((e,t)=>{const i=us._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),ia(qr,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(e.sourcePosition,e.howMany),n=us._createFromPositionAndShift(t.sourcePosition,t.howMany);let s,r=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),s=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ua(e,t)&&ua(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ha([o],s);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),ha([o],s);const l=We(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),ha([o],s);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(r=!1):r=!0;const c=[],d=o.getDifference(n);for(const e of d){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==We(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),o=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);c.push(...o)}const u=o.getIntersection(n);return null!==u&&r&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(u):1==c.length?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(u):c.push(u):c.splice(1,0,u)),0===c.length?[new Jr(e.baseVersion)]:ha(c,s)})),ia(qr,Wr,((e,t,i)=>{let o=e.targetPosition.clone();if(e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(o=e.targetPosition._getTransformedBySplitOperation(t)),e.sourcePosition.isEqual(t.insertionPosition)&&"firstToMoveMerged"==i.abRelation)return e.howMany++,e.targetPosition=o,[e];const n=us._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return t.graveyardPosition&&"lastToMoveMerged"!=i.abRelation||e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let e=new us(t.splitPosition,n.end);e=e._getTransformedBySplitOperation(t);return ha([new us(n.start,t.splitPosition),e],o)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(o=e.targetPosition);const s=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&o&&!i.aWasUndone&&s.push(us._createFromPositionAndShift(t.insertionPosition,1))}return ha(s,o)})),ia(qr,Ur,((e,t,i)=>{const o=us._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Jr(0)]}else if(!i.aWasUndone){const i=[];let o=t.graveyardPosition.clone(),n=t.targetPosition._getTransformedByMergeOperation(t);const s=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(i.push(new qr(e.sourcePosition,e.howMany-1,s,0)),o=o._getTransformedByMove(e.sourcePosition,s,e.howMany-1),n=n._getTransformedByMove(e.sourcePosition,s,e.howMany-1));const r=t.deletionPosition._getCombined(e.sourcePosition,s),a=new qr(o,1,r,0),l=a.getMovedRangeStart().path.slice();l.push(0);const c=new ss(a.targetPosition.root,l);n=n._getTransformedByMove(o,r,1);const d=new qr(n,t.howMany,c,0);return i.push(a),i.push(d),i}const n=us._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),ia(Zr,Hr,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),ia(Zr,Ur,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),ia(Zr,qr,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),ia(Zr,Zr,((e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new Jr(0)];e.oldName=t.newName}return[e]})),ia(Zr,Wr,((e,t)=>{if("same"==We(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new Zr(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),ia(Qr,Qr,((e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong)return[new Jr(0)];e.oldValue=t.newValue}return[e]})),ia(Yr,Yr,((e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new Jr(0)]:[e])),ia(Wr,Hr,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const o=new ss(t.graveyardPosition.root,i),n=Wr.getInsertionPosition(new ss(t.graveyardPosition.root,i)),s=new Wr(o,0,n,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),e.graveyardPosition=s.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[s,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),ia(Wr,qr,((e,t,i)=>{const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&n){const i=e.splitPosition._getTransformedByMoveOperation(t),o=e.graveyardPosition._getTransformedByMoveOperation(t),n=o.path.slice();n.push(0);const s=new ss(o.root,n);return[new qr(i,e.howMany,s,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const n=e.splitPosition.isEqual(t.targetPosition);if(n&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Wr.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:o}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(o),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Jr(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Jr(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const o="$graveyard"==e.splitPosition.root.rootName,n="$graveyard"==t.splitPosition.root.rootName;if(n&&!o||!(o&&!n)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new qr(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new qr(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new Jr(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const o=new ss(t.insertionPosition.root,i);return[e,new qr(e.insertionPosition,1,o,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const i=t[0];i.isDocumentOperation&&pa.call(this,i)}),{priority:"low"})}function pa(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}ma.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class fa{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},be("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:o=!1,isTyping:n=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=o,this.isTyping=n}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}}class ba{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(e){this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size&&0==this._changedRoots.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);const o=us._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of o.getItems({shallow:!0}))this._setElementState(e,"move");break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=us._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._setElementState(t.position.nodeAfter,"rename");break}case"split":{const e=t.splitPosition.parent;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany);const i=us._createFromPositionAndShift(t.splitPosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&(this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1),this._setElementState(t.graveyardPosition.nodeAfter,"move"));break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1),this._setElementState(e,"move");const o=t.targetPosition.parent;if(!this._isInInsertedElement(o)){this._markInsert(o,t.targetPosition.offset,e.maxOffset);const i=us._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let o=this._changedMarkers.get(e);o?o.newMarkerData=i:(o={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,o)),null==o.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this.getChanges().length)return!0;if(this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const i=e.range&&!t.range,o=!e.range&&t.range,n=e.range&&t.range&&!e.range.isEqual(t.range);if(i||o||n)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(ka),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map((e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t}))}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e),this._setElementState(e,"refresh");const t=us._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,o){const n=this._changedRoots.get(e)||{name:e},s=n.attributes||{};if(s[t]){const e=s[t];o===e.oldValue?delete s[t]:e.newValue=o}else s[t]={oldValue:i,newValue:o};0===Object.entries(s).length?(delete n.attributes,void 0===n.state&&this._changedRoots.delete(e)):(n.attributes=s,this._changedRoots.set(e,n))}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const o={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,o),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;ei&&this._elementState.set(e,t)}_getDiffActionForNode(e,t){if(!e.is("element"))return t;if(!this._elementsSnapshots.has(e))return t;const i=this._elementState.get(e);return i&&"move"!=i?i:t}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const t=ya(e.getChildren());this._elementChildrenSnapshots.set(e,t);for(const e of t)this._elementsSnapshots.set(e.node,e)}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const i of t){const o=e.offset+e.howMany,n=i.offset+i.howMany;if("insert"==e.type&&("insert"==i.type&&(e.offset<=i.offset?i.offset+=e.howMany:e.offseti.offset){if(o>n){const e={type:"attribute",offset:n,howMany:o-n,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offsetn?(e.nodesToHandle=o-n,e.offset=n):e.nodesToHandle=0);if("remove"==i.type&&e.offseti.offset){const n={type:"attribute",offset:i.offset,howMany:o-i.offset,count:this._changeCount++};this._handleChange(n,t),t.push(n),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&o<=n?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&o>=n&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i,o,n){const s={type:"insert",position:ss._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++,action:i};return"insert"!=i&&n&&(s.before={name:n.name,attributes:new Map(n.attributes)}),s}_getRemoveDiff(e,t,i,o){return{type:"remove",action:i,position:ss._createAt(e,t),name:o.name,attributes:new Map(o.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const o=[];i=new Map(i);for(const[n,s]of t){const t=i.has(n)?i.get(n):null;t!==s&&o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:n,attributeOldValue:s,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(n)}for(const[t,n]of i)o.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:n,changeCount:this._changeCount++});return o}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),o=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&o>=e.offset&&oo){for(let t=0;t1500)for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new fe("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const i=this._operations[0];void 0===e&&(e=i.baseVersion);let o=t-1;for(const[t,i]of this._gaps)e>t&&et&&othis.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);void 0===n&&(n=0);let s=this._baseVersionToOperationIndex.get(o);return void 0===s&&(s=this._operations.length-1),this._operations.slice(n,s+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Ca extends Ms{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Ca.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const Aa="$graveyard";class xa extends(xe()){model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new va,this.selection=new Os(this),this.roots=new ei({idProperty:"rootName"}),this.differ=new ba(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Aa),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,i,o,n)=>{const s={...t.getData(),range:o};this.differ.bufferMarkerChange(t.name,n,s),null===i&&t.on("change",((e,i)=>{const o=t.getData();this.differ.bufferMarkerChange(t.name,{...o,range:i},o)}))})),this.registerPostFixer((e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Aa)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new fe("model-document-createroot-name-exists",this,{name:t});const i=new Ca(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map((e=>e.rootName))}getRoots(e=!1){return this.roots.filter((t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ki(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Ea(e.start)&&Ea(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Ea(e){const t=e.textNode;if(t){const i=t.data,o=e.offset-t.startOffset;return!ui(i,o)&&!hi(i,o)}return!0}class Ta extends(xe()){_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Pa?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){const n=e instanceof Pa?e.name:e;if(n.includes(","))throw new fe("markercollection-incorrect-marker-name",this);const s=this._markers.get(n);if(s){const e=s.getData(),r=s.getRange();let a=!1;return r.isEqual(t)||(s._attachLiveRange(Ts.fromRange(t)),a=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,a=!0),"boolean"==typeof o&&o!=s.affectsData&&(s._affectsData=o,a=!0),a&&this.fire(`update:${n}`,s,r,t,e),s}const r=Ts.fromRange(t),a=new Pa(n,r,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Pa?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof Pa?e.name:e,i=this._markers.get(t);if(!i)throw new fe("markercollection-refresh-marker-not-exists",this);const o=i.getRange();this.fire(`update:${t}`,i,o,o,i.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Pa extends(xe(ts)){name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new fe("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Pa.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Sa extends Fr{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new fe("detach-operation-on-document-node",this)}_execute(){Nr(us._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Ia extends ts{markers=new Map;_children=new Fs;constructor(e){super(),e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push(Ms.fromJSON(i)):t.push(Is.fromJSON(i));return new Ia(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Is(e)];Ue(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Is(e):e instanceof is?new Is(e.data,e.getAttributes()):e))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const t of e)t.parent=null}}Ia.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class Ra{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Is(e,t)}createElement(e,t){return new Ms(e,t)}createDocumentFragment(){return new Ia}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof Is&&""==e.data)return;const o=ss._createAt(t,i);if(e.parent){if(Ma(e.root,o.root))return void this.move(us._createOn(e),o);if(e.root.document)throw new fe("model-writer-insert-forbidden-move",this);this.remove(e)}const n=o.root.document?o.root.document.version:null,s=e instanceof Ia?e._removeChildren(0,e.childCount):e,r=new Hr(o,s,n);if(e instanceof Is&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof Ia)for(const[t,i]of e.markers){const e=ss._createAt(i.root,0),n={range:new us(i.start._getCombined(e,o),i.end._getCombined(e,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,n):this.addMarker(t,n)}}insertText(e,t,i,o){t instanceof Ia||t instanceof Ms||t instanceof ss?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof Ia||t instanceof Ms||t instanceof ss?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof Ia||t instanceof Ms?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof Ia||t instanceof Ms?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof us){const o=i.getMinimalFlatRanges();for(const i of o)Oa(this,e,t,i)}else Va(this,e,t,i)}setAttributes(e,t){for(const[i,o]of ai(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof us){const i=t.getMinimalFlatRanges();for(const t of i)Oa(this,e,null,t)}else Va(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof us)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof us))throw new fe("writer-move-invalid-range",this);if(!e.isFlat)throw new fe("writer-move-range-not-flat",this);const o=ss._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Ma(e.root,o.root))throw new fe("writer-move-different-document",this);const n=e.root.document?e.root.document.version:null,s=new qr(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof us?e:us._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Fa(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Ms))throw new fe("writer-merge-no-element-before",this);if(!(i instanceof Ms))throw new fe("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,i=e.nodeAfter;this.move(us._createIn(i),ss._createAt(t,"end")),this.remove(i)}_merge(e){const t=ss._createAt(e.nodeBefore,"end"),i=ss._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new ss(o,[0]),s=e.root.document.version,r=new Ur(i,e.nodeAfter.maxOffset,t,n,s);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Ms))throw new fe("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,o=new Zr(ss._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i,o,n=e.parent;if(!n.parent)throw new fe("writer-split-element-no-parent",this);if(t||(t=n.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new fe("writer-split-invalid-limit-element",this);do{const t=n.root.document?n.root.document.version:null,s=n.maxOffset-e.offset,r=Wr.getInsertionPosition(e),a=new Wr(e,s,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||o||(i=n,o=e.parent.nextSibling),n=(e=this.createPositionAfter(e.parent)).parent}while(n!==t);return{position:e,range:new us(ss._createAt(i,"end"),ss._createAt(o,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new fe("writer-wrap-range-not-flat",this);const i=t instanceof Ms?t:new Ms(t);if(i.childCount>0)throw new fe("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new fe("writer-wrap-element-attached",this);this.insert(i,e.start);const o=new us(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,ss._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new fe("writer-unwrap-element-no-parent",this);this.move(us._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new fe("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,o=t.range,n=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new fe("writer-addmarker-marker-exists",this);if(!o)throw new fe("writer-addmarker-no-range",this);return i?(Da(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,o=this.model.markers.get(i);if(!o)throw new fe("writer-updatemarker-marker-not-exists",this);if(!t)return be("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(o);const n="boolean"==typeof t.usingOperation,s="boolean"==typeof t.affectsData,r=s?t.affectsData:o.affectsData;if(!n&&!t.range&&!s)throw new fe("writer-updatemarker-wrong-options",this);const a=o.getRange(),l=t.range?t.range:a;n&&t.usingOperation!==o.managedUsingOperations?t.usingOperation?Da(this,i,null,l,r):(Da(this,i,a,null,r),this.model.markers._set(i,l,void 0,r)):o.managedUsingOperations?Da(this,i,a,l,r):this.model.markers._set(i,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new fe("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);if(!i.managedUsingOperations)return void this.model.markers._remove(t);Da(this,t,i.getRange(),null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new fe("writer-addroot-root-exists",this);const o=this.model.document,n=new Yr(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new fe("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,o=new Yr(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,i]of ai(e))this._setSelectionAttribute(t,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const o=Os._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=Os._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new fe("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const o=i.getRange();let n=!1;if("move"===e){const e=t;n=e.containsPosition(o.start)||e.start.isEqual(o.start)||e.containsPosition(o.end)||e.end.isEqual(o.end)}else{const e=t,i=e.nodeBefore,s=e.nodeAfter,r=o.start.parent==i&&o.start.isAtEnd,a=o.end.parent==s&&0==o.end.offset,l=o.end.nodeAfter==s,c=o.start.nodeAfter==s;n=r||a||l||c}n&&this.updateMarker(i.name,{range:o})}}}function Oa(e,t,i,o){const n=e.model,s=n.document;let r,a,l,c=o.start;for(const e of o.getWalker({shallow:!0}))l=e.item.getAttribute(t),r&&a!=l&&(a!=i&&d(),c=r),r=e.nextPosition,a=l;function d(){const o=new us(c,r),l=o.root.document?s.version:null,d=new Gr(o,t,a,i,l);e.batch.addOperation(d),n.applyOperation(d)}r instanceof ss&&r!=c&&a!=i&&d()}function Va(e,t,i,o){const n=e.model,s=n.document,r=o.getAttribute(t);let a,l;if(r!=i){if(o.root===o){const e=o.document?s.version:null;l=new Qr(o,t,r,i,e)}else{a=new us(ss._createBefore(o),e.createPositionAfter(o));const n=a.root.document?s.version:null;l=new Gr(a,t,r,i,n)}e.batch.addOperation(l),n.applyOperation(l)}}function Da(e,t,i,o,n){const s=e.model,r=s.document,a=new Kr(t,i,o,s.markers,!!n,r.version);e.batch.addOperation(a),s.applyOperation(a)}function Fa(e,t,i,o){let n;if(e.root.document){const i=o.document,s=new ss(i.graveyard,[0]);n=new qr(e,t,s,i.version)}else n=new Sa(e,t);i.addOperation(n),o.applyOperation(n)}function Ma(e,t){return e===t||e instanceof Ca&&t instanceof Ca}function Na(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.selection,o=t.schema,n=[];let s=!1;for(const e of i.getRanges()){const t=Ba(e,o);t&&!t.isEqual(e)?(n.push(t),s=!0):n.push(e)}s&&e.setSelection(function(e){const t=[...e],i=new Set;let o=1;for(;o!i.has(t)))}(n),{backward:i.isBackward});return!1}(t,e)))}function Ba(e,t){return e.isCollapsed?function(e,t){const i=e.start,o=t.getNearestSelectionRange(i);if(!o){const e=i.getAncestors().reverse().find((e=>t.isObject(e)));return e?us._createOn(e):null}if(!o.isCollapsed)return o;const n=o.start;if(i.isEqual(n))return null;return new us(n)}(e,t):function(e,t){const{start:i,end:o}=e,n=t.checkChild(i,"$text"),s=t.checkChild(o,"$text"),r=t.getLimitElement(i),a=t.getLimitElement(o);if(r===a){if(n&&s)return null;if(function(e,t,i){const o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}(i,o,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),n=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),s=e?e.start:i,r=n?n.end:o;return new us(s,r)}}const l=r&&!r.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,n=l&&(!e||!za(i.nodeAfter,t)),s=c&&(!e||!za(o.nodeBefore,t));let d=i,u=o;return n&&(d=ss._createBefore(La(r,t))),s&&(u=ss._createAfter(La(a,t))),new us(d,u)}return null}(e,t)}function La(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function za(e,t){return e&&t.isSelectable(e)}function ja(e,t,i={}){if(t.isCollapsed)return;const o=t.getFirstRange();if("$graveyard"==o.root.rootName)return;const n=e.schema;e.change((e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const o=t.getFirstRange();if(o.start.parent==o.end.parent)return!1;return e.checkChild(i,"paragraph")}(n,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),Wa(e,e.createPositionAt(i,0),t)}(e,t);const s={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(s,n.getAttributesWithProperty(e,"copyOnReplace",!0))}let r,a;i.doNotFixSelection?(r=ma.fromPosition(o.start,"toPrevious"),a=ma.fromPosition(o.end,"toNext")):[r,a]=function(e){const t=e.root.document.model,i=e.start;let o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of o){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(o);if(i&&o.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const n=i.getLastPosition(),s=t.createRange(n,o);t.hasContent(s,{ignoreMarkers:!0})||(o=n)}}return[ma.fromPosition(i,"toPrevious"),ma.fromPosition(o,"toNext")]}(o),r.isTouching(a)||e.remove(e.createRange(r,a)),i.leaveUnmerged||(!function(e,t,i){const o=e.model;if(!Ha(e.model.schema,t,i))return;const[n,s]=function(e,t){const i=e.getAncestors(),o=t.getAncestors();let n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}(t,i);if(!n||!s)return;!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(s,{ignoreMarkers:!0})?qa(e,t,i,n.parent):$a(e,t,i,n.parent)}(e,r,a),n.removeDisallowedAttributes(r.parent.getChildren(),e)),Ua(e,t,r),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}(n,r)&&Wa(e,r,t,s),r.detach(),a.detach()}))}function $a(e,t,i,o){const n=t.parent,s=i.parent;if(n!=o&&s!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(s,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}Ha(e.model.schema,t,i)&&$a(e,t,i,o)}}function qa(e,t,i,o){const n=t.parent,s=i.parent;if(n!=o&&s!=o){for(t=e.createPositionAfter(n),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(n,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(s),function(e,t){const i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name);e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}(e,i),Ha(e.model.schema,t,i)&&qa(e,t,i,o)}}function Ha(e,t,i){const o=t.parent,n=i.parent;return o!=n&&(!e.isLimit(o)&&!e.isLimit(n)&&function(e,t,i){const o=new us(e,t);for(const e of o.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e))}function Wa(e,t,i,o={}){const n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),Ua(e,i,e.createPositionAt(n,0))}function Ua(e,t,i){t instanceof Os?e.setSelection(i):t.setTo(i)}function Ka(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{i.push(e.start.parent),t.remove(e)})),i.forEach((e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}}))}class Ga{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))t.offsetSize>0&&this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),!1!==this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){const t=Array.from(e);for(const e of t){if(!e.is("element"))continue;const i=[],o=[],n=this.writer.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(const{item:e}of n){const s=e.parent;this.schema.checkChild(s,e)||(e.is("element")&&!this.schema.isObject(e)?(o.push(e),t.push(s)):i.push(e),n.jumpTo(this.writer.createPositionAfter(e)))}for(const e of o)this.writer.unwrap(e);for(const e of i)this.writer.remove(e)}}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new fe("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?us._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new us(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this._checkAndSplitToAllowedPosition(e)?(e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this.schema.isObject(e)||this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=ma.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new fe("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=ma.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=ma.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Ms))return;if(!this._canMergeLeft(e))return;const t=ma._createBefore(e);t.stickiness="toNext";const i=ma.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=ma._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=ma._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Ms))return;if(!this._canMergeRight(e))return;const t=ma._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new fe("insertcontent-invalid-insertion-position",this);this.position=ss._createAt(t.nodeBefore,"end");const i=ma.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=ma._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=ma._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Ms&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Ms&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){const i=this.schema.createContext(e);return this.schema.checkChild(i,t)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function Ja(e,t,i,o={}){if(!e.schema.isObject(t))throw new fe("insertobject-element-not-an-object",e,{object:t});const n=i||e.document.selection;let s=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(s=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));const r=ti(n.getSelectedBlocks()),a={};return r&&Object.assign(a,e.schema.getAttributesWithProperty(r,"copyOnReplace",!0)),e.change((i=>{s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0});let n=t;const r=s.anchor.parent,l=e.schema.createContext(r);!e.schema.checkChild(l,t)&&e.schema.checkChild(l,"paragraph")&&e.schema.checkChild(l.push("paragraph"),t)&&(n=i.createElement("paragraph"),i.insert(t,n)),e.schema.setAllowedAttributes(n,a,i);const c=e.insertContent(n,s);return c.isCollapsed||o.setSelection&&function(e,t,i,o){const n=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new fe("insertobject-invalid-place-parameter-value",n);let s=t.nextSibling;if(n.schema.isInline(t))return void e.setSelection(t,"after");const r=s&&n.schema.checkChild(s,"$text");!r&&n.schema.checkChild(t.parent,"paragraph")&&(s=e.createElement("paragraph"),n.schema.setAllowedAttributes(s,o,e),n.insertContent(s,e.createPositionAfter(t)));s&&e.setSelection(s,0)}(i,t,o.setSelection,a),c}))}function Za(e,t){const{isForward:i,walker:o,unit:n,schema:s,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:c}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;i||(i=t?e.position.nodeAfter:e.position.nodeBefore);for(;i&&i.is("$text");){const o=e.position.offset-i.startOffset;if(Xa(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(Ya(i.data,o,t))break;e.next()}}return e.position}(o,i):function(e,t,i){const o=e.position.textNode;if(o){const n=o.data;let s=e.position.offset-o.startOffset;for(;ui(n,s)||"character"==t&&hi(n,s)||i&&gi(n,s);)e.next(),s=e.position.offset-o.startOffset}return e.position}(o,n,r);if(a==(i?"elementStart":"elementEnd")){if(s.isSelectable(l))return ss._createAt(l,i?"after":"before");if(s.checkChild(c,"$text"))return c}else{if(s.isLimit(l))return void o.skip((()=>!0));if(s.checkChild(c,"$text"))return c}}function Qa(e,t){const i=e.root,o=ss._createAt(i,t?"end":0);return t?new us(e,o):new us(o,e)}function Ya(e,t,i){const o=t+(i?0:-1);return' ,.?!:;"-()'.includes(e.charAt(o))}function Xa(e,t,i){return t===(i?e.offsetSize:0)}class el extends(Be()){markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new Ta,this.document=new xa(this),this.schema=new mr,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((()=>!0),"$marker"),Na(this),this.document.registerPostFixer(ir),this.on("insertContent",((e,[t,i])=>{e.return=function(e,t,i){return e.change((o=>{const n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});const s=new Ga(e,o,n.anchor),r=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,o]of t.markers){const{start:t,end:n}=o,s=t.isEqual(n);e.push({position:t,name:i,isCollapsed:s},{position:n,name:i,isCollapsed:s})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:i,name:n,isCollapsed:s}of e){let e=null,a=null;const l=i.parent===t&&i.isAtStart,c=i.parent===t&&i.isAtEnd;l||c?s&&(a=l?"start":"end"):(e=o.createElement("$marker"),o.insert(e,i)),r.push({name:n,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];s.handleNodes(a);let l=s.getSelectionRange();if(t.is("documentFragment")&&r.length){const e=l?Ts.fromRange(l):null,t={};for(let e=r.length-1;e>=0;e--){const{name:i,element:n,collapsed:a}=r[e],l=!t[i];if(l&&(t[i]=[]),n){const e=o.createPositionAt(n,"before");t[i].push(e),o.remove(n)}else{const e=s.getAffectedRange();if(!e){a&&t[i].push(s.position);continue}a?t[i].push(e[a]):t[i].push(l?e.start:e.end)}}for(const[e,[i,n]]of Object.entries(t))i&&n&&i.root===n.root&&i.root.document&&!o.model.markers.has(e)&&o.addMarker(e,{usingOperation:!0,affectsData:!0,range:new us(i,n)});e&&(l=e.toRange(),e.detach())}l&&(n instanceof Os?o.setSelection(l):n.setTo(l));const c=s.getAffectedRange()||e.createRange(n.anchor);return s.destroy(),c}))}(this,t,i)})),this.on("insertObject",((e,[t,i,o])=>{e.return=Ja(this,t,i,o)})),this.on("canEditAt",(e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()}))}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new fa,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){fe.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new fa):e instanceof fa||(e=new fa(e)):e=new fa,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){fe.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){const n=tl(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){const s=tl(t,i);return this.fire("insertObject",[e,s,o,o,...n])}deleteContent(e,t){ja(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const o=e.schema,n="backward"!=i.direction,s=i.unit?i.unit:"character",r=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new os({boundaries:Qa(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:l,schema:o,isForward:n,unit:s,treatEmojiAsSingleUnit:r};let d;for(;d=l.next();){if(d.done)return;const i=Za(c,d.value);if(i)return void(t instanceof Os?e.change((e=>{e.setSelectionFocus(i)})):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const i=e.createDocumentFragment(),o=t.getFirstRange();if(!o||o.isCollapsed)return i;const n=o.start.root,s=o.start.getCommonPath(o.end),r=n.getNodeByPath(s);let a;a=o.start.parent==o.end.parent?o:e.createRange(e.createPositionAt(r,o.start.path[s.length]),e.createPositionAt(r,o.end.path[s.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=o){const t=o._getTransformedByMove(a.start,e.createPositionAt(i,0),l)[0],n=e.createRange(e.createPositionAt(i,0),t.start);Ka(e.createRange(t.end,e.createPositionAt(i,"end")),e),Ka(n,e)}return i}))}(this,e)}hasContent(e,t={}){let i;i=e.is("selection")?Array.from(e.getRanges()):e.is("range")?[e]:[us._createIn(e)];for(const e of i)if(this._rangeHasContent(e,t))return!0;return!1}_rangeHasContent(e,t){if(e.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o)for(const t of this.markers.getMarkersIntersectingRange(e))if(t.affectsData)return!0;for(const t of e.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!i)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}canEditAt(e){const t=tl(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new ss(e,t,i)}createPositionAt(e,t){return ss._createAt(e,t)}createPositionAfter(e){return ss._createAfter(e)}createPositionBefore(e){return ss._createBefore(e)}createRange(e,t){return new us(e,t)}createRangeIn(e){return us._createIn(e)}createRangeOn(e){return us._createOn(e)}createSelection(...e){return new _s(...e)}createBatch(e){return new fa(e)}createOperationFromJSON(e){return ea.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new Ra(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function tl(e,t){if(e)return e instanceof _s||e instanceof Os?e:e instanceof ys?t||0===t?new _s(e,t):e.is("rootElement")?new _s(e,"in"):new _s(e,"on"):new _s(e)}class il extends jn{domEventType="click";onDomEvent(e){this.fire(e.type,e)}}class ol extends jn{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}}class nl extends jn{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}}class sl extends jn{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}}class rl{document;constructor(e){this.document=e}createDocumentFragment(e){return new tn(this.document,e)}createElement(e,t,i){return new _o(this.document,e,t,i)}createText(e){return new no(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new _o(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){a(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return So._createAt(e,t)}createPositionAfter(e){return So._createAfter(e)}createPositionBefore(e){return So._createBefore(e)}createRange(e,t){return new Io(e,t)}createRangeOn(e){return Io._createOn(e)}createRangeIn(e){return Io._createIn(e)}createSelection(...e){return new Oo(...e)}}const al=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ll=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,cl=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,dl=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,ul=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,hl=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,ml=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function gl(e){return e.startsWith("#")?al.test(e):e.startsWith("rgb")?ll.test(e)||cl.test(e):e.startsWith("hsl")?dl.test(e)||ul.test(e):ml.has(e.toLowerCase())}const pl=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function fl(e){return pl.includes(e)}const bl=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function wl(e){return bl.test(e)}const yl=/^[+-]?[0-9]*([.][0-9]+)?%$/;function _l(e){return yl.test(e)}const kl=["auto","cover","contain"];const vl=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const Cl=["center","top","bottom","left","right"];function Al(e){return Cl.includes(e)}const xl=["fixed","scroll","local"];function El(e){return xl.includes(e)}const Tl=["border-box","padding-box","content-box"];function Pl(e){return Tl.includes(e)}const Sl=["border-box","padding-box","content-box","text"];function Il(e){return Sl.includes(e)}function Rl(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Fl(e),i=t[0],o=t[2]||i,n=t[1]||i;return{top:i,bottom:o,right:n,left:t[3]||n}}function Ol(e){return t=>{const{top:i,right:o,bottom:n,left:s}=t,r=[];return[i,o,s,n].every((e=>!!e))?r.push([e,Vl(t)]):(i&&r.push([e+"-top",i]),o&&r.push([e+"-right",o]),n&&r.push([e+"-bottom",n]),s&&r.push([e+"-left",s])),r}}function Vl({top:e,right:t,bottom:i,left:o}){const n=[];return o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e),n.join(" ")}function Dl(e){return t=>({path:e,value:Rl(t)})}function Fl(e){const t=e.trim().slice(0,1500).matchAll(hl);return Array.from(t).map((e=>e[0]))}const Ml={image:"none",repeat:"repeat",position:"0% 0%",size:"auto",origin:"padding-box",clip:"border-box",attachment:"scroll"},Nl=["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient","conic-gradient","repeating-conic-gradient","url"];function Bl(e){e.setNormalizer("background-color",(e=>({path:"background.color",value:e})));for(const t in Ml)e.setNormalizer(`background-${t}`,Ll(`background.${t}`)),e.setReducer(`background-${t}`,zl(`background-${t}`));e.setNormalizer("background",(e=>{const t=function(e){return ql(e).map(jl).filter((e=>null!==e))}(e);t.length||t.push({...$l(),color:e});const i=function(e){const t={image:[],position:[],size:[],repeat:[],attachment:[],origin:[],clip:[]};for(const i of e)t.position.push(i.position.join(" ")),t.size.push(i.size.join(" ")),t.repeat.push(i.repeat.join(" ")),t.image.push(i.image),t.attachment.push(i.attachment),t.origin.push(i.origin),t.clip.push(i.clip);return e.at(-1)?.color&&(t.color=e.at(-1).color),t}(t);return{path:"background",value:i}})),e.setReducer("background",(e=>{const t=e,i=Object.keys(Ml).every((e=>{const i=t[e];return void 0!==i&&(!Array.isArray(i)||i.length>0)}));return i?function(e){const t=[],i=function(e){const t=function(e){let t=0;for(const i of Object.values(e))Array.isArray(i)&&i.length>t&&(t=i.length);return t}(e),i=Array.from({length:t},((t,i)=>{const o=$l();return e.image?.[i]&&(o.image=e.image[i]),e.position?.[i]&&(o.position=e.position[i].split(" ")),e.size?.[i]&&(o.size=e.size[i].split(" ")),e.repeat?.[i]&&(o.repeat=e.repeat[i].split(" ")),e.attachment?.[i]&&(o.attachment=e.attachment[i]),e.origin?.[i]&&(o.origin=e.origin[i]),e.clip?.[i]&&(o.clip=e.clip[i]),o}));return e.color&&(i.at(-1).color=e.color),i}(e).map((e=>function(e){const t=[];e.image&&e.image!==Ml.image&&t.push(e.image);const i=e.position.join(" "),o=!i||i===Ml.position;o||t.push(i);const n=e.size.join(" ");n&&n!==Ml.size&&(o&&t.push("0% 0%"),t.push("/",n));const s=e.repeat.join(" ");s&&s!==Ml.repeat&&t.push(s),e.attachment&&e.attachment!==Ml.attachment&&t.push(e.attachment);const r=e.origin===Ml.origin,a=e.clip===Ml.clip;return r&&a||(t.push(e.origin),e.clip!==e.origin&&t.push(e.clip)),e.color&&t.push(e.color),t.join(" ")}(e).trim())).filter(Boolean).join(", ");return i&&t.push(["background",i]),t}(t):function(e){const t=[];for(const i in Ml){const o=e[i];Array.isArray(o)&&t.push([`background-${i}`,o.join(", ")])}return void 0!==e.color&&t.push(["background-color",e.color]),t}(t)})),e.setStyleRelation("background",["background-color","background-image","background-repeat","background-position","background-size","background-attachment","background-origin","background-clip"])}function Ll(e){return t=>({path:e,value:ql(t)})}function zl(e){return t=>{const i=t.join(", ");return[[e,i]]}}function jl(e){const t={},{value:i,image:o}=function(e){for(const t of Nl){const i=t+"(",o=e.indexOf(i);if(o<0)continue;let n=t,s=0;for(let i=o+t.length;i"constructor"!==e)).length:0===t.length}return!0}(t)?null:{...$l(),...t}}function $l(){return{attachment:Ml.attachment,image:Ml.image,origin:Ml.origin,clip:Ml.clip,position:Ml.position.split(" "),repeat:Ml.repeat.split(" "),size:Ml.size.split(" ")}}function ql(e){const t=[];let i="",o=0;for(const n of e){if("("===n)o++;else if(")"===n)o--;else if(","===n&&0===o){t.push(i.trim()),i="";continue}i+=n}return i.trim()&&t.push(i.trim()),t}function Hl(e){e.setNormalizer("border",(e=>{const{color:t,style:i,width:o}=Ql(e);return{path:"border",value:{color:Rl(t),style:Rl(i),width:Rl(o)}}})),e.setNormalizer("border-top",Wl("top")),e.setNormalizer("border-right",Wl("right")),e.setNormalizer("border-bottom",Wl("bottom")),e.setNormalizer("border-left",Wl("left")),e.setNormalizer("border-color",Ul("color")),e.setNormalizer("border-width",Ul("width")),e.setNormalizer("border-style",Ul("style")),e.setNormalizer("border-top-color",Gl("color","top")),e.setNormalizer("border-top-style",Gl("style","top")),e.setNormalizer("border-top-width",Gl("width","top")),e.setNormalizer("border-right-color",Gl("color","right")),e.setNormalizer("border-right-style",Gl("style","right")),e.setNormalizer("border-right-width",Gl("width","right")),e.setNormalizer("border-bottom-color",Gl("color","bottom")),e.setNormalizer("border-bottom-style",Gl("style","bottom")),e.setNormalizer("border-bottom-width",Gl("width","bottom")),e.setNormalizer("border-left-color",Gl("color","left")),e.setNormalizer("border-left-style",Gl("style","left")),e.setNormalizer("border-left-width",Gl("width","left")),e.setExtractor("border-top",Jl("top")),e.setExtractor("border-right",Jl("right")),e.setExtractor("border-bottom",Jl("bottom")),e.setExtractor("border-left",Jl("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Ol("border-color")),e.setReducer("border-style",Ol("border-style")),e.setReducer("border-width",Ol("border-width")),e.setReducer("border-top",Yl("top")),e.setReducer("border-right",Yl("right")),e.setReducer("border-bottom",Yl("bottom")),e.setReducer("border-left",Yl("left")),e.setReducer("border",function(){return t=>{const i=Zl(t,"top"),o=Zl(t,"right"),n=Zl(t,"bottom"),s=Zl(t,"left"),r=[i,o,n,s],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},l=Xl(a,"all");if(l.length)return l;const c=Object.entries(a).reduce(((e,[t,i])=>(i&&(e.push([`border-${t}`,i]),r.forEach((e=>delete e[t]))),e)),[]);return[...c,...Xl(i,"top"),...Xl(o,"right"),...Xl(n,"bottom"),...Xl(s,"left")]};function e(e,t){return e.map((e=>e[t])).reduce(((e,t)=>e==t?e:null))}}()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function Wl(e){return t=>{const{color:i,style:o,width:n}=Ql(t),s={};return void 0!==i&&(s.color={[e]:i}),void 0!==o&&(s.style={[e]:o}),void 0!==n&&(s.width={[e]:n}),{path:"border",value:s}}}function Ul(e){return t=>({path:"border",value:Kl(t,e)})}function Kl(e,t){return{[t]:Rl(e)}}function Gl(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function Jl(e){return(t,i)=>{if(i.border)return Zl(i.border,e)}}function Zl(e,t){const i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function Ql(e){const t={},i=Fl(e);for(const e of i)wl(e)||/thin|medium|thick/.test(e)?t.width=e:fl(e)?t.style=e:t.color=e;return t}function Yl(e){return t=>Xl(t,e)}function Xl(e,t){const i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),3==i.length){const o=i.map((t=>e[t])).join(" ");return["all"==t?["border",o]:[`border-${t}`,o]]}return"all"==t?[]:i.map((i=>[`border-${t}-${i}`,e[i]]))}function ec(e){e.setNormalizer("margin",Dl("margin")),e.setNormalizer("margin-top",(e=>({path:"margin.top",value:e}))),e.setNormalizer("margin-right",(e=>({path:"margin.right",value:e}))),e.setNormalizer("margin-bottom",(e=>({path:"margin.bottom",value:e}))),e.setNormalizer("margin-left",(e=>({path:"margin.left",value:e}))),e.setReducer("margin",Ol("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function tc(e){e.setNormalizer("padding",Dl("padding")),e.setNormalizer("padding-top",(e=>({path:"padding.top",value:e}))),e.setNormalizer("padding-right",(e=>({path:"padding.right",value:e}))),e.setNormalizer("padding-bottom",(e=>({path:"padding.bottom",value:e}))),e.setNormalizer("padding-left",(e=>({path:"padding.left",value:e}))),e.setReducer("padding",Ol("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}Symbol("_treeDump");function ic(e,t=0,i={}){const{leading:o=!0,trailing:n=!0}=i;return Li(e,t,{leading:o,maxWait:t,trailing:n})}class oc{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(e){if(this.crashes=[],this._crashNumberLimit="number"==typeof e.crashNumberLimit?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod="number"==typeof e.minimumNonErrorTimePeriod?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter((e=>e!==t))}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;return(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function nc(e,t=new Set){const i=[e],o=new Set;let n=0;for(;i.length>n;){const e=i[n++];if(!o.has(e)&&sc(e)&&!t.has(e))if(o.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch{}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return o}function sc(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function rc(e,t,i=new Set){if(e===t&&("object"==typeof(o=e)&&null!==o))return!0;var o;const n=nc(e,i),s=nc(t,i);for(const e of n)if(s.has(e))return!0;return!1}function ac(e,t,i){const o=t.root,n=t.roots||Object.create(null);i&&!n[i]&&(n[i]=o||Object.create(null));const s=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&(t=e,!L(t));var t}(e),r=function(e,t,i){return t||!i?e.initialData||Object.create(null):{[i]:e.initialData}}(t,s,i),a=Array.from(new Set([...s?Object.keys(e):[],...Object.keys(n),...Object.keys(r)]));for(const e of a){const i=n[e]||Object.create(null);i.initialData="",i.placeholder??=lc(t,"placeholder",e),i.label??=lc(t,"label",e),n[e]=i}t.roots=n}function lc(e,t,i){const o=e[t];if(o)return"string"==typeof o?o:o[i]}class cc extends oc{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_editorAttachTo=null;_isSingleRootEditor=!0;_isUsingConfigBasedCreator=!1;_editables={};_config;_excludedProps;constructor(e,t={}){super(t),this._throttledSave=ic(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>void 0===i?e.create(t):e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then((()=>(this.state="initializing",this._fire("stateChange"),this._destroy()))).catch((e=>{console.error("An error happened during the editor destroying.",e)})).then((()=>{this._isUsingConfigBasedCreator?ac(this._isSingleRootEditor?"":{},this._config,!!this._isSingleRootEditor&&"main"):ac(this._isSingleRootEditor?this._editorAttachTo||"":this._editables,this._config,!!this._isSingleRootEditor&&"main");const e={...this._config,extraPlugins:this._config.extraPlugins||[],_watchdogInitialData:this._data};e.extraPlugins.push(dc);const t={};for(const[i,o]of Object.entries(this._data.roots)){const n=e.roots[i]||Object.create(null);n.initialData="",o.isLoaded?n.lazyLoad=!1:delete n.modelAttributes,t[i]=n}if(e.roots=t,delete e.initialData,delete e.root,this._isUsingConfigBasedCreator)return this.create(e,e.context);const i=this._isSingleRootEditor?this._editorAttachTo||"":this._editables;return this.create(i,e,e.context)})).then((()=>{this._fire("restart")}))}create(e=(this._isUsingConfigBasedCreator?this._config:this._elementOrData),t=(this._isUsingConfigBasedCreator?void 0:this._config),i){const o=this._detectConfigBasedCreator(e,t),n=o?void 0:e,s=o?e:t,r=o?t:i;return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>{if(super._startErrorHandling(),this._isUsingConfigBasedCreator=o,this._elementOrData=n,this._config=this._cloneEditorConfiguration(s||{}),this._config.context=r,o){this._editorAttachTo=null;const e=this._config.roots?Object.keys(this._config.roots).length:0,t=this._config.initialData,i=t&&"object"==typeof t;this._isSingleRootEditor=!i&&e<=1}else this._editorAttachTo=uc(n)?n:null,this._isSingleRootEditor=uc(n)||"string"==typeof n;return o?this._creator(this._config):this._creator(n,this._config)})).then((e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._editorAttachTo||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)}))}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._editorAttachTo||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter((e=>e.isAttached()&&"$graveyard"!=e.rootName)),{plugins:i}=e,o=i.has("CommentsRepository")&&i.get("CommentsRepository"),n=i.has("TrackChanges")&&i.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach((e=>{s.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}}));for(const t of e.model.markers)t._affectsData&&(s.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return o&&(s.commentThreads=JSON.stringify(o.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),n&&(s.suggestions=JSON.stringify(n.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return rc(this._editor,e.context,this._excludedProps)}_detectConfigBasedCreator(e,t){if("string"==typeof e||uc(e))return!1;if(t&&"object"==typeof t&&!("destroy"in t)&&Object.keys(t).length>0)return!1;if(e&&"object"==typeof e){const t=Object.values(e);if(t.length>0&&t.every((e=>"string"==typeof e||uc(e))))return!1}return!0}_cloneEditorConfiguration(e){return N(e,((e,t)=>uc(e)||"context"===t?e:void 0))}}class dc{editor;_data;constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",(e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},(e=>{this._restoreCollaborationData(),this._restoreEditorData(e)})),this.editor.data.fire("ready")}),{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const o of t.children)i._appendChild(this._createNode(e,o));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach((([i,{content:o,attributes:n}])=>{const s=JSON.parse(o),r=JSON.parse(n),a=t.model.document.getRoot(i);for(const[t,i]of r)e.setAttribute(t,i,a);for(const t of s){const i=this._createNode(e,t);e.insert(i,a,"end")}})),Object.entries(this._data.markers).forEach((([i,o])=>{const{document:n}=t.model,{rangeJSON:{start:s,end:r},...a}=o,l=n.getRoot(s.root),c=e.createPositionFromPath(l,s.path,s.stickiness),d=e.createPositionFromPath(l,r.path,r.stickiness),u=e.createRange(c,d);e.addMarker(i,{range:u,...a})}))}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const t=this.editor.plugins.get("CommentsRepository");for(const e of t.getCommentThreads())t._removeCommentThread({threadId:e.id});e.forEach((e=>{const t=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:t,...e})}))}if(this.editor.plugins.has("TrackChangesEditing")){const e=this.editor.plugins.get("TrackChangesEditing");for(const t of e.getSuggestions())e._removeSuggestion(t);t.forEach((t=>{e.addSuggestionData(t)}))}}}function uc(e){return L(e)}const hc=Symbol("MainQueueId");class mc extends oc{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new gc;_contextConfig;_item;constructor(e,t={}){super(t),this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty((()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))}))}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(hc,(()=>(this._contextConfig=e,this._create())))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=pc(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e.id,(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new cc(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",((i,{error:o,causesRestart:n})=>{this._fire("itemError",{itemId:e.id,error:o}),n&&this._actionQueues.enqueue(e.id,(()=>new Promise((i=>{const o=()=>{t.off("restart",o),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",o)}))))})),void 0!==e.sourceElementOrData?t.create(e.sourceElementOrData,e.config,this._context):t.create(e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))))}remove(e){const t=pc(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e,(()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))))}destroy(){return this._actionQueues.enqueue(hc,(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())))}_restart(){return this._actionQueues.enqueue(hc,(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch((e=>{console.error("An error happened during destroying the context or items.",e)})).then((()=>this._create())).then((()=>this._fire("restart"))))))}_create(){return Promise.resolve().then((()=>(this._startErrorHandling(),this._creator(this._contextConfig)))).then((e=>(this._context=e,this._contextProps=nc(this._context),Promise.all(Array.from(this._watchdogs.values()).map((e=>(e._setExcludedProperties(this._contextProps),e._isUsingConfigBasedCreator?e.create(void 0,this._context):e.create(void 0,void 0,this._context))))))))}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map((e=>e.destroy()))).then((()=>this._destructor(e)))}))}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return rc(this._context,e.context)}}class gc{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===hc;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const o=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(hc),this._queues.get(e)])).then(t),n=o.catch((()=>{}));return this._queues.set(e,n),o.finally((()=>{this._activeActions--,this._queues.get(e)===n&&0===this._activeActions&&this._onEmptyCallbacks.forEach((e=>e()))}))}}function pc(e){return Array.isArray(e)?e:[e]}class fc extends(Be()){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",bc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",bc),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function bc(e){e.return=!1,e.stop()}class wc extends(Be()){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.listenTo(e,"change:isReadOnly",(()=>{this.refresh()})),this.on("set:isEnabled",(t=>{if(!this.affectsData)return;const i=e.model.document.selection,o=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())}),{priority:"highest"}),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",yc,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",yc),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function yc(e){e.return=!1,e.stop()}class _c{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new fe("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class kc extends(xe()){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of i)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new fe("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){const o=this,n=this._context;!function e(t,i=new Set){t.forEach((t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!o._availablePlugins.has(t.pluginName)&&o._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))}))}(e),u(e);const s=[...function e(t,i=new Set){return t.map((e=>a(e)?e:o._availablePlugins.get(e))).reduce(((t,o)=>i.has(o)?t:(i.add(o),o.requires&&(u(o.requires,o),e(o.requires,i).forEach((e=>t.add(e)))),t.add(o))),new Set)}(e.filter((e=>!c(e,t))))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new fe("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new fe("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new fe("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const n=o._availablePlugins.get(t);if(!n)throw new fe("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const s=e.indexOf(n);if(-1===s){if(o._contextPlugins.has(n))return;throw new fe("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(n.requires&&n.requires.length)throw new fe("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(s,1,i),o._availablePlugins.set(t,i)}}(s,i);const r=function(e){return e.map((e=>{let t=o._contextPlugins.get(e);return t=t||new e(n),o._add(e,t),t}))}(s);return await h(r,"init"),await h(r,"afterInit"),r;function a(e){return"function"==typeof e}function l(e){return a(e)&&!!e.isContextPlugin}function c(e,t){return t.some((t=>t===e||(d(e)===t||d(t)===e)))}function d(e){return a(e)?e.pluginName||e.name:e}function u(e,i=null){e.map((e=>a(e)?e:o._availablePlugins.get(e)||e)).forEach((e=>{!function(e){if("function"!=typeof e)return;if(e._throwErrorWhenUsedAsAPlugin)throw new fe("plugincollection-plugin-invalid-constructor",n,{name:e.name})}(e),function(e,t){if(a(e))return;if(t)throw new fe("plugincollection-soft-required",n,{missingPlugin:e,requiredBy:d(t)});throw new fe("plugincollection-plugin-not-found",n,{plugin:e})}(e,i),function(e,t){if(!l(t))return;if(l(e))return;throw new fe("plugincollection-context-required",n,{plugin:d(e),requiredBy:d(t)})}(e,i),function(e,i){if(!i)return;if(!c(e,t))return;throw new fe("plugincollection-required",n,{plugin:d(e),requiredBy:d(i)})}(e,i)}))}function h(e,t){return e.reduce(((e,i)=>i[t]?o._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new fe("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class vc{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new Ge(i,this.constructor.defaultConfig);const o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new kc(this,o);const n=this.config.get("language")||{};this.locale=new Xt({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new ei}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new fe("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new fe("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new fe("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const i=new this(e);t(i.initPlugins().then((()=>i)))}))}static get _throwErrorWhenUsedAsAPlugin(){return!0}}class Cc extends(Be()){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class Ac extends ri{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}const xc="contentEditing",Ec="common";class Tc{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:xc,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:Ec}),o&&o.forEach((t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})}))}addKeystrokeInfoGroup({categoryId:e=xc,id:t,label:i,keystrokes:o}){const n=this.keystrokeInfos.get(e);if(!n)throw new fe("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=xc,groupId:t=Ec,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new fe("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new fe("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}}function Pc(e){return Object.getPrototypeOf(e).constructor.editorName}function Sc(e){if(!e)return;const t=Array.isArray(e)?{items:e}:e,i=function e(t){return t.flatMap((t=>"string"==typeof t?[t]:e(t.items)))}(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:(o=i,o.filter((e=>"|"!==e&&"-"!==e)))};var o}function Ic(){let e="unknown",t="unknown";return Y.isMac?e="mac":Y.isWindows?e="windows":Y.isiOS?e="ios":Y.isAndroid&&(e="android"),Y.isGecko?t="gecko":Y.isBlink?t="blink":Y.isSafari&&(t="safari"),{os:e,browser:t}}function Rc(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",me()),localStorage.getItem("__ckeditor-session-id")}function Oc(){return J.window.CKEDITOR_PAGE_SESSION_ID=J.window.CKEDITOR_PAGE_SESSION_ID||me(),J.window.CKEDITOR_PAGE_SESSION_ID}class Vc extends(Be()){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),"object"!=typeof e||Array.isArray(e))throw new fe("editor-config-invalid-type");if("sanitizeHtml"in e)throw new fe("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...s}=e,r=e.language||o.language;this._context=e.context||new vc({language:r,translations:n}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new Ge(s,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),function(e){let t=e.get("licenseKey");!t&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(t=window.CKEDITOR_GLOBAL_LICENSE_KEY,e.set("licenseKey",t));if(!t)throw new fe("license-key-missing")}(this.config),this.plugins=new kc(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new _c,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new el(this.config),this.on("change:isReadOnly",(()=>{this.model.document.isReadOnly=this.isReadOnly}));const l=new po;this.data=new Rr(this.model,l),this.editing=new hr(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Or([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ac(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Tc(this),function(e){const t=e.config.get("licenseKey"),i=window[Symbol.for("cke distribution")]||"sh";function o(t,i){e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError(t,i)}if("GPL"==t)return void("cloud"==i&&o("distributionChannel"));const n=fi(t);if(!n)return void o("invalid");if(!function(e){return["exp","jti","vc"].every((t=>t in e))}(n))return void o("invalid");if(n.distributionChannel&&!Qt(n.distributionChannel).includes(i))return void o("distributionChannel");if(function(e){const t=Array.isArray(e)?e:[e],i=function(){const e=[];for(let t=0;t<256;t++){let i=t;for(let e=0;e<8;e++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}return e}();let o=-1;const n=t.map((e=>Array.isArray(e)?e.join(""):String(e))).join("");for(let e=0;e>>8^i[255&(o^n.charCodeAt(e))];return o=~o>>>0,o.toString(16).padStart(8,"0")}(function(e){return Object.getOwnPropertyNames(e).sort().filter((t=>"vc"!=t&&null!=e[t])).map((t=>e[t]))}(n))!=n.vc.toLowerCase())return void o("invalid");if(new Date(1e3*n.exp)<_e)return void o("expired");const s=n.licensedHosts;if(s&&s.length>0&&!function(e){const{hostname:t}=new URL(window.location.href);if(e.includes(t))return!0;const i=t.split(".");return e.filter((e=>e.includes("*"))).map((e=>e.split("."))).filter((e=>e.length<=i.length)).map((e=>Array(i.length-e.length).fill("*"===e[0]?"*":"").concat(e))).some((e=>i.every(((t,i)=>e[i]===t||"*"===e[i]))))}(s))return void o("domainLimit");if(["evaluation","trial"].includes(n.licenseType)&&1e3*n.exp{o("evaluationLimit")}),6e5);e.on("destroy",(()=>{clearTimeout(t)}))}n.usageEndpoint&&e.once("ready",(()=>{const i={requestId:me(),requestTime:Math.round(Date.now()/1e3),license:t,editor:Dc(e)};e._sendUsageRequest(n.usageEndpoint,i).then((e=>{const{status:t,message:i}=e;i&&console.warn(i),"ok"!=t&&o("usageLimit")}),(()=>{var e,t;e="license-key-validation-endpoint-not-reachable",t={url:n.usageEndpoint},console.error(...ye(e,t))}))}),{priority:"high"})}(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new fe("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new fe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new fe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(o),i,n).then((e=>(function(e){const t=e.config.get("licenseKey");if("GPL"===t)return;const i=fi(t);if(!i)return;const o=[...e.plugins].map((([e])=>e)).find((e=>{return!!e.pluginName&&(!!e.licenseFeatureCode&&(t=i,o=e.licenseFeatureCode,(t.removeFeatures||[]).includes(o)));var t,o}));o&&(e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError("pluginNotAllowed",o.pluginName))}(this),e)))}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),e.then((()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()})).then((()=>this.plugins.destroy())).then((()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})).then((()=>this._context._removeEditor(this)))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(e){fe.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=vc;static EditorWatchdog=cc;static ContextWatchdog=mc;_showLicenseError(e,t){setTimeout((()=>{if("invalid"==e)throw new fe("invalid-license-key");if("expired"==e)throw new fe("license-key-expired");if("domainLimit"==e)throw new fe("license-key-domain-limit");if("pluginNotAllowed"==e){const e=t.replace(/(Editing|UI)$/,""),i=this.plugins.has(e);throw new fe("license-key-plugin-not-allowed",null,{pluginName:i?e:t})}if("featureNotAllowed"==e)throw new fe("license-key-feature-not-allowed",null,{featureName:t});if("evaluationLimit"==e)throw new fe("license-key-evaluation-limit");if("trialLimit"==e)throw new fe("license-key-trial-limit");if("developmentLimit"==e)throw new fe("license-key-development-limit");if("usageLimit"==e)throw new fe("license-key-usage-limit");if("distributionChannel"==e)throw new fe("license-key-invalid-distribution-channel")}),0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),o=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok)throw new Error(`HTTP Response: ${o.status}`);return o.json()}}function Dc(e){const t=function(e){return{sessionId:Rc(),pageSessionId:Oc(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Pc(e),plugins:(t=e.plugins,Array.from(t).filter((([e])=>!!e.pluginName)).map((([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:o,isPremiumPlugin:n}=e;return{isContext:!!i,isOfficial:!!o,isPremium:!!n,name:t}}))),distribution:{channel:window[Symbol.for("cke distribution")]||"sh"},env:Ic(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:Sc(e.config.get("toolbar")),block:Sc(e.config.get("blockToolbar")),balloon:Sc(e.config.get("balloonToolbar"))}};var t}(e);return e.fire("collectUsageData",{setUsageData:function(e,i){if(void 0!==ki(t,e))throw new fe("editor-usage-data-path-already-set",{path:e});Ii(t,e,i)}}),t}function Fc(e){return class extends e{sourceElement;updateSourceElement(e){if(!this.sourceElement)throw new fe("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void wt(this.sourceElement,"");const o="string"==typeof e?e:this.data.get();wt(this.sourceElement,o)}}}function Mc(e,t,i="main",o=!1){const n=t.get("root"),s=t.get("roots")||Object.create(null);if(n){if(!i)throw new fe("editor-create-multi-root-with-main",null);if(i in s)throw new fe("editor-create-roots-with-main",null)}i&&!s[i]&&(s[i]=n||Object.create(null));const r=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&!Bc(e)}(e),a=function(e,t,i){return t||!i?e.get("initialData")||Object.create(null):{[i]:e.get("initialData")}}(t,r,i),l=Array.from(new Set([...r?Object.keys(e):[],...Object.keys(s),...Object.keys(a)]));for(const i of l){const n=s[i]||Object.create(null),l=r?e[i]:e;if(!o&&Bc(l)){if(n.element)throw new fe("editor-create-root-element-overspecified",null);n.element=l}if(o&&Bc(n.element)&&be("editor-create-root-element-not-supported"),void 0===n.initialData)if(void 0===a[i])n.initialData=Bc(d=l||n.element||o&&t.get("attachTo")||"")?(c=d)instanceof HTMLTextAreaElement?c.value:c.innerHTML:d;else{if(l&&!Bc(l))throw new fe("editor-create-initial-data-overspecified",null);n.initialData=a[i]}else{if(l&&!Bc(l))throw new fe("editor-create-root-initial-data-overspecified",null);if(void 0!==a[i])throw new fe("editor-create-legacy-initial-data-overspecified",null)}n.placeholder??=Nc(t,"placeholder",i),n.label??=Nc(t,"label",i),s[i]=n}var c,d;if(o&&Bc(e)){if(t.get("attachTo"))throw new fe("editor-create-attachto-overspecified",null);t.set("attachTo",e)}if(!o&&t.get("attachTo"))throw new fe("editor-create-attachto-ignored",null);t.set("roots",s)}function Nc(e,t,i){const o=e.get(t);if(o)return"string"==typeof o?o:o[i]}function Bc(e){return L(e)}class Lc extends Cc{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new ei({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new fe("pendingactions-add-invalid-message",this);const t=new(Be());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}var zc='',jc='',$c='',qc='',Hc='',Wc='',Uc='',Kc='',Gc='',Jc='',Zc='',Qc='',Yc='',Xc='',ed='',td='',id='',od='',nd='';const sd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in sd)Object.freeze(sd[e]);const rd=Object.freeze(sd),ad=function(e){var t,i,o=[],n=1;if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if("number"==typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if(e=String(e).toLowerCase(),rd[e])o=rd[e].slice(),i="rgb";else if("transparent"===e)n=0,i="rgb",o=[0,0,0];else if("#"===e[0]){var s=e.slice(1),r=s.length;n=1,r<=4?(o=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===r&&(n=parseInt(s[3]+s[3],16)/255)):(o=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===r&&(n=parseInt(s[6]+s[7],16)/255)),o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0),i="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var a=t[1],l="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;o=t[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=o.shift()),n=(o=o.map((function(e,t){if("%"===e[e.length-1])return e=parseFloat(e)/100,3===t?e:"rgb"===i?255*e:"h"===i[0]?100*e:"l"!==i[0]||t?"lab"===i?125*e:"lch"===i?t<2?150*e:360*e:"o"!==i[0]||t?"oklab"===i?.4*e:"oklch"===i?t<2?.4*e:360*e:e:e:100*e;if("h"===i[t]||2===t&&"h"===i[i.length-1]){if(void 0!==ld[e])return ld[e];if(e.endsWith("deg"))return parseFloat(e);if(e.endsWith("turn"))return 360*parseFloat(e);if(e.endsWith("grad"))return 360*parseFloat(e)/400;if(e.endsWith("rad"))return 180*parseFloat(e)/Math.PI}return"none"===e?0:parseFloat(e)}))).length>l?o.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(o=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:o,alpha:n}};var ld={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};const cd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in cd)Object.freeze(cd[e]);const dd=Object.freeze(cd),ud={};for(const e of Object.keys(dd))ud[dd[e]]=e;const hd={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},md=hd,gd=(6/29)**3;function pd(e){const t=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e;return Math.min(Math.max(0,t),1)}function fd(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(hd)){if(!("channels"in hd[e]))throw new Error("missing channels property: "+e);if(!("labels"in hd[e]))throw new Error("missing channel labels property: "+e);if(hd[e].labels.length!==hd[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=hd[e];delete hd[e].channels,delete hd[e].labels,Object.defineProperty(hd[e],"channels",{value:t}),Object.defineProperty(hd[e],"labels",{value:i})}function bd(e){const t=function(){const e={},t=Object.keys(md);for(let{length:i}=t,o=0;o0;){const e=i.pop(),o=Object.keys(md[e]);for(let{length:n}=o,s=0;s1&&(n-=1)}return[360*n,100*s,100*c]},hd.rgb.hwb=function(e){const t=e[0],i=e[1];let o=e[2];const n=hd.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,100*s,100*o]},hd.rgb.oklab=function(e){const t=fd(e[0]/255),i=fd(e[1]/255),o=fd(e[2]/255),n=Math.cbrt(.4122214708*t+.5363325363*i+.0514459929*o),s=Math.cbrt(.2119034982*t+.6806995451*i+.1073969566*o),r=Math.cbrt(.0883024619*t+.2817188376*i+.6299787005*o);return[100*(.2104542553*n+.793617785*s-.0040720468*r),100*(1.9779984951*n-2.428592205*s+.4505937099*r),100*(.0259040371*n+.7827717662*s-.808675766*r)]},hd.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o);return[100*((1-t-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-o-n)/(1-n)||0),100*n]},hd.rgb.keyword=function(e){const t=ud[e];if(t)return t;let i,o=Number.POSITIVE_INFINITY;for(const t of Object.keys(dd)){const r=dd[t],a=(s=r,((n=e)[0]-s[0])**2+(n[1]-s[1])**2+(n[2]-s[2])**2);agd?i**(1/3):7.787*i+16/116,o=o>gd?o**(1/3):7.787*o+16/116,n=n>gd?n**(1/3):7.787*n+16/116;return[116*o-16,500*(i-o),200*(o-n)]},hd.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;let n,s;if(0===i)return s=255*o,[s,s,s];const r=o<.5?o*(1+i):o+i-o*i,a=2*o-r,l=[0,0,0];for(let e=0;e<3;e++)n=t+1/3*-(e-1),n<0&&n++,n>1&&n--,s=6*n<1?a+6*(r-a)*n:2*n<1?r:3*n<2?a+(r-a)*(2/3-n)*6:a,l[e]=255*s;return l},hd.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,o=e[2]/100,n=i;const s=Math.max(o,.01);o*=2,i*=o<=1?o:2-o,n*=s<=1?s:2-s;return[t,100*(0===o?2*n/(s+n):2*i/(o+i)),100*((o+i)/2)]},hd.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let o=e[2]/100;const n=Math.floor(t)%6,s=t-Math.floor(t),r=255*o*(1-i),a=255*o*(1-i*s),l=255*o*(1-i*(1-s));switch(o*=255,n){case 0:return[o,l,r];case 1:return[a,o,r];case 2:return[r,o,l];case 3:return[r,a,o];case 4:return[l,r,o];case 5:return[o,r,a]}},hd.hsv.hsl=function(e){const t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01);let s,r;r=(2-i)*o;const a=(2-i)*n;return s=i*n,s/=a<=1?a:2-a,s=s||0,r/=2,[t,100*s,100*r]},hd.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,o=e[2]/100;const n=i+o;let s;n>1&&(i/=n,o/=n);const r=Math.floor(6*t),a=1-o;s=6*t-r,1&r&&(s=1-s);const l=i+s*(a-i);let c,d,u;switch(r){default:case 6:case 0:c=a,d=l,u=i;break;case 1:c=l,d=a,u=i;break;case 2:c=i,d=a,u=l;break;case 3:c=i,d=l,u=a;break;case 4:c=l,d=i,u=a;break;case 5:c=a,d=i,u=l}return[255*c,255*d,255*u]},hd.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n))]},hd.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100;let n,s,r;return n=3.2404542*t+-1.5371385*i+-.4985314*o,s=-.969266*t+1.8760108*i+.041556*o,r=.0556434*t+-.2040259*i+1.0572252*o,n=pd(n),s=pd(s),r=pd(r),[255*n,255*s,255*r]},hd.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];t/=95.047,i/=100,o/=108.883,t=t>gd?t**(1/3):7.787*t+16/116,i=i>gd?i**(1/3):7.787*i+16/116,o=o>gd?o**(1/3):7.787*o+16/116;return[116*i-16,500*(t-i),200*(i-o)]},hd.xyz.oklab=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=Math.cbrt(.8189330101*t+.3618667424*i-.1288597137*o),s=Math.cbrt(.0329845436*t+.9293118715*i+.0361456387*o),r=Math.cbrt(.0482003018*t+.2643662691*i+.633851707*o);return[100*(.2104542553*n+.793617785*s-.0040720468*r),100*(1.9779984951*n-2.428592205*s+.4505937099*r),100*(.0259040371*n+.7827717662*s-.808675766*r)]},hd.oklab.oklch=function(e){return hd.lab.lch(e)},hd.oklab.xyz=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(.999999998*t+.396337792*i+.215803758*o)**3,s=(1.000000008*t-.105561342*i-.063854175*o)**3,r=(1.000000055*t-.089484182*i-1.291485538*o)**3;return[100*(1.227013851*n-.55779998*s+.281256149*r),100*(-.040580178*n+1.11225687*s-.071676679*r),100*(-.076381285*n-.421481978*s+1.58616322*r)]},hd.oklab.rgb=function(e){const t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(t+.3963377774*i+.2158037573*o)**3,s=(t-.1055613458*i-.0638541728*o)**3,r=(t-.0894841775*i-1.291485548*o)**3;return[255*pd(4.0767416621*n-3.3077115913*s+.2309699292*r),255*pd(-1.2684380046*n+2.6097574011*s-.3413193965*r),255*pd(-.0041960863*n-.7034186147*s+1.707614701*r)]},hd.oklch.oklab=function(e){return hd.lch.lab(e)},hd.lab.xyz=function(e){let t,i,o;i=(e[0]+16)/116,t=e[1]/500+i,o=i-e[2]/200;const n=i**3,s=t**3,r=o**3;return i=n>gd?n:(i-16/116)/7.787,t=s>gd?s:(t-16/116)/7.787,o=r>gd?r:(o-16/116)/7.787,t*=95.047,i*=100,o*=108.883,[t,i,o]},hd.lab.lch=function(e){const t=e[0],i=e[1],o=e[2];let n;n=360*Math.atan2(o,i)/2/Math.PI,n<0&&(n+=360);return[t,Math.sqrt(i*i+o*o),n]},hd.lch.lab=function(e){const t=e[0],i=e[1],o=e[2]/360*2*Math.PI;return[t,i*Math.cos(o),i*Math.sin(o)]},hd.rgb.ansi16=function(e,t=null){const[i,o,n]=e;let s=null===t?hd.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),0===s)return 30;let r=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return 2===s&&(r+=60),r},hd.hsv.ansi16=function(e){return hd.rgb.ansi16(hd.hsv.rgb(e),e[2])},hd.rgb.ansi256=function(e){const t=e[0],i=e[1],o=e[2];if(t>>4==i>>4&&i>>4==o>>4)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)},hd.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(Math.trunc(e>50)+1);return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},hd.ansi256.rgb=function(e){if((e=e[0])>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},hd.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(t.length)+t},hd.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=[...i].map((e=>e+e)).join(""));const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,255&o]},hd.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),s=Math.min(Math.min(t,i),o),r=n-s;let a;return a=r<=0?0:n===t?(i-o)/r%6:n===i?2+(o-t)/r:4+(t-i)/r,a/=6,a%=1,[360*a,100*r,100*(r<1?s/(1-r):0)]},hd.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i);let n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],100*o,100*n]},hd.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,o=t*i;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},hd.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,o=e[2]/100;if(0===i)return[255*o,255*o,255*o];const n=[0,0,0],s=t%1*6,r=s%1,a=1-r;let l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=r,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=r;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=r,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-i)*o,[255*(i*n[0]+l),255*(i*n[1]+l),255*(i*n[2]+l)]},hd.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let o=0;return i>0&&(o=t/i),[e[0],100*o,100*i]},hd.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let o=0;return i>0&&i<.5?o=t/(2*i):i>=.5&&i<1&&(o=t/(2*(1-i))),[e[0],100*o,100*i]},hd.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},hd.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,o=i-t;let n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],100*o,100*n]},hd.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},hd.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},hd.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},hd.gray.hsl=function(e){return[0,0,e[0]]},hd.gray.hsv=hd.gray.hsl,hd.gray.hwb=function(e){return[0,100,e[0]]},hd.gray.cmyk=function(e){return[0,0,0,e[0]]},hd.gray.lab=function(e){return[e[0],0,0]},hd.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i},hd.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const _d=function(e){const t=bd(e),i={},o=Object.keys(t);for(let{length:e}=o,n=0;n1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function Ad(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const o=e(t);if("object"==typeof o)for(let{length:e}=o,t=0;te>i?i:eMath.round(i*e)/i,Pd=(Math.PI,e=>("#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Td(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?Td(parseInt(e.substring(6,8),16)/255,2):1})),Sd=({h:e,s:t,v:i,a:o})=>{const n=(200-t)*i/100;return{h:Td(e),s:Td(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:Td(n/2),a:Td(o,2)}},Id=e=>{const{h:t,s:i,l:o}=Sd(e);return`hsl(${t}, ${i}%, ${o}%)`},Rd=({h:e,s:t,v:i,a:o})=>{e=e/360*6,t/=100,i/=100;const n=Math.floor(e),s=i*(1-t),r=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),l=n%6;return{r:Td(255*[i,r,s,s,a,i][l]),g:Td(255*[a,i,i,r,s,s][l]),b:Td(255*[s,s,a,i,i,r][l]),a:Td(o,2)}},Od=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},Vd=({r:e,g:t,b:i,a:o})=>{const n=o<1?Od(Td(255*o)):"";return"#"+Od(e)+Od(t)+Od(i)+n},Dd=({r:e,g:t,b:i,a:o})=>{const n=Math.max(e,t,i),s=n-Math.min(e,t,i),r=s?n===e?(t-i)/s:n===t?2+(i-e)/s:4+(e-t)/s:0;return{h:Td(60*(r<0?r+6:r)),s:Td(n?s/n*100:0),v:Td(n/255*100),a:o}},Fd=(e,t)=>{if(e===t)return!0;for(const i in e)if(e[i]!==t[i])return!1;return!0},Md={},Nd=e=>{let t=Md[e];return t||(t=document.createElement("template"),t.innerHTML=e,Md[e]=t),t},Bd=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};let Ld=!1;const zd=e=>"touches"in e,jd=(e,t)=>{const i=zd(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();Bd(e.el,"move",e.getMove({x:Ed((i.pageX-(o.left+window.pageXOffset))/o.width),y:Ed((i.pageY-(o.top+window.pageYOffset))/o.height)}))};class $d{constructor(e,t,i,o){const n=Nd(`
    `);e.appendChild(n.content.cloneNode(!0));const s=e.querySelector(`[part=${t}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=o,this.nodes=[s.firstChild,s]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(Ld?"touchmove":"mousemove",this),t(Ld?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(e=>!(Ld&&!zd(e)||(Ld||(Ld=zd(e)),0)))(e)||!Ld&&0!=e.button)return;this.el.focus(),jd(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),jd(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((e,t)=>{const i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),Bd(e.el,"move",e.getMove({x:39===i?.01:37===i?-.01:34===i?.05:33===i?-.05:35===i?1:36===i?-1:0,y:40===i?.01:38===i?-.01:0},!0)))})(this,e)}}style(e){e.forEach(((e,t)=>{for(const i in e)this.nodes[t].style.setProperty(i,e[i])}))}}class qd extends $d{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:Id({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Td(e)}`)}getMove(e,t){return{h:t?Ed(this.h+360*e.x,0,360):360*e.x}}}class Hd extends $d{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:Id(e)},{"background-color":Id({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Td(e.s)}%, Brightness ${Td(e.v)}%`)}getMove(e,t){return{s:t?Ed(this.hsva.s+100*e.x,0,100):100*e.x,v:t?Ed(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Wd=Symbol("same"),Ud=Symbol("color"),Kd=Symbol("hsva"),Gd=Symbol("update"),Jd=Symbol("parts"),Zd=Symbol("css"),Qd=Symbol("sliders");class Yd extends HTMLElement{static get observedAttributes(){return["color"]}get[Zd](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Qd](){return[Hd,qd]}get color(){return this[Ud]}set color(e){if(!this[Wd](e)){const t=this.colorModel.toHsva(e);this[Gd](t),this[Ud]=e}}constructor(){super();const e=Nd(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Jd]=this[Qd].map((e=>new e(t)))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){const o=this.colorModel.fromAttr(i);this[Wd](o)||(this.color=o)}handleEvent(e){const t=this[Kd],i={...t,...e.detail};let o;this[Gd](i),Fd(i,t)||this[Wd](o=this.colorModel.fromHsva(i))||(this[Ud]=o,Bd(this,"color-changed",{value:o}))}[Wd](e){return this.color&&this.colorModel.equal(e,this.color)}[Gd](e){this[Kd]=e,this[Jd].forEach((t=>t.update(e)))}}const Xd={defaultColor:"#000",toHsva:e=>Dd(Pd(e)),fromHsva:({h:e,s:t,v:i})=>Vd(Rd({h:e,s:t,v:i,a:1})),equal:(e,t)=>e.toLowerCase()===t.toLowerCase()||Fd(Pd(e),Pd(t)),fromAttr:e=>e};class eu extends Yd{get colorModel(){return Xd}}class tu extends ei{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,i)=>{this._renderViewIntoCollectionParent(t,i)})),this.on("remove",((e,t)=>{t.element&&this._parentElement&&t.element.remove()})),this._parentElement=null}destroy(){this.map((e=>e.destroy()))}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every((e=>"string"==typeof e)))throw new fe("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",((i,o)=>{for(const i of e)o.delegate(i).to(t)})),this.on("remove",((i,o)=>{for(const i of e)o.stopDelegating(i,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class iu extends(xe()){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,mu(hu(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new fe("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)yu(i)?yield i:_u(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,o)=>new nu({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o}),if:(i,o,n)=>new su({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}static extend(e,t){if(e._isRendered)throw new fe("template-extend-render",[this,e]);bu(e,mu(hu(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new fe("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),ru(this.text)?this._bindToObservable({schema:this.text,updater:cu(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),s=this.attributes[o];i&&(i.attributes[o]=n);const r=vu(s)?s[0].ns:null;if(ru(s)){const a=vu(s)?s[0].value:s;i&&Cu(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:du(t,o,r),data:e})}else if("style"==o&&"string"!=typeof s[0])this._renderStyleAttribute(s[0],e);else{i&&n&&Cu(o)&&s.unshift(n);const e=s.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(pu,"");wu(e)||t.setAttributeNS(r,o,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];ru(n)?this._bindToObservable({schema:[n],updater:uu(i,o),data:t}):au(o)?i.style.setProperty(o,n):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const s of this.children)if(ku(s)){if(!o){s.setParent(t);for(const e of s)i.appendChild(e.element)}}else if(yu(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if(Qe(s))i.appendChild(s);else if(o){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),s._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:t})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map((i=>{const[o,n]=t.split("@");return i.activateDomEventListener(o,n,e)}));e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;lu(e,t,i);const n=e.filter((e=>!wu(e))).filter((e=>e.observable)).map((o=>o.activateAttributeListener(e,t,i)));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const i=e;for(const e in t.attributes){const o=t.attributes[e];null===o?i.removeAttribute(e):i.setAttribute(e,o)}for(let e=0;elu(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class nu extends ou{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class su extends ou{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!wu(super.getValue(e))&&(this.valueIfTrue||!0)}}function ru(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(ru):e instanceof ou)}function au(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function lu(e,t,{node:i}){const o=function(e,t){return e.map((e=>e instanceof ou?e.getValue(t):e))}(e,i);let n;n=1==e.length&&e[0]instanceof su?o[0]:o.reduce(pu,""),wu(n)?t.remove():t.set(n)}function cu(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function du(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function uu(e,t){return{set(i){au(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){au(t)?e.style.removeProperty(t):e.style[t]=null}}}function hu(e){return N(e,(e=>{if(e&&(e instanceof ou||_u(e)||yu(e)||ku(e)))return e}))}function mu(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Qt(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)gu(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Qt(e[t].value)),gu(e,t)}(e.attributes);const t=[];if(e.children)if(ku(e.children))t.push(e.children);else for(const i of e.children)_u(i)||yu(i)||Qe(i)?t.push(i):t.push(new iu(i));e.children=t}return e}function gu(e,t){e[t]=Qt(e[t])}function pu(e,t){return wu(t)?e:wu(e)?t:`${e} ${t}`}function fu(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function bu(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),fu(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),fu(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new fe("ui-template-extend-children-mismatch",e);let i=0;for(const o of t.children)bu(e.children[i++],o)}}function wu(e){return!e&&0!==e}function yu(e){return e instanceof Au}function _u(e){return e instanceof iu}function ku(e){return e instanceof tu}function vu(e){return s(e[0])&&e[0].ns}function Cu(e){return"class"==e||"style"==e}class Au extends(et(Be())){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new ei,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,i)=>{i.locale=e,i.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=iu.bind(this,this)}createCollection(e){const t=new tu(e);return this._viewCollections.add(t),t}registerChild(e){Ue(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Ue(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new iu(e)}extendTemplate(e){iu.extend(this.template,e)}render(){if(this.isRendered)throw new fe("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}const xu={POLITE:"polite",ASSERTIVE:"assertive"};class Eu{editor;view;constructor(e){this.editor=e,e.once("ready",(()=>{for(const e of Object.values(xu))this.announce("",e)}))}announce(e,t=xu.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new Tu(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}="string"==typeof t?{politeness:t}:t;let s=this.view.regionViews.find((e=>e.politeness===o));s||(s=new Pu(i,o),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:n})}}class Tu extends Au{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class Pu extends Au{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",(()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)})),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval((()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()}),5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function Su({emitter:e,activator:t,callback:i,contextElements:o,listenerOptions:n}){e.listenTo(document,"mousedown",((e,n)=>{if(!t())return;const s="function"==typeof n.composedPath?n.composedPath():[],r="function"==typeof o?o():o;for(const e of r)if(e.contains(n.target)||s.includes(e))return;i()}),n)}function Iu(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function Ru(e){return class extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",(()=>{this._attachListeners()})),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(J.document,"mouseup",this._onDragEndBound),this.listenTo(J.document,"touchend",this._onDragEndBound),this.listenTo(J.document,"mousemove",this._onDragBound),this.listenTo(J.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(J.document,"mouseup",this._onDragEndBound),this.stopListening(J.document,"touchend",this._onDragEndBound),this.stopListening(J.document,"mousemove",this._onDragBound),this.stopListening(J.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:o},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,o=0;t instanceof MouseEvent?(i=t.clientX,o=t.clientY):(i=t.touches[0].clientX,o=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(o-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:o}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}function Ou({view:e}){e.listenTo(e.element,"submit",((t,i)=>{i.preventDefault(),e.fire("submit")}),{useCapture:!0})}function Vu({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){const s="number"==typeof o?()=>o:o;function r(e){return o=>{const n=i.find((e=>e.element===t.focusedElement)),s=i.getIndex(n),r=e(s,i);i.get(r).focus(),o.stopPropagation(),o.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function l(e,t){return 0===e?t-1:e-1}e.set("arrowright",r(((e,t)=>"rtl"===n?l(e,t.length):a(e,t.length)))),e.set("arrowleft",r(((e,t)=>"rtl"===n?a(e,t.length):l(e,t.length)))),e.set("arrowup",r(((e,t)=>{let i=e-s();return i<0&&(i=e+s()*Math.floor(t.length/s()),i>t.length-1&&(i-=s())),i}))),e.set("arrowdown",r(((e,t)=>{let i=e+s();return i>t.length-1&&(i=e%s()),i})))}class Du extends Au{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${me()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class Fu extends Au{constructor(e,t){super(e);const i=e.t,o=new Du;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[Ke(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map((e=>{const t=[Ke(document,"h3",{},e.label),...Array.from(e.groups.values()).map((e=>this._createGroup(e))).flat()];return e.description&&t.splice(1,0,Ke(document,"p",{},e.description)),Ke(document,"section",{},t)}))}_createGroup(e){const t=e.keystrokes.sort(((e,t)=>e.label.localeCompare(t.label))).map((e=>this._createGroupRow(e))).flat(),i=[Ke(document,"dl",{},t)];return e.label&&i.unshift(Ke(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=Ke(document,"dt"),o=Ke(document,"dd"),n=function(e){if("string"==typeof e)return[[e]];if("string"==typeof e[0])return[e];return e}(e.keystroke),s=[];for(const e of n)s.push(e.map(Mu).join(""));return i.innerHTML=e.label,o.innerHTML=s.join(", ")+(e.mayRequireFn&&Y.isMac?` ${t("(may require Fn)")}`:""),[i,o]}}function Mu(e){return Ut(e).split("+").map((e=>`${e}`)).join("+")}class Nu extends Au{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",(e=>!e)),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(()=>{this._updateXMLContent(),this._colorFillPaths()})),this.on("change:fillColor",(()=>{this._colorFillPaths()}))}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!e)throw new fe("ui-iconview-invalid-svg",this);const t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:i}of Array.from(e.attributes))Nu.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}class Bu extends Au{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class Lu extends Au{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new Bu){super(e);const i=this.bindTemplate,o=me();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new Nu,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",(e=>!e)),i.if("isVisible","ck-hidden",(e=>!e)),i.to("isOn",(e=>e?"ck-on":"ck-off")),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",(e=>e||"button")),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,(e=>!e)),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||zu(i))&&String(!!e))),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||!zu(i))&&String(!!e))),Y.isSafari&&(this._focusDelayed||(this._focusDelayed=ci((()=>this.focus()),0)),n.on.mousedown=i.to((()=>{this._focusDelayed()})),n.on.mouseup=i.to((()=>{this._focusDelayed.cancel()}))),this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",((e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)})),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new Au;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>Ut(e)))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=Ut(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function zu(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class ju extends Au{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new Nu,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new Au(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class $u extends(xe()){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];"string"==typeof i&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,((e,i)=>{this[t](),i()}),e.keystrokeHandlerOptions)}this.on("forwardCycle",(()=>this.focusFirst()),{priority:"low"}),this.on("backwardCycle",(()=>this.focusLast()),{priority:"low"})}get first(){return this.focusables.find(qu)||null}get last(){return this.focusables.filter(qu).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o})),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",(e=>{const i=t();this.focusNext(),i!==t()&&e.stop()}),{priority:"low"}),this.listenTo(e,"backwardCycle",(e=>{const i=t();this.focusPrevious(),i!==t()&&e.stop()}),{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const i=this.focusables.get(n);if(qu(i)){o=i;break}n=(n+t+e)%t}while(n!==i);return o}}function qu(e){return Hu(e)&&Ct(e.element)}function Hu(e){return!(!("focus"in e)||"function"!=typeof e.focus)}class Wu extends Au{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new ri,this._focusTracker=new ii,this._focusables=new tu,this.focusCycler=new $u({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new Lu(this.locale);let i;for(i in e.on("execute",(()=>t.onExecute())),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}}class Uu extends Au{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const Ku="screen-center",Gu="editor-center",Ju="editor-top-side",Zu="editor-top-center",Qu="editor-bottom-center",Yu="editor-above-center",Xu="editor-below-center",eh=yt("px");class th extends(Ru(Au)){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const n=this.bindTemplate,s=e.t;this.set("className",""),this.set("ariaLabel",s("Editor dialog")),this.set("isModal",!1),this.set("position",Ku),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new ri,this.focusTracker=new ii,this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",(e=>!e)),n.if("_isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",(e=>eh(e))),left:n.to("_left",(e=>eh(e))),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",((e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())})),this.on("drag",((e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)})),this.listenTo(J.window,"resize",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.listenTo(J.document,"scroll",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.on("change:_isVisible",((e,t,i)=>{i&&(this._isTransparent=!0,setTimeout((()=>{this.updatePosition(),this._isTransparent=!1,this.focus()}),10))})),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new ju(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof Au&&(o=[o]),this.contentView=new Uu(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new Wu(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e{var t;this._focusables.add(e),this.focusTracker.add(e.element),Hu(t=e)&&"focusCycler"in t&&t.focusCycler instanceof $u&&this._focusCycler.chain(e.focusCycler)}))}_createCloseButton(){const e=new Lu(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:qc}),e.on("execute",(()=>this.fire("close",{source:"closeButton"}))),e}}class ih extends fc{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),ih._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",((e,t)=>{this._show(t)})),this.on("show",((e,t)=>{t.onShow&&t.onShow(this)}),{priority:"low"}),this.on("hide",(()=>{ih._visibleDialogPlugin&&ih._visibleDialogPlugin._hide()})),this.on("hide",(()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)}),{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",((t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())}))}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",(()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()}))}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:s,className:r,isModal:a,position:l,onHide:c,keystrokeHandlerOptions:d}){const u=this.editor;this.view=new th(u.locale,{getCurrentDomRoot:()=>u.editing.view.getDomRoot(u.model.document.selection.anchor.root.rootName),getViewportOffset:()=>u.ui.viewportOffset,keystrokeHandlerOptions:d});const h=this.view;h.on("close",(()=>{this.hide()})),u.ui.view.body.add(h),u.keystrokes.listenTo(h.element),l||(l=a?Ku:Gu),a&&this._lockBodyScroll(),h.set({position:l,_isVisible:!0,className:r,isModal:a}),h.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:s}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,ih._visibleDialogPlugin=this}hide(){ih._visibleDialogPlugin&&ih._visibleDialogPlugin.fire(`hide:${ih._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,ih._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class oh extends Lu{_checkIconHolderView=new nh;constructor(e,t=new Bu){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",((e,t)=>e||t))}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",(e=>this.isToggleable&&e)),this.on("change:_hasCheck",((e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)}))}}class nh extends Au{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",(e=>e?"ck-on":"ck-off"))]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",((e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)}))}_createCheckIconView(){const e=new Nu;return e.content=Hc,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class sh extends oh{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class rh extends fc{contentView=null;static get requires(){return[ih]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e})),e.ui.componentFactory.add("menuBar:accessibilityHelp",(()=>{const e=this._createButton(sh);return e.label=t("Accessibility"),e})),e.keystrokes.set("Alt+0",((e,t)=>{this._toggleDialog(),t()})),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=new e(t.locale);return o.set({keystroke:"Alt+0",icon:zc,isToggleable:!0}),o.on("execute",(()=>this._toggleDialog())),o.bind("isOn").to(i,"id",(e=>"accessibilityHelp"===e)),o}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function o(e,t){const o=[t.getAttribute("aria-label"),i("Press %0 for help.",[Ut("Alt+0")])].filter((e=>e)).join(". ");e.setAttribute("aria-label",o,t)}e.ui.on("ready",(()=>{t.change((e=>{for(const i of t.document.roots)o(e,i)})),e.on("addRoot",((i,n)=>{const s=e.editing.view.document.getRoot(n.rootName);t.change((e=>o(e,s)))}),{priority:"low"})}))}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new Fu(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:zc,hasCloseButton:!0,content:this.contentView})}}class ah extends tu{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new iu({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),ah._bodyWrapper&&ah._bodyWrapper.isConnected||(ah._bodyWrapper=Ke(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(ah._bodyWrapper)),ah._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),ah._bodyWrapper&&!ah._bodyWrapper.childElementCount&&(ah._bodyWrapper.remove(),delete ah._bodyWrapper)}}const lh=yt("px"),ch={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class dh extends Au{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",(e=>`ck-balloon-panel_${e}`)),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",lh),left:t.to("left",lh)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=uh(e.target);if(t&&!Ct(t))return!1;this.show();const i=dh.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:J.document.body,fitInViewport:!0},e),n=dh._getOptimalPosition(o)||ch,s=parseInt(n.left),r=parseInt(n.top),a=n.name,l=n.config||{},{withArrow:c=!0}=l;return this.top=r,this.left=s,this.position=a,this.withArrow=c,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=uh(e.target);const i=e.limiter?uh(e.limiter):J.document.body;if(this.listenTo(J.document,"scroll",((o,n)=>{const s=n.target,r=t&&s.contains(t),a=i&&s.contains(i);!r&&!a&&t&&i||this.attachTo(e)}),{useCapture:!0}),this.listenTo(J.window,"resize",(()=>{this.attachTo(e)})),!this._resizeObserver&&(t&&at(t)&&(t=t.parentElement),t)){const e=()=>{Ct(t)||this.unpin()};this._resizeObserver=new bt(t,e)}return!0}_stopPinning(){this.stopListening(J.document,"scroll"),this.stopListening(J.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=dh.arrowSideOffset,heightOffset:i=dh.arrowHeightOffset,stickyVerticalOffset:o=dh.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left-i.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(e,i)=>({top:s(e,i),left:e.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(e,i)=>({top:s(e,i),left:e.right-i.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:e=>({top:r(e),left:e.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(e,t)=>({top:r(e),left:e.left-t.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.left-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(e,i)=>({top:r(e),left:e.left-i.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:e=>({top:r(e),left:e.left+e.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(e,t)=>({top:r(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(e,i)=>({top:r(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:e=>({top:r(e),left:e.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(e,i)=>({top:r(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(e,t)=>({top:r(e),left:e.right-t.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(e,i)=>({top:r(e),left:e.right-.75*i.width+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(e,i)=>({top:r(e),left:e.right-i.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(e,t,i)=>{const s=new ut(J.document.body).getIntersection(i.getVisible());if(!s)return null;const r=s.getVisible();return e.getIntersection(r)&&r.top-e.top-othis._showBalloon()),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",(()=>this._handleEditorReady()))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",((e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()})),e.ui.focusTracker.on("change:focusedElement",((e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()})),e.ui.on("update",(()=>{this._showBalloonThrottled()})))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new dh,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t="right"===e.side?function(e,t){return mh(e,t,((e,i)=>e.left+e.width-i.width-t.horizontalOffset))}(this._lastFocusedEditableElement,e):function(e,t){return mh(e,t,(e=>e.left+t.horizontalOffset))}(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const o=Array.from(e.ui.getEditableElementsNames()).map((t=>e.ui.getEditableElement(t)));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function mh(e,t,i){return(o,n)=>{const s=new ut(e);if(s.width<350||s.height<50)return null;let r;r="inside"===t.position?s.bottom-n.height:s.bottom-n.height/2,r-=t.verticalOffset;const a=i(s,n),l=o.clone().moveTo(a,r).getIntersection(n.clone().moveTo(a,r)).getVisible();return!l||l.getArea()\n',isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to((e=>e.preventDefault()))}}]})}}class fh extends Lu{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Au;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class bh extends(yh(Lu)){}class wh extends(yh(oh)){}function yh(e){return class extends e{_fileInputView;constructor(...e){super(...e),this._fileInputView=new _h(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",(()=>{this._fileInputView.open()})),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}}class _h extends Au{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to((()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}class kh extends Au{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new Lu(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:Uc}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",(e=>!e)),e.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),e}}function vh(e,t){const i=e.t,o={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map((e=>{const t=o[e.label];return t&&t!=e.label&&(e.label=t),e}))}function Ch(e){return e.map(Ah).filter((e=>!!e))}function Ah(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class xh extends Lu{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",(e=>Y.isMediaForcedColors?null:e))},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Eh extends Au{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),i.forEach((e=>{const t=new xh;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",(()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})})),this.items.add(t)})),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",((e,t,i)=>{for(const e of this.items)e.isOn=e.color===i}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",((e,t)=>{this.focusTracker.add(t.element)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t.element)})),this.keystrokes.listenTo(this.element),Vu({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function Th(e,t){if(!e)return"";const i=Ph(e);if(!i)return"";if(i.space===t)return e;if(o=i,!Object.keys(xd).includes(o.space))return"";var o;const n=xd[i.space][t];if(!n)return"";return function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}(n("hex"===i.space?i.hexValue:i.values),t)}function Ph(e){if(e.startsWith("#")){const t=ad(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}const t=ad(e);return t.space?t:null}class Sh extends Au{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${me()}`,o=`ck-labeled-field-view-status-${me()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((e,t)=>e||t));const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",(e=>!e)),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Du(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Au(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(e=>!e))],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Ih extends Au{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new ii,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class Rh extends Ih{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Oh extends Rh{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class Vh extends Rh{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}class Dh extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",(e=>`ck-dropdown__panel_${e}`)),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{const t=e.target;t instanceof Element&&"input"===t.tagName.toLocaleLowerCase()||e.preventDefault()}))}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():be("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class Fh extends Au{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ri,this.focusTracker=new ii,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",(e=>!e))],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.on("change:isOpen",((e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=Fh._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:s,southMiddleEast:r,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Fh.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,o,r,a,e,n,s,l,c,t]:[o,i,a,r,e,s,n,c,l,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})};static _getOptimalPosition=At}class Mh extends Lu{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Uc,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class Nh extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class Bh extends Au{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class Lh extends Au{labelView;items;children;constructor(e,t=new Du){super(e);const i=this.bindTemplate,o=new zh(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){if(this.items){const e=this.items.find((e=>!(e instanceof Bh)));e&&e.focus()}}}class zh extends Au{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new tu,this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this._focusCycler=new $u({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof Lh?this._registerFocusableItemsGroup(e):e instanceof Nh&&this._registerFocusableListItem(e);this.items.on("change",((e,t)=>{for(const e of t.removed)e instanceof Lh?this._deregisterFocusableItemsGroup(e):e instanceof Nh&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof Lh?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach(((e,i)=>{const o=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,o)}));const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class jh extends Au{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class $h extends Au{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function qh(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}const Hh=(()=>({alignLeft:jc,bold:$c,importExport:'',paragraph:'',plus:'',text:'',threeVerticalDots:od,pilcrow:'',dragIndicator:''}))();class Wh extends Au{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Uh(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n="rtl"===e.uiLanguageDirection;this._focusCycler=new $u({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];var r;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(r=this,r.bindTemplate.to((e=>{e.target===r.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new Gh(this):new Kh(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",((e,t)=>{this.focusTracker.add(t)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),"dynamic"===e?(this._behavior=new Gh(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Kh(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const o=qh(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map((e=>s(e)?this._createNestedToolbarDropdown(e,t,n):"|"===e?new jh:"-"===e?new $h:t.create(e))).filter((e=>!!e))}_cleanItemsConfiguration(e,t,i){const o=e.filter(((e,o,n)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(be("toolbarview-line-break-ignored-when-grouping-items",n),!1):!(!s(e)&&!t.has(e))||(be("toolbarview-item-unavailable",{item:e}),!1))));return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,o=e.findIndex(t);if(-1===o)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter(((e,i,o)=>{if(t(e))return!0;return!(i>0&&o[i-1]===e)}))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:s,tooltip:r=!0,withText:a=!1}=e;if(s=this._cleanItemsConfiguration(s,t,i),!s.length)return null;const l=Zh(this.locale);return o||be("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:o,tooltip:r,withText:!!a}),!1!==n?l.buttonView.icon=Hh[n]||n||od:l.buttonView.withText=!0,Qh(l,(()=>l.toolbarView._buildItemsFromConfig(s,t,i))),l}}class Uh extends Au{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Kh{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using((e=>e)),e.focusables.bindTo(e.items).using((e=>Hu(e)?e:null))}render(){}destroy(){}}class Gh{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",((e,t)=>{const i=t.index,o=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()}))}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let t=0;to.right-this.cachedPadding:i.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new jh),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=Zh(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Qh(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:od}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{Hu(e)&&this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Jh extends Au{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new ri,this.focusTracker=new ii,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",(e=>!e)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new Lu;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new Lu,t=e.bindTemplate;return e.icon=Uc,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function Zh(e,t=Mh){const i="function"==typeof t?new t(e):t,o=new Dh(e),n=new Fh(e,i,o);return i.bind("isEnabled").to(n),i instanceof Jh?i.arrowView.bind("isOn").to(n,"isOpen"):i.bind("isOn").to(n,"isOpen"),function(e){(function(e){Su({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...im(e.focusTracker).filter((t=>!e.element.contains(t)))]})})(e),function(e){e.on("execute",(t=>{t.source instanceof fh||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,i,o)=>{!o&&e.isOpen&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isOpen&&(e.panelView.focus(),i())})),e.keystrokes.set("arrowup",((t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{if(o)return;e.focusTracker.elements.some((e=>e.contains(J.document.activeElement)))&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,i,o)=>{o&&e.panelView.focus()}),{priority:"low"})}(e)}(n),n}function Qh(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Yh(e,t,i):e.once("change:isOpen",(()=>Yh(e,t,i)),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&tm(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function Yh(e,t,i){const o=e.locale,n=o.t,s=e.toolbarView=new Wh(o),r="function"==typeof t?t():t;s.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(s.maxWidth=i.maxWidth),i.class&&(s.class=i.class),i.isCompact&&(s.isCompact=i.isCompact),i.isVertical&&(s.isVertical=!0),r instanceof tu?s.items.bindTo(r).using((e=>e)):s.items.addMany(r),e.panelView.children.add(s),e.focusTracker.add(s),s.items.delegate("execute").to(e)}function Xh(e,t,i={}){e.isOpen?em(e,t,i):e.once("change:isOpen",(()=>em(e,t,i)),{priority:"highest"}),tm(e,(()=>e.listView.items.find((e=>e instanceof Nh&&e.children.first.isOn))))}function em(e,t,i){const o=e.locale,n=e.listView=new zh(o),s="function"==typeof t?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,om(e,n.items,s,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function tm(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():be("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))}),{priority:ge.low-10})}function im(e){return[...e.elements,...e.externalViews.flatMap((e=>im(e.focusTracker)))]}function om(e,t,i,o){!function(e){let t=0;const i=e=>e instanceof Nh&&e.children.first instanceof oh?e.children.first:null,o=e=>{const t=i(e);return t&&t.isToggleable?t:null},n=t=>{for(const o of e){const e=i(o);e&&(e.hasCheckSpace=t)}};e.on("change",((e,s)=>{const r=t>0;for(const e of s.removed)o(e)&&t--;for(const e of s.added){const o=i(e);o&&(o.isToggleable&&t++,o.hasCheckSpace=t>0)}const a=t>0;r!==a&&n(a)}))}(t),t.bindTo(i).using((t=>{if("separator"===t.type)return new Bh(o);if("group"===t.type){const i=new Lh(o);return i.set({label:t.label}),om(e,i.items,t.items,o),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e="menuitemcheckbox"===t.model.role||"menuitemradio"===t.model.role,i=new Nh(o);let n;return"button"===t.type?(n=new oh(o,t.labelView),n.set({isToggleable:e})):n=new fh(o),n.bind(...Object.keys(t.model)).to(t.model),n.delegate("execute").to(i),i.children.add(n),i}return null}))}const nm=(e,t,i)=>{const o=new Oh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},sm=(e,t,i)=>{const o=new Vh(e.locale);return o.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),o.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),o.bind("hasError").to(e,"errorText",(e=>!!e)),o.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(o),o},rm=(e,t,i)=>{const o=Zh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o};class am extends Au{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=Li((e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})}),150,{leading:!0}),this.on("set:color",((e,t,i)=>{e.return=Th(i,this._config.format||"hsl")})),this.on("change:color",(()=>{this._hexColor=lm(this.color)})),this.on("change:_hexColor",(()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),lm(this.color)!=lm(this._hexColor)&&(this.color=this._hexColor)}))}render(){var e,t;if(super.render(),e="hex-color-picker",t=eu,void 0===customElements.get(e)&&customElements.define(e,t),this.picker=J.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",(e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)}))}focus(){if(!this._config.hideInput&&(Y.isGecko||Y.isiOS||Y.isSafari||Y.isBlink)){this.hexInputRow.children.get(1).focus()}this.slidersView.first.focus()}_createSlidersView(){const e=[...this.picker.shadowRoot.children].filter((e=>"slider"===e.getAttribute("role"))).map((e=>new cm(e)));this.slidersView=this.createCollection(),e.forEach((e=>{this.slidersView.add(e)}))}_createInputRow(){const e=this._createColorInput();return new um(this.locale,e)}_createColorInput(){const e=new Sh(this.locale,nm),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",(t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t)),e.fieldView.on("input",(()=>{const t=e.fieldView.element.value;if(t){const e=hm(t);e&&this._debounceColorPickerEvent(e)}})),e}isValid(){const{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function lm(e){let t=function(e){if(!e)return"";const t=Ph(e);return t?"hex"===t.space?t.hexValue:Th(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class cm extends Au{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class dm extends Au{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class um extends Au{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new dm,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return hm(this.inputView.fieldView.element.value)}}function hm(e){if(!e)return null;const t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class mm extends(Be(ei)){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(e,t){return this.find((t=>t.color===e.color))?this:super.add(e,t)}hasColor(e){return!!this.find((t=>t.color===e))}}class gm extends Au{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:a,focusables:l}){super(e);const c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new mm,this.documentColorsCount=s,this._focusables=l,this._removeButtonLabel=o,this._colorPickerLabel=r,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",(e=>!e))]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const i=e.createRangeIn(n);for(const e of i.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=iu.bind(this.documentColors,this.documentColors),t=new Au(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new Lu,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:'',class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",(()=>{this.fire("colorPicker:show")}))}_createRemoveColorButton(){const e=new Lu;return e.set({withText:!0,icon:'',label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",(()=>{this.fire("execute",{value:null,source:"removeColorButton"})})),e.render(),e}_createStaticColorsGrid(){const e=new Eh(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",((e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})})),e}_createDocumentColorsGrid(){const e=iu.bind(this.documentColors,this.documentColors),t=new Eh(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using((e=>{const t=new xh;return t.set({color:e.color,hasBorder:e.options?.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",(()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})})),t})),this.documentColors.on("change:isEmpty",((e,i,o)=>{o&&(t.selectedColor=null)})),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find((t=>t.color===e));t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class pm extends Au{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const s=this.bindTemplate,{saveButtonView:r,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=r,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:r,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",(e=>!e))]},children:this.items})}render(){super.render();const e=new am(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",((t,i,o)=>{e.color=o})),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",(e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())}))}_stopPropagationOnArrowsKeys(){const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new Au,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new Lu(e),o=new Lu(e);return i.set({icon:Hc,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:qc,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",(()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})})),o.on("execute",(()=>{this.fire("colorPicker:cancel")})),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",((e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)}))}}class fm extends Au{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new ii,this.keystrokes=new ri,this._focusables=new tu,this._colorPickerViewConfig=a,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new gm(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new pm(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",((e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)})),this.colorGridsFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.colorPickerFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{this.showColorPickerFragment()})),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class bm{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(wm(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new fe("componentfactory-item-missing",this,{name:e});return this._components.get(wm(e)).callback(this.editor.locale)}has(e){return this._components.has(wm(e))}}function wm(e){return String(e).toLowerCase()}const ym="ck-tooltip";class _m extends(et()){tooltipTextView;balloonPanelView;static defaultBalloonPositions=dh.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),_m._editors.add(e),_m._instance)return _m._instance;_m._instance=this,this.tooltipTextView=new Au(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new dh(e.locale),this.balloonPanelView.class=ym,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver((()=>{e()}));return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}((()=>{this._updateTooltipPosition()})),this._pinTooltipDebounced=Li(this._pinTooltip,600),this._unpinTooltipDebounced=Li(this._unpinTooltip,400),this.listenTo(J.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(J.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(J.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(J.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(J.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(J.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;_m._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),_m._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),_m._instance=null)}static getPositioningFunctions(e){const t=_m.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=km(t);i?i!==this._currentElementWithTooltip?(this._unpinTooltip(),"focus"===e.name&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,vm(i)):this._pinTooltipDebounced(i,vm(i))):this._unpinTooltipDebounced.cancel():"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!L(t))return;const e=this.balloonPanelView.element,o=e&&(e===i||e.contains(i)),n=!o&&t===e;if(o)return void this._unpinTooltipDebounced.cancel();if(!n&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const s=km(t),r=km(i);(n||s&&s!==r)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||s&&s.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=ti(_m._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[ym,o].filter((e=>e)).join(" "),this.balloonPanelView.pin({target:e,positions:_m.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const e of _m._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of _m._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=vm(this._currentElementWithTooltip);Ct(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:_m.getPositioningFunctions(e.position)}):this._unpinTooltip()}}function km(e){return L(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function vm(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}class Cm extends hh{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const e=xm(this.editor.config.get("licenseKey"));return Boolean(e&&this.licenseTypeMessage[e])}_createBadgeContent(){const e=xm(this.editor.config.get("licenseKey"));return new Am(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class Am extends Au{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function xm(e){if("GPL"==e)return"GPL";const t=di(e.split(".")[1]);return t?t.licenseType||"production":null}class Em extends Nh{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const Tm={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",(t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(const i of e.menus){const e=t.path[0],o=e instanceof Em&&e.children.first===i;i.isOpen=(t.path.includes(i)||o)&&i.isEnabled}t.source.focus()}}))},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const o=e.children.getIndex(t),n=t.isOpen,s=e.children.length,r=e.children.get((o+s+i)%s);t.isOpen=!1,n&&(r.isOpen=!0),r.buttonView.focus()}e.on("menu:arrowright",(e=>{i(e.source,t?-1:1)})),e.on("menu:arrowleft",(e=>{i(e.source,t?1:-1)}))},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",(()=>{e.isOpen||e.menus.forEach((e=>{e.isOpen=!1}))}))},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",((t,i,o)=>{o&&e.menus.filter((e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen)).forEach((e=>{e.isOpen=!1}))}))},closeOnClickOutside(e){Su({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map((e=>e.element))})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",((i,o,n)=>{n||(t||(e.isFocusBorderEnabled=!1),t=!1)})),e.listenTo(e.element,"keydown",(()=>{t=!0}),{useCapture:!0}),e.listenTo(e.element,"keyup",(()=>{t=!1}),{useCapture:!0}),e.listenTo(e.element,"focus",(()=>{t&&(e.isFocusBorderEnabled=!0)}),{useCapture:!0})}},Pm={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!0}))},toggleOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!e.isOpen}))},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",((t,i,o)=>{o||t.source!==e.parentMenuView||(e.isOpen=!1)}))}},Sm={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},Im=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Rm({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){const n=j(e);return Om(e,n,o),function(e,t){const i=t.removeItems,o=[];t.items=t.items.filter((({menuId:e})=>!i.includes(e)||(o.push(e),!1))),Mm(t.items,(e=>{e.groups=e.groups.filter((({groupId:e})=>!i.includes(e)||(o.push(e),!1)));for(const t of e.groups)t.items=t.items.filter((e=>{const t=zm(e);return!i.includes(t)||(o.push(t),!1)}))}));for(const t of i)o.includes(t)||be("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,n),Om(e,n,n.addItems),function(e,t,i){Mm(t.items,(o=>{for(const n of o.groups)n.items=n.items.filter((n=>{const s="string"==typeof n&&!i.has(n);return s&&!t.isUsingDefaultConfig&&be("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:j(o),componentName:n}),!s}))}))}(e,n,i),Dm(e,n),function(e,t){const i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Mm(e.items,(e=>{e.label in o&&(e.label=o[e.label])}))}(n,t),n}function Om(e,t,i){const o=[];if(0!=i.length){for(const e of i){const i=Bm(e.position),s=Lm(e.position);if("object"==typeof(n=e)&&"menu"in n)if(s){const n=t.items.findIndex((e=>e.menuId===s));if(-1!=n)"before"===i?(t.items.splice(n,0,e.menu),o.push(e)):"after"===i&&(t.items.splice(n+1,0,e.menu),o.push(e));else{Vm(t,e.menu,s,i)&&o.push(e)}}else"start"===i?(t.items.unshift(e.menu),o.push(e)):"end"===i&&(t.items.push(e.menu),o.push(e));else if(Nm(e))Mm(t.items,(t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),o.push(e)):"end"===i&&(t.groups.push(e.group),o.push(e));else{const n=t.groups.findIndex((e=>e.groupId===s));-1!==n&&("before"===i?(t.groups.splice(n,0,e.group),o.push(e)):"after"===i&&(t.groups.splice(n+1,0,e.group),o.push(e)))}}));else{Vm(t,e.item,s,i)&&o.push(e)}}var n;for(const t of i)o.includes(t)||be("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function Vm(e,t,i,o){let n=!1;return Mm(e.items,(e=>{for(const{groupId:s,items:r}of e.groups){if(n)return;if(s===i)"start"===o?(r.unshift(t),n=!0):"end"===o&&(r.push(t),n=!0);else{const e=r.findIndex((e=>zm(e)===i));-1!==e&&("before"===o?(r.splice(e,0,t),n=!0):"after"===o&&(r.splice(e+1,0,t),n=!0))}}})),n}function Dm(e,t){const i=t.isUsingDefaultConfig;let o=!1;t.items=t.items.filter((t=>!!t.groups.length||(Fm(e,t,i),!1))),t.items.length?(Mm(t.items,(t=>{t.groups=t.groups.filter((e=>!!e.items.length||(o=!0,!1)));for(const n of t.groups)n.items=n.items.filter((t=>!(jm(t)&&!t.groups.length)||(Fm(e,t,i),o=!0,!1)))})),o&&Dm(e,t)):Fm(e,e,i)}function Fm(e,t,i){i||be("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function Mm(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)jm(e)&&i(e)}}function Nm(e){return"object"==typeof e&&"group"in e}function Bm(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function Lm(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function zm(e){return"string"==typeof e?e:e.menuId}function jm(e){return"object"==typeof e&&"menuId"in e}class $m extends(Be()){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new bm(e),this.focusTracker=new ii,this.tooltipManager=new _m(e),this.poweredBy=new gh(e),this.evaluationBadge=new Cm(e),this.ariaLiveAnnouncer=new Eu(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",(()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0})),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:j(Im),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",((e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())})),this.editor.keystrokes.set("Alt+F9",((i,o)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),o())}))}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",((e,i)=>{this._saveLastFocusedForeignElement();const o=this._getCurrentFocusedToolbarDefinition();o&&t||(t=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const o=this._getCurrentFocusedToolbarDefinition();o&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),o.options.afterBlur&&o.options.afterBlur(),i())}))}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(Ct(i.element)||o.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>qm(e)-qm(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!Ct(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",((e,t)=>{this.focusTracker.add(t.element)})),e.on("remove",((e,t)=>{this.focusTracker.remove(t.element)}))}_initViewportOffset(e){this.on("set:viewportOffset",((e,t,i)=>{const o=this._getVisualViewportTopOffset(i);i.visualTop!==o&&(e.return={...i,visualTop:o})})),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!J.window.visualViewport)return;const e=()=>{const e=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==e&&(this.viewportOffset={...this.viewportOffset,visualTop:e})};this._domEmitter=new(et()),this._domEmitter.listenTo(J.window.visualViewport,"scroll",e),this._domEmitter.listenTo(J.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const t=St().top,i=e.top||0;return t>i?0:i-t}}function qm(e){const{toolbarView:t,options:i}=e;let o=10;return Ct(t.element)&&o--,i.isContextual&&(o-=2),o}class Hm extends Au{body;menuBarView;toolbar;constructor(e){super(e),this.body=new ah(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Wm extends Au{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((i=>{const o=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",o)}))}e.isRenderingInProgress?function i(o){e.once("change:isRenderingInProgress",((e,n,s)=>{s?i(o):t(o)}))}(this):t(this)}}class Um extends Wm{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change((t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)}))}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[o];if("function"==typeof t)return t(this);if(i){const e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",o)}}class Km extends Au{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...Qt(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach((e=>this.children.add(e))),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",(e=>e.join(" "))),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class Gm extends Cc{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",((e,t)=>{window.alert(t.message)}),{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Jm extends(Be()){constructor(e,t){super(),t&&Mi(this,t),e&&this.set(e)}}const Zm=yt("px");class Qm extends fc{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new fe("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new fe("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new fe("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new dh(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ym(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>1)),e.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((e,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,i])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new Xm(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?Math.min(e-1,2):0)),e.listenTo(this.view,"change:top",(()=>e.updatePosition())),e.listenTo(this.view,"change:left",(()=>e.updatePosition())),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Ym extends Au{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new ii,this.buttonPrevView=this._createButtonView(t("Previous"),ed),this.buttonNextView=this._createButtonView(t("Next"),Kc),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new Lu(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Xm extends Au{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:i.to("top",Zm),left:i.to("left",Zm),width:i.to("width",Zm),height:i.to("height",Zm)}},children:this.content}),this.on("change:numberOfPanels",((e,t,i,o)=>{i>o?this._addPanels(i-o):this._removePanels(o-i),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new Au;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new ut(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}class eg extends oh{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Uc,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class tg extends Au{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",(e=>`ck-menu-bar__menu__panel_position_${e}`)),t.if("isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}class ig extends Au{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new eg(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new tg(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new ri,this.focusTracker=new ii,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",(e=>!e)),t.if("parentMenuView","ck-menu-bar__menu_top-level",(e=>!e))]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Pm.closeOnEscKey(this),this._closeOnDisabled(),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Pm.openOnButtonClick(this),Pm.openOnArrowRightKey(this),Pm.closeOnArrowLeftKey(this),Pm.openAndFocusOnEnterKeyPress(this),Pm.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Pm.openAndFocusPanelOnArrowDownKey(this),Pm.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",((e,t)=>{this.fire("arrowright"),t()})),this.keystrokes.set("arrowleft",((e,t)=>{this.fire("arrowleft"),t()}))}_closeOnDisabled(){this.on("change:isEnabled",((e,t,i)=>{i||(this.isOpen=!1)}))}_repositionPanelOnOpen(){this.on("change:isOpen",((e,t,i)=>{if(!i)return;const o=ig._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName}))}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:s,westNorth:r,eastNorth:a}=Sm;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[s,a,n,r]:[e,t,i,o]:this.parentMenuView?[n,r,s,a]:[t,e,o,i]}get _defaultMenuPositionName(){return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=At}class og extends zh{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some((e=>{const t=ng(e);return t&&t.isToggleable}));this.items.forEach((t=>{const i=ng(t);i&&(i.hasCheckSpace=e)}))}}function ng(e){return e instanceof Nh?e.children.map((e=>function(e){return"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof Lu}(e)?e.buttonView:e)).find((e=>e instanceof oh)):null}class sg extends wh{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const rg=["mouseenter","arrowleft","arrowright","change:isOpen"];class ag extends Au{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=Rm({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map((e=>this._createMenu({componentFactory:t,menuDefinition:e})));this.children.addMany(o)}render(){super.render(),Tm.toggleMenusAndFocusItemsOnHover(this),Tm.closeMenusWhenTheBarCloses(this),Tm.closeMenuWhenAnotherOnTheSameLevelOpens(this),Tm.focusCycleMenusOnArrows(this),Tm.closeOnClickOutside(this),Tm.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...rg).to(t),e.parentMenuView=t):e.delegate(...rg).to(this,(e=>"menu:"+e)),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new ig(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",(()=>{const i=new og(o);i.ariaLabel=t.label,n.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))})),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const e of r.items){const r=new Em(o,t);if(s(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{const o=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!o)continue;r.children.add(o)}n.push(r)}r!==e.groups[e.groups.length-1]&&n.push(new Bh(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof ig||o instanceof sh||o instanceof sg?(this._registerMenuTree(o,t),o.on("execute",(()=>{this.close()})),o):(be("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof ig))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter((e=>e instanceof og))[0];if(!i)return void e.delegate("mouseenter").to(t);const o=i.items.filter((e=>e instanceof Nh));for(const t of o)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",((t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout((()=>{this.isOpen=Array.from(this.children).some((e=>e.isOpen))}),0)}))}}class lg extends $m{view;constructor(e,t){super(e),this.view=t}init(){const e=this.editor,t=this.view,i=e.editing.view,o=t.editable,n=i.document.getRoot();o.name=n.rootName,t.render();const s=o.element;this.setEditableElement(o.name,s),t.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(s),this._initPlaceholder(),this._initToolbar(),this.initMenuBar(this.view.menuBarView),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.editor,t=this.view;t.toolbar.fillFromConfig(e.config.get("toolbar"),this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.config.get("roots")[i.rootName].placeholder;o&&(i.placeholder=o),Qi({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}}class cg extends Hm{toolbar;editable;menuBarView;constructor(e,t,i={}){super(e),this.toolbar=new Wh(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.menuBarView=new ag(e),this.editable=new Um(e,t,i.editableElement,{label:i.label}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}}),this.menuBarView.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.menuBarView,this.toolbar,this.editable])}}class dg extends(Fc(Vc)){static get editorName(){return"DecoupledEditor"}ui;constructor(e,t={}){const{sourceElementOrData:i,editorConfig:o}=function(e,t){return"string"==typeof e||Bc(e)||t&&Object.keys(t).length?{sourceElementOrData:e,editorConfig:t}:{sourceElementOrData:"",editorConfig:e}}(e,t);super(o),Mc(i,this.config);const n=this.config.get("roots").main.element;if(L(n)){if("TEXTAREA"===n.tagName)throw new fe("editor-wrong-element",null);this.sourceElement=n,function(e,t){if(t.ckeditorInstance)throw new fe("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",(()=>{delete t.ckeditorInstance}))}(this,n)}this.model.document.createRoot();const s=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new cg(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:s,label:this.config.get("roots").main.label});this.ui=new lg(this,r)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(e)}))}static create(e,t={}){return new Promise((i=>{const o=new this(e,t);i(o.initPlugins().then((()=>o.ui.init())).then((()=>o.data.init(o.config.get("roots").main.initialData))).then((()=>o.fire("ready"))).then((()=>o)))}))}}class ug{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class hg extends wc{_buffer;constructor(e,t){super(e),this._buffer=new ug(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,o=e.text||"",n=o.length;let s=i.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const r=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(e.createText(o,a),s),r?e.setSelection(r):s.is("documentSelection")||e.setSelection(s),this._buffer.unlock(),this._buffer.input(n)}))}}const mg=["insertText","insertReplacementText"],gg=[...mg,"insertCompositionText"];class pg extends Ln{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(Un);const t=Y.isAndroid?gg:mg,i=e.document;i.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{data:s,targetRanges:r,inputType:a,domEvent:l,isComposing:c}=n;if(!t.includes(a))return;this.focusObserver.flush();const d=new ue(i,"insertText");i.fire(d,new zn(e,l,{text:s,selection:e.createSelection(r),isComposing:c})),d.stop.called&&o.stop()})),Y.isAndroid||i.on("compositionend",((t,{data:o,domEvent:n})=>{this.isEnabled&&o&&i.fire("insertText",new zn(e,n,{text:o,isComposing:!0}))}),{priority:"low"})}observe(){}stopObserving(){}}class fg extends fc{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.editing.mapper,n=t.document.selection;this._typingQueue=new bg(e),i.addObserver(pg);const s=new hg(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",(()=>{this._typingQueue.flush("next beforeinput")}),{priority:"high"}),this.listenTo(i.document,"insertText",((e,r)=>{const{text:a,selection:l}=r;if(i.document.selection.isFake&&l&&i.document.selection.isSimilar(l)&&r.preventDefault(),l&&Array.from(l.getRanges()).some((e=>!e.isCollapsed))&&r.preventDefault(),!s.isEnabled)return void r.preventDefault();let c;l&&(c=Array.from(l.getRanges()).filter((e=>e.root.is("rootElement"))).map((e=>o.toModelRange(e))).map((e=>Ba(e,t.schema)||e))),c&&c.length||(c=Array.from(n.getRanges()));let d=a;if(Y.isAndroid){const e=Array.from(c[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");if(e&&(e.length<=d.length?d.startsWith(e)&&(d=d.substring(e.length),c[0].start=c[0].start.getShiftedBy(e.length)):e.startsWith(d)&&(c[0].start=c[0].start.getShiftedBy(d.length),d="")),0==d.length&&c[0].isCollapsed)return}const u={text:d,selection:t.createSelection(c)};this._typingQueue.push(u,Boolean(r.isComposing)),r.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")})),Y.isAndroid?this.listenTo(i.document,"keydown",((e,o)=>{!n.isCollapsed&&229==o.keyCode&&i.document.isComposing&&wg(t,s)})):this.listenTo(i.document,"compositionstart",(()=>{n.isCollapsed||wg(t,s)}),{priority:"high"}),this.listenTo(i.document,"mutations",((e,{mutations:t})=>{if(this._typingQueue.hasAffectedElements())for(const{node:e}of t){const t=yg(e,o),i=o.toModelElement(t);if(this._typingQueue.isElementAffected(i))return void this._typingQueue.flush("mutations")}})),this.listenTo(i.document,"compositionend",(()=>{this._typingQueue.flush("before composition end")}),{priority:"high"}),this.listenTo(i.document,"compositionend",(()=>{this._typingQueue.flush("after composition end");const e=[];if(this._typingQueue.hasAffectedElements())for(const t of this._typingQueue.flushAffectedElements()){const i=o.toViewElement(t);i&&e.push({type:"children",node:i})}!e.length&&Y.isAndroid||i.document.fire("mutations",{mutations:e})}),{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class bg{editor;flushDebounced=Li((()=>this.flush("timeout")),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){const i={text:e.text};if(e.selection){i.selectionRanges=[];for(const t of e.selection.getRanges())i.selectionRanges.push(Ts.fromRange(t)),this._affectedElements.add(t.start.parent)}this._queue.push(i),this._isComposing||=t,this.flushDebounced()}shift(){const e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map((e=>function(e){const t=e.toRange();if(e.detach(),"$graveyard"==t.root.rootName)return null;return t}(e))).filter((e=>!!e));i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){const t=this.editor,i=t.model,o=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const n=t.commands.get("insertText").buffer;i.enqueueChange(n.batch,(()=>{for(n.lock();this._queue.length;){const e=this.shift();t.execute("insertText",e)}n.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1})),o.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}}function wg(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,(()=>{e.deleteContent(e.document.selection)})),i.unlock()}function yg(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}class _g extends wc{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new ug(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,(o=>{this._buffer.lock();const n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;const s=e.sequence||1,r=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(o);if(this._shouldReplaceFirstBlockWithParagraph(n,s))return void this.editor.execute("paragraph",{selection:n});if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach((e=>{a+=He(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o)))return!1;if(!t.schema.checkChild(o,"paragraph"))return!1;const n=o.getChild(0);return!n||!n.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const o=e.getFirstPosition(),n=i.schema.getLimitElement(o),s=n.getChild(0);return o.parent==s&&(!!e.containsEntireContent(s)&&(!!i.schema.checkChild(n,"paragraph")&&"paragraph"!=s.name))}}const kg="word",vg="selection",Cg="backward",Ag="forward",xg={deleteContent:{unit:vg,direction:Cg},deleteContentBackward:{unit:"codePoint",direction:Cg},deleteWordBackward:{unit:kg,direction:Cg},deleteHardLineBackward:{unit:vg,direction:Cg},deleteSoftLineBackward:{unit:vg,direction:Cg},deleteContentForward:{unit:"character",direction:Ag},deleteWordForward:{unit:kg,direction:Ag},deleteHardLineForward:{unit:vg,direction:Ag},deleteSoftLineForward:{unit:vg,direction:Ag}};class Eg extends Ln{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",(()=>{i++})),t.on("keyup",(()=>{i=0})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:r,inputType:a}=n,l=xg[a];if(!l)return;const c={direction:l.direction,unit:l.unit,sequence:i};c.unit==vg&&(c.selectionToRemove=e.createSelection(s[0])),"deleteContentBackward"===a&&(Y.isAndroid&&(c.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:o}of t){if(e.parent.is("$text")){const t=e.parent.data,o=e.offset;if(ui(t,o)||hi(t,o)||gi(t,o))continue;i++}else(o.is("containerElement")||o.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(s)&&(c.unit=vg,c.selectionToRemove=e.createSelection(s)));const d=new Do(t,"delete",s[0]);t.fire(d,new zn(e,r,c)),d.stop.called&&o.stop()})),Y.isBlink&&function(e){const t=e.view,i=t.document;let o=null,n=!1;function s(e){return e==$t.backspace||e==$t.delete}function r(e){return e==$t.backspace?Cg:Ag}i.on("keydown",((e,{keyCode:t})=>{o=t,n=!1})),i.on("keyup",((a,{keyCode:l,domEvent:c})=>{const d=i.selection,u=e.isEnabled&&l==o&&s(l)&&!d.isCollapsed&&!n;if(o=null,u){const e=d.getFirstRange(),o=new Do(i,"delete",e),n={unit:vg,direction:r(l),selectionToRemove:d};i.fire(o,new zn(t,c,n))}})),i.on("beforeinput",((e,{inputType:t})=>{const i=xg[t];s(o)&&i&&i.direction==r(o)&&(n=!0)}),{priority:"high"}),i.on("beforeinput",((e,{inputType:t,data:i})=>{o==$t.delete&&"insertText"==t&&""==i&&e.stop()}),{priority:"high"})}(this)}observe(){}stopObserving(){}}class Tg extends fc{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(Eg),this._undoOnBackspace=!1;const n=new _g(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new _g(e,"backward")),this.listenTo(i,"delete",((o,n)=>{i.isComposing||n.preventDefault();const{direction:s,sequence:r,selectionToRemove:a,unit:l}=n,c="forward"===s?"deleteForward":"delete",d={sequence:r};if("selection"==l){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t))).map((t=>Ba(t,e.model.schema)||t));d.selection=e.model.createSelection(t)}else d.unit=l;e.execute(c,d),t.scrollToTheSelection()}),{priority:"low"}),this.listenTo(i,"keydown",((n,s)=>{if(i.isComposing||s.keyCode!=$t.backspace||!o.selection.isCollapsed)return;const r=e.model.schema.getLimitElement(o.selection),a=e.model.createPositionAt(r,0);if(a.isTouching(o.selection.getFirstPosition())){s.preventDefault();const o=e.model.schema.getNearestSelectionRange(a,"forward");if(!o)return;const n=t.createSelection(e.editing.mapper.toViewRange(o)),r=n.getFirstRange(),l=new Do(document,"delete",r),c={unit:"selection",direction:"backward",selectionToRemove:n};i.fire(l,new zn(t,s.domEvent,c))}})),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(o,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Pg extends fc{static get requires(){return[fg,Tg]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function Sg(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce(((e,{item:o})=>o.is("$text")||o.is("$textProxy")?e+o.data:(i=t.createPositionAfter(o),"")),""),range:t.createRange(i,e.end)}}class Ig extends(Be()){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:i})=>{i&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:r}=Sg(n,i),a=this.testCallback(s);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:s,range:r});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class Rg extends fc{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",((e,t)=>{if(!n.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==$t.arrowright,s=t.keyCode==$t.arrowleft;if(!i&&!s)return;const r=o.contentLanguageDirection;let a=!1;a="ltr"===r&&i||"rtl"===r&&s?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()}),{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Ng(n.getFirstPosition(),this.attributes)||this._restoreGravity())})),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return!this._isGravityOverridden&&((!n.isAtStart||!Og(o,t))&&(!!Ng(n,t)&&(e&&Fg(e),Og(o,t)&&Ng(n,t,!0)?Dg(i,t):this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(e&&Fg(e),this._restoreGravity(),Ng(n,t,!0)?Dg(i,t):Vg(i,t,n),!0):n.isAtStart?!!Og(o,t)&&(e&&Fg(e),Vg(i,t,n),!0):!Og(o,t)&&Ng(n,t,!0)?(e&&Fg(e),Vg(i,t,n),!0):!!Mg(n,t)&&(n.isAtEnd&&!Og(o,t)&&Ng(n,t)?(e&&Fg(e),Vg(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(ol),e.editing.view.addObserver(nl);let n=!1,s=!1;this.listenTo(o,"touchstart",(()=>{s=!1,n=!0})),this.listenTo(o,"mousedown",(()=>{s=!0})),this.listenTo(o,"selectionChange",(()=>{const e=this.attributes;if(!s&&!n)return;if(s=!1,n=!1,!i.isCollapsed)return;if(!Og(i,e))return;const o=i.getFirstPosition();Ng(o,e)&&(o.isAtStart||Ng(o,e,!0)?Dg(t,e):this._isGravityOverridden||this._overrideGravity())}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",(()=>{const o=t.getFirstPosition();Og(t,i)&&Ng(o,i)&&Dg(e,i)}),{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view;let n=!1,s=!1;this.listenTo(o.document,"delete",((e,t)=>{n="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{if(!n)return;const e=i.getFirstPosition();s=Og(i,this.attributes)&&!Mg(e,this.attributes)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{n&&(n=!1,s||e.model.enqueueChange((()=>{const e=i.getFirstPosition();Og(i,this.attributes)&&Ng(e,this.attributes)&&(e.isAtStart||Ng(e,this.attributes,!0)?Dg(t,this.attributes):this._isGravityOverridden||this._overrideGravity())})))}),{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((e=>e.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}function Og(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function Vg(e,t,i){const o=i.nodeBefore;e.change((i=>{if(o){const t=[],n=e.schema.isObject(o)&&e.schema.isInline(o);for(const[i,s]of o.getAttributes())!e.schema.checkAttribute("$text",i)||n&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,s]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)}))}function Dg(e,t){e.change((e=>{e.removeSelectionAttribute(t)}))}function Fg(e){e.preventDefault()}function Mg(e,t){return Ng(e.getShiftedBy(-1),t)}function Ng(e,t,i=!1){const{nodeBefore:o,nodeAfter:n}=e;for(const e of t){const t=o?o.getAttribute(e):void 0,s=n?n.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==s)&&s!==t)return!0}return!1}Bg('"'),Bg("'"),Bg("'"),Bg('"'),Bg('"'),Bg("'");function Bg(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Lg(e,t,i,o){return o.createRange(zg(e,t,i,!0,o),zg(e,t,i,!1,o))}function zg(e,t,i,o,n){let s=e.textNode||(o?e.nodeBefore:e.nodeAfter),r=null;for(;s&&s.getAttribute(t)==i;)r=s,s=o?s.previousSibling:s.nextSibling;return r?n.createPositionAt(r,o?"before":"after"):e}function jg(e,t,i,o){const n=e.editing.view,s=new Set;n.document.registerPostFixer((n=>{const r=e.model.document.selection;let a=!1;if(r.hasAttribute(t)){const l=Lg(r.getFirstPosition(),t,r.getAttribute(t),e.model),c=e.editing.mapper.toViewRange(l);for(const e of c.getItems())e.is("element",i)&&!e.hasClass(o)&&(n.addClass(o,e),s.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){n.change((e=>{for(const t of s.values())e.removeClass(o,t),s.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}function*$g(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class qg extends wc{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,s=i.getFirstRange(),r=s.start.parent,a=s.end.parent;if(o.isLimit(r)||o.isLimit(a))return n||r!=a||t.deleteContent(i),!1;if(n){const t=$g(e.model.schema,i.getAttributes());return Hg(e,s.start),e.setSelectionAttribute(t),!0}{const o=!(s.start.isAtStart&&s.end.isAtEnd),n=r==a;if(t.deleteContent(i,{leaveUnmerged:o}),o){if(n)return Hg(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function Hg(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const Wg={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ug extends Ln{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",((e,t)=>{i=t.shiftKey})),t.on("beforeinput",((o,n)=>{if(!this.isEnabled)return;let s=n.inputType;Y.isSafari&&i&&"insertParagraph"==s&&(s="insertLineBreak");const r=n.domEvent,a=Wg[s];if(!a)return;const l=new Do(t,"enter",n.targetRanges[0]);t.fire(l,new zn(e,r,{isSoft:a.isSoft})),l.stop.called&&o.stop()}))}observe(){}stopObserving(){}}class Kg extends fc{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(Ug),e.commands.add("enter",new qg(e)),this.listenTo(i,"enter",((o,n)=>{i.isComposing||n.preventDefault(),n.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Gg extends wc{execute(){const e=this.editor.model,t=e.document;e.change((i=>{!function(e,t,i){const o=i.isCollapsed,n=i.getFirstRange(),s=n.start.parent,r=n.end.parent,a=s==r;if(o){const o=$g(e.schema,i.getAttributes());Jg(e,t,n.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(o)}else{const o=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:o}),a?Jg(e,t,i.focus):o&&t.setSelection(r,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const o=t.getFirstRange(),n=o.start.parent,s=o.end.parent;if((Zg(n,e)||Zg(s,e))&&n!==s)return!1;return!0}(e.schema,t.selection)}}function Jg(e,t,i){const o=t.createElement("softBreak");e.insertContent(o,i),t.setSelection(o,"after")}function Zg(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Zg(e.parent,t))}class Qg extends fc{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),o.addObserver(Ug),e.commands.add("shiftEnter",new Gg(e)),this.listenTo(n,"enter",((t,i)=>{n.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Yg extends(xe()){_stack=[];add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const n=i[0];o===n||Xg(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const n=i[0];o===n||Xg(o,n)||this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(Xg(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&ep(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function Xg(e,t){return e&&t&&e.priority==t.priority&&tp(e.classes)==tp(t.classes)}function ep(e,t){return e.priority>t.priority||!(e.prioritytp(t.classes)}function tp(e){return Array.isArray(e)?e.sort().join(","):e}const ip="ck-widget_selected";function op(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function np(e,t,i={}){if(!e.is("containerElement"))throw new fe("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=dp,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){const i=e.getCustomProperty("widgetLabel");i.push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),i=new Nu;return i.set("content",Wc),i.render(),t.appendChild(i.element),t}));t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),ap(e,t),e}function sp(e,t,i){if(t.classes&&i.addClass(Qt(t.classes),e),t.attributes)for(const o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function rp(e,t,i){if(t.classes&&i.removeClass(Qt(t.classes),e),t.attributes)for(const o in t.attributes)i.removeAttribute(o,e)}function ap(e,t,i=sp,o=rp){const n=new Yg;n.on("change:top",((t,n)=>{n.oldDescriptor&&o(e,n.oldDescriptor,n.writer),n.newDescriptor&&i(e,n.newDescriptor,n.writer)}));t.setCustomProperty("addHighlight",((e,t,i)=>n.add(t,i)),e),t.setCustomProperty("removeHighlight",((e,t,i)=>n.remove(t,i)),e)}function lp(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),!1!==i.withAriaRole&&t.setAttribute("role","textbox",e),e.isReadOnly||t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((i,o,n)=>{t.setAttribute("contenteditable",n?"false":"true",e),n?t.removeAttribute("tabindex",e):t.setAttribute("tabindex","-1",e)})),e.on("change:isFocused",((i,o,n)=>{n?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),ap(e,t),e}function cp(e,t){const i=e.getSelectedElement();if(i){const o=gp(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function dp(){return null}function up(e){const t=e=>{const{width:t,paddingLeft:i,paddingRight:o}=e.ownerDocument.defaultView.getComputedStyle(e);return parseFloat(t)-(parseFloat(i)||0)-(parseFloat(o)||0)},i=e.parentElement;if(!i)return 0;let o=t(i);let n=0,s=i;for(;isNaN(o);){if(s=s.parentElement,++n>5)return 0;o=t(s)}return o}const hp="widget-type-around";function mp(e,t,i){return!!e&&op(e)&&!i.isInline(t)}function gp(e){return e.getAttribute(hp)}const pp=["before","after"],fp=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,bp="ck-widget__type-around_disabled";class wp extends fc{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Kg,Tg]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((i,o,n)=>{t.change((e=>{for(const i of t.document.roots)n?e.removeClass(bp,i):e.addClass(bp,i)})),n||e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view,n=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:n}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,((...e)=>{this.isEnabled&&i(...e)}),o)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=gp(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,n,s)=>{const r=s.mapper.toViewElement(n.item);if(r&&mp(r,n.item,t)){!function(e,t,i){const o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);return function(e,t){for(const i of pp){const o=new iu({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(fp,!0)]});e.appendChild(o.render())}}(i,t),function(e){const t=new iu({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i}));e.insert(e.createPositionAt(i,"end"),o)}(s.writer,o,r);r.getCustomProperty("widgetLabel").push((()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;function s(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(n.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[op,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,i)=>{i.directChange&&e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=i.getSelectedElement();if(t){if(mp(e.editing.mapper.toViewElement(t),t,o))return}e.model.change((e=>{e.removeSelectionAttribute(hp)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,i)=>{const n=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(n.removeClass(pp.map(s),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=i.mapper.toViewElement(r);if(!mp(a,r,o))return;const l=gp(t.selection);l&&(n.addClass(s(l),a),this._currentFakeCaretModelElement=r)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,i,o)=>{o||e.model.change((e=>{e.removeSelectionAttribute(hp)}))}))}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,n=o.document.selection,s=o.schema,r=i.editing.view;if(t.shiftKey)return;const a=function(e,t){const i=Kt(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let c;mp(l,i.editing.mapper.toModelElement(l),s)?c=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(c=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=gp(t.document.selection);return t.change((t=>{if(!i)return t.setSelectionAttribute(hp,e?"after":"before"),!0;if(!(i===(e?"after":"before")))return t.removeSelectionAttribute(hp),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),s=n._getObjectElementNextToSelection(e);return!!mp(t.editing.mapper.toViewElement(s),s,o)&&(i.change((t=>{n._setSelectionOverElement(s),t.setSelectionAttribute(hp,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,s=i.document.selection,r=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!mp(n.toViewElement(r),r,o)&&(i.change((t=>{t.setSelection(r,"on"),t.setSelectionAttribute(hp,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((i,o)=>{const n=o.domTarget.closest(".ck-widget__type-around__button");if(!n)return;const s=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(n),r=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(n,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,s),o.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",((i,o)=>{if("atTarget"!=i.eventPhase)return;const n=t.getSelectedElement(),s=e.editing.mapper.toViewElement(n),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:mp(s,n,r)&&(this._insertParagraph(n,o.isSoft?"before":"after"),a=!0),a&&(o.preventDefault(),i.stop())}),{context:op})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)}),{priority:"high"}),Y.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",((t,n)=>{if("atTarget"!=t.eventPhase)return;const s=gp(i.document.selection);if(!s)return;const r=n.direction,a=i.document.selection.getSelectedElement(),l="forward"==r;if("before"===s===l)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=o.getNearestSelectionRange(i.createPositionAt(a,s),r);if(t)if(t.isCollapsed){const n=i.createSelection(t.start);if(i.modifySelection(n,{direction:r}),n.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}(o,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}n.preventDefault(),t.stop()}),{context:op})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[o,n])=>{if(n&&!n.is("documentSelection"))return;const s=gp(i);return s?(e.stop(),t.change((e=>{const n=i.getSelectedElement(),r=t.createPositionAt(n,s),a=e.createSelection(r),l=t.insertContent(o,a);return e.setSelection(a),l}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,i)=>{const[,o,n={}]=i;if(o&&!o.is("documentSelection"))return;const s=gp(t);s&&(n.findOptimalPosition=s,i[3]=n)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[i])=>{if(i&&!i.is("documentSelection"))return;gp(t)&&e.stop()}),{priority:"high"})}}function yp(e){const t=e.model;return(i,o)=>{const n=o.keyCode==$t.arrowup,s=o.keyCode==$t.arrowdown,r=o.shiftKey,a=t.document.selection;if(!n&&!s)return;const l=s,c=function(e,t,i){const o=e.model;if(i){const e=t.focus,i=_p(o,e,"forward");if(!i)return;const n=o.createRange(e,i),s=kp(o.schema,n,"backward");if(s)return o.createRange(e,s)}else{const e=t.focus,i=_p(o,e,"backward");if(!i)return;const n=o.createRange(i,e),s=kp(o.schema,n,"forward");if(s)return o.createRange(s,e)}}(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(r)return}(c.isCollapsed||function(e,t,i){const o=e.model,n=e.view.domConverter;if(i){const e=o.createSelection(t.start);o.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=o.createRange(e.focus,t.end))}const s=e.mapper.toViewRange(t),r=n.viewRangeToDom(s),a=ut.getDomRangeRects(r);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,c,l))&&(t.change((e=>{const i=l?c.end:c.start;if(r){const o=t.createSelection(a.anchor);o.setFocus(i),e.setSelection(o)}else e.setSelection(i)})),i.stop(),o.preventDefault(),o.stopPropagation())}}}function _p(e,t,i){const o=e.schema,n=e.createRangeIn(t.root),s="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(r)&&!o.isInline(r))return e;if(a==s&&o.isBlock(r))return null}return null}function kp(e,t,i){const o="backward"==i?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(const{nextPosition:o}of t.getWalker({direction:i}))if(e.checkChild(o,"$text"))return o}class vp extends fc{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[wp,Tg]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",((t,i,o)=>{const n=o.writer,s=i.selection;if(s.isCollapsed)return;const r=s.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);var l;op(a)&&(o.consumable.consume(s,"selection")&&n.setSelection(n.createRangeOn(a),{fake:!0,label:(l=a,l.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),""))}))})),this.editor.editing.downcastDispatcher.on("selection",((e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const o=i.writer,n=o.document.selection;let s=null;for(const e of n.getRanges())for(const t of e){const e=t.item;op(e)&&!Cp(e,s)&&(o.addClass(ip,e),this._previouslySelected.add(e),s=e)}}),{priority:"low"}),t.addObserver(ol),t.addObserver(sl),this.listenTo(i,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(i,"pointerdown",((...e)=>this._onPointerdown(...e))),this.listenTo(i,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[op,"$text"]}),this.listenTo(i,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(i,"arrowKey",yp(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"}),this.listenTo(i,"tab",((e,i)=>{this._selectNextEditable(i.shiftKey?"backward":"forward")&&(t.scrollToTheSelection(),i.preventDefault(),e.stop())}),{context:e=>op(e)||e.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",((e,t)=>{t.keystroke==$t.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{context:e=>e.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary)return;const i=this.editor,o=i.editing.view,n=o.document;let s=t.target;if(!s)return;if(!op(s)){const e=function(e){let t=e;for(;t;){if(t.is("editableElement")||op(t))return t;t=t.parent}return null}(s);if(!e)return;if(op(e))s=e;else{const e=function(e,t){const i=st(t.domEvent);let o=null;o=i?e.domConverter.domRangeToView(i):e.createRange(e.createPositionAt(t.target,0));if(!o)return null;const n=o.start;if(!n.parent)return null;let s=n.parent;n.parent.is("editableElement")&&(n.isAtEnd&&n.nodeBefore?s=n.nodeBefore:n.isAtStart&&n.nodeAfter&&(s=n.nodeAfter));if(s.is("$text"))return s.parent;return s}(o,t);if(!e||!op(e))return;s=e}}(Y.isAndroid||Y.isiOS)&&t.preventDefault(),n.isFocused||o.focus();const r=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),r=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(o.toModelElement(s),i.schema);return!!r&&(i.change((e=>{const t=n.isLimit(r)?null:function(e,t){const i=new os({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(r),n),i=e.createPositionAt(r,0),o=t?e.createPositionAt(t,0):e.createPositionAt(r,"end");e.setSelection(e.createRange(i,o))})),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,n=o.schema,s=o.document.selection,r=s.getSelectedElement(),a=Kt(i,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,c="up"==a||"down"==a;if(!t.shiftKey&&!s.isCollapsed){if(function(e,t){const i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter,s=o.nodeBefore;return!!n&&t.isObject(n)||!!s&&t.isObject(s)}(s,n)){const i=l?s.getLastPosition():s.getFirstPosition(),r=n.getNearestSelectionRange(i,l?"forward":"backward");r&&(o.change((e=>{e.setSelection(r)})),t.preventDefault(),e.stop())}return}const d=function(e,t){const i=e.document.selection,o=i.getSelectedElement(),n=gp(i);if(o&&"before"==n)return e.createSelection(o,"before");if(o&&"after"==n)return e.createSelection(o,"after");return e.createSelection(i.getRanges(),{backward:o&&e.schema.isObject(o)?!t:i.isBackward})}(o,l),u=o.createSelection(d);if(o.modifySelection(u,{direction:l?"forward":"backward"}),u.isEqual(d))return;u.focus.isTouching(d.focus)&&n.checkChild(u.focus.parent,"$text")&&(l?!u.focus.isAtEnd:!u.focus.isAtStart)&&o.modifySelection(u,{direction:l?"forward":"backward"});const h=l?d.focus.nodeBefore:d.focus.nodeAfter,m=u.focus.nodeBefore,g=u.focus.nodeAfter,p=l?m:g;if(t.shiftKey)(r&&n.isObject(r)||p&&n.isObject(p)||h&&n.isObject(h))&&(o.change((e=>{e.setSelection(u)})),t.preventDefault(),e.stop());else if(p&&n.isObject(p)){if(n.isInline(p)&&c)return;o.change((e=>{e.setSelection(p,"on")})),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change((e=>{let o=t.anchor.parent;for(;o.isEmpty;){const t=o;o=t.parent,e.remove(t)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;const s=e?n.focus.nodeBefore:n.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(ip,t);this._previouslySelected.clear()}_selectNextEditable(e){const t=this.editor.editing,i=t.view,o=this.editor.model,n=i.document.selection,s=o.document.selection;let r;if(s.rangeCount>1){const i=s.isBackward?s.getFirstRange():s.getLastRange();r=t.mapper.toViewPosition("forward"==e?i.end:i.start)}else r="forward"==e?n.getFirstPosition():n.getLastPosition();const a=this._findNextFocusRange(r,e);return!!a&&(o.change((e=>{e.setSelection(a)})),!0)}_findNextFocusRange(e,t){const i=this.editor.editing,o=i.view,n=this.editor.model,s=o.document.selection,r=s.editableElement,a=r.getPath();let l=s.getSelectedElement();l&&!op(l)&&(l=null);const c="forward"==t?o.createRange(e,o.createPositionAt(e.root,"end")):o.createRange(o.createPositionAt(e.root,0),e);for(const{nextPosition:e}of c.getWalker({direction:t})){const o=e.parent;if(op(o)&&o!=l){const e=i.mapper.toModelElement(o);if(!n.schema.isBlock(e))continue;if("extension"!=We(a,o.getPath()))return n.createRangeOn(e)}else if(o.is("editableElement")){if(o==r&&!l)continue;const s=i.mapper.toModelPosition(e),c=n.schema.getNearestSelectionRange(s,t);if(!c)continue;return o==r&&l?c:"extension"!=We(a,o.getPath())?n.createRangeIn(n.schema.getLimitElement(c)):c}}return null}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(op);if(!o)return!1;const n=t.toModelElement(o);return!!n&&(e.model.change((e=>{e.setSelection(n,"on")})),!0)}}function Cp(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class Ap extends fc{_toolbarDefinitions=new Map;_balloon;static get requires(){return[Qm]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",(t=>{(function(e){const t=e.getSelectedElement();return!(!t||!op(t))})(e.editing.view.document.selection)&&t.stop()}),{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container",positions:s}){if(!i.length)return void be("widget-toolbar-no-items",{toolbarId:e});const r=this.editor,a=r.t,l=new Wh(r.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new fe("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:l,getRelatedElement:o,balloonClassName:n,itemsConfig:i,positions:s,initialized:!1};r.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{const e=o(r.editing.view.document.selection);e&&this._showToolbar(c,e)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&n)if(this.editor.ui.focusTracker.isFocused){const s=n.getAncestors().length;s>e&&(e=s,t=n,i=o)}else this._isToolbarVisible(o)&&this._hideToolbar(o);else this._isToolbarInBalloon(o)&&this._hideToolbar(o)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?xp(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Ep(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const i=t.getRelatedElement(this.editor.editing.view.document.selection);xp(this.editor,i,e.positions)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function xp(e,t,i){const o=e.plugins.get("ContextualBalloon"),n=Ep(e,t,i);o.updatePosition(n)}function Ep(e,t,i){const o=e.editing.view,n=dh.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:i||[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class Tp extends(Be()){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const o=new ut(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)if(e.classList.contains(Pp(i)))return i}(e),this._referenceCoordinates=function(e,t){const i=new ut(e),o=t.split("-"),n={x:"right"==o[1]?i.right:i.left,y:"bottom"==o[0]?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}(t,function(e){const t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=function(e,t=new ut(e)){const i=up(e);return i?t.width/i*100:0}(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Pp(e){return`ck-widget__resizer__handle-${e}`}class Sp extends Au{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",(e=>e?`ck-orientation-${e}`:""))],style:{display:e.if("_isVisible","none",(e=>!e))}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",((e,t)=>null!==e&&null!==t)),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",((t,i,o)=>"px"===e.unit?`${t}×${i}`:`${o}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,i)=>t<50||i<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class Ip extends(Be()){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((e,t)=>e&&t)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((e=>{e.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change((i=>{const o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);return e._appendHandles(i),e._appendSizeUI(i),i}));i.insert(i.createPositionAt(t,"end"),o),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new Tp(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change((e=>{const i=this._options.unit||"%",o=("%"===i?t.widthPercents:t.width)+i;e.setStyle("width",o,this._options.viewElement)}));const i=this._getHandleHost(),o=new ut(i),n=Math.round(o.width),s=Math.round(o.height),r=new ut(i);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(o),this.state.update({...t,handleHostWidth:n,handleHostHeight:s})}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change((()=>{this._cleanup(),this._options.onCommit(t)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((i=t)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const o=t.parentElement,n=this._getHandleHost(),s=this._viewResizerWrapper,r=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let a;if(o.isSameNode(n)){const t=e||new ut(n);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[n.offsetWidth+"px",n.offsetHeight+"px",n.offsetLeft+"px",n.offsetTop+"px"];"same"!==We(r,a)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},s)}))}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(e){const t=this.state,i={x:(o=e).pageX,y:o.pageY};var o;const n=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};n&&t.activeHandlePosition.endsWith("-right")&&(s.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),n&&(s.x*=2);let r=Math.abs(t.originalWidth+s.x),a=Math.abs(t.originalHeight+s.y);return"width"==(r/t.aspectRatio>a?"width":"height")?a=r/t.aspectRatio:r=a*t.aspectRatio,{width:Math.round(r),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const o of t)e.appendChild(new iu({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=o,`ck-widget__resizer__handle-${i}`)}}).render());var i}_appendSizeUI(e){this._sizeView=new Sp,this._sizeView.render(),e.appendChild(this._sizeView.element)}}class Rp extends fc{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,t=J.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(ol),this._observer=new(et()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=ic((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())}),{priority:"lowest"}),this._observer.listenTo(J.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",(()=>{const e=i.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new Ip(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const e=i.get("WidgetToolbarRepository");t.on("begin",(()=>{e.forceDisabled("resize")}),{priority:"lowest"}),t.on("cancel",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"}),t.on("commit",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(e.viewElement,t);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;Ip.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}class Op extends fc{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),i.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(e,{writer:t})=>np(this.createTocViewElement(t),t,{label:this.label})}),i.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(e,{writer:t})=>this.createTocDataElement(t)}),e.ui.componentFactory.add(Op.buttonName,(t=>{const i=new Lu(t);return i.set({label:this.label,withText:!0}),i.on("execute",(()=>{e.model.change((t=>{const i=t.createElement("op-macro-toc",{});e.model.insertContent(i,e.model.document.selection)}))})),i}))}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(e){const t=e.createText(this.label),i=e.createContainerElement("div");return e.insert(e.createPositionAt(i,0),t),i}createTocDataElement(e){return e.createContainerElement("macro",{class:"toc"})}}const Vp=Symbol("isOPEmbeddedTable");function Dp(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(Vp)&&op(e)}(t))}function Fp(e){return _.get(e.config,"_config.openProject.context.resource")}function Mp(e){return _.get(e.config,"_config.openProject.pluginContext")}function Np(e,t){return Mp(e).services[t]}function Bp(e){return Np(e,"pathHelperService")}function Lp(e){return Np(e,"i18n")}class zp extends fc{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){const e=this.editor,t=e.model,i=e.conversion,o=Mp(e);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},t.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(e,{writer:t})=>{const i=e.getAttribute("data-query-props");return t.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:i?JSON.parse(i):{}})}}),i.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,{writer:t})=>{return i=this.createEmbeddedTableView(t),o=t,this.label,o.setCustomProperty(Vp,!0,i),np(i,o,{label:"your label here"});var i,o}}),i.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(e,{writer:t})=>this.createEmbeddedTableDataElement(e,t)}),e.ui.componentFactory.add(zp.buttonName,(t=>{const i=new Lu(t);return i.set({label:this.text.button,withText:!0}),i.on("execute",(()=>o.runInZone((()=>{o.services.externalQueryConfiguration.show({currentQuery:{},callback:t=>e.model.change((i=>{const o=i.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:t});e.model.insertContent(o,e.model.document.selection)}))})})))),i}))}createEmbeddedTableView(e){const t=e.createText(this.text.macro_text),i=e.createContainerElement("div");return e.insert(e.createPositionAt(i,0),t),i}createEmbeddedTableDataElement(e,t){const i=e.getAttribute("opEmbeddedTableQuery")||{};return t.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(i)})}}function jp(e,t,i){e.ui.componentFactory.add(t,(t=>{const o=new Lu(t);return o.set({label:I18n.t("js.button_edit"),icon:'\n',tooltip:!0}),o.on("execute",(()=>{const t=e.model.document.selection.getSelectedElement();t&&i(t)})),o}))}const $p="ck-toolbar-container";function qp(e,t,i,o){const n=t.config.get(i+".toolbar");if(!n||!n.length)return;const s=t.plugins.get("ContextualBalloon"),r=new Wh(t.locale);function a(){t.ui.focusTracker.isFocused&&o(t.editing.view.document.selection)?c()?function(e,t){const i=e.plugins.get("ContextualBalloon");if(t(e.editing.view.document.selection)){const t=Hp(e);i.updatePosition(t)}}(t,o):s.hasView(r)||s.add({view:r,position:Hp(t),balloonClassName:$p}):l()}function l(){c()&&s.remove(r)}function c(){return s.visibleView==r}r.fillFromConfig(n,t.ui.componentFactory),e.listenTo(t.editing.view,"render",a),e.listenTo(t.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function Hp(e){const t=e.editing.view,i=dh.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class Wp extends fc{static get requires(){return[Qm]}static get pluginName(){return"EmbeddedTableToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditEmbeddedTableQuery",(e=>{const o=i.services.externalQueryConfiguration,n=e.getAttribute("opEmbeddedTableQuery")||{};i.runInZone((()=>{o.show({currentQuery:n,callback:i=>t.change((t=>{t.setAttribute("opEmbeddedTableQuery",i,e)}))})}))}))}afterInit(){qp(this,this.editor,"OPMacroEmbeddedTable",Dp)}}const Up=Symbol("isWpButtonMacroSymbol");function Kp(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(Up)&&op(e)}(t))}class Gp extends fc{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){const e=this.editor,t=e.model,i=e.conversion,o=Mp(e);t.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(e,{writer:t})=>{const i=e.getAttribute("data-type")||"",o=e.getAttribute("data-classes")||"";return t.createElement("op-macro-wp-button",{type:i,classes:o})}}),i.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(e,{writer:t})=>this.createMacroViewElement(e,t)}),i.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(e,{writer:t})=>t.createContainerElement("macro",{class:"create_work_package_link","data-type":e.getAttribute("type")||"","data-classes":e.getAttribute("classes")||""})}),e.ui.componentFactory.add(Gp.buttonName,(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),i.on("execute",(()=>{o.services.macros.configureWorkPackageButton().then((t=>e.model.change((i=>{const o=i.createElement("op-macro-wp-button",{});i.setAttribute("type",t.type,o),i.setAttribute("classes",t.classes,o),e.model.insertContent(o,e.model.document.selection)}))))})),i}))}macroLabel(e){return e?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:e}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(e,t){const i=e.getAttribute("classes")||"",o=this.macroLabel(),n=t.createText(o),s=t.createContainerElement("span",{class:i});return t.insert(t.createPositionAt(s,0),n),function(e,t,i){return t.setCustomProperty(Up,!0,e),np(e,t,{label:i})}(s,t,{label:o})}}class Jp extends fc{static get requires(){return[Qm]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){const e=this.editor,t=Mp(e);jp(e,"opEditWpMacroButton",(i=>{const o=t.services.macros,n=i.getAttribute("type"),s=i.getAttribute("classes");o.configureWorkPackageButton(n,s).then((t=>e.model.change((e=>{e.setAttribute("classes",t.classes,i),e.setAttribute("type",t.type,i)}))))}))}afterInit(){qp(this,this.editor,"OPMacroWpButton",Kp)}}class Zp extends(Be()){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise(((i,o)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class Qp extends fc{loaders=new ei;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Lc]}init(){this.loaders.on("change",(()=>this._updatePendingAction())),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0))}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return be("filerepository-no-upload-adapter"),null;const t=new Yp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then((e=>{this._loadersMap.set(e,t)})).catch((()=>{})),t.on("change:uploaded",(()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e})),t.on("change:uploadTotal",(()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof Yp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,i)=>{e===t&&this._loadersMap.delete(i)}))}_updatePendingAction(){const e=this.editor.plugins.get(Lc);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class Yp extends(Be()){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=me(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Zp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0)),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new fe("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new fe("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,i(e)})).catch((e=>{t.isFulfilled=!0,o(e)}))})),t}}class Xp{constructor(e,t,i){this.loader=e,this.resource=t,this.editor=i}upload(){const e=this.resource,t=Np(this.editor,"attachmentsResourceService");return e?this.loader.file.then((i=>t.attachFiles(e,[i]).toPromise().then((e=>(this.editor.model.fire("op:attachment-added",e),this.buildResponse(e[0])))).catch((e=>{console.error("Failed upload %O",e)})))):(console.warn("resource not available in this CKEditor instance"),Promise.reject("Not possible to upload attachments without resource"))}buildResponse(e){return{default:e._links.staticDownloadLocation.href}}abort(){return!1}}function ef(e){return e}function tf(e,t,i){return"function"!=typeof i?tf(e,t,(()=>{})):of(e,t,(function e(t,o,n,s,r,a){const l=i(t,o,n,s,r,a);return void 0!==l?Boolean(l):of(t,o,e,a)}),new Map)}function of(e,t,i,o){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,i,o){if(null==t)return!0;if(Array.isArray(t))return nf(e,t,i,o);if(t instanceof Map)return function(e,t,i,o){if(0===t.size)return!0;if(!(e instanceof Map))return!1;for(const[n,s]of t.entries()){if(!1===i(e.get(n),s,n,e,t,o))return!1}return!0}(e,t,i,o);if(t instanceof Set)return function(e,t,i,o){if(0===t.size)return!0;if(!(e instanceof Set))return!1;return nf([...e],[...t],i,o)}(e,t,i,o);const n=Object.keys(t);if(null==e||V(e))return 0===n.length;if(0===n.length)return!0;if(o?.has(t))return o.get(t)===e;o?.set(t,e);try{for(let s=0;s0?of(e,{...t},i,o):vi(e,t);default:return s(e)?"string"!=typeof t||""===t:vi(e,t)}}function nf(e,t,i,o){if(0===t.length)return!0;if(!Array.isArray(e))return!1;const n=new Set;for(let s=0;s{}))}function rf(e){var t;return e=F(t=e,void 0,t,new Map,void 0),t=>sf(t,e)}function af(e,t){let i;if(i=Array.isArray(t)?t:"string"==typeof t&&bi(t)&&null==e?.[t]?_i(t):[t],0===i.length)return!1;let o=e;for(let e=0;e{o.preventDefault();const n=o.dropRange?[o.dropRange]:null,s=new ue(t,e);t.fire(s,{dataTransfer:o.dataTransfer,method:i.name,targetRanges:n,target:o.target,domEvent:o.domEvent}),s.stop.called&&o.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,o={dataTransfer:new Jn(t,{cacheFiles:i})};if("drop"==e.type||"dragover"==e.type){const t=st(e);o.dropRange=t&&this.view.domConverter.domRangeToView(t)}this.fire(e.type,e,o)}}const uf=["figcaption","li"],hf=["ol","ul"];function mf(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return"\n";let i="",o=null;for(const n of t.getChildren())i+=pf(n,o)+mf(e,n),o=n;if(t.is("rawElement")){const o=document.implementation.createHTMLDocument("").createElement("div");t.render(o,e),i+=gf(o)}return i}function gf(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if("BR"===e.tagName)return"\n";for(const i of e.childNodes)t+=gf(i);return t}function pf(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||hf.includes(e.name)&&hf.includes(t.name)?"\n\n":e.is("containerElement")||t.is("containerElement")?uf.includes(e.name)||uf.includes(t.name)?"\n":e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":"\n\n":"":""}class ff extends fc{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=e=>e.model.getSelectedContent(e.model.document.selection)){return this.editor.model.change((o=>{const n=o.model.document.selection;o.setSelection(t);const s=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),r=i(o),a=this._removeFakeMarkersInsideElement(o,r);for(const[e,t]of Object.entries(s)){a[e]||=o.createRangeIn(r);for(const e of t)o.remove(e)}r.markers.clear();for(const[e,t]of Object.entries(a))r.markers.set(e,t);return o.setSelection(n),r}))}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change((e=>{const o=this._insertFakeMarkersElements(e,i),n=t(e),s=this._removeFakeMarkersInsideElement(e,n);for(const t of Object.values(o).flat())e.remove(t);for(const[t,i]of Object.entries(s))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return n}))}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:o}=i;return"all"===o||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){const o=Array.from(t.getRanges()),n=new Set(o.flatMap((t=>Array.from(e.model.markers.getMarkersIntersectingRange(t)))));return Array.from(n).filter((e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return o.some((e=>e.containsRange(t,!0)))}return!0})).map((e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()})))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap((([e,o])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:o}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),n=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||n)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:o}]}return[]}))}_insertFakeMarkersElements(e,t){const i={},o=t.flatMap((e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]})).sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:t,marker:n,type:s}of o){const o=e.createElement("$marker",{"data-name":n.name,"data-type":s});i[n.name]||(i[n.name]=[]),i[n.name].push(o),e.insert(o,t)}return i}_removeFakeMarkersInsideElement(e,t){return cf(this._getAllFakeMarkersFromElement(e,t).reduce(((t,i)=>{const o=i.markerElement&&e.createPositionBefore(i.markerElement);let n=t[i.name],s=!1;if(n?.start&&n?.end){this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:s=!0,n=null}return s||(t[i.name]={...n,[i.type]:o}),i.markerElement&&e.remove(i.markerElement),t}),{}),(i=>new us(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end"))))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap((({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]})),o=[],n=[];for(const e of i){if("end"===e.type){i.some((t=>t.name===e.name&&"start"===t.type))||o.push({markerElement:null,name:e.name,type:"start"})}if("start"===e.type){i.some((t=>t.name===e.name&&"end"===t.type))||n.unshift({markerElement:null,name:e.name,type:"end"})}}return[...o,...i,...n]}_getUniqueMarkerName(e){const t=e.split(":"),i=me().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class bf extends fc{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[ff]}init(){this.editor.editing.view.addObserver(df),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},(()=>{const n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})}))}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",((t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()}),{priority:"highest"}),this.listenTo(o,"clipboardInput",((e,t)=>{const o=t.dataTransfer;let n;if(t.content)n=t.content;else{let e="";o.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(o.getData("text/html")):o.getData("text/plain")&&(((s=(s=o.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

    ").replace(/\r?\n/g,"
    ").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

    ")||s.includes("
    "))&&(s=`

    ${s}

    `),e=s),n=this.editor.data.htmlProcessor.toView(e)}var s;const r=new ue(this,"inputTransformation"),a=o.getData("application/ckeditor5-editor-id")||null;this.fire(r,{content:n,dataTransfer:o,sourceEditorId:a,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const o=this.editor.data.toModel(i.content,"$clipboardHolder");0!=o.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:o,method:i.method,sourceEditorId:i.sourceEditorId,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=n._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,o=(e,i)=>{const o=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(o,t.selection,e.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?o(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,o)=>{const n=e.data.toView(o.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:n,method:o.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,o)=>{o.content.isEmpty||(o.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(o.content)),o.dataTransfer.setData("text/plain",mf(e.data.htmlProcessor.domConverter,o.content)),o.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),"cut"==o.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}const wf=yt("px");class yf extends Au{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>wf(e))),top:e.to("top",(e=>wf(e))),width:e.to("width",(e=>wf(e)))}}})}}class _f extends fc{removeDropMarkerDelayed=ci((()=>this.removeDropMarker()),40);_updateDropMarkerThrottled=ic((e=>this._updateDropMarker(e)),40);_reconvertMarkerThrottled=ic((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0);_dropTargetLineView=new yf;_domEmitter=new(et());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,s){this.removeDropMarkerDelayed.cancel();const r=kf(this.editor,e,t,i,o,n,s);return r?s&&s.containsRange(r)||r&&!this.editor.model.canEditAt(r)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(r),r):null}getFinalDropRange(e,t,i,o,n,s){const r=kf(this.editor,e,t,i,o,n,s);return this.removeDropMarker(),r}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const t=this.editor.editing,i=e.start.nodeBefore,o=e.start.nodeAfter,n=e.start.parent,s=i?t.mapper.toViewElement(i):null,r=s?t.view.domConverter.mapViewToDom(s):null,a=o?t.mapper.toViewElement(o):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(n);if(!c)return;const d=t.view.domConverter.mapViewToDom(c),u=this._getScrollableRect(c),{scrollX:h,scrollY:m}=J.window,g=r?new ut(r):null,p=l?new ut(l):null,f=new ut(d).excludeScrollbarsAndBorders(),b=g?g.bottom:f.top,w=p?p.top:f.bottom,y=J.window.getComputedStyle(d),_=b<=w?(b+w)/2:w;if(u.top<_&&_a.schema.checkChild(s,e)))){if(a.schema.checkChild(s,"$text"))return a.createRange(s);if(t)return Cf(e,xf(e,t.parent),o,n)}}}else if(a.schema.isInline(c))return Cf(e,c,o,n);if(a.schema.isBlock(c))return Cf(e,c,o,n);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter((t=>t.is("element")&&!vf(e,t)));let i=0,s=t.length;if(0==s)return a.createRange(a.createPositionAt(c,"end"));for(;i{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),Y.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(J.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(J.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(J.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",((e,i,o)=>{t.setAttribute("draggable",o?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change((e=>e.setSelection(s))),this._isBlockDragging=!0,o.focus(),o.getObserver(df).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,o=document.elementFromPoint(t,i),n=this.editor.editing.view;o&&o.closest(".ck-editor__editable")&&n.getObserver(df).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:o,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class Tf extends fc{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=ci((()=>this._clearDraggableAttributes()),40);_blockMode=!1;_domEmitter=new(et());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[bf,vp,_f,Ef]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(df),t.addObserver(sl),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),Y.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=e.plugins.get(_f);this.listenTo(o,"dragstart",((i,o)=>{if(o.target?.is("editableElement"))return void o.preventDefault();if(this._prepareDraggedRange(o.target),!this._draggedRange)return void o.preventDefault();this._draggingUid=me();const n=this.isEnabled&&e.model.canEditAt(this._draggedRange);o.dataTransfer.effectAllowed=n?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const s=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(o.dataTransfer,s,"dragstart");const{dataTransfer:r,domTarget:a,domEvent:l}=o,{clientX:c}=l;this._updatePreview({dataTransfer:r,domTarget:a,clientX:c}),o.stopPropagation(),n||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(o,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(J.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(o,"dragenter",(()=>{this.isEnabled&&i.focus()})),this.listenTo(o,"dragleave",(()=>{n.removeDropMarkerDelayed()})),this.listenTo(o,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:o}=t.domEvent;n.updateDropMarker(t.target,t.targetRanges,i,o,this._blockMode,this._draggedRange)?(this._draggedRange||(t.dataTransfer.dropEffect="copy"),Y.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()):t.dataTransfer.dropEffect="none"}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(_f);this.listenTo(t,"clipboardInput",((t,o)=>{if("drop"!=o.method)return;const{clientX:n,clientY:s}=o.domEvent,r=i.getFinalDropRange(o.target,o.targetRanges,n,s,this._blockMode,this._draggedRange);if(!r)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=o.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==Pf(o.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void t.stop();o.targetRanges=[e.editing.mapper.toViewRange(r)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bf);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==Pf(t.dataTransfer),o=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(o&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"pointerdown",((o,n)=>{if(Y.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let s=Sf(n.target);if(Y.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&op(e)||(s=i.selection.editableElement)}s&&(t.change((e=>{e.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"pointerup",(()=>{Y.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_finalizeDragging(e){const t=this.editor,i=t.model;if(t.plugins.get(_f).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const o=t.getFirstPosition().parent;o.isEmpty&&!i.schema.checkChild(o,"$text")&&i.schema.checkChild(o,"paragraph")&&e.insertElement("paragraph",o,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,o=i.document.selection,n=e?Sf(e):null;if(n){const e=t.editing.mapper.toModelElement(n);if(this._draggedRange=Ts.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;const s=Array.from(o.getSelectedBlocks()),r=o.getFirstRange();if(0==s.length)return void(this._draggedRange=Ts.fromRange(r));const a=If(i,s);if(s.length>1)this._draggedRange=Ts.fromRange(a),this._blockMode=!0;else if(1==s.length){const e=r.start.isTouching(a.start)&&r.end.isTouching(a.end);this._draggedRange=Ts.fromRange(e?a:r),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){const o=this.editor.editing.view,n=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(n),r=J.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Ke(J.document,"div",{style:"position: fixed; left: -999999px;"}),J.document.body.appendChild(this._previewContainer));const a=Ke(J.document,"div");a.className="ck ck-content ck-clipboard-preview";const l=new ut(s),c=parseFloat(r.paddingLeft),d=parseFloat(r.paddingRight),u=parseFloat(r.width)-c-d;if(s.contains(t)){if(!Y.isiOS)return;a.style.maxWidth=`${u}px`,a.style.padding="10px",a.style.minWidth="200px",a.style.minHeight="20px",a.style.boxSizing="border-box",a.style.backgroundColor="var(--ck-color-base-background)"}else if(Y.isiOS)a.style.width=`${u}px`,a.style.backgroundColor="var(--ck-color-base-background)";else{const e=l.left-i+c;a.style.width=`${u+e}px`,a.style.paddingLeft=`${e}px`}o.domConverter.setContentOf(a,e.getData("text/html")),e.setDragImage(a,0,0),this._previewContainer.appendChild(a)}}function Pf(e){return Y.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Sf(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(op);if(op(e))return e;const t=e.findAncestor((e=>op(e)||e.is("editableElement")));return op(t)?t:null}function If(e,t){const i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),s=e.createPositionBefore(i),r=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){const t=e.createRangeOn(n),i=s.isTouching(t.start),o=r.isTouching(t.end);if(i&&o)return If(e,[n])}return e.createRange(s,r)}class Rf extends fc{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[bf]}init(){const e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(df),e.plugins.get(bf).on("contentInsertion",((e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const o=e.getChild(0);o.is("element")&&t.schema.isBlock(o)&&!t.schema.isObject(o)&&!t.schema.isLimit(o)&&(i=t.createRangeIn(o))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find((e=>t.schema.getAttributeProperties(e).isFormatting)))return!1}return!0})(i.content,t)&&t.change((e=>{const n=Array.from(o.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),n.push(...o.getAttributes());const s=e.createRangeIn(i.content);for(const i of s.getItems())for(const o of n)t.schema.checkAttribute(i,o[0])&&e.setAttribute(o[0],o[1],i)}))}))}}class Of extends fc{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ff,bf,Tf,Rf]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class Vf extends wc{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const o=this.editor.model,n=o.document,s=[],r=e.map((e=>e.getTransformedByOperations(i))),a=r.flat();for(const e of r){const t=e.filter((e=>e.root!=n.graveyard)).filter((e=>!Ff(e,a)));t.length&&(Df(t),s.push(t[0]))}s.length&&o.change((e=>{e.setSelection(s,{backward:t})}))}_undo(e,t){const i=this.editor.model,o=i.document;this._createdBatches.add(t);const n=e.operations.slice().filter((e=>e.isDocumentOperation));n.reverse();for(const e of n){const n=e.baseVersion+1,s=Array.from(o.history.getOperations(n)),r=sa([e.getReversed()],s,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let n of r){const s=n.affectedSelectable;s&&!i.canEditAt(s)&&(n=new Jr(n.baseVersion)),t.addOperation(n),i.applyOperation(n),o.history.setOperationAsUndone(e,n)}}}}function Df(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class Mf extends Vf{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,(()=>{this._undo(i.batch,o);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,o),this.refresh()}}class Nf extends Vf{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)})),this.fire("revert",e.batch,t),this.refresh()}}class Bf extends fc{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new Mf(e),this._redoCommand=new Nf(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const o=i.batch,n=this._redoCommand.createdBatches.has(o),s=this._undoCommand.createdBatches.has(o);this._batchRegistry.has(o)||(this._batchRegistry.add(o),o.isUndoable&&(n?this._undoCommand.addBatch(o):s||(this._undoCommand.addBatch(o),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Lf extends fc{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,o="ltr"==t.uiLanguageDirection?nd:td,n="ltr"==t.uiLanguageDirection?td:nd;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(Lu,e,t,i,o);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(sh,e,t,i,o)))}_createButton(e,t,i,o,n){const s=this.editor,r=s.locale,a=s.commands.get(t),l=new e(r);return l.set({label:i,icon:n,keystroke:o}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",(()=>{s.execute(t),s.editing.view.focus()})),l}}class zf extends fc{static get requires(){return[Bf,Lf]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}function jf(e){return e}function $f(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function qf(e,t){const i=e.plugins.get("ImageUtils"),o=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>{if(!i.isInlineImageView(e))return null;if(!o)return n(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:n(e)};function n(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function Hf(e,t){const i=ti(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function Wf(e){return e&&e.endsWith("px")?parseInt(e):null}function Uf(e){const t=Wf(e.getStyle("width")),i=Wf(e.getStyle("height"));return!(!t||!i)}const Kf=/^(image|image-inline)$/;class Gf extends fc{_domEmitter=new(et());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,o={}){const n=this.editor,s=n.model,r=s.document.selection,a=Jf(n,t||r,i);e={...Object.fromEntries(r.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(a,t)||delete e[t];return s.change((i=>{const{setImageSizes:n=!0}=o,r=i.createElement(a,e);return s.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),r.parent?(n&&this.setImageNaturalSizeAttributes(r),r):null}))}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((i=>{const o=new J.window.Image;this._domEmitter.listenTo(o,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(i.batch,(t=>{t.setAttribute("width",o.naturalWidth,e),t.setAttribute("height",o.naturalHeight,e)})),this._domEmitter.stopListening(o,"load")})),o.src=t})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:Kf})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=Jf(e,t,null);if("imageBlock"==i){const i=function(e,t){const i=cp(e,t),o=i.start.parent;if(o.isEmpty&&!o.is("element","$root"))return o.parent;return o}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return np(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&op(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Jf(e,t,i){const o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===n?"imageInline":"auto"!==n?"imageBlock":t.is("selection")?Hf(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class Zf extends wc{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change((t=>{t.setAttribute("alt",e.newValue,n)}))}}class Qf extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new Zf(this.editor))}}class Yf extends Au{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Km(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new tu,this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}}function Xf(e){const t=e.editing.view,i=dh.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class eb extends fc{_balloon;_form;static get requires(){return[Qm]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const o=e.commands.get("imageTextAlternative"),n=new Lu(i);return n.set({label:t("Change image text alternative"),icon:'',tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{this._showForm()})),n}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Iu(Yf))(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=Xf(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),Su({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Xf(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class tb extends fc{static get requires(){return[Qf,eb]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function ib(e,t){const i=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,s=o.mapper.toViewElement(i.item),r=e.findViewImgElement(s);null===i.attributeNewValue?(n.removeAttribute("srcset",r),n.removeAttribute("sizes",r)):i.attributeNewValue&&(n.setAttribute("srcset",i.attributeNewValue,r),n.setAttribute("sizes","100vw",r))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function ob(e,t,i){const o=(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;const n=o.writer,s=o.mapper.toViewElement(i.item),r=e.findViewImgElement(s);n.setAttribute(i.attributeKey,i.attributeNewValue||"",r)};return e=>{e.on(`attribute:${i}:${t}`,o)}}class nb extends Ln{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class sb extends wc{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&be("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&be("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Qt(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((t,s)=>{const r=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),s&&r&&o.isImage(r)){const i=this.editor.model.createPositionAfter(r);o.insertImage({...t,...n},i,e.imageType)}else e.breakBlock?o.insertImage({...t,...n},i.getFirstPosition(),e.imageType):o.insertImage({...t,...n},null,e.imageType)}))}}class rb extends wc{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class ab extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(nb),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new sb(e),o=new rb(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}}class lb extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),o="imageBlock"===e?"figure":"img";function n(t,o,n,s,r=!1){t.on(`attribute:${o}:${e}`,((t,o,a)=>{if(!a.consumable.consume(o.item,t.name))return;const l=a.writer,c=a.mapper.toViewElement(o.item),d=i.findViewImgElement(c);null!==o.attributeNewValue?l.setAttribute(n,o.attributeNewValue,d):l.removeAttribute(n,d);const u=o.item.getAttribute("width"),h=o.item.getAttribute("height"),m=u&&h;if(m&&r&&l.setAttribute("loading","lazy",d),o.item.hasAttribute("sources"))return;const g=o.item.hasAttribute("resizedWidth");("imageInline"!==e||g||s)&&m&&l.setStyle("aspect-ratio",`${u}/${h}`,d)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:e=>Uf(e)?Wf(e.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:e=>Uf(e)?Wf(e.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{n(e,"width","width",!0,!0),n(e,"height","height",!0,!0)})),t.conversion.for("dataDowncast").add((e=>{n(e,"width","width",!1),n(e,"height","height",!1)})),t.conversion.for("upcast").add((e=>{e.on("element:img",((e,t,i)=>{const o=t.viewItem.getAttribute("width"),n=t.viewItem.getAttribute("height");o&&n&&i.consumable.consume(t.viewItem,{styles:["aspect-ratio"]})}))}))}}class cb extends wc{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(n.getAttributes());return s.src||s.uploadId?i.change((t=>{const{setImageSizes:r=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(n))),l=o.insertImage(s,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:r});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),o="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:o})}return{oldElement:n,newElement:l}})):null}}class db extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,o)=>{if(!o.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;o.consumable.consume(t.item,e.name);const n=o.writer,s=o.mapper.toViewElement(t.item),r=i.findViewImgElement(s);t.attributeNewValue?(n.addClass("image_placeholder",r),n.setStyle("background-image",`url(${t.attributeNewValue})`,r),n.setCustomProperty("editingPipeline:doNotReuseOnce",!0,r)):(n.removeClass("image_placeholder",r),n.removeStyle("background-image",r))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(nb),this.listenTo(o.document,"imageLoaded",((e,s)=>{const r=o.domConverter.mapDomToView(s.target);if(!r)return;const a=n.getImageWidgetFromImageView(r);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",l)}))}))}}class ub extends fc{static get requires(){return[ab,lb,Gf,db,bf]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new cb(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>$f(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>o.toImageWidget($f(i),i,t("image widget"))}),i.for("downcast").add(ob(o,"imageBlock","src")).add(ob(o,"imageBlock","alt")).add(ib(o,"imageBlock")),i.for("upcast").elementToElement({view:qf(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const n=e.findViewImgElement(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=ti(o.convertItem(n,i.modelCursor).modelRange.getItems());s?(o.convertChildren(i.viewItem,s),o.updateConversionResult(s,i)):o.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(o))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(o.isInlineImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Hf(t.schema,l)){const e=new rl(i.document),t=r.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(e)}))}))}}class hb extends Au{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this._focusables=new tu,this.children=this.createCollection(),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof kh&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),Ou({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class mb extends fc{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const o=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o),e.ui.componentFactory.add("menuBar:insertImage",(e=>this._createMenuBarComponent(e)))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,menuBarButtonViewCreator:n,requiresForm:s=!1,override:r=!1}){this._integrations.has(e)&&!r&&be("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:n,formViewCreator:o,requiresForm:s})}_createToolbarComponent(e){const t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n;const s=o[0];if(1==o.length){if(!s.requiresForm)return s.buttonViewCreator(!0);n=s.buttonViewCreator(!0)}else{const t=s.buttonViewCreator(!1);n=new Jh(e,t),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const r=this.dropdownView=Zh(e,n),a=o.map((({observable:e})=>"function"==typeof e?e():e));return r.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),r.once("change:isOpen",(()=>{const e=o.flatMap((({formViewCreator:e})=>e(1==o.length))),i=new hb(t.locale,e);r.panelView.children.add(i)})),r}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;const o=i.flatMap((({menuBarButtonViewCreator:e})=>e(1==i.length))),n=new ig(e),s=new og(e);n.panelView.children.add(s),n.buttonView.set({icon:'',label:t("Image")});for(const t of o){const i=new Em(e,n);i.children.add(t),s.items.add(i),t.delegate("execute").to(n)}return n}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return be("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||be("image-insert-unknown-integration",{item:i});return t.length||be("image-insert-integrations-not-registered"),t}}class gb extends fc{static get requires(){return[ub,vp,tb,mb]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class pb extends fc{static get requires(){return[ab,lb,Gf,db,bf]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new cb(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>o.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(ob(o,"imageInline","src")).add(ob(o,"imageInline","alt")).add(ib(o,"imageInline")),i.for("upcast").elementToElement({view:qf(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",((n,s)=>{const r=Array.from(s.content.getChildren());let a;if(!r.every(o.isBlockImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Hf(t.schema,l)){const e=new rl(i.document),t=r.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,o.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}})),this.listenTo(n,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&o.setImageNaturalSizeAttributes(e)}))}))}}class fb extends fc{static get requires(){return[pb,vp,tb,mb]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class bb extends fc{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class wb extends wc{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(ub))return this.isEnabled=!1,void(this.value=!1);const o=e.model.document.selection,n=o.getSelectedElement();if(!n){const e=t.getCaptionFromModelSelection(o);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(n),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils");let s=i.getSelectedElement();const r=o._getSavedCaption(s);n.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());const a=r||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils");let s,r=i.getSelectedElement();r?s=n.getCaptionFromImageModelElement(r):(s=n.getCaptionFromModelSelection(i),r=s.parent),o._saveCaption(r,s),e.setSelection(r,"on"),e.remove(s)}}class yb extends fc{static get requires(){return[Gf,bb]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new wb(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:e=>o.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:o})=>{if(!i.isBlockImage(e.parent))return null;const s=o.createEditableElement("figcaption");o.setCustomProperty("imageCaption",!0,s),s.placeholder=n("Enter image caption"),Qi({view:t,element:s,keepOnFocus:!0});const r=e.parent.getAttribute("alt");return lp(s,o,{label:r?n("Caption for image: %0",[r]):n("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),s=e=>{if(!e.return)return;const{oldElement:o,newElement:n}=e.return;if(!o)return;if(t.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(e)return void this._saveCaption(n,e)}const s=this._getSavedCaption(o);s&&this._saveCaption(n,s)};o&&this.listenTo(o,"execute",s,{priority:"low"}),n&&this.listenTo(n,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Ms.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const n=t.document.differ.getChanges();for(const t of n){if("alt"!==t.attributeKey)continue;const n=t.range.start.nodeAfter;if(i.isBlockImage(n)){const t=o.getCaptionFromImageModelElement(n);if(!t)return;e.editing.reconvertItem(t)}}}))}}class _b extends fc{static get requires(){return[bb]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",(n=>{const s=e.commands.get("toggleImageCaption"),r=new Lu(n);return r.set({icon:'',tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const o=i.getCaptionFromModelSelection(e.model.document.selection);if(o){const i=e.editing.mapper.toViewElement(o);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),r}))}}function kb(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function vb(e){return new Promise(((t,i)=>{const o=e.getAttribute("src");fetch(o).then((e=>e.blob())).then((e=>{const i=Cb(e,o),n=i.replace("image/",""),s=new File([e],`image.${n}`,{type:i});t(s)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const o=J.document.createElement("img");o.addEventListener("load",(()=>{const e=J.document.createElement("canvas");e.width=o.width,e.height=o.height;e.getContext("2d").drawImage(o,0,0),e.toBlob((e=>e?t(e):i()))})),o.addEventListener("error",(()=>i())),o.src=e}))}(e).then((t=>{const i=Cb(t,e),o=i.replace("image/","");return new File([t],`image.${o}`,{type:i})}))}(o).then(t).catch(i):i(e)))}))}function Cb(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Ab extends fc{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",(()=>this._createToolbarButton())),e.ui.componentFactory.add("imageUpload",(()=>this._createToolbarButton())),e.ui.componentFactory.add("menuBar:uploadImage",(()=>this._createMenuBarButton("standalone"))),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),s=kb(n),r=new e(t.locale),a=i.t;return r.set({acceptedType:n.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:''}),r.bind("isEnabled").to(o),r.on("done",((e,i)=>{const o=Array.from(i).filter((e=>s.test(e.type)));o.length&&(t.execute("uploadImage",{file:o}),t.editing.view.focus())})),r}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),o=this._createButton(bh);return o.tooltip=!0,o.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",((t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions."))),o}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(bh);return i.withText=!0,i.bind("label").to(t,"isImageSelected",(t=>e(t?"Replace from computer":"Upload from computer"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(sg);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}class xb extends fc{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{const o=this.editor,n=t.item,s=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const r=o.plugins.get("ImageUtils"),a=o.plugins.get(Qp),l=s?t.attributeNewValue:null,c=this.placeholder,d=o.editing.mapper.toViewElement(n),u=i.writer;if("reading"==l)return Eb(d,u),void Tb(r,c,d,u);if("uploading"==l){const e=a.loaders.get(s);return Eb(d,u),void(e?(Pb(d,u),function(e,t,i,o){const n=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),n),i.on("change:uploadedPercent",((e,t,i)=>{o.change((e=>{e.setStyle("width",i+"%",n)}))}))}(d,u,e,o.editing.view),function(e,t,i,o){if(o.data){const n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}(r,d,u,e)):Tb(r,c,d,u))}"complete"==l&&a.loaders.get(s)&&function(e,t,i){const o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(o))))}),3e3)}(d,u,o.editing.view),function(e,t){Ib(e,t,"progressBar")}(d,u),Pb(d,u),function(e,t){t.removeClass("ck-appear",e)}(d,u)}}function Eb(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Tb(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);const n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),Sb(i,"placeholder")||o.insert(o.createPositionAfter(n),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(o))}function Pb(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Ib(e,t,"placeholder")}function Sb(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function Ib(e,t,i){const o=Sb(e,i);o&&t.remove(t.createRangeOn(o))}class Rb extends wc{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Qt(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const s=i.getSelectedElement();if(t&&s&&o.isImage(s)){const t=this.editor.model.createPositionAfter(s);this._uploadImage(e,n,t)}else this._uploadImage(e,n)}))}_uploadImage(e,t,i){const o=this.editor,n=o.plugins.get(Qp).createLoader(e),s=o.plugins.get("ImageUtils");n&&s.insertImage({...t,uploadId:n.id},i)}}class Ob extends fc{static get requires(){return[Qp,Gm,bf,Gf]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,o=e.plugins.get(Qp),n=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),r=kb(e.config.get("image.upload.types")),a=new Rb(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add((e=>e.on("element:img",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{attributes:["data-ck-upload-id"]}))return;const n=t.viewItem.getAttribute("data-ck-upload-id");if(!n)return;const[s]=Array.from(t.modelRange.getItems({shallow:!0})),r=o.loaders.get(n);s&&(i.writer.setAttribute("uploadId",n,s),i.consumable.consume(t.viewItem,{attributes:["data-ck-upload-id"]}),r&&r.data&&i.writer.setAttribute("uploadStatus",r.status,s))}),{priority:"low"}))),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(o=i.dataTransfer,Array.from(o.types).includes("text/html")&&""!==o.getData("text/html"))return;var o;const n=Array.from(i.dataTransfer.files).filter((e=>!!e&&r.test(e.type)));if(!n.length)return;t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:n})}));if(!e.commands.get("uploadImage").isAccessAllowed){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}})),this.listenTo(s,"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).map((e=>e.item)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(n,e)&&!e.getAttribute("uploadProcessed"))).map((e=>({promise:vb(e),imageElement:e})));if(!s.length)return;const r=new rl(e.editing.view.document);for(const e of s){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=o.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),t.on("change",(()=>{const i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),n=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,s="$graveyard"==t.position.root.rootName;for(const t of Vb(e,i)){const i=t.getAttribute("uploadId"),r=t.getAttribute("uploadStatus");if(!i||"complete"==r)continue;const a=o.loaders.get(i);if(a)if(s){if(!n.has(i)){Array.from(this._uploadImageElements.get(i)).every((e=>"$graveyard"==e.root.rootName))&&a.abort()}}else n.add(i),this._uploadImageElements.has(i)?this._uploadImageElements.get(i).add(t):this._uploadImageElements.set(i,new Set([t])),"idle"==a.status&&this._readAndUpload(a);else!s&&this._uploadedImages.has(i)&&e.model.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:this._uploadedImages.get(i),imageElement:t})}))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const o=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",o.default,t),this._parseAndSetSrcsetAttributeOnImage(o,t,e),n.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(Qp),s=t.plugins.get(Gm),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{const i=a.get(e.id);for(const e of i)t.setAttribute("uploadStatus","reading",e)})),e.read().then((()=>{const n=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image"));for(const o of a.get(e.id)){if(Y.isSafari){const e=t.editing.mapper.toViewElement(o),i=r.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const o=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=o}))}i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",o)}))}return n})).then((n=>{i.enqueueChange({isUndoable:!1},(i=>{for(const t of a.get(e.id))i.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:n,imageElement:t});t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this._uploadedImages.set(e.id,n)})),l()})).catch((n=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))"$graveyard"!==i.root.rootName&&t.remove(i)})),l()}));function l(){i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i);a.delete(e.id)})),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0;const n=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return o=Math.max(o,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=n){const e={srcset:n};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=o),i.setAttributes(e,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,o=i.get(Qp),n=i.get(Gf);t.for("dataDowncast").add((t=>{t.on(`attribute:uploadId:${e}`,((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const s=o.loaders.get(t.attributeNewValue);if(!s||!s.data)return null;const r=i.mapper.toViewElement(t.item),a=n.findViewImgElement(r);a&&(i.consumable.consume(t.item,e.name),i.writer.setAttribute("data-ck-upload-id",s.id,a))}))}))}}function Vb(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class Db extends fc{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[Ob,Ab,xb]}}class Fb extends wc{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change((t=>{t.setAttribute("resizedWidth",e.width,n),t.removeAttribute("resizedHeight",n),o.setImageNaturalSizeAttributes(n)}))}}class Mb extends fc{static get requires(){return[Gf]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Fb(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add((t=>t.on(`attribute:resizedWidth:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=i.writer,n=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(o.setStyle("width",t.attributeNewValue,n),o.addClass("image_resized",n)):(o.removeStyle("width",n),o.removeClass("image_resized",n))})))),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add((t=>t.on(`attribute:resizedHeight:${e}`,((t,o,n)=>{if(!n.consumable.consume(o.item,t.name))return;const s=n.writer,r=n.mapper.toViewElement(o.item),a="imageInline"===e?i.findViewImgElement(r):r;null!==o.attributeNewValue?s.setStyle("height",o.attributeNewValue,a):s.removeStyle("height",a)})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>Uf(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>Uf(e)?null:e.getStyle("height")}}),t.conversion.for("upcast").add((t=>{t.on("element:"+("imageBlock"===e?"figure":"img"),((e,t,i)=>{i.consumable.consume(t.viewItem,{classes:["image_resized"]})}))}))}}const Nb=(()=>({small:'',medium:'',large:'',custom:'',original:''}))();class Bb extends fc{static get requires(){return[Mb]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:o,icon:n}=e;t.ui.componentFactory.add(i,(i=>{const s=new Lu(i),r=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!Nb[n])throw new fe("imageresizebuttons-missing-icon",t,e);if(s.set({label:a,icon:Nb[n],tooltip:a,isToggleable:!0}),s.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Lb(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(s,"execute",(()=>{e._showForm(this._resizeUnit)}))}else{const e=o?o+this._resizeUnit:null;s.bind("isOn").to(r,"value",r,"isEnabled",zb(e)),this.listenTo(s,"execute",(()=>{t.execute("resizeImage",{width:e})}))}return s}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,o=e.find((e=>!e.value)),n=n=>{const s=t.commands.get("resizeImage"),r=Zh(n,Mh),a=r.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:o.value,icon:Nb.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(s,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(o))),r.bind("isEnabled").to(this),Xh(r,(()=>this._getResizeDropdownListItemDefinitions(e,s)),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(r,"execute",(e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())})),r};t.ui.componentFactory.add("resizeImage",n),t.ui.componentFactory.add("imageResize",n)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?Lb(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Lb(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,o=new ei,n=e.map((e=>Lb(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null}));for(const e of n){let s=null;if(i.plugins.has("ImageCustomResizeUI")&&Lb(e)){const o=i.plugins.get("ImageCustomResizeUI");s={type:"button",model:new Jm({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{o._showForm(this._resizeUnit)}})};const r=Object.values(n).map((e=>e.valueWithUnits));s.model.bind("isOn").to(t,"value",t,"isEnabled",jb(r))}else s={type:"button",model:new Jm({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},s.model.bind("isOn").to(t,"value",t,"isEnabled",zb(e.valueWithUnits));s.model.bind("isEnabled").to(t,"isEnabled"),o.add(s)}return o}}function Lb(e){return"custom"===e.value}function zb(e){return(t,i)=>!(void 0===t||!i)&&(null===e&&t===e||null!==t&&t.width===e)}function jb(e){return(t,i)=>!e.some((e=>zb(e)(t,i)))}const $b="image_resized";class qb extends fc{static get requires(){return[Rp,Gf]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(nb),this.listenTo(t.document,"imageLoaded",((o,n)=>{if(!n.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,r=s.domToView(n.target),a=i.getImageWidgetFromImageView(r);let l=this.editor.plugins.get(Rp).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,d=c.toModelElement(a);l=e.plugins.get(Rp).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:d,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.mapViewToDom(c.toViewElement(d)),isCentered:()=>"alignCenter"==d.getAttribute("imageStyle"),onCommit(i){t.change((e=>{e.removeClass($b,a)})),e.execute("resizeImage",{width:i})}}),l.on("updateSize",(()=>{a.hasClass($b)||t.change((e=>{e.addClass($b,a)}));const e="imageInline"===d.name?r:a;e.getStyle("height")&&t.change((t=>{t.removeStyle("height",e)}))})),l.bind("isEnabled").to(this)}))}}function Hb(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],o=Number.parseFloat(t);return Number.isNaN(o)?null:{value:o,unit:i}}function Wb(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function Ub(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const o=t.mapper.toViewElement(i);return{model:i,view:o,dom:t.view.domConverter.mapViewToDom(o)}}class Kb extends Au{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new ii,this.keystrokes=new ri,this.unit=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Km(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new tu,this._validators=i,this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.backButtonView,this.labeledInput,this.saveButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new Sh(this.locale,sm);return t.label=e("Resize image (in %0)",this.unit),t.class="ck-labeled-field-view_full-width",t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class Gb extends fc{_balloon;_form;static get requires(){return[Qm]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Iu(Kb))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",(()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))})),this.listenTo(this._form.labeledInput,"change:errorText",(()=>{t.ui.update()})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),Su({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:Xf(t)});const o=function(e,t){const i=Ub(e);if(!i)return null;const o=Hb(i.model.getAttribute("resizedWidth")||null);return o?o.unit===t?o:Wb(up(i.dom),{value:new ut(i.dom).width},t):null}(t,e),n=o?o.value.toFixed(1):"",s=function(e,t){const i=Ub(e);if(!i)return null;const o=up(i.dom),n=Hb(window.getComputedStyle(i.dom).minWidth)||{value:1};return{unit:t,lower:Math.max(.1,Wb(o,n,t).value),upper:"px"===t?o:100}}(t,e);i.fieldView.value=i.fieldView.element.value=n,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Jb extends wc{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("ImageUtils");i.change((t=>{const n=e.value,{setImageSizes:s=!0}=e;let r=o.getClosestSelectedImageElement(i.document.selection);n&&this.shouldConvertImageType(n,r)&&(this.editor.execute(o.isBlockImage(r)?"imageTypeInline":"imageTypeBlock",{setImageSizes:s}),r=o.getClosestSelectedImageElement(i.document.selection)),!n||this._styles.get(n).isDefault?t.removeAttribute("imageStyle",r):t.setAttribute("imageStyle",n,r),s&&o.setImageNaturalSizeAttributes(r)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const Zb={get inline(){return{name:"inline",title:"In line",icon:Qc,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Jc,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Yc,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Gc,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Zc,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Xc,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Gc,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Zc,modelElements:["imageBlock"],className:"image-style-side"}}},Qb=(()=>({full:'',left:Yc,right:Xc,center:Gc,inlineLeft:Jc,inlineRight:Zc,inline:Qc}))(),Yb=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Xb(e){be("image-style-configuration-definition-invalid",e)}const ew={normalizeStyles:function(e){const t=(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?Zb[e]?{...Zb[e]}:{name:e}:function(e,t){const i={...t};for(const o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}(Zb[e.name],e);"string"==typeof e.icon&&(e.icon=Qb[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:o,name:n}=e;if(!(o&&o.length&&n))return Xb({style:e}),!1;{const n=[t?"imageBlock":null,i?"imageInline":null];if(!o.some((e=>n.includes(e))))return be("image-style-missing-dependency",{style:e,missingPlugins:o.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)));return t},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...Yb]:[]},warnInvalidStyle:Xb};function tw(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(i,o,n)=>{if(!o.modelRange)return;const s=o.viewItem,r=ti(o.modelRange.getItems());if(r&&n.schema.checkAttribute(r,"imageStyle")){for(const e of t[r.name])n.consumable.consume(s,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,r);!function(e,t,i,o){if(!e.consumable.test(t,{styles:["float"]}))return;let n=null;switch(t.getStyle("float")){case"left":n="alignLeft";break;case"right":n="alignRight"}if(!n)return;const s=iw(n,o);if(!s)return;const r=Zb[s.name];if(!Ui(s,r))return;e.writer.setAttribute("imageStyle",n,i),e.consumable.consume(t,{styles:["float"]})}(n,s,r,e)}}}function iw(e,t){for(const i of t)if(i.name===e)return i}class ow extends fc{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Gf]}normalizedStyles;init(){const e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",ew.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=ew.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new Jb(e,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,o=i.model.schema,n=(s=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const o=iw(t.attributeNewValue,s),n=iw(t.attributeOldValue,s),r=i.mapper.toViewElement(t.item),a=i.writer;n&&a.removeClass(n.className,r),o&&a.addClass(o.className,r)});var s;const r=tw(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:figure",r,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",r,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(Gf),o=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let n=!1;for(const s of t.differ.getChanges())if("insert"==s.type||"attribute"==s.type&&"imageStyle"==s.attributeKey){let t="insert"==s.type?s.position.nodeAfter:s.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const r=t.getAttribute("imageStyle");if(!r)continue;const a=o.get(r);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),n=!0)}return n}))}}class nw extends fc{static get requires(){return[ow]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=sw(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of i)this._createButton(e);const o=sw([...t.filter(s),...ew.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const e of o)this._createDropdown(e,i)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(o=>{let n;const{defaultItem:s,items:r,title:a}=e,l=r.filter((e=>t.find((({name:t})=>rw(t)===e)))).map((e=>{const t=i.create(e);return e===s&&(n=t),t}));r.length!==l.length&&ew.warnInvalidStyle({dropdown:e});const c=Zh(o,Jh),d=c.buttonView,u=d.arrowView;return Qh(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:aw(a,n.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:a}),d.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(jf);return t<0?n.icon:l[t].icon})),d.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(jf);return aw(a,t<0?n.label:l[t].label)})),d.bind("isOn").toMany(l,"isOn",((...e)=>e.some(jf))),d.bind("class").toMany(l,"isOn",((...e)=>e.some(jf)?"ck-splitbutton_flatten":void 0)),d.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:n.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(jf))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(rw(t),(i=>{const o=this.editor.commands.get("imageStyle"),n=new Lu(i);return n.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>e===t)),n.on("execute",this._executeCommand.bind(this,t)),n}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function sw(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function rw(e){return`imageStyle:${e}`}function aw(e,t){return(e?e+": ":"")+t}function lw(e){return e.map((e=>s(e)?e.name:e))}const cw=Symbol("isWpButtonMacroSymbol");function dw(e){const t=e.getSelectedElement();return!(!t||!function(e){return!!e.getCustomProperty(cw)&&op(e)}(t))}class uw extends fc{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),i.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(e,{writer:t})=>{const i=e.getAttribute("data-page")||"",o="true"==e.getAttribute("data-include-parent");return t.createElement("op-macro-child-pages",{page:i,includeParent:o})}}),i.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(e,{writer:t})=>this.createMacroViewElement(e,t)}).add((e=>e.on("attribute:page",this.modelAttributeToView.bind(this)))).add((e=>e.on("attribute:includeParent",this.modelAttributeToView.bind(this)))),i.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(e,{writer:t})=>t.createContainerElement("macro",{class:"child_pages","data-page":e.getAttribute("page")||"","data-include-parent":e.getAttribute("includeParent")||""})}),e.ui.componentFactory.add(uw.buttonName,(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),i.on("execute",(()=>{e.model.change((t=>{const i=t.createElement("op-macro-child-pages",{});e.model.insertContent(i,e.model.document.selection)}))})),i}))}modelAttributeToView(e,t,i){const o=t.item;if(!o.is("element","op-macro-child-pages"))return;i.consumable.consume(t.item,e.name);const n=i.mapper.toViewElement(o);i.writer.remove(i.writer.createRangeIn(n)),this.setPlaceholderContent(i.writer,o,n)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(e){return e&&e.length>0?e:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(e){return e?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(e,t){const i=t.createContainerElement("div");return this.setPlaceholderContent(t,e,i),function(e,t,i){return t.setCustomProperty(cw,!0,e),np(e,t,{label:i})}(i,t,{label:this.macroLabel()})}setPlaceholderContent(e,t,i){const o=t.getAttribute("page"),n=t.getAttribute("includeParent"),s=this.macroLabel(),r=this.pageLabel(o),a=e.createContainerElement("span",{class:"macro-value"});let l=[e.createText(`${s} `)];e.insert(e.createPositionAt(a,0),e.createText(`${r}`)),l.push(a),l.push(e.createText(this.includeParentText(n))),e.insert(e.createPositionAt(i,0),l)}}class hw extends fc{static get requires(){return[Qm]}static get pluginName(){return"OPChildPagesToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditChildPagesMacroButton",(e=>{const o=i.services.macros,n=e.getAttribute("page"),s=e.getAttribute("includeParent"),r=n&&n.length>0?n:"";o.configureChildPages(r,s).then((i=>t.change((t=>{t.setAttribute("page",i.page,e),t.setAttribute("includeParent",i.includeParent,e)}))))}))}afterInit(){qp(this,this.editor,"OPChildPages",dw)}}class mw extends wc{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!gw(e.schema,i))do{if(i=i.parent,!i)return}while(!gw(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function gw(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const pw=Wt("Ctrl+A");class fw extends fc{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new mw(e)),this.listenTo(i,"keydown",((t,i)=>{Ht(i)===pw&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class bw extends fc{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton(sh)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),s=i.t;return n.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),n}}class ww extends fc{static get requires(){return[fw,bw]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}const yw="ckCsrfToken",_w="abcdefghijklmnopqrstuvwxyz0123456789";function kw(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const i of t){const t=i.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}(yw);var t,i;return e&&40==e.length||(e=function(e){let t="";const i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let e=0;e.5?o.toUpperCase():o}return t}(40),t=yw,i=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(i)+";path=/"),e}class vw{loader;url;t;xhr;constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then((e=>new Promise(((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){const o=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${i.name}.`;o.addEventListener("error",(()=>t(s))),o.addEventListener("abort",(()=>t())),o.addEventListener("load",(()=>{const i=o.response;if(!i||!i.uploaded)return t(i&&i.error&&i.error.message?i.error.message:s);e({default:i.url})})),o.upload&&o.upload.addEventListener("progress",(e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)}))}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",kw()),this.xhr.send(t)}}function Cw(e,t,i,o){let n,s=null;"function"==typeof o?n=o:(s=e.commands.get(o),n=()=>{e.execute(o)}),e.model.document.on("change:data",((r,a)=>{if(s&&!s.isEnabled||!t.isEnabled)return;const l=ti(e.model.document.selection.getRanges());if(!l.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const c=Array.from(e.model.document.differ.getChanges()),d=c[0];if(1!=c.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const u=d.position.parent;if(u.is("element","codeBlock"))return;if(u.is("element","listItem")&&"function"!=typeof o&&!["numberedList","bulletedList","todoList"].includes(o))return;if(s&&!0===s.value)return;const h=u.getChild(0),m=e.model.createRangeOn(h);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(h.data.substr(0,l.end.offset));g&&e.model.enqueueChange((t=>{const i=e.model.document.selection,o=t.createPositionAt(u,0),s=t.createPositionAt(u,g[0].length),r=new Ts(o,s);if(!1!==n({match:g})){const e=Array.from(i.getAttributes());t.remove(r);const o=i.getFirstRange(),n=t.createRangeIn(u);!u.isEmpty||n.isEqual(o)||n.containsRange(o,!0)||t.remove(u),function(e,t,i){const o=e.model.schema,n=t.getFirstPosition();let s=new gr(n);o.checkChild(s,"$text")&&(s=s.push("$text"));for(const[t,n]of i)o.checkAttribute(s,t)&&e.setSelectionAttribute(t,n)}(t,i,e)}r.detach(),e.model.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Aw(e,t,i,o){let n,s;i instanceof RegExp?n=i:s=i,s=s||(e=>{let t;const i=[],o=[];for(;null!==(t=n.exec(e))&&!(t&&t.length<4);){let{index:e,1:n,2:s,3:r}=t;const a=n+s+r;e+=t[0].length-a.length;const l=[e,e+n.length],c=[e+n.length+s.length,e+n.length+s.length+r.length];i.push(l),i.push(c),o.push([e+n.length,e+n.length+s.length])}return{remove:i,format:o}}),e.model.document.on("change:data",((i,n)=>{if(n.isUndo||!n.isLocal||!t.isEnabled)return;const r=e.model,a=r.document.selection;if(!a.isCollapsed)return;const l=Array.from(r.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,u=d.parent,{text:h,range:m}=function(e,t){let i=e.start;const o=Array.from(e.getItems()).reduce(((e,o)=>!o.is("$text")&&!o.is("$textProxy")||o.getAttribute("code")?(i=t.createPositionAfter(o),""):e+o.data),"");return{text:o,range:t.createRange(i,e.end)}}(r.createRange(r.createPositionAt(u,0),d),r),g=s(h),p=xw(m.start,g.format,r),f=xw(m.start,g.remove,r);p.length&&f.length&&r.enqueueChange((t=>{if(!1!==o(t,p)){for(const e of f.reverse())t.remove(e);r.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function xw(e,t,i){return t.filter((e=>void 0!==e[0]&&void 0!==e[1])).map((t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1]))))}function Ew(e,t){return(i,o)=>{if(!e.commands.get(t).isEnabled)return!1;const n=e.model.schema.getValidRanges(o,t);for(const e of n)i.setAttribute(t,!0,e);i.removeSelectionAttribute(t)}}class Tw extends wc{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,o=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)o?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const n=t.schema.getValidRanges(i.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const t of n){let i=t,n=this.attributeKey;t.isCollapsed&&(i=t.start.parent,n=Os._getStoreAttributeKey(this.attributeKey)),o?e.setAttribute(n,o,i):e.removeAttribute(n,i)}}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const Pw="bold";class Sw extends fc{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Pw}),e.model.schema.setAttributeProperties(Pw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Pw,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(Pw,new Tw(e,Pw)),e.keystrokes.set("CTRL+B",Pw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function Iw({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:s}){return r=>{const a=e.commands.get(t),l=new r(e.locale);return l.set({label:n,icon:o,keystroke:s,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof sh?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",(()=>{e.execute(t),e.editing.view.focus()})),l}}const Rw="bold";class Ow extends fc{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Rw,plugin:this,icon:$c,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(Rw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Rw,(()=>i(sh)))}}const Vw="code";class Dw extends fc{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Rg]}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vw}),e.model.schema.setAttributeProperties(Vw,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:Vw,view:"code"}),e.commands.add(Vw,new Tw(e,Vw)),e.plugins.get(Rg).registerAttribute(Vw),jg(e,Vw,"code","ck-code_selected"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const Fw="code";class Mw extends fc{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Fw,plugin:this,icon:'',label:t("Code")});e.ui.componentFactory.add(Fw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Fw,(()=>i(sh)))}}const Nw="italic";class Bw extends fc{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Nw}),e.model.schema.setAttributeProperties(Nw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Nw,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Nw,new Tw(e,Nw)),e.keystrokes.set("CTRL+I",Nw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const Lw="italic";class zw extends fc{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:Lw,plugin:this,icon:'',keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(Lw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+Lw,(()=>i(sh)))}}const jw="strikethrough";class $w extends fc{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:jw}),e.model.schema.setAttributeProperties(jw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:jw,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(jw,new Tw(e,jw)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const qw="strikethrough";class Hw extends fc{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Iw({editor:e,commandName:qw,plugin:this,icon:'',keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(qw,(()=>i(Lu))),e.ui.componentFactory.add("menuBar:"+qw,(()=>i(sh)))}}class Ww extends wc{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),s=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(s){const t=n.filter((e=>Uw(e)||Gw(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,n.filter(Uw))}))}_getValue(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Uw(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=ti(e.getSelectedBlocks());return!!i&&Gw(t,i)}_removeQuote(e,t){Kw(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];Kw(e,t).reverse().forEach((t=>{let o=Uw(t.start);o||(o=e.createElement("blockQuote"),e.wrap(t,o)),i.push(o)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function Uw(e){return"blockQuote"==e.parent.name?e.parent:null}function Kw(e,t){let i,o=0;const n=[];for(;o{const o=e.model.document.differ.getChanges();for(const e of o)if("insert"==e.type){const o=e.position.nodeAfter;if(!o)continue;if(o.is("element","blockQuote")&&o.isEmpty)return i.remove(o),!0;if(o.is("element","blockQuote")&&!t.checkChild(e.position,o))return i.unwrap(o),!0;if(o.is("element")){const e=i.createRangeIn(o);for(const o of e.getItems())if(o.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(o),o))return i.unwrap(o),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1}));const i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",((t,i)=>{if(!o.isCollapsed||!n.value)return;o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((t,i)=>{if("backward"!=i.direction||!o.isCollapsed||!n.value)return;const s=o.getLastPosition().parent;s.isEmpty&&!s.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"})}}class Zw extends fc{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:blockQuote",(()=>{const e=this._createButton(sh);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),s=i.t;return n.set({label:s("Block quote"),icon:'',isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value"),this.listenTo(n,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),n}}class Qw extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=ti(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Yw(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change((e=>{const i=o.getSelectedBlocks();for(const o of i)!o.is("element","paragraph")&&Yw(o,t.schema)&&e.rename(o,"paragraph")}))}}function Yw(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Xw extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let o=e.position;return t.canEditAt(o)?t.change((e=>{if(o=this._findPositionToInsertParagraph(o,e),!o)return null;const n=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(n,i,e),t.insertContent(n,o),e.setSelection(n,"in"),e.createPositionAt(n,0)})):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;const n=e.parent,s=i.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}}class ey extends fc{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Qw(e)),e.commands.add("insertParagraph",new Xw(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>ey.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class ty extends wc{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>iy(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,i=t.document,o=e.value;t.change((e=>{const n=Array.from(i.selection.getSelectedBlocks()).filter((e=>iy(e,o,t.schema)));for(const t of n)t.is("element",o)||e.rename(t,o)}))}}function iy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const oy="paragraph";class ny extends fc{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ey]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const o of t)"paragraph"!==o.model&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new ty(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,o)=>{const n=e.model.document.selection.getFirstPosition().parent;i.some((e=>n.is("element",e.model)))&&!n.is("element",oy)&&0===n.childCount&&o.writer.rename(n,oy)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ge.low+1})}}function sy(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e}))}class ry extends fc{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=sy(e),o=t("Choose heading"),n=t("Heading");e.ui.componentFactory.add("heading",(t=>{const s={},r=new ei,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of i){const t={type:"button",model:new Jm({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),s[e.model]=e.title}const d=Zh(t);return Xh(d,r,{ariaLabel:n,role:"menu"}),d.buttonView.set({ariaLabel:n,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some((e=>e)))),d.buttonView.bind("label").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?o:s[i]?s[i]:o})),d.buttonView.bind("ariaLabel").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:s[i]?`${s[i]}, ${n}`:n})),this.listenTo(d,"execute",(t=>{const{commandName:i,commandValue:o}=t.source;e.execute(i,o?{value:o}:void 0),e.editing.view.focus()})),d})),e.ui.componentFactory.add("menuBar:heading",(o=>{const n=new ig(o),s=e.commands.get("heading"),r=e.commands.get("paragraph"),a=[s],l=new og(o);n.set({class:"ck-heading-dropdown"}),l.set({ariaLabel:t("Heading"),role:"menu"}),n.buttonView.set({label:t("Heading")}),n.panelView.children.add(l);for(const t of i){const i=new Em(o,n),c=new sh(o);i.children.add(c),l.items.add(i),c.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),c.delegate("execute").to(n),c.on("execute",(()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(c.bind("isOn").to(r,"value"),a.push(r)):c.bind("isOn").to(s,"value",(e=>e===t.model))}return n.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),n}))}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class ay{_definitions=new Set;_conflictChecker;get length(){return this._definitions.size}setConflictChecker(e){this._conflictChecker=e}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{const t=(e,t)=>{const i=t.createAttributeElement("a",e.attributes,{priority:5});e.classes&&t.addClass(e.classes,i);for(const o in e.styles)t.setStyle(o,e.styles[o],i);return t.setCustomProperty("link",!0,i),i},i=e=>(i,o,n)=>{if(o.attributeKey.startsWith("link")&&("linkHref"!=o.attributeKey||n.consumable.test(o.item,"attribute:linkHref"))&&(o.item.is("selection")||n.schema.isInline(o.item)))for(const i of this._definitions)i.callback(o.item.getAttribute("linkHref"))&&!this._conflictChecker?.(i,o.item)&&e?o.item.is("selection")?n.writer.wrap(n.writer.document.selection.getFirstRange(),t(i,n.writer)):n.writer.wrap(n.mapper.toViewRange(o.range),t(i,n.writer)):n.writer.unwrap(n.mapper.toViewRange(o.range),t(i,n.writer))};e.on("attribute",i(!1),{priority:ge.high-1}),e.on("attribute",i(!0),{priority:ge.high-2})}}getDispatcherForLinkedImage(){return e=>{const t=e=>(t,i,{writer:o,mapper:n})=>{if(!i.item.is("element","imageBlock")||!i.attributeKey.startsWith("link"))return;const s=n.toViewElement(i.item),r=Array.from(s.getChildren()).find((e=>e.is("element","a")));if(r)for(const t of this._definitions){const n=ai(t.attributes);if(t.callback(i.item.getAttribute("linkHref"))&&!this._conflictChecker?.(t,i.item)&&e){for(const[e,t]of n)"class"===e?o.addClass(t,r):o.setAttribute(e,t,!1,r);t.classes&&o.addClass(t.classes,r);for(const e in t.styles)o.setStyle(e,t.styles[e],r)}else{for(const[e,t]of n)"class"===e?o.removeClass(t,r):o.removeAttribute(e,t,r);t.classes&&o.removeClass(t.classes,r);for(const e in t.styles)o.removeStyle(e,r)}}};e.on("attribute",t(!1),{priority:ge.high-1}),e.on("attribute",t(!0),{priority:ge.high-2})}}}const ly=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,cy=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,dy=/^((\w+:(\/{2,})?)|(\W))/i,uy=["https?","ftps?","mailto"],hy="Ctrl+K";function my(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function gy(e,t=uy){const i=String(e),o=t.join("|");return function(e,t){const i=e.replace(ly,"");return!!i.match(t)}(i,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",o)}`,"i"))?i:"#"}function py(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function fy(e,t){const i=(o=e,cy.test(o)?"mailto:":t);var o;const n=!!i&&!by(e);return e&&n?i+e:e}function by(e){return dy.test(e)}function wy(e){let t="";for(const i of e.getItems()){if(!i.is("$text")&&!i.is("$textProxy"))return;t+=i.data}return t}function yy(e,t){if(e.attributes&&t.attributes){if(Object.keys(e.attributes).some((e=>!function(e){return"class"===e||"style"===e||"rel"===e}(e)&&e in t.attributes)))return!0}if(e.styles&&t.styles){if(Object.keys(e.styles).some((e=>e in t.styles)))return!0}return!1}function _y(e,t){const i=t.find((t=>t.id===e));return i?t.filter((t=>t.id!==e&&yy(i,t))).map((e=>e.id)):[]}class ky extends wc{manualDecorators=new ei;automaticDecorators=new ay;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||ti(t.getSelectedBlocks());py(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={},i){const o=this.editor.model,n=o.document.selection,s=function({decoratorStates:e,allDecorators:t}){const i={...e};for(const n in e)if(e[n]&&o(n)){const e=_y(n,t);for(const t of e)i[t]=!1}function o(e){return t.some((t=>t.id===e&&!t.value))}return i}({allDecorators:Array.from(this.manualDecorators),decoratorStates:t}),r=[],a=[];for(const e in s)s[e]?r.push(e):a.push(e);o.change((t=>{const s=i=>{t.setAttribute("linkHref",e,i),r.forEach((e=>t.setAttribute(e,!0,i))),a.forEach((e=>t.removeAttribute(e,i)))},l=(n,r)=>{const a=wy(n);if(!a)return n;let l=i;if(l||(l=r&&r==a?e:a),l!=a){const e=t.createDocumentFragment();for(const i of n.getItems()){const o=i;t.append(t.createText(o.data,o.getAttributes()),e)}const i=t.createRangeIn(e),r=function(e,t){const i=de(e,t),o={equal:0,insert:0,delete:0},n=[];let s="",r="";for(const a of[...i,null])"insert"==a?r+=t[o.equal+o.insert]:"delete"==a?s+=e[o.equal+o.delete]:(s.length||r.length)&&(n.push({offset:o.equal,actual:s,expected:r}),s="",r=""),a&&o[a]++;return n}(a,l);let c=0;for(const{offset:e,actual:n,expected:a}of r){const r=e+c,l=t.createRange(i.start.getShiftedBy(r),i.start.getShiftedBy(r+n.length)),d=vy(l,i).getAttributes(),u=Array.from(d).filter((([e])=>o.schema.getAttributeProperties(e).isFormatting)),h=t.createText(a,u);s(h),t.remove(l),t.insert(h,l.start),c+=a.length}return o.insertContent(e,n),t.createRange(n.start,n.start.getShiftedBy(l.length))}},c=e=>{const{plugins:i}=this.editor;if(t.setSelection(e.end),i.has("TwoStepCaretMovement"))i.get("TwoStepCaretMovement")._handleForwardMovement();else for(const e of["linkHref",...r,...a])t.removeSelectionAttribute(e)};if(n.isCollapsed){const a=n.getFirstPosition();if(n.hasAttribute("linkHref")){const e=n.getAttribute("linkHref"),t=Lg(a,"linkHref",e,o),i=l(t,e);s(i||t),i&&c(i)}else if(""!==e){const s=ai(n.getAttributes());s.set("linkHref",e),r.forEach((e=>{s.set(e,!0)}));c(o.insertContent(t.createText(i||e,s),a))}}else{const e=Array.from(n.getRanges()),i=o.schema.getValidRanges(e,"linkHref"),r=[];for(const e of n.getSelectedBlocks())o.schema.checkAttribute(e,"linkHref")&&r.push(t.createRangeOn(e));const a=r.slice();for(const e of i)this._isRangeToUpdate(e,r)&&a.push(e);const c=e.map((e=>({start:ma.fromPosition(e.start,"toPrevious"),end:ma.fromPosition(e.end,"toNext")})));for(let e of a){e=l(e,(e.start.textNode||e.start.nodeAfter).getAttribute("linkHref"))||e,s(e)}t.setSelection(c.map((e=>{const t=e.start.toPosition(),i=e.end.toPosition();return e.start.detach(),e.end.detach(),o.createRange(t,i)})))}})),this.restoreManualDecoratorStates()}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return py(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}function vy(e,t){if(!e.isCollapsed)return ti(e.getItems());const i=e.start;return i.textNode?i.textNode:!i.nodeBefore||i.isEqual(t.start)?i.nodeAfter:i.nodeBefore}class Cy extends wc{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();py(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,o=e.commands.get("link");t.change((e=>{const n=i.isCollapsed?[Lg(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of n)if(e.removeAttribute("linkHref",t),o)for(const i of o.manualDecorators)e.removeAttribute(i.id,t)}))}}class Ay extends(Be()){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const xy="automatic",Ey=/^(https?:)?\/\//;class Ty extends fc{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Rg,fg,bf]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:my}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>my(gy(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new ky(e)),e.commands.add("unlink",new Cy(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[o,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${i=o,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}(yi(i))}`});t.push(e)}var i;return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===xy))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode)));e.plugins.get(Rg).registerAttribute("linkHref"),jg(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration(),this._enableDecoratorConflictPostfixer()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link"),o=i.automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&o.add({id:"linkIsExternal",mode:xy,callback:e=>!!e&&Ey.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),o.add(e),o.setConflictChecker(((e,t)=>{for(const o of i.manualDecorators)if(t.hasAttribute(o.id)&&yy(e,o))return!0})),o.length&&t.conversion.for("downcast").add(o.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const o=new Ay(e);i.add(o),t.conversion.for("downcast").add((e=>{const t=e=>{const t=e.createAttributeElement("a",o.attributes,{priority:5});o.classes&&e.addClass(o.classes,t);for(const i in o.styles)e.setStyle(i,o.styles[i],t);return e.setCustomProperty("link",!0,t),t},i=e=>(i,o,n)=>{if(o.item.is("selection")||n.schema.isInline(o.item)){if(!e&&o.attributeOldValue){if(!n.consumable.test(o.item,i.name))return;n.writer.unwrap(n.mapper.toViewRange(o.range),t(n.writer))}if(e&&o.attributeNewValue){if(!n.consumable.consume(o.item,i.name))return;o.item.is("selection")?n.writer.wrap(n.writer.document.selection.getFirstRange(),t(n.writer)):n.writer.wrap(n.mapper.toViewRange(o.range),t(n.writer))}}};e.on(`attribute:${o.id}`,i(!1),{priority:ge.high-1}),e.on(`attribute:${o.id}`,i(!0),{priority:ge.high-2})})),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=e=>{var t;this._linkOpeners.some((t=>t(e)))||(t=e,window.open(t,"_blank","noopener"))};this.listenTo(t,"click",((e,t)=>{if(!(Y.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let o=t.domTarget;if("a"!=o.tagName.toLowerCase()&&(o=o.closest("a")),!o)return;const n=o.getAttribute("href");n&&(e.stop(),t.preventDefault(),i(n))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,o)=>{const n=e.commands.get("link").value;!!n&&o.keyCode===$t.enter&&o.altKey&&(t.stop(),i(n))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:o})=>{o.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,o)=>{t.change((e=>{const t=e.createRangeIn(o.content);for(const o of t.getItems())if(o.hasAttribute("linkHref")){const t=fy(o.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,o)}}))}))}_enableDecoratorConflictPostfixer(){const e=this.editor,t=e.model,i=e.commands.get("link");t.document.registerPostFixer((e=>{let o=!1;const n=t.document.differ.getChanges(),s=new Set,r=new Set(i.manualDecorators.map((e=>e.id)));for(const e of n){if("attribute"===e.type){if("linkHref"!==e.attributeKey&&!r.has(e.attributeKey))continue;for(const t of e.range.getItems())t.hasAttribute("linkHref")&&s.add(t)}"insert"===e.type&&e.attributes.has("linkHref")&&e.position.nodeAfter&&s.add(e.position.nodeAfter)}for(const t of s){const n=[];for(const s of i.manualDecorators)if(t.hasAttribute(s.id)){for(let i=n.length-1;i>=0;i--){const r=n[i];yy(r,s)&&(e.removeAttribute(r.id,t),n.splice(i,1),o=!0)}n.push(s)}}return o}))}}class Py extends Lu{constructor(e){super(e);const t=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:t.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to((e=>{if(this.href){const t=()=>e.preventDefault();this.fire("navigate",this.href,t)}}))}}),this.template.tag="a"}}class Sy extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;saveButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new tu;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",(()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this});[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}_createDisplayedTextInput(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){const e=this.locale.t,t=new Sh(this.locale,nm);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new Km(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new Km(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class Iy extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new tu;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",(()=>{this.hasItems=this.listChildren.length>0})),this.on("change:hasItems",((e,t,i)=>{i?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))})),this.keystrokes.set("Esc",((e,t)=>{this.fire("cancel"),t()})),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render();[this.listView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){const e=new ju(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new Au(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}class Ry extends Au{focusTracker=new ii;keystrokes=new ri;backButtonView;children;listChildren;_focusables=new tu;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",((e,t)=>{this.fire("back"),t()}))}render(){super.render();[...this.listChildren,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){const e=this.locale.t,t=new ju(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){const e=new zh(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using((e=>{const t=new Nh(this.locale);return t.children.add(e),t})),e}}class Oy extends Lu{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Nu;return e.content=Kc,e}}const Vy="link-ui";class Dy extends fc{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new ei;static get requires(){return[Qm,Ty]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(il),this._balloon=e.plugins.get(Qm),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Vy,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vy,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:hy},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){const t=this._linksProviders.filter((t=>(t.order||0)<=(e.order||0))).length;this._linksProviders.add(e,t)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,t=new Wh(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let o=e.config.get("link.toolbar");return i.manualDecorators.length||(o=o.filter((e=>"linkProperties"!==e))),t.fillFromConfig(o,e.ui.componentFactory),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(hy,((e,t)=>{this._addFormView(),t()})),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){const e=this.editor,t=e.locale.t,i=e.commands.get("link"),o=e.config.get("link.defaultProtocol"),n=new(Iu(Sy))(e.locale,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return n.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",(e=>void 0!==e)),n.urlInputView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("label").to(i,"value",(e=>t(e?"Update":"Insert"))),this.listenTo(n,"submit",(()=>{if(n.isValid()){const t=fy(n.urlInputView.fieldView.element.value,o),i=n.displayedTextInputView.fieldView.element.value;e.execute("link",t,this._getDecoratorSwitchesState(),i!==this.selectedLinkableText?i:void 0),this._closeFormView()}})),this.listenTo(n.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n.providersListChildren.bindTo(this._linksProviders).using((e=>this._createLinksListProviderButton(e))),n}_createLinkProviderListView(e){return e.getListItems().map((({href:e,label:t,icon:i})=>{const o=new Lu;return o.set({label:t,icon:i,tooltip:!1,withText:!0}),o.on("execute",(()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=e,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()})),o}))}_createLinkProviderItemsView(e){const t=this.editor,i=t.locale.t,o=new Iy(t.locale),{emptyListPlaceholder:n,label:s}=e;return o.emptyListPlaceholder=n||i("No links available"),o.title=s,this.listenTo(o,"cancel",(()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()})),o}_createPropertiesView(){const e=this.editor,t=this.editor.commands.get("link"),i=new(Iu(Ry))(e.locale);return this.listenTo(i,"back",(()=>{e.editing.view.focus(),this._removePropertiesView()})),i.listChildren.bindTo(t.manualDecorators).using((i=>{const o=new fh(e.locale);return o.set({label:i.label,withText:!0}),o.bind("isOn").toMany([i,t],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),o.on("execute",(()=>{e.execute("link",t.value,{...this._getDecoratorSwitchesState(),[i.id]:!o.isOn})})),o})),i}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce(((t,i)=>{const o=void 0===e.value&&void 0===i.value?i.defaultValue:i.value;return{...t,[i.id]:!!o}}),{})}_registerEditingOpeners(){this.editor.plugins.get(Ty)._registerLinkOpener((e=>{const t=this._getLinkProviderLinkByHref(e);if(!t)return!1;const{item:i,provider:o}=t;return!!o.navigate&&o.navigate(i)}))}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:link",(()=>{const e=this._createButton(sh);return e.set({role:"menuitemcheckbox"}),e})),e.ui.componentFactory.add("linkPreview",(t=>{const i=new Py(t),o=e.config.get("link.allowedProtocols"),n=e.commands.get("link"),s=t.t;i.bind("isEnabled").to(n,"value",(e=>!!e)),i.bind("href").to(n,"value",(e=>e&&gy(e,o)));const r=e=>{if(!e)return i.label=void 0,i.icon=void 0,void(i.tooltip=s("Open link in new tab"));const t=this._getLinkProviderLinkByHref(e);if(t){const{label:e,tooltip:o,icon:n}=t.item;i.label=e,i.tooltip=o||!1,i.icon=n}else i.label=e,i.icon=void 0,i.tooltip=s("Open link in new tab")};return r(n.value),this.listenTo(n,"change:value",((e,t,i)=>{r(i)})),this.listenTo(i,"navigate",((e,t,i)=>{const o=this._getLinkProviderLinkByHref(t);if(!o)return;const{provider:n,item:s}=o,{navigate:r}=n;r&&r(s)&&(e.stop(),i())})),i})),e.ui.componentFactory.add("unlink",(t=>{const i=e.commands.get("unlink"),o=new Lu(t),n=t.t;return o.set({label:n("Unlink"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",(()=>{e.execute("unlink"),this._hideUI()})),o})),e.ui.componentFactory.add("editLink",(t=>{const i=e.commands.get("link"),o=new Lu(t),n=t.t;return o.set({label:n("Edit link"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",(()=>{this._addFormView()})),o})),e.ui.componentFactory.add("linkProperties",(t=>{const i=e.commands.get("link"),o=new Lu(t),n=t.t;return o.set({label:n("Link properties"),icon:'\n',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",((e,t,i)=>e&&!!t&&i.length>0)),this.listenTo(o,"execute",(()=>{this._addPropertiesView()})),o}))}_createLinksListProviderButton(e){const t=this.editor.locale,i=new Oy(t);return i.set({label:e.label}),this.listenTo(i,"execute",(()=>{this._showLinksProviderView(e)})),i}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),s=i.t;return n.set({label:s("Link"),icon:'',keystroke:hy,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",(e=>!!e)),this.listenTo(n,"execute",(()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()})),n}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(hy,((t,i)=>{i(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),Su({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),this._isToolbarInPanel||this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),this._arePropertiesInPanel||(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){const e=this.editor.commands.get("link");this.selectedLinkableText=void 0,void 0!==e.value?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){const t=this.editor;this._isUIInPanel&&(this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&t.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),o=s();const n=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,o=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(Vy)){const t=this.editor.editing.mapper.markerNameToElements(Vy);if(t){const i=Array.from(t),o=e.createRange(e.createPositionBefore(i[0]),e.createPositionAfter(i[i.length-1]));return{target:e.domConverter.viewRangeToDom(o)}}}return{target:()=>{const i=this._getSelectedLinkElement();return i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&op(i))return Fy(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=Fy(i.start),n=Fy(i.end);return o&&o==n&&e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_getSelectedLinkableText(){const e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return wy(e.document.selection.getFirstRange());const o=t.view.createRangeOn(i);return wy(t.mapper.toModelRange(o))}_getLinkProviderLinkByHref(e){if(!e)return null;for(const t of this._linksProviders){const i=t.getItem?t.getItem(e):t.getListItems().find((t=>t.href===e));if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(Vy))t.updateMarker(Vy,{range:i});else if(i.start.isAtEnd){const o=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(Vy,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(Vy,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vy)&&e.change((e=>{e.removeMarker(Vy)}))}}function Fy(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const My=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Ny extends fc{static get requires(){return[Tg,Ty]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Lg(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),s=o.getLastPosition();let r=t.getJoined(this._expandLinkRange(i,n)||t);r&&(r=r.getJoined(this._expandLinkRange(i,s)||t)),r&&(r.start.isBefore(n)||r.end.isAfter(s))&&e.setSelection(r)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",((e,o)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||"paste"!==o.method)return;if(i.rangeCount>1)return;const s=i.getFirstRange(),r=o.dataTransfer.getData("text/plain");if(!r)return;const a=r.match(My);a&&a[2]===r&&(t.change((e=>{this._selectEntireLinks(e,s),n.execute(r)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new Ig(e.model,(e=>{let t=e;if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(t))return;t=t.slice(0,-1),"!.:,;?".includes(t[t.length-1])&&(t=t.slice(0,-1));const i=By(t);return i?{url:i,removedTrailingCharacters:e.length-t.length}:void 0}));t.on("matched:data",((t,i)=>{const{batch:o,range:n,url:s,removedTrailingCharacters:r}=i;if(!o.isTyping)return;const a=n.end.getShiftedBy(-r),l=a.getShiftedBy(-s.length),c=e.model.createRange(l,a);this._applyAutoLink(s,c)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();let i;i=e.parent.previousSibling?.is("element")?t.createRangeIn(e.parent.previousSibling):t.createRange(t.createPositionAt(e.parent,0),e),this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:o}=Sg(e,t),n=By(i);if(n){const e=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,e)}}_applyAutoLink(e,t){const i=this.editor.model,o=fy(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&by(o)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(o,t)}_persistAutoLink(e,t){const i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange((n=>{n.setAttribute("linkHref",e,t),i.enqueueChange((()=>{o.requestUndoOnBackspace()}))}))}}function By(e){const t=My.exec(e);return t?t[2]:null}function Ly(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return jy(e);var t;const i=function(e){return"string"==typeof e?zy[e]:zy[e.model]}(e);if(i)return jy(i);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new fe("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},jy(e)}(e)}(e))).filter((e=>void 0!==e))}const zy={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function jy(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}class $y{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Qt(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return ti(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of new qy(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some((e=>t.getAttribute(e)!==this._startElement.getAttribute(e))))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class qy{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward="forward"===t}[Symbol.iterator](){return this}next(){if(!Uy(this._node))return{done:!0,value:void 0};const e=this._node.getAttribute("listIndent");let t=null;if(this._previous){const i=this._previousNodeIndent;e>i?this._previousNodesByIndent[i]=this._previous:ee.getAttribute("listItemId")!=t))}function s_(e){return Array.from(e).filter((e=>"$graveyard"!==e.root.rootName)).sort(((e,t)=>e.index-t.index))}function r_(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function a_(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function l_(e){return"numbered"==e||"customNumbered"==e}function c_(e,t,i){return Gy(t,{direction:"forward"}).pop().index>e.index?t_(e,t,i):[]}class d_ extends wc{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor,t=e.model,i=u_(t.document.selection),o=e.plugins.get("ListEditing").getListAttributeNames();t.change((e=>{const t=[];n_(i)&&!Zy(i[0])?("forward"==this._direction&&t.push(...i_(i,e,{attributeNames:o})),t.push(...e_(i[0],e))):"forward"==this._direction?t.push(...i_(i,e,{expand:!0,attributeNames:o})):t.push(...function(e,t,{attributeNames:i}){const o=Yy(e=Qt(e)),n=new Set,s=Math.min(...o.map((e=>e.getAttribute("listIndent")))),r=new Map;for(const e of o)r.set(e,$y.first(e,{lowerIndent:!0}));for(const e of o){if(n.has(e))continue;n.add(e);const o=e.getAttribute("listIndent")-1;if(o<0)o_(e,t,i);else{if(e.getAttribute("listIndent")==s){const i=c_(e,r.get(e),t);for(const e of i)n.add(e);if(i.length)continue}t.setAttribute("listIndent",o,e)}}return s_(n)}(i,e,{attributeNames:o}));for(const i of t){if(!i.hasAttribute("listType"))continue;const t=$y.first(i,{sameIndent:!0});t&&e.setAttribute("listType",t.getAttribute("listType"),i)}this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",s_(new Set(e)))}_checkEnabled(){let e=u_(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if(n_(e)&&!Zy(e[0]))return!0;e=Yy(e),t=e[0];const i=$y.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function u_(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex((e=>!Uy(e)));return-1!=i&&(t.length=i),t}class h_ extends wc{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,o=r_(t),n=Array.from(i.selection.getSelectedBlocks()).filter((e=>t.schema.checkAttribute(e,"listType")||a_(e,t.schema))),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change((r=>{if(s){const e=n[n.length-1],t=this.editor.plugins.get("ListEditing").getListAttributeNames(),i=Gy(e,{direction:"forward"}),o=[];i.length>1&&o.push(...e_(i[1],r)),o.push(...o_(n,r,t)),o.push(...function(e,t){const i=[];let o=Number.POSITIVE_INFINITY;for(const{node:n}of new qy(e.nextSibling)){const e=n.getAttribute("listIndent");if(0==e)break;e{const{firstElement:r,lastElement:a}=this._getMergeSubjectElements(o,e),l=r.getAttribute("listIndent")||0,c=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(l!=c){const e=(u=a,Array.from(new $y(u,{direction:"forward",higherIndent:!0})));n.push(...i_([a,...e],t,{indentBy:l-c,expand:l{const t=e_(this._getStartBlock(),e);this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",s_(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&Uy(t)&&!Zy(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class p_ extends fc{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(e,t,i,o){t&&(e.addClass("ck-list-marker-bold",i),!Y.isSafari||o&&o.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-bold","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("BoldEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class f_ extends fc{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(e,t,i,o){t&&(e.addClass("ck-list-marker-italic",i),!Y.isSafari||o&&o.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-italic","0",i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("ItalicEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}class b_ extends fc{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const o=Ly(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(e,t,i,n){if(t){const s=o.find((e=>e.model==t));s&&s.view&&"string"!=typeof s.view?s.view.styles?(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",s.view.styles["font-size"],i)):s.view.classes&&(e.addClass(`ck-list-marker-font-size-${t}`,i),!Y.isSafari||n&&n.dataPipeline||e.setStyle("--ck-content-list-marker-dummy-font-size","0",i)):(e.addClass("ck-list-marker-font-size",i),e.setStyle("--ck-content-list-marker-font-size",t,i))}}})}afterInit(){const e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:e=>e.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=Ly(e.config.get("fontSize.options"));for(const t of i)t.model&&t.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:t.model},view:{name:"li",classes:`ck-list-marker-font-size-${t.model}`}})}}class w_ extends fc{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-color",i),e.setStyle("--ck-content-list-marker-color",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontColorEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:e=>e.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class y_ extends fc{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(z_);e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(e,t,i){t&&(e.addClass("ck-list-marker-font-family",i),e.setStyle("--ck-content-list-marker-font-family",t,i))}}))}afterInit(){const e=this.editor,t=e.model;e.plugins.has("FontFamilyEditing")&&this.editor.config.get("list.enableListItemMarkerFormatting")&&(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck((e=>{if(!e.last.getAttribute("listItemId"))return!1}),"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:e=>e.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}class __ extends fc{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[p_,f_,b_,w_,y_]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges(),o=new Set;let n=!1;for(const e of i)if("attribute"===e.type)("listItemId"==e.attributeKey||"listType"==e.attributeKey||this._isInlineOrSelectionFormatting(e.attributeKey)||Object.values(this._loadedFormatting).includes(e.attributeKey))&&(Uy(e.range.start.nodeAfter)?o.add(e.range.start.nodeAfter):Uy(e.range.start.parent)&&o.add(e.range.start.parent));else if(Uy(e.position.nodeAfter)&&o.add(e.position.nodeAfter),Uy(e.position.nodeBefore)&&o.add(e.position.nodeBefore),Uy(e.position.parent)&&o.add(e.position.parent),"insert"==e.type&&"$text"!=e.name){const i=t.createRangeIn(e.position.nodeAfter);for(const e of i.getItems())Uy(e)&&o.add(e)}for(const i of o){const o=k_(e,i,Object.keys(this._loadedFormatting));for(const[e,s]of Object.entries(o)){const o=this._loadedFormatting[e];(s&&C_(t,i,o,s)||!s&&A_(t,i,o))&&(n=!0)}}return n}))}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}}function k_(e,t,i){if(Zy(t))return v_(e,t,i);return v_(e,Ky(t)[0],i)}function v_(e,t,i){if(!function(e){return["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))}(t)||e.schema.isLimit(t))return Object.fromEntries(i.map((e=>[e])));if(t.isEmpty)return Object.fromEntries(i.map((e=>[e,t.getAttribute(`selection:${e}`)])));const o=new Set(i),n={},s=e.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:t}of s){for(const i of o)if(e.schema.checkAttribute(t,i)){const e=t.getAttribute(i);void 0===e?(o.delete(i),n[i]=void 0):void 0===n[i]?n[i]=e:n[i]!==e&&(o.delete(i),n[i]=void 0)}else i in n||(n[i]=void 0);if(!o.size)break;e.schema.isLimit(t)&&s.jumpTo(e.createPositionAfter(t))}return n}function C_(e,t,i,o){const n=Ky(t);let s=!1;for(const t of n)t.hasAttribute(i)&&t.getAttribute(i)===o||(e.setAttribute(i,o,t),s=!0);return s}function A_(e,t,i){const o=Ky(t);let n=!1;for(const t of o)t.hasAttribute(i)&&(e.removeAttribute(i,t),n=!0);return n}class x_ extends fc{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return Xy(e)}isFirstBlockOfListItem(e){return Zy(e)}isListItemBlock(e){return Uy(e)}expandListBlocksToCompleteItems(e,t={}){return Yy(e,t)}isNumberedListType(e){return l_(e)}isFirstListItemInList(e){return function(e){return!$y.first(e,{sameIndent:!0,sameAttributes:"listType"})}(e)}}function E_(e){return e.is("element","ol")||e.is("element","ul")}function T_(e){return e.is("element","li")}function P_(e,t,i,o=R_(i,t)){return e.createAttributeElement(I_(i),null,{priority:2*t/100-100,id:o})}function S_(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function I_(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function R_(e,t){return`list-${e}-${t}`}function O_(e,t,i){const o=e.nodeBefore;if(Uy(o)){let e=o;for(const{node:n}of new qy(e,"backward")){if(e=n,i.has(e))return;if(i.add(e),t.has(o))return}t.add(e)}else{const i=e.nodeAfter;Uy(i)&&t.add(i)}}function V_(){return(e,t,i)=>{const{writer:o,schema:n}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>n.checkAttribute(e,"listItemId")));if(!s.length)return;const r=t.viewItem.getAttribute("data-list-item-id")||Wy.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const a=function(e){let t=0,i=e.parent;for(;i;){if(T_(i))t++;else{const e=i.previousSibling;e&&T_(e)&&t++}i=i.parent}return t}(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=s[0].getAttribute("listType");c&&(l=c);const d={listItemId:r,listIndent:a,listType:l};for(const e of s)e.hasAttribute("listItemId")||o.setAttributes(d,e);s.length>1&&s[1].getAttribute("listItemId")!=d.listItemId&&i.keepEmptyElement(s[0])}}function D_(e,t,i,o){return()=>{const o=e.document.differ.getChanges(),r=[],a=new Set,l=new Set,c=new Set;for(const e of o)if("insert"==e.type&&"$text"!=e.name)O_(e.position,a,c),e.attributes.has("listItemId")?l.add(e.position.nodeAfter):O_(e.position.getShiftedBy(e.length),a,c);else if("remove"==e.type&&e.attributes.has("listItemId"))O_(e.position,a,c);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(O_(e.range.start,a,c),null===e.attributeNewValue?(O_(e.range.start.getShiftedBy(1),a,c),s(t)&&r.push(t)):l.add(t)):Uy(t)&&s(t)&&r.push(t)}for(const e of a.values())r.push(...n(e,l));for(const e of new Set(r))t.reconvertItem(e)};function n(e,t){const o=[],n=new Set,a=[];for(const{node:l,previous:c}of new qy(e)){if(n.has(l))continue;const e=l.getAttribute("listIndent");c&&ei.includes(e)))),modelElement:l};const d=Gy(l,{direction:"forward"});for(const e of d)n.add(e),(s(e,d)||r(e,a,t))&&o.push(e)}return o}function s(e,n){const s=t.mapper.toViewElement(e);if(!s)return!1;if(function(e){e=e.parent;for(;e.is("attributeElement")&&["ol","ul","li"].includes(e.name);)e=e.parent;if(e.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(e))return!0;return!1}(s))return!0;if(o.fire("checkElement",{modelElement:e,viewElement:s}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const r=B_(e,i,n);return!(!r||!s.is("element","p"))||!(r||!s.is("element","span"))}function r(e,i,n){if(n.has(e))return!1;const s=t.mapper.toViewElement(e);let r=i.length-1;for(let e=s.parent;!e.is("editableElement");e=e.parent){const t=T_(e),n=E_(e);if(!n&&!t)continue;const s="checkAttributes:"+(t?"item":"list");if(o.fire(s,{viewElement:e,modelAttributes:i[r].modelAttributes,modelReferenceElement:i[r].modelElement}))break;if(n&&(r--,r<0))return!1}return!0}}function F_(e,t,i,{dataPipeline:o}={}){const n=function(e,t){const i=t.filter((e=>!1===e.consume)).map((e=>e.attributeName));return(t,o)=>{const n=[];for(const o of e)t.hasAttribute(o)&&!i.includes(o)&&n.push(`attribute:${o}`);return!!n.every((e=>!1!==o.test(t,e)))&&(n.forEach((e=>o.consume(t,e))),!0)}}(e,t);return(s,r,a)=>{const{writer:l,mapper:c,consumable:d}=a,u=r.item;if(!e.includes(r.attributeKey))return;if(!n(u,d))return;const h={...a.options,dataPipeline:o},m=function(e,t,i,o){const n=i.createRangeOn(e),s=t.toViewRange(n).getTrimmed(),r=s.getWalker();for(const{item:e}of r)if(e.is("element")&&e.getCustomProperty("listItemMarker"))r.jumpTo(o.createPositionAfter(e));else if(e.is("element")&&!e.getCustomProperty("listItemWrapper"))return e}(u,c,i,l);N_(m,l,c),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const o=i.parent;t.unwrap(t.createRangeOn(e),i),i=o}}(m,l);const g=function(e,t,i,o,{dataPipeline:n}){let s=o.createRangeOn(t);if(!Zy(e))return s;for(const r of i){if("itemMarker"!=r.scope)continue;const i=r.createElement(o,e,{dataPipeline:n});if(!i)continue;if(o.setCustomProperty("listItemMarker",!0,i),r.canInjectMarkerIntoElement&&r.canInjectMarkerIntoElement(e)?o.insert(o.createPositionAt(t,0),i):(o.insert(s.start,i),s=o.createRange(o.createPositionBefore(i),o.createPositionAfter(t))),!r.createWrapperElement||!r.canWrapElement)continue;const a=r.createWrapperElement(o,e,{dataPipeline:n});o.setCustomProperty("listItemWrapper",!0,a),r.canWrapElement(e)?s=o.wrap(s,a):(s=o.wrap(o.createRangeOn(i),a),s=o.createRange(s.start,o.createPositionAfter(t)))}return s}(u,m,t,l,h);!function(e,t,i,o,n){if(!e.hasAttribute("listIndent"))return;const s=e.getAttribute("listIndent");let r=e;for(let e=s;e>=0;e--){const s=S_(o,e,r.getAttribute("listItemId")),a=P_(o,e,r.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!r.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(o,r.getAttribute(e.attributeName),"list"==e.scope?a:s,n,r);if(t=o.wrap(t,s),t=o.wrap(t,a),0==e)break;if(r=$y.first(r,{lowerIndent:!0}),!r)break}}(u,g,t,l,h)}}function M_(e,{dataPipeline:t}={}){return(i,{writer:o})=>{if(!B_(i,e))return null;if(!t)return o.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function N_(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const o=[];n(t.createPositionBefore(e).getWalker({direction:"backward"})),n(t.createRangeIn(e).getWalker());for(const e of o)t.remove(e);function n(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&o.push(t)}}}function B_(e,t,i=Ky(e)){if(!Uy(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!t.includes(i))return!1;return i.length<2}const L_=["listType","listIndent","listItemId"];class z_ extends fc{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Kg,Tg,x_,bf,__]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new fe("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:L_}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of L_)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new h_(e,"numbered")),e.commands.add("bulletedList",new h_(e,"bulleted")),e.commands.add("customNumberedList",new h_(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new h_(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new d_(e,"forward")),e.commands.add("outdentList",new d_(e,"backward")),e.commands.add("splitListItemBefore",new g_(e,"before")),e.commands.add("splitListItemAfter",new g_(e,"after")),i&&(e.commands.add("mergeListItemBackward",new m_(e,"backward")),e.commands.add("mergeListItemForward",new m_(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...L_,...this._downcastStrategies.map((e=>e.attributeName))]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",((o,n)=>{const s=e.model.document.selection;r_(e.model)||e.model.change((()=>{const r=s.getFirstPosition();if(s.isCollapsed&&"backward"==n.direction){if(!r.isAtStart)return;const i=r.parent;if(!Uy(i))return;if($y.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:j_(e.model,"backward")})}else Qy(i)||e.execute("splitListItemAfter"),e.execute("outdentList");n.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:j_(e.model,"forward")}),n.preventDefault(),o.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,o=i.get("enter");this.listenTo(e.editing.view.document,"enter",((i,o)=>{const n=t.document,s=n.selection.getFirstPosition().parent;if(n.selection.isCollapsed&&Uy(s)&&s.isEmpty&&!o.isSoft){const t=Zy(s),n=Qy(s);t&&n?(e.execute("outdentList"),o.preventDefault(),i.stop()):t&&!n?(e.execute("splitListItemAfter"),o.preventDefault(),i.stop()):n&&(e.execute("splitListItemBefore"),o.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(o,"afterExecute",(()=>{const t=i.get("splitListItemBefore");if(t.refresh(),!t.isEnabled)return;2===Ky(e.model.document.selection.getLastPosition().parent).length&&t.execute()}))}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",((t,i)=>{const o=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),n=o?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(n,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(n,{listType:""}):null,converterPriority:"high"}).add((e=>{e.on("element:li",V_())})),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:n,view:M_(i),converterPriority:"high"}).add((e=>{var o;e.on("attribute",F_(i,this._downcastStrategies,t)),e.on("remove",(o=t.schema,(e,t,i)=>{const{writer:n,mapper:s}=i,r=e.name.split(":")[1];if(!o.checkAttribute(r,"listItemId"))return;const a=s.toViewPosition(t.position),l=t.position.getShiftedBy(t.length),c=s.toViewPosition(l,{isPhantom:!0}),d=n.createRange(a,c).getTrimmed().end.nodeBefore;d&&N_(d,n,s)}))})),e.conversion.for("dataDowncast").elementToElement({model:n,view:M_(i,{dataPipeline:!0}),converterPriority:"high"}).add((e=>{e.on("attribute",F_(i,this._downcastStrategies,t,{dataPipeline:!0}))}));const s=(r=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!Uy(i))return;if(!r.some((e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i))))return;const o=t.mapper.toViewElement(i),n=a.createRangeIn(o),s=n.getWalker();let l=n.start;for(const{item:e}of s){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(e),s.skip((({previousPosition:e})=>!e.isEqual(l))))}t.viewPosition=l});var r,a;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",D_(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())})),this.on("checkAttributes:list",((e,{viewElement:t,modelAttributes:i})=>{t.name==I_(i.listType)&&t.id==R_(i.listType,i.listIndent)||(e.return=!0,e.stop())}))}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer((i=>function(e,t,i,o){const n=e.document.differ.getChanges(),s=new Set,r=new Set,a=o.editor.config.get("list.multiBlock");let l=!1;for(const o of n){if("insert"==o.type&&"$text"!=o.name){const n=o.position.nodeAfter;if(!e.schema.checkAttribute(n,"listItemId"))for(const e of Array.from(n.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,n),l=!0);O_(o.position,r,s),o.attributes.has("listItemId")||O_(o.position.getShiftedBy(o.length),r,s);for(const{item:t,previousPosition:i}of e.createRangeIn(n))Uy(t)&&O_(i,r,s)}else"remove"==o.type?O_(o.position,r,s):"attribute"==o.type&&i.includes(o.attributeKey)&&(O_(o.range.start,r,s),null===o.attributeNewValue&&O_(o.range.start.getShiftedBy(1),r,s));if(!a&&"attribute"==o.type&&L_.includes(o.attributeKey)){const e=o.range.start.nodeAfter;null===o.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),l=!0):null===o.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),l=!0)}}const c=new Set;for(const e of r.values())l=o.fire("postFixer",{listNodes:new Hy(e),listHead:e,writer:t,seenIds:c})||l;return l}(e,i,t,this))),this.on("postFixer",((e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,o=-1,n=null,s=!1;for(const{node:r}of e){const e=r.getAttribute("listIndent");if(e>i){let a;null===n?(n=e-i,a=i):(n>e&&(n=e),a=e-n),a>o+1&&(a=o+1),t.setAttribute("listIndent",a,r),s=!0,o=a}else n=null,i=e+1,o=e}return s}(t,i)||e.return}),{priority:"high"}),this.on("postFixer",((e,{listNodes:t,writer:i,seenIds:o})=>{e.return=function(e,t,i){const o=new Set;let n=!1;for(const{node:s}of e){if(o.has(s))continue;let e=s.getAttribute("listType"),r=s.getAttribute("listItemId");if(t.has(r)&&(r=Wy.next()),t.add(r),s.is("element","listItem"))s.getAttribute("listItemId")!=r&&(i.setAttribute("listItemId",r,s),n=!0);else for(const t of Gy(s,{direction:"forward"}))o.add(t),t.getAttribute("listType")!=e&&(r=Wy.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=r&&(i.setAttribute("listItemId",r,t),n=!0)}return n}(t,o,i)||e.return}),{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,o])=>{const n=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!n.length)return;const s=(o?e.createSelection(o):e.document.selection).getFirstPosition();let r;if(Uy(s.parent))r=s.parent;else{if(!Uy(s.nodeBefore)||!Uy(s.nodeAfter))return;r=s.nodeBefore}e.change((e=>{const t=r.getAttribute("listType"),i=r.getAttribute("listIndent"),o=n[0].getAttribute("listIndent")||0,s=Math.max(i-o,0);for(const i of n){const o=Uy(i);r.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(o?i.getAttribute("listIndent"):0)+s,listItemId:o?i.getAttribute("listItemId"):Wy.next(),listType:t},i)}}))}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",((t,i)=>{e.change((e=>{const t=Array.from(i.content.getChildren()),o=t[t.length-1];if(t.length>1&&o.is("element")&&o.isEmpty){t.slice(0,-1).every(Uy)&&e.remove(o)}if("copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());n_(t)&&o_(t,e,this.getListAttributeNames())}}))}))}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,o){o&&(o.skipListItemIds||o.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}}function j_(e,t){const i=e.document.selection;if(!i.isCollapsed)return!r_(e);if("forward"===t)return!0;const o=i.getFirstPosition().parent,n=o.previousSibling;return!e.schema.isObject(n)&&(!!n.isEmpty||n_([o,n]))}function $_(e,t,i,o){e.ui.componentFactory.add(t,(()=>{const n=q_(Lu,e,t,i,o);return n.set({tooltip:!0,isToggleable:!0}),n})),e.ui.componentFactory.add(`menuBar:${t}`,(()=>{const n=q_(sh,e,t,i,o);return n.set({role:"menuitemcheckbox",isToggleable:!0}),n}))}function q_(e,t,i,o,n){const s=t.commands.get(i),r=new e(t.locale);return r.set({label:o,icon:n}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),r}class H_ extends fc{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||$_(this.editor,"numberedList",e("Numbered List"),''),this.editor.ui.componentFactory.has("bulletedList")||$_(this.editor,"bulletedList",e("Bulleted List"),'')}}const W_={},U_={},K_={},G_=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(const{listStyle:e,typeAttribute:t,listType:i}of G_)W_[e]=i,U_[e]=t,t&&(K_[t]=e);class J_ extends wc{constructor(e){super(e),this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){const e=this._getSelectedItems();this.value=this._getValue(e),this.isEnabled=!!e.length}execute(e={}){this.editor.model.change((t=>{const i=this._getSelectedItems(),o=void 0===e.forceValue?!this._getValue(i):e.forceValue;for(const e of i)o?t.setAttribute("todoListChecked",!0,e):t.removeAttribute("todoListChecked",e)}))}_getValue(e){return e.every((e=>e.getAttribute("todoListChecked")))}_getSelectedItems(){const e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),o=i.start.parent,n=[];t.checkAttribute(o,"todoListChecked")&&n.push(...Ky(o));for(const e of i.getItems({shallow:!0}))t.checkAttribute(e,"todoListChecked")&&!n.includes(e)&&n.push(...Ky(e));return n}}class Z_ extends jn{domEventType=["change"];onDomEvent(e){if(e.target){const t=this.view.domConverter.mapDomToView(e.target);t&&t.is("element","input")&&"checkbox"==t.getAttribute("type")&&t.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",e)}}}const Q_=Wt("Ctrl+Enter");class Y_ extends fc{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.model,i=e.editing,o=e.plugins.get(z_),n=e.config.get("list.multiBlock")?"paragraph":"listItem";e.commands.add("todoList",new h_(e,"todo")),e.commands.add("checkTodoList",new J_(e)),i.view.addObserver(Z_),t.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),t.schema.addAttributeCheck((e=>{const t=e.last;if(!t.getAttribute("listItemId")||"todo"!=t.getAttribute("listType"))return!1}),"todoListChecked"),e.conversion.for("upcast").add((e=>{e.on("element:input",((e,t,i)=>{const o=t.modelCursor,n=o.parent,s=t.viewItem;if(!i.consumable.test(s,{name:!0}))return;if("checkbox"!=s.getAttribute("type")||!o.isAtStart||!n.hasAttribute("listType"))return;i.consumable.consume(s,{name:!0});const r=i.writer;r.setAttribute("listType","todo",n),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,n),t.modelRange=r.createRange(o)})),e.on("element:li",((e,t,i)=>{const{writer:o,schema:n}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>"todo"===e.getAttribute("listType")&&n.checkAttribute(e,"listItemId"))).reduce(((e,t)=>{const i=t.getAttribute("listItemId");return e.has(i)||e.set(i,Ky(t)),e}),new Map);for(const[,e]of s.entries())if(e.some((e=>e.getAttribute("todoListChecked"))))for(const t of e)o.setAttribute("todoListChecked",!0,t)}),{priority:"low"}),e.on("element:label",X_({name:"label",classes:"todo-list__label"})),e.on("element:label",X_({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),e.on("element:span",X_({name:"span",classes:"todo-list__label__description"})),e.on("element:ul",function(e){const t=new uo(e);return(e,i,o)=>{const n=t.match(i.viewItem);if(!n)return;const s=n.match;s.name=!1,o.consumable.consume(i.viewItem,s)}}({name:"ul",classes:"todo-list"}))})),e.conversion.for("downcast").elementToElement({model:n,view:(e,{writer:t})=>{if(ek(e,o.getListAttributeNames()))return t.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),o.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(e,t,i){"todo"==t?e.addClass("todo-list",i):e.removeClass("todo-list",i)}}),o.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(e,t,{dataPipeline:i}){if("todo"!=t.getAttribute("listType"))return null;const o=e.createUIElement("input",{type:"checkbox",...t.getAttribute("todoListChecked")?{checked:"checked"}:null,...i?{disabled:"disabled"}:{tabindex:"-1"}});if(i)return o;const n=e.createContainerElement("span",{contenteditable:"false"},o);return n.getFillerOffset=()=>null,n},canWrapElement:e=>ek(e,o.getListAttributeNames()),createWrapperElement(e,t,{dataPipeline:i}){const n=["todo-list__label"];return ek(t,o.getListAttributeNames())||n.push("todo-list__label_without-description"),e.createAttributeElement(i?"label":"span",{class:n.join(" ")})}}),o.on("checkElement",((e,{modelElement:t,viewElement:i})=>{const n=ek(t,o.getListAttributeNames());i.hasClass("todo-list__label__description")!=n&&(e.return=!0,e.stop())})),o.on("checkElement",((t,{modelElement:i,viewElement:o})=>{const n="todo"==i.getAttribute("listType")&&Zy(i);let s=!1;const r=e.editing.view.createPositionBefore(o).getWalker({direction:"backward"});for(const{item:t}of r){if(t.is("element")&&e.editing.mapper.toModelElement(t))break;t.is("element","input")&&"checkbox"==t.getAttribute("type")&&(s=!0)}s!=n&&(t.return=!0,t.stop())})),o.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:o,previousNodeInList:n}of t){if(!n)continue;if(n.getAttribute("listItemId")!=o.getAttribute("listItemId"))continue;const t=n.hasAttribute("todoListChecked"),s=o.hasAttribute("todoListChecked");s&&!t?(i.removeAttribute("todoListChecked",o),e.return=!0):!s&&t&&(i.setAttribute("todoListChecked",!0,o),e.return=!0)}})),t.document.registerPostFixer((e=>{const i=t.document.differ.getChanges();let o=!1;for(const t of i)if("attribute"==t.type&&"listType"==t.attributeKey){const i=t.range.start.nodeAfter;"todo"==t.attributeOldValue&&i.hasAttribute("todoListChecked")&&(e.removeAttribute("todoListChecked",i),o=!0)}else if("insert"==t.type&&"$text"!=t.name)for(const{item:i}of e.createRangeOn(t.position.nodeAfter))i.is("element")&&"todo"!=i.getAttribute("listType")&&i.hasAttribute("todoListChecked")&&(e.removeAttribute("todoListChecked",i),o=!0);return o})),this.listenTo(i.view.document,"keydown",((t,i)=>{Ht(i)===Q_&&(e.execute("checkTodoList"),t.stop())}),{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",((e,t)=>{const o=t.target;if(!o||!o.is("element","input"))return;const n=i.view.createPositionAfter(o),s=i.mapper.toModelPosition(n).parent;s&&Uy(s)&&"todo"==s.getAttribute("listType")&&this._handleCheckmarkChange(s)})),this.listenTo(i.view.document,"arrowKey",function(e,t){return(i,o)=>{const n=Kt(o.keyCode,t.contentLanguageDirection),s=e.schema,r=e.document.selection;if(!r.isCollapsed)return;const a=r.getFirstPosition(),l=a.parent;if("right"==n&&a.isAtEnd){const t=s.getNearestSelectionRange(e.createPositionAfter(l),"forward");if(!t)return;const n=t.start.parent;n&&Uy(n)&&"todo"==n.getAttribute("listType")&&(e.change((e=>e.setSelection(t))),o.preventDefault(),o.stopPropagation(),i.stop())}else if("left"==n&&a.isAtStart&&Uy(l)&&"todo"==l.getAttribute("listType")){const t=s.getNearestSelectionRange(e.createPositionBefore(l),"backward");if(!t)return;e.change((e=>e.setSelection(t))),o.preventDefault(),o.stopPropagation(),i.stop()}}}(t,e.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",((e,i)=>{const o=i.viewPosition.parent,n=o.is("attributeElement","li")&&0==i.viewPosition.offset,s=tk(o)&&i.viewPosition.offset<=1,r=o.is("element","span")&&"false"==o.getAttribute("contenteditable")&&tk(o.parent);if(!n&&!s&&!r)return;const a=i.modelPosition.nodeAfter;a&&"todo"==a.getAttribute("listType")&&(i.modelPosition=t.createPositionAt(a,0))}),{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){const t=this.editor,i=t.model,o=Array.from(i.document.selection.getRanges());i.change((i=>{i.setSelection(e,"end"),t.execute("checkTodoList"),i.setSelection(o)}))}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor;let o=null;t&&e.document.selection.on("change:range",(()=>{const n=e.document.selection.focus.parent,s=ik(o),r=ik(n);s&&!r?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!s&&r&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),o=n}))}}function X_(e){const t=new uo(e);return(e,i,o)=>{const n=t.match(i.viewItem);n&&o.consumable.consume(i.viewItem,n.match)&&Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))}}function ek(e,t){return(e.is("element","paragraph")||e.is("element","listItem"))&&"todo"==e.getAttribute("listType")&&Zy(e)&&function(e,t){for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return!0}(e,t)}function tk(e){return!!e&&e.is("attributeElement")&&e.hasClass("todo-list__label")}function ik(e){return!!e&&(!(!e.is("element","paragraph")&&!e.is("element","listItem"))&&"todo"==e.getAttribute("listType"))}class ok extends fc{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;$_(this.editor,"todoList",e("To-do List"),'')}}const nk=Symbol("isOPCodeBlock");function sk(e){return!!e.getCustomProperty(nk)&&op(e)}function rk(e){const t=e.getSelectedElement();return!(!t||!sk(t))}function ak(e,t,i){const o=t.createContainerElement("pre",{title:window.I18n.t("js.editor.macro.toolbar_help")});return lk(t,e,o),function(e,t,i){return t.setCustomProperty(nk,!0,e),np(e,t,{label:i})}(o,t,i)}function lk(e,t,i){const o=(t.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),n=e.createContainerElement("div",{class:"op-uc-code-block--language"});ck(e,o,n,"text"),e.insert(e.createPositionAt(i,0),n);ck(e,t.getAttribute("opCodeblockContent"),i,"(empty)")}function ck(e,t,i,o){const n=e.createText(t||o);e.insert(e.createPositionAt(i,0),n)}class dk extends jn{constructor(e){super(e),this.domEventType="dblclick"}onDomEvent(e){this.fire(e.type,e)}}class uk extends fc{static get pluginName(){return"CodeBlockEditing"}init(){const e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=Mp(e);var r,a;t.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),i.for("upcast").add(function(){return t=>{t.on("element:pre",e,{priority:"high"})};function e(e,t,i){if(!i.consumable.test(t.viewItem,{name:!0}))return;const o=Array.from(t.viewItem.getChildren()).find((e=>e.is("element","code")));if(!o||!i.consumable.consume(o,{name:!0}))return;const n=i.writer.createElement("codeblock");i.writer.setAttribute("opCodeblockLanguage",o.getAttribute("class"),n);const s=i.splitToAllowedParent(n,t.modelCursor);if(s){i.writer.insert(n,s.position);const e=o.getChild(0);if(e){i.consumable.consume(e,{name:!0});const t=e.data.replace(/\n$/,"");i.writer.setAttribute("opCodeblockContent",t,n)}t.modelRange=i.writer.createRange(i.writer.createPositionBefore(n),i.writer.createPositionAfter(n)),t.modelCursor=t.modelRange.end}}}()),i.for("editingDowncast").elementToElement({model:"codeblock",view:(e,{writer:t})=>ak(e,t,"Code block")}).add(function(){return t=>{t.on("attribute:opCodeblockContent",e),t.on("attribute:opCodeblockLanguage",e)};function e(e,t,i){const o=t.item;i.consumable.consume(t.item,e.name);const n=i.mapper.toViewElement(o);i.writer.remove(i.writer.createRangeOn(n.getChild(1))),i.writer.remove(i.writer.createRangeOn(n.getChild(0))),lk(i.writer,o,n)}}()),i.for("dataDowncast").add(function(){return t=>{t.on("insert:codeblock",e,{priority:"high"})};function e(e,t,i){const o=t.item,n=o.getAttribute("opCodeblockLanguage")||"language-text",s=o.getAttribute("opCodeblockContent");i.consumable.consume(o,"insert");const r=i.writer,a=r.createContainerElement("pre"),l=r.createContainerElement("div",{class:"op-uc-code-block--language"}),c=r.createContainerElement("code",{class:n}),d=r.createText(n),u=r.createText(s);r.insert(r.createPositionAt(c,0),u),r.insert(r.createPositionAt(l,0),d),r.insert(r.createPositionAt(a,0),l),r.insert(r.createPositionAt(a,0),c),i.mapper.bindElements(o,c),i.mapper.bindElements(o,a),i.mapper.bindElements(o,l);const h=i.mapper.toViewPosition(t.range.start);r.insert(h,a),e.stop()}}()),this.editor.editing.mapper.on("viewToModelPosition",(r=this.editor.model,a=e=>e.hasClass("op-uc-code-block"),(e,t)=>{const{mapper:i,viewPosition:o}=t,n=i.findMappedViewAncestor(o);if(!a(n))return;const s=i.toModelElement(n);t.modelPosition=r.createPositionAt(s,o.isAtStart?"before":"after")})),o.addObserver(dk),this.listenTo(n,"dblclick",((t,i)=>{let o=i.target,n=i.domEvent;if(n.shiftKey||n.altKey||n.metaKey)return;if(!sk(o)&&(o=o.findAncestor(sk),!o))return;i.preventDefault(),i.stopPropagation();const r=e.editing.mapper.toModelElement(o),a=s.services.macros,l=r.getAttribute("opCodeblockLanguage"),c=r.getAttribute("opCodeblockContent");a.editCodeBlock(c,l).then((t=>e.model.change((e=>{e.setAttribute("opCodeblockLanguage",t.languageClass,r),e.setAttribute("opCodeblockContent",t.content,r)}))))})),e.ui.componentFactory.add("insertCodeBlock",(t=>{const i=new Lu(t);return i.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n\n',tooltip:!0}),i.on("execute",(()=>{s.services.macros.editCodeBlock().then((t=>e.model.change((i=>{const o=i.createElement("codeblock");i.setAttribute("opCodeblockLanguage",t.languageClass,o),i.setAttribute("opCodeblockContent",t.content,o),e.model.insertContent(o,e.model.document.selection)}))))})),i}))}}class hk extends fc{static get requires(){return[Qm]}static get pluginName(){return"CodeBlockToolbar"}init(){const e=this.editor,t=this.editor.model,i=Mp(e);jp(e,"opEditCodeBlock",(e=>{const o=i.services.macros,n=e.getAttribute("opCodeblockLanguage"),s=e.getAttribute("opCodeblockContent");o.editCodeBlock(s,n).then((i=>t.change((t=>{t.setAttribute("opCodeblockLanguage",i.languageClass,e),t.setAttribute("opCodeblockContent",i.content,e)}))))}))}afterInit(){qp(this,this.editor,"OPCodeBlock",rk)}}function mk(e){return e.__currentlyDisabled=e.__currentlyDisabled||[],e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]}function gk(e,t){mk(e).forEach((i=>{let o=i;i instanceof bh?o=i.buttonView:i!==t&&Object.prototype.hasOwnProperty.call(i,"isEnabled")||(o=null),o&&(o.isEnabled?o.isEnabled=!1:e.__currentlyDisabled.push(o))}))}function pk(e){mk(e).forEach((t=>{let i=t;t instanceof bh&&(i=t.buttonView),e.__currentlyDisabled.indexOf(i)<0&&(i.isEnabled=!0)})),e.__currentlyDisabled=[]}class fk{constructor(e){this.response=e}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return 401===this.statusCode}get unprocessableEntity(){return 422===this.statusCode}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(!this.isTurboStream)return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`));window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js")}async activeScript(){if(!this.isScript)return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`));{const e=document.createElement("script"),t=document.querySelector("meta[name=csp-nonce]");if(t){const i=""===t.nonce?t.content:t.nonce;i&&e.setAttribute("nonce",i)}e.innerHTML=await this.text,document.body.appendChild(e)}}}class bk{static register(e){this.interceptor=e}static get(){return this.interceptor}static reset(){this.interceptor=void 0}}function wk(e){const t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.content}class yk{constructor(e,t,i={}){this.method=e,this.options=i,this.originalUrl=t.toString()}async perform(){try{const e=bk.get();e&&await e(this)}catch(e){console.error(e)}const e=window.Turbo?window.Turbo.fetch:window.fetch,t=new fk(await e(this.url,this.fetchOptions));if(t.unauthenticated&&t.authenticationURL)return Promise.reject(window.location.href=t.authenticationURL);t.isScript&&await t.activeScript();return(t.ok||t.unprocessableEntity)&&t.isTurboStream&&await t.renderTurboStream(),t}addHeader(e,t){const i=this.additionalHeaders;i[e]=t,this.options.headers=i}sameHostname(){if(!this.originalUrl.startsWith("http:")&&!this.originalUrl.startsWith("https:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch(e){return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect,keepalive:this.keepalive}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(e["X-CSRF-Token"]=this.csrfToken),function(e){const t={};for(const i in e){const o=e[i];void 0!==o&&(t[i]=o)}return t}(Object.assign(e,this.additionalHeaders))}get csrfToken(){return function(e){const t=document.cookie?document.cookie.split("; "):[],i=`${encodeURIComponent(e)}=`,o=t.find((e=>e.startsWith(i)));if(o){const e=o.split("=").slice(1).join("=");if(e)return decodeURIComponent(e)}}(wk("csrf-param"))||wk("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:null==this.body||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){const e=(this.originalUrl.split("?")[1]||"").split("#")[0],t=new URLSearchParams(e);let i=this.options.query;var o;i instanceof window.FormData?(o=i,i=[...o].reduce(((e,[t,i])=>e.concat("string"==typeof i?[[t,i]]:[])),[])):i=i instanceof window.URLSearchParams?i.entries():Object.entries(i||{}),function(e,t){for(const[i,o]of t)o instanceof window.File||(e.has(i)&&!i.includes("[]")?(e.delete(i),e.set(i,o)):e.append(i,o))}(t,i);const n=t.toString();return n.length>0?`?${n}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get keepalive(){return this.options.keepalive||!1}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){const e="[object String]"===Object.prototype.toString.call(this.body);return"application/json"===this.headers["Content-Type"]&&!e?JSON.stringify(this.body):this.body}}async function _k(e,t){return new yk("get",e,t).perform()}function kk(e,t){const{modelAttribute:i,styleName:o,attributeName:n,attributeType:s,viewElement:r,defaultValue:a,shouldUpcast:l=()=>!0,reduceBoxSides:c=!1}=t;e.for("upcast").attributeToAttribute({view:{name:r,styles:{[o]:/[\s\S]+/}},model:{key:i,value:(e,t,i)=>{if(!l(e))return;const n=xk(a,"",i),s=e.getNormalizedStyle(o),r=c?Ek(s):s;if(n!==r)return r;t.consumable.consume(e,{styles:o})}}}),n&&e.for("upcast").attributeToAttribute({view:{name:r,attributes:{[n]:/.+/}},model:{key:i,value:(e,t,i)=>{if("figure"==e.name||e.hasStyle(o)||"table"==e.name&&"figure"==e.parent.name&&e.parent.hasStyle(o))return;const r=xk(a,"",i);let l=e.getAttribute(n);if(l&&"length"==s){const e=parseFloat(l);l=isNaN(e)?r:e+(l.includes("%")?"%":"px")}if(r!==l)return l;t.consumable.consume(e,{attributes:n})}}})}function vk(e,t,i,o){const{conversion:n}=e;n.for("upcast").add((e=>{e.on(`element:${t}`,((e,t,n)=>{const{modelRange:s,viewItem:r}=t;if(!s)return;const a=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter((e=>r.hasStyle(e))),l=r.is("element","table")?r:r.findAncestor("table"),c=l.hasAttribute("border");if(!a.length&&!c)return;const d={styles:a};if(!n.consumable.test(r,d))return;const u=ti(s.getItems({shallow:!0})),h=u.findAncestor("table",{includeSelf:!0});let m=o;h&&"layout"==h.getAttribute("tableType")&&(m={style:"none",color:"",width:""}),n.consumable.consume(r,d);const g={style:r.getNormalizedStyle("border-style"),color:r.getNormalizedStyle("border-color"),width:r.getNormalizedStyle("border-width")};if(c&&n.consumable.test(l,{attributes:"border"})){const e=parseFloat(l.getAttribute("border")||"1"),t=Number.isNaN(e)||!Number.isFinite(e)||e<0||"table"!=r.name&&e>1?"1px":`${e}px`;g.width={top:t,bottom:t,right:t,left:t,...g.width||{}},r.is("element","table")&&n.consumable.consume(l,{attributes:"border"})}const p={style:Ek(g.style),color:Ek(g.color),width:Ek(g.width)};p.style!==m.style&&n.writer.setAttribute(i.style,p.style,u),p.color!==m.color&&n.writer.setAttribute(i.color,p.color,u),p.width!==m.width&&n.writer.setAttribute(i.width,p.width,u)}))}))}function Ck(e,t){const{modelElement:i,modelAttribute:o,styleName:n}=t;e.for("downcast").attributeToAttribute({model:{name:i,key:o},view:e=>({key:"style",value:{[n]:e}})})}function Ak(e,t){const{modelAttribute:i,styleName:o}=t;e.for("downcast").add((e=>{e.on(`attribute:${i}:table`,((e,t,i)=>{const{item:n,attributeNewValue:s}=t,{mapper:r,writer:a}=i;if(!i.consumable.consume(t.item,e.name))return;const l=Array.from(r.toViewElement(n).getChildren()).find((e=>e.is("element","table")));s?a.setStyle(o,s,l):a.removeStyle(o,l)}))}))}function xk(e,t,i){const o=i.modelRange&&ti(i.modelRange.getItems({shallow:!0})),n=o&&o.is("element")&&o.findAncestor("table",{includeSelf:!0});return n&&"layout"===n.getAttribute("tableType")?t:e}function Ek(e){if(!e)return;const t=["top","right","bottom","left"];if(!t.every((t=>e[t])))return e;const i=e.top;return t.every((t=>e[t]===i))?i:e}function Tk(e,t,i){const{conversion:o}=e;o.for("upcast").add((e=>{e.on(`element:${t}`,((e,t,o)=>{const{modelRange:n,viewItem:s}=t;if(!n)return;if(s.is("element","table"))return void o.consumable.consume(s,{attributes:"cellpadding"});const r=s.findAncestor("table");if(!r.hasAttribute("cellpadding")||!o.consumable.test(r,{attributes:"cellpadding"}))return;const a=n?.start?.nodeAfter,l=parseFloat(r.getAttribute("cellpadding")||"1"),c=Number.isNaN(l)||!Number.isFinite(l)||l<0?"0px":`${l}px`,d=a.getAttribute("tableCellPadding");if(d){if("object"==typeof d){const e={...i!==c&&{top:c},...i!==c&&{right:c},...i!==c&&{bottom:c},...i!==c&&{left:c},...d};o.writer.setAttribute("tableCellPadding",e,a)}}else i!==c&&o.writer.setAttribute("tableCellPadding",c,a)}),{priority:"low"})}))}const Pk={className:"table-style-align-left"},Sk={className:"table-style-align-center"},Ik={className:"table-style-align-right"},Rk={className:"table-style-block-align-left"},Ok={className:"table-style-block-align-right"},Vk=[{view:{name:/^(table|figure)$/,styles:{float:/^(left|none|right)$/}},getAlign:e=>{let t=e.getStyle("float");return"none"===t&&(t="center"),t},getConsumables(e){const t=e.getStyle("float"),i=["float"];return"left"===t&&e.hasStyle("margin-right")?i.push("margin-right"):"right"===t&&e.hasStyle("margin-left")&&i.push("margin-left"),{styles:i}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"auto"}},getAlign:()=>"center",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,key:"class",value:"table-style-align-left"},getAlign:()=>"left",getConsumables:()=>({classes:Pk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Ik.className},getAlign:()=>"right",getConsumables:()=>({classes:Ik.className})},{view:{name:/^(table|figure)$/,key:"class",value:Sk.className},getAlign:()=>"center",getConsumables:()=>({classes:Sk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Rk.className},getAlign:()=>"blockLeft",getConsumables:()=>({classes:Rk.className})},{view:{name:/^(table|figure)$/,key:"class",value:Ok.className},getAlign:()=>"blockRight",getConsumables:()=>({classes:Ok.className})},{view:{name:/^(table|figure)$/,styles:{"margin-left":"0","margin-right":"auto"}},getAlign:()=>"blockLeft",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"0"}},getAlign:()=>"blockRight",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:"table",attributes:{align:/^(left|center|right)$/}},getAlign:e=>e.getAttribute("align"),getConsumables:()=>({attributes:"align"})}],Dk={center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:Rk.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:Ok.className}};class Fk{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const o=parseInt(i.getAttribute("colspan")||"1"),n=parseInt(i.getAttribute("rowspan")||"1");(o>1||n>1)&&this._recordSpans(i,n,o),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new Mk(this,e,t,i)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||i||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class Mk{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Nk(e){return"header"===e||"header-row"===e||"header-column"===e}function Bk(e,t,i,o,n=1){null!=t&&null!=n&&t>n?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Lk(e,t,i={}){const o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function zk(e,t){const i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&n0){Bk("headingRows",s-i,e,n,0)}const r=parseInt(t.getAttribute("headingColumns")||"0");if(r>0){Bk("headingColumns",r-o,e,n,0)}}(a,e,o,n,i),function(e,t,i,o,n){const s=Array.from(t.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),r=parseInt(t.getAttribute("footerRows")||"0"),a=s-r;if(r<1)return;let l=0;o>=a&&(l=o-Math.max(a,i)+1);Bk("footerRows",l,e,n,0)}(a,e,o,s,i),a}function Uk(e,t,i=0){const o=[],n=new Fk(e,{startRow:i,endRow:t-1});for(const e of n){const{row:i,cellHeight:n}=e;i1&&(a.rowspan=l);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=s+r,u=[...new Fk(n,{startRow:s,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:n,cell:s}=t;s===e&&void 0===h&&(h=n),void 0!==h&&h===n&&o===d&&(m=Lk(i,t.getPositionBefore(),a))}return Bk("rowspan",r,e,i),m}function Gk(e,t){const i=[],o=new Fk(e);for(const e of o){const{column:o,cellWidth:n}=e;o1&&(s.colspan=r);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(s.rowspan=a);const l=Lk(o,o.createPositionAfter(e),s);return Bk("colspan",n,e,o),l}function Zk(e,t,i,o,n,s){const r=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(i+r-1>n){Bk("colspan",n-i+1,e,s,1)}if(t+a-1>o){Bk("rowspan",o-t+1,e,s,1)}}function Qk(e,t){const i=t.getColumns(e),o=new Array(i).fill(0);for(const{column:t}of new Fk(e))o[t]++;const n=o.reduce(((e,t,i)=>t?e:[...e,i]),[]);if(n.length>0){const i=n[n.length-1];return t.removeColumns(e,{at:i}),!0}return!1}function Yk(e,t){const i=[],o=t.getRows(e);for(let t=0;t0){const o=i[i.length-1];return t.removeRows(e,{at:o}),!0}return!1}function Xk(e,t){Qk(e,t)||Yk(e,t)}function ev(e,t){const i=Array.from(new Fk(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=i[0].cellHeight-1;return t.lastRow+o}function tv(e,t){const i=Array.from(new Fk(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=i[0].cellWidth-1;return t.lastColumn+o}function iv(e){for(const t of e.getChildren())if(t.is("element","table"))return t}function ov(e){return t=>{t.on("element:table",((t,i,o)=>{const n=i.viewItem;if(!o.consumable.test(n,{name:!0}))return;const{rows:s,headingRows:r,headingColumns:a,footerRows:l}=function(e){let t,i=!0;const o=[],n=[],s=[];let r=null,a=null;const l=Array.from(e.getChildren());for(let e=0;ee.is("element","tr")));let d=null,u=null;for(const h of c){const m=Array.from(h.getChildren()).filter((e=>e.is("element","td")||e.is("element","th")));if("tfoot"===t.name){a||={element:t,rows:c},i=!1;const o=a.element===t;if(!o&&null===u)for(let t=e;t0&&(null===d||m.length===d)&&m.every((e=>e.is("element","th")))&&i?(o.push(h),i=!0):(n.push(h),i=!1),d=Math.max(d||0,m.length)}}const c=function(e){let t=new Map,i=0;const o=e.map((e=>{const o=[],n=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name)),s=new Map;for(;n.length||o.length0)o.push(e.cell);else{const e=n.shift();if(!e){o.push(null);continue}{const t=parseInt(e.getAttribute("colspan")||"1"),i=parseInt(e.getAttribute("rowspan")||"1");for(let n=0;n1&&s.set(o.length,{cell:e,remaining:i-1}),o.push(e)}}}for(const[e,i]of t.entries())i.remaining-=1,i.remaining>0&&!s.has(e)&&s.set(e,i);return t=s,i=Math.max(i,o.length),o}));for(const e of o)for(;e.lengtho.convertItem(e,o.writer.createPositionAt(d,"end")))),o.convertChildren(n,o.writer.createPositionAt(d,"end")),d.isEmpty){const e=o.writer.createElement("tableRow");o.writer.insert(e,o.writer.createPositionAt(d,"end")),Lk(o.writer,o.writer.createPositionAt(e,"end"))}o.updateConversionResult(d,i)}}))}}function nv(e){return t=>{t.on(`element:${e}`,((e,t,{writer:i})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,n=i.createPositionAt(o,0);if(t.viewItem.isEmpty)return void i.insertElement("paragraph",n);const s=Array.from(o.getChildren());if(s.every((e=>e.is("element","$marker")))){const e=i.createElement("paragraph");i.insert(e,i.createPositionAt(o,0));for(const t of s)i.move(i.createRangeOn(t),i.createPositionAt(e,"end"))}}),{priority:"low"})}}function sv(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}function rv(e){const t=sv(e);return t?Array.from(t.getChildren()):[]}class av extends fc{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,i=t.parent,o=i.getChildIndex(t),n=new Fk(i,{row:o});for(const{cell:t,row:i,column:o}of n)if(t===e)return{row:i,column:o}}createTable(e,t){const i=e.createElement("table");return lv(e,i,0,t.rows||2,t.columns||2),t.footerRows&&this.setFooterRowsCount(e,i,t.footerRows),t.headingRows&&this.setHeadingRowsCount(e,i,t.headingRows),t.headingColumns&&this.setHeadingColumnsCount(e,i,t.headingColumns),i}insertRows(e,t={}){const i=this.editor.model,o=t.at||0,n=t.rows||1,s=void 0!==t.copyStructureFromAbove,r=t.copyStructureFromAbove?o-1:o,a=Hk(this.editor),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=this.getRows(e),d=this.getColumns(e);if(o>c)throw new fe("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change((t=>{let i=e.getAttribute("headingRows")||0,u=e.getAttribute("footerRows")||0;if(i>o&&(i+=n),u&&o>c-u&&(u+=n),s||0!==o&&o!==c){const i=s?Math.max(o,r):o,c=new Fk(e,{endRow:i}),u=new Array(d).fill(1);for(const{row:e,column:i,cellHeight:a,cellWidth:l,cell:d}of c){const c=e+a-1,h=e<=r&&r<=c;e0){const n=Lk(t,c,r>1?{colspan:r}:void 0);a&&hv({table:e,writer:t,cell:n,row:o+i,column:s,scopedHeaders:l})}s+=Math.abs(r)-1}}}else{const i=lv(t,e,o,n,d);if(a)for(let n=0;n{let i=e.getAttribute("headingColumns");on-1)throw new fe("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change((t=>{const i={first:s,last:r},{cellsToMove:o,cellsToTrim:a}=function(e,{first:t,last:i}){const o=new Map,n=[];for(const{row:s,column:r,cellHeight:a,cell:l}of new Fk(e,{endRow:i})){const e=s+a-1;if(s>=t&&s<=i&&e>i){const e=a-(i-s+1);o.set(r,{cell:l,rowspan:e})}if(s=t){let o;o=e>=i?i-t+1:e-t+1,n.push({cell:l,rowspan:a-o})}}return{cellsToMove:o,cellsToTrim:n}}(e,i);if(o.size){!function(e,t,i,o){const n=new Fk(e,{includeAllSlots:!0,row:t}),s=[...n],r=e.getChild(t);let a;for(const{column:e,cell:t,isAnchor:n}of s)if(i.has(e)){const{cell:t,rowspan:n}=i.get(e),s=a?o.createPositionAfter(a):o.createPositionAt(r,0);o.move(o.createRangeOn(t),s),Bk("rowspan",n,t,o),a=t}else n&&(a=t)}(e,r+1,o,t)}for(let i=r;i>=s;i--)t.remove(e.getChild(i));for(const{rowspan:e,cell:i}of a)Bk("rowspan",e,i,t);if(function(e,{first:t,last:i},o){const n=e.getAttribute("headingRows")||0;if(t=r){Bk("footerRows",i>=r?s-(o-i+1):t-1-o,e,n,0)}}(e,n,i,t),Qk(e,this)||Yk(e,this),Hk(this.editor)){let i=e.getAttribute("headingRows")||0;const o=this.getRows(e);for(;i{!function(e,t,i){const o=e.getAttribute("headingColumns")||0;if(o&&t.first=o;n--){for(const{cell:i,column:o,cellWidth:s}of[...new Fk(e)])o<=n&&s>1&&o+s>n?Bk("colspan",s-1,i,t):o===n&&t.remove(i);if(i[n]){const e=0===n?i[1]:i[n-1],o=parseFloat(i[n].getAttribute("columnWidth")),s=parseFloat(e.getAttribute("columnWidth"));t.remove(i[n]),t.setAttribute("columnWidth",o+s+"%",e)}}if(Yk(e,this)||Qk(e,this),Hk(this.editor)){let i=e.getAttribute("headingColumns")||0;const o=this.getColumns(e);for(;i{if(s>1){const{newCellsSpan:o,updatedSpan:r}=dv(s,t);Bk("colspan",r,e,i);const a={};o>1&&(a.colspan=o),n>1&&(a.rowspan=n);cv(s>t?t-1:s-1,i,i.createPositionAfter(e),a)}if(st===e)),c=a.filter((({cell:t,cellWidth:i,column:o})=>t!==e&&o===l||ol));for(const{cell:e,cellWidth:t}of c)i.setAttribute("colspan",t+r,e);const d={};n>1&&(d.rowspan=n),cv(r,i,i.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>l&&Bk("headingColumns",u+r,o,i)}}))}splitCellHorizontally(e,t=2){const i=this.editor.model,o=e.parent,n=o.parent,s=n.getChildIndex(o),r=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change((i=>{if(r>1){const o=[...new Fk(n,{startRow:s,endRow:s+r-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=dv(r,t);Bk("rowspan",c,e,i);const{column:d}=o.find((({cell:t})=>t===e)),u={};l>1&&(u.rowspan=l),a>1&&(u.colspan=a);let h=0;for(const e of o){const{column:t,row:o}=e,n=t===d;h>=l&&n&&(h=0),o>=s+c&&n&&(h||cv(1,i,e.getPositionBefore(),u),h++)}}if(rs){const e=n+o;i.setAttribute("rowspan",e,t)}const d={};a>1&&(d.colspan=a),lv(i,n,s+1,o,1,d);const u=n.getAttribute("headingRows")||0;u>s&&Bk("headingRows",u+o,n,i);const h=n.getAttribute("footerRows")||0;l-h<=s&&Bk("footerRows",h+o,n,i)}}))}getColumns(e){return[...e.getChild(0).getChildren()].filter((e=>e.is("element","tableCell"))).reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new Fk(e,t)}getSelectedTableCells(e){const t=[];for(const i of this.sortRanges(e.getRanges())){const e=i.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}setFooterRowsCount(e,t,i){if(!this.editor.config.get("table.enableFooters"))return;const o=t.getAttribute("headingRows")||0,n=this.getRows(t),s=Math.min(i,n);if(Bk("footerRows",s,t,e,0),o+s>n){const i=n-s;this.setHeadingRowsCount(e,t,i)}}setHeadingRowsCount(e,t,i,o={}){const{updateCellType:n=!0,resetFormerHeadingCells:s=!0,autoExpand:r=!0}=o,a=this.getRows(t),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=t.getAttribute("headingRows")||0;let d=Math.min(i,a);if(d===c)return;Bk("headingRows",d,t,e,0);if(d+(t.getAttribute("footerRows")||0)>a){const i=a-d;this.setFooterRowsCount(e,t,i)}if(Hk(this.editor)){if(n){for(const{cell:i,row:o,column:n}of new Fk(t,{endRow:d-1}))hv({table:t,writer:e,cell:i,row:o,column:n,scopedHeaders:l});if(s&&dc){for(;dl){for(;de.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),i=[...new Fk(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,i=new Set;let o=0;for(const n of e){const{row:e,column:s}=this.getCellLocation(n),r=parseInt(n.getAttribute("rowspan"))||1,a=parseInt(n.getAttribute("colspan"))||1;t.add(e),i.add(s),r>1&&t.add(e+r-1),a>1&&i.add(s+a-1),o+=r*a}const n=function(e,t){const i=Array.from(e.values()),o=Array.from(t.values()),n=Math.max(...i),s=Math.min(...i),r=Math.max(...o),a=Math.min(...o);return(n-s+1)*(r-a+1)}(t,i);return n==o}sortRanges(e){return Array.from(e).sort(uv)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),i=this.getRows(t),o=this.getRowIndexes(e),n=parseInt(t.getAttribute("headingRows"))||0,s=parseInt(t.getAttribute("footerRows"))||0;if(!this._areIndexesInSameHeadingSection(o,n)||!this._areIndexesInSameFooterSection(o,i,s))return!1;const r=this.getColumnIndexes(e),a=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameHeadingSection(r,a)}_areIndexesInSameHeadingSection({first:e,last:t},i){return e=n===t>=n}}function lv(e,t,i,o,n,s={}){const r=[];for(let a=0;a=r&&o>=a)return void e.removeAttribute("tableCellType",n);let l="header";s&&(l=i{const n=i.getAttribute("headingRows")||0,s=i.getAttribute("footerRows")||0,r=o.createContainerElement("table",null,[]),a=o.createContainerElement("figure",{class:"table"},r),l=e.getRows(i);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=n&&e.index0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("tfoot",null,o.createSlot((e=>e.is("element","tableRow")&&e.index>=l-s))));for(const{positionOffset:e,filter:i}of t.additionalSlots)o.insert(o.createPositionAt(r,e),o.createSlot(i));return o.insert(o.createPositionAt(r,"after"),o.createSlot((e=>!e.is("element","tableRow")&&!t.additionalSlots.some((({filter:t})=>t(e)))))),t.asWidget?function(e,t){return t.setCustomProperty("table",!0,e),np(e,t,{hasSelectionHandle:!0})}(a,o):a}}function yv(e){return(i,{writer:o})=>{if(e.cellTypeEnabled?.()){return t(o,Nk(i.getAttribute("tableCellType"))?"th":"td")}const n=i.parent,s=n.parent,r=s.getChildIndex(n),a=new Fk(s,{row:r}),l=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0;let d=null;for(const e of a)if(e.cell==i){d=t(o,e.row{if(!t.parent.is("element","tableCell"))return null;if(!kv(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function kv(e){return 1==e.parent.childCount&&!function(e){for(const t of e.getAttributeKeys())if(!t.startsWith("selection:")&&"htmlEmptyBlock"!=t)return!0;return!1}(e)}function vv(e){return(t,i)=>{const o=e.plugins.has("PlainTableOutput"),n=i.options.isClipboardPipeline,s=Av(e,t);return o||s||n?function(e,t,i){const o=i.plugins.get(av),n=t.writer,s=o.getRows(e),r=e.getAttribute("headingRows")||0,a=e.getAttribute("footerRows")||0,l=s-a,c=n.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=r&&e.indexe.is("element","tableRow")&&e.index>=l)),h=n.createSlot((e=>!e.is("element","tableRow"))),m=n.createContainerElement("thead",null,c),g=n.createContainerElement("tbody",null,d),p=n.createContainerElement("tfoot",null,u),f=[];r&&f.push(m);r+a{const n=e.plugins.has("PlainTableOutput"),s=o.isClipboardPipeline,r=Av(e,t);return(n||r||s)&&"table"===t.parent.name?i.createContainerElement("caption"):null}}function Av(e,t){const i=e.plugins.has("TableLayoutEditing"),o=e.config.get("table.tableLayout.stripFigureFromContentTable")??!1,n=t.findAncestor("table",{includeSelf:!0}),s=n?.getAttribute("tableType");return i&&(o||"layout"===s)}class xv extends wc{refresh(){const e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=function(e,t){const i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}(t,i)}execute(e={}){const t=this.editor,i=t.model,o=t.plugins.get("TableUtils"),n=!!t.config.get("table.enableFooters"),s=t.config.get("table.defaultHeadings.rows"),r=t.config.get("table.defaultHeadings.columns"),a=t.config.get("table.defaultFooters");void 0===e.headingRows&&s&&(e.headingRows=s),void 0===e.headingColumns&&r&&(e.headingColumns=r),n&&void 0===e.footerRows&&a&&(e.footerRows=a),!n&&"footerRows"in e&&delete e.footerRows,i.change((t=>{const n=o.createTable(t,e);i.insertObject(n,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(n.getNodeByPath([0,0,0]),0))}))}}class Ev extends wc{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="above"===this.order,n=i.getSelectionAffectedTableCells(t),s=i.getRowIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?r:r+1,copyStructureFromAbove:!o})}}class Tv extends wc{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o="left"===this.order,n=i.getSelectionAffectedTableCells(t),s=i.getColumnIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?r:r+1})}}class Pv extends wc{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}class Sv extends wc{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change((e=>{const t="right"==n||"down"==n,s=t?i:o,r=t?o:i,a=r.parent;!function(e,t,i){Iv(e)||(Iv(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end")));i.remove(e)}(r,s,e);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(i.getAttribute(l)||"1"),d=parseInt(o.getAttribute(l)||"1");e.setAttribute(l,c+d,s),e.setSelection(e.createRangeIn(s));const u=this.editor.plugins.get("TableUtils");Xk(a.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;const o=this.isHorizontal?function(e,t,i){const o=e.parent,n=o.parent,s="right"==t?e.nextSibling:e.previousSibling,r=(n.getAttribute("headingColumns")||0)>0;if(!s)return;const a="right"==t?e:s,l="right"==t?s:e,{column:c}=i.getCellLocation(a),{column:d}=i.getCellLocation(l),u=parseInt(a.getAttribute("colspan")||"1"),h=zk(i,a),m=zk(i,l);if(r&&h!=m)return;return c+u===d?s:void 0}(i,this.direction,t):function(e,t,i){const o=e.parent,n=o.parent,s=n.getChildIndex(o),r=i.getRows(n);if("down"==t&&s===r-1||"up"==t&&0===s)return null;const a=parseInt(e.getAttribute("rowspan")||"1"),l=n.getAttribute("headingRows")||0,c=n.getAttribute("footerRows")||0,d=r-c,u="up"==t&&s===d,h="up"==t&&s===l,m="down"==t&&s+a===l,g="down"==t&&s+a===d;if(l&&(m||h))return null;if(c&&(u||g))return null;const p=parseInt(e.getAttribute("rowspan")||"1"),f="down"==t?s+p:s,b=[...new Fk(n,{endRow:f})],w=b.find((t=>t.cell===e)),y=w.column,_=b.find((({row:e,cellHeight:i,column:o})=>o===y&&("down"==t?e===f:f===e+i)));return _&&_.cell?_.cell:null}(i,this.direction,t);if(!o)return;const n=this.isHorizontal?"rowspan":"colspan",s=parseInt(i.getAttribute(n)||"1");return parseInt(o.getAttribute(n)||"1")===s?o:void 0}}function Iv(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class Rv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getRows(o)-1,s=e.getRowIndexes(t),r=0===s.first&&s.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],s=n.findAncestor("table"),r=t.getCellLocation(n).column;e.change((e=>{const i=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:i});const n=function(e,t,i,o){const n=e.getChild(Math.min(t,o-1));let s=n.getChild(0),r=0;for(const e of n.getChildren()){if(r>i)return s;s=e,r+=parseInt(e.getAttribute("colspan")||"1")}return s}(s,o.first,r,t.getRows(s));e.setSelection(e.createPositionAt(n,0))}))}}class Ov extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){const o=i.findAncestor("table"),n=e.getColumns(o),{first:s,last:r}=e.getColumnIndexes(t);this.isEnabled=r-se.cell===t)).column,last:n.find((e=>e.cell===i)).column},r=function(e,t,i,o){const n=parseInt(i.getAttribute("colspan")||"1");return n>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>ee>o.last)).cell}(n,t,i,s);this.editor.model.change((t=>{const i=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:i}),t.setSelection(t.createPositionAt(r,0))}))}}class Vv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingRows"),this.value=i.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=this.value?s:r+1,l=n.getAttribute("headingRows")||0;i.change((e=>{if(a){const t=Uk(n,a,a>l?l:0);for(const{cell:i}of t)Kk(i,a,e)}t.setHeadingRowsCount(e,n,a)}))}_isInHeading(e,t){const i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.indexthis._isInFooter(e,o)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=t.getRows(n),l=this.value?a-(r+1):a-s,c=n.getAttribute("footerRows")||0;i.change((e=>{if(l){const t=a-l,i=a-c,o=Uk(n,t,t>i?i:0);for(const{cell:i}of o)Kk(i,t,e)}t.setFooterRowsCount(e,n,l)}))}_isInFooter(e,t){const i=parseInt(t.getAttribute("footerRows")||"0"),o=this.editor.plugins.get("TableUtils").getRows(t),n=e.parent.index;return!!i&&n>=o-i}}class Fv extends wc{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(0===i.length)return this.isEnabled=!1,void(this.value=!1);const o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingColumns"),this.value=i.every((t=>zk(e,t)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getColumnIndexes(o),a=this.value?s:r+1;i.change((e=>{if(a){const t=Gk(n,a);for(const{cell:i,column:o}of t)Jk(i,o,a,e)}t.setHeadingColumnsCount(e,n,a)}))}}class Mv extends wc{refresh(){const e=this.editor.plugins.get(av),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){const e=this.editor.model,t=this.editor.plugins.get(av);e.change((i=>{const o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:s,mergeHeight:r}=function(e,t,i){let o=0,n=0;for(const e of t){const{row:t,column:s}=i.getCellLocation(e);o=Lv(e,s,o,"colspan"),n=Lv(e,t,n,"rowspan")}const{row:s,column:r}=i.getCellLocation(e),a=o-r,l=n-s;return{mergeWidth:a,mergeHeight:l}}(n,o,t);Bk("colspan",s,n,i),Bk("rowspan",r,n,i);for(const e of o)Nv(e,n,i);Xk(n.findAncestor("table"),t),i.setSelection(n,"in")}))}}function Nv(e,t,i){Bv(e)||(Bv(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function Bv(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function Lv(e,t,i,o){const n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}class zv extends wc{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),s=[];for(let t=o.first;t<=o.last;t++)for(const i of n.getChild(t).getChildren())s.push(e.createRangeOn(i));e.change((e=>{e.setSelection(s)}))}}class jv extends wc{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),s=o.findAncestor("table"),r=e.getCellLocation(o),a=e.getCellLocation(n),l=Math.min(r.column,a.column),c=Math.max(r.column,a.column),d=[];for(const e of new Fk(s,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function $v(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.differ.getChanges();let o=!1;const n=new Set;for(const t of i){let i=null;"insert"==t.type&&"table"==t.name&&(i=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(i=t.position.findAncestor("table")),Wv(t)&&(i=t.range.start.findAncestor("table")),i&&!n.has(i)&&(o=qv(i,e)||o,o=Hv(i,e)||o,n.add(i))}return o}(t,e)))}function qv(e,t){let i=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),i=parseInt(e.getAttribute("footerRows")||"0"),o=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),n=o-i,s=[];for(const{row:i,cell:r,cellHeight:a}of new Fk(e)){if(a<2)continue;let e;if(e=i=n?o:n,i+a>e){const t=e-i;s.push({cell:r,rowspan:t})}}return s}(e);if(o.length){i=!0;for(const e of o)Bk("rowspan",e.rowspan,e.cell,t,1)}return i}function Hv(e,t){let i=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:i}of new Fk(e,{includeAllSlots:!0}))t[i]++;return t}(e),n=[];for(const[t,i]of o.entries())!i&&e.getChild(t).is("element","tableRow")&&n.push(t);if(n.length){i=!0;for(const i of n.reverse())t.remove(e.getChild(i)),o.splice(i,1)}const s=o.filter(((t,i)=>e.getChild(i).is("element","tableRow"))),r=s[0];if(!s.every((e=>e===r))){const o=s.reduce(((e,t)=>t>e?t:e),0);for(const[n,r]of s.entries()){const s=o-r;if(s){for(let i=0;ifunction(e,t){const i=t.document.differ.getChanges();let o=!1;for(const t of i)"insert"==t.type&&"table"==t.name&&(o=Kv(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=Gv(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=Jv(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!Zv(t)||(o=Jv(t.position.parent,e)||o);return o}(t,e)))}function Kv(e,t){let i=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(i=Gv(o,t)||i);return i}function Gv(e,t){let i=!1;for(const o of e.getChildren())i=Jv(o,t)||i;return i}function Jv(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const i=Array.from(e.getChildren()).filter((e=>e.is("$text")));for(const e of i)t.wrap(t.createRangeOn(e),"paragraph");return!!i.length}function Zv(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function Qv(e,t,i){const o=i.getAttribute("headingRows")||0,n=i.getAttribute("footerRows")||0,s=e.getRows(i);if(o+n>s){return Bk("footerRows",Math.max(0,s-o),i,t,0),!0}return!1}function Yv(e,t){if(!e.is("element","paragraph"))return!1;const i=t.toViewElement(e);return!!i&&kv(e)!==i.is("element","span")}class Xv extends fc{_additionalSlots;static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[av]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get(av);e.config.define("table.enableFooters",!1);const s=!!e.config.get("table.enableFooters");i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns",...s?["footerRows"]:[]]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=iv(t.viewItem);if(!o||!i.consumable.test(o,{name:!0}))return;i.consumable.consume(t.viewItem,{name:!0,classes:"table"});const n=i.convertItem(o,t.modelCursor),s=ti(n.modelRange.getItems());if(!s||!s.is("element","table"))return i.consumable.revert(t.viewItem,{name:!0,classes:"table"}),void(n.modelRange&&!n.modelRange.isCollapsed&&(t.modelRange=n.modelRange,t.modelCursor=n.modelCursor));i.convertChildren(t.viewItem,i.writer.createPositionAt(s,"end")),i.updateConversionResult(s,t)}))})),o.for("upcast").add(ov({enableFooters:s})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:wv(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:wv(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(nv("td")),o.for("upcast").add(nv("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:yv({asWidget:!0,cellTypeEnabled:()=>Hk(this.editor)})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:yv({cellTypeEnabled:()=>Hk(this.editor)})}),o.for("editingDowncast").elementToElement({model:"paragraph",view:_v({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:_v(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:eC("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:eC("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.defaultFooters",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change((t=>{for(const i of e.editing.view.document.roots)t.addClass("ck-table-show-hidden-borders",i)})),e.commands.add("insertTable",new xv(e)),e.commands.add("insertTableRowAbove",new Ev(e,{order:"above"})),e.commands.add("insertTableRowBelow",new Ev(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Tv(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Tv(e,{order:"right"})),e.commands.add("removeTableRow",new Rv(e)),e.commands.add("removeTableColumn",new Ov(e)),e.commands.add("splitTableCellVertically",new Pv(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new Pv(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new Mv(e)),e.commands.add("mergeTableCellRight",new Sv(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Sv(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Sv(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Sv(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new Fv(e)),e.commands.add("setTableRowHeader",new Vv(e)),s&&e.commands.add("setTableFooterRow",new Dv(e)),e.commands.add("selectTableRow",new zv(e)),e.commands.add("selectTableColumn",new jv(e)),$v(t),Uv(t),s&&function(e){const{model:t}=e,i=e.plugins.get(av);t.document.registerPostFixer((e=>{let o=!1;const n=t.document.differ.getChanges(),s=new Set;for(const e of n){let t=null;"attribute"!=e.type||"headingRows"!=e.attributeKey&&"footerRows"!=e.attributeKey?("insert"==e.type&&"tableRow"==e.name||"remove"==e.type&&"tableRow"==e.name)&&(t=e.position.parent):t=e.range.start.nodeAfter,t&&t.is("element","table")&&s.add(t)}for(const t of s)Qv(i,e,t)&&(o=!0);return o}))}(e),this.listenTo(t.document,"change:data",(()=>{Hk(e)||function(e,t){const i=e.document.differ,o=new Set,n=new Set,s=new Set;for(const e of i.getChanges()){let i;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey&&"footerRows"!=e.attributeKey)continue;i=t}else"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table"));if(!i)continue;"insert"==e.type&&"tableRow"==e.name&&t.mapper.toViewElement(e.position.nodeAfter)&&o.add(e.position.nodeAfter);const r=i.getAttribute("headingRows")||0,a=i.getAttribute("headingColumns")||0,l=new Fk(i);for(const e of l){const i=t.mapper.toViewElement(e.cell);if(!i||!i.is("element"))continue;const l=e.rowYv(e,t.mapper)));for(const e of i)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:vv(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:Cv(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&function(e){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[i,o]of Object.entries(t))e.conversion.for("dataDowncast").add((t=>t.on(`attribute:${o}:table`,((t,o,n)=>{const{item:s,attributeNewValue:r}=o,{mapper:a,writer:l}=n,c=e.plugins.has("PlainTableOutput"),d=n.options.isClipboardPipeline,u=Av(e,s);if(!(c||u||d))return;if(!n.consumable.consume(s,t.name))return;const h=a.toViewElement(s);r?l.setStyle(i,r,h):l.removeStyle(i,h)}),{priority:"high"})))}(e)}}function eC(e){return t=>{const i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}class tC extends Au{items;keystrokes;focusTracker;constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new ri,this.focusTracker=new ii,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:i,column:o}=t.target.dataset;this.items.get(10*(parseInt(i,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,i)=>{if(!i)return;const{row:o,column:n}=i.dataset;this.set({rows:parseInt(o),columns:parseInt(n)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),Vu({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((i,o)=>{const n=Math.floor(o/10){const o=e.commands.get("insertTable"),n=Zh(i);let s;return n.bind("isEnabled").to(o),n.buttonView.set({icon:id,label:t("Insert table"),tooltip:!0}),n.on("change:isOpen",(()=>{s||(s=new tC(i),n.panelView.children.add(s),s.delegate("execute").to(n),n.on("execute",(()=>{e.execute("insertTable",{rows:s.rows,columns:s.columns}),e.editing.view.focus()})))})),n})),e.ui.componentFactory.add("menuBar:insertTable",(i=>{const o=e.commands.get("insertTable"),n=new ig(i),s=new tC(i);return s.delegate("execute").to(n),n.on("change:isOpen",((e,t,i)=>{i||s.reset()})),s.on("execute",(()=>{e.execute("insertTable",{rows:s.rows,columns:s.columns}),e.editing.view.focus()})),n.buttonView.set({label:t("Table"),icon:id}),n.panelView.children.add(s),n.bind("isEnabled").to(o),n})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},o&&{type:"switchbutton",model:{commandName:"setTableFooterRow",label:t("Footer row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}].filter(Boolean);return this._prepareDropdown(t("Row"),'',i,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',o,e)}))}_prepareDropdown(e,t,i,o){const n=this.editor,s=Zh(o),r=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(r,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(s,"execute",(e=>{n.execute(e.source.commandName),e.source instanceof fh||n.editing.view.focus()})),s}_prepareMergeSplitButtonDropdown(e,t,i,o){const n=this.editor,s=Zh(o,Jh),r="mergeTableCells",a=n.commands.get(r),l=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([a,...l],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(s.buttonView,"execute",(()=>{n.execute(r),n.editing.view.focus()})),this.listenTo(s,"execute",(e=>{n.execute(e.source.commandName),n.editing.view.focus()})),s}_fillDropdownWithListOptions(e,t){const i=this.editor,o=[],n=new ei;for(const e of t)oC(e,i,o,n);return Xh(e,n),o}}function oC(e,t,i,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new Jm(e.model),{commandName:n,bindIsOn:s}=e.model,r=t.commands.get(n);i.push(r),o.set({commandName:n}),o.bind("isEnabled").to(r),s&&o.bind("isOn").to(r,"value"),o.set({withText:!0})}o.add(e)}class nC extends fc{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[av,av]}init(){const e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(i.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(av),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return 0==i.length?null:i}getSelectionAsFragment(){const e=this.editor.plugins.get(av),t=this.getSelectedTableCells();return t?this.editor.model.change((i=>{const o=i.createDocumentFragment(),{first:n,last:s}=e.getColumnIndexes(t),{first:r,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table");let c=a,d=s;if(e.isSelectionRectangular(t)){const e={firstColumn:n,lastColumn:s,firstRow:r,lastRow:a};c=ev(l,e),d=tv(l,e)}const u=Wk(l,{startRow:r,startColumn:n,endRow:c,endColumn:d},i);return i.insert(u,o,0),o})):null}setCellSelection(e,t){const i=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(i.cells.map((t=>e.createRangeOn(t))),{backward:i.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=ti(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,i,o)=>{const n=o.writer;!function(e){for(const i of t)e.removeClass("ck-editor__editable_selected",i);t.clear()}(n);const s=this.getSelectedTableCells();if(!s)return;for(const e of s){const i=o.mapper.toViewElement(e);n.addClass("ck-editor__editable_selected",i),t.add(i)}const r=o.mapper.toViewElement(s[s.length-1]);n.setSelection(r,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((i=>{const o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)}))}}))}_handleDeleteContent(e,t){const i=this.editor.plugins.get(av),o=t[0],n=t[1],s=this.editor.model,r=!n||"backward"==n.direction,a=i.getSelectedTableCells(o);a.length&&(e.stop(),s.change((e=>{const t=a[r?a.length-1:0];s.change((e=>{for(const t of a)s.deleteContent(e.createSelection(t,"in"))}));const i=s.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(i):o.setTo(i)})))}_handleInsertTextEvent(e,t){const i=this.editor,o=this.getSelectedTableCells();if(!o)return;const n=i.editing.view,s=i.editing.mapper,r=o.map((e=>n.createRangeOn(s.toViewElement(e))));t.selection=n.createSelection(r),t.preventDefault()}_getCellsToSelect(e,t){const i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),s=Math.min(o.row,n.row),r=Math.max(o.row,n.row),a=Math.min(o.column,n.column),l=parseInt(t.getAttribute("colspan")||"1")-1,c=Math.max(o.column,n.column+l),d=new Array(r-s+1).fill(null).map((()=>[])),u={startRow:s,endRow:r,startColumn:a,endColumn:c};for(const{row:t,cell:i}of new Fk(e.findAncestor("table"),u))d[t-s].push(i);const h=n.rowe.reverse())),{cells:d.flat(),backward:h||m}}}class sC extends fc{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ff,bf,nC,av]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e,"cut",((e,t)=>this._onCopyCut(e,t))),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){const{editor:e}=this,t=e.plugins.get(bf),i=e.plugins.get(nC);let o=!1;t.on("contentInsertion",((e,t)=>{o="paste"===t.method})),this.listenTo(e.model,"insertContent",((e,[t,n])=>{(o||null!==i.getSelectedTableCells())&&this._onInsertContent(e,t,n)}),{priority:"high"}),t.on("contentInsertion",(()=>{o=!1}),{priority:"lowest"})}_onCopyCut(e,t){const i=this.editor.editing.view,o=this.editor.plugins.get(nC),n=this.editor.plugins.get(ff);o.getSelectedTableCells()&&("cut"!=e.name||this.editor.model.canEditAt(this.editor.model.document.selection))&&(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:"cut"===e.name},(()=>{const s=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,(()=>o.getSelectionAsFragment()));i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(s),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;const o=this.editor.model,n=this.editor.plugins.get(av),s=this.editor.plugins.get(ff),r=this.getTableIfOnlyTableInContent(t,o);if(!r)return;const a=n.getSelectionAffectedTableCells(o.document.selection);a.length?(e.stop(),t.is("documentFragment")?s._pasteMarkersIntoTransformedElement(t.markers,(e=>this._replaceSelectedCells(r,a,e))):this.editor.model.change((e=>{this._replaceSelectedCells(r,a,e)}))):Xk(r,n)}_replaceSelectedCells(e,t,i){const o=this.editor.plugins.get(av),n={width:o.getColumns(e),height:o.getRows(e)},s=function(e,t,i,o){const n=e[0].findAncestor("table"),s=o.getColumnIndexes(e),r=o.getRowIndexes(e),a={firstColumn:s.first,lastColumn:s.last,firstRow:r.first,lastRow:r.last},l=1===e.length;l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,function(e,t,i,o){const n=o.getColumns(e),s=o.getRows(e);i>n&&o.insertColumns(e,{at:n,columns:i-n});t>s&&o.insertRows(e,{at:s,rows:t-s})}(n,a.lastRow+1,a.lastColumn+1,o));l||!o.isSelectionRectangular(e)?function(e,t,i){const{firstRow:o,lastRow:n,firstColumn:s,lastColumn:r}=t,a={first:o,last:n},l={first:s,last:r};aC(e,s,a,i),aC(e,r+1,a,i),rC(e,o,l,i),rC(e,n+1,l,i,o)}(n,a,i):(a.lastRow=ev(n,a),a.lastColumn=tv(n,a));return a}(t,n,i,o),r=s.lastRow-s.firstRow+1,a=s.lastColumn-s.firstColumn+1;e=Wk(e,{startRow:0,startColumn:0,endRow:Math.min(r,n.height)-1,endColumn:Math.min(a,n.width)-1},i);const l=t[0].findAncestor("table"),c=this._replaceSelectedCellsWithPasted(e,n,l,s,i,o);if(this.editor.plugins.get("TableSelection").isEnabled){const e=o.sortRanges(c.map((e=>i.createRangeOn(e))));i.setSelection(e)}else i.setSelection(c[0],0);return l}_replaceSelectedCellsWithPasted(e,t,i,o,n,s){const{width:r,height:a}=t,l=function(e,t,i){const o=new Array(i).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:i,cell:n}of new Fk(e))o[i][t]=n;return o}(e,r,a),c=[...new Fk(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],d=[];let u;for(const e of c){const{row:t,column:i}=e;i===o.firstColumn&&(u=e.getPositionBefore());const s=t-o.firstRow,c=i-o.firstColumn,h=l[s%a][c%r],m=h?n.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,u,n);g&&(Zk(g,t,i,o.lastRow,o.lastColumn,n),d.push(g),u=n.createPositionAfter(g))}const h=parseInt(i.getAttribute("headingRows")||"0"),m=parseInt(i.getAttribute("headingColumns")||"0"),g=parseInt(i.getAttribute("footerRows")||"0"),p=s.getRows(i)-g,f=o.firstRowlC(e,t,i))).map((({cell:e})=>Kk(e,t,o)))}function aC(e,t,i,o){if(t<1)return;return Gk(e,t).filter((({row:e,cellHeight:t})=>lC(e,t,i))).map((({cell:e,column:i})=>Jk(e,i,t,o)))}function lC(e,t,i){const o=e+t-1,{first:n,last:s}=i;return e>=n&&e<=s||e=n}class cC extends fc{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[nC,av]}init(){const e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(t,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(t,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){const i=this.editor.model.document.selection.getSelectedElement();i&&i.is("element","table")&&t.stopPropagation()}_handleTab(e,t){const i=this.editor,o=this.editor.plugins.get(av),n=this.editor.plugins.get("TableSelection"),s=i.model.document.selection,r=!t.shiftKey;let a=o.getTableCellsContainingSelection(s)[0];if(a||(a=n.getFocusCell()),!a)return;t.stopPropagation();const l=a.parent,c=l.parent,d=c.getChildIndex(l),u=l.getChildIndex(a)===l.childCount-1,h=d===o.getRows(c)-1;r&&h&&u&&i.execute("insertTableRowBelow")}_onArrowKey(e,t){const i=this.editor,o=Kt(t.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(o,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const i=this.editor.plugins.get(av),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,s=n.document.selection,r=["right","down"].includes(e),a=i.getSelectedTableCells(s);if(a.length){let i;return i=t?o.getFocusCell():r?a[a.length-1]:a[0],this._navigateFromCellInDirection(i,e,t),!0}const l=s.focus.findAncestor("tableCell");if(!l)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==r&&!s.containsEntireContent(l))return!1}else{const e=s.getSelectedElement();if(!e||!n.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(s,l,r)&&(this._navigateFromCellInDirection(l,e,t),!0)}_isSelectionAtCellEdge(e,t,i){const o=this.editor.model,n=this.editor.model.schema,s=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(s).is("element","tableCell")){return o.createPositionAt(t,i?"end":0).isTouching(s)}const r=o.createSelection(s);return o.modifySelection(r,{direction:i?"forward":"backward"}),s.isEqual(r.focus)}_navigateFromCellInDirection(e,t,i=!1){const o=this.editor.model,n=e.findAncestor("table"),s=[...new Fk(n,{includeAllSlots:!0})],{row:r,column:a}=s[s.length-1],l=s.find((({cell:t})=>t==e));let{row:c,column:d}=l;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>r||d<0&&c<=0||d>a&&c>=r)return void o.change((e=>{e.setSelection(e.createRangeOn(n))}));d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const u=s.find((e=>e.row==c&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}class dC extends jn{domEventType=["mousemove","mouseleave"];onDomEvent(e){this.fire(e.type,e)}}class uC extends fc{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[nC,av]}init(){this.editor.editing.view.addObserver(dC),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(av);let i=!1;const o=e.plugins.get(nC);this.listenTo(e.editing.view.document,"mousedown",((n,s)=>{const r=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!s.domEvent.shiftKey)return;const a=o.getAnchorCell()||t.getTableCellsContainingSelection(r)[0];if(!a)return;const l=this._getModelTableCellFromDomEvent(s);l&&hC(a,l)&&(i=!0,o.setCellSelection(a,l),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{i=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,i,o=!1,n=!1;const s=e.plugins.get(nC);this.listenTo(e.editing.view.document,"mousedown",((e,i)=>{this.isEnabled&&s.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(i)))})),this.listenTo(e.editing.view.document,"mousemove",((e,r)=>{if(!r.domEvent.buttons)return;if(!t)return;const a=this._getModelTableCellFromDomEvent(r);a&&hC(t,a)&&(i=a,o||i==t||(o=!0)),o&&(n=!0,s.setCellSelection(t,i),r.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,n=!1,t=null,i=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function hC(e,t){return e.parent.parent==t.parent.parent}class mC extends fc{static get requires(){return[Xv,iC,nC,uC,cC,sC,vp]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}}function gC(e){const t=pC(e);return t||fC(e)}function pC(e){const t=e.getSelectedElement();return t&&bC(t)?t:null}function fC(e){const t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&bC(i))return i;i=i.parent}return null}function bC(e){return e.is("element")&&!!e.getCustomProperty("table")&&op(e)}class wC extends Au{options;focusTracker;focusCycler;_focusables;dropdownView;inputView;keystrokes;_stillTyping;constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new ii,this._focusables=new tu,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new ri,this._stillTyping=!1,this.focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",((e,t,i)=>this._setInputValue(i)))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach((e=>{this.focusTracker.add(e.element),this._focusables.add(e)})),this.keystrokes.listenTo(this.element)}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){const e=this.locale,t=e.t,i=this.bindTemplate,o=this._createColorSelector(e),n=Zh(e),s=new Au;return s.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",(e=>""!=e))]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(s),n.buttonView.label=t("Color picker"),n.buttonView.tooltip=!0,n.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",(e=>!e)),n.on("change:isOpen",((e,t,i)=>{i&&(o.updateSelectedColors(),o.showColorGridsFragment())})),n}_createInputTextView(){const e=this.locale,t=new Oh(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",(()=>{const e=t.element.value,i=this.options.colorDefinitions.find((t=>e===t.label));this._stillTyping=!0,this.value=i&&i.color||e})),t.on("blur",(()=>{this._stillTyping=!1,this._setInputValue(t.element.value)})),t.delegate("input").to(this),t}_createColorSelector(e){const t=e.t,i=this.options.defaultColorValue||"",o=t(i?"Restore default":"Remove color"),n=new fm(e,{colors:this.options.colorDefinitions,columns:this.options.columns,removeButtonLabel:o,colorPickerLabel:t("Color picker"),colorPickerViewConfig:!1!==this.options.colorPickerConfig&&{...this.options.colorPickerConfig,hideInput:!0}});n.appendUI(),n.on("execute",((e,t)=>{"colorPickerSaveButton"!==t.source?(this.value=t.value||i,this.fire("input"),"colorPicker"!==t.source&&(this.dropdownView.isOpen=!1)):this.dropdownView.isOpen=!1}));let s=this.value;return n.on("colorPicker:cancel",(()=>{this.value=s,this.fire("input"),this.dropdownView.isOpen=!1})),n.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{s=this.value})),n.bind("selectedColor").to(this,"value"),n}_setInputValue(e){if(!this._stillTyping){const t=yC(e),i=this.options.colorDefinitions.find((e=>t===yC(e.color)));this.inputView.value=i?i.label:e||""}}}function yC(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}const _C=e=>""===e;function kC(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function vC(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}function CC(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}function AC(e){return e=e.trim().toLowerCase(),_C(e)||gl(e)}function xC(e){return e=e.trim(),_C(e)||RC(e)||wl(e)||_l(e)}function EC(e){return e=e.trim(),_C(e)||RC(e)||wl(e)}function TC(e,t){const i=new ei,o=kC(e.t);for(const n in o){const s={type:"button",model:new Jm({_borderStyleValue:n,label:o[n],role:"menuitemradio",withText:!0})};"none"===n?s.model.bind("isOn").to(e,"borderStyle",(e=>"none"===t?!e:e===n)):s.model.bind("isOn").to(e,"borderStyle",(e=>e===n)),i.add(s)}return i}function PC(e){const{view:t,icons:i,toolbar:o,labels:n,propertyName:s,nameToValue:r,defaultValue:a}=e;for(const e in n){const l=new Lu(t.locale);l.set({role:"radio",isToggleable:!0,label:n[e],icon:i[e],tooltip:n[e]});const c=r?r(e):e;l.bind("isOn").to(t,s,(e=>{let t=e;return""===e&&a&&(t=a),c===t})),l.on("execute",(()=>{!a&&c&&t[s]===c?t[s]=void 0:t[s]=c})),o.items.add(l)}}const SC=[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}];function IC(e){return(t,i,o)=>{const n=new wC(t.locale,{colorDefinitions:(s=e.colorConfig,s.map((e=>({color:e.model,label:e.label,options:{hasBorder:e.hasBorder}})))),columns:e.columns,defaultColorValue:e.defaultColorValue,colorPickerConfig:e.colorPickerConfig});var s;return n.inputView.set({id:i,ariaDescribedById:o}),n.bind("isReadOnly").to(t,"isEnabled",(e=>!e)),n.bind("hasError").to(t,"errorText",(e=>!!e)),n.on("input",(()=>{t.errorText=null})),t.bind("isEmpty","isFocused").to(n),n}}function RC(e){const t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}class OC extends Au{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;cellTypeDropdown;paddingInput;widthInput;heightInput;horizontalAlignmentToolbar;verticalAlignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",padding:"",backgroundColor:"",width:"",height:"",horizontalAlignment:"",verticalAlignment:"",cellType:""}),this.options=t;const{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{cellTypeRowLabel:l,cellTypeDropdown:c}=this._createCellTypeField(),{widthInput:d,operatorLabel:u,heightInput:h,dimensionsLabel:m}=this._createDimensionFields(),{horizontalAlignmentToolbar:g,verticalAlignmentToolbar:p,alignmentLabel:f}=this._createAlignmentFields();this.focusTracker=new ii,this.keystrokes=new ri,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.cellTypeDropdown=c,this.paddingInput=this._createPaddingField(),this.widthInput=d,this.heightInput=h,this.horizontalAlignmentToolbar=g,this.verticalAlignmentToolbar=p;const{saveButtonView:b,cancelButtonView:w}=this._createActionButtons();this.saveButtonView=b,this.cancelButtonView=w,this.backButtonView=this._createBackButton(),this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const y=new ju(e,{label:this.t("Cell properties")});y.children.add(this.backButtonView,0),this.children.add(y),this.children.add(new Km(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new Km(e,{children:[new Km(e,{labelView:l,children:[l,c],class:"ck-table-form__cell-type-row"}),new Km(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new Km(e,{children:[new Km(e,{labelView:m,children:[m,d,u,h],class:"ck-table-form__dimensions-row"}),new Km(e,{children:[this.paddingInput],class:"ck-table-cell-properties-form__padding-row"})]})),this.children.add(new Km(e,{labelView:f,children:[f,g,p],class:"ck-table-cell-properties-form__alignment-row"})),this.children.add(new Km(e,{children:[this.cancelButtonView,this.saveButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-cell-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this}),[this.borderColorInput,this.backgroundInput].forEach((e=>{this._focusCycler.chain(e.fieldView.focusCycler)})),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.cellTypeDropdown,this.backgroundInput,this.widthInput,this.heightInput,this.paddingInput,this.horizontalAlignmentToolbar,this.verticalAlignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){const e=this.options.defaultTableCellProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=IC({colorConfig:this.options.borderColors,columns:5,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new Du(o);r.text=n("Border");const a=kC(n),l=new Sh(o,rm);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",(e=>a[e||"none"])),l.fieldView.on("execute",(e=>{this.borderStyle=e.source._borderStyleValue})),l.bind("isEmpty").to(this,"borderStyle",(e=>!e)),Xh(l.fieldView,TC(this,t.style),{role:"menu",ariaLabel:s});const c=new Sh(o,nm);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",VC),c.fieldView.on("input",(()=>{this.borderWidth=c.fieldView.element.value}));const d=new Sh(o,i);return d.set({label:n("Color"),class:"ck-table-form__border-color"}),d.fieldView.bind("value").to(this,"borderColor"),d.bind("isEnabled").to(this,"borderStyle",VC),d.fieldView.on("input",(()=>{this.borderColor=d.fieldView.value})),this.on("change:borderStyle",((e,i,o,n)=>{VC(o)||(this.borderColor="",this.borderWidth=""),VC(n)||(this.borderColor=t.color,this.borderWidth=t.width)})),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:d,borderWidthInput:c}}_createBackgroundFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Background");const o=IC({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableCellProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new Sh(e,o);return n.set({label:t("Color"),class:"ck-table-cell-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",(()=>{this.backgroundColor=n.fieldView.value})),{backgroundRowLabel:i,backgroundInput:n}}_createCellTypeField(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Cell type");const o=this._cellTypeLabels,n=new Sh(e,rm);return n.set({label:t("Cell type"),class:"ck-table-cell-properties-form__cell-type"}),n.fieldView.buttonView.set({ariaLabel:t("Cell type"),ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:t("Cell type")}),n.fieldView.buttonView.bind("label").to(this,"cellType",(e=>o[e||"data"])),n.fieldView.on("execute",(e=>{this.cellType=e.source._cellTypeValue})),n.bind("isEmpty").to(this,"cellType",(e=>!e)),Xh(n.fieldView,this._getCellTypeDefinitions(),{role:"menu",ariaLabel:t("Cell type")}),{cellTypeRowLabel:i,cellTypeDropdown:n}}_createDimensionFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Dimensions");const o=new Sh(e,nm);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",(()=>{this.width=o.fieldView.element.value}));const n=new Au(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const s=new Sh(e,nm);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",(()=>{this.height=s.fieldView.element.value})),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createPaddingField(){const e=this.locale,t=this.t,i=new Sh(e,nm);return i.set({label:t("Padding"),class:"ck-table-cell-properties-form__padding"}),i.fieldView.bind("value").to(this,"padding"),i.fieldView.on("input",(()=>{this.padding=i.fieldView.element.value})),i}_createAlignmentFields(){const e=this.locale,t=this.t,i=new Du(e),o={left:jc,center:'',right:'',justify:'',top:'',middle:'',bottom:''};i.text=t("Table cell text alignment");const n=new Wh(e),s="rtl"===e.contentLanguageDirection;n.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Horizontal text alignment toolbar"),class:"ck-table-cell-properties-form__horizontal-alignment-toolbar"}),PC({view:this,icons:o,toolbar:n,labels:this._horizontalAlignmentLabels,propertyName:"horizontalAlignment",nameToValue:e=>{if(s){if("left"===e)return"right";if("right"===e)return"left"}return e},defaultValue:this.options.defaultTableCellProperties.horizontalAlignment});const r=new Wh(e);return r.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Vertical text alignment toolbar"),class:"ck-table-cell-properties-form__vertical-alignment-toolbar"}),PC({view:this,icons:o,toolbar:r,labels:this._verticalAlignmentLabels,propertyName:"verticalAlignment",defaultValue:this.options.defaultTableCellProperties.verticalAlignment}),{horizontalAlignmentToolbar:n,verticalAlignmentToolbar:r,alignmentLabel:i}}_createActionButtons(){const e=this.locale,t=this.t,i=new Lu(e),o=new Lu(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.paddingInput];return i.set({label:t("Save"),class:"ck-button-action",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",((...e)=>e.every((e=>!e)))),o.set({label:t("Cancel"),withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_getCellTypeDefinitions(){const e=new ei,t=this._cellTypeLabels,i=["data","header"];this.options.showScopedHeaderOptions&&i.push("header-column","header-row");for(const o of i){const i={type:"button",model:new Jm({_cellTypeValue:o,label:t[o],role:"menuitemradio",withText:!0})};i.model.bind("isOn").to(this,"cellType",(e=>e===o)),e.add(i)}return e}get _horizontalAlignmentLabels(){const e=this.locale,t=this.t,i=t("Align cell text to the left"),o=t("Align cell text to the center"),n=t("Align cell text to the right"),s=t("Justify cell text");return"rtl"===e.uiLanguageDirection?{right:n,center:o,left:i,justify:s}:{left:i,center:o,right:n,justify:s}}get _verticalAlignmentLabels(){const e=this.t;return{top:e("Align cell text to the top"),middle:e("Align cell text to the middle"),bottom:e("Align cell text to the bottom")}}get _cellTypeLabels(){const e=this.t;return{data:e("Data cell"),header:e("Header cell"),"header-column":e("Column header"),"header-row":e("Row header")}}}function VC(e){return"none"!==e}const DC=(()=>[dh.defaultPositions.northArrowSouth,dh.defaultPositions.northArrowSouthWest,dh.defaultPositions.northArrowSouthEast,dh.defaultPositions.southArrowNorth,dh.defaultPositions.southArrowNorthWest,dh.defaultPositions.southArrowNorthEast,dh.defaultPositions.viewportStickyNorth])();function FC(e,t){const i=e.plugins.get("ContextualBalloon"),o=e.editing.view.document.selection;let n;"cell"===t?fC(o)&&(n=NC(e)):gC(o)&&(n=MC(e)),n&&i.updatePosition(n)}function MC(e){const t=$k(e.model.document.selection),i=e.editing.mapper.toViewElement(t);return{target:e.editing.view.domConverter.mapViewToDom(i),positions:DC}}function NC(e){const t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(o.rangeCount>1)return{target:()=>function(e,t){const i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map((e=>{const t=BC(e.start),n=i.toViewElement(t);return new ut(o.mapViewToDom(n))}));return ut.getBoundingRect(n)}(o.getRanges(),e),positions:DC};const n=BC(o.getFirstPosition()),s=t.toViewElement(n);return{target:i.mapViewToDom(s),positions:DC}}function BC(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}const LC={borderStyle:"tableCellBorderStyle",borderColor:"tableCellBorderColor",borderWidth:"tableCellBorderWidth",height:"tableCellHeight",width:"tableCellWidth",padding:"tableCellPadding",backgroundColor:"tableCellBackgroundColor",horizontalAlignment:"tableCellHorizontalAlignment",verticalAlignment:"tableCellVerticalAlignment",cellType:"tableCellType"};class zC extends fc{_defaultContentTableCellProperties;_defaultLayoutTableCellProperties;_balloon;view;_viewWithContentTableDefaults;_viewWithLayoutTableDefaults;_undoStepBatch;_isReady;static get requires(){return[Qm]}static get pluginName(){return"TableCellPropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableCellProperties",{borderColors:SC,backgroundColors:SC})}init(){const e=this.editor,t=e.t;this._defaultContentTableCellProperties=bv(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection}),this._defaultLayoutTableCellProperties=pv(void 0,{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection}),this._balloon=e.plugins.get(Qm),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellProperties",(i=>{const o=new Lu(i);o.set({label:t("Cell properties"),icon:'',tooltip:!0}),this.listenTo(o,"execute",(()=>this._showView()));const n=Object.values(LC).map((t=>e.commands.get(t))).filter((e=>!!e));return o.bind("isEnabled").toMany(n,"isEnabled",((...e)=>e.some((e=>e)))),o}))}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){const t=this.editor,i=t.config.get("table.tableCellProperties"),o=!!t.config.get("table.tableCellProperties.scopedHeaders"),n=Ch(i.borderColors),s=vh(t.locale,n),r=Ch(i.backgroundColors),a=vh(t.locale,r),l=!1!==i.colorPicker,c=new OC(t.locale,{borderColors:s,backgroundColors:a,defaultTableCellProperties:e,colorPickerConfig:!!l&&(i.colorPicker||{}),showScopedHeaderOptions:o}),d=t.t;c.render(),this.listenTo(c,"submit",(()=>{this._hideView()})),this.listenTo(c,"cancel",(()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()})),c.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),Su({emitter:c,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});const u=vC(d),h=CC(d);c.on("change:borderStyle",this._getPropertyChangeCallback("tableCellBorderStyle")),c.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:c.borderColorInput,commandName:"tableCellBorderColor",errorText:u,validator:AC})),c.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:c.borderWidthInput,commandName:"tableCellBorderWidth",errorText:h,validator:EC})),c.on("change:padding",this._getValidatedPropertyChangeCallback({viewField:c.paddingInput,commandName:"tableCellPadding",errorText:h,validator:xC})),c.on("change:width",this._getValidatedPropertyChangeCallback({viewField:c.widthInput,commandName:"tableCellWidth",errorText:h,validator:xC})),c.on("change:height",this._getValidatedPropertyChangeCallback({viewField:c.heightInput,commandName:"tableCellHeight",errorText:h,validator:xC})),c.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:c.backgroundInput,commandName:"tableCellBackgroundColor",errorText:u,validator:AC})),c.on("change:horizontalAlignment",this._getPropertyChangeCallback("tableCellHorizontalAlignment")),c.on("change:verticalAlignment",this._getPropertyChangeCallback("tableCellVerticalAlignment"));const m=t.commands.get("tableCellType");return m&&(c.cellTypeDropdown.bind("isEnabled").to(m,"isEnabled"),c.on("change:cellType",this._getPropertyChangeCallback("tableCellType"))),c}_fillViewFormFromCommandValues(){const e=this.editor.commands,t=e.get("tableCellBorderStyle");Object.entries(LC).flatMap((([t,i])=>{const o=e.get(i);if(!o)return[];const n=t;let s;s="cellType"===n?"":this.view===this._viewWithContentTableDefaults?this._defaultContentTableCellProperties[n]||"":this._defaultLayoutTableCellProperties[n]||"";return[[t,o.value||s]]})).forEach((([e,i])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==t.value)&&this.view.set(e,i)})),this._isReady=!0}_showView(){const e=this.editor,t=gC(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||"layout"!==i.getAttribute("tableType");o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableCellProperties):o||this._viewWithLayoutTableDefaults||(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableCellProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",(()=>{this._updateView()})),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:NC(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;fC(e.editing.view.document.selection)?this._isViewVisible&&FC(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:t,viewField:i,validator:o,errorText:n}=e,s=Li((()=>{i.errorText=n}),500);return(e,n,r)=>{s.cancel(),this._isReady&&(o(r)?(this.editor.execute(t,{value:r,batch:this._undoStepBatch}),i.errorText=null):s())}}}class jC extends wc{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){switch(super(e),this.attributeName=t,this._defaultContentTableValue=i,t){case"tableCellType":this._defaultLayoutTableValue="data";break;case"tableCellBorderStyle":this._defaultLayoutTableValue="none";break;case"tableCellHorizontalAlignment":this._defaultLayoutTableValue="left";break;case"tableCellVerticalAlignment":this._defaultLayoutTableValue="middle";break;default:this._defaultLayoutTableValue=void 0}}refresh(){const e=this.editor.model.document.selection,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e),i=$k(e);this._defaultValue=i&&"layout"===i.getAttribute("tableType")?this._defaultLayoutTableValue:this._defaultContentTableValue,this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){const{value:t,batch:i}=e,o=this.editor.model,n=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(i,(e=>{s?n.forEach((t=>e.setAttribute(this.attributeName,s,t))):n.forEach((t=>e.removeAttribute(this.attributeName,t))),this.fire("afterExecute",{writer:e,tableCells:n,valueToSet:s})}))}_getAttribute(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){const t=this._getAttribute(e[0]);return e.every((e=>this._getAttribute(e)===t))?t:void 0}}class $C extends jC{constructor(e,t){super(e,"tableCellWidth",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class qC extends fc{static get pluginName(){return"TableCellWidthEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xv]}init(){const e=this.editor,t=bv(e.config.get("table.tableCellProperties.defaultProperties"));jk(e.model.schema,e.conversion,{modelAttribute:"tableCellWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:t.width}),e.commands.add("tableCellWidth",new $C(e,t.width))}}class HC extends jC{constructor(e,t){super(e,"tableCellPadding",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class WC extends jC{constructor(e,t){super(e,"tableCellHeight",t)}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class UC extends jC{constructor(e,t){super(e,"tableCellBackgroundColor",t)}}class KC extends jC{constructor(e,t){super(e,"tableCellVerticalAlignment",t)}}class GC extends jC{constructor(e,t){super(e,"tableCellHorizontalAlignment",t)}}class JC extends jC{constructor(e,t){super(e,"tableCellBorderStyle",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class ZC extends jC{constructor(e,t){super(e,"tableCellBorderColor",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class QC extends jC{constructor(e,t){super(e,"tableCellBorderWidth",t)}_getAttribute(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class YC extends jC{constructor(e){super(e,"tableCellType","data"),this.on("afterExecute",((e,t)=>{const{writer:i,tableCells:o}=t,n=this.editor.plugins.get(av),s=function(e){const t=new Map;for(const i of e){const e=i.findAncestor("table");t.has(e)||t.set(e,[]),t.get(e).push(i)}return t}(o);XC(n,i,s.keys())}))}refresh(){super.refresh();const e=$k(this.editor.model.document.selection);this.isEnabled&&e&&"layout"===e.getAttribute("tableType")&&(this.isEnabled=!1)}_getAttribute(e){return e?.getAttribute(this.attributeName)||"data"}}function XC(e,t,i){let o=!1;for(const n of i){let i=n.getAttribute("headingRows")||0,s=n.getAttribute("headingColumns")||0;const r=n.getAttribute("footerRows")||0,a=e.getRows(n)-r,l=s>i;if(l){const r=eA(e,n,"column",s,i);r!==s&&(e.setHeadingColumnsCount(t,n,r,{updateCellType:!1}),s=r,o=!0)}let c=eA(e,n,"row",i,s);if(r>0&&(c=Math.min(c,a)),c!==i&&(e.setHeadingRowsCount(t,n,c,{updateCellType:!1}),i=c,o=!0),!l){const r=eA(e,n,"column",s,i);r!==s&&(e.setHeadingColumnsCount(t,n,r,{updateCellType:!1}),o=!0)}}return o}function eA(e,t,i,o,n){const s="row"===i?e.getRows(t):e.getColumns(t);let r=o;for(let e=0;e=n&&(a=!0)}if(!s)return Math.min(r,e);a&&(r=Math.max(r,e+1))}return Math.min(r,s)}const tA=/^(top|middle|bottom)$/,iA=/^(left|center|right|justify)$/;class oA extends fc{static get pluginName(){return"TableCellPropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Xv,qC]}init(){const e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableCellProperties.defaultProperties",{});const o=bv(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:"rtl"===e.locale.contentLanguageDirection});e.data.addStyleProcessorRules(Hl),function(e,t){const{conversion:i}=e,{schema:o}=e.model,n={width:"tableCellBorderWidth",color:"tableCellBorderColor",style:"tableCellBorderStyle"};o.extend("tableCell",{allowAttributes:Object.values(n)});for(const e of Object.values(n))o.setAttributeProperties(e,{isFormatting:!0});vk(e,"td",n,t),vk(e,"th",n,t),Ck(i,{modelElement:"tableCell",modelAttribute:n.style,styleName:"border-style"}),Ck(i,{modelElement:"tableCell",modelAttribute:n.color,styleName:"border-color"}),Ck(i,{modelElement:"tableCell",modelAttribute:n.width,styleName:"border-width"})}(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableCellBorderStyle",new JC(e,o.borderStyle)),e.commands.add("tableCellBorderColor",new ZC(e,o.borderColor)),e.commands.add("tableCellBorderWidth",new QC(e,o.borderWidth)),jk(t,i,{modelAttribute:"tableCellHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableCellHeight",new WC(e,o.height)),e.data.addStyleProcessorRules(tc),jk(t,i,{modelAttribute:"tableCellPadding",styleName:"padding",reduceBoxSides:!0,defaultValue:o.padding}),function(e,t){Tk(e,"td",t),Tk(e,"th",t)}(e,o.padding),e.commands.add("tableCellPadding",new HC(e,o.padding)),e.data.addStyleProcessorRules(Bl),jk(t,i,{modelAttribute:"tableCellBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableCellBackgroundColor",new UC(e,o.backgroundColor)),function(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellHorizontalAlignment"]}),e.setAttributeProperties("tableCellHorizontalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellHorizontalAlignment"},view:e=>({key:"style",value:{"text-align":e}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"text-align":iA}},model:{key:"tableCellHorizontalAlignment",value:(e,t,o)=>{const n=xk(i,"left",o),s=e.getStyle("text-align");if(s!==n)return s;t.consumable.consume(e,{styles:"text-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{align:iA}},model:{key:"tableCellHorizontalAlignment",value:(e,t,o)=>{const n=xk(i,"left",o),s=e.getAttribute("align");if(s!==n)return s;t.consumable.consume(e,{attributes:"align"})}}})}(t,i,o.horizontalAlignment),e.commands.add("tableCellHorizontalAlignment",new GC(e,o.horizontalAlignment)),function(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellVerticalAlignment"]}),e.setAttributeProperties("tableCellVerticalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellVerticalAlignment"},view:e=>({key:"style",value:{"vertical-align":e}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"vertical-align":tA}},model:{key:"tableCellVerticalAlignment",value:(e,t,o)=>{const n=xk(i,"middle",o),s=e.getStyle("vertical-align");if(s!==n)return s;t.consumable.consume(e,{styles:"vertical-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{valign:tA}},model:{key:"tableCellVerticalAlignment",value:(e,t,o)=>{const n=xk(i,"middle",o),s=e.getAttribute("valign");if(s!==n)return s;t.consumable.consume(e,{attributes:"valign"})}}})}(t,i,o.verticalAlignment),e.commands.add("tableCellVerticalAlignment",new KC(e,o.verticalAlignment)),function(e){const{model:t,conversion:i,editing:o,config:n}=e,{schema:s}=t;n.define("table.tableCellProperties.scopedHeaders",!0);const r=!!n.get("table.tableCellProperties.scopedHeaders"),a=e.plugins.get(av);s.extend("tableCell",{allowAttributes:["tableCellType"]}),s.setAttributeProperties("tableCellType",{isFormatting:!0}),s.addAttributeCheck((e=>{const t=Array.from(e).reverse().find((e=>"table"===e.name));if("layout"===t?.getAttribute("tableType"))return!1}),"tableCellType"),i.for("upcast").add((e=>{e.on("element:th",((e,t,i)=>{const{writer:o}=i,{modelRange:n}=t,s=n?.start.nodeAfter;s?.is("element","tableCell")&&!s.hasAttribute("tableCellType")&&o.setAttribute("tableCellType","header",s)})),e.on("element:table",((e,t,i)=>{const{writer:o}=i,{modelRange:n}=t,s=n?.start.nodeAfter;if(s?.is("element","table")&&"layout"===s.getAttribute("tableType"))for(const{cell:e}of new Fk(s)){if(Nk(e.getAttribute("tableCellType"))){o.setAttribute("tableType","content",s);break}}}),{priority:ge.low-1})})),r&&(i.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellType"},view:e=>{switch(e){case"header-row":return{key:"scope",value:"row"};case"header-column":return{key:"scope",value:"col"}}}}),i.for("upcast").add((e=>{e.on("element:th",((e,t,i)=>{const{writer:o,consumable:n}=i,{viewItem:s,modelRange:r}=t,a=r.start.nodeAfter,l=a?.getAttribute("tableCellType");if("header"===l&&n.consume(s,{attributes:["scope"]})){switch(s.getAttribute("scope")){case"row":o.setAttribute("tableCellType","header-row",a);break;case"col":o.setAttribute("tableCellType","header-column",a)}}}))})));t.document.registerPostFixer((e=>{const i=t.document.differ.getChanges(),o=new Set;for(const e of i){if("attribute"===e.type&&("headingRows"===e.attributeKey||"headingColumns"===e.attributeKey)){const t=e.range.start.nodeAfter;t?.is("element","table")&&"$graveyard"!==t.root.rootName&&o.add(t)}if("attribute"===e.type&&"tableCellType"===e.attributeKey){const t=e.range.start.nodeAfter;if(t?.is("element","tableCell")&&"$graveyard"!==t.root.rootName){const e=t.findAncestor("table");e&&o.add(e)}}if("insert"===e.type&&e.position.nodeAfter)for(const{item:i}of t.createRangeOn(e.position.nodeAfter))if(i.is("element","tableCell")&&i.getAttribute("tableCellType")&&"$graveyard"!==i.root.rootName){const e=i.findAncestor("table");e&&o.add(e)}}return XC(a,e,o)})),t.document.on("change:data",(()=>{const{differ:e}=t.document,i=new Set;for(const t of e.getChanges())if("attribute"===t.type&&"tableCellType"===t.attributeKey){const e=t.range.start.nodeAfter;e.is("element","tableCell")&&i.add(e)}for(const e of i){const t=o.mapper.toViewElement(e),i=Nk(e.getAttribute("tableCellType"))?"th":"td";t?.name!==i&&o.reconvertItem(e)}}))}(e),e.commands.add("tableCellType",new YC(e))}}class nA extends wc{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){super(e),this.attributeName=t,this._defaultContentTableValue=i,this._defaultLayoutTableValue="tableBorderStyle"===t?"none":void 0}refresh(){const e=$k(this.editor.model.document.selection);this._defaultValue=e&&"layout"===e.getAttribute("tableType")?this._defaultLayoutTableValue:this._defaultContentTableValue,this.isEnabled=!!e,this.value=this._getValue(e)}execute(e={}){const t=this.editor.model,i=t.document.selection,{value:o,batch:n}=e,s=$k(i),r=this._getValueToSet(o);t.enqueueChange(n,(e=>{r?e.setAttribute(this.attributeName,r,s):e.removeAttribute(this.attributeName,s)}))}_getValue(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}}class sA extends nA{constructor(e,t){super(e,"tableBackgroundColor",t)}}class rA extends nA{constructor(e,t){super(e,"tableBorderColor",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class aA extends nA{constructor(e,t){super(e,"tableBorderStyle",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}}class lA extends nA{constructor(e,t){super(e,"tableBorderWidth",t)}_getValue(e){if(!e)return;const t=mv(e.getAttribute(this.attributeName));return t!==this._defaultValue?t:void 0}_getValueToSet(e){const t=gv(e,"px");if(t!==this._defaultValue)return t}}class cA extends nA{constructor(e,t){super(e,"tableWidth",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class dA extends nA{constructor(e,t){super(e,"tableHeight",t)}_getValueToSet(e){if((e=gv(e,"px"))!==this._defaultValue)return e}}class uA extends nA{constructor(e,t){super(e,"tableAlignment",t)}}class hA extends fc{static get pluginName(){return"TablePropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Xv]}init(){const e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});const o=fv(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),n=!0===e.config.get("table.tableProperties.alignment.useInlineStyles");e.data.addStyleProcessorRules(ec),e.data.addStyleProcessorRules(Hl),function(e,t){const{conversion:i}=e,{schema:o}=e.model,n={width:"tableBorderWidth",color:"tableBorderColor",style:"tableBorderStyle"};o.extend("table",{allowAttributes:Object.values(n)});for(const e of Object.values(n))o.setAttributeProperties(e,{isFormatting:!0});vk(e,"table",n,t),Ak(i,{modelAttribute:n.color,styleName:"border-color"}),Ak(i,{modelAttribute:n.style,styleName:"border-style"}),Ak(i,{modelAttribute:n.width,styleName:"border-width"})}(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableBorderColor",new rA(e,o.borderColor)),e.commands.add("tableBorderStyle",new aA(e,o.borderStyle)),e.commands.add("tableBorderWidth",new lA(e,o.borderWidth)),function(e,t,i,o){e.extend("table",{allowAttributes:["tableAlignment"]}),e.setAttributeProperties("tableAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"table",key:"tableAlignment",values:["left","center","right","blockLeft","blockRight"]},view:{left:o?{key:"style",value:{float:"left","margin-right":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:Pk.className},right:o?{key:"style",value:{float:"right","margin-left":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:Ik.className},center:o?{key:"style",value:{"margin-left":"auto","margin-right":"auto"}}:{key:"class",value:Sk.className},blockLeft:o?{key:"style",value:{"margin-left":"0","margin-right":"auto"}}:{key:"class",value:Rk.className},blockRight:o?{key:"style",value:{"margin-left":"auto","margin-right":"0"}}:{key:"class",value:Ok.className}},converterPriority:"high"}),Vk.forEach((e=>{t.for("upcast").attributeToAttribute({view:e.view,model:{key:"tableAlignment",value:(t,o,n)=>{if(function(e){return"figure"==e.name&&!e.hasClass("table")}(t))return;const s=xk(i,"",n),r=e.getAlign(t),a=e.getConsumables(t);return o.consumable.consume(t,a),r!==s?r:void 0}}})})),t.for("upcast").add(function(e){return t=>{t.on("element:div",((t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,attributes:"align"}))return;const n=iv(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,attributes:"align"});const s=o.convertItem(n,i.modelCursor),r=ti(s.modelRange.getItems());if(!r||!r.is("element","table"))return o.consumable.revert(i.viewItem,{name:!0,attributes:"align"}),void(s.modelRange&&!s.modelRange.isCollapsed&&(i.modelRange=s.modelRange,i.modelCursor=s.modelCursor));const a=function(e,t,i){if(e)switch(e){case"right":return"right"===t?"right":"left"===t?"left":"blockRight";case"center":return"center";case"left":return void 0===t?"blockLeft":"left";default:return i}return}(i.viewItem.getAttribute("align"),n.getAttribute("align"),xk(e,"",i));a&&o.writer.setAttribute("tableAlignment",a,r),o.convertChildren(i.viewItem,o.writer.createPositionAt(r,"end")),o.updateConversionResult(r,i)}))}}(i))}(t,i,o.alignment,n),e.commands.add("tableAlignment",new uA(e,o.alignment)),pA(t,i,{modelAttribute:"tableWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:o.width}),e.commands.add("tableWidth",new cA(e,o.width)),pA(t,i,{modelAttribute:"tableHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableHeight",new dA(e,o.height)),e.data.addStyleProcessorRules(Bl),function(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),kk(t,{viewElement:"table",...i}),Ak(t,i)}(t,i,{modelAttribute:"tableBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableBackgroundColor",new sA(e,o.backgroundColor)),Tk(e,"table");const s=e.editing.view.document;this.listenTo(s,"clipboardOutput",((t,i)=>{e.editing.view.change((e=>{for(const{item:t}of e.createRangeIn(i.content))mA(t,e);i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content))}))}),{priority:"lowest"})}}function mA(e,t){if(!e.is("element","table"))return;const i=e.getAttribute("align"),o=e.getStyle("float"),n=e.getStyle("margin-left"),s=e.getStyle("margin-right");i&&"center"===i||o&&"right"===o&&i&&"right"===i?gA(t,i,e):void 0===o&&"auto"===n&&"0"===s&&gA(t,"right",e)}function gA(e,t,i){const o=e.createPositionBefore(i),n=e.createContainerElement("div",{align:t},i);e.insert(o,n)}function pA(e,t,i){const{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),kk(t,{viewElement:/^(table|figure)$/,shouldUpcast:e=>!("table"==e.name&&"figure"==e.parent.name||"figure"==e.name&&!e.hasClass("table")),...i}),Ck(t,{modelElement:"table",...i})}class fA extends Au{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;widthInput;heightInput;alignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;const{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:d,dimensionsLabel:u}=this._createDimensionFields(),{alignmentToolbar:h,alignmentLabel:m}=this._createAlignmentFields();this.focusTracker=new ii,this.keystrokes=new ri,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=d,this.alignmentToolbar=h;const{saveButtonView:g,cancelButtonView:p}=this._createActionButtons();this.saveButtonView=g,this.cancelButtonView=p,this.backButtonView=this._createBackButton(),this._focusables=new tu,this._focusCycler=new $u({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const f=new ju(e,{label:this.t("Table properties")});f.children.add(this.backButtonView,0),this.children.add(f),this.children.add(new Km(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new Km(e,{children:[new Km(e,{labelView:u,children:[u,l,c,d],class:"ck-table-form__dimensions-row"}),new Km(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new Km(e,{labelView:m,children:[m,h],class:"ck-table-properties-form__alignment-row"})),this.children.add(new Km(e,{children:[this.cancelButtonView,this.saveButtonView],class:"ck-table-form__action-row"})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),Ou({view:this}),[this.borderColorInput,this.backgroundInput].forEach((e=>{this._focusCycler.chain(e.fieldView.focusCycler)})),[this.borderStyleDropdown,this.borderWidthInput,this.borderColorInput,this.widthInput,this.heightInput,this.backgroundInput,this.alignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){const e=this.options.defaultTableProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=IC({colorConfig:this.options.borderColors,columns:5,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new Du(o);r.text=n("Border");const a=kC(n),l=new Sh(o,rm);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",(e=>a[e||"none"])),l.fieldView.on("execute",(e=>{this.borderStyle=e.source._borderStyleValue})),l.bind("isEmpty").to(this,"borderStyle",(e=>!e)),Xh(l.fieldView,TC(this,t.style),{role:"menu",ariaLabel:s});const c=new Sh(o,nm);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",bA),c.fieldView.on("input",(()=>{this.borderWidth=c.fieldView.element.value}));const d=new Sh(o,i);return d.set({label:n("Color"),class:"ck-table-form__border-color"}),d.fieldView.bind("value").to(this,"borderColor"),d.bind("isEnabled").to(this,"borderStyle",bA),d.fieldView.on("input",(()=>{this.borderColor=d.fieldView.value})),this.on("change:borderStyle",((e,i,o,n)=>{bA(o)||(this.borderColor="",this.borderWidth=""),bA(n)||(this.borderColor=t.color,this.borderWidth=t.width)})),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:d,borderWidthInput:c}}_createBackgroundFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Background");const o=IC({colorConfig:this.options.backgroundColors,columns:5,defaultColorValue:this.options.defaultTableProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new Sh(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",(()=>{this.backgroundColor=n.fieldView.value})),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Dimensions");const o=new Sh(e,nm);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",(()=>{this.width=o.fieldView.element.value}));const n=new Au(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"×"}]});const s=new Sh(e,nm);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",(()=>{this.height=s.fieldView.element.value})),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createAlignmentFields(){const e=this.locale,t=this.t,i=new Du(e);i.text=t("Table Alignment");const o=new Wh(e);return o.set({role:"radiogroup",isCompact:!0,ariaLabel:t("Table alignment toolbar")}),PC({view:this,icons:{left:Jc,center:Gc,right:Zc,blockLeft:Yc,blockRight:Xc},toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){const e=this.locale,t=this.t,i=new Lu(e),o=new Lu(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),class:"ck-button-action",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",((...e)=>e.every((e=>!e)))),o.set({label:t("Cancel"),withText:!0}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){const e=this.locale.t,t=new Lu(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:ed,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}get _alignmentLabels(){const e=this.locale,t=this.t,i=t("Align table to the left with no text wrapping"),o=t("Align table to the right with no text wrapping"),n=t("Align table to the left with text wrapping"),s=t("Center table with no text wrapping"),r=t("Align table to the right with text wrapping");return"rtl"===e.uiLanguageDirection?{right:r,left:n,blockRight:o,center:s,blockLeft:i}:{blockLeft:i,center:s,blockRight:o,left:n,right:r}}}function bA(e){return"none"!==e}const wA={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"};class yA extends fc{_defaultContentTableProperties;_defaultLayoutTableProperties;_balloon;view=null;_viewWithContentTableDefaults=null;_viewWithLayoutTableDefaults=null;_undoStepBatch;_isReady;static get requires(){return[Qm]}static get pluginName(){return"TablePropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableProperties",{borderColors:SC,backgroundColors:SC})}init(){const e=this.editor;this._defaultContentTableProperties=fv(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._defaultLayoutTableProperties=pv(),this._balloon=e.plugins.get(Qm),e.ui.componentFactory.add("tableProperties",(()=>this._createTablePropertiesButton()))}_createTablePropertiesButton(){const e=this.editor,t=e.t,i=new Lu(e.locale);i.set({label:t("Table properties"),icon:'',tooltip:!0}),this.listenTo(i,"execute",(()=>this._showView()));const o=Object.values(wA).map((t=>e.commands.get(t)));return i.bind("isEnabled").toMany(o,"isEnabled",((...e)=>e.some((e=>e)))),i}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){const t=this.editor,i=t.config.get("table.tableProperties"),o=Ch(i.borderColors),n=vh(t.locale,o),s=Ch(i.backgroundColors),r=vh(t.locale,s),a=!1!==i.colorPicker,l=new fA(t.locale,{borderColors:n,backgroundColors:r,defaultTableProperties:e,colorPickerConfig:!!a&&(i.colorPicker||{})}),c=t.t;l.render(),this.listenTo(l,"submit",(()=>{this._hideView()})),this.listenTo(l,"cancel",(()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()})),l.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),Su({emitter:l,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});const d=vC(c),u=CC(c);return l.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle")),l.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:l.borderColorInput,commandName:"tableBorderColor",errorText:d,validator:AC})),l.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:l.borderWidthInput,commandName:"tableBorderWidth",errorText:u,validator:EC})),l.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:l.backgroundInput,commandName:"tableBackgroundColor",errorText:d,validator:AC})),l.on("change:width",this._getValidatedPropertyChangeCallback({viewField:l.widthInput,commandName:"tableWidth",errorText:u,validator:xC})),l.on("change:height",this._getValidatedPropertyChangeCallback({viewField:l.heightInput,commandName:"tableHeight",errorText:u,validator:xC})),l.on("change:alignment",this._getPropertyChangeCallback("tableAlignment")),l}_fillViewFormFromCommandValues(){const e=this.editor.commands,t=e.get("tableBorderStyle");Object.entries(wA).map((([t,i])=>{const o=t,n=this.view===this._viewWithContentTableDefaults?this._defaultContentTableProperties[o]||"":this._defaultLayoutTableProperties[o]||"";return[o,e.get(i).value||n]})).forEach((([e,i])=>{("borderColor"!==e&&"borderWidth"!==e||"none"!==t.value)&&this.view.set(e,i)})),this._isReady=!0}_showView(){const e=this.editor,t=gC(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||"layout"!==i.getAttribute("tableType");o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableProperties):o||this._viewWithLayoutTableDefaults||(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",(()=>{this._updateView()})),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:MC(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;gC(e.editing.view.document.selection)?this._isViewVisible&&FC(e,"table"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){const{commandName:t,viewField:i,validator:o,errorText:n}=e,s=Li((()=>{i.errorText=n}),500);return(e,n,r)=>{s.cancel(),this._isReady&&(o(r)?(this.editor.execute(t,{value:r,batch:this._undoStepBatch}),i.errorText=null):s())}}}function _A(e){const t=parseFloat(e);return e.endsWith("pt")?kA(96*t/72):e.endsWith("pc")?kA(12*t*96/72):e.endsWith("in")?kA(96*t):e.endsWith("cm")?kA(96*t/2.54):e.endsWith("mm")?kA(t/10*96/2.54):e}function kA(e){return Math.round(e)+"px"}function vA(e,t,i){if(!e.childCount)return;const o=new rl(e.document),n=function(e,t){const i=t.createRangeIn(e),o=[],n=new Set;for(const e of i.getItems()){if(!e.is("element")||!e.name.match(/^(p|h\d+|li|div)$/))continue;let t=VA(e);if(void 0===t||0!=parseFloat(t)||Array.from(e.getClassNames()).find((e=>e.startsWith("MsoList")))||(t=void 0),e.hasStyle("mso-list")&&"none"!==e.getStyle("mso-list")||void 0!==t&&n.has(t)){const i=RA(e);o.push({element:e,id:i.id,order:i.order,indent:i.indent,marginLeft:t}),void 0!==t&&n.add(t)}else n.clear()}return o}(e,o);if(!n.length)return;const s={},r=[];let a=AA();for(const e of n)if(void 0!==e.indent){EA(e)||(xA(o,r,a),a=AA(),r.length=0);const n=`${e.id}:${e.indent}`,l=Math.min(e.indent-1,r.length);if(lr.length-1||r[l].listElement.name!=a.type){0==l&&"ol"==a.type&&void 0!==e.id&&s[n]&&(a.startIndex=s[n]);const t=IA(a,o,i);if(0==r.length){const i=e.element.parent,n=i.getChildIndex(e.element)+1;o.insertChild(n,t,i)}else{const e=r[l-1].listItemElements;o.appendChild(t,e[e.length-1])}r[l]={...e,listElement:t,listItemElements:[]},0==l&&void 0!==e.id&&(s[n]=a.startIndex||1)}}const c="li"==e.element.name?e.element:o.createElement("li");CA(o,r,a,e,c,l),o.appendChild(c,r[l].listElement),r[l].listItemElements.push(c),0==l&&void 0!==e.id&&s[n]++,e.element!=c&&o.appendChild(e.element,c),OA(e.element,o),o.removeStyle("text-indent",e.element),o.removeStyle("margin-left",e.element)}else{const t=r.find((t=>t.marginLeft==e.marginLeft));if(t){const i=t.listItemElements;o.appendChild(e.element,i[i.length-1]),o.removeStyle("margin-left",e.element)}else r.length=0}xA(o,r,a)}function CA(e,t,i,o,n,s){if(void 0===o.marginLeft)return void(0==s&&(i.canApplyMarginOnList=!1));const r=parseFloat(o.marginLeft);let a=0;if(t.length>1){const e=t[t.length-2].listItemElements;if(e.length>0){const t=e[e.length-1].getStyle("margin-left");void 0!==t&&(a+=parseFloat(t))}}a+=40*t.length;const l=r-a,c=0!==l?kA(l):void 0;c&&(e.setStyle("margin-left",c,n),0==s&&i.canApplyMarginOnList&&(void 0===i.marginLeft&&(i.marginLeft=c),c!==i.marginLeft&&(i.canApplyMarginOnList=!1),i.topLevelListItemElements.push(n)))}function AA(){return{marginLeft:void 0,canApplyMarginOnList:!0,topLevelListItemElements:[]}}function xA(e,t,i){if(i.canApplyMarginOnList&&i.marginLeft&&i.topLevelListItemElements.length>0){e.setStyle("margin-left",i.marginLeft,t[0].listElement);for(const t of i.topLevelListItemElements)e.removeStyle("margin-left",t)}}function EA(e){const t=e.element.previousSibling;if(!t){const t=e.element.parent;return TA(t)&&(!t.previousSibling||TA(t.previousSibling))}return TA(t)}function TA(e){return e.is("element","ol")||e.is("element","ul")}function PA(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),o=/mso-level-number-format:([^;]{0,100});/gi,n=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),r=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=r.exec(t),c=a&&!l,d=i.exec(t);let u="decimal",h="ol",m=null;if(d&&d[1]){const t=o.exec(d[1]);if(t&&t[1]&&(u=t[1].trim(),h="bullet"!==u&&"image"!==u?"ol":"ul"),"bullet"===u){const t=function(e){if("li"==e.name&&"ul"==e.parent.name&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const i=t._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(e.element);t&&(u=t)}else{const e=n.exec(d[1]);e&&e[1]&&(m=parseInt(e[1]))}c&&(h="ol")}return{type:h,startIndex:m,style:SA(u),isLegalStyleList:c}}function SA(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function IA(e,t,i){const o=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,o),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,o),e.isLegalStyleList&&i&&t.addClass("legal-list",o),o}function RA(e){const t=e.getStyle("mso-list");if(void 0===t)return{};const i=t.match(/(^|\s{1,100})l(\d+)/i),o=t.match(/\s{0,100}lfo(\d+)/i),n=t.match(/\s{0,100}level(\d+)/i);return i&&o&&n?{id:i[2],order:o[1],indent:parseInt(n[1])}:{indent:1}}function OA(e,t){const i=new uo({name:"span",styles:{"mso-list":"Ignore"}}),o=t.createRangeIn(e);for(const e of o)"elementStart"===e.type&&i.match(e.item)&&t.remove(e.item)}function VA(e){const t=e.getStyle("margin-left");return void 0===t||t.endsWith("px")?t:_A(t)}function DA(e,t){if(!e.childCount)return;const i=new rl(e.document),o=function(e,t){const i=t.createRangeIn(e),o=new uo({name:/v:(.+)/}),n=[];for(const e of i){if("elementStart"!=e.type)continue;const t=e.item,i=t.previousSibling,s=i&&i.is("element")?i.name:null,r=["Chart"],a=o.match(t),l=t.getAttribute("o:gfxdata"),c="v:shapetype"===s,d=l&&r.some((e=>t.getAttribute("id").includes(e)));a&&l&&!c&&!d&&n.push(e.item.getAttribute("id"))}return n}(e,i);!function(e,t,i){const o=i.createRangeIn(t),n=new uo({name:"img"}),s=[];for(const t of o)if(t.item.is("element")&&n.match(t.item)){const i=t.item,o=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];o.length&&o.every((t=>e.indexOf(t)>-1))?s.push(i):i.getAttribute("src")||s.push(i)}for(const e of s)i.remove(e)}(o,e,i),function(e,t,i){const o=i.createRangeIn(t),n=[];for(const t of o)if("elementStart"==t.type&&t.item.is("element","v:shape")){const i=t.item.getAttribute("id");if(e.includes(i))continue;s(t.item.parent.getChildren(),i)||n.push(t.item)}for(const e of n){const t={src:r(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const o=i.createElement("img",t);i.insertChild(e.index+1,o,e.parent)}function s(e,t){for(const i of e)if(i.is("element")){if("img"==i.name&&i.getAttribute("v:shapes")==t)return!0;if(s(i.getChildren(),t))return!0}return!1}function r(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(o,e,i),function(e,t){const i=t.createRangeIn(e),o=new uo({name:/v:(.+)/}),n=[];for(const e of i)"elementStart"==e.type&&o.match(e.item)&&n.push(e.item);for(const e of n)t.remove(e)}(e,i);const n=function(e,t){const i=t.createRangeIn(e),o=new uo({name:"img"}),n=[];let s=0;for(const e of i)e.item.is("element")&&o.match(e.item)&&(e.item.getAttribute("src").startsWith("file://")&&n.push({element:e.item,imageIndex:s}),s++);return n}(e,i);n.length&&function(e,t,i){for(let o=0;oString.fromCharCode(parseInt(e,16)))).join(""))}function MA(e,t){for(const i of t.createRangeIn(e).getItems())i.is("element","table")&&("0px"===i.getStyle("width")&&t.removeStyle("width",i),"0"===i.getAttribute("width")&&t.removeAttribute("width",i))}function NA(e,t){const i=[],o=[];for(const{item:n}of e.createRangeIn(t))if(n.is("element")&&n.getStyle("mso-footnote-id")){i.unshift(n);const{nextSibling:e}=n;e?.is("$text")&&e.data.startsWith(" ")&&o.unshift(e)}for(const t of i)e.remove(t);for(const t of o){const i=t.data.substring(1);if(i.length>0){const o=t.parent,n=o.getChildIndex(t),s=e.createText(i);e.remove(t),e.insertChild(n,s,o)}else e.remove(t)}return t}function BA(e,t){const i=e.createElement("sup",{class:"footnote"}),o=e.createElement("a",{id:`ref-${t}`,href:`#${t}`});return e.appendChild(o,i),i}function LA(e,t){const i=e.createElement("li",{id:t,class:"footnote-definition"}),o=e.createElement("a",{href:`#ref-${t}`,class:"footnote-backlink"}),n=e.createElement("div",{class:"footnote-content"});return e.appendChild(e.createText("^"),o),e.appendChild(o,i),e.appendChild(n,i),{listItem:i,content:n}}const zA=//i,jA=/xmlns:o="urn:schemas-microsoft-com/i;class $A{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;constructor(e,t=!1,i=!1){this.document=e,this.hasMultiLevelListPlugin=t,this.hasTablePropertiesPlugin=i}isActive(e){return zA.test(e)||jA.test(e)}execute(e){const t=new rl(this.document),{body:i,stylesString:o}=e._parsedData;!function(e,t){const i=[];for(const o of t.createRangeIn(e)){const e=o.item;e.is("element","a")&&!e.hasAttribute("href")&&(e.hasAttribute("id")||e.hasAttribute("name"))&&i.push(e)}for(const e of i){const i=e.parent.getChildIndex(e)+1,o=e.getChildren();t.insertChild(i,o,e.parent)}}(i,t),vA(i,o,this.hasMultiLevelListPlugin),DA(i,e.dataTransfer.getData("text/rtf")),function(e,t,i=!1){for(const o of t.createRangeIn(e).getItems()){if(!o.is("element","table")&&!o.is("element","td")&&!o.is("element","th"))continue;if(i&&o.is("element","table")){const e=o.parent?.is("element","div")?o.parent:null,i=o.parent?.parent?.is("element","div")?o.parent.parent:null,n=e??i;n&&"center"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","auto",o)):n&&"right"===n.getAttribute("align")&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","0",o)):n||o.getAttribute("align")||(t.setStyle("margin-left","0",o),t.setStyle("margin-right","auto",o))}const e=["left","top","right","bottom"];if(e.every((e=>!o.hasStyle(`border-${e}-style`))))t.setStyle("border-style","none",o);else for(const i of e)o.hasStyle(`border-${i}-style`)||t.setStyle(`border-${i}-style`,"none",o);const n=["width","height",...e.map((e=>`border-${e}-width`)),...e.map((e=>`padding-${e}`))];for(const e of n)o.hasStyle(e)&&t.setStyle(e,_A(o.getStyle(e)),o)}}(i,t,this.hasTablePropertiesPlugin),MA(i,t),function(e,t){const i=new Map,o=new Map;let n=null;for(const{item:s}of t.createRangeIn(e))if(s.is("element"))if("footnote-list"!==s.getStyle("mso-element")){if(s.hasStyle("mso-footnote-id")){const e=s.findAncestor("element",(e=>"footnote"===e.getStyle("mso-element")));if(e){const t=e.getAttribute("id");o.set(t,e)}else{const e=s.getStyle("mso-footnote-id");i.set(e,s)}}}else n=s;if(!i.size||!n)return;const s=function(e){return e.createElement("ol",{class:"footnotes"})}(t);t.replace(n,s);for(const[e,n]of i){const i=o.get(e);if(!i)continue;t.replace(n,BA(t,e));const r=LA(t,e);NA(t,i);for(const e of i.getChildren()){let i=e;e.is("element")&&(i=t.clone(e,!0)),t.appendChild(i,r.content)}t.appendChild(r.listItem,s)}}(i,t),function(e){const t=[],i=new rl(e.document);for(const{item:o}of i.createRangeIn(e))if(o.is("element")){for(const e of o.getClassNames())/\bmso/gi.exec(e)&&i.removeClass(e,o);for(const e of o.getStyleNames())/\bmso/gi.exec(e)&&i.removeStyle(e,o);(o.is("element","w:sdt")||o.is("element","w:sdtpr")&&o.isEmpty||o.is("element","o:p")&&o.isEmpty)&&t.push(o)}for(const e of t){const t=e.parent,o=t.getChildIndex(e);i.insertChild(o,e.getChildren(),t),i.remove(e)}}(i),e.content=i}}function qA(e,t,i,{blockElements:o,inlineObjectElements:n}){let s=i.createPositionAt(e,"forward"==t?"after":"before");return s=s.getLastMatchingPosition((({item:e})=>e.is("element")&&!o.includes(e.name)&&!n.includes(e.name)),{direction:t}),"forward"==t?s.nodeAfter:s.nodeBefore}function HA(e,t){return!!e&&e.is("element")&&t.includes(e.name)}function WA(e){let t=e;for(;t;){if(t.is("element")){const e=t.getStyle?.("white-space");if("pre-wrap"===e)return!0}t=t.parent}return!1}function UA(e,t,i){const{parent:o,data:n}=e,s=n.replaceAll("\t"," ".repeat(i)),r=o.getChildIndex(e);t.remove(e),t.insertChild(r,t.createText(s),o)}const KA=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class GA{document;constructor(e){this.document=e}isActive(e){return KA.test(e)}execute(e){const t=new rl(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}(i,t),function(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","li")){const i=e.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}(i,t),function(e,t){const i=new Ho(t.document.stylesProcessor),o=new Rn(i,{renderingMode:"data"}),n=o.blockElements,s=o.inlineObjectElements,r=[];for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","br")){const i=qA(e,"forward",t,{blockElements:n,inlineObjectElements:s}),o=qA(e,"backward",t,{blockElements:n,inlineObjectElements:s}),a=HA(i,n);(HA(o,n)||a)&&r.push(e)}}for(const e of r)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(i,t),function(e,t,i){const o=new Set;for(const i of t.createRangeIn(e).getItems())i.is("view:$textProxy")&&i.data.includes("\t")&&WA(i.parent)&&o.add(i.textNode);for(const e of o)UA(e,t,i)}(i,t,8),e.content=i}}const JA=/(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length)))}function YA(e,t){const i=new DOMParser,o=function(e){return QA(QA(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(e){const t="",i="",o=e.indexOf(t);if(o<0)return e;const n=e.indexOf(i,o+t.length);return e.substring(0,o+t.length)+(n>=0?e.substring(n):"")}(e=(e=e.replace(//,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(HT.source+"\\s*$"),/^$/,!1]];const UT=[["table",function(e,t,i,o){if(t+2>i)return!1;let n=t+1;if(e.sCount[n]=4)return!1;let s=e.bMarks[n]+e.tShift[n];if(s>=e.eMarks[n])return!1;const r=e.src.charCodeAt(s++);if(124!==r&&45!==r&&58!==r)return!1;if(s>=e.eMarks[n])return!1;const a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a&&!eT(a))return!1;if(45===r&&eT(a))return!1;for(;s=4)return!1;c=BT(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const u=c.length;if(0===u||u!==d.length)return!1;if(o)return!0;const h=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),g=[t,0];e.push("table_open","table",1).map=g,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t=4)break;if(c=BT(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),f+=u-c.length,f>65536)break;if(n===t+2){e.push("tbody_open","tbody",1).map=p=[t+2,0]}e.push("tr_open","tr",1).map=[n,n+1];for(let t=0;t=4))break;o++,n=o}e.line=n;const s=e.push("code_block","code",0);return s.content=e.getLines(t,n,4+e.blkIndent,!1)+"\n",s.map=[t,e.line],!0}],["fence",function(e,t,i,o){let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(n+3>s)return!1;const r=e.src.charCodeAt(n);if(126!==r&&96!==r)return!1;let a=n;n=e.skipChars(n,r);let l=n-a;if(l<3)return!1;const c=e.src.slice(a,n),d=e.src.slice(n,s);if(96===r&&d.indexOf(String.fromCharCode(r))>=0)return!1;if(o)return!0;let u=t,h=!1;for(;(u++,!(u>=i))&&(n=a=e.bMarks[u]+e.tShift[u],s=e.eMarks[u],!(n=4||(n=e.skipChars(n,r),n-a=4)return!1;if(62!==e.src.charCodeAt(n))return!1;if(o)return!0;const a=[],l=[],c=[],d=[],u=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let m,g=!1;for(m=t;m=s)break;if(62===e.src.charCodeAt(n++)&&!t){let t,i,o=e.sCount[m]+1;32===e.src.charCodeAt(n)?(n++,o++,i=!1,t=!0):9===e.src.charCodeAt(n)?(t=!0,(e.bsCount[m]+o)%4==3?(n++,o++,i=!1):i=!0):t=!1;let r=o;for(a.push(e.bMarks[m]),e.bMarks[m]=n;n=s,l.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(t?1:0),c.push(e.sCount[m]),e.sCount[m]=r-o,d.push(e.tShift[m]),e.tShift[m]=n-e.bMarks[m];continue}if(g)break;let o=!1;for(let t=0,n=u.length;t";const b=[t,0];f.map=b,e.md.block.tokenize(e,t,m),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=r,e.parentType=h,b[1]=e.line;for(let i=0;i=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(42!==r&&45!==r&&95!==r)return!1;let a=1;for(;s=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(m=!0),(h=zT(e,l))>=0){if(d=!0,r=e.bMarks[l]+e.tShift[l],u=Number(e.src.slice(r,h-1)),m&&1!==u)return!1}else{if(!((h=LT(e,l))>=0))return!1;d=!1}if(m&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(o)return!0;const g=e.src.charCodeAt(h-1),p=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),1!==u&&(a.attrs=[["start",u]])):a=e.push("bullet_list_open","ul",1);const f=[l,0];a.map=f,a.markup=String.fromCharCode(g);let b=!1;const w=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";l=n?1:o-t,m>4&&(m=1);const p=t+m;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(g);const f=[l,0];a.map=f,d&&(a.info=e.src.slice(r,h-1));const y=e.tight,_=e.tShift[l],k=e.sCount[l],v=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=p,e.tight=!0,e.tShift[l]=u-e.bMarks[l],e.sCount[l]=o,u>=n&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,l,i,!0),e.tight&&!b||(c=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=v,e.tShift[l]=_,e.sCount[l]=k,e.tight=y,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(g),l=e.line,f[1]=l,l>=i)break;if(e.sCount[l]=4)break;let C=!1;for(let t=0,o=w.length;t=4)return!1;if(91!==e.src.charCodeAt(n))return!1;function a(t){const i=e.lineMax;if(t>=i||e.isEmpty(t))return null;let o=!1;if(e.sCount[t]-e.blkIndent>3&&(o=!0),e.sCount[t]<0&&(o=!0),!o){const o=e.md.block.ruler.getRules("reference"),n=e.parentType;e.parentType="reference";let s=!1;for(let n=0,r=o.length;n=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(n))return!1;let r=e.src.slice(n,s),a=0;for(;a=4)return!1;let r=e.src.charCodeAt(n);if(35!==r||n>=s)return!1;let a=1;for(r=e.src.charCodeAt(++n);35===r&&n6||nn&&eT(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const d=e.push("inline","",0);return d.content=e.src.slice(n,s).trim(),d.map=[t,e.line],d.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,i){const o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const n=e.parentType;e.parentType="paragraph";let s,r=0,a=t+1;for(;a3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const i=e.eMarks[a];if(t=i))){r=61===s?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let n=0,s=o.length;n3)continue;if(e.sCount[s]<0)continue;let t=!1;for(let n=0,r=o.length;n=i))&&!(e.sCount[r]=s){e.line=i;break}const t=e.line;let l=!1;for(let s=0;s=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),r=e.line,r0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(n),o},JT.prototype.scanDelims=function(e,t){const i=this.posMax,o=this.src.charCodeAt(e),n=e>0?this.src.charCodeAt(e-1):32;let s=e;for(;s?@[]^_`{|}~-".split("").forEach((function(e){XT[e.charCodeAt(0)]=1}));const tP={tokenize:function(e,t){const i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(126!==o)return!1;const n=e.scanDelims(e.pos,!0);let s=n.length;const r=String.fromCharCode(o);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=r,s--);for(let t=0;t=0;i--){const o=t[i];if(95!==o.marker&&42!==o.marker)continue;if(-1===o.end)continue;const n=t[o.end],s=i>0&&t[i-1].end===o.end+1&&t[i-1].marker===o.marker&&t[i-1].token===o.token-1&&t[o.end+1].token===n.token+1,r=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?r+r:r,a.content="";const l=e.tokens[n.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?r+r:r,l.content="",s&&(e.tokens[t[i-1].token].content="",e.tokens[t[o.end+1].token].content="",i--)}}const oP={tokenize:function(e,t){const i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;const n=e.scanDelims(e.pos,42===o);for(let t=0;t\x00-\x20]*)$/;const rP=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,aP=/^&([a-z][a-z0-9]{1,31});/i;function lP(e){const t={},i=e.length;if(!i)return;let o=0,n=-2;const s=[];for(let r=0;ra;l-=s[l]+1){const t=e[l];if(t.marker===i.marker&&(t.open&&t.end<0)){let o=!1;if((t.close||i.open)&&(t.length+i.length)%3==0&&(t.length%3==0&&i.length%3==0||(o=!0)),!o){const o=l>0&&!e[l-1].open?s[l-1]+1:0;s[r]=r-l+o,s[l]=o,i.open=!1,t.end=r,t.close=!1,c=-1,n=-2;break}}}-1!==c&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=c)}}const cP=[["text",function(e,t){let i=e.pos;for(;i0)return!1;const i=e.pos;if(i+3>e.posMax)return!1;if(58!==e.src.charCodeAt(i))return!1;if(47!==e.src.charCodeAt(i+1))return!1;if(47!==e.src.charCodeAt(i+2))return!1;const o=e.pending.match(YT);if(!o)return!1;const n=o[1],s=e.md.linkify.matchAtStart(e.src.slice(i-n.length));if(!s)return!1;let r=s.url;if(r.length<=n.length)return!1;r=r.replace(/\*+$/,"");const a=e.md.normalizeLink(r);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-n.length);const t=e.push("link_open","a",1);t.attrs=[["href",a]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(r);const i=e.push("link_close","a",-1);i.markup="linkify",i.info="auto"}return e.pos+=r.length-n.length,!0}],["newline",function(e,t){let i=e.pos;if(10!==e.src.charCodeAt(i))return!1;const o=e.pending.length-1,n=e.posMax;if(!t)if(o>=0&&32===e.pending.charCodeAt(o))if(o>=1&&32===e.pending.charCodeAt(o-1)){let t=o-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i=o)return!1;let n=e.src.charCodeAt(i);if(10===n){for(t||e.push("hardbreak","br",0),i++;i=55296&&n<=56319&&i+1=56320&&t<=57343&&(s+=e.src[i+1],i++)}const r="\\"+s;if(!t){const t=e.push("text_special","",0);n<256&&0!==XT[n]?t.content=s:t.content=r,t.markup=r,t.info="escape"}return e.pos=i+1,!0}],["backticks",function(e,t){let i=e.pos;if(96!==e.src.charCodeAt(i))return!1;const o=i;i++;const n=e.posMax;for(;i=u)return!1;if(l=g,n=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),n.ok){for(r=e.md.normalizeLink(n.str),e.md.validateLink(r)?g=n.pos:r="",l=g;g=u||41!==e.src.charCodeAt(g))&&(c=!0),g++}if(c){if(void 0===e.env.references)return!1;if(g=0?o=e.src.slice(l,g++):g=m+1):g=m+1,o||(o=e.src.slice(h,m)),s=e.env.references[nT(o)],!s)return e.pos=d,!1;r=s.href,a=s.title}if(!t){e.pos=h,e.posMax=m;const t=[["href",r]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=u,!0}],["image",function(e,t){let i,o,n,s,r,a,l,c,d="";const u=e.pos,h=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const m=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(s=g+1,s=h)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(d=e.md.normalizeLink(a.str),e.md.validateLink(d)?s=a.pos:d=""),c=s;s=h||41!==e.src.charCodeAt(s))return e.pos=u,!1;s++}else{if(void 0===e.env.references)return!1;if(s=0?n=e.src.slice(c,s++):s=g+1):s=g+1,n||(n=e.src.slice(m,g)),r=e.env.references[nT(n)],!r)return e.pos=u,!1;d=r.href,l=r.title}if(!t){o=e.src.slice(m,g);const t=[];e.md.inline.parse(o,e.md,e.env,t);const i=e.push("image","img",0),n=[["src",d],["alt",""]];i.attrs=n,i.children=t,i.content=o,l&&n.push(["title",l])}return e.pos=s,e.posMax=h,!0}],["autolink",function(e,t){let i=e.pos;if(60!==e.src.charCodeAt(i))return!1;const o=e.pos,n=e.posMax;for(;;){if(++i>=n)return!1;const t=e.src.charCodeAt(i);if(60===t)return!1;if(62===t)break}const s=e.src.slice(o+1,i);if(sP.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const o=e.push("link_close","a",-1);o.markup="autolink",o.info="auto"}return e.pos+=s.length+2,!0}if(nP.test(s)){const i=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(i))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",i]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const o=e.push("link_close","a",-1);o.markup="autolink",o.info="auto"}return e.pos+=s.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const i=e.posMax,o=e.pos;if(60!==e.src.charCodeAt(o)||o+2>=i)return!1;const n=e.src.charCodeAt(o+1);if(33!==n&&63!==n&&47!==n&&!function(e){const t=32|e;return t>=97&&t<=122}(n))return!1;const s=e.src.slice(o).match(qT);if(!s)return!1;if(!t){const t=e.push("html_inline","",0);t.content=s[0],r=t.content,/^\s]/i.test(r)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}var r;return e.pos+=s[0].length,!0}],["entity",function(e,t){const i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1>=o)return!1;if(35===e.src.charCodeAt(i+1)){const o=e.src.slice(i).match(rP);if(o){if(!t){const t="x"===o[1][0].toLowerCase()?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=zE(t)?jE(t):jE(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(i).match(aP);if(o){const i=SE(o[0]);if(i!==o[0]){if(!t){const t=e.push("text_special","",0);t.content=i,t.markup=o[0],t.info="entity"}return e.pos+=o[0].length,!0}}}return!1}]],dP=[["balance_pairs",function(e){const t=e.tokens_meta,i=e.tokens_meta.length;lP(e.delimiters);for(let e=0;e0&&o++,"text"===n[t].type&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,s[t]=e.pos},uP.prototype.tokenize=function(e){const t=this.ruler.getRules(""),i=t.length,o=e.posMax,n=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(r){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},uP.prototype.parse=function(e,t,i,o){const n=new this.State(e,t,i,o);this.tokenize(n);const s=this.ruler2.getRules(""),r=s.length;for(let e=0;e=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:o.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,i){const o=e.slice(t);return i.re.mailto||(i.re.mailto=new RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(o)?o.match(i.re.mailto)[0].length:0}}},yP="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function _P(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=lE.source,t.src_Cc=cE.source,t.src_Z=uE.source,t.src_P=rE.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const i="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+i+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),i=e.__tlds__.slice();function o(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||i.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),i.push(t.src_xn),t.src_tlds=i.join("|"),t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const n=[];function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){const i=e.__schemas__[t];if(null===i)return;const o={validate:null,link:null};if(e.__compiled__[t]=o,"[object Object]"===gP(i))return!function(e){return"[object RegExp]"===gP(e)}(i.validate)?pP(i.validate)?o.validate=i.validate:s(t,i):o.validate=function(e){return function(t,i){const o=t.slice(i);return e.test(o)?o.match(e)[0].length:0}}(i.validate),void(pP(i.normalize)?o.normalize=i.normalize:i.normalize?s(t,i):o.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===gP(e)}(i)?s(t,i):n.push(t)})),n.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const r=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(fP).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function kP(e,t){const i=e.__index__,o=e.__last_index__,n=e.__text_cache__.slice(i,o);this.schema=e.__schema__.toLowerCase(),this.index=i+t,this.lastIndex=o+t,this.raw=n,this.text=n,this.url=n}function vP(e,t){const i=new kP(e,t);return e.__compiled__[i.schema].normalize(i,e),i}function CP(e,t){if(!(this instanceof CP))return new CP(e,t);var i;t||(i=e,Object.keys(i||{}).reduce((function(e,t){return e||bP.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=mP({},bP,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=mP({},wP,e),this.__compiled__={},this.__tlds__=yP,this.__tlds_replaced__=!1,this.re={},_P(this)}CP.prototype.add=function(e,t){return this.__schemas__[e]=t,_P(this),this},CP.prototype.set=function(e){return this.__opts__=mP(this.__opts__,e),this},CP.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,i,o,n,s,r,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(n=this.testSchemaAt(e,t[2],a.lastIndex),n){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(o=e.match(this.re.email_fuzzy))&&(s=o.index+o[1].length,r=o.index+o[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=r))),this.__index__>=0},CP.prototype.pretest=function(e){return this.re.pretest.test(e)},CP.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0},CP.prototype.match=function(e){const t=[];let i=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(vP(this,i)),i=this.__last_index__);let o=i?e.slice(i):e;for(;this.test(o);)t.push(vP(this,i)),o=o.slice(this.__last_index__),i+=this.__last_index__;return t.length?t:null},CP.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const i=this.testSchemaAt(e,t[2],t[0].length);return i?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i,vP(this,0)):null},CP.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,i){return e!==i[t-1]})).reverse(),_P(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,_P(this),this)},CP.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},CP.prototype.onCompile=function(){};const AP=CP,xP=2147483647,EP=36,TP=/^xn--/,PP=/[^\0-\x7F]/,SP=/[\x2E\u3002\uFF0E\uFF61]/g,IP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},RP=Math.floor,OP=String.fromCharCode;function VP(e){throw new RangeError(IP[e])}function DP(e,t){const i=e.split("@");let o="";i.length>1&&(o=i[0]+"@",e=i[1]);const n=function(e,t){const i=[];let o=e.length;for(;o--;)i[o]=t(e[o]);return i}((e=e.replace(SP,".")).split("."),t).join(".");return o+n}function FP(e){const t=[];let i=0;const o=e.length;for(;i=55296&&n<=56319&&i>1,e+=RP(e/t);e>455;o+=EP)e=RP(e/35);return RP(o+36*e/(e+38))},BP=function(e){const t=[],i=e.length;let o=0,n=128,s=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let i=0;i=128&&VP("not-basic"),t.push(e.charCodeAt(i));for(let l=r>0?r+1:0;l=i&&VP("invalid-input");const r=(a=e.charCodeAt(l++))>=48&&a<58?a-48+26:a>=65&&a<91?a-65:a>=97&&a<123?a-97:EP;r>=EP&&VP("invalid-input"),r>RP((xP-o)/t)&&VP("overflow"),o+=r*t;const c=n<=s?1:n>=s+26?26:n-s;if(rRP(xP/d)&&VP("overflow"),t*=d}const c=t.length+1;s=NP(o-r,c,0==r),RP(o/c)>xP-n&&VP("overflow"),n+=RP(o/c),o%=c,t.splice(o++,0,n)}var a;return String.fromCodePoint(...t)},LP=function(e){const t=[],i=(e=FP(e)).length;let o=128,n=0,s=72;for(const i of e)i<128&&t.push(OP(i));const r=t.length;let a=r;for(r&&t.push("-");a=o&&tRP((xP-n)/l)&&VP("overflow"),n+=(i-o)*l,o=i;for(const i of e)if(ixP&&VP("overflow"),i===o){let e=n;for(let i=EP;;i+=EP){const o=i<=s?1:i>=s+26?26:i-s;if(eString.fromCodePoint(...e)},decode:BP,encode:LP,toASCII:function(e){return DP(e,(function(e){return PP.test(e)?"xn--"+LP(e):e}))},toUnicode:function(e){return DP(e,(function(e){return TP.test(e)?BP(e.slice(4).toLowerCase()):e}))}},jP={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},$P=/^(vbscript|javascript|file|data):/,qP=/^data:image\/(gif|png|jpeg|webp);/;function HP(e){const t=e.trim().toLowerCase();return!$P.test(t)||qP.test(t)}const WP=["http:","https:","mailto:"];function UP(e){const t=sE(e,!0);if(t.hostname&&(!t.protocol||WP.indexOf(t.protocol)>=0))try{t.hostname=zP.toASCII(t.hostname)}catch(e){}return Wx(Ux(t))}function KP(e){const t=sE(e,!0);if(t.hostname&&(!t.protocol||WP.indexOf(t.protocol)>=0))try{t.hostname=zP.toUnicode(t.hostname)}catch(e){}return $x(Ux(t),$x.defaultChars+"%")}function GP(e,t){if(!(this instanceof GP))return new GP(e,t);t||FE(e)||(t=e||{},e="default"),this.inline=new hP,this.block=new GT,this.core=new DT,this.renderer=new uT,this.linkify=new AP,this.validateLink=HP,this.normalizeLink=UP,this.normalizeLinkText=KP,this.utils=o,this.helpers=BE({},n),this.options={},this.configure(e),t&&this.set(t)}GP.prototype.set=function(e){return BE(this.options,e),this},GP.prototype.configure=function(e){const t=this;if(FE(e)){const t=e;if(!(e=jP[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(i){e.components[i].rules&&t[i].ruler.enableOnly(e.components[i].rules),e.components[i].rules2&&t[i].ruler2.enableOnly(e.components[i].rules2)})),this},GP.prototype.enable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.enable(e,!0))}),this),i=i.concat(this.inline.ruler2.enable(e,!0));const o=e.filter((function(e){return i.indexOf(e)<0}));if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},GP.prototype.disable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){i=i.concat(this[t].ruler.disable(e,!0))}),this),i=i.concat(this.inline.ruler2.disable(e,!0));const o=e.filter((function(e){return i.indexOf(e)<0}));if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},GP.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},GP.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const i=new this.core.State(e,this,t);return this.core.process(i),i.tokens},GP.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},GP.prototype.parseInline=function(e,t){const i=new this.core.State(e,this,t);return i.inlineMode=!0,this.core.process(i),i.tokens},GP.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const JP=GP;var ZP=i(428),QP=i.n(ZP);const YP=/^(#{1,3})(\d+|[A-Z][A-Z0-9_]*-\d+)(?!\w)/;function XP(e,t){const i=e.pos,o=e.src;if(35!==o.charCodeAt(i))return!1;if(i>0&&/[\w#]/.test(o[i-1]))return!1;const n=YP.exec(o.slice(i));if(!n)return!1;if(t)return e.pos=i+n[0].length,!0;if(function(e){if(!e.some((e=>"html_inline"===e.type&&e.content.startsWith("=0;t--){const i=e[t];if("html_inline"!==i.type)continue;const o=i.content;if(o.startsWith("${a}`:`${a}`;return e.push("html_inline","",0).content=l,!0}const eS=/(?:\\\[){3}([0-9]+):([^\\\n]+)(?:\\\]){3}/;class tS{constructor(e){const t=e.editing.view.document;this._htmlDP=new Ir(t),this._domConverter=new Rn(t),this.editor=e}toView(e){const t=JP({html:!0,breaks:!0,langPrefix:"language-"});let i=t.use(QP(),{label:!0});i.inline.ruler.before("text","op_workpackage_ref",XP),i.inline.ruler.before("text","op_wiki_page_link",((e,t)=>function(e,t,i){const o=e.pos,n=e.src;if(92!==n.charCodeAt(o))return!1;const s=n.slice(o),r=eS.exec(s);if(!r)return!1;if(t)return!0;const a=r[1],l=r[2],c=crypto.randomUUID(),d=`\n`;return e.push("html_inline","",0).content=d,e.pos=o+r[0].length,!0}(e,t,this.editor)));const o=i.renderer.rules.code_block;t.renderer.rules.code_block=function(e,t,i,n,s){return e[t].content=e[t].content.replace(/\n$/,""),o(e,t,i,n,s)};const n=i.render(e),s=this._htmlDP._toDom(n);!function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(;t=i.nextNode();)t.previousElementSibling&&t.previousElementSibling.classList.contains("task-list-item-checkbox")&&(t.textContent=t.textContent.replace(/^\s+/,""))}(s),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("BR"===e.tagName&&!e.parentElement)return NodeFilter.FILTER_ACCEPT}}),o=[];for(;t=i.nextNode();)o.push(t);for(const t of o){const i=document.createElement("p");e.insertBefore(i,t),Lx(t)?i.appendChild(t):t.remove()}}(s),function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("P"===e.tagName&&e.parentElement&&"TD"===e.parentElement.tagName&&1===e.childNodes.length&&"BR"===e.childNodes[0].nodeName)return NodeFilter.FILTER_ACCEPT}});let i;for(;i=t.nextNode();)i.childNodes[0].remove()}(s),function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("BR"===e.tagName&&e.parentElement&&"LI"===e.parentElement.tagName)return NodeFilter.FILTER_ACCEPT}});let i,o=[];for(;i=t.nextNode();)o.push(i);for(const e of o)e.parentElement.insertBefore(document.createElement("p"),e),e.remove()}(s),s.querySelectorAll("input.task-list-item-checkbox").forEach((e=>{const t=e.closest("li.task-list-item");t&&e.parentElement!==t&&(e.parentElement&&e.parentElement.removeChild(e),t.insertBefore(e,t.firstChild))}));return this._domConverter.domToView(s)}toData(e){const t=this._domConverter.viewToDom(e,document);!function(e,t,i){t=t.map((e=>e.toUpperCase())),i=i.map((e=>e.toUpperCase()));let o,n=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(;o=n.nextNode();)o.parentElement&&t.indexOf(o.parentElement.nodeName)>=0&&(o.nodeValue=o.nodeValue.replace(/^[\u00a0]+/g," ").replace(/[\u00a0]+$/g," ")),Nx(o,i)||(o.nodeValue=_.escape(o.nodeValue))}(t,["strong","em"],["pre","code","table"]),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,(function(e){return"a"===e.nodeName.toLowerCase()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}));for(;t=i.nextNode();)t.setAttribute("href",t.href)}(t),function(e){let t,i=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){if("P"===e.tagName&&0===e.childNodes.length&&(!e.parentElement||"LI"===e.parentElement.tagName))return NodeFilter.FILTER_ACCEPT}});for(;t=i.nextNode();)t.appendChild(document.createElement("br"))}(t);const i=new Mx({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){if("CODE"===t.tagName){const e=(t.getAttribute("class")||"").replace("language-",""),i=t.textContent||"";return"```"+e+"\n"+(i.length?i:"\n")+"```\n"}return"PRE"===t.tagName?e:t.isBlock?"\n\n":""}});return i.use([ex]),i.addRule("taskListItems",{filter:function(e){const t="checkbox"===e.type,i=e.parentNode&&"LI"===e.parentNode.nodeName,o=e.parentNode&&e.parentNode.parentNode&&"LI"===e.parentNode.parentNode.nodeName;return t&&(i||o)},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}}),i.addRule("orderedListItems",{filter:function(e){return"LI"===e.nodeName&&!!e.closest("ol")},replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n");var o=t.parentNode,n=i.bulletListMarker+" ";if("OL"===o.nodeName){var s=o.getAttribute("start"),r=Array.prototype.indexOf.call(o.children,t);n=(s?Number(s)+r:r+1)+". "}var a=n.length,l=" ".repeat(a);return n+(e=e.replace(/\n/gm,"\n"+l))+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}}),i.addRule("imageFigure",{filter:"img",replacement:function(e,t){const i=t.parentElement;return i&&i.classList.contains("op-uc-figure--content")?i.parentElement.outerHTML:t.outerHTML}}),i.addRule("figcaption",{filter:"figcaption",replacement:function(e,t){return""}}),i.addRule("markdownTables",{filter:function(e){return"TABLE"===e.nodeName&&(!e.parentElement||"FIGURE"!==e.parentElement.nodeName)},replacement:function(e,t){return t.outerHTML}}),i.addRule("htmlTables",{filter:function(e){const t=e.getElementsByTagName("table");return"FIGURE"===e.nodeName&&t.length},replacement:function(e,t){return t.querySelectorAll("td br[data-cke-filler]").forEach((e=>{e.nextElementSibling&&e.removeAttribute("data-cke-filler")})),t.outerHTML}}),i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}}),i.addRule("workPackageQuickinfo",{filter:e=>"OPCE-MACRO-WP-QUICKINFO"===e.nodeName,replacement:(e,t)=>{const i=t.getAttribute("data-display-id")||t.getAttribute("data-id")||"";if(!i)return"";return"true"===t.getAttribute("data-detailed")?`###${i}`:`##${i}`}}),i.addRule("wikiPageLink",{filter:e=>"TURBO-FRAME"===e.nodeName&&"wiki-page-link"===e.getAttribute("data-type"),replacement:(e,t)=>`\\[\\[\\[${t.getAttribute("data-provider-id")||""}:${t.getAttribute("data-page-identifier")||""}\\]\\]\\]`}),i.addRule("openProjectMacros",{filter:["macro"],replacement:(e,t)=>{t.innerHTML="";return t.outerHTML.replace("","\n")}}),i.addRule("mentions",{filter:e=>"MENTION"===e.nodeName&&e.classList.contains("mention"),replacement:(e,t)=>"work_package"===t.getAttribute("data-type")?t.getAttribute("data-display-id")?t.outerHTML:t.getAttribute("data-text")||t.textContent||"":t.outerHTML}),i.addRule("emptyParagraphs",{filter:e=>"P"===e.nodeName&&(0===e.childNodes.length||1===e.childNodes.length&&"BR"===e.childNodes[0].nodeName),replacement:(e,t)=>t.parentElement||t.nextSibling||t.previousSibling?1===t.childNodes.length&&Lx(t.childNodes[0])?Bx+"\n\n":"
    \n\n":""}),i.addRule("openProjectPageBreak",{filter:e=>"DIV"===e.nodeName&&e.classList.contains("page-break"),replacement:(e,t)=>Bx}),i.turndown(t).replace(/\u00A0/," ").replace("###turndown-ignore###\n","")}}const iS='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n\n';const oS={"(":")","[":"]","{":"}"};class nS extends wc{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"mention")}execute(e){const t=this.editor.model,i=t.document.selection,o="string"==typeof e.mention?{id:e.mention}:e.mention,n=o.id,s=e.range||i.getFirstRange();if(!t.canEditAt(s))return;const r=e.text||n,a=rS({_text:r,id:n},o);if(!n.startsWith(e.marker))throw new fe("mentioncommand-incorrect-id",this);t.change((e=>{const o=ai(i.getAttributes()),n=new Map(o.entries());n.set("mention",a);const l=t.insertContent(e.createText(r,n),s),c=l.start.nodeBefore,d=l.end.nodeAfter,u=d&&d.is("$text")&&d.data.startsWith(" ");let h=!1;if(c&&d&&c.is("$text")&&d.is("$text")){const e=c.data.slice(-1),t=e in oS,i=t&&d.data.startsWith(oS[e]);h=t&&i}h||u||t.insertContent(e.createText(" ",o),s.start.getShiftedBy(r.length))}))}}class sS extends fc{static get pluginName(){return"MentionEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=t.document;t.schema.extend("$text",{allowAttributes:"mention"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",attributes:"data-mention",classes:"mention"},model:{key:"mention",value:e=>aS(e)}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:cS}),e.conversion.for("downcast").add(lS),i.registerPostFixer((e=>function(e,t,i){const o=t.differ.getChanges();let n=!1;for(const t of o){if("attribute"==t.type)continue;const o=t.position;if("$text"==t.name){const t=o.textNode&&o.textNode.nextSibling;n=uS(o.textNode,e)||n,n=uS(t,e)||n,n=uS(o.nodeBefore,e)||n,n=uS(o.nodeAfter,e)||n}if("$text"!=t.name&&"insert"==t.type){const t=o.nodeAfter;for(const i of e.createRangeIn(t).getItems())n=uS(i,e)||n}if("insert"==t.type&&i.isInline(t.name)){const t=o.nodeAfter&&o.nodeAfter.nextSibling;n=uS(o.nodeBefore,e)||n,n=uS(t,e)||n}}return n}(e,i,t.schema))),i.registerPostFixer((e=>function(e,t){const i=t.differ.getChanges();let o=!1;for(const t of i)if("attribute"===t.type&&"mention"!=t.attributeKey){const i=t.range.start.nodeBefore,n=t.range.end.nodeAfter;for(const s of[i,n])dS(s)&&s.getAttribute(t.attributeKey)!=t.attributeNewValue&&(e.setAttribute(t.attributeKey,t.attributeNewValue,s),o=!0)}return o}(e,i))),i.registerPostFixer((e=>function(e,t){const i=t.selection,o=i.focus;if(i.isCollapsed&&i.hasAttribute("mention")&&function(e){const t=e.isAtStart;return e.nodeBefore&&e.nodeBefore.is("$text")||t}(o))return e.removeSelectionAttribute("mention"),!0;return!1}(e,i))),e.commands.add("mention",new nS(e))}}function rS(e,t){return Object.assign({uid:me().slice(0,8)},e,t||{})}function aS(e,t){const i=e.getAttribute("data-mention"),o=e.getChild(0);if(!o)return;const n=e.getAttribute("data-mention-uid");return rS({id:i,_text:o.data},n?{uid:n,...t}:t)}function lS(e){e.on("attribute:mention",((e,t,i)=>{const o=t.attributeNewValue;if(!t.item.is("$textProxy")||!o)return;const n=t.range.start;(n.textNode||n.nodeAfter).data!=o._text&&i.consumable.consume(t.item,e.name)}),{priority:"highest"})}function cS(e,{writer:t,options:i}){if(e)return t.createAttributeElement("span",{class:"mention","data-mention":e.id,...!i.isClipboardPipeline&&{"data-mention-uid":e.uid}},{id:e.uid,priority:20})}function dS(e){if(!e||!e.is("$text")&&!e.is("$textProxy")||!e.hasAttribute("mention"))return!1;return e.data!=e.getAttribute("mention")._text}function uS(e,t){return!!dS(e)&&(t.removeAttribute("mention",e),!0)}class hS extends zh{selected;position;constructor(e){super(e),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const e=this.selected,t=this.items.getIndex(e);this.select(t+1)}selectPrevious(){const e=this.selected,t=this.items.getIndex(e);this.select(t-1)}select(e){let t=0;e>0&&e{i?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))})),this.listenTo(this.domElement,"click",(()=>{this.fire("execute")}))}render(){super.render(),this.element=this.domElement}focus(){this.domElement.focus()}}class gS extends Nh{item;marker;highlight(){this.children.first.isOn=!0}removeHighlight(){this.children.first.isOn=!1}}const pS=[$t.arrowup,$t.arrowdown,$t.esc],fS=[$t.enter,$t.tab];class bS extends fc{_mentionsView;_mentionsConfigurations;_balloon;_items=new ei;_lastRequested;_requestFeedDebounced;static get pluginName(){return"MentionUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Qm]}constructor(e){super(e),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=Li(this._requestFeed,100),e.config.define("mention",{feeds:[]})}init(){const e=this.editor,t=e.config.get("mention.commitKeys")||fS,i=pS.concat(t);this._balloon=e.plugins.get(Qm),e.editing.view.document.on("keydown",((e,o)=>{var n;n=o.keyCode,i.includes(n)&&this._isUIVisible&&(o.preventDefault(),e.stop(),o.keyCode==$t.arrowdown&&this._mentionsView.selectNext(),o.keyCode==$t.arrowup&&this._mentionsView.selectPrevious(),t.includes(o.keyCode)&&this._mentionsView.executeSelected(),o.keyCode==$t.esc&&this._hideUIAndRemoveMarker())}),{priority:"highest"}),Su({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const o=e.config.get("mention.feeds");for(const e of o){const{feed:t,marker:i,dropdownLimit:o}=e;if(!vS(i))throw new fe("mentionconfig-incorrect-marker",null,{marker:i});const n={marker:i,feedCallback:"function"==typeof t?t.bind(this.editor):kS(t),itemRenderer:e.itemRenderer,dropdownLimit:o};this._mentionsConfigurations.set(i,n)}this._setupTextWatcher(o),this.listenTo(e,"change:isReadOnly",(()=>{this._hideUIAndRemoveMarker()})),this.on("requestFeed:response",((e,t)=>this._handleFeedResponse(t))),this.on("requestFeed:error",(()=>this._hideUIAndRemoveMarker()))}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const e=this.editor.locale,t=new hS(e);return t.items.bindTo(this._items).using((i=>{const{item:o,marker:n}=i,{dropdownLimit:s}=this._mentionsConfigurations.get(n),r=s||this.editor.config.get("mention.dropdownLimit")||10;if(t.items.length>=r)return null;const a=new gS(e),l=this._renderItem(o,n);return l.delegate("execute").to(a),a.children.add(l),a.item=o,a.marker=n,a.on("execute",(()=>{t.fire("execute",{item:o,marker:n})})),a})),t.on("execute",((e,t)=>{const i=this.editor,o=i.model,n=t.item,s=t.marker,r=i.model.markers.get("mention"),a=o.createPositionAt(o.document.selection.focus),l=o.createPositionAt(r.getStart()),c=o.createRange(l,a);this._hideUIAndRemoveMarker(),i.execute("mention",{mention:n,text:n.text,marker:s,range:c}),i.editing.view.focus()})),t}_getItemRenderer(e){const{itemRenderer:t}=this._mentionsConfigurations.get(e);return t}_requestFeed(e,t){this._lastRequested=t;const{feedCallback:i}=this._mentionsConfigurations.get(e),o=i(t);o instanceof Promise?o.then((i=>{this._lastRequested==t?this.fire("requestFeed:response",{feed:i,marker:e,feedText:t}):this.fire("requestFeed:discarded",{feed:i,marker:e,feedText:t})})).catch((t=>{this.fire("requestFeed:error",{error:t}),be("mention-feed-callback-error",{marker:e})})):this.fire("requestFeed:response",{feed:o,marker:e,feedText:t})}_setupTextWatcher(e){const t=this.editor,i=e.map((e=>({...e,pattern:_S(e.marker,e.minimumCharacters||0)}))),o=new Ig(t.model,function(e){const t=t=>{const i=yS(e,t);if(!i)return!1;let o=0;0!==i.position&&(o=i.position-1);const n=t.substring(o);return i.pattern.test(n)};return t}(i));o.on("matched",((e,o)=>{const n=yS(i,o.text),s=t.model.document.selection.focus,r=t.model.createPositionAt(s.parent,n.position);if(function(e){const t=e.textNode&&e.textNode.hasAttribute("mention"),i=e.nodeBefore;return t||i&&i.is("$text")&&i.hasAttribute("mention")}(s)||function(e){const t=e.nodeAfter;return t&&t.is("$text")&&t.hasAttribute("mention")}(r))return void this._hideUIAndRemoveMarker();const a=function(e,t){let i=0;0!==e.position&&(i=e.position-1);const o=_S(e.marker,0),n=t.substring(i);return n.match(o)[2]}(n,o.text),l=n.marker.length+a.length,c=s.getShiftedBy(-l),d=s.getShiftedBy(-a.length),u=t.model.createRange(c,d);if(CS(t)){const e=t.model.markers.get("mention");t.model.change((t=>{t.updateMarker(e,{range:u})}))}else t.model.change((e=>{e.addMarker("mention",{range:u,usingOperation:!1,affectsData:!1})}));this._requestFeedDebounced(n.marker,a)})),o.on("unmatched",(()=>{this._hideUIAndRemoveMarker()}));const n=t.commands.get("mention");return o.bind("isEnabled").to(n),o}_handleFeedResponse(e){const{feed:t,marker:i}=e;if(!CS(this.editor))return;this._items.clear();for(const e of t){const t="object"!=typeof e?{id:e,text:e}:e;this._items.add({item:t,marker:i})}const o=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(o):this._hideUIAndRemoveMarker()}_showOrUpdateUI(e){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(e,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(e,this._mentionsView.position),singleViewMode:!0,balloonClassName:"ck-mention-balloon"}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),CS(this.editor)&&this.editor.model.change((e=>e.removeMarker("mention"))),this._mentionsView.position=void 0}_renderItem(e,t){const i=this.editor;let o,n=e.id;const s=this._getItemRenderer(t);if(s){const t=s(e);"string"!=typeof t?o=new mS(i.locale,t):n=t}if(!o){const e=new Lu(i.locale);e.label=n,e.withText=!0,o=e}return o}_getBalloonPanelPositionData(e,t){const i=this.editor,o=i.editing,n=o.view.domConverter,s=o.mapper;return{target:()=>{let t=e.getRange();"$graveyard"==t.start.root.rootName&&(t=i.model.document.selection.getFirstRange());const o=s.toViewRange(t);return ut.getDomRangeRects(n.viewRangeToDom(o)).pop()},limiter:()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},positions:wS(t,i.locale.uiLanguageDirection)}}}function wS(e,t){const i={caret_se:e=>({top:e.bottom+3,left:e.right,name:"caret_se",config:{withArrow:!1}}),caret_ne:(e,t)=>({top:e.top-t.height-3,left:e.right,name:"caret_ne",config:{withArrow:!1}}),caret_sw:(e,t)=>({top:e.bottom+3,left:e.right-t.width,name:"caret_sw",config:{withArrow:!1}}),caret_nw:(e,t)=>({top:e.top-t.height-3,left:e.right-t.width,name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(i,e)?[i[e]]:"rtl"!==t?[i.caret_se,i.caret_sw,i.caret_ne,i.caret_nw]:[i.caret_sw,i.caret_se,i.caret_nw,i.caret_ne]}function yS(e,t){let i;for(const o of e){const e=t.lastIndexOf(o.marker);e>0&&!t.substring(e-1).match(o.pattern)||(!i||e>=i.position)&&(i={marker:o.marker,position:e,minimumCharacters:o.minimumCharacters,pattern:o.pattern})}return i}function _S(e,t){const i=0==t?"*":`{${t},}`,o=Y.features.isRegExpUnicodePropertySupported?"\\p{Ps}\\p{Pi}\"'":"\\(\\[{\"'";e=e.replace(/[.*+?^${}()\-|[\]\\]/g,"\\$&");return new RegExp(`(?:^|[ ${o}])(${e})([^#@]${i})$`,"u")}function kS(e){return t=>e.filter((e=>("string"==typeof e?e:String(e.id)).toLowerCase().includes(t.toLowerCase())))}function vS(e){return!!e}function CS(e){return e.model.markers.has("mention")}const AS=/^#{2,3}/;function xS(e){if("work_package"!==e.getAttribute("data-type"))return!1;const t=e.getAttribute("data-text");return!!t&&AS.test(t)}class ES extends wc{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const o=function(e,t){const i=cp(e,t),o=i.start.parent;if(o.isEmpty&&!o.is("element","$root"))return o.parent;return o}(e,i);return t.checkChild(o,"pageBreak")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("pageBreak");e.insertObject(i,null,null,{setSelection:"after"})}))}}class TS extends fc{static get pluginName(){return"PageBreakEditing"}static get licenseFeatureCode(){return"PB"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>t.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},t.createContainerElement("span",{style:"display: none"}))}),o.for("editingDowncast").elementToStructure({model:"pageBreak",view:(e,{writer:t})=>{const o=i("Page break"),n=t.createContainerElement("div"),s=t.createRawElement("span",{class:"page-break__label"},(function(e){e.innerText=i("Page break")}));return t.addClass("page-break",n),t.insert(t.createPositionAt(n,0),s),function(e,t,i){return t.setCustomProperty("pageBreak",!0,e),np(e,t,{label:i})}(n,t,o)}}),o.for("upcast").elementToElement({view:e=>{const t="always"==e.getStyle("page-break-before"),i="always"==e.getStyle("page-break-after");if(!t&&!i)return null;if(1==e.childCount){const t=e.getChild(0);if(!t.is("element","span")||"none"!=t.getStyle("display"))return null}else if(e.childCount>1)return null;return{name:!0,styles:[...t?["page-break-before"]:[],...i?["page-break-after"]:[]],...e.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new ES(e))}}class PS extends fc{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("pageBreak",(()=>{const e=this._createButton(Lu);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:pageBreak",(()=>this._createButton(sh)))}_createButton(e){const t=this.editor,i=t.locale,o=t.commands.get("pageBreak"),n=new e(t.locale),s=i.t;return n.set({label:s("Page break"),icon:''}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",(()=>{t.execute("pageBreak"),t.editing.view.focus()})),n}}class SS extends fc{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[Lc]}constructor(e){super(e);const t=e.config.get("autosave")||{},i=t.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=Li(this._save.bind(this),i),this._lastDocumentVersion=e.model.document.version,this._savePromise=null,this._domEmitter=new(et()),this._config=t,this._pendingActions=e.plugins.get(Lc),this._makeImmediateSave=!1}init(){const e=this.editor,t=e.model.document;this.listenTo(e,"ready",(()=>{this.listenTo(t,"change:data",((e,t)=>{this._saveCallbacks.length&&t.isLocal&&("synchronized"===this.state&&(this.state="waiting",this._setPendingAction()),"waiting"===this.state&&this._debouncedSave())}))})),this.listenTo(e,"destroy",(()=>this._flush()),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",((e,t)=>{this._pendingActions.hasAny&&(t.returnValue=this._pendingActions.first.message)}))}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then((()=>Promise.all(this._saveCallbacks.map((e=>e(this.editor)))))).finally((()=>{this._savePromise=null})).then((()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)})).catch((e=>{throw this.state="error",this.state="saving",this._debouncedSave(),e})),this._savePromise)}_setPendingAction(){const e=this.editor.t;this._action||(this._action=this._pendingActions.add(e("Saving changes")))}get _saveCallbacks(){const e=[];return this.adapter&&this.adapter.save&&e.push(this.adapter.save),this._config.save&&e.push(this._config.save),e}}var IS=i(992);function RS(e){return e.trim().split(/\s+/).length}function OS(e){const t=e.length;let i=5381;for(let o=0;o>>0}function VS(e){const t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(IS.decompress(t))}catch(e){return console.error("Failed to load CKEditor revisions from localStorage: "+e.toString()),null}}class DS extends fc{init(){const e=this.editor,t=Lp(e);e.ui.componentFactory.add("opContentRevisions",(i=>{const o=Zh(i),n=new ei;return Xh(o,n,{role:"menu",ariaLabel:t.t("js.editor.revisions")}),o.buttonView.set({label:t.t("js.editor.revisions"),icon:'\n\n\n',tooltip:!0}),this.listenTo(o.buttonView,"execute",(async()=>{n.clear(),function(e,t){const i=e.config.get(MS),o=VS(i),n=Lp(e),s=Np(e,"timezone");if(!o?.items||o.items.count<=0){const e={type:"button",model:{label:n.t("js.editor.no_revisions"),withText:!0}};return void t.add(e)}const r=e.getData(),a=OS(r);for(let e=o.items.length;e>0;){e--;const i=o.items[e],r=s.formattedRelativeDateTime(i.timestamp),l=n.t("js.units.word",{count:RS(i.content)}),c=`${i.hash===a?`${n.t("js.label_current")} - `:""}${r} (${l})`,d={type:"button",model:{timestamp:i.timestamp,label:c,withText:!0}};t.add(d)}}(e,n)})),o.on("execute",(t=>{const{timestamp:i}=t.source;i&&e.execute("opContentRevisionApply",i)})),o}))}}class FS extends wc{async execute(e){const t=this.editor,i=t.config.get(MS),o=await VS(i);if(!o)return void console.error(`Trying to load revision ${e} but no record present.`);const n=o.items.find((t=>t.timestamp===e));n&&(t.setData(n.content),setTimeout((()=>{t.editing.view.focus()})))}}const MS="opContentRevisionKey",NS="op_ckeditor_rev";const BS="op-macro-wp-quickinfo",LS="opce-macro-wp-quickinfo";const zS="op-macro-wiki-page-link";const jS=[Op,class extends fc{static get requires(){return[zp,vp,Wp]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return zp.buttonName}},class extends fc{static get requires(){return[Gp,vp,Jp]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return Gp.buttonName}},class extends fc{static get requires(){return[uw,vp,hw]}static get pluginName(){return"OPChildPages"}static get buttonName(){return uw.buttonName}}],$S=[class extends fc{static get requires(){return[Qp,Db]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=e=>{const t=Fp(this.editor);return new Xp(e,t,this.editor)}}},class extends fc{static get pluginName(){return"OPAttachmentListener"}init(){this.editor.model.on("op:attachment-removed",((e,t)=>{this.removeDeletedImage(t)}))}removeDeletedImage(e){let t=this.editor.model.document.getRoot();for(const i of Array.from(t.getChildren()))if("image"===i.name&&e.indexOf(i.getAttribute("src"))>-1){const e=this.editor.model.createSelection(i,"on");this.editor.model.deleteContent(e)}}}],qS=[class extends fc{static get requires(){return[rh,Of,Kg,ww,Qg,Pg,zf]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Qp]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(Qp).createUploadAdapter=t=>new vw(t,e,this.editor.t))}},class extends fc{static get requires(){return[Tg]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Cw(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Cw(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Cw(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Cw(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=Ew(this.editor,"bold");Aw(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Aw(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=Ew(this.editor,"italic");Aw(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Aw(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=Ew(this.editor,"code");Aw(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=Ew(this.editor,"strikethrough");Aw(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter((e=>e.match(/^heading[1-6]$/))).forEach((t=>{const i=t[7],o=new RegExp(`^(#{${i}})\\s$`);Cw(this.editor,this,o,(()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Cw(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Cw(e,this,/^```$/,(()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Cw(this.editor,this,/^---$/,"horizontalLine")}},SS,class extends fc{static get requires(){return[Sw,Ow]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Dw,Mw]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Bw,zw]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[$w,Hw]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Jw,Zw]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[ny,ry]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}},gb,fb,class extends fc{static get requires(){return[yb,_b]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[ow,nw]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Mb,qb,Gb,Bb]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Ap,Gf]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Ap),o=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:lw(e.config.get("image.toolbar")||[]),getRelatedElement:e=>o.getClosestSelectedImageWidget(e)})}},class extends fc{static get pluginName(){return"OpImageAttachmentLookup"}init(){const e=this.editor,t=e.conversion,i=Fp(e);t.for("editingDowncast").add(function(e){return e=>{e.on("attribute:src:imageBlock",t,{priority:"highest"}),e.on("attribute:src:imageInline",t,{priority:"highest"})};function t(t,i,o){let n=i.attributeNewValue;if(!n||!e.lookupDownloadLocationByName)return;const s=e.lookupDownloadLocationByName(n);i.attributeNewValue=s||n}}(i)),t.for("dataDowncast").add(function(e){return e=>{e.on("attribute:src:imageBlock",t,{priority:"highest"}),e.on("attribute:src:imageInline",t,{priority:"highest"})};function t(t,i,o){let n=i.attributeNewValue;if(!n||!e.lookupDownloadLocationByName)return;const s=e.lookupDownloadLocationByName(n);i.attributeNewValue=s||n;const r=o.writer,a=o.mapper.toViewElement(i.item);let l;l="imageInline"===i.item.name?a:a.getChild(0),s&&r.setAttribute("data-original-src",n,l)}}(i));const o=e.plugins.get("ImageUtils");o.decorate("setImageNaturalSizeAttributes"),o.on("setImageNaturalSizeAttributes",((e,[t])=>{console.log("model image element:",{element:t}),e.stop()}),{priority:"highest"})}},class extends fc{static get requires(){return[Ty,Dy,Ny]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[z_,H_]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[Y_,ok]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}},class extends fc{static get requires(){return[TS,PS,vp]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}},ey,Pg,class extends fc{toMentionAttribute(e,t){return aS(e,t)}static get pluginName(){return"Mention"}static get isOfficialPlugin(){return!0}static get requires(){return[sS,bS]}},function(e){const t=Mp(e),i=e.editing.view,o=i.document;i.addObserver(il),e.listenTo(o,"click",((e,t)=>{if("A"===t.domTarget.nodeName&&t.domTarget.classList.contains("mention")){const e=document.createElement("a");e.target="_blank",e.href=t.domTarget.attributes.href.value,e.click()}})),e.conversion.for("upcast").elementToAttribute({view:{name:"mention",key:"data-mention",classes:"mention"},model:{key:"mention",value:i=>{const o=i.getAttribute("data-id"),n=i.getAttribute("data-display-id"),s=i.getAttribute("data-type"),r=i.getAttribute("data-text");if(xS(i))return null;const a=function(e,i){const o=t.services.apiV3Service[`${i}s`].segment,n=window.OpenProject.urlRoot;return`${n}/${o}/${e}`}(n||o,s);return e.plugins.get("Mention").toMentionAttribute(i,{dataId:o,dataDisplayId:n,link:a,text:r,type:s})}},converterPriority:"high"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:e=>{const t=[...e.getChildren()][0],i=t&&t.data;if(i){const e=`[Invalid mention: ${i}]`;t._data=e}}},converterPriority:"high"}),e.conversion.for("editingDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(e,{writer:t})=>{if(!e)return;if("emoji"===e.type)return t.createAttributeElement("span");return t.createAttributeElement("a",{class:"mention",href:e.link,"data-mention":e.text,title:e.text})}}),e.conversion.for("dataDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(e,{writer:t})=>{if(!e)return;if("emoji"===e.type)return t.createAttributeElement("span");const i={class:"mention","data-id":e.dataId,"data-type":e.type,"data-text":e.text};e.dataDisplayId&&(i["data-display-id"]=e.dataDisplayId);return t.createAttributeElement("mention",i)}})},class extends fc{static get pluginName(){return"PasteFromOffice"}static get licenseFeatureCode(){return"PFO"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[bf]}init(){const e=this.editor,t=e.plugins.get("ClipboardPipeline"),i=e.editing.view.document,o=[],n=this.editor.plugins.has("MultiLevelListEditing"),s=this.editor.plugins.has("TablePropertiesEditing");o.push(new $A(i,n,s)),o.push(new GA(i)),o.push(new ZA(i)),t.on("inputTransformation",((t,n)=>{if(n._isTransformedWithPasteFromOffice)return;if(e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const s=n.dataTransfer.getData("text/html"),r=o.find((e=>e.isActive(s)));r&&(n._parsedData||(n._parsedData=YA(s,i.stylesProcessor)),r.execute(n),n._isTransformedWithPasteFromOffice=!0)}),{priority:"high"})}},class extends fc{static get pluginName(){return"OPHelpLinkPlugin"}init(){const e=this.editor,t=e.config.get("openProject.helpURL");e.ui.componentFactory.add("openProjectShowFormattingHelp",(e=>{const i=new Lu(e);return i.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:'',tooltip:!0}),i.on("execute",(()=>{window.open(t,"_blank")})),i}))}},class extends fc{static get pluginName(){return"OPPreview"}init(){const e=this.editor;let t=!1,i=null;e.ui.componentFactory.add("preview",(o=>{const n=new Lu(o);n.set({label:this.label,icon:'\n',tooltip:!0});let s=function(t){const o=e.ui.getEditableElement(),s=o?.parentElement;if(!s?.parentElement)return void console.error("Cannot show preview: invalid editor structure");const r=document.createElement("div");r.className="ck-editor__preview op-uc-container";Array.from(s.parentElement.children).filter((e=>e!==s&&e.classList.contains("ck-editor__preview"))).forEach((e=>e.remove()));const a=Np(e,"ckEditorPreview");i=a.render(r,t),s.style.display="none",s.parentElement.insertBefore(r,s.nextSibling),gk(e,n)},r=function(){let i=function(e){return _.get(e.config,"_config.openProject.context.previewContext")}(e);(async function(e,t){return new yk("post",e,t).perform()})(Bp(e).api.v3.previewMarkup(i),{contentType:"text/plain; charset=UTF-8",responseKind:"html",body:e.getData()}).then((e=>e.html)).then(s).catch((i=>{console.error("Error fetching preview:",i),t=!1,pk(e)}))};return n.on("execute",(()=>{t?(t=!1,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot disable preview: invalid editor structure");i&&i(),Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__preview"))).forEach((e=>e.remove())),o.style.display="",pk(e)}()):(t=!0,r())})),n}))}get label(){return window.I18n.t("js.editor.preview")}},class extends fc{static get pluginName(){return"OPSourceCode"}init(){const e=this.editor;let t=!1,i={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};e.ui.componentFactory.add("opShowSource",(o=>{const n=new Lu(o);n.set({label:i.source,class:"",icon:iS,tooltip:!0});return n.on("execute",(()=>{t?(t=!1,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot hide source: invalid editor structure");e.fire("op:source-code-disabled"),Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__source"))).forEach((e=>e.remove())),o.style.display="",pk(e),n.set({label:i.source,class:"",icon:iS,tooltip:!0})}()):(t=!0,function(){const t=e.ui.getEditableElement(),o=t?.parentElement;if(!o?.parentElement)return void console.error("Cannot show source: invalid editor structure");const s=document.createElement("div");s.className="ck-editor__source",Array.from(o.parentElement.children).filter((e=>e!==o&&e.classList.contains("ck-editor__source"))).forEach((e=>e.remove())),o.style.display="none",o.parentElement.insertBefore(s,o.nextSibling),gk(e,n),e.fire("op:source-code-enabled"),n.set({label:i.wysiwyg,class:"-source-enabled",icon:'\n\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n\n',tooltip:!0})}())})),n}))}},class extends fc{static get requires(){return[SS,DS]}static get pluginName(){return"OpContentRevisions"}constructor(e){super(e);const t=this.getStorageKey(e);e.config.define(MS,t)}init(){const e=this.editor;e.commands.add("opContentRevisionApply",new FS(e)),e.once("ready",(()=>{const t=Date.now();e.plugins.get("Autosave")._domEmitter.stopListening(window,"beforeunload"),Object.keys(localStorage).forEach((e=>{if(e.startsWith(NS)){const i=VS(e);i?.updatedAt&&t-i.updatedAt>=288e5&&localStorage.removeItem(e)}}))}))}getStorageKey(e){const t=e.config.get("storageKey");return t||this.createLocalStorageKey(e)}createLocalStorageKey(e){const t=Fp(e),i=function(e){return _.get(e.config,"_config.openProject.context.field")}(e);let o="";return o=t?.href?t.href:location.pathname,i&&(o+=`_${i}`),`${NS}_${o}`}},class extends fc{static get requires(){return[vp]}static get pluginName(){return"OPMacroWpQuickinfo"}init(){const e=this.editor,t=e.model,i=e.conversion;t.schema.register(BS,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["wpId","wpDisplayId","detailed","markerText"]}),i.for("upcast").elementToElement({view:{name:LS},model:(e,{writer:t})=>{const i=e.getAttribute("data-id")||"",o=e.getAttribute("data-display-id")||""||i,n={wpDisplayId:o,detailed:"true"===e.getAttribute("data-detailed")};return i&&i!==o&&(n.wpId=i),t.createElement(BS,n)},converterPriority:"high"}),i.for("upcast").elementToElement({view:{name:"mention",classes:"mention"},model:(e,{writer:t})=>{if(!xS(e))return null;const i=e.getAttribute("data-text"),o=i.startsWith("###"),n=e.getAttribute("data-id")||"",s=e.getAttribute("data-display-id")||n;return t.createElement(BS,{wpId:n,wpDisplayId:s,detailed:o,markerText:i})},converterPriority:"highest"}),i.for("editingDowncast").elementToElement({model:BS,view:(e,{writer:t})=>{const i=e.getAttribute("wpDisplayId")||"",o=!!e.getAttribute("detailed"),n=e.getAttribute("wpId")||i,s=e.getAttribute("markerText")||`${o?"###":"##"}${i}`,r=t.createContainerElement("span",{class:"op-macro-wp-quickinfo-widget"}),a=t.createRawElement(LS,{"data-id":n,"data-display-id":i,"data-detailed":String(o)},(()=>{}));return t.insert(t.createPositionAt(r,0),a),np(r,t,{label:s})}}),i.for("dataDowncast").elementToElement({model:BS,view:(e,{writer:t})=>{const i=e.getAttribute("wpDisplayId")||"",o=!!e.getAttribute("detailed"),n=e.getAttribute("wpId"),s=e.getAttribute("markerText")||`${o?"###":"##"}${i}`;if(n){const e=t.createContainerElement("mention",{class:"mention","data-id":n,"data-type":"work_package","data-text":s,"data-display-id":i});return t.insert(t.createPositionAt(e,0),t.createText(s)),e}const r=t.createContainerElement(LS,{"data-id":n||i,"data-display-id":i,"data-detailed":String(o)});return t.insert(t.createPositionAt(r,0),t.createText(s)),r}})}afterInit(){const e=this.editor,t=e.commands.get("mention");t&&t.on("execute",((t,i)=>{const o=i&&i[0];if(!o||!o.mention)return;if("work_package"!==o.mention.type)return;const n=o.marker;if("##"!==n&&"###"!==n)return;t.stop();const s="###"===n,r=String(o.mention.dataDisplayId),a=null!=o.mention.dataId?String(o.mention.dataId):null,l=o.mention.text||`${n}${r}`;e.model.change((t=>{const i=o.range||e.model.document.selection.getFirstRange();i&&t.remove(i);const n={wpDisplayId:r,detailed:s,markerText:l};a&&(n.wpId=a);const c=t.createElement(BS,n);e.model.insertContent(c,e.model.document.selection),t.setSelection(t.createPositionAfter(c))}))}),{priority:"high"})}},class extends fc{static get pluginName(){return"OpMacroWikiPageLink"}init(){const e=this.editor,t=e.conversion;e.model.schema.register(zS,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["providerId","pageIdentifier"]}),t.for("upcast").elementToElement({view:{name:"turbo-frame",attributes:{"data-type":"wiki-page-link"}},model:(e,{writer:t})=>{const i=e.getAttribute("data-provider-id"),o=e.getAttribute("data-page-identifier");return t.createElement(zS,{providerId:i,pageIdentifier:o})}}),t.for("dataDowncast").elementToElement({model:zS,view:(e,{writer:t})=>{const i=e.getAttribute("providerId"),o=e.getAttribute("pageIdentifier"),n=crypto.randomUUID(),s=t.createContainerElement("turbo-frame",{id:n,src:this.macroUrl(i,o,n),"data-provider-id":i,"data-page-identifier":o,"data-type":"wiki-page-link"}),r=`[[[${i}:${o}]]]`;return t.insert(t.createPositionAt(s,0),t.createText(r)),s}}),t.for("editingDowncast").elementToElement({model:zS,view:(e,{writer:t})=>{const i=e.getAttribute("providerId"),o=e.getAttribute("pageIdentifier"),n=crypto.randomUUID(),s=t.createContainerElement("span",{class:"my-wiki-page-link-widget"}),r=t.createRawElement("turbo-frame",{id:n,src:this.macroUrl(i,o,n),"data-provider-id":i,"data-page-identifier":o,"data-type":"wiki-page-link"},(()=>{}));return t.insert(t.createPositionAt(s,0),r),np(s,t,{label:`[[[${i}:${o}]]]`})}})}macroUrl(e,t,i){return Bp(this.editor).wikiPageLinkMacro(e,t,i)}},class extends fc{static get pluginName(){return"CodeBlock"}static get requires(){return[uk,hk]}},function(e){e.data.processor=new tS(e)},mC,class extends fc{static get requires(){return[Ap]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(Ap),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:fC}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:pC})}},class extends fc{static get pluginName(){return"TableProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[hA,yA]}},class extends fc{static get pluginName(){return"TableCellProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[oA,zC]}},class extends fc{init(){const e=this.editor,t=(e.config.get("removePlugins")||[]).map((e=>e.pluginName)),i=window.I18n.t("js.editor.macro.dropdown.chose_macro");!0!==e.config.get("openProject.disableAllMacros")&&e.ui.componentFactory.add("macroList",(o=>{const n=[];for(const i of jS){if(-1!==t.indexOf(i.pluginName))continue;const o=e.ui.componentFactory.create(i.buttonName);n.push(o)}const s=Zh(o);return Qh(s,n,{isVertical:!0,class:"op-macro-list-button"}),s.buttonView.set({isOn:!1,withText:!0,tooltip:i,label:window.I18n.t("js.editor.macro.dropdown.macros")}),s}))}},class extends fc{get config(){const e="op-uc-";return{preFix:e,editorClasses:[`${e}container`,`${e}container_editing`],elementsWithCustomClassesMap:{paragraph:`${e}p`,heading1:`${e}h1`,heading2:`${e}h2`,heading3:`${e}h3`,heading4:`${e}h4`,heading5:`${e}h5`,heading6:`${e}h6`,blockQuote:`${e}blockquote`,figure:`${e}figure`,table:`${e}table`,thead:`${e}table--head`,tr:`${e}table--row`,td:`${e}table--cell`,th:[`${e}table--cell`,`${e}table--cell_head`],tableCell:`${e}table--cell`,tableRow:`${e}table--row`,ol:`${e}list`,ul:`${e}list`,list:`${e}list`,todo:`${e}list ${e}list_task-list`,listItem:`${e}list--item`,li:`${e}list--item`,imageInline:`${e}image ${e}image_inline`,imageBlock:`${e}image`,img:`${e}image`,codeblock:`${e}code-block`,caption:`${e}figure--description`,"op-macro-embedded-table":[`${e}placeholder`,`${e}embedded-table`],"op-macro-wp-button":[`${e}placeholder`,`${e}wp-button`],"op-macro-child-pages":[`${e}placeholder`,`${e}child-pages`],"op-macro-toc":[`${e}placeholder`,`${e}toc`],content:`${e}figure--content`},attributesWithCustomClassesMap:{code:`${e}code`,linkHref:`${e}link`,alignment:`${e}figure_align-`,tableAlignment:`${e}figure_align-`,todo:`${e}list_task-list`,numbered:`${e}list`,bulleted:`${e}list`,listType:null,headingColumns:null,width:null,uploadStatus:null},alignmentValuesMap:{left:"start",right:"end",blockLeft:"start",blockRight:"end",center:"center",default:"center"}}}init(){this._addCustomCSSClassesToTheEditorContainer(this.editor),this._addCustomCSSClassesToElements(this.config),this._addCustomCSSClassesToAttributes(this.config)}_addCustomCSSClassesToTheEditorContainer(e){e.sourceElement.classList.add(...this.config.editorClasses)}_addCustomCSSClassesToElements(e){this.editor.model.schema.extend("table",{allowAttributes:["figureClasses"]}),this.editor.conversion.for("upcast").add((t=>t.on("element:table",this._manageTableUpcast(e))),{priority:"high"}),this.editor.conversion.for("downcast").add((t=>t.on("insert",this._manageElementsInsertion(e),{priority:"low"})))}_addCustomCSSClassesToAttributes(e){this.editor.conversion.for("downcast").add((t=>t.on("attribute",this._manageAttributesInsertion(e),{priority:"low"})))}_manageTableUpcast(e){return(t,i,o)=>{const n=o.writer,s=i.viewItem,r=i.modelRange,a=r&&r.start.nodeAfter;if(!a)return;let l=a.getAttribute("figureClasses")||[],c=s.parent.getClassNames&&s.parent.getClassNames();const d=c?[...c].filter((e=>!!e)):[];l=[...l,...d];const u=d.filter((t=>t.startsWith(e.attributesWithCustomClassesMap.alignment)))[0],h=u&&u.replace(e.attributesWithCustomClassesMap.alignment,"")||e.alignmentValuesMap.default,m=Object.keys(e.alignmentValuesMap).find((t=>e.alignmentValuesMap[t]===h))||"center";if(!u){const t=`${e.attributesWithCustomClassesMap.alignment}${h}`;l=[...l,t]}n.setAttribute("figureClasses",l,a),"center"===m?n.setAttribute("alignment",null,a):n.setAttribute("alignment",m,a)}}_manageElementsInsertion(e){return(t,i,o)=>{const n=Object.keys(e.elementsWithCustomClassesMap),s=o.writer,r=i.item.name,a=i.item,l=o.mapper.toViewElement(a);let c=[l];const d=["imageBlock","table","tableCell","tableRow","listItem"].includes(r);if(n.includes(r)&&l){if(d)if("listItem"===r)c=this._manageListItems(s,a,l,c,e);else{const t=l,i=Array.from(s.createRangeIn(l).getItems());if("imageBlock"===r){const o=i.find((e=>e.is("element","img")));this._wrapInFigureContentContainer(o,t,e,s),c=[...c,o]}else if("table"===r||"tableRow"===r){const o=i.filter((e=>n.includes(e.name)));if(c=[...c,...o],"table"===r){if(!a.getAttribute("tableAlignment")){const i=`${e.attributesWithCustomClassesMap.alignment}${e.alignmentValuesMap.default}`;s.addClass(i,t)}}}}c.forEach((t=>{const i=d?t.name:r,o=e.elementsWithCustomClassesMap[i];s.addClass(o,t)}))}}}_manageAttributesInsertion(e){return(t,i,o)=>{const n=Object.keys(e.attributesWithCustomClassesMap),s=i.attributeKey,r=o.writer,a=i.item,l=o.mapper.toViewElement(a);if(n.includes(s))if("linkHref"===s||"code"===s){const t="linkHref"===s?"a":s,n="linkHref"===s?5:10,l=r.document.selection,c=r.createAttributeElement(t,{class:e.attributesWithCustomClassesMap[s]},{priority:n});a.is("selection")?r.wrap(l.getFirstRange(),c):r.wrap(o.mapper.toViewRange(i.range),c)}else if("tableAlignment"===s){const t=l,o=e.alignmentValuesMap[i.attributeNewValue]||e.alignmentValuesMap.default;Array.from(new Set(Object.values(e.alignmentValuesMap))).map((t=>`${e.attributesWithCustomClassesMap[s]}${t}`)).filter((e=>t.hasClass(e))).forEach((e=>r.removeClass(e,t))),t.hasStyle("float")&&r.removeStyle("float",t),r.addClass(`${e.attributesWithCustomClassesMap[s]}${o}`,t)}else if("listType"===s){this._manageListItems(r,a,l,[l],e).forEach((t=>{const i=t.name,o=e.elementsWithCustomClassesMap[i];r.addClass(o,t)}))}else if("headingColumns"===s){const t=i.attributeNewValue,o=Array.from(r.createRangeIn(l).getItems()).filter((t=>Object.keys(e.elementsWithCustomClassesMap).includes(t.name)));t?o.forEach((t=>{const i=t.name,o=e.elementsWithCustomClassesMap[i];r.addClass(o,t)})):o.filter((t=>t.hasClass(e.elementsWithCustomClassesMap.th[1]))).forEach((t=>{const i=t.nextSibling;i&&"th"!==i.name&&r.removeClass(e.elementsWithCustomClassesMap.th[1],t)}))}else if("width"===s)l.hasClass("image_resized")&&r.removeClass("image_resized",l);else if("uploadStatus"===s&&"complete"===i.attributeNewValue){let e=Array.from(r.createRangeIn(l).getItems()).find((e=>e.hasClass("ck-upload-placeholder-loader")));e&&r.remove(r.createRangeOn(e))}}}_manageListItems(e,t,i,o,n){const s=i.findAncestor("li"),r=i.findAncestor(/^(ul|ol)$/);if(!r)return o;const a=t.getAttribute("listType"),l=n.attributesWithCustomClassesMap[a];if("todo"===a)e.addClass(l,r);else{const t=n.attributesWithCustomClassesMap.todo;r.hasClass(t)&&e.removeClass(t,r)}return[...o,r,s]}_wrapInFigureContentContainer(e,t,i,o){const n=o.createContainerElement("div",{class:i.elementsWithCustomClassesMap.content});o.insert(o.createPositionAt(n,0),e),o.insert(o.createPositionAt(t,0),n)}}].concat(jS,$S);function HS(e){return function(t){const i=window.OpenProject.urlRoot,o=`${i}/work_packages/auto_complete.json`;return this.config.get("disabledMentions").includes("work_package")?[]:new Promise(((n,s)=>{_k(o,{responseKind:"json",query:{q:t,scope:"all"}}).then((e=>e.json)).then((t=>{n(t.map((t=>{const o=t.displayId||t.id,n=`${e}${o}`;return{id:n,dataId:t.id,dataDisplayId:o,type:"work_package",text:n,name:t.to_s,link:`${i}/work_packages/${o}`}})))})).catch((e=>{console.error("Error fetching work package mentions:",e),s(e)}))}))}}function WS(e){const t=document.createElement("span");return"user"!==e.type&&"work_package"!==e.type||(t.setAttribute("data-hover-card-trigger-target","trigger"),t.setAttribute("data-hover-card-url",`${e.link}/hover_card`)),t.classList.add("mention-list-item"),t.textContent=e.name,t}const US=JSON.parse('[{"id":":grinning_face:","symbol":"😀","group":"people","keywords":["face","grin","grinning face"]},{"id":":beaming_face_with_smiling_eyes:","symbol":"😁","group":"people","keywords":["beaming face with smiling eyes","eye","face","grin","smile"]},{"id":":face_with_tears_of_joy:","symbol":"😂","group":"people","keywords":["face","face with tears of joy","joy","laugh","tear"]},{"id":":rolling_on_the_floor_laughing:","symbol":"🤣","group":"people","keywords":["face","floor","laugh","rolling","rolling on the floor laughing"]},{"id":":grinning_face_with_big_eyes:","symbol":"😃","group":"people","keywords":["face","grinning face with big eyes","mouth","open","smile"]},{"id":":grinning_face_with_smiling_eyes:","symbol":"😄","group":"people","keywords":["eye","face","grinning face with smiling eyes","mouth","open","smile"]},{"id":":grinning_face_with_sweat:","symbol":"😅","group":"people","keywords":["cold","face","grinning face with sweat","open","smile","sweat"]},{"id":":grinning_squinting_face:","symbol":"😆","group":"people","keywords":["face","grinning squinting face","laugh","mouth","satisfied","smile"]},{"id":":winking_face:","symbol":"😉","group":"people","keywords":["face","wink","winking face"]},{"id":":smiling_face_with_smiling_eyes:","symbol":"😊","group":"people","keywords":["blush","eye","face","smile","smiling face with smiling eyes"]},{"id":":face_savoring_food:","symbol":"😋","group":"people","keywords":["delicious","face","face savoring food","savouring","smile","yum"]},{"id":":smiling_face_with_sunglasses:","symbol":"😎","group":"people","keywords":["bright","cool","face","smiling face with sunglasses","sun","sunglasses"]},{"id":":smiling_face_with_heart-eyes:","symbol":"😍","group":"people","keywords":["eye","face","love","smile","smiling face with heart-eyes"]},{"id":":face_blowing_a_kiss:","symbol":"😘","group":"people","keywords":["face","face blowing a kiss","kiss"]},{"id":":kissing_face:","symbol":"😗","group":"people","keywords":["face","kiss","kissing face"]},{"id":":kissing_face_with_smiling_eyes:","symbol":"😙","group":"people","keywords":["eye","face","kiss","kissing face with smiling eyes","smile"]},{"id":":kissing_face_with_closed_eyes:","symbol":"😚","group":"people","keywords":["closed","eye","face","kiss","kissing face with closed eyes"]},{"id":":smiling_face:","symbol":"☺","group":"people","keywords":["face","outlined","relaxed","smile","smiling face"]},{"id":":slightly_smiling_face:","symbol":"🙂","group":"people","keywords":["face","slightly smiling face","smile"]},{"id":":hugging_face:","symbol":"🤗","group":"people","keywords":["face","hug","hugging"]},{"id":":star-struck:","symbol":"🤩","group":"people","keywords":["eyes","face","grinning","star","star-struck",""]},{"id":":thinking_face:","symbol":"🤔","group":"people","keywords":["face","thinking"]},{"id":":face_with_raised_eyebrow:","symbol":"🤨","group":"people","keywords":["distrust","face with raised eyebrow","skeptic",""]},{"id":":neutral_face:","symbol":"😐","group":"people","keywords":["deadpan","face","neutral"]},{"id":":expressionless_face:","symbol":"😑","group":"people","keywords":["expressionless","face","inexpressive","unexpressive"]},{"id":":face_without_mouth:","symbol":"😶","group":"people","keywords":["face","face without mouth","mouth","quiet","silent"]},{"id":":face_with_rolling_eyes:","symbol":"🙄","group":"people","keywords":["eyes","face","face with rolling eyes","rolling"]},{"id":":smirking_face:","symbol":"😏","group":"people","keywords":["face","smirk","smirking face"]},{"id":":persevering_face:","symbol":"😣","group":"people","keywords":["face","persevere","persevering face"]},{"id":":sad_but_relieved_face:","symbol":"😥","group":"people","keywords":["disappointed","face","relieved","sad but relieved face","whew"]},{"id":":face_with_open_mouth:","symbol":"😮","group":"people","keywords":["face","face with open mouth","mouth","open","sympathy"]},{"id":":zipper-mouth_face:","symbol":"🤐","group":"people","keywords":["face","mouth","zipper","zipper-mouth face"]},{"id":":hushed_face:","symbol":"😯","group":"people","keywords":["face","hushed","stunned","surprised"]},{"id":":sleepy_face:","symbol":"😪","group":"people","keywords":["face","sleep","sleepy face"]},{"id":":tired_face:","symbol":"😫","group":"people","keywords":["face","tired"]},{"id":":sleeping_face:","symbol":"😴","group":"people","keywords":["face","sleep","sleeping face","zzz"]},{"id":":relieved_face:","symbol":"😌","group":"people","keywords":["face","relieved"]},{"id":":face_with_tongue:","symbol":"😛","group":"people","keywords":["face","face with tongue","tongue"]},{"id":":winking_face_with_tongue:","symbol":"😜","group":"people","keywords":["eye","face","joke","tongue","wink","winking face with tongue"]},{"id":":squinting_face_with_tongue:","symbol":"😝","group":"people","keywords":["eye","face","horrible","squinting face with tongue","taste","tongue"]},{"id":":drooling_face:","symbol":"🤤","group":"people","keywords":["drooling","face"]},{"id":":unamused_face:","symbol":"😒","group":"people","keywords":["face","unamused","unhappy"]},{"id":":downcast_face_with_sweat:","symbol":"😓","group":"people","keywords":["cold","downcast face with sweat","face","sweat"]},{"id":":pensive_face:","symbol":"😔","group":"people","keywords":["dejected","face","pensive"]},{"id":":confused_face:","symbol":"😕","group":"people","keywords":["confused","face"]},{"id":":upside-down_face:","symbol":"🙃","group":"people","keywords":["face","upside-down"]},{"id":":money-mouth_face:","symbol":"🤑","group":"people","keywords":["face","money","money-mouth face","mouth"]},{"id":":astonished_face:","symbol":"😲","group":"people","keywords":["astonished","face","shocked","totally"]},{"id":":frowning_face:","symbol":"☹","group":"people","keywords":["face","frown","frowning face"]},{"id":":slightly_frowning_face:","symbol":"🙁","group":"people","keywords":["face","frown","slightly frowning face"]},{"id":":confounded_face:","symbol":"😖","group":"people","keywords":["confounded","face"]},{"id":":disappointed_face:","symbol":"😞","group":"people","keywords":["disappointed","face"]},{"id":":worried_face:","symbol":"😟","group":"people","keywords":["face","worried"]},{"id":":face_with_steam_from_nose:","symbol":"😤","group":"people","keywords":["face","face with steam from nose","triumph","won"]},{"id":":crying_face:","symbol":"😢","group":"people","keywords":["cry","crying face","face","sad","tear"]},{"id":":loudly_crying_face:","symbol":"😭","group":"people","keywords":["cry","face","loudly crying face","sad","sob","tear"]},{"id":":frowning_face_with_open_mouth:","symbol":"😦","group":"people","keywords":["face","frown","frowning face with open mouth","mouth","open"]},{"id":":anguished_face:","symbol":"😧","group":"people","keywords":["anguished","face"]},{"id":":fearful_face:","symbol":"😨","group":"people","keywords":["face","fear","fearful","scared"]},{"id":":weary_face:","symbol":"😩","group":"people","keywords":["face","tired","weary"]},{"id":":exploding_head:","symbol":"🤯","group":"people","keywords":["exploding head","shocked"]},{"id":":grimacing_face:","symbol":"😬","group":"people","keywords":["face","grimace","grimacing face"]},{"id":":anxious_face_with_sweat:","symbol":"😰","group":"people","keywords":["anxious face with sweat","blue","cold","face","rushed","sweat"]},{"id":":face_screaming_in_fear:","symbol":"😱","group":"people","keywords":["face","face screaming in fear","fear","munch","scared","scream"]},{"id":":flushed_face:","symbol":"😳","group":"people","keywords":["dazed","face","flushed"]},{"id":":zany_face:","symbol":"🤪","group":"people","keywords":["eye","goofy","large","small","zany face"]},{"id":":dizzy_face:","symbol":"😵","group":"people","keywords":["dizzy","face"]},{"id":":pouting_face:","symbol":"😡","group":"people","keywords":["angry","face","mad","pouting","rage","red"]},{"id":":angry_face:","symbol":"😠","group":"people","keywords":["angry","face","mad"]},{"id":":face_with_symbols_on_mouth:","symbol":"🤬","group":"people","keywords":["face with symbols on mouth","swearing",""]},{"id":":face_with_medical_mask:","symbol":"😷","group":"people","keywords":["cold","doctor","face","face with medical mask","mask","sick"]},{"id":":face_with_thermometer:","symbol":"🤒","group":"people","keywords":["face","face with thermometer","ill","sick","thermometer"]},{"id":":face_with_head-bandage:","symbol":"🤕","group":"people","keywords":["bandage","face","face with head-bandage","hurt","injury"]},{"id":":nauseated_face:","symbol":"🤢","group":"people","keywords":["face","nauseated","vomit"]},{"id":":face_vomiting:","symbol":"🤮","group":"people","keywords":["face vomiting","sick","vomit"]},{"id":":sneezing_face:","symbol":"🤧","group":"people","keywords":["face","gesundheit","sneeze","sneezing face"]},{"id":":smiling_face_with_halo:","symbol":"😇","group":"people","keywords":["angel","face","fantasy","halo","innocent","smiling face with halo"]},{"id":":cowboy_hat_face:","symbol":"🤠","group":"people","keywords":["cowboy","cowgirl","face","hat"]},{"id":":lying_face:","symbol":"🤥","group":"people","keywords":["face","lie","lying face","pinocchio"]},{"id":":shushing_face:","symbol":"🤫","group":"people","keywords":["quiet","shush","shushing face"]},{"id":":face_with_hand_over_mouth:","symbol":"🤭","group":"people","keywords":["face with hand over mouth","whoops",""]},{"id":":face_with_monocle:","symbol":"🧐","group":"people","keywords":["face with monocle","stuffy",""]},{"id":":nerd_face:","symbol":"🤓","group":"people","keywords":["face","geek","nerd"]},{"id":":smiling_face_with_horns:","symbol":"😈","group":"people","keywords":["face","fairy tale","fantasy","horns","smile","smiling face with horns"]},{"id":":angry_face_with_horns:","symbol":"👿","group":"people","keywords":["angry face with horns","demon","devil","face","fantasy","imp"]},{"id":":clown_face:","symbol":"🤡","group":"people","keywords":["clown","face"]},{"id":":ogre:","symbol":"👹","group":"people","keywords":["creature","face","fairy tale","fantasy","monster","ogre",""]},{"id":":goblin:","symbol":"👺","group":"people","keywords":["creature","face","fairy tale","fantasy","goblin","monster"]},{"id":":skull:","symbol":"💀","group":"people","keywords":["death","face","fairy tale","monster","skull"]},{"id":":skull_and_crossbones:","symbol":"☠","group":"people","keywords":["crossbones","death","face","monster","skull","skull and crossbones"]},{"id":":ghost:","symbol":"👻","group":"people","keywords":["creature","face","fairy tale","fantasy","ghost","monster"]},{"id":":alien:","symbol":"👽","group":"people","keywords":["alien","creature","extraterrestrial","face","fantasy","ufo"]},{"id":":alien_monster:","symbol":"👾","group":"people","keywords":["alien","creature","extraterrestrial","face","monster","ufo"]},{"id":":robot_face:","symbol":"🤖","group":"people","keywords":["face","monster","robot"]},{"id":":pile_of_poo:","symbol":"💩","group":"people","keywords":["dung","face","monster","pile of poo","poo","poop"]},{"id":":grinning_cat_face:","symbol":"😺","group":"people","keywords":["cat","face","grinning cat face","mouth","open","smile"]},{"id":":grinning_cat_face_with_smiling_eyes:","symbol":"😸","group":"people","keywords":["cat","eye","face","grin","grinning cat face with smiling eyes","smile"]},{"id":":cat_face_with_tears_of_joy:","symbol":"😹","group":"people","keywords":["cat","cat face with tears of joy","face","joy","tear"]},{"id":":smiling_cat_face_with_heart-eyes:","symbol":"😻","group":"people","keywords":["cat","eye","face","love","smile","smiling cat face with heart-eyes"]},{"id":":cat_face_with_wry_smile:","symbol":"😼","group":"people","keywords":["cat","cat face with wry smile","face","ironic","smile","wry"]},{"id":":kissing_cat_face:","symbol":"😽","group":"people","keywords":["cat","eye","face","kiss","kissing cat face"]},{"id":":weary_cat_face:","symbol":"🙀","group":"people","keywords":["cat","face","oh","surprised","weary"]},{"id":":crying_cat_face:","symbol":"😿","group":"people","keywords":["cat","cry","crying cat face","face","sad","tear"]},{"id":":pouting_cat_face:","symbol":"😾","group":"people","keywords":["cat","face","pouting"]},{"id":":see-no-evil_monkey:","symbol":"🙈","group":"people","keywords":["evil","face","forbidden","monkey","see","see-no-evil monkey"]},{"id":":hear-no-evil_monkey:","symbol":"🙉","group":"people","keywords":["evil","face","forbidden","hear","hear-no-evil monkey","monkey"]},{"id":":speak-no-evil_monkey:","symbol":"🙊","group":"people","keywords":["evil","face","forbidden","monkey","speak","speak-no-evil monkey"]},{"id":":baby:","symbol":"👶","group":"people","keywords":["baby","young"]},{"id":":child:","symbol":"🧒","group":"people","keywords":["child","gender-neutral","unspecified gender","young"]},{"id":":boy:","symbol":"👦","group":"people","keywords":["boy","young"]},{"id":":girl:","symbol":"👧","group":"people","keywords":["girl","Virgo","young","zodiac"]},{"id":":person:","symbol":"🧑","group":"people","keywords":["adult","gender-neutral","person","unspecified gender"]},{"id":":person_blond_hair:","symbol":"👱","group":"people","keywords":["blond","blond-haired person","person: blond hair"]},{"id":":man:","symbol":"👨","group":"people","keywords":["adult","man"]},{"id":":man_blond_hair:","symbol":"👱‍♂️","group":"people","keywords":["blond","blond-haired man","man","man: blond hair"]},{"id":":man_beard:","symbol":"🧔","group":"people","keywords":["beard","man: beard","person",""]},{"id":":woman:","symbol":"👩","group":"people","keywords":["adult","woman"]},{"id":":woman_blond_hair:","symbol":"👱‍♀️","group":"people","keywords":["blond-haired woman","blonde","woman","woman: blond hair"]},{"id":":older_person:","symbol":"🧓","group":"people","keywords":["adult","gender-neutral","old","older person","unspecified gender"]},{"id":":old_man:","symbol":"👴","group":"people","keywords":["adult","man","old"]},{"id":":old_woman:","symbol":"👵","group":"people","keywords":["adult","old","woman"]},{"id":":man_health_worker:","symbol":"👨‍⚕️","group":"people","keywords":["doctor","healthcare","man","man health worker","nurse","therapist"]},{"id":":woman_health_worker:","symbol":"👩‍⚕️","group":"people","keywords":["doctor","healthcare","nurse","therapist","woman","woman health worker"]},{"id":":man_student:","symbol":"👨‍🎓","group":"people","keywords":["graduate","man","student"]},{"id":":woman_student:","symbol":"👩‍🎓","group":"people","keywords":["graduate","student","woman"]},{"id":":man_teacher:","symbol":"👨‍🏫","group":"people","keywords":["instructor","man","professor","teacher"]},{"id":":woman_teacher:","symbol":"👩‍🏫","group":"people","keywords":["instructor","professor","teacher","woman"]},{"id":":man_judge:","symbol":"👨‍⚖️","group":"people","keywords":["justice","man","man judge","scales"]},{"id":":woman_judge:","symbol":"👩‍⚖️","group":"people","keywords":["judge","scales","woman"]},{"id":":man_farmer:","symbol":"👨‍🌾","group":"people","keywords":["farmer","gardener","man","rancher"]},{"id":":woman_farmer:","symbol":"👩‍🌾","group":"people","keywords":["farmer","gardener","rancher","woman"]},{"id":":man_cook:","symbol":"👨‍🍳","group":"people","keywords":["chef","cook","man"]},{"id":":woman_cook:","symbol":"👩‍🍳","group":"people","keywords":["chef","cook","woman"]},{"id":":man_mechanic:","symbol":"👨‍🔧","group":"people","keywords":["electrician","man","mechanic","plumber","tradesperson"]},{"id":":woman_mechanic:","symbol":"👩‍🔧","group":"people","keywords":["electrician","mechanic","plumber","tradesperson","woman"]},{"id":":man_factory_worker:","symbol":"👨‍🏭","group":"people","keywords":["assembly","factory","industrial","man","worker"]},{"id":":woman_factory_worker:","symbol":"👩‍🏭","group":"people","keywords":["assembly","factory","industrial","woman","worker"]},{"id":":man_office_worker:","symbol":"👨‍💼","group":"people","keywords":["architect","business","man","man office worker","manager","white-collar"]},{"id":":woman_office_worker:","symbol":"👩‍💼","group":"people","keywords":["architect","business","manager","white-collar","woman","woman office worker"]},{"id":":man_scientist:","symbol":"👨‍🔬","group":"people","keywords":["biologist","chemist","engineer","man","physicist","scientist"]},{"id":":woman_scientist:","symbol":"👩‍🔬","group":"people","keywords":["biologist","chemist","engineer","physicist","scientist","woman"]},{"id":":man_technologist:","symbol":"👨‍💻","group":"people","keywords":["coder","developer","inventor","man","software","technologist"]},{"id":":woman_technologist:","symbol":"👩‍💻","group":"people","keywords":["coder","developer","inventor","software","technologist","woman"]},{"id":":man_singer:","symbol":"👨‍🎤","group":"people","keywords":["actor","entertainer","man","rock","singer","star"]},{"id":":woman_singer:","symbol":"👩‍🎤","group":"people","keywords":["actor","entertainer","rock","singer","star","woman"]},{"id":":man_artist:","symbol":"👨‍🎨","group":"people","keywords":["artist","man","palette"]},{"id":":woman_artist:","symbol":"👩‍🎨","group":"people","keywords":["artist","palette","woman"]},{"id":":man_pilot:","symbol":"👨‍✈️","group":"people","keywords":["man","pilot","plane"]},{"id":":woman_pilot:","symbol":"👩‍✈️","group":"people","keywords":["pilot","plane","woman"]},{"id":":man_astronaut:","symbol":"👨‍🚀","group":"people","keywords":["astronaut","man","rocket"]},{"id":":woman_astronaut:","symbol":"👩‍🚀","group":"people","keywords":["astronaut","rocket","woman"]},{"id":":man_firefighter:","symbol":"👨‍🚒","group":"people","keywords":["firefighter","firetruck","man"]},{"id":":woman_firefighter:","symbol":"👩‍🚒","group":"people","keywords":["firefighter","firetruck","woman"]},{"id":":police_officer:","symbol":"👮","group":"people","keywords":["cop","officer","police"]},{"id":":man_police_officer:","symbol":"👮‍♂️","group":"people","keywords":["cop","man","officer","police"]},{"id":":woman_police_officer:","symbol":"👮‍♀️","group":"people","keywords":["cop","officer","police","woman"]},{"id":":detective:","symbol":"🕵","group":"people","keywords":["detective","sleuth","spy"]},{"id":":man_detective:","symbol":"🕵️‍♂️","group":"people","keywords":["detective","man","sleuth","spy"]},{"id":":woman_detective:","symbol":"🕵️‍♀️","group":"people","keywords":["detective","sleuth","spy","woman"]},{"id":":guard:","symbol":"💂","group":"people","keywords":["guard"]},{"id":":man_guard:","symbol":"💂‍♂️","group":"people","keywords":["guard","man"]},{"id":":woman_guard:","symbol":"💂‍♀️","group":"people","keywords":["guard","woman"]},{"id":":construction_worker:","symbol":"👷","group":"people","keywords":["construction","hat","worker"]},{"id":":man_construction_worker:","symbol":"👷‍♂️","group":"people","keywords":["construction","man","worker"]},{"id":":woman_construction_worker:","symbol":"👷‍♀️","group":"people","keywords":["construction","woman","worker"]},{"id":":prince:","symbol":"🤴","group":"people","keywords":["prince"]},{"id":":princess:","symbol":"👸","group":"people","keywords":["fairy tale","fantasy","princess"]},{"id":":person_wearing_turban:","symbol":"👳","group":"people","keywords":["person wearing turban","turban"]},{"id":":man_wearing_turban:","symbol":"👳‍♂️","group":"people","keywords":["man","man wearing turban","turban"]},{"id":":woman_wearing_turban:","symbol":"👳‍♀️","group":"people","keywords":["turban","woman","woman wearing turban"]},{"id":":man_with_chinese_cap:","symbol":"👲","group":"people","keywords":["gua pi mao","hat","man","man with Chinese cap"]},{"id":":woman_with_headscarf:","symbol":"🧕","group":"people","keywords":["headscarf","hijab","mantilla","tichel","woman with headscarf",""]},{"id":":man_in_tuxedo:","symbol":"🤵","group":"people","keywords":["groom","man","man in tuxedo","tuxedo"]},{"id":":bride_with_veil:","symbol":"👰","group":"people","keywords":["bride","bride with veil","veil","wedding"]},{"id":":pregnant_woman:","symbol":"🤰","group":"people","keywords":["pregnant","woman"]},{"id":":breast-feeding:","symbol":"🤱","group":"people","keywords":["baby","breast","breast-feeding","nursing"]},{"id":":baby_angel:","symbol":"👼","group":"people","keywords":["angel","baby","face","fairy tale","fantasy"]},{"id":":santa_claus:","symbol":"🎅","group":"people","keywords":["celebration","Christmas","claus","father","santa","Santa Claus"]},{"id":":mrs._claus:","symbol":"🤶","group":"people","keywords":["celebration","Christmas","claus","mother","Mrs.","Mrs. Claus"]},{"id":":mage:","symbol":"🧙","group":"people","keywords":["mage","sorcerer","sorceress","witch","wizard"]},{"id":":man_mage:","symbol":"🧙‍♂️","group":"people","keywords":["man mage","sorcerer","wizard"]},{"id":":woman_mage:","symbol":"🧙‍♀️","group":"people","keywords":["sorceress","witch","woman mage"]},{"id":":fairy:","symbol":"🧚","group":"people","keywords":["fairy","Oberon","Puck","Titania"]},{"id":":man_fairy:","symbol":"🧚‍♂️","group":"people","keywords":["man fairy","Oberon","Puck"]},{"id":":woman_fairy:","symbol":"🧚‍♀️","group":"people","keywords":["Titania","woman fairy"]},{"id":":vampire:","symbol":"🧛","group":"people","keywords":["Dracula","undead","vampire"]},{"id":":man_vampire:","symbol":"🧛‍♂️","group":"people","keywords":["Dracula","man vampire","undead"]},{"id":":woman_vampire:","symbol":"🧛‍♀️","group":"people","keywords":["undead","woman vampire"]},{"id":":merperson:","symbol":"🧜","group":"people","keywords":["mermaid","merman","merperson","merwoman"]},{"id":":merman:","symbol":"🧜‍♂️","group":"people","keywords":["merman","Triton"]},{"id":":mermaid:","symbol":"🧜‍♀️","group":"people","keywords":["mermaid","merwoman"]},{"id":":elf:","symbol":"🧝","group":"people","keywords":["elf","magical",""]},{"id":":man_elf:","symbol":"🧝‍♂️","group":"people","keywords":["magical","man elf"]},{"id":":woman_elf:","symbol":"🧝‍♀️","group":"people","keywords":["magical","woman elf"]},{"id":":genie:","symbol":"🧞","group":"people","keywords":["djinn","genie",""]},{"id":":man_genie:","symbol":"🧞‍♂️","group":"people","keywords":["djinn","man genie"]},{"id":":woman_genie:","symbol":"🧞‍♀️","group":"people","keywords":["djinn","woman genie"]},{"id":":zombie:","symbol":"🧟","group":"people","keywords":["undead","walking dead","zombie",""]},{"id":":man_zombie:","symbol":"🧟‍♂️","group":"people","keywords":["man zombie","undead","walking dead"]},{"id":":woman_zombie:","symbol":"🧟‍♀️","group":"people","keywords":["undead","walking dead","woman zombie"]},{"id":":person_frowning:","symbol":"🙍","group":"people","keywords":["frown","gesture","person frowning"]},{"id":":man_frowning:","symbol":"🙍‍♂️","group":"people","keywords":["frowning","gesture","man"]},{"id":":woman_frowning:","symbol":"🙍‍♀️","group":"people","keywords":["frowning","gesture","woman"]},{"id":":person_pouting:","symbol":"🙎","group":"people","keywords":["gesture","person pouting","pouting"]},{"id":":man_pouting:","symbol":"🙎‍♂️","group":"people","keywords":["gesture","man","pouting"]},{"id":":woman_pouting:","symbol":"🙎‍♀️","group":"people","keywords":["gesture","pouting","woman"]},{"id":":person_gesturing_no:","symbol":"🙅","group":"people","keywords":["forbidden","gesture","hand","person gesturing NO","prohibited"]},{"id":":man_gesturing_no:","symbol":"🙅‍♂️","group":"people","keywords":["forbidden","gesture","hand","man","man gesturing NO","prohibited"]},{"id":":woman_gesturing_no:","symbol":"🙅‍♀️","group":"people","keywords":["forbidden","gesture","hand","prohibited","woman","woman gesturing NO"]},{"id":":person_gesturing_ok:","symbol":"🙆","group":"people","keywords":["gesture","hand","OK","person gesturing OK"]},{"id":":man_gesturing_ok:","symbol":"🙆‍♂️","group":"people","keywords":["gesture","hand","man","man gesturing OK","OK"]},{"id":":woman_gesturing_ok:","symbol":"🙆‍♀️","group":"people","keywords":["gesture","hand","OK","woman","woman gesturing OK"]},{"id":":person_tipping_hand:","symbol":"💁","group":"people","keywords":["hand","help","information","person tipping hand","sassy","tipping"]},{"id":":man_tipping_hand:","symbol":"💁‍♂️","group":"people","keywords":["man","man tipping hand","sassy","tipping hand"]},{"id":":woman_tipping_hand:","symbol":"💁‍♀️","group":"people","keywords":["sassy","tipping hand","woman","woman tipping hand"]},{"id":":person_raising_hand:","symbol":"🙋","group":"people","keywords":["gesture","hand","happy","person raising hand","raised"]},{"id":":man_raising_hand:","symbol":"🙋‍♂️","group":"people","keywords":["gesture","man","man raising hand","raising hand"]},{"id":":woman_raising_hand:","symbol":"🙋‍♀️","group":"people","keywords":["gesture","raising hand","woman","woman raising hand"]},{"id":":person_bowing:","symbol":"🙇","group":"people","keywords":["apology","bow","gesture","person bowing","sorry"]},{"id":":man_bowing:","symbol":"🙇‍♂️","group":"people","keywords":["apology","bowing","favor","gesture","man","sorry"]},{"id":":woman_bowing:","symbol":"🙇‍♀️","group":"people","keywords":["apology","bowing","favor","gesture","sorry","woman"]},{"id":":person_facepalming:","symbol":"🤦","group":"people","keywords":["disbelief","exasperation","face","palm","person facepalming"]},{"id":":man_facepalming:","symbol":"🤦‍♂️","group":"people","keywords":["disbelief","exasperation","facepalm","man","man facepalming"]},{"id":":woman_facepalming:","symbol":"🤦‍♀️","group":"people","keywords":["disbelief","exasperation","facepalm","woman","woman facepalming"]},{"id":":person_shrugging:","symbol":"🤷","group":"people","keywords":["doubt","ignorance","indifference","person shrugging","shrug"]},{"id":":man_shrugging:","symbol":"🤷‍♂️","group":"people","keywords":["doubt","ignorance","indifference","man","man shrugging","shrug"]},{"id":":woman_shrugging:","symbol":"🤷‍♀️","group":"people","keywords":["doubt","ignorance","indifference","shrug","woman","woman shrugging"]},{"id":":person_getting_massage:","symbol":"💆","group":"people","keywords":["face","massage","person getting massage","salon"]},{"id":":man_getting_massage:","symbol":"💆‍♂️","group":"people","keywords":["face","man","man getting massage","massage"]},{"id":":woman_getting_massage:","symbol":"💆‍♀️","group":"people","keywords":["face","massage","woman","woman getting massage"]},{"id":":person_getting_haircut:","symbol":"💇","group":"people","keywords":["barber","beauty","haircut","parlor","person getting haircut"]},{"id":":man_getting_haircut:","symbol":"💇‍♂️","group":"people","keywords":["haircut","man","man getting haircut"]},{"id":":woman_getting_haircut:","symbol":"💇‍♀️","group":"people","keywords":["haircut","woman","woman getting haircut"]},{"id":":person_walking:","symbol":"🚶","group":"people","keywords":["hike","person walking","walk","walking"]},{"id":":man_walking:","symbol":"🚶‍♂️","group":"people","keywords":["hike","man","man walking","walk"]},{"id":":woman_walking:","symbol":"🚶‍♀️","group":"people","keywords":["hike","walk","woman","woman walking"]},{"id":":person_running:","symbol":"🏃","group":"people","keywords":["marathon","person running","running"]},{"id":":man_running:","symbol":"🏃‍♂️","group":"people","keywords":["man","marathon","racing","running"]},{"id":":woman_running:","symbol":"🏃‍♀️","group":"people","keywords":["marathon","racing","running","woman"]},{"id":":woman_dancing:","symbol":"💃","group":"people","keywords":["dancing","woman"]},{"id":":man_dancing:","symbol":"🕺","group":"people","keywords":["dance","man","man dancing"]},{"id":":people_with_bunny_ears:","symbol":"👯","group":"people","keywords":["bunny ear","dancer","partying","people with bunny ears"]},{"id":":men_with_bunny_ears:","symbol":"👯‍♂️","group":"people","keywords":["bunny ear","dancer","men","men with bunny ears","partying"]},{"id":":women_with_bunny_ears:","symbol":"👯‍♀️","group":"people","keywords":["bunny ear","dancer","partying","women","women with bunny ears"]},{"id":":person_in_steamy_room:","symbol":"🧖","group":"people","keywords":["person in steamy room","sauna","steam room",""]},{"id":":man_in_steamy_room:","symbol":"🧖‍♂️","group":"people","keywords":["man in steamy room","sauna","steam room"]},{"id":":woman_in_steamy_room:","symbol":"🧖‍♀️","group":"people","keywords":["sauna","steam room","woman in steamy room"]},{"id":":person_climbing:","symbol":"🧗","group":"people","keywords":["climber","person climbing"]},{"id":":man_climbing:","symbol":"🧗‍♂️","group":"people","keywords":["climber","man climbing"]},{"id":":woman_climbing:","symbol":"🧗‍♀️","group":"people","keywords":["climber","woman climbing"]},{"id":":person_in_lotus_position:","symbol":"🧘","group":"people","keywords":["meditation","person in lotus position","yoga",""]},{"id":":man_in_lotus_position:","symbol":"🧘‍♂️","group":"people","keywords":["man in lotus position","meditation","yoga"]},{"id":":woman_in_lotus_position:","symbol":"🧘‍♀️","group":"people","keywords":["meditation","woman in lotus position","yoga"]},{"id":":person_taking_bath:","symbol":"🛀","group":"people","keywords":["bath","bathtub","person taking bath"]},{"id":":person_in_bed:","symbol":"🛌","group":"people","keywords":["hotel","person in bed","sleep"]},{"id":":man_in_suit_levitating:","symbol":"🕴","group":"people","keywords":["business","man","man in suit levitating","suit"]},{"id":":speaking_head:","symbol":"🗣","group":"people","keywords":["face","head","silhouette","speak","speaking"]},{"id":":bust_in_silhouette:","symbol":"👤","group":"people","keywords":["bust","bust in silhouette","silhouette"]},{"id":":busts_in_silhouette:","symbol":"👥","group":"people","keywords":["bust","busts in silhouette","silhouette"]},{"id":":person_fencing:","symbol":"🤺","group":"people","keywords":["fencer","fencing","person fencing","sword"]},{"id":":horse_racing:","symbol":"🏇","group":"people","keywords":["horse","jockey","racehorse","racing"]},{"id":":skier:","symbol":"⛷","group":"people","keywords":["ski","skier","snow"]},{"id":":snowboarder:","symbol":"🏂","group":"people","keywords":["ski","snow","snowboard","snowboarder"]},{"id":":person_golfing:","symbol":"🏌","group":"people","keywords":["ball","golf","person golfing"]},{"id":":man_golfing:","symbol":"🏌️‍♂️","group":"people","keywords":["golf","man","man golfing"]},{"id":":woman_golfing:","symbol":"🏌️‍♀️","group":"people","keywords":["golf","woman","woman golfing"]},{"id":":person_surfing:","symbol":"🏄","group":"people","keywords":["person surfing","surfing"]},{"id":":man_surfing:","symbol":"🏄‍♂️","group":"people","keywords":["man","surfing"]},{"id":":woman_surfing:","symbol":"🏄‍♀️","group":"people","keywords":["surfing","woman"]},{"id":":person_rowing_boat:","symbol":"🚣","group":"people","keywords":["boat","person rowing boat","rowboat"]},{"id":":man_rowing_boat:","symbol":"🚣‍♂️","group":"people","keywords":["boat","man","man rowing boat","rowboat"]},{"id":":woman_rowing_boat:","symbol":"🚣‍♀️","group":"people","keywords":["boat","rowboat","woman","woman rowing boat"]},{"id":":person_swimming:","symbol":"🏊","group":"people","keywords":["person swimming","swim"]},{"id":":man_swimming:","symbol":"🏊‍♂️","group":"people","keywords":["man","man swimming","swim"]},{"id":":woman_swimming:","symbol":"🏊‍♀️","group":"people","keywords":["swim","woman","woman swimming"]},{"id":":person_bouncing_ball:","symbol":"⛹","group":"people","keywords":["ball","person bouncing ball"]},{"id":":man_bouncing_ball:","symbol":"⛹️‍♂️","group":"people","keywords":["ball","man","man bouncing ball"]},{"id":":woman_bouncing_ball:","symbol":"⛹️‍♀️","group":"people","keywords":["ball","woman","woman bouncing ball"]},{"id":":person_lifting_weights:","symbol":"🏋","group":"people","keywords":["lifter","person lifting weights","weight"]},{"id":":man_lifting_weights:","symbol":"🏋️‍♂️","group":"people","keywords":["man","man lifting weights","weight lifter"]},{"id":":woman_lifting_weights:","symbol":"🏋️‍♀️","group":"people","keywords":["weight lifter","woman","woman lifting weights"]},{"id":":person_biking:","symbol":"🚴","group":"people","keywords":["bicycle","biking","cyclist","person biking"]},{"id":":man_biking:","symbol":"🚴‍♂️","group":"people","keywords":["bicycle","biking","cyclist","man"]},{"id":":woman_biking:","symbol":"🚴‍♀️","group":"people","keywords":["bicycle","biking","cyclist","woman"]},{"id":":person_mountain_biking:","symbol":"🚵","group":"people","keywords":["bicycle","bicyclist","bike","cyclist","mountain","person mountain biking"]},{"id":":man_mountain_biking:","symbol":"🚵‍♂️","group":"people","keywords":["bicycle","bike","cyclist","man","man mountain biking","mountain"]},{"id":":woman_mountain_biking:","symbol":"🚵‍♀️","group":"people","keywords":["bicycle","bike","biking","cyclist","mountain","woman"]},{"id":":racing_car:","symbol":"🏎","group":"people","keywords":["car","racing"]},{"id":":motorcycle:","symbol":"🏍","group":"people","keywords":["motorcycle","racing"]},{"id":":person_cartwheeling:","symbol":"🤸","group":"people","keywords":["cartwheel","gymnastics","person cartwheeling"]},{"id":":man_cartwheeling:","symbol":"🤸‍♂️","group":"people","keywords":["cartwheel","gymnastics","man","man cartwheeling"]},{"id":":woman_cartwheeling:","symbol":"🤸‍♀️","group":"people","keywords":["cartwheel","gymnastics","woman","woman cartwheeling"]},{"id":":people_wrestling:","symbol":"🤼","group":"people","keywords":["people wrestling","wrestle","wrestler"]},{"id":":men_wrestling:","symbol":"🤼‍♂️","group":"people","keywords":["men","men wrestling","wrestle"]},{"id":":women_wrestling:","symbol":"🤼‍♀️","group":"people","keywords":["women","women wrestling","wrestle"]},{"id":":person_playing_water_polo:","symbol":"🤽","group":"people","keywords":["person playing water polo","polo","water"]},{"id":":man_playing_water_polo:","symbol":"🤽‍♂️","group":"people","keywords":["man","man playing water polo","water polo"]},{"id":":woman_playing_water_polo:","symbol":"🤽‍♀️","group":"people","keywords":["water polo","woman","woman playing water polo"]},{"id":":person_playing_handball:","symbol":"🤾","group":"people","keywords":["ball","handball","person playing handball"]},{"id":":man_playing_handball:","symbol":"🤾‍♂️","group":"people","keywords":["handball","man","man playing handball"]},{"id":":woman_playing_handball:","symbol":"🤾‍♀️","group":"people","keywords":["handball","woman","woman playing handball"]},{"id":":person_juggling:","symbol":"🤹","group":"people","keywords":["balance","juggle","multitask","person juggling","skill"]},{"id":":man_juggling:","symbol":"🤹‍♂️","group":"people","keywords":["juggling","man","multitask"]},{"id":":woman_juggling:","symbol":"🤹‍♀️","group":"people","keywords":["juggling","multitask","woman"]},{"id":":man_and_woman_holding_hands:","symbol":"👫","group":"people","keywords":["couple","hand","hold","man","man and woman holding hands","woman"]},{"id":":two_men_holding_hands:","symbol":"👬","group":"people","keywords":["couple","Gemini","man","twins","two men holding hands","zodiac"]},{"id":":two_women_holding_hands:","symbol":"👭","group":"people","keywords":["couple","hand","two women holding hands","woman"]},{"id":":kiss:","symbol":"💏","group":"people","keywords":["couple","kiss"]},{"id":":kiss_woman_man:","symbol":"👩‍❤️‍💋‍👨","group":"people","keywords":["couple","kiss","man","woman"]},{"id":":kiss_man_man:","symbol":"👨‍❤️‍💋‍👨","group":"people","keywords":["couple","kiss","man"]},{"id":":kiss_woman_woman:","symbol":"👩‍❤️‍💋‍👩","group":"people","keywords":["couple","kiss","woman"]},{"id":":couple_with_heart:","symbol":"💑","group":"people","keywords":["couple","couple with heart","love"]},{"id":":couple_with_heart_woman_man:","symbol":"👩‍❤️‍👨","group":"people","keywords":["couple","couple with heart","love","man","woman"]},{"id":":couple_with_heart_man_man:","symbol":"👨‍❤️‍👨","group":"people","keywords":["couple","couple with heart","love","man"]},{"id":":couple_with_heart_woman_woman:","symbol":"👩‍❤️‍👩","group":"people","keywords":["couple","couple with heart","love","woman"]},{"id":":family:","symbol":"👪","group":"people","keywords":["family"]},{"id":":family_man_woman_boy:","symbol":"👨‍👩‍👦","group":"people","keywords":["boy","family","man","woman"]},{"id":":family_man_woman_girl:","symbol":"👨‍👩‍👧","group":"people","keywords":["family","girl","man","woman"]},{"id":":family_man_woman_girl_boy:","symbol":"👨‍👩‍👧‍👦","group":"people","keywords":["boy","family","girl","man","woman"]},{"id":":family_man_woman_boy_boy:","symbol":"👨‍👩‍👦‍👦","group":"people","keywords":["boy","family","man","woman"]},{"id":":family_man_woman_girl_girl:","symbol":"👨‍👩‍👧‍👧","group":"people","keywords":["family","girl","man","woman"]},{"id":":family_man_man_boy:","symbol":"👨‍👨‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_man_girl:","symbol":"👨‍👨‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_man_man_girl_boy:","symbol":"👨‍👨‍👧‍👦","group":"people","keywords":["boy","family","girl","man"]},{"id":":family_man_man_boy_boy:","symbol":"👨‍👨‍👦‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_man_girl_girl:","symbol":"👨‍👨‍👧‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_woman_woman_boy:","symbol":"👩‍👩‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_woman_girl:","symbol":"👩‍👩‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_woman_woman_girl_boy:","symbol":"👩‍👩‍👧‍👦","group":"people","keywords":["boy","family","girl","woman"]},{"id":":family_woman_woman_boy_boy:","symbol":"👩‍👩‍👦‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_woman_girl_girl:","symbol":"👩‍👩‍👧‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_man_boy:","symbol":"👨‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_boy_boy:","symbol":"👨‍👦‍👦","group":"people","keywords":["boy","family","man"]},{"id":":family_man_girl:","symbol":"👨‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_man_girl_boy:","symbol":"👨‍👧‍👦","group":"people","keywords":["boy","family","girl","man"]},{"id":":family_man_girl_girl:","symbol":"👨‍👧‍👧","group":"people","keywords":["family","girl","man"]},{"id":":family_woman_boy:","symbol":"👩‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_boy_boy:","symbol":"👩‍👦‍👦","group":"people","keywords":["boy","family","woman"]},{"id":":family_woman_girl:","symbol":"👩‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":family_woman_girl_boy:","symbol":"👩‍👧‍👦","group":"people","keywords":["boy","family","girl","woman"]},{"id":":family_woman_girl_girl:","symbol":"👩‍👧‍👧","group":"people","keywords":["family","girl","woman"]},{"id":":selfie:","symbol":"🤳","group":"people","keywords":["camera","phone","selfie"]},{"id":":flexed_biceps:","symbol":"💪","group":"people","keywords":["biceps","comic","flex","flexed biceps","muscle"]},{"id":":backhand_index_pointing_left:","symbol":"👈","group":"people","keywords":["backhand","backhand index pointing left","finger","hand","index","point"]},{"id":":backhand_index_pointing_right:","symbol":"👉","group":"people","keywords":["backhand","backhand index pointing right","finger","hand","index","point"]},{"id":":index_pointing_up:","symbol":"☝","group":"people","keywords":["finger","hand","index","index pointing up","point","up"]},{"id":":backhand_index_pointing_up:","symbol":"👆","group":"people","keywords":["backhand","backhand index pointing up","finger","hand","point","up"]},{"id":":middle_finger:","symbol":"🖕","group":"people","keywords":["finger","hand","middle finger"]},{"id":":backhand_index_pointing_down:","symbol":"👇","group":"people","keywords":["backhand","backhand index pointing down","down","finger","hand","point"]},{"id":":victory_hand:","symbol":"✌","group":"people","keywords":["hand","v","victory"]},{"id":":crossed_fingers:","symbol":"🤞","group":"people","keywords":["cross","crossed fingers","finger","hand","luck"]},{"id":":vulcan_salute:","symbol":"🖖","group":"people","keywords":["finger","hand","spock","vulcan","vulcan salute"]},{"id":":sign_of_the_horns:","symbol":"🤘","group":"people","keywords":["finger","hand","horns","rock-on","sign of the horns"]},{"id":":call_me_hand:","symbol":"🤙","group":"people","keywords":["call","call me hand","hand"]},{"id":":hand_with_fingers_splayed:","symbol":"🖐","group":"people","keywords":["finger","hand","hand with fingers splayed","splayed"]},{"id":":raised_hand:","symbol":"✋","group":"people","keywords":["hand","raised hand"]},{"id":":ok_hand:","symbol":"👌","group":"people","keywords":["hand","OK"]},{"id":":thumbs_up:","symbol":"👍","group":"people","keywords":["+1","hand","thumb","thumbs up","up"]},{"id":":thumbs_down:","symbol":"👎","group":"people","keywords":["-1","down","hand","thumb","thumbs down"]},{"id":":raised_fist:","symbol":"✊","group":"people","keywords":["clenched","fist","hand","punch","raised fist"]},{"id":":oncoming_fist:","symbol":"👊","group":"people","keywords":["clenched","fist","hand","oncoming fist","punch"]},{"id":":left-facing_fist:","symbol":"🤛","group":"people","keywords":["fist","left-facing fist","leftwards"]},{"id":":right-facing_fist:","symbol":"🤜","group":"people","keywords":["fist","right-facing fist","rightwards"]},{"id":":raised_back_of_hand:","symbol":"🤚","group":"people","keywords":["backhand","raised","raised back of hand"]},{"id":":waving_hand:","symbol":"👋","group":"people","keywords":["hand","wave","waving"]},{"id":":love-you_gesture:","symbol":"🤟","group":"people","keywords":["hand","ILY","love-you gesture"]},{"id":":writing_hand:","symbol":"✍","group":"people","keywords":["hand","write","writing hand"]},{"id":":clapping_hands:","symbol":"👏","group":"people","keywords":["clap","clapping hands","hand"]},{"id":":open_hands:","symbol":"👐","group":"people","keywords":["hand","open","open hands"]},{"id":":raising_hands:","symbol":"🙌","group":"people","keywords":["celebration","gesture","hand","hooray","raised","raising hands"]},{"id":":palms_up_together:","symbol":"🤲","group":"people","keywords":["palms up together","prayer",""]},{"id":":folded_hands:","symbol":"🙏","group":"people","keywords":["ask","folded hands","hand","please","pray","thanks"]},{"id":":handshake:","symbol":"🤝","group":"people","keywords":["agreement","hand","handshake","meeting","shake"]},{"id":":nail_polish:","symbol":"💅","group":"people","keywords":["care","cosmetics","manicure","nail","polish"]},{"id":":ear:","symbol":"👂","group":"people","keywords":["body","ear"]},{"id":":nose:","symbol":"👃","group":"people","keywords":["body","nose"]},{"id":":footprints:","symbol":"👣","group":"people","keywords":["clothing","footprint","footprints","print"]},{"id":":eyes:","symbol":"👀","group":"people","keywords":["eye","eyes","face"]},{"id":":eye:","symbol":"👁","group":"people","keywords":["body","eye"]},{"id":":eye_in_speech_bubble:","symbol":"👁️‍🗨️","group":"people","keywords":["eye","eye in speech bubble","speech bubble","witness"]},{"id":":brain:","symbol":"🧠","group":"people","keywords":["brain","intelligent"]},{"id":":tongue:","symbol":"👅","group":"people","keywords":["body","tongue"]},{"id":":mouth:","symbol":"👄","group":"people","keywords":["lips","mouth"]},{"id":":kiss_mark:","symbol":"💋","group":"people","keywords":["kiss","kiss mark","lips"]},{"id":":heart_with_arrow:","symbol":"💘","group":"people","keywords":["arrow","cupid","heart with arrow"]},{"id":":heart_with_ribbon:","symbol":"💝","group":"people","keywords":["heart with ribbon","ribbon","valentine"]},{"id":":sparkling_heart:","symbol":"💖","group":"people","keywords":["excited","sparkle","sparkling heart"]},{"id":":growing_heart:","symbol":"💗","group":"people","keywords":["excited","growing","growing heart","nervous","pulse"]},{"id":":beating_heart:","symbol":"💓","group":"people","keywords":["beating","beating heart","heartbeat","pulsating"]},{"id":":revolving_hearts:","symbol":"💞","group":"people","keywords":["revolving","revolving hearts"]},{"id":":two_hearts:","symbol":"💕","group":"people","keywords":["love","two hearts"]},{"id":":love_letter:","symbol":"💌","group":"people","keywords":["heart","letter","love","mail"]},{"id":":heavy_heart_exclamation:","symbol":"❣","group":"people","keywords":["exclamation","heavy heart exclamation","mark","punctuation"]},{"id":":broken_heart:","symbol":"💔","group":"people","keywords":["break","broken","broken heart"]},{"id":":red_heart:","symbol":"❤","group":"people","keywords":["heart","red heart"]},{"id":":orange_heart:","symbol":"🧡","group":"people","keywords":["orange","orange heart"]},{"id":":yellow_heart:","symbol":"💛","group":"people","keywords":["yellow","yellow heart"]},{"id":":green_heart:","symbol":"💚","group":"people","keywords":["green","green heart"]},{"id":":blue_heart:","symbol":"💙","group":"people","keywords":["blue","blue heart"]},{"id":":purple_heart:","symbol":"💜","group":"people","keywords":["purple","purple heart"]},{"id":":black_heart:","symbol":"🖤","group":"people","keywords":["black","black heart","evil","wicked"]},{"id":":heart_decoration:","symbol":"💟","group":"people","keywords":["heart","heart decoration"]},{"id":":zzz:","symbol":"💤","group":"people","keywords":["comic","sleep","zzz"]},{"id":":anger_symbol:","symbol":"💢","group":"people","keywords":["anger symbol","angry","comic","mad"]},{"id":":bomb:","symbol":"💣","group":"people","keywords":["bomb","comic"]},{"id":":collision:","symbol":"💥","group":"people","keywords":["boom","collision","comic"]},{"id":":sweat_droplets:","symbol":"💦","group":"people","keywords":["comic","splashing","sweat","sweat droplets"]},{"id":":dashing_away:","symbol":"💨","group":"people","keywords":["comic","dash","dashing away","running"]},{"id":":dizzy:","symbol":"💫","group":"people","keywords":["comic","dizzy","star"]},{"id":":speech_balloon:","symbol":"💬","group":"people","keywords":["balloon","bubble","comic","dialog","speech"]},{"id":":left_speech_bubble:","symbol":"🗨","group":"people","keywords":["dialog","left speech bubble","speech"]},{"id":":right_anger_bubble:","symbol":"🗯","group":"people","keywords":["angry","balloon","bubble","mad","right anger bubble"]},{"id":":thought_balloon:","symbol":"💭","group":"people","keywords":["balloon","bubble","comic","thought"]},{"id":":hole:","symbol":"🕳","group":"people","keywords":["hole"]},{"id":":glasses:","symbol":"👓","group":"people","keywords":["clothing","eye","eyeglasses","eyewear","glasses"]},{"id":":sunglasses:","symbol":"🕶","group":"people","keywords":["dark","eye","eyewear","glasses","sunglasses"]},{"id":":necktie:","symbol":"👔","group":"people","keywords":["clothing","necktie","tie"]},{"id":":t-shirt:","symbol":"👕","group":"people","keywords":["clothing","shirt","t-shirt","tshirt"]},{"id":":jeans:","symbol":"👖","group":"people","keywords":["clothing","jeans","pants","trousers"]},{"id":":scarf:","symbol":"🧣","group":"people","keywords":["neck","scarf"]},{"id":":gloves:","symbol":"🧤","group":"people","keywords":["gloves","hand"]},{"id":":coat:","symbol":"🧥","group":"people","keywords":["coat","jacket"]},{"id":":socks:","symbol":"🧦","group":"people","keywords":["socks","stocking"]},{"id":":dress:","symbol":"👗","group":"people","keywords":["clothing","dress"]},{"id":":kimono:","symbol":"👘","group":"people","keywords":["clothing","kimono"]},{"id":":bikini:","symbol":"👙","group":"people","keywords":["bikini","clothing","swim"]},{"id":":woman’s_clothes:","symbol":"👚","group":"people","keywords":["clothing","woman","woman’s clothes"]},{"id":":purse:","symbol":"👛","group":"people","keywords":["clothing","coin","purse"]},{"id":":handbag:","symbol":"👜","group":"people","keywords":["bag","clothing","handbag","purse"]},{"id":":clutch_bag:","symbol":"👝","group":"people","keywords":["bag","clothing","clutch bag","pouch"]},{"id":":shopping_bags:","symbol":"🛍","group":"people","keywords":["bag","hotel","shopping","shopping bags"]},{"id":":backpack:","symbol":"🎒","group":"people","keywords":["backpack","bag","rucksack","satchel","school"]},{"id":":man’s_shoe:","symbol":"👞","group":"people","keywords":["clothing","man","man’s shoe","shoe"]},{"id":":running_shoe:","symbol":"👟","group":"people","keywords":["athletic","clothing","running shoe","shoe","sneaker"]},{"id":":high-heeled_shoe:","symbol":"👠","group":"people","keywords":["clothing","heel","high-heeled shoe","shoe","woman"]},{"id":":woman’s_sandal:","symbol":"👡","group":"people","keywords":["clothing","sandal","shoe","woman","woman’s sandal"]},{"id":":woman’s_boot:","symbol":"👢","group":"people","keywords":["boot","clothing","shoe","woman","woman’s boot"]},{"id":":crown:","symbol":"👑","group":"people","keywords":["clothing","crown","king","queen"]},{"id":":woman’s_hat:","symbol":"👒","group":"people","keywords":["clothing","hat","woman","woman’s hat"]},{"id":":top_hat:","symbol":"🎩","group":"people","keywords":["clothing","hat","top","tophat"]},{"id":":graduation_cap:","symbol":"🎓","group":"people","keywords":["cap","celebration","clothing","graduation","hat"]},{"id":":billed_cap:","symbol":"🧢","group":"people","keywords":["baseball cap","billed cap"]},{"id":":rescue_worker’s_helmet:","symbol":"⛑","group":"people","keywords":["aid","cross","face","hat","helmet","rescue worker’s helmet"]},{"id":":prayer_beads:","symbol":"📿","group":"people","keywords":["beads","clothing","necklace","prayer","religion"]},{"id":":lipstick:","symbol":"💄","group":"people","keywords":["cosmetics","lipstick","makeup"]},{"id":":ring:","symbol":"💍","group":"people","keywords":["diamond","ring"]},{"id":":gem_stone:","symbol":"💎","group":"people","keywords":["diamond","gem","gem stone","jewel"]},{"id":":monkey_face:","symbol":"🐵","group":"nature","keywords":["face","monkey"]},{"id":":monkey:","symbol":"🐒","group":"nature","keywords":["monkey"]},{"id":":gorilla:","symbol":"🦍","group":"nature","keywords":["gorilla"]},{"id":":dog_face:","symbol":"🐶","group":"nature","keywords":["dog","face","pet"]},{"id":":dog:","symbol":"🐕","group":"nature","keywords":["dog","pet"]},{"id":":poodle:","symbol":"🐩","group":"nature","keywords":["dog","poodle"]},{"id":":wolf_face:","symbol":"🐺","group":"nature","keywords":["face","wolf"]},{"id":":fox_face:","symbol":"🦊","group":"nature","keywords":["face","fox"]},{"id":":cat_face:","symbol":"🐱","group":"nature","keywords":["cat","face","pet"]},{"id":":cat:","symbol":"🐈","group":"nature","keywords":["cat","pet"]},{"id":":lion_face:","symbol":"🦁","group":"nature","keywords":["face","Leo","lion","zodiac"]},{"id":":tiger_face:","symbol":"🐯","group":"nature","keywords":["face","tiger"]},{"id":":tiger:","symbol":"🐅","group":"nature","keywords":["tiger"]},{"id":":leopard:","symbol":"🐆","group":"nature","keywords":["leopard"]},{"id":":horse_face:","symbol":"🐴","group":"nature","keywords":["face","horse"]},{"id":":horse:","symbol":"🐎","group":"nature","keywords":["equestrian","horse","racehorse","racing"]},{"id":":unicorn_face:","symbol":"🦄","group":"nature","keywords":["face","unicorn"]},{"id":":zebra:","symbol":"🦓","group":"nature","keywords":["stripe","zebra"]},{"id":":deer:","symbol":"🦌","group":"nature","keywords":["deer"]},{"id":":cow_face:","symbol":"🐮","group":"nature","keywords":["cow","face"]},{"id":":ox:","symbol":"🐂","group":"nature","keywords":["bull","ox","Taurus","zodiac"]},{"id":":water_buffalo:","symbol":"🐃","group":"nature","keywords":["buffalo","water"]},{"id":":cow:","symbol":"🐄","group":"nature","keywords":["cow"]},{"id":":pig_face:","symbol":"🐷","group":"nature","keywords":["face","pig"]},{"id":":pig:","symbol":"🐖","group":"nature","keywords":["pig","sow"]},{"id":":boar:","symbol":"🐗","group":"nature","keywords":["boar","pig"]},{"id":":pig_nose:","symbol":"🐽","group":"nature","keywords":["face","nose","pig"]},{"id":":ram:","symbol":"🐏","group":"nature","keywords":["Aries","male","ram","sheep","zodiac"]},{"id":":ewe:","symbol":"🐑","group":"nature","keywords":["ewe","female","sheep"]},{"id":":goat:","symbol":"🐐","group":"nature","keywords":["Capricorn","goat","zodiac"]},{"id":":camel:","symbol":"🐪","group":"nature","keywords":["camel","dromedary","hump"]},{"id":":two-hump_camel:","symbol":"🐫","group":"nature","keywords":["bactrian","camel","hump","two-hump camel"]},{"id":":giraffe:","symbol":"🦒","group":"nature","keywords":["giraffe","spots"]},{"id":":elephant:","symbol":"🐘","group":"nature","keywords":["elephant"]},{"id":":rhinoceros:","symbol":"🦏","group":"nature","keywords":["rhinoceros"]},{"id":":mouse_face:","symbol":"🐭","group":"nature","keywords":["face","mouse"]},{"id":":mouse:","symbol":"🐁","group":"nature","keywords":["mouse"]},{"id":":rat:","symbol":"🐀","group":"nature","keywords":["rat"]},{"id":":hamster_face:","symbol":"🐹","group":"nature","keywords":["face","hamster","pet"]},{"id":":rabbit_face:","symbol":"🐰","group":"nature","keywords":["bunny","face","pet","rabbit"]},{"id":":rabbit:","symbol":"🐇","group":"nature","keywords":["bunny","pet","rabbit"]},{"id":":chipmunk:","symbol":"🐿","group":"nature","keywords":["chipmunk","squirrel"]},{"id":":hedgehog:","symbol":"🦔","group":"nature","keywords":["hedgehog","spiny"]},{"id":":bat:","symbol":"🦇","group":"nature","keywords":["bat","vampire"]},{"id":":bear_face:","symbol":"🐻","group":"nature","keywords":["bear","face"]},{"id":":koala:","symbol":"🐨","group":"nature","keywords":["bear","koala"]},{"id":":panda_face:","symbol":"🐼","group":"nature","keywords":["face","panda"]},{"id":":paw_prints:","symbol":"🐾","group":"nature","keywords":["feet","paw","paw prints","print"]},{"id":":turkey:","symbol":"🦃","group":"nature","keywords":["bird","turkey"]},{"id":":chicken:","symbol":"🐔","group":"nature","keywords":["bird","chicken"]},{"id":":rooster:","symbol":"🐓","group":"nature","keywords":["bird","rooster"]},{"id":":hatching_chick:","symbol":"🐣","group":"nature","keywords":["baby","bird","chick","hatching"]},{"id":":baby_chick:","symbol":"🐤","group":"nature","keywords":["baby","bird","chick"]},{"id":":front-facing_baby_chick:","symbol":"🐥","group":"nature","keywords":["baby","bird","chick","front-facing baby chick"]},{"id":":bird:","symbol":"🐦","group":"nature","keywords":["bird"]},{"id":":penguin:","symbol":"🐧","group":"nature","keywords":["bird","penguin"]},{"id":":dove:","symbol":"🕊","group":"nature","keywords":["bird","dove","fly","peace"]},{"id":":eagle:","symbol":"🦅","group":"nature","keywords":["bird","eagle"]},{"id":":duck:","symbol":"🦆","group":"nature","keywords":["bird","duck"]},{"id":":owl:","symbol":"🦉","group":"nature","keywords":["bird","owl","wise"]},{"id":":frog_face:","symbol":"🐸","group":"nature","keywords":["face","frog"]},{"id":":crocodile:","symbol":"🐊","group":"nature","keywords":["crocodile"]},{"id":":turtle:","symbol":"🐢","group":"nature","keywords":["terrapin","tortoise","turtle"]},{"id":":lizard:","symbol":"🦎","group":"nature","keywords":["lizard","reptile"]},{"id":":snake:","symbol":"🐍","group":"nature","keywords":["bearer","Ophiuchus","serpent","snake","zodiac"]},{"id":":dragon_face:","symbol":"🐲","group":"nature","keywords":["dragon","face","fairy tale"]},{"id":":dragon:","symbol":"🐉","group":"nature","keywords":["dragon","fairy tale"]},{"id":":sauropod:","symbol":"🦕","group":"nature","keywords":["brachiosaurus","brontosaurus","diplodocus","sauropod"]},{"id":":t-rex:","symbol":"🦖","group":"nature","keywords":["T-Rex","Tyrannosaurus Rex"]},{"id":":spouting_whale:","symbol":"🐳","group":"nature","keywords":["face","spouting","whale"]},{"id":":whale:","symbol":"🐋","group":"nature","keywords":["whale"]},{"id":":dolphin:","symbol":"🐬","group":"nature","keywords":["dolphin","flipper"]},{"id":":fish:","symbol":"🐟","group":"nature","keywords":["fish","Pisces","zodiac"]},{"id":":tropical_fish:","symbol":"🐠","group":"nature","keywords":["fish","tropical"]},{"id":":blowfish:","symbol":"🐡","group":"nature","keywords":["blowfish","fish"]},{"id":":shark:","symbol":"🦈","group":"nature","keywords":["fish","shark"]},{"id":":octopus:","symbol":"🐙","group":"nature","keywords":["octopus"]},{"id":":spiral_shell:","symbol":"🐚","group":"nature","keywords":["shell","spiral"]},{"id":":crab:","symbol":"🦀","group":"nature","keywords":["Cancer","crab","zodiac"]},{"id":":shrimp:","symbol":"🦐","group":"nature","keywords":["food","shellfish","shrimp","small"]},{"id":":squid:","symbol":"🦑","group":"nature","keywords":["food","molusc","squid"]},{"id":":snail:","symbol":"🐌","group":"nature","keywords":["snail"]},{"id":":butterfly:","symbol":"🦋","group":"nature","keywords":["butterfly","insect","pretty"]},{"id":":bug:","symbol":"🐛","group":"nature","keywords":["bug","insect"]},{"id":":ant:","symbol":"🐜","group":"nature","keywords":["ant","insect"]},{"id":":honeybee:","symbol":"🐝","group":"nature","keywords":["bee","honeybee","insect"]},{"id":":lady_beetle:","symbol":"🐞","group":"nature","keywords":["beetle","insect","lady beetle","ladybird","ladybug"]},{"id":":cricket:","symbol":"🦗","group":"nature","keywords":["cricket","grasshopper",""]},{"id":":spider:","symbol":"🕷","group":"nature","keywords":["insect","spider"]},{"id":":spider_web:","symbol":"🕸","group":"nature","keywords":["spider","web"]},{"id":":scorpion:","symbol":"🦂","group":"nature","keywords":["scorpio","Scorpio","scorpion","zodiac"]},{"id":":bouquet:","symbol":"💐","group":"nature","keywords":["bouquet","flower"]},{"id":":cherry_blossom:","symbol":"🌸","group":"nature","keywords":["blossom","cherry","flower"]},{"id":":white_flower:","symbol":"💮","group":"nature","keywords":["flower","white flower"]},{"id":":rosette:","symbol":"🏵","group":"nature","keywords":["plant","rosette"]},{"id":":rose:","symbol":"🌹","group":"nature","keywords":["flower","rose"]},{"id":":wilted_flower:","symbol":"🥀","group":"nature","keywords":["flower","wilted"]},{"id":":hibiscus:","symbol":"🌺","group":"nature","keywords":["flower","hibiscus"]},{"id":":sunflower:","symbol":"🌻","group":"nature","keywords":["flower","sun","sunflower"]},{"id":":blossom:","symbol":"🌼","group":"nature","keywords":["blossom","flower"]},{"id":":tulip:","symbol":"🌷","group":"nature","keywords":["flower","tulip"]},{"id":":seedling:","symbol":"🌱","group":"nature","keywords":["seedling","young"]},{"id":":evergreen_tree:","symbol":"🌲","group":"nature","keywords":["evergreen tree","tree"]},{"id":":deciduous_tree:","symbol":"🌳","group":"nature","keywords":["deciduous","shedding","tree"]},{"id":":palm_tree:","symbol":"🌴","group":"nature","keywords":["palm","tree"]},{"id":":cactus:","symbol":"🌵","group":"nature","keywords":["cactus","plant"]},{"id":":sheaf_of_rice:","symbol":"🌾","group":"nature","keywords":["ear","grain","rice","sheaf of rice"]},{"id":":herb:","symbol":"🌿","group":"nature","keywords":["herb","leaf"]},{"id":":shamrock:","symbol":"☘","group":"nature","keywords":["plant","shamrock"]},{"id":":four_leaf_clover:","symbol":"🍀","group":"nature","keywords":["4","clover","four","four-leaf clover","leaf"]},{"id":":maple_leaf:","symbol":"🍁","group":"nature","keywords":["falling","leaf","maple"]},{"id":":fallen_leaf:","symbol":"🍂","group":"nature","keywords":["fallen leaf","falling","leaf"]},{"id":":leaf_fluttering_in_wind:","symbol":"🍃","group":"nature","keywords":["blow","flutter","leaf","leaf fluttering in wind","wind"]},{"id":":grapes:","symbol":"🍇","group":"food","keywords":["fruit","grape","grapes"]},{"id":":melon:","symbol":"🍈","group":"food","keywords":["fruit","melon"]},{"id":":watermelon:","symbol":"🍉","group":"food","keywords":["fruit","watermelon"]},{"id":":tangerine:","symbol":"🍊","group":"food","keywords":["fruit","orange","tangerine"]},{"id":":lemon:","symbol":"🍋","group":"food","keywords":["citrus","fruit","lemon"]},{"id":":banana:","symbol":"🍌","group":"food","keywords":["banana","fruit"]},{"id":":pineapple:","symbol":"🍍","group":"food","keywords":["fruit","pineapple"]},{"id":":red_apple:","symbol":"🍎","group":"food","keywords":["apple","fruit","red"]},{"id":":green_apple:","symbol":"🍏","group":"food","keywords":["apple","fruit","green"]},{"id":":pear:","symbol":"🍐","group":"food","keywords":["fruit","pear"]},{"id":":peach:","symbol":"🍑","group":"food","keywords":["fruit","peach"]},{"id":":cherries:","symbol":"🍒","group":"food","keywords":["berries","cherries","cherry","fruit","red"]},{"id":":strawberry:","symbol":"🍓","group":"food","keywords":["berry","fruit","strawberry"]},{"id":":kiwi_fruit:","symbol":"🥝","group":"food","keywords":["food","fruit","kiwi"]},{"id":":tomato:","symbol":"🍅","group":"food","keywords":["fruit","tomato","vegetable"]},{"id":":coconut:","symbol":"🥥","group":"food","keywords":["coconut","palm","piña colada"]},{"id":":avocado:","symbol":"🥑","group":"food","keywords":["avocado","food","fruit"]},{"id":":eggplant:","symbol":"🍆","group":"food","keywords":["aubergine","eggplant","vegetable"]},{"id":":potato:","symbol":"🥔","group":"food","keywords":["food","potato","vegetable"]},{"id":":carrot:","symbol":"🥕","group":"food","keywords":["carrot","food","vegetable"]},{"id":":ear_of_corn:","symbol":"🌽","group":"food","keywords":["corn","ear","ear of corn","maize","maze"]},{"id":":hot_pepper:","symbol":"🌶","group":"food","keywords":["hot","pepper"]},{"id":":cucumber:","symbol":"🥒","group":"food","keywords":["cucumber","food","pickle","vegetable"]},{"id":":broccoli:","symbol":"🥦","group":"food","keywords":["broccoli","wild cabbage"]},{"id":":mushroom:","symbol":"🍄","group":"food","keywords":["mushroom","toadstool"]},{"id":":peanuts:","symbol":"🥜","group":"food","keywords":["food","nut","peanut","peanuts","vegetable"]},{"id":":chestnut:","symbol":"🌰","group":"food","keywords":["chestnut","plant"]},{"id":":bread:","symbol":"🍞","group":"food","keywords":["bread","loaf"]},{"id":":croissant:","symbol":"🥐","group":"food","keywords":["bread","crescent roll","croissant","food","french"]},{"id":":baguette_bread:","symbol":"🥖","group":"food","keywords":["baguette","bread","food","french"]},{"id":":pretzel:","symbol":"🥨","group":"food","keywords":["pretzel","twisted",""]},{"id":":pancakes:","symbol":"🥞","group":"food","keywords":["crêpe","food","hotcake","pancake","pancakes"]},{"id":":cheese_wedge:","symbol":"🧀","group":"food","keywords":["cheese","cheese wedge"]},{"id":":meat_on_bone:","symbol":"🍖","group":"food","keywords":["bone","meat","meat on bone"]},{"id":":poultry_leg:","symbol":"🍗","group":"food","keywords":["bone","chicken","drumstick","leg","poultry"]},{"id":":cut_of_meat:","symbol":"🥩","group":"food","keywords":["chop","cut of meat","lambchop","porkchop","steak"]},{"id":":bacon:","symbol":"🥓","group":"food","keywords":["bacon","food","meat"]},{"id":":hamburger:","symbol":"🍔","group":"food","keywords":["burger","hamburger"]},{"id":":french_fries:","symbol":"🍟","group":"food","keywords":["french","fries"]},{"id":":pizza:","symbol":"🍕","group":"food","keywords":["cheese","pizza","slice"]},{"id":":hot_dog:","symbol":"🌭","group":"food","keywords":["frankfurter","hot dog","hotdog","sausage"]},{"id":":sandwich:","symbol":"🥪","group":"food","keywords":["bread","sandwich"]},{"id":":taco:","symbol":"🌮","group":"food","keywords":["mexican","taco"]},{"id":":burrito:","symbol":"🌯","group":"food","keywords":["burrito","mexican","wrap"]},{"id":":stuffed_flatbread:","symbol":"🥙","group":"food","keywords":["falafel","flatbread","food","gyro","kebab","stuffed"]},{"id":":egg:","symbol":"🥚","group":"food","keywords":["egg","food"]},{"id":":cooking:","symbol":"🍳","group":"food","keywords":["cooking","egg","frying","pan"]},{"id":":shallow_pan_of_food:","symbol":"🥘","group":"food","keywords":["casserole","food","paella","pan","shallow","shallow pan of food"]},{"id":":pot_of_food:","symbol":"🍲","group":"food","keywords":["pot","pot of food","stew"]},{"id":":bowl_with_spoon:","symbol":"🥣","group":"food","keywords":["bowl with spoon","breakfast","cereal","congee",""]},{"id":":green_salad:","symbol":"🥗","group":"food","keywords":["food","green","salad"]},{"id":":popcorn:","symbol":"🍿","group":"food","keywords":["popcorn"]},{"id":":canned_food:","symbol":"🥫","group":"food","keywords":["can","canned food"]},{"id":":bento_box:","symbol":"🍱","group":"food","keywords":["bento","box"]},{"id":":rice_cracker:","symbol":"🍘","group":"food","keywords":["cracker","rice"]},{"id":":rice_ball:","symbol":"🍙","group":"food","keywords":["ball","Japanese","rice"]},{"id":":cooked_rice:","symbol":"🍚","group":"food","keywords":["cooked","rice"]},{"id":":curry_rice:","symbol":"🍛","group":"food","keywords":["curry","rice"]},{"id":":steaming_bowl:","symbol":"🍜","group":"food","keywords":["bowl","noodle","ramen","steaming"]},{"id":":spaghetti:","symbol":"🍝","group":"food","keywords":["pasta","spaghetti"]},{"id":":roasted_sweet_potato:","symbol":"🍠","group":"food","keywords":["potato","roasted","sweet"]},{"id":":oden:","symbol":"🍢","group":"food","keywords":["kebab","oden","seafood","skewer","stick"]},{"id":":sushi:","symbol":"🍣","group":"food","keywords":["sushi"]},{"id":":fried_shrimp:","symbol":"🍤","group":"food","keywords":["fried","prawn","shrimp","tempura"]},{"id":":fish_cake_with_swirl:","symbol":"🍥","group":"food","keywords":["cake","fish","fish cake with swirl","pastry","swirl"]},{"id":":dango:","symbol":"🍡","group":"food","keywords":["dango","dessert","Japanese","skewer","stick","sweet"]},{"id":":dumpling:","symbol":"🥟","group":"food","keywords":["dumpling","empanada","gyōza","jiaozi","pierogi","potsticker"]},{"id":":fortune_cookie:","symbol":"🥠","group":"food","keywords":["fortune cookie","prophecy"]},{"id":":takeout_box:","symbol":"🥡","group":"food","keywords":["oyster pail","takeout box"]},{"id":":soft_ice_cream:","symbol":"🍦","group":"food","keywords":["cream","dessert","ice","icecream","soft","sweet"]},{"id":":shaved_ice:","symbol":"🍧","group":"food","keywords":["dessert","ice","shaved","sweet"]},{"id":":ice_cream:","symbol":"🍨","group":"food","keywords":["cream","dessert","ice","sweet"]},{"id":":doughnut:","symbol":"🍩","group":"food","keywords":["dessert","donut","doughnut","sweet"]},{"id":":cookie:","symbol":"🍪","group":"food","keywords":["cookie","dessert","sweet"]},{"id":":birthday_cake:","symbol":"🎂","group":"food","keywords":["birthday","cake","celebration","dessert","pastry","sweet"]},{"id":":shortcake:","symbol":"🍰","group":"food","keywords":["cake","dessert","pastry","shortcake","slice","sweet"]},{"id":":pie:","symbol":"🥧","group":"food","keywords":["filling","pastry","pie",""]},{"id":":chocolate_bar:","symbol":"🍫","group":"food","keywords":["bar","chocolate","dessert","sweet"]},{"id":":candy:","symbol":"🍬","group":"food","keywords":["candy","dessert","sweet"]},{"id":":lollipop:","symbol":"🍭","group":"food","keywords":["candy","dessert","lollipop","sweet"]},{"id":":custard:","symbol":"🍮","group":"food","keywords":["custard","dessert","pudding","sweet"]},{"id":":honey_pot:","symbol":"🍯","group":"food","keywords":["honey","honeypot","pot","sweet"]},{"id":":baby_bottle:","symbol":"🍼","group":"food","keywords":["baby","bottle","drink","milk"]},{"id":":glass_of_milk:","symbol":"🥛","group":"food","keywords":["drink","glass","glass of milk","milk"]},{"id":":hot_beverage:","symbol":"☕","group":"food","keywords":["beverage","coffee","drink","hot","steaming","tea"]},{"id":":teacup_without_handle:","symbol":"🍵","group":"food","keywords":["beverage","cup","drink","tea","teacup","teacup without handle"]},{"id":":sake:","symbol":"🍶","group":"food","keywords":["bar","beverage","bottle","cup","drink","sake"]},{"id":":bottle_with_popping_cork:","symbol":"🍾","group":"food","keywords":["bar","bottle","bottle with popping cork","cork","drink","popping"]},{"id":":wine_glass:","symbol":"🍷","group":"food","keywords":["bar","beverage","drink","glass","wine"]},{"id":":cocktail_glass:","symbol":"🍸","group":"food","keywords":["bar","cocktail","drink","glass"]},{"id":":tropical_drink:","symbol":"🍹","group":"food","keywords":["bar","drink","tropical"]},{"id":":beer_mug:","symbol":"🍺","group":"food","keywords":["bar","beer","drink","mug"]},{"id":":clinking_beer_mugs:","symbol":"🍻","group":"food","keywords":["bar","beer","clink","clinking beer mugs","drink","mug"]},{"id":":clinking_glasses:","symbol":"🥂","group":"food","keywords":["celebrate","clink","clinking glasses","drink","glass"]},{"id":":tumbler_glass:","symbol":"🥃","group":"food","keywords":["glass","liquor","shot","tumbler","whisky"]},{"id":":cup_with_straw:","symbol":"🥤","group":"food","keywords":["cup with straw","juice","soda",""]},{"id":":chopsticks:","symbol":"🥢","group":"food","keywords":["chopsticks","hashi",""]},{"id":":fork_and_knife_with_plate:","symbol":"🍽","group":"food","keywords":["cooking","fork","fork and knife with plate","knife","plate"]},{"id":":fork_and_knife:","symbol":"🍴","group":"food","keywords":["cooking","cutlery","fork","fork and knife","knife"]},{"id":":spoon:","symbol":"🥄","group":"food","keywords":["spoon","tableware"]},{"id":":kitchen_knife:","symbol":"🔪","group":"food","keywords":["cooking","hocho","kitchen knife","knife","tool","weapon"]},{"id":":amphora:","symbol":"🏺","group":"food","keywords":["amphora","Aquarius","cooking","drink","jug","zodiac"]},{"id":":globe_showing_europe-africa:","symbol":"🌍","group":"travel","keywords":["Africa","earth","Europe","globe","globe showing Europe-Africa","world"]},{"id":":globe_showing_americas:","symbol":"🌎","group":"travel","keywords":["Americas","earth","globe","globe showing Americas","world"]},{"id":":globe_showing_asia-australia:","symbol":"🌏","group":"travel","keywords":["Asia","Australia","earth","globe","globe showing Asia-Australia","world"]},{"id":":globe_with_meridians:","symbol":"🌐","group":"travel","keywords":["earth","globe","globe with meridians","meridians","world"]},{"id":":world_map:","symbol":"🗺","group":"travel","keywords":["map","world"]},{"id":":map_of_japan:","symbol":"🗾","group":"travel","keywords":["Japan","map","map of Japan"]},{"id":":snow-capped_mountain:","symbol":"🏔","group":"travel","keywords":["cold","mountain","snow","snow-capped mountain"]},{"id":":mountain:","symbol":"⛰","group":"travel","keywords":["mountain"]},{"id":":volcano:","symbol":"🌋","group":"travel","keywords":["eruption","mountain","volcano"]},{"id":":mount_fuji:","symbol":"🗻","group":"travel","keywords":["fuji","mount fuji","mountain"]},{"id":":camping:","symbol":"🏕","group":"travel","keywords":["camping"]},{"id":":beach_with_umbrella:","symbol":"🏖","group":"travel","keywords":["beach","beach with umbrella","umbrella"]},{"id":":desert:","symbol":"🏜","group":"travel","keywords":["desert"]},{"id":":desert_island:","symbol":"🏝","group":"travel","keywords":["desert","island"]},{"id":":national_park:","symbol":"🏞","group":"travel","keywords":["national park","park"]},{"id":":stadium:","symbol":"🏟","group":"travel","keywords":["stadium"]},{"id":":classical_building:","symbol":"🏛","group":"travel","keywords":["classical","classical building"]},{"id":":building_construction:","symbol":"🏗","group":"travel","keywords":["building construction","construction"]},{"id":":houses:","symbol":"🏘","group":"travel","keywords":["houses"]},{"id":":derelict_house:","symbol":"🏚","group":"travel","keywords":["derelict","house"]},{"id":":house:","symbol":"🏠","group":"travel","keywords":["home","house"]},{"id":":house_with_garden:","symbol":"🏡","group":"travel","keywords":["garden","home","house","house with garden"]},{"id":":office_building:","symbol":"🏢","group":"travel","keywords":["building","office building"]},{"id":":japanese_post_office:","symbol":"🏣","group":"travel","keywords":["Japanese","Japanese post office","post"]},{"id":":post_office:","symbol":"🏤","group":"travel","keywords":["European","post","post office"]},{"id":":hospital:","symbol":"🏥","group":"travel","keywords":["doctor","hospital","medicine"]},{"id":":bank:","symbol":"🏦","group":"travel","keywords":["bank","building"]},{"id":":hotel:","symbol":"🏨","group":"travel","keywords":["building","hotel"]},{"id":":love_hotel:","symbol":"🏩","group":"travel","keywords":["hotel","love"]},{"id":":convenience_store:","symbol":"🏪","group":"travel","keywords":["convenience","store"]},{"id":":school:","symbol":"🏫","group":"travel","keywords":["building","school"]},{"id":":department_store:","symbol":"🏬","group":"travel","keywords":["department","store"]},{"id":":factory:","symbol":"🏭","group":"travel","keywords":["building","factory"]},{"id":":japanese_castle:","symbol":"🏯","group":"travel","keywords":["castle","Japanese"]},{"id":":castle:","symbol":"🏰","group":"travel","keywords":["castle","European"]},{"id":":wedding:","symbol":"💒","group":"travel","keywords":["chapel","romance","wedding"]},{"id":":tokyo_tower:","symbol":"🗼","group":"travel","keywords":["Tokyo","tower"]},{"id":":statue_of_liberty:","symbol":"🗽","group":"travel","keywords":["liberty","statue","Statue of Liberty"]},{"id":":church:","symbol":"⛪","group":"travel","keywords":["Christian","church","cross","religion"]},{"id":":mosque:","symbol":"🕌","group":"travel","keywords":["islam","mosque","Muslim","religion"]},{"id":":synagogue:","symbol":"🕍","group":"travel","keywords":["Jew","Jewish","religion","synagogue","temple"]},{"id":":shinto_shrine:","symbol":"⛩","group":"travel","keywords":["religion","shinto","shrine"]},{"id":":kaaba:","symbol":"🕋","group":"travel","keywords":["islam","kaaba","Muslim","religion"]},{"id":":fountain:","symbol":"⛲","group":"travel","keywords":["fountain"]},{"id":":tent:","symbol":"⛺","group":"travel","keywords":["camping","tent"]},{"id":":foggy:","symbol":"🌁","group":"travel","keywords":["fog","foggy"]},{"id":":night_with_stars:","symbol":"🌃","group":"travel","keywords":["night","night with stars","star"]},{"id":":cityscape:","symbol":"🏙","group":"travel","keywords":["city","cityscape"]},{"id":":sunrise_over_mountains:","symbol":"🌄","group":"travel","keywords":["morning","mountain","sun","sunrise","sunrise over mountains"]},{"id":":sunrise:","symbol":"🌅","group":"travel","keywords":["morning","sun","sunrise"]},{"id":":cityscape_at_dusk:","symbol":"🌆","group":"travel","keywords":["city","cityscape at dusk","dusk","evening","landscape","sunset"]},{"id":":sunset:","symbol":"🌇","group":"travel","keywords":["dusk","sun","sunset"]},{"id":":bridge_at_night:","symbol":"🌉","group":"travel","keywords":["bridge","bridge at night","night"]},{"id":":hot_springs:","symbol":"♨","group":"travel","keywords":["hot","hotsprings","springs","steaming"]},{"id":":milky_way:","symbol":"🌌","group":"travel","keywords":["milky way","space"]},{"id":":carousel_horse:","symbol":"🎠","group":"travel","keywords":["carousel","horse"]},{"id":":ferris_wheel:","symbol":"🎡","group":"travel","keywords":["amusement park","ferris","wheel"]},{"id":":roller_coaster:","symbol":"🎢","group":"travel","keywords":["amusement park","coaster","roller"]},{"id":":barber_pole:","symbol":"💈","group":"travel","keywords":["barber","haircut","pole"]},{"id":":circus_tent:","symbol":"🎪","group":"travel","keywords":["circus","tent"]},{"id":":locomotive:","symbol":"🚂","group":"travel","keywords":["engine","locomotive","railway","steam","train"]},{"id":":railway_car:","symbol":"🚃","group":"travel","keywords":["car","electric","railway","train","tram","trolleybus"]},{"id":":high-speed_train:","symbol":"🚄","group":"travel","keywords":["high-speed train","railway","shinkansen","speed","train"]},{"id":":bullet_train:","symbol":"🚅","group":"travel","keywords":["bullet","railway","shinkansen","speed","train"]},{"id":":train:","symbol":"🚆","group":"travel","keywords":["railway","train"]},{"id":":metro:","symbol":"🚇","group":"travel","keywords":["metro","subway"]},{"id":":light_rail:","symbol":"🚈","group":"travel","keywords":["light rail","railway"]},{"id":":station:","symbol":"🚉","group":"travel","keywords":["railway","station","train"]},{"id":":tram:","symbol":"🚊","group":"travel","keywords":["tram","trolleybus"]},{"id":":monorail:","symbol":"🚝","group":"travel","keywords":["monorail","vehicle"]},{"id":":mountain_railway:","symbol":"🚞","group":"travel","keywords":["car","mountain","railway"]},{"id":":tram_car:","symbol":"🚋","group":"travel","keywords":["car","tram","trolleybus"]},{"id":":bus:","symbol":"🚌","group":"travel","keywords":["bus","vehicle"]},{"id":":oncoming_bus:","symbol":"🚍","group":"travel","keywords":["bus","oncoming"]},{"id":":trolleybus:","symbol":"🚎","group":"travel","keywords":["bus","tram","trolley","trolleybus"]},{"id":":minibus:","symbol":"🚐","group":"travel","keywords":["bus","minibus"]},{"id":":ambulance:","symbol":"🚑","group":"travel","keywords":["ambulance","vehicle"]},{"id":":fire_engine:","symbol":"🚒","group":"travel","keywords":["engine","fire","truck"]},{"id":":police_car:","symbol":"🚓","group":"travel","keywords":["car","patrol","police"]},{"id":":oncoming_police_car:","symbol":"🚔","group":"travel","keywords":["car","oncoming","police"]},{"id":":taxi:","symbol":"🚕","group":"travel","keywords":["taxi","vehicle"]},{"id":":oncoming_taxi:","symbol":"🚖","group":"travel","keywords":["oncoming","taxi"]},{"id":":automobile:","symbol":"🚗","group":"travel","keywords":["automobile","car"]},{"id":":oncoming_automobile:","symbol":"🚘","group":"travel","keywords":["automobile","car","oncoming"]},{"id":":sport_utility_vehicle:","symbol":"🚙","group":"travel","keywords":["recreational","sport utility","sport utility vehicle"]},{"id":":delivery_truck:","symbol":"🚚","group":"travel","keywords":["delivery","truck"]},{"id":":articulated_lorry:","symbol":"🚛","group":"travel","keywords":["articulated lorry","lorry","semi","truck"]},{"id":":tractor:","symbol":"🚜","group":"travel","keywords":["tractor","vehicle"]},{"id":":bicycle:","symbol":"🚲","group":"travel","keywords":["bicycle","bike"]},{"id":":kick_scooter:","symbol":"🛴","group":"travel","keywords":["kick","scooter"]},{"id":":motor_scooter:","symbol":"🛵","group":"travel","keywords":["motor","scooter"]},{"id":":bus_stop:","symbol":"🚏","group":"travel","keywords":["bus","busstop","stop"]},{"id":":motorway:","symbol":"🛣","group":"travel","keywords":["highway","motorway","road"]},{"id":":railway_track:","symbol":"🛤","group":"travel","keywords":["railway","railway track","train"]},{"id":":oil_drum:","symbol":"🛢","group":"travel","keywords":["drum","oil"]},{"id":":fuel_pump:","symbol":"⛽","group":"travel","keywords":["diesel","fuel","fuelpump","gas","pump","station"]},{"id":":police_car_light:","symbol":"🚨","group":"travel","keywords":["beacon","car","light","police","revolving"]},{"id":":horizontal_traffic_light:","symbol":"🚥","group":"travel","keywords":["horizontal traffic light","light","signal","traffic"]},{"id":":vertical_traffic_light:","symbol":"🚦","group":"travel","keywords":["light","signal","traffic","vertical traffic light"]},{"id":":stop_sign:","symbol":"🛑","group":"travel","keywords":["octagonal","sign","stop"]},{"id":":construction:","symbol":"🚧","group":"travel","keywords":["barrier","construction"]},{"id":":anchor:","symbol":"⚓","group":"travel","keywords":["anchor","ship","tool"]},{"id":":sailboat:","symbol":"⛵","group":"travel","keywords":["boat","resort","sailboat","sea","yacht"]},{"id":":canoe:","symbol":"🛶","group":"travel","keywords":["boat","canoe"]},{"id":":speedboat:","symbol":"🚤","group":"travel","keywords":["boat","speedboat"]},{"id":":passenger_ship:","symbol":"🛳","group":"travel","keywords":["passenger","ship"]},{"id":":ferry:","symbol":"⛴","group":"travel","keywords":["boat","ferry","passenger"]},{"id":":motor_boat:","symbol":"🛥","group":"travel","keywords":["boat","motor boat","motorboat"]},{"id":":ship:","symbol":"🚢","group":"travel","keywords":["boat","passenger","ship"]},{"id":":airplane:","symbol":"✈","group":"travel","keywords":["aeroplane","airplane"]},{"id":":small_airplane:","symbol":"🛩","group":"travel","keywords":["aeroplane","airplane","small airplane"]},{"id":":airplane_departure:","symbol":"🛫","group":"travel","keywords":["aeroplane","airplane","check-in","departure","departures"]},{"id":":airplane_arrival:","symbol":"🛬","group":"travel","keywords":["aeroplane","airplane","airplane arrival","arrivals","arriving","landing"]},{"id":":seat:","symbol":"💺","group":"travel","keywords":["chair","seat"]},{"id":":helicopter:","symbol":"🚁","group":"travel","keywords":["helicopter","vehicle"]},{"id":":suspension_railway:","symbol":"🚟","group":"travel","keywords":["railway","suspension"]},{"id":":mountain_cableway:","symbol":"🚠","group":"travel","keywords":["cable","gondola","mountain","mountain cableway"]},{"id":":aerial_tramway:","symbol":"🚡","group":"travel","keywords":["aerial","cable","car","gondola","tramway"]},{"id":":satellite:","symbol":"🛰","group":"travel","keywords":["satellite","space"]},{"id":":rocket:","symbol":"🚀","group":"travel","keywords":["rocket","space"]},{"id":":flying_saucer:","symbol":"🛸","group":"travel","keywords":["flying saucer","UFO"]},{"id":":bellhop_bell:","symbol":"🛎","group":"travel","keywords":["bell","bellhop","hotel"]},{"id":":hourglass_done:","symbol":"⌛","group":"travel","keywords":["hourglass done","sand","timer"]},{"id":":hourglass_not_done:","symbol":"⏳","group":"travel","keywords":["hourglass","hourglass not done","sand","timer"]},{"id":":watch:","symbol":"⌚","group":"travel","keywords":["clock","watch"]},{"id":":alarm_clock:","symbol":"⏰","group":"travel","keywords":["alarm","clock"]},{"id":":stopwatch:","symbol":"⏱","group":"travel","keywords":["clock","stopwatch"]},{"id":":timer_clock:","symbol":"⏲","group":"travel","keywords":["clock","timer"]},{"id":":mantelpiece_clock:","symbol":"🕰","group":"travel","keywords":["clock","mantelpiece clock"]},{"id":":twelve_o’clock:","symbol":"🕛","group":"travel","keywords":["00","12","12:00","clock","o’clock","twelve"]},{"id":":twelve-thirty:","symbol":"🕧","group":"travel","keywords":["12","12:30","clock","thirty","twelve","twelve-thirty"]},{"id":":one_o’clock:","symbol":"🕐","group":"travel","keywords":["00","1","1:00","clock","o’clock","one"]},{"id":":one-thirty:","symbol":"🕜","group":"travel","keywords":["1","1:30","clock","one","one-thirty","thirty"]},{"id":":two_o’clock:","symbol":"🕑","group":"travel","keywords":["00","2","2:00","clock","o’clock","two"]},{"id":":two-thirty:","symbol":"🕝","group":"travel","keywords":["2","2:30","clock","thirty","two","two-thirty"]},{"id":":three_o’clock:","symbol":"🕒","group":"travel","keywords":["00","3","3:00","clock","o’clock","three"]},{"id":":three-thirty:","symbol":"🕞","group":"travel","keywords":["3","3:30","clock","thirty","three","three-thirty"]},{"id":":four_o’clock:","symbol":"🕓","group":"travel","keywords":["00","4","4:00","clock","four","o’clock"]},{"id":":four-thirty:","symbol":"🕟","group":"travel","keywords":["4","4:30","clock","four","four-thirty","thirty"]},{"id":":five_o’clock:","symbol":"🕔","group":"travel","keywords":["00","5","5:00","clock","five","o’clock"]},{"id":":five-thirty:","symbol":"🕠","group":"travel","keywords":["5","5:30","clock","five","five-thirty","thirty"]},{"id":":six_o’clock:","symbol":"🕕","group":"travel","keywords":["00","6","6:00","clock","o’clock","six"]},{"id":":six-thirty:","symbol":"🕡","group":"travel","keywords":["6","6:30","clock","six","six-thirty","thirty"]},{"id":":seven_o’clock:","symbol":"🕖","group":"travel","keywords":["00","7","7:00","clock","o’clock","seven"]},{"id":":seven-thirty:","symbol":"🕢","group":"travel","keywords":["7","7:30","clock","seven","seven-thirty","thirty"]},{"id":":eight_o’clock:","symbol":"🕗","group":"travel","keywords":["00","8","8:00","clock","eight","o’clock"]},{"id":":eight-thirty:","symbol":"🕣","group":"travel","keywords":["8","8:30","clock","eight","eight-thirty","thirty"]},{"id":":nine_o’clock:","symbol":"🕘","group":"travel","keywords":["00","9","9:00","clock","nine","o’clock"]},{"id":":nine-thirty:","symbol":"🕤","group":"travel","keywords":["9","9:30","clock","nine","nine-thirty","thirty"]},{"id":":ten_o’clock:","symbol":"🕙","group":"travel","keywords":["00","10","10:00","clock","o’clock","ten"]},{"id":":ten-thirty:","symbol":"🕥","group":"travel","keywords":["10","10:30","clock","ten","ten-thirty","thirty"]},{"id":":eleven_o’clock:","symbol":"🕚","group":"travel","keywords":["00","11","11:00","clock","eleven","o’clock"]},{"id":":eleven-thirty:","symbol":"🕦","group":"travel","keywords":["11","11:30","clock","eleven","eleven-thirty","thirty"]},{"id":":new_moon:","symbol":"🌑","group":"travel","keywords":["dark","moon","new moon"]},{"id":":waxing_crescent_moon:","symbol":"🌒","group":"travel","keywords":["crescent","moon","waxing"]},{"id":":first_quarter_moon:","symbol":"🌓","group":"travel","keywords":["first quarter moon","moon","quarter"]},{"id":":waxing_gibbous_moon:","symbol":"🌔","group":"travel","keywords":["gibbous","moon","waxing"]},{"id":":full_moon:","symbol":"🌕","group":"travel","keywords":["full","moon"]},{"id":":waning_gibbous_moon:","symbol":"🌖","group":"travel","keywords":["gibbous","moon","waning"]},{"id":":last_quarter_moon:","symbol":"🌗","group":"travel","keywords":["last quarter moon","moon","quarter"]},{"id":":waning_crescent_moon:","symbol":"🌘","group":"travel","keywords":["crescent","moon","waning"]},{"id":":crescent_moon:","symbol":"🌙","group":"travel","keywords":["crescent","moon"]},{"id":":new_moon_face:","symbol":"🌚","group":"travel","keywords":["face","moon","new moon face"]},{"id":":first_quarter_moon_face:","symbol":"🌛","group":"travel","keywords":["face","first quarter moon face","moon","quarter"]},{"id":":last_quarter_moon_face:","symbol":"🌜","group":"travel","keywords":["face","last quarter moon face","moon","quarter"]},{"id":":thermometer:","symbol":"🌡","group":"travel","keywords":["thermometer","weather"]},{"id":":sun:","symbol":"☀","group":"travel","keywords":["bright","rays","sun","sunny"]},{"id":":full_moon_face:","symbol":"🌝","group":"travel","keywords":["bright","face","full","moon"]},{"id":":sun_with_face:","symbol":"🌞","group":"travel","keywords":["bright","face","sun","sun with face"]},{"id":":star:","symbol":"⭐","group":"travel","keywords":["star"]},{"id":":glowing_star:","symbol":"🌟","group":"travel","keywords":["glittery","glow","glowing star","shining","sparkle","star"]},{"id":":shooting_star:","symbol":"🌠","group":"travel","keywords":["falling","shooting","star"]},{"id":":cloud:","symbol":"☁️","group":"travel","keywords":["cloud","weather"]},{"id":":sun_behind_cloud:","symbol":"⛅","group":"travel","keywords":["cloud","sun","sun behind cloud"]},{"id":":cloud_with_lightning_and_rain:","symbol":"⛈️","group":"travel","keywords":["cloud","cloud with lightning and rain","rain","thunder"]},{"id":":sun_behind_small_cloud:","symbol":"🌤","group":"travel","keywords":["cloud","sun","sun behind small cloud"]},{"id":":sun_behind_large_cloud:","symbol":"🌥","group":"travel","keywords":["cloud","sun","sun behind large cloud"]},{"id":":sun_behind_rain_cloud:","symbol":"🌦","group":"travel","keywords":["cloud","rain","sun","sun behind rain cloud"]},{"id":":cloud_with_rain:","symbol":"🌧","group":"travel","keywords":["cloud","cloud with rain","rain"]},{"id":":cloud_with_snow:","symbol":"🌨","group":"travel","keywords":["cloud","cloud with snow","cold","snow"]},{"id":":cloud_with_lightning:","symbol":"🌩","group":"travel","keywords":["cloud","cloud with lightning","lightning"]},{"id":":tornado:","symbol":"🌪","group":"travel","keywords":["cloud","tornado","whirlwind"]},{"id":":fog:","symbol":"🌫","group":"travel","keywords":["cloud","fog"]},{"id":":wind_face:","symbol":"🌬","group":"travel","keywords":["blow","cloud","face","wind"]},{"id":":cyclone:","symbol":"🌀","group":"travel","keywords":["cyclone","dizzy","hurricane","twister","typhoon"]},{"id":":rainbow:","symbol":"🌈","group":"travel","keywords":["rain","rainbow"]},{"id":":closed_umbrella:","symbol":"🌂","group":"travel","keywords":["closed umbrella","clothing","rain","umbrella"]},{"id":":umbrella:","symbol":"☂","group":"travel","keywords":["clothing","rain","umbrella"]},{"id":":umbrella_with_rain_drops:","symbol":"☔","group":"travel","keywords":["clothing","drop","rain","umbrella","umbrella with rain drops"]},{"id":":umbrella_on_ground:","symbol":"⛱","group":"travel","keywords":["rain","sun","umbrella","umbrella on ground"]},{"id":":high_voltage:","symbol":"⚡","group":"travel","keywords":["danger","electric","high voltage","lightning","voltage","zap"]},{"id":":snowflake:","symbol":"❄","group":"travel","keywords":["cold","snow","snowflake"]},{"id":":snowman:","symbol":"☃","group":"travel","keywords":["cold","snow","snowman"]},{"id":":snowman_without_snow:","symbol":"⛄","group":"travel","keywords":["cold","snow","snowman","snowman without snow"]},{"id":":comet:","symbol":"☄","group":"travel","keywords":["comet","space"]},{"id":":fire:","symbol":"🔥","group":"travel","keywords":["fire","flame","tool"]},{"id":":droplet:","symbol":"💧","group":"travel","keywords":["cold","comic","drop","droplet","sweat"]},{"id":":water_wave:","symbol":"🌊","group":"travel","keywords":["ocean","water","wave"]},{"id":":jack-o-lantern:","symbol":"🎃","group":"activities","keywords":["celebration","halloween","jack","jack-o-lantern","lantern"]},{"id":":christmas_tree:","symbol":"🎄","group":"activities","keywords":["celebration","Christmas","tree"]},{"id":":fireworks:","symbol":"🎆","group":"activities","keywords":["celebration","fireworks"]},{"id":":sparkler:","symbol":"🎇","group":"activities","keywords":["celebration","fireworks","sparkle","sparkler"]},{"id":":sparkles:","symbol":"✨","group":"activities","keywords":["sparkle","sparkles","star"]},{"id":":balloon:","symbol":"🎈","group":"activities","keywords":["balloon","celebration"]},{"id":":party_popper:","symbol":"🎉","group":"activities","keywords":["celebration","party","popper","tada"]},{"id":":confetti_ball:","symbol":"🎊","group":"activities","keywords":["ball","celebration","confetti"]},{"id":":tanabata_tree:","symbol":"🎋","group":"activities","keywords":["banner","celebration","Japanese","tanabata tree","tree"]},{"id":":pine_decoration:","symbol":"🎍","group":"activities","keywords":["bamboo","celebration","Japanese","pine","pine decoration"]},{"id":":japanese_dolls:","symbol":"🎎","group":"activities","keywords":["celebration","doll","festival","Japanese","Japanese dolls"]},{"id":":carp_streamer:","symbol":"🎏","group":"activities","keywords":["carp","celebration","streamer"]},{"id":":wind_chime:","symbol":"🎐","group":"activities","keywords":["bell","celebration","chime","wind"]},{"id":":moon_viewing_ceremony:","symbol":"🎑","group":"activities","keywords":["celebration","ceremony","moon","moon viewing ceremony"]},{"id":":ribbon:","symbol":"🎀","group":"activities","keywords":["celebration","ribbon"]},{"id":":wrapped_gift:","symbol":"🎁","group":"activities","keywords":["box","celebration","gift","present","wrapped"]},{"id":":reminder_ribbon:","symbol":"🎗","group":"activities","keywords":["celebration","reminder","ribbon"]},{"id":":admission_tickets:","symbol":"🎟","group":"activities","keywords":["admission","admission tickets","ticket"]},{"id":":ticket:","symbol":"🎫","group":"activities","keywords":["admission","ticket"]},{"id":":military_medal:","symbol":"🎖","group":"activities","keywords":["celebration","medal","military"]},{"id":":trophy:","symbol":"🏆","group":"activities","keywords":["prize","trophy"]},{"id":":sports_medal:","symbol":"🏅","group":"activities","keywords":["medal","sports medal"]},{"id":":1st_place_medal:","symbol":"🥇","group":"activities","keywords":["1st place medal","first","gold","medal"]},{"id":":2nd_place_medal:","symbol":"🥈","group":"activities","keywords":["2nd place medal","medal","second","silver"]},{"id":":3rd_place_medal:","symbol":"🥉","group":"activities","keywords":["3rd place medal","bronze","medal","third"]},{"id":":soccer_ball:","symbol":"⚽","group":"activities","keywords":["ball","football","soccer"]},{"id":":baseball:","symbol":"⚾","group":"activities","keywords":["ball","baseball"]},{"id":":basketball:","symbol":"🏀","group":"activities","keywords":["ball","basketball","hoop"]},{"id":":volleyball:","symbol":"🏐","group":"activities","keywords":["ball","game","volleyball"]},{"id":":american_football:","symbol":"🏈","group":"activities","keywords":["american","ball","football"]},{"id":":rugby_football:","symbol":"🏉","group":"activities","keywords":["ball","football","rugby"]},{"id":":tennis:","symbol":"🎾","group":"activities","keywords":["ball","racquet","tennis"]},{"id":":bowling:","symbol":"🎳","group":"activities","keywords":["ball","bowling","game"]},{"id":":cricket_game:","symbol":"🏏","group":"activities","keywords":["ball","bat","cricket game","game"]},{"id":":field_hockey:","symbol":"🏑","group":"activities","keywords":["ball","field","game","hockey","stick"]},{"id":":ice_hockey:","symbol":"🏒","group":"activities","keywords":["game","hockey","ice","puck","stick"]},{"id":":ping_pong:","symbol":"🏓","group":"activities","keywords":["ball","bat","game","paddle","ping pong","table tennis"]},{"id":":badminton:","symbol":"🏸","group":"activities","keywords":["badminton","birdie","game","racquet","shuttlecock"]},{"id":":boxing_glove:","symbol":"🥊","group":"activities","keywords":["boxing","glove"]},{"id":":martial_arts_uniform:","symbol":"🥋","group":"activities","keywords":["judo","karate","martial arts","martial arts uniform","taekwondo","uniform"]},{"id":":goal_net:","symbol":"🥅","group":"activities","keywords":["goal","net"]},{"id":":flag_in_hole:","symbol":"⛳","group":"activities","keywords":["flag in hole","golf","hole"]},{"id":":ice_skate:","symbol":"⛸","group":"activities","keywords":["ice","skate"]},{"id":":fishing_pole:","symbol":"🎣","group":"activities","keywords":["fish","fishing pole","pole"]},{"id":":running_shirt:","symbol":"🎽","group":"activities","keywords":["athletics","running","sash","shirt"]},{"id":":skis:","symbol":"🎿","group":"activities","keywords":["ski","skis","snow"]},{"id":":sled:","symbol":"🛷","group":"activities","keywords":["sled","sledge","sleigh",""]},{"id":":curling_stone:","symbol":"🥌","group":"activities","keywords":["curling stone","game","rock"]},{"id":":direct_hit:","symbol":"🎯","group":"activities","keywords":["bullseye","dart","direct hit","game","hit","target"]},{"id":":pool_8_ball:","symbol":"🎱","group":"activities","keywords":["8","ball","billiard","eight","game","pool 8 ball"]},{"id":":crystal_ball:","symbol":"🔮","group":"activities","keywords":["ball","crystal","fairy tale","fantasy","fortune","tool"]},{"id":":video_game:","symbol":"🎮","group":"activities","keywords":["controller","game","video game"]},{"id":":joystick:","symbol":"🕹","group":"activities","keywords":["game","joystick","video game"]},{"id":":slot_machine:","symbol":"🎰","group":"activities","keywords":["game","slot","slot machine"]},{"id":":game_die:","symbol":"🎲","group":"activities","keywords":["dice","die","game"]},{"id":":spade_suit:","symbol":"♠","group":"activities","keywords":["card","game","spade suit"]},{"id":":heart_suit:","symbol":"♥","group":"activities","keywords":["card","game","heart suit"]},{"id":":diamond_suit:","symbol":"♦","group":"activities","keywords":["card","diamond suit","game"]},{"id":":club_suit:","symbol":"♣","group":"activities","keywords":["card","club suit","game"]},{"id":":joker:","symbol":"🃏","group":"activities","keywords":["card","game","joker","wildcard"]},{"id":":mahjong_red_dragon:","symbol":"🀄","group":"activities","keywords":["game","mahjong","mahjong red dragon","red"]},{"id":":flower_playing_cards:","symbol":"🎴","group":"activities","keywords":["card","flower","flower playing cards","game","Japanese","playing"]},{"id":":performing_arts:","symbol":"🎭","group":"activities","keywords":["art","mask","performing","performing arts","theater","theatre"]},{"id":":framed_picture:","symbol":"🖼","group":"activities","keywords":["art","frame","framed picture","museum","painting","picture"]},{"id":":artist_palette:","symbol":"🎨","group":"activities","keywords":["art","artist palette","museum","painting","palette"]},{"id":":muted_speaker:","symbol":"🔇","group":"objects","keywords":["mute","muted speaker","quiet","silent","speaker"]},{"id":":speaker_low_volume:","symbol":"🔈","group":"objects","keywords":["soft","speaker low volume"]},{"id":":speaker_medium_volume:","symbol":"🔉","group":"objects","keywords":["medium","speaker medium volume"]},{"id":":speaker_high_volume:","symbol":"🔊","group":"objects","keywords":["loud","speaker high volume"]},{"id":":loudspeaker:","symbol":"📢","group":"objects","keywords":["loud","loudspeaker","public address"]},{"id":":megaphone:","symbol":"📣","group":"objects","keywords":["cheering","megaphone"]},{"id":":postal_horn:","symbol":"📯","group":"objects","keywords":["horn","post","postal"]},{"id":":bell:","symbol":"🔔","group":"objects","keywords":["bell"]},{"id":":bell_with_slash:","symbol":"🔕","group":"objects","keywords":["bell","bell with slash","forbidden","mute","quiet","silent"]},{"id":":musical_score:","symbol":"🎼","group":"objects","keywords":["music","musical score","score"]},{"id":":musical_note:","symbol":"🎵","group":"objects","keywords":["music","musical note","note"]},{"id":":musical_notes:","symbol":"🎶","group":"objects","keywords":["music","musical notes","note","notes"]},{"id":":studio_microphone:","symbol":"🎙","group":"objects","keywords":["mic","microphone","music","studio"]},{"id":":level_slider:","symbol":"🎚","group":"objects","keywords":["level","music","slider"]},{"id":":control_knobs:","symbol":"🎛","group":"objects","keywords":["control","knobs","music"]},{"id":":microphone:","symbol":"🎤","group":"objects","keywords":["karaoke","mic","microphone"]},{"id":":headphone:","symbol":"🎧","group":"objects","keywords":["earbud","headphone"]},{"id":":radio:","symbol":"📻","group":"objects","keywords":["radio","video"]},{"id":":saxophone:","symbol":"🎷","group":"objects","keywords":["instrument","music","sax","saxophone"]},{"id":":guitar:","symbol":"🎸","group":"objects","keywords":["guitar","instrument","music"]},{"id":":musical_keyboard:","symbol":"🎹","group":"objects","keywords":["instrument","keyboard","music","musical keyboard","piano"]},{"id":":trumpet:","symbol":"🎺","group":"objects","keywords":["instrument","music","trumpet"]},{"id":":violin:","symbol":"🎻","group":"objects","keywords":["instrument","music","violin"]},{"id":":drum:","symbol":"🥁","group":"objects","keywords":["drum","drumsticks","music"]},{"id":":mobile_phone:","symbol":"📱","group":"objects","keywords":["cell","mobile","phone","telephone"]},{"id":":mobile_phone_with_arrow:","symbol":"📲","group":"objects","keywords":["arrow","cell","mobile","mobile phone with arrow","phone","receive"]},{"id":":telephone:","symbol":"☎","group":"objects","keywords":["phone","telephone"]},{"id":":telephone_receiver:","symbol":"📞","group":"objects","keywords":["phone","receiver","telephone"]},{"id":":pager:","symbol":"📟","group":"objects","keywords":["pager"]},{"id":":fax_machine:","symbol":"📠","group":"objects","keywords":["fax","fax machine"]},{"id":":battery:","symbol":"🔋","group":"objects","keywords":["battery"]},{"id":":electric_plug:","symbol":"🔌","group":"objects","keywords":["electric","electricity","plug"]},{"id":":laptop_computer:","symbol":"💻","group":"objects","keywords":["computer","laptop computer","pc","personal"]},{"id":":desktop_computer:","symbol":"🖥","group":"objects","keywords":["computer","desktop"]},{"id":":printer:","symbol":"🖨","group":"objects","keywords":["computer","printer"]},{"id":":keyboard:","symbol":"⌨","group":"objects","keywords":["computer","keyboard"]},{"id":":computer_mouse:","symbol":"🖱","group":"objects","keywords":["computer","computer mouse"]},{"id":":trackball:","symbol":"🖲","group":"objects","keywords":["computer","trackball"]},{"id":":computer_disk:","symbol":"💽","group":"objects","keywords":["computer","disk","minidisk","optical"]},{"id":":floppy_disk:","symbol":"💾","group":"objects","keywords":["computer","disk","floppy"]},{"id":":optical_disk:","symbol":"💿","group":"objects","keywords":["cd","computer","disk","optical"]},{"id":":dvd:","symbol":"📀","group":"objects","keywords":["blu-ray","computer","disk","dvd","optical"]},{"id":":movie_camera:","symbol":"🎥","group":"objects","keywords":["camera","cinema","movie"]},{"id":":film_frames:","symbol":"🎞","group":"objects","keywords":["cinema","film","frames","movie"]},{"id":":film_projector:","symbol":"📽","group":"objects","keywords":["cinema","film","movie","projector","video"]},{"id":":clapper_board:","symbol":"🎬","group":"objects","keywords":["clapper","clapper board","movie"]},{"id":":television:","symbol":"📺","group":"objects","keywords":["television","tv","video"]},{"id":":camera:","symbol":"📷","group":"objects","keywords":["camera","video"]},{"id":":camera_with_flash:","symbol":"📸","group":"objects","keywords":["camera","camera with flash","flash","video"]},{"id":":video_camera:","symbol":"📹","group":"objects","keywords":["camera","video"]},{"id":":videocassette:","symbol":"📼","group":"objects","keywords":["tape","vhs","video","videocassette"]},{"id":":magnifying_glass_tilted_left:","symbol":"🔍","group":"objects","keywords":["glass","magnifying","magnifying glass tilted left","search","tool"]},{"id":":magnifying_glass_tilted_right:","symbol":"🔎","group":"objects","keywords":["glass","magnifying","magnifying glass tilted right","search","tool"]},{"id":":candle:","symbol":"🕯","group":"objects","keywords":["candle","light"]},{"id":":light_bulb:","symbol":"💡","group":"objects","keywords":["bulb","comic","electric","idea","light"]},{"id":":flashlight:","symbol":"🔦","group":"objects","keywords":["electric","flashlight","light","tool","torch"]},{"id":":red_paper_lantern:","symbol":"🏮","group":"objects","keywords":["bar","lantern","light","red","red paper lantern"]},{"id":":notebook_with_decorative_cover:","symbol":"📔","group":"objects","keywords":["book","cover","decorated","notebook","notebook with decorative cover"]},{"id":":closed_book:","symbol":"📕","group":"objects","keywords":["book","closed"]},{"id":":open_book:","symbol":"📖","group":"objects","keywords":["book","open"]},{"id":":green_book:","symbol":"📗","group":"objects","keywords":["book","green"]},{"id":":blue_book:","symbol":"📘","group":"objects","keywords":["blue","book"]},{"id":":orange_book:","symbol":"📙","group":"objects","keywords":["book","orange"]},{"id":":books:","symbol":"📚","group":"objects","keywords":["book","books"]},{"id":":notebook:","symbol":"📓","group":"objects","keywords":["notebook"]},{"id":":ledger:","symbol":"📒","group":"objects","keywords":["ledger","notebook"]},{"id":":page_with_curl:","symbol":"📃","group":"objects","keywords":["curl","document","page","page with curl"]},{"id":":scroll:","symbol":"📜","group":"objects","keywords":["paper","scroll"]},{"id":":page_facing_up:","symbol":"📄","group":"objects","keywords":["document","page","page facing up"]},{"id":":newspaper:","symbol":"📰","group":"objects","keywords":["news","newspaper","paper"]},{"id":":rolled-up_newspaper:","symbol":"🗞","group":"objects","keywords":["news","newspaper","paper","rolled","rolled-up newspaper"]},{"id":":bookmark_tabs:","symbol":"📑","group":"objects","keywords":["bookmark","mark","marker","tabs"]},{"id":":bookmark:","symbol":"🔖","group":"objects","keywords":["bookmark","mark"]},{"id":":label:","symbol":"🏷","group":"objects","keywords":["label"]},{"id":":money_bag:","symbol":"💰","group":"objects","keywords":["bag","dollar","money","moneybag"]},{"id":":yen_banknote:","symbol":"💴","group":"objects","keywords":["banknote","bill","currency","money","note","yen"]},{"id":":dollar_banknote:","symbol":"💵","group":"objects","keywords":["banknote","bill","currency","dollar","money","note"]},{"id":":euro_banknote:","symbol":"💶","group":"objects","keywords":["banknote","bill","currency","euro","money","note"]},{"id":":pound_banknote:","symbol":"💷","group":"objects","keywords":["banknote","bill","currency","money","note","pound"]},{"id":":money_with_wings:","symbol":"💸","group":"objects","keywords":["banknote","bill","fly","money","money with wings","wings"]},{"id":":credit_card:","symbol":"💳","group":"objects","keywords":["card","credit","money"]},{"id":":chart_increasing_with_yen:","symbol":"💹","group":"objects","keywords":["chart","chart increasing with yen","graph","growth","money","yen"]},{"id":":currency_exchange:","symbol":"💱","group":"objects","keywords":["bank","currency","exchange","money"]},{"id":":heavy_dollar_sign:","symbol":"💲","group":"objects","keywords":["currency","dollar","heavy dollar sign","money"]},{"id":":envelope:","symbol":"✉","group":"objects","keywords":["email","envelope","letter"]},{"id":":e-mail:","symbol":"📧","group":"objects","keywords":["e-mail","email","letter","mail"]},{"id":":incoming_envelope:","symbol":"📨","group":"objects","keywords":["e-mail","email","envelope","incoming","letter","receive"]},{"id":":envelope_with_arrow:","symbol":"📩","group":"objects","keywords":["arrow","e-mail","email","envelope","envelope with arrow","outgoing"]},{"id":":outbox_tray:","symbol":"📤","group":"objects","keywords":["box","letter","mail","outbox","sent","tray"]},{"id":":inbox_tray:","symbol":"📥","group":"objects","keywords":["box","inbox","letter","mail","receive","tray"]},{"id":":package:","symbol":"📦","group":"objects","keywords":["box","package","parcel"]},{"id":":closed_mailbox_with_raised_flag:","symbol":"📫","group":"objects","keywords":["closed","closed mailbox with raised flag","mail","mailbox","postbox"]},{"id":":closed_mailbox_with_lowered_flag:","symbol":"📪","group":"objects","keywords":["closed","closed mailbox with lowered flag","lowered","mail","mailbox","postbox"]},{"id":":open_mailbox_with_raised_flag:","symbol":"📬","group":"objects","keywords":["mail","mailbox","open","open mailbox with raised flag","postbox"]},{"id":":open_mailbox_with_lowered_flag:","symbol":"📭","group":"objects","keywords":["lowered","mail","mailbox","open","open mailbox with lowered flag","postbox"]},{"id":":postbox:","symbol":"📮","group":"objects","keywords":["mail","mailbox","postbox"]},{"id":":ballot_box_with_ballot:","symbol":"🗳","group":"objects","keywords":["ballot","ballot box with ballot","box"]},{"id":":pencil:","symbol":"✏","group":"objects","keywords":["pencil"]},{"id":":black_nib:","symbol":"✒","group":"objects","keywords":["black nib","nib","pen"]},{"id":":fountain_pen:","symbol":"🖋","group":"objects","keywords":["fountain","pen"]},{"id":":pen:","symbol":"🖊","group":"objects","keywords":["ballpoint","pen"]},{"id":":paintbrush:","symbol":"🖌","group":"objects","keywords":["paintbrush","painting"]},{"id":":crayon:","symbol":"🖍","group":"objects","keywords":["crayon"]},{"id":":memo:","symbol":"📝","group":"objects","keywords":["memo","pencil"]},{"id":":briefcase:","symbol":"💼","group":"objects","keywords":["briefcase"]},{"id":":file_folder:","symbol":"📁","group":"objects","keywords":["file","folder"]},{"id":":open_file_folder:","symbol":"📂","group":"objects","keywords":["file","folder","open"]},{"id":":card_index_dividers:","symbol":"🗂","group":"objects","keywords":["card","dividers","index"]},{"id":":calendar:","symbol":"📅","group":"objects","keywords":["calendar","date"]},{"id":":tear-off_calendar:","symbol":"📆","group":"objects","keywords":["calendar","tear-off calendar"]},{"id":":spiral_notepad:","symbol":"🗒","group":"objects","keywords":["note","pad","spiral","spiral notepad"]},{"id":":spiral_calendar:","symbol":"🗓","group":"objects","keywords":["calendar","pad","spiral"]},{"id":":card_index:","symbol":"📇","group":"objects","keywords":["card","index","rolodex"]},{"id":":chart_increasing:","symbol":"📈","group":"objects","keywords":["chart","chart increasing","graph","growth","trend","upward"]},{"id":":chart_decreasing:","symbol":"📉","group":"objects","keywords":["chart","chart decreasing","down","graph","trend"]},{"id":":bar_chart:","symbol":"📊","group":"objects","keywords":["bar","chart","graph"]},{"id":":clipboard:","symbol":"📋","group":"objects","keywords":["clipboard"]},{"id":":pushpin:","symbol":"📌","group":"objects","keywords":["pin","pushpin"]},{"id":":round_pushpin:","symbol":"📍","group":"objects","keywords":["pin","pushpin","round pushpin"]},{"id":":paperclip:","symbol":"📎","group":"objects","keywords":["paperclip"]},{"id":":linked_paperclips:","symbol":"🖇","group":"objects","keywords":["link","linked paperclips","paperclip"]},{"id":":straight_ruler:","symbol":"📏","group":"objects","keywords":["ruler","straight edge","straight ruler"]},{"id":":triangular_ruler:","symbol":"📐","group":"objects","keywords":["ruler","set","triangle","triangular ruler"]},{"id":":scissors:","symbol":"✂","group":"objects","keywords":["cutting","scissors","tool"]},{"id":":card_file_box:","symbol":"🗃","group":"objects","keywords":["box","card","file"]},{"id":":file_cabinet:","symbol":"🗄","group":"objects","keywords":["cabinet","file","filing"]},{"id":":wastebasket:","symbol":"🗑","group":"objects","keywords":["wastebasket"]},{"id":":locked:","symbol":"🔒","group":"objects","keywords":["closed","locked"]},{"id":":unlocked:","symbol":"🔓","group":"objects","keywords":["lock","open","unlock","unlocked"]},{"id":":locked_with_pen:","symbol":"🔏","group":"objects","keywords":["ink","lock","locked with pen","nib","pen","privacy"]},{"id":":locked_with_key:","symbol":"🔐","group":"objects","keywords":["closed","key","lock","locked with key","secure"]},{"id":":key:","symbol":"🔑","group":"objects","keywords":["key","lock","password"]},{"id":":old_key:","symbol":"🗝","group":"objects","keywords":["clue","key","lock","old"]},{"id":":hammer:","symbol":"🔨","group":"objects","keywords":["hammer","tool"]},{"id":":pick:","symbol":"⛏","group":"objects","keywords":["mining","pick","tool"]},{"id":":hammer_and_pick:","symbol":"⚒","group":"objects","keywords":["hammer","hammer and pick","pick","tool"]},{"id":":hammer_and_wrench:","symbol":"🛠","group":"objects","keywords":["hammer","hammer and wrench","spanner","tool","wrench"]},{"id":":dagger:","symbol":"🗡","group":"objects","keywords":["dagger","knife","weapon"]},{"id":":crossed_swords:","symbol":"⚔","group":"objects","keywords":["crossed","swords","weapon"]},{"id":":pistol:","symbol":"🔫","group":"objects","keywords":["gun","handgun","pistol","revolver","tool","weapon"]},{"id":":bow_and_arrow:","symbol":"🏹","group":"objects","keywords":["archer","arrow","bow","bow and arrow","Sagittarius","zodiac"]},{"id":":shield:","symbol":"🛡","group":"objects","keywords":["shield","weapon"]},{"id":":wrench:","symbol":"🔧","group":"objects","keywords":["spanner","tool","wrench"]},{"id":":nut_and_bolt:","symbol":"🔩","group":"objects","keywords":["bolt","nut","nut and bolt","tool"]},{"id":":gear:","symbol":"⚙","group":"objects","keywords":["cog","cogwheel","gear","tool"]},{"id":":clamp:","symbol":"🗜","group":"objects","keywords":["clamp","compress","tool","vice"]},{"id":":balance_scale:","symbol":"⚖","group":"objects","keywords":["balance","justice","Libra","scale","zodiac"]},{"id":":link:","symbol":"🔗","group":"objects","keywords":["link"]},{"id":":chains:","symbol":"⛓","group":"objects","keywords":["chain","chains"]},{"id":":alembic:","symbol":"⚗","group":"objects","keywords":["alembic","chemistry","tool"]},{"id":":microscope:","symbol":"🔬","group":"objects","keywords":["microscope","science","tool"]},{"id":":telescope:","symbol":"🔭","group":"objects","keywords":["science","telescope","tool"]},{"id":":satellite_antenna:","symbol":"📡","group":"objects","keywords":["antenna","dish","satellite"]},{"id":":syringe:","symbol":"💉","group":"objects","keywords":["medicine","needle","shot","sick","syringe"]},{"id":":pill:","symbol":"💊","group":"objects","keywords":["doctor","medicine","pill","sick"]},{"id":":door:","symbol":"🚪","group":"objects","keywords":["door"]},{"id":":bed:","symbol":"🛏","group":"objects","keywords":["bed","hotel","sleep"]},{"id":":couch_and_lamp:","symbol":"🛋","group":"objects","keywords":["couch","couch and lamp","hotel","lamp"]},{"id":":toilet:","symbol":"🚽","group":"objects","keywords":["toilet"]},{"id":":shower:","symbol":"🚿","group":"objects","keywords":["shower","water"]},{"id":":bathtub:","symbol":"🛁","group":"objects","keywords":["bath","bathtub"]},{"id":":shopping_cart:","symbol":"🛒","group":"objects","keywords":["cart","shopping","trolley"]},{"id":":cigarette:","symbol":"🚬","group":"objects","keywords":["cigarette","smoking"]},{"id":":coffin:","symbol":"⚰","group":"objects","keywords":["coffin","death"]},{"id":":funeral_urn:","symbol":"⚱","group":"objects","keywords":["ashes","death","funeral","urn"]},{"id":":moai:","symbol":"🗿","group":"objects","keywords":["face","moai","moyai","statue"]},{"id":":atm_sign:","symbol":"🏧","group":"symbols","keywords":["atm","ATM sign","automated","bank","teller"]},{"id":":litter_in_bin_sign:","symbol":"🚮","group":"symbols","keywords":["litter","litter bin","litter in bin sign"]},{"id":":potable_water:","symbol":"🚰","group":"symbols","keywords":["drinking","potable","water"]},{"id":":wheelchair_symbol:","symbol":"♿","group":"symbols","keywords":["access","wheelchair symbol"]},{"id":":men’s_room:","symbol":"🚹","group":"symbols","keywords":["lavatory","man","men’s room","restroom","wc"]},{"id":":women’s_room:","symbol":"🚺","group":"symbols","keywords":["lavatory","restroom","wc","woman","women’s room"]},{"id":":restroom:","symbol":"🚻","group":"symbols","keywords":["lavatory","restroom","WC"]},{"id":":baby_symbol:","symbol":"🚼","group":"symbols","keywords":["baby","baby symbol","changing"]},{"id":":water_closet:","symbol":"🚾","group":"symbols","keywords":["closet","lavatory","restroom","water","wc"]},{"id":":passport_control:","symbol":"🛂","group":"symbols","keywords":["control","passport"]},{"id":":customs:","symbol":"🛃","group":"symbols","keywords":["customs"]},{"id":":baggage_claim:","symbol":"🛄","group":"symbols","keywords":["baggage","claim"]},{"id":":left_luggage:","symbol":"🛅","group":"symbols","keywords":["baggage","left luggage","locker","luggage"]},{"id":":warning:","symbol":"⚠","group":"symbols","keywords":["warning"]},{"id":":children_crossing:","symbol":"🚸","group":"symbols","keywords":["child","children crossing","crossing","pedestrian","traffic"]},{"id":":no_entry:","symbol":"⛔","group":"symbols","keywords":["entry","forbidden","no","not","prohibited","traffic"]},{"id":":prohibited:","symbol":"🚫","group":"symbols","keywords":["entry","forbidden","no","not","prohibited"]},{"id":":no_bicycles:","symbol":"🚳","group":"symbols","keywords":["bicycle","bike","forbidden","no","no bicycles","prohibited"]},{"id":":no_smoking:","symbol":"🚭","group":"symbols","keywords":["forbidden","no","not","prohibited","smoking"]},{"id":":no_littering:","symbol":"🚯","group":"symbols","keywords":["forbidden","litter","no","no littering","not","prohibited"]},{"id":":non-potable_water:","symbol":"🚱","group":"symbols","keywords":["non-drinking","non-potable","water"]},{"id":":no_pedestrians:","symbol":"🚷","group":"symbols","keywords":["forbidden","no","no pedestrians","not","pedestrian","prohibited"]},{"id":":no_mobile_phones:","symbol":"📵","group":"symbols","keywords":["cell","forbidden","mobile","no","no mobile phones","phone"]},{"id":":no_one_under_eighteen:","symbol":"🔞","group":"symbols","keywords":["18","age restriction","eighteen","no one under eighteen","prohibited","underage"]},{"id":":radioactive:","symbol":"☢","group":"symbols","keywords":["radioactive","sign"]},{"id":":biohazard:","symbol":"☣","group":"symbols","keywords":["biohazard","sign"]},{"id":":up_arrow:","symbol":"⬆","group":"symbols","keywords":["arrow","cardinal","direction","north","up arrow"]},{"id":":up-right_arrow:","symbol":"↗","group":"symbols","keywords":["arrow","direction","intercardinal","northeast","up-right arrow"]},{"id":":right_arrow:","symbol":"➡","group":"symbols","keywords":["arrow","cardinal","direction","east","right arrow"]},{"id":":down-right_arrow:","symbol":"↘","group":"symbols","keywords":["arrow","direction","down-right arrow","intercardinal","southeast"]},{"id":":down_arrow:","symbol":"⬇","group":"symbols","keywords":["arrow","cardinal","direction","down","south"]},{"id":":down-left_arrow:","symbol":"↙","group":"symbols","keywords":["arrow","direction","down-left arrow","intercardinal","southwest"]},{"id":":left_arrow:","symbol":"⬅","group":"symbols","keywords":["arrow","cardinal","direction","left arrow","west"]},{"id":":up-left_arrow:","symbol":"↖","group":"symbols","keywords":["arrow","direction","intercardinal","northwest","up-left arrow"]},{"id":":up-down_arrow:","symbol":"↕","group":"symbols","keywords":["arrow","up-down arrow"]},{"id":":left-right_arrow:","symbol":"↔","group":"symbols","keywords":["arrow","left-right arrow"]},{"id":":right_arrow_curving_left:","symbol":"↩","group":"symbols","keywords":["arrow","right arrow curving left"]},{"id":":left_arrow_curving_right:","symbol":"↪","group":"symbols","keywords":["arrow","left arrow curving right"]},{"id":":right_arrow_curving_up:","symbol":"⤴","group":"symbols","keywords":["arrow","right arrow curving up"]},{"id":":right_arrow_curving_down:","symbol":"⤵","group":"symbols","keywords":["arrow","down","right arrow curving down"]},{"id":":clockwise_vertical_arrows:","symbol":"🔃","group":"symbols","keywords":["arrow","clockwise","clockwise vertical arrows","reload"]},{"id":":counterclockwise_arrows_button:","symbol":"🔄","group":"symbols","keywords":["anticlockwise","arrow","counterclockwise","counterclockwise arrows button","withershins"]},{"id":":back_arrow:","symbol":"🔙","group":"symbols","keywords":["arrow","back","BACK arrow"]},{"id":":end_arrow:","symbol":"🔚","group":"symbols","keywords":["arrow","end","END arrow"]},{"id":":on!_arrow:","symbol":"🔛","group":"symbols","keywords":["arrow","mark","on","ON! arrow"]},{"id":":soon_arrow:","symbol":"🔜","group":"symbols","keywords":["arrow","soon","SOON arrow"]},{"id":":top_arrow:","symbol":"🔝","group":"symbols","keywords":["arrow","top","TOP arrow","up"]},{"id":":place_of_worship:","symbol":"🛐","group":"symbols","keywords":["place of worship","religion","worship"]},{"id":":atom_symbol:","symbol":"⚛","group":"symbols","keywords":["atheist","atom","atom symbol"]},{"id":":om:","symbol":"🕉","group":"symbols","keywords":["Hindu","om","religion"]},{"id":":star_of_david:","symbol":"✡","group":"symbols","keywords":["David","Jew","Jewish","religion","star","star of David"]},{"id":":wheel_of_dharma:","symbol":"☸","group":"symbols","keywords":["Buddhist","dharma","religion","wheel","wheel of dharma"]},{"id":":yin_yang:","symbol":"☯","group":"symbols","keywords":["religion","tao","taoist","yang","yin"]},{"id":":latin_cross:","symbol":"✝","group":"symbols","keywords":["Christian","cross","latin cross","religion"]},{"id":":orthodox_cross:","symbol":"☦","group":"symbols","keywords":["Christian","cross","orthodox cross","religion"]},{"id":":star_and_crescent:","symbol":"☪","group":"symbols","keywords":["islam","Muslim","religion","star and crescent"]},{"id":":peace_symbol:","symbol":"☮","group":"symbols","keywords":["peace","peace symbol"]},{"id":":menorah:","symbol":"🕎","group":"symbols","keywords":["candelabrum","candlestick","menorah","religion"]},{"id":":dotted_six-pointed_star:","symbol":"🔯","group":"symbols","keywords":["dotted six-pointed star","fortune","star"]},{"id":":aries:","symbol":"♈","group":"symbols","keywords":["Aries","ram","zodiac"]},{"id":":taurus:","symbol":"♉","group":"symbols","keywords":["bull","ox","Taurus","zodiac"]},{"id":":gemini:","symbol":"♊","group":"symbols","keywords":["Gemini","twins","zodiac"]},{"id":":cancer:","symbol":"♋","group":"symbols","keywords":["Cancer","crab","zodiac"]},{"id":":leo:","symbol":"♌","group":"symbols","keywords":["Leo","lion","zodiac"]},{"id":":virgo:","symbol":"♍","group":"symbols","keywords":["Virgo","zodiac"]},{"id":":libra:","symbol":"♎","group":"symbols","keywords":["balance","justice","Libra","scales","zodiac"]},{"id":":scorpio:","symbol":"♏","group":"symbols","keywords":["Scorpio","scorpion","scorpius","zodiac"]},{"id":":sagittarius:","symbol":"♐","group":"symbols","keywords":["archer","Sagittarius","zodiac"]},{"id":":capricorn:","symbol":"♑","group":"symbols","keywords":["Capricorn","goat","zodiac"]},{"id":":aquarius:","symbol":"♒","group":"symbols","keywords":["Aquarius","bearer","water","zodiac"]},{"id":":pisces:","symbol":"♓","group":"symbols","keywords":["fish","Pisces","zodiac"]},{"id":":ophiuchus:","symbol":"⛎","group":"symbols","keywords":["bearer","Ophiuchus","serpent","snake","zodiac"]},{"id":":shuffle_tracks_button:","symbol":"🔀","group":"symbols","keywords":["arrow","crossed","shuffle tracks button"]},{"id":":repeat_button:","symbol":"🔁","group":"symbols","keywords":["arrow","clockwise","repeat","repeat button"]},{"id":":repeat_single_button:","symbol":"🔂","group":"symbols","keywords":["arrow","clockwise","once","repeat single button"]},{"id":":play_button:","symbol":"▶","group":"symbols","keywords":["arrow","play","play button","right","triangle"]},{"id":":fast-forward_button:","symbol":"⏩","group":"symbols","keywords":["arrow","double","fast","fast-forward button","forward"]},{"id":":next_track_button:","symbol":"⏭","group":"symbols","keywords":["arrow","next scene","next track","next track button","triangle"]},{"id":":play_or_pause_button:","symbol":"⏯","group":"symbols","keywords":["arrow","pause","play","play or pause button","right","triangle"]},{"id":":reverse_button:","symbol":"◀","group":"symbols","keywords":["arrow","left","reverse","reverse button","triangle"]},{"id":":fast_reverse_button:","symbol":"⏪","group":"symbols","keywords":["arrow","double","fast reverse button","rewind"]},{"id":":last_track_button:","symbol":"⏮","group":"symbols","keywords":["arrow","last track button","previous scene","previous track","triangle"]},{"id":":upwards_button:","symbol":"🔼","group":"symbols","keywords":["arrow","button","red","upwards button"]},{"id":":fast_up_button:","symbol":"⏫","group":"symbols","keywords":["arrow","double","fast up button"]},{"id":":downwards_button:","symbol":"🔽","group":"symbols","keywords":["arrow","button","down","downwards button","red"]},{"id":":fast_down_button:","symbol":"⏬","group":"symbols","keywords":["arrow","double","down","fast down button"]},{"id":":pause_button:","symbol":"⏸","group":"symbols","keywords":["bar","double","pause","pause button","vertical"]},{"id":":stop_button:","symbol":"⏹","group":"symbols","keywords":["square","stop","stop button"]},{"id":":record_button:","symbol":"⏺","group":"symbols","keywords":["circle","record","record button"]},{"id":":eject_button:","symbol":"⏏","group":"symbols","keywords":["eject","eject button"]},{"id":":cinema:","symbol":"🎦","group":"symbols","keywords":["camera","cinema","film","movie"]},{"id":":dim_button:","symbol":"🔅","group":"symbols","keywords":["brightness","dim","dim button","low"]},{"id":":bright_button:","symbol":"🔆","group":"symbols","keywords":["bright","bright button","brightness"]},{"id":":antenna_bars:","symbol":"📶","group":"symbols","keywords":["antenna","antenna bars","bar","cell","mobile","phone"]},{"id":":vibration_mode:","symbol":"📳","group":"symbols","keywords":["cell","mobile","mode","phone","telephone","vibration"]},{"id":":mobile_phone_off:","symbol":"📴","group":"symbols","keywords":["cell","mobile","off","phone","telephone"]},{"id":":female_sign:","symbol":"♀","group":"symbols","keywords":["female sign","woman"]},{"id":":male_sign:","symbol":"♂","group":"symbols","keywords":["male sign","man"]},{"id":":medical_symbol:","symbol":"⚕","group":"symbols","keywords":["aesculapius","medical symbol","medicine","staff"]},{"id":":recycling_symbol:","symbol":"♻","group":"symbols","keywords":["recycle","recycling symbol"]},{"id":":fleur-de-lis:","symbol":"⚜","group":"symbols","keywords":["fleur-de-lis"]},{"id":":trident_emblem:","symbol":"🔱","group":"symbols","keywords":["anchor","emblem","ship","tool","trident"]},{"id":":name_badge:","symbol":"📛","group":"symbols","keywords":["badge","name"]},{"id":":japanese_symbol_for_beginner:","symbol":"🔰","group":"symbols","keywords":["beginner","chevron","Japanese","Japanese symbol for beginner","leaf"]},{"id":":heavy_large_circle:","symbol":"⭕","group":"symbols","keywords":["circle","heavy large circle","o"]},{"id":":white_heavy_check_mark:","symbol":"✅","group":"symbols","keywords":["check","mark","white heavy check mark"]},{"id":":ballot_box_with_check:","symbol":"☑","group":"symbols","keywords":["ballot","ballot box with check","box","check"]},{"id":":heavy_check_mark:","symbol":"✔","group":"symbols","keywords":["check","heavy check mark","mark"]},{"id":":heavy_multiplication_x:","symbol":"✖","group":"symbols","keywords":["cancel","heavy multiplication x","multiplication","multiply","x"]},{"id":":cross_mark:","symbol":"❌","group":"symbols","keywords":["cancel","cross mark","mark","multiplication","multiply","x"]},{"id":":cross_mark_button:","symbol":"❎","group":"symbols","keywords":["cross mark button","mark","square"]},{"id":":heavy_plus_sign:","symbol":"➕","group":"symbols","keywords":["heavy plus sign","math","plus"]},{"id":":heavy_minus_sign:","symbol":"➖","group":"symbols","keywords":["heavy minus sign","math","minus"]},{"id":":heavy_division_sign:","symbol":"➗","group":"symbols","keywords":["division","heavy division sign","math"]},{"id":":curly_loop:","symbol":"➰","group":"symbols","keywords":["curl","curly loop","loop"]},{"id":":double_curly_loop:","symbol":"➿","group":"symbols","keywords":["curl","double","double curly loop","loop"]},{"id":":part_alternation_mark:","symbol":"〽","group":"symbols","keywords":["mark","part","part alternation mark"]},{"id":":eight-spoked_asterisk:","symbol":"✳","group":"symbols","keywords":["asterisk","eight-spoked asterisk"]},{"id":":eight-pointed_star:","symbol":"✴","group":"symbols","keywords":["eight-pointed star","star"]},{"id":":sparkle:","symbol":"❇","group":"symbols","keywords":["sparkle"]},{"id":":double_exclamation_mark:","symbol":"‼","group":"symbols","keywords":["bangbang","double exclamation mark","exclamation","mark","punctuation"]},{"id":":exclamation_question_mark:","symbol":"⁉","group":"symbols","keywords":["exclamation","interrobang","mark","punctuation","question"]},{"id":":question_mark:","symbol":"❓","group":"symbols","keywords":["mark","punctuation","question"]},{"id":":white_question_mark:","symbol":"❔","group":"symbols","keywords":["mark","outlined","punctuation","question","white question mark"]},{"id":":white_exclamation_mark:","symbol":"❕","group":"symbols","keywords":["exclamation","mark","outlined","punctuation","white exclamation mark"]},{"id":":exclamation_mark:","symbol":"❗","group":"symbols","keywords":["exclamation","mark","punctuation"]},{"id":":wavy_dash:","symbol":"〰","group":"symbols","keywords":["dash","punctuation","wavy"]},{"id":":copyright:","symbol":"©","group":"symbols","keywords":["copyright"]},{"id":":registered:","symbol":"®","group":"symbols","keywords":["registered"]},{"id":":trade_mark:","symbol":"™","group":"symbols","keywords":["mark","tm","trade mark","trademark"]},{"id":":keycap_#:","symbol":"#️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_*:","symbol":"*️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_0:","symbol":"0️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_1:","symbol":"1️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_2:","symbol":"2️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_3:","symbol":"3️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_4:","symbol":"4️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_5:","symbol":"5️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_6:","symbol":"6️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_7:","symbol":"7️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_8:","symbol":"8️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_9:","symbol":"9️⃣","group":"symbols","keywords":["keycap"]},{"id":":keycap_10:","symbol":"🔟","group":"symbols","keywords":["keycap"]},{"id":":hundred_points:","symbol":"💯","group":"symbols","keywords":["100","full","hundred","hundred points","score"]},{"id":":input_latin_uppercase:","symbol":"🔠","group":"symbols","keywords":["ABCD","input","latin","letters","uppercase"]},{"id":":input_latin_lowercase:","symbol":"🔡","group":"symbols","keywords":["abcd","input","latin","letters","lowercase"]},{"id":":input_numbers:","symbol":"🔢","group":"symbols","keywords":["1234","input","numbers"]},{"id":":input_symbols:","symbol":"🔣","group":"symbols","keywords":["〒♪&%","input","input symbols"]},{"id":":input_latin_letters:","symbol":"🔤","group":"symbols","keywords":["abc","alphabet","input","latin","letters"]},{"id":":a_button_(blood_type):","symbol":"🅰","group":"symbols","keywords":["a","A button (blood type)","blood type"]},{"id":":ab_button_(blood_type):","symbol":"🆎","group":"symbols","keywords":["ab","AB button (blood type)","blood type"]},{"id":":b_button_(blood_type):","symbol":"🅱","group":"symbols","keywords":["b","B button (blood type)","blood type"]},{"id":":cl_button:","symbol":"🆑","group":"symbols","keywords":["cl","CL button"]},{"id":":cool_button:","symbol":"🆒","group":"symbols","keywords":["cool","COOL button"]},{"id":":free_button:","symbol":"🆓","group":"symbols","keywords":["free","FREE button"]},{"id":":information:","symbol":"ℹ","group":"symbols","keywords":["i","information"]},{"id":":id_button:","symbol":"🆔","group":"symbols","keywords":["id","ID button","identity"]},{"id":":circled_m:","symbol":"Ⓜ","group":"symbols","keywords":["circle","circled M","m"]},{"id":":new_button:","symbol":"🆕","group":"symbols","keywords":["new","NEW button"]},{"id":":ng_button:","symbol":"🆖","group":"symbols","keywords":["ng","NG button"]},{"id":":o_button_(blood_type):","symbol":"🅾","group":"symbols","keywords":["blood type","o","O button (blood type)"]},{"id":":ok_button:","symbol":"🆗","group":"symbols","keywords":["OK","OK button"]},{"id":":p_button:","symbol":"🅿","group":"symbols","keywords":["P button","parking"]},{"id":":sos_button:","symbol":"🆘","group":"symbols","keywords":["help","sos","SOS button"]},{"id":":up!_button:","symbol":"🆙","group":"symbols","keywords":["mark","up","UP! button"]},{"id":":vs_button:","symbol":"🆚","group":"symbols","keywords":["versus","vs","VS button"]},{"id":":japanese_“here”_button:","symbol":"🈁","group":"symbols","keywords":["“here”","Japanese","Japanese “here” button","katakana","ココ"]},{"id":":japanese_“service_charge”_button:","symbol":"🈂","group":"symbols","keywords":["“service charge”","Japanese","Japanese “service charge” button","katakana","サ"]},{"id":":japanese_“monthly_amount”_button:","symbol":"🈷","group":"symbols","keywords":["“monthly amount”","ideograph","Japanese","Japanese “monthly amount” button","月"]},{"id":":japanese_“not_free_of_charge”_button:","symbol":"🈶","group":"symbols","keywords":["“not free of charge”","ideograph","Japanese","Japanese “not free of charge” button","有"]},{"id":":japanese_“reserved”_button:","symbol":"🈯","group":"symbols","keywords":["“reserved”","ideograph","Japanese","Japanese “reserved” button","指"]},{"id":":japanese_“bargain”_button:","symbol":"🉐","group":"symbols","keywords":["“bargain”","ideograph","Japanese","Japanese “bargain” button","得"]},{"id":":japanese_“discount”_button:","symbol":"🈹","group":"symbols","keywords":["“discount”","ideograph","Japanese","Japanese “discount” button","割"]},{"id":":japanese_“free_of_charge”_button:","symbol":"🈚","group":"symbols","keywords":["“free of charge”","ideograph","Japanese","Japanese “free of charge” button","無"]},{"id":":japanese_“prohibited”_button:","symbol":"🈲","group":"symbols","keywords":["“prohibited”","ideograph","Japanese","Japanese “prohibited” button","禁"]},{"id":":japanese_“acceptable”_button:","symbol":"🉑","group":"symbols","keywords":["“acceptable”","ideograph","Japanese","Japanese “acceptable” button","可"]},{"id":":japanese_“application”_button:","symbol":"🈸","group":"symbols","keywords":["“application”","ideograph","Japanese","Japanese “application” button","申"]},{"id":":japanese_“passing_grade”_button:","symbol":"🈴","group":"symbols","keywords":["“passing grade”","ideograph","Japanese","Japanese “passing grade” button","合"]},{"id":":japanese_“vacancy”_button:","symbol":"🈳","group":"symbols","keywords":["“vacancy”","ideograph","Japanese","Japanese “vacancy” button","空"]},{"id":":japanese_“congratulations”_button:","symbol":"㊗","group":"symbols","keywords":["“congratulations”","ideograph","Japanese","Japanese “congratulations” button","祝"]},{"id":":japanese_“secret”_button:","symbol":"㊙","group":"symbols","keywords":["“secret”","ideograph","Japanese","Japanese “secret” button","秘"]},{"id":":japanese_“open_for_business”_button:","symbol":"🈺","group":"symbols","keywords":["“open for business”","ideograph","Japanese","Japanese “open for business” button","営"]},{"id":":japanese_“no_vacancy”_button:","symbol":"🈵","group":"symbols","keywords":["“no vacancy”","ideograph","Japanese","Japanese “no vacancy” button","満"]},{"id":":red_circle:","symbol":"🔴","group":"symbols","keywords":["circle","geometric","red"]},{"id":":blue_circle:","symbol":"🔵","group":"symbols","keywords":["blue","circle","geometric"]},{"id":":white_circle:","symbol":"⚪","group":"symbols","keywords":["circle","geometric","white circle"]},{"id":":black_circle:","symbol":"⚫","group":"symbols","keywords":["black circle","circle","geometric"]},{"id":":white_large_square:","symbol":"⬜","group":"symbols","keywords":["geometric","square","white large square"]},{"id":":black_large_square:","symbol":"⬛","group":"symbols","keywords":["black large square","geometric","square"]},{"id":":black_medium_square:","symbol":"◼","group":"symbols","keywords":["black medium square","geometric","square"]},{"id":":white_medium_square:","symbol":"◻","group":"symbols","keywords":["geometric","square","white medium square"]},{"id":":white_medium-small_square:","symbol":"◽","group":"symbols","keywords":["geometric","square","white medium-small square"]},{"id":":black_medium-small_square:","symbol":"◾","group":"symbols","keywords":["black medium-small square","geometric","square"]},{"id":":white_small_square:","symbol":"▫","group":"symbols","keywords":["geometric","square","white small square"]},{"id":":black_small_square:","symbol":"▪","group":"symbols","keywords":["black small square","geometric","square"]},{"id":":large_orange_diamond:","symbol":"🔶","group":"symbols","keywords":["diamond","geometric","large orange diamond","orange"]},{"id":":large_blue_diamond:","symbol":"🔷","group":"symbols","keywords":["blue","diamond","geometric","large blue diamond"]},{"id":":small_orange_diamond:","symbol":"🔸","group":"symbols","keywords":["diamond","geometric","orange","small orange diamond"]},{"id":":small_blue_diamond:","symbol":"🔹","group":"symbols","keywords":["blue","diamond","geometric","small blue diamond"]},{"id":":red_triangle_pointed_up:","symbol":"🔺","group":"symbols","keywords":["geometric","red","red triangle pointed up"]},{"id":":red_triangle_pointed_down:","symbol":"🔻","group":"symbols","keywords":["down","geometric","red","red triangle pointed down"]},{"id":":diamond_with_a_dot:","symbol":"💠","group":"symbols","keywords":["comic","diamond","diamond with a dot","geometric","inside"]},{"id":":radio_button:","symbol":"🔘","group":"symbols","keywords":["button","geometric","radio"]},{"id":":black_square_button:","symbol":"🔲","group":"symbols","keywords":["black square button","button","geometric","square"]},{"id":":white_square_button:","symbol":"🔳","group":"symbols","keywords":["button","geometric","outlined","square","white square button"]},{"id":":chequered_flag:","symbol":"🏁","group":"flags","keywords":["checkered","chequered","chequered flag","racing"]},{"id":":triangular_flag:","symbol":"🚩","group":"flags","keywords":["post","triangular flag"]},{"id":":crossed_flags:","symbol":"🎌","group":"flags","keywords":["celebration","cross","crossed","crossed flags","Japanese"]},{"id":":black_flag:","symbol":"🏴","group":"flags","keywords":["black flag","waving"]},{"id":":white_flag:","symbol":"🏳","group":"flags","keywords":["waving","white flag"]},{"id":":rainbow_flag:","symbol":"🏳️‍🌈","group":"flags","keywords":["rainbow","rainbow flag"]},{"id":":flag_ascension_island:","symbol":"🇦🇨","group":"flags","keywords":["flag"]},{"id":":flag_andorra:","symbol":"🇦🇩","group":"flags","keywords":["flag"]},{"id":":flag_united_arab_emirates:","symbol":"🇦🇪","group":"flags","keywords":["flag"]},{"id":":flag_afghanistan:","symbol":"🇦🇫","group":"flags","keywords":["flag"]},{"id":":flag_antigua_&_barbuda:","symbol":"🇦🇬","group":"flags","keywords":["flag"]},{"id":":flag_anguilla:","symbol":"🇦🇮","group":"flags","keywords":["flag"]},{"id":":flag_albania:","symbol":"🇦🇱","group":"flags","keywords":["flag"]},{"id":":flag_armenia:","symbol":"🇦🇲","group":"flags","keywords":["flag"]},{"id":":flag_angola:","symbol":"🇦🇴","group":"flags","keywords":["flag"]},{"id":":flag_antarctica:","symbol":"🇦🇶","group":"flags","keywords":["flag"]},{"id":":flag_argentina:","symbol":"🇦🇷","group":"flags","keywords":["flag"]},{"id":":flag_american_samoa:","symbol":"🇦🇸","group":"flags","keywords":["flag"]},{"id":":flag_austria:","symbol":"🇦🇹","group":"flags","keywords":["flag"]},{"id":":flag_australia:","symbol":"🇦🇺","group":"flags","keywords":["flag"]},{"id":":flag_aruba:","symbol":"🇦🇼","group":"flags","keywords":["flag"]},{"id":":flag_åland_islands:","symbol":"🇦🇽","group":"flags","keywords":["flag"]},{"id":":flag_azerbaijan:","symbol":"🇦🇿","group":"flags","keywords":["flag"]},{"id":":flag_bosnia_&_herzegovina:","symbol":"🇧🇦","group":"flags","keywords":["flag"]},{"id":":flag_barbados:","symbol":"🇧🇧","group":"flags","keywords":["flag"]},{"id":":flag_bangladesh:","symbol":"🇧🇩","group":"flags","keywords":["flag"]},{"id":":flag_belgium:","symbol":"🇧🇪","group":"flags","keywords":["flag"]},{"id":":flag_burkina_faso:","symbol":"🇧🇫","group":"flags","keywords":["flag"]},{"id":":flag_bulgaria:","symbol":"🇧🇬","group":"flags","keywords":["flag"]},{"id":":flag_bahrain:","symbol":"🇧🇭","group":"flags","keywords":["flag"]},{"id":":flag_burundi:","symbol":"🇧🇮","group":"flags","keywords":["flag"]},{"id":":flag_benin:","symbol":"🇧🇯","group":"flags","keywords":["flag"]},{"id":":flag_st._barthélemy:","symbol":"🇧🇱","group":"flags","keywords":["flag"]},{"id":":flag_bermuda:","symbol":"🇧🇲","group":"flags","keywords":["flag"]},{"id":":flag_brunei:","symbol":"🇧🇳","group":"flags","keywords":["flag"]},{"id":":flag_bolivia:","symbol":"🇧🇴","group":"flags","keywords":["flag"]},{"id":":flag_caribbean_netherlands:","symbol":"🇧🇶","group":"flags","keywords":["flag"]},{"id":":flag_brazil:","symbol":"🇧🇷","group":"flags","keywords":["flag"]},{"id":":flag_bahamas:","symbol":"🇧🇸","group":"flags","keywords":["flag"]},{"id":":flag_bhutan:","symbol":"🇧🇹","group":"flags","keywords":["flag"]},{"id":":flag_bouvet_island:","symbol":"🇧🇻","group":"flags","keywords":["flag"]},{"id":":flag_botswana:","symbol":"🇧🇼","group":"flags","keywords":["flag"]},{"id":":flag_belarus:","symbol":"🇧🇾","group":"flags","keywords":["flag"]},{"id":":flag_belize:","symbol":"🇧🇿","group":"flags","keywords":["flag"]},{"id":":flag_canada:","symbol":"🇨🇦","group":"flags","keywords":["flag"]},{"id":":flag_cocos_(keeling)_islands:","symbol":"🇨🇨","group":"flags","keywords":["flag"]},{"id":":flag_congo_-_kinshasa:","symbol":"🇨🇩","group":"flags","keywords":["flag"]},{"id":":flag_central_african_republic:","symbol":"🇨🇫","group":"flags","keywords":["flag"]},{"id":":flag_congo_-_brazzaville:","symbol":"🇨🇬","group":"flags","keywords":["flag"]},{"id":":flag_switzerland:","symbol":"🇨🇭","group":"flags","keywords":["flag"]},{"id":":flag_côte_d’ivoire:","symbol":"🇨🇮","group":"flags","keywords":["flag"]},{"id":":flag_cook_islands:","symbol":"🇨🇰","group":"flags","keywords":["flag"]},{"id":":flag_chile:","symbol":"🇨🇱","group":"flags","keywords":["flag"]},{"id":":flag_cameroon:","symbol":"🇨🇲","group":"flags","keywords":["flag"]},{"id":":flag_china:","symbol":"🇨🇳","group":"flags","keywords":["flag"]},{"id":":flag_colombia:","symbol":"🇨🇴","group":"flags","keywords":["flag"]},{"id":":flag_clipperton_island:","symbol":"🇨🇵","group":"flags","keywords":["flag"]},{"id":":flag_costa_rica:","symbol":"🇨🇷","group":"flags","keywords":["flag"]},{"id":":flag_cuba:","symbol":"🇨🇺","group":"flags","keywords":["flag"]},{"id":":flag_cape_verde:","symbol":"🇨🇻","group":"flags","keywords":["flag"]},{"id":":flag_curaçao:","symbol":"🇨🇼","group":"flags","keywords":["flag"]},{"id":":flag_christmas_island:","symbol":"🇨🇽","group":"flags","keywords":["flag"]},{"id":":flag_cyprus:","symbol":"🇨🇾","group":"flags","keywords":["flag"]},{"id":":flag_czechia:","symbol":"🇨🇿","group":"flags","keywords":["flag"]},{"id":":flag_germany:","symbol":"🇩🇪","group":"flags","keywords":["flag"]},{"id":":flag_diego_garcia:","symbol":"🇩🇬","group":"flags","keywords":["flag"]},{"id":":flag_djibouti:","symbol":"🇩🇯","group":"flags","keywords":["flag"]},{"id":":flag_denmark:","symbol":"🇩🇰","group":"flags","keywords":["flag"]},{"id":":flag_dominica:","symbol":"🇩🇲","group":"flags","keywords":["flag"]},{"id":":flag_dominican_republic:","symbol":"🇩🇴","group":"flags","keywords":["flag"]},{"id":":flag_algeria:","symbol":"🇩🇿","group":"flags","keywords":["flag"]},{"id":":flag_ceuta_&_melilla:","symbol":"🇪🇦","group":"flags","keywords":["flag"]},{"id":":flag_ecuador:","symbol":"🇪🇨","group":"flags","keywords":["flag"]},{"id":":flag_estonia:","symbol":"🇪🇪","group":"flags","keywords":["flag"]},{"id":":flag_egypt:","symbol":"🇪🇬","group":"flags","keywords":["flag"]},{"id":":flag_western_sahara:","symbol":"🇪🇭","group":"flags","keywords":["flag"]},{"id":":flag_eritrea:","symbol":"🇪🇷","group":"flags","keywords":["flag"]},{"id":":flag_spain:","symbol":"🇪🇸","group":"flags","keywords":["flag"]},{"id":":flag_ethiopia:","symbol":"🇪🇹","group":"flags","keywords":["flag"]},{"id":":flag_european_union:","symbol":"🇪🇺","group":"flags","keywords":["flag"]},{"id":":flag_finland:","symbol":"🇫🇮","group":"flags","keywords":["flag"]},{"id":":flag_fiji:","symbol":"🇫🇯","group":"flags","keywords":["flag"]},{"id":":flag_falkland_islands:","symbol":"🇫🇰","group":"flags","keywords":["flag"]},{"id":":flag_micronesia:","symbol":"🇫🇲","group":"flags","keywords":["flag"]},{"id":":flag_faroe_islands:","symbol":"🇫🇴","group":"flags","keywords":["flag"]},{"id":":flag_france:","symbol":"🇫🇷","group":"flags","keywords":["flag"]},{"id":":flag_gabon:","symbol":"🇬🇦","group":"flags","keywords":["flag"]},{"id":":flag_united_kingdom:","symbol":"🇬🇧","group":"flags","keywords":["flag"]},{"id":":flag_grenada:","symbol":"🇬🇩","group":"flags","keywords":["flag"]},{"id":":flag_georgia:","symbol":"🇬🇪","group":"flags","keywords":["flag"]},{"id":":flag_french_guiana:","symbol":"🇬🇫","group":"flags","keywords":["flag"]},{"id":":flag_guernsey:","symbol":"🇬🇬","group":"flags","keywords":["flag"]},{"id":":flag_ghana:","symbol":"🇬🇭","group":"flags","keywords":["flag"]},{"id":":flag_gibraltar:","symbol":"🇬🇮","group":"flags","keywords":["flag"]},{"id":":flag_greenland:","symbol":"🇬🇱","group":"flags","keywords":["flag"]},{"id":":flag_gambia:","symbol":"🇬🇲","group":"flags","keywords":["flag"]},{"id":":flag_guinea:","symbol":"🇬🇳","group":"flags","keywords":["flag"]},{"id":":flag_guadeloupe:","symbol":"🇬🇵","group":"flags","keywords":["flag"]},{"id":":flag_equatorial_guinea:","symbol":"🇬🇶","group":"flags","keywords":["flag"]},{"id":":flag_greece:","symbol":"🇬🇷","group":"flags","keywords":["flag"]},{"id":":flag_south_georgia_&_south_sandwich_islands:","symbol":"🇬🇸","group":"flags","keywords":["flag"]},{"id":":flag_guatemala:","symbol":"🇬🇹","group":"flags","keywords":["flag"]},{"id":":flag_guam:","symbol":"🇬🇺","group":"flags","keywords":["flag"]},{"id":":flag_guinea-bissau:","symbol":"🇬🇼","group":"flags","keywords":["flag"]},{"id":":flag_guyana:","symbol":"🇬🇾","group":"flags","keywords":["flag"]},{"id":":flag_hong_kong_sar_china:","symbol":"🇭🇰","group":"flags","keywords":["flag"]},{"id":":flag_heard_&_mcdonald_islands:","symbol":"🇭🇲","group":"flags","keywords":["flag"]},{"id":":flag_honduras:","symbol":"🇭🇳","group":"flags","keywords":["flag"]},{"id":":flag_croatia:","symbol":"🇭🇷","group":"flags","keywords":["flag"]},{"id":":flag_haiti:","symbol":"🇭🇹","group":"flags","keywords":["flag"]},{"id":":flag_hungary:","symbol":"🇭🇺","group":"flags","keywords":["flag"]},{"id":":flag_canary_islands:","symbol":"🇮🇨","group":"flags","keywords":["flag"]},{"id":":flag_indonesia:","symbol":"🇮🇩","group":"flags","keywords":["flag"]},{"id":":flag_ireland:","symbol":"🇮🇪","group":"flags","keywords":["flag"]},{"id":":flag_israel:","symbol":"🇮🇱","group":"flags","keywords":["flag"]},{"id":":flag_isle_of_man:","symbol":"🇮🇲","group":"flags","keywords":["flag"]},{"id":":flag_india:","symbol":"🇮🇳","group":"flags","keywords":["flag"]},{"id":":flag_british_indian_ocean_territory:","symbol":"🇮🇴","group":"flags","keywords":["flag"]},{"id":":flag_iraq:","symbol":"🇮🇶","group":"flags","keywords":["flag"]},{"id":":flag_iran:","symbol":"🇮🇷","group":"flags","keywords":["flag"]},{"id":":flag_iceland:","symbol":"🇮🇸","group":"flags","keywords":["flag"]},{"id":":flag_italy:","symbol":"🇮🇹","group":"flags","keywords":["flag"]},{"id":":flag_jersey:","symbol":"🇯🇪","group":"flags","keywords":["flag"]},{"id":":flag_jamaica:","symbol":"🇯🇲","group":"flags","keywords":["flag"]},{"id":":flag_jordan:","symbol":"🇯🇴","group":"flags","keywords":["flag"]},{"id":":flag_japan:","symbol":"🇯🇵","group":"flags","keywords":["flag"]},{"id":":flag_kenya:","symbol":"🇰🇪","group":"flags","keywords":["flag"]},{"id":":flag_kyrgyzstan:","symbol":"🇰🇬","group":"flags","keywords":["flag"]},{"id":":flag_cambodia:","symbol":"🇰🇭","group":"flags","keywords":["flag"]},{"id":":flag_kiribati:","symbol":"🇰🇮","group":"flags","keywords":["flag"]},{"id":":flag_comoros:","symbol":"🇰🇲","group":"flags","keywords":["flag"]},{"id":":flag_st._kitts_&_nevis:","symbol":"🇰🇳","group":"flags","keywords":["flag"]},{"id":":flag_north_korea:","symbol":"🇰🇵","group":"flags","keywords":["flag"]},{"id":":flag_south_korea:","symbol":"🇰🇷","group":"flags","keywords":["flag"]},{"id":":flag_kuwait:","symbol":"🇰🇼","group":"flags","keywords":["flag"]},{"id":":flag_cayman_islands:","symbol":"🇰🇾","group":"flags","keywords":["flag"]},{"id":":flag_kazakhstan:","symbol":"🇰🇿","group":"flags","keywords":["flag"]},{"id":":flag_laos:","symbol":"🇱🇦","group":"flags","keywords":["flag"]},{"id":":flag_lebanon:","symbol":"🇱🇧","group":"flags","keywords":["flag"]},{"id":":flag_st._lucia:","symbol":"🇱🇨","group":"flags","keywords":["flag"]},{"id":":flag_liechtenstein:","symbol":"🇱🇮","group":"flags","keywords":["flag"]},{"id":":flag_sri_lanka:","symbol":"🇱🇰","group":"flags","keywords":["flag"]},{"id":":flag_liberia:","symbol":"🇱🇷","group":"flags","keywords":["flag"]},{"id":":flag_lesotho:","symbol":"🇱🇸","group":"flags","keywords":["flag"]},{"id":":flag_lithuania:","symbol":"🇱🇹","group":"flags","keywords":["flag"]},{"id":":flag_luxembourg:","symbol":"🇱🇺","group":"flags","keywords":["flag"]},{"id":":flag_latvia:","symbol":"🇱🇻","group":"flags","keywords":["flag"]},{"id":":flag_libya:","symbol":"🇱🇾","group":"flags","keywords":["flag"]},{"id":":flag_morocco:","symbol":"🇲🇦","group":"flags","keywords":["flag"]},{"id":":flag_monaco:","symbol":"🇲🇨","group":"flags","keywords":["flag"]},{"id":":flag_moldova:","symbol":"🇲🇩","group":"flags","keywords":["flag"]},{"id":":flag_montenegro:","symbol":"🇲🇪","group":"flags","keywords":["flag"]},{"id":":flag_st._martin:","symbol":"🇲🇫","group":"flags","keywords":["flag"]},{"id":":flag_madagascar:","symbol":"🇲🇬","group":"flags","keywords":["flag"]},{"id":":flag_marshall_islands:","symbol":"🇲🇭","group":"flags","keywords":["flag"]},{"id":":flag_macedonia:","symbol":"🇲🇰","group":"flags","keywords":["flag"]},{"id":":flag_mali:","symbol":"🇲🇱","group":"flags","keywords":["flag"]},{"id":":flag_myanmar_(burma):","symbol":"🇲🇲","group":"flags","keywords":["flag"]},{"id":":flag_mongolia:","symbol":"🇲🇳","group":"flags","keywords":["flag"]},{"id":":flag_macau_sar_china:","symbol":"🇲🇴","group":"flags","keywords":["flag"]},{"id":":flag_northern_mariana_islands:","symbol":"🇲🇵","group":"flags","keywords":["flag"]},{"id":":flag_martinique:","symbol":"🇲🇶","group":"flags","keywords":["flag"]},{"id":":flag_mauritania:","symbol":"🇲🇷","group":"flags","keywords":["flag"]},{"id":":flag_montserrat:","symbol":"🇲🇸","group":"flags","keywords":["flag"]},{"id":":flag_malta:","symbol":"🇲🇹","group":"flags","keywords":["flag"]},{"id":":flag_mauritius:","symbol":"🇲🇺","group":"flags","keywords":["flag"]},{"id":":flag_maldives:","symbol":"🇲🇻","group":"flags","keywords":["flag"]},{"id":":flag_malawi:","symbol":"🇲🇼","group":"flags","keywords":["flag"]},{"id":":flag_mexico:","symbol":"🇲🇽","group":"flags","keywords":["flag"]},{"id":":flag_malaysia:","symbol":"🇲🇾","group":"flags","keywords":["flag"]},{"id":":flag_mozambique:","symbol":"🇲🇿","group":"flags","keywords":["flag"]},{"id":":flag_namibia:","symbol":"🇳🇦","group":"flags","keywords":["flag"]},{"id":":flag_new_caledonia:","symbol":"🇳🇨","group":"flags","keywords":["flag"]},{"id":":flag_niger:","symbol":"🇳🇪","group":"flags","keywords":["flag"]},{"id":":flag_norfolk_island:","symbol":"🇳🇫","group":"flags","keywords":["flag"]},{"id":":flag_nigeria:","symbol":"🇳🇬","group":"flags","keywords":["flag"]},{"id":":flag_nicaragua:","symbol":"🇳🇮","group":"flags","keywords":["flag"]},{"id":":flag_netherlands:","symbol":"🇳🇱","group":"flags","keywords":["flag"]},{"id":":flag_norway:","symbol":"🇳🇴","group":"flags","keywords":["flag"]},{"id":":flag_nepal:","symbol":"🇳🇵","group":"flags","keywords":["flag"]},{"id":":flag_nauru:","symbol":"🇳🇷","group":"flags","keywords":["flag"]},{"id":":flag_niue:","symbol":"🇳🇺","group":"flags","keywords":["flag"]},{"id":":flag_new_zealand:","symbol":"🇳🇿","group":"flags","keywords":["flag"]},{"id":":flag_oman:","symbol":"🇴🇲","group":"flags","keywords":["flag"]},{"id":":flag_panama:","symbol":"🇵🇦","group":"flags","keywords":["flag"]},{"id":":flag_peru:","symbol":"🇵🇪","group":"flags","keywords":["flag"]},{"id":":flag_french_polynesia:","symbol":"🇵🇫","group":"flags","keywords":["flag"]},{"id":":flag_papua_new_guinea:","symbol":"🇵🇬","group":"flags","keywords":["flag"]},{"id":":flag_philippines:","symbol":"🇵🇭","group":"flags","keywords":["flag"]},{"id":":flag_pakistan:","symbol":"🇵🇰","group":"flags","keywords":["flag"]},{"id":":flag_poland:","symbol":"🇵🇱","group":"flags","keywords":["flag"]},{"id":":flag_st._pierre_&_miquelon:","symbol":"🇵🇲","group":"flags","keywords":["flag"]},{"id":":flag_pitcairn_islands:","symbol":"🇵🇳","group":"flags","keywords":["flag"]},{"id":":flag_puerto_rico:","symbol":"🇵🇷","group":"flags","keywords":["flag"]},{"id":":flag_palestinian_territories:","symbol":"🇵🇸","group":"flags","keywords":["flag"]},{"id":":flag_portugal:","symbol":"🇵🇹","group":"flags","keywords":["flag"]},{"id":":flag_palau:","symbol":"🇵🇼","group":"flags","keywords":["flag"]},{"id":":flag_paraguay:","symbol":"🇵🇾","group":"flags","keywords":["flag"]},{"id":":flag_qatar:","symbol":"🇶🇦","group":"flags","keywords":["flag"]},{"id":":flag_réunion:","symbol":"🇷🇪","group":"flags","keywords":["flag"]},{"id":":flag_romania:","symbol":"🇷🇴","group":"flags","keywords":["flag"]},{"id":":flag_serbia:","symbol":"🇷🇸","group":"flags","keywords":["flag"]},{"id":":flag_russia:","symbol":"🇷🇺","group":"flags","keywords":["flag"]},{"id":":flag_rwanda:","symbol":"🇷🇼","group":"flags","keywords":["flag"]},{"id":":flag_saudi_arabia:","symbol":"🇸🇦","group":"flags","keywords":["flag"]},{"id":":flag_solomon_islands:","symbol":"🇸🇧","group":"flags","keywords":["flag"]},{"id":":flag_seychelles:","symbol":"🇸🇨","group":"flags","keywords":["flag"]},{"id":":flag_sudan:","symbol":"🇸🇩","group":"flags","keywords":["flag"]},{"id":":flag_sweden:","symbol":"🇸🇪","group":"flags","keywords":["flag"]},{"id":":flag_singapore:","symbol":"🇸🇬","group":"flags","keywords":["flag"]},{"id":":flag_st._helena:","symbol":"🇸🇭","group":"flags","keywords":["flag"]},{"id":":flag_slovenia:","symbol":"🇸🇮","group":"flags","keywords":["flag"]},{"id":":flag_svalbard_&_jan_mayen:","symbol":"🇸🇯","group":"flags","keywords":["flag"]},{"id":":flag_slovakia:","symbol":"🇸🇰","group":"flags","keywords":["flag"]},{"id":":flag_sierra_leone:","symbol":"🇸🇱","group":"flags","keywords":["flag"]},{"id":":flag_san_marino:","symbol":"🇸🇲","group":"flags","keywords":["flag"]},{"id":":flag_senegal:","symbol":"🇸🇳","group":"flags","keywords":["flag"]},{"id":":flag_somalia:","symbol":"🇸🇴","group":"flags","keywords":["flag"]},{"id":":flag_suriname:","symbol":"🇸🇷","group":"flags","keywords":["flag"]},{"id":":flag_south_sudan:","symbol":"🇸🇸","group":"flags","keywords":["flag"]},{"id":":flag_são_tomé_&_príncipe:","symbol":"🇸🇹","group":"flags","keywords":["flag"]},{"id":":flag_el_salvador:","symbol":"🇸🇻","group":"flags","keywords":["flag"]},{"id":":flag_sint_maarten:","symbol":"🇸🇽","group":"flags","keywords":["flag"]},{"id":":flag_syria:","symbol":"🇸🇾","group":"flags","keywords":["flag"]},{"id":":flag_swaziland:","symbol":"🇸🇿","group":"flags","keywords":["flag"]},{"id":":flag_tristan_da_cunha:","symbol":"🇹🇦","group":"flags","keywords":["flag"]},{"id":":flag_turks_&_caicos_islands:","symbol":"🇹🇨","group":"flags","keywords":["flag"]},{"id":":flag_chad:","symbol":"🇹🇩","group":"flags","keywords":["flag"]},{"id":":flag_french_southern_territories:","symbol":"🇹🇫","group":"flags","keywords":["flag"]},{"id":":flag_togo:","symbol":"🇹🇬","group":"flags","keywords":["flag"]},{"id":":flag_thailand:","symbol":"🇹🇭","group":"flags","keywords":["flag"]},{"id":":flag_tajikistan:","symbol":"🇹🇯","group":"flags","keywords":["flag"]},{"id":":flag_tokelau:","symbol":"🇹🇰","group":"flags","keywords":["flag"]},{"id":":flag_timor-leste:","symbol":"🇹🇱","group":"flags","keywords":["flag"]},{"id":":flag_turkmenistan:","symbol":"🇹🇲","group":"flags","keywords":["flag"]},{"id":":flag_tunisia:","symbol":"🇹🇳","group":"flags","keywords":["flag"]},{"id":":flag_tonga:","symbol":"🇹🇴","group":"flags","keywords":["flag"]},{"id":":flag_turkey:","symbol":"🇹🇷","group":"flags","keywords":["flag"]},{"id":":flag_trinidad_&_tobago:","symbol":"🇹🇹","group":"flags","keywords":["flag"]},{"id":":flag_tuvalu:","symbol":"🇹🇻","group":"flags","keywords":["flag"]},{"id":":flag_taiwan:","symbol":"🇹🇼","group":"flags","keywords":["flag"]},{"id":":flag_tanzania:","symbol":"🇹🇿","group":"flags","keywords":["flag"]},{"id":":flag_ukraine:","symbol":"🇺🇦","group":"flags","keywords":["flag"]},{"id":":flag_uganda:","symbol":"🇺🇬","group":"flags","keywords":["flag"]},{"id":":flag_u.s._outlying_islands:","symbol":"🇺🇲","group":"flags","keywords":["flag"]},{"id":":flag_united_nations:","symbol":"🇺🇳","group":"flags","keywords":["flag"]},{"id":":flag_united_states:","symbol":"🇺🇸","group":"flags","keywords":["flag"]},{"id":":flag_uruguay:","symbol":"🇺🇾","group":"flags","keywords":["flag"]},{"id":":flag_uzbekistan:","symbol":"🇺🇿","group":"flags","keywords":["flag"]},{"id":":flag_vatican_city:","symbol":"🇻🇦","group":"flags","keywords":["flag"]},{"id":":flag_st._vincent_&_grenadines:","symbol":"🇻🇨","group":"flags","keywords":["flag"]},{"id":":flag_venezuela:","symbol":"🇻🇪","group":"flags","keywords":["flag"]},{"id":":flag_british_virgin_islands:","symbol":"🇻🇬","group":"flags","keywords":["flag"]},{"id":":flag_u.s._virgin_islands:","symbol":"🇻🇮","group":"flags","keywords":["flag"]},{"id":":flag_vietnam:","symbol":"🇻🇳","group":"flags","keywords":["flag"]},{"id":":flag_vanuatu:","symbol":"🇻🇺","group":"flags","keywords":["flag"]},{"id":":flag_wallis_&_futuna:","symbol":"🇼🇫","group":"flags","keywords":["flag"]},{"id":":flag_samoa:","symbol":"🇼🇸","group":"flags","keywords":["flag"]},{"id":":flag_kosovo:","symbol":"🇽🇰","group":"flags","keywords":["flag"]},{"id":":flag_yemen:","symbol":"🇾🇪","group":"flags","keywords":["flag"]},{"id":":flag_mayotte:","symbol":"🇾🇹","group":"flags","keywords":["flag"]},{"id":":flag_south_africa:","symbol":"🇿🇦","group":"flags","keywords":["flag"]},{"id":":flag_zambia:","symbol":"🇿🇲","group":"flags","keywords":["flag"]},{"id":":flag_zimbabwe:","symbol":"🇿🇼","group":"flags","keywords":["flag"]},{"id":":flag_england:","symbol":"🏴󠁧󠁢󠁥󠁮󠁧󠁿","group":"flags","keywords":["flag"]},{"id":":flag_scotland:","symbol":"🏴󠁧󠁢󠁳󠁣󠁴󠁿","group":"flags","keywords":["flag"]},{"id":":flag_wales:","symbol":"🏴󠁧󠁢󠁷󠁬󠁳󠁿","group":"flags","keywords":["flag"]}]');const KS={autosave:{waitingTime:5e3,save:e=>async function(e){const t=Date.now(),i=e.config.get(MS),o=await e.getData();o||console.warn("Trying to save snapshot but data is not defined.");const n={timestamp:t,hash:OS(o),content:o},s=VS(i),r=s?.items||[];r.find((e=>n.hash===e.hash))||r.push(n);try{const e=IS.compress(JSON.stringify({items:r,updatedAt:t}));localStorage.setItem(i,e)}catch(t){Np(e,"notifications").addError("Failed to save CKEditor data to localStorage: "+t.toString())}return!0}(e)},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{insert:{type:"inline"},resizeUnit:"px",resizeOptions:[{name:"imageResize:original",value:null,icon:"original"},{name:"imageResize:50",value:"50",icon:"medium"},{name:"imageResize:75",value:"75",icon:"large"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","|","imageResize:original"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells","tableProperties","tableCellProperties"]},mention:{feeds:[{marker:"@",feed:function(e){const t=this;let i=Fp(t);if(i&&"Activity::Comment"===i._type){const e=i.$embedded.workPackage;e&&(i=e)}if(!i||"WorkPackage"!==i._type)return[];if(t.config.get("disabledMentions").includes("user"))return[];const o=Bp(t).api.v3.principals(i,e),n=Mp(t),s=window.OpenProject.urlRoot;return new Promise(((e,t)=>{_k(o,{responseKind:"json",query:{select:"elements/_type,elements/id,elements/name"}}).then((e=>e.json)).then((t=>{e(_.uniqBy(t._embedded.elements,(e=>e.id)).map((e=>{const t=e._type.toLowerCase(),i=`@${e.name}`,o=`@${e.id}`,r=n.services.apiV3Service[`${t}s`].segment;return{type:t,id:o,text:i,link:`${s}/${r}/${e.id}`,dataId:e.id,name:e.name}})))})).catch((e=>{console.error("Error fetching user mentions:",e),t(e)}))}))},itemRenderer:WS,minimumCharacters:0},{marker:"###",feed:HS("###"),itemRenderer:WS,minimumCharacters:1},{marker:"##",feed:HS("##"),itemRenderer:WS,minimumCharacters:1},{marker:"#",feed:HS("#"),itemRenderer:WS,minimumCharacters:1},{marker:":",feed:function(e){return new Promise(((t,i)=>{const o=US.filter((t=>function(e,t,i){if(t.includes(e))return!0;if(0!==i.length)for(let t=0;t({id:e.id,name:e.id.replace(/:/g,""),text:e.symbol,type:"emoji"})));t(o)}))},itemRenderer:function(e){const t=document.createElement("span");return t.classList.add("mention-list-item"),t.textContent=`${e.text} ${e.name}`,t},minimumCharacters:1}]},language:"en",licenseKey:"GPL"};function GS(e){return(t,i)=>{const o=i.openProject.context;i.removePlugins=i.removePlugins||[];const n=o.resource;if(n&&n.canAddAttachments||i.removePlugins.push(...$S.map((e=>e.pluginName))),!1===o.macros&&(i.openProject.disableAllMacros=!0,i.removePlugins.push(...jS.map((e=>e.pluginName)))),Array.isArray(o.macros)){const e=jS.filter((e=>-1===o.macros.indexOf(e.pluginName)));i.removePlugins.push(...e)}i.disabledMentions=[];const s=o.disabledMentions;return Array.isArray(s)&&(i.disabledMentions=s),e.create(t,i).then((e=>e))}}class JS extends dg{}class ZS extends dg{}window.OPConstrainedEditor=JS,window.OPClassicEditor=ZS,window.OPEditorWatchdog=cc,ZS.createCustomized=GS(ZS),ZS.builtinPlugins=qS,ZS.defaultConfig=Object.assign({},KS),ZS.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","insertTable","macroList","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","|","pageBreak","|","preview","opShowSource"]},JS.createCustomized=GS(JS),JS.builtinPlugins=qS,JS.defaultConfig=Object.assign({},KS),JS.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","preview","opShowSource"]}})(),o=o.default})())); //# sourceMappingURL=ckeditor.js.map \ No newline at end of file diff --git a/frontend/src/vendor/ckeditor/ckeditor.js.map b/frontend/src/vendor/ckeditor/ckeditor.js.map index 4fb04e28597..7a4e41939c3 100644 --- a/frontend/src/vendor/ckeditor/ckeditor.js.map +++ b/frontend/src/vendor/ckeditor/ckeditor.js.map @@ -1 +1 @@ -{"version":3,"file":"ckeditor.js","mappings":";;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAkB,SAAID,IAEtBD,EAAe,SAAIC,GACpB,CATD,CASGK,MAAM,IACT,M,eCLA,IAAIC,GAAoB,EACpBC,GAAkB,EAClBC,GAAgB,EAqBpB,SAASC,EAAQC,EAAOC,EAAMC,GAC7B,IAAIC,EAAQH,EAAMI,UAAUH,GACxBI,EAAO,CAACJ,EAAMC,GAEdC,EAAQ,EACXH,EAAMM,SAASD,GAEfL,EAAMO,MAAMJ,GAASE,CAEvB,CAEA,SAASG,EAAYC,EAAQN,GAE5B,IADA,IAAIO,EAAcD,EAAON,GAAOQ,MAAQ,EAC/BC,EAAIT,EAAQ,EAAGS,GAAK,EAAGA,IAC/B,GAAIH,EAAOG,GAAGD,QAAUD,EACvB,OAAOE,EAGT,OAAQ,CACT,CAEA,SAASC,EAAWJ,EAAQN,GAC3B,MA0DgD,WA1DhCM,EAAON,GA0DgBW,MACxC,SAAqBd,GAAS,MAAsB,mBAAfA,EAAMc,IAA2B,CA1D9DC,CAAYN,EAAON,EAAQ,KA2DnC,SAAoBH,GAAS,MAAsB,mBAAfA,EAAMc,IAA2B,CA1D7DE,CAAWP,EAAON,EAAQ,KA4DlC,SAAgCH,GAE/B,OAAyC,IAAlCA,EAAMiB,QAAQC,QAAQ,SAAmD,IAAlClB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MC,aAAAwrB,CAAcxhC,GACX,OAAO0zB,GAAU0B,UAAUp1B,EAC/B,CACA,eAAAyhC,IAAmBrpC,GACf,OAAO,IAAIk9B,MAAiBl9B,EAChC,EAQA,MAAM2yF,GAAmB,8CACvBC,GAAmB,2DACnBC,GAAoB,oEACpBC,GAAmB,uEACnBC,GAAoB,sEAGpBC,GAA6B,qCAC7BC,GAAc,IAAIr/F,IAAI,CAExB,QACA,SACA,OACA,QACA,SACA,MACA,SACA,UACA,QACA,OACA,QACA,SACA,OACA,OACA,OACA,OAEA,SAEA,YACA,eACA,aACA,QACA,QACA,SACA,iBACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,YACA,aACA,OACA,YACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,YACA,QACA,UACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,UACA,YACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,UACA,SACA,YACA,SACA,QACA,aACA,cAEA,eACA,gBACA,eACA,aACA,aACA,kBACA,eACA,aACA,cACA,WACA,YACA,gBACA,iBACA,kBACA,sBACA,iBACA,WACA,OACA,WACA,YACA,mBACA,aACA,kBACA,oBACA,eACA,SACA,cACA,aAEA,gBAEA,eACA,gBAcA,SAASs/F,GAAkB/2E,GAE3B,OAAIA,EAAO0G,WAAW,KACX8vE,GAAi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mBpwH,IAGhC5rJ,OAAOi8Q,oBAAsBF,GAC7B/7Q,OAAOk8Q,gBAAkBF,GAGzBh8Q,OAAOm8Q,iBAAmB33K,GAE1Bw3K,GAAWI,iBAAmBZ,GAAwBQ,IACtDA,GAAWpsK,eAAiBA,GAC5BosK,GAAWrsK,cAAgB/5G,OAAO8I,OAAO,CAAC,EAAGixG,IAC7CqsK,GAAWrsK,cAAc6H,QAAU,CACjChxF,MAAO,CACN,UACA,IACA,OACA,SACA,gBACA,OACA,kBACA,OACA,eACA,eACA,WACA,cACA,aACA,IACA,cACA,YACA,IACA,qBACA,OACA,OACA,gCACA,IACA,YACA,IACA,UACA,iBAIHu1P,GAAkBK,iBAAmBZ,GAAwBO,IAC7DA,GAAkBnsK,eAAiBA,GACnCmsK,GAAkBpsK,cAAgB/5G,OAAO8I,OAAO,CAAC,EAAGixG,IACpDosK,GAAkBpsK,cAAc6H,QAAU,CACzChxF,MAAO,CACN,OACA,SACA,gBACA,OACA,kBACA,OACA,eACA,eACA,WACA,cACA,aACA,IACA,qBACA,OACA,OACA,gCACA,UACA,gB,kBzQ9DF","sources":["webpack://OPEditor/webpack/universalModuleDefinition","webpack://OPEditor/./node_modules/markdown-it-task-lists/index.js","webpack://OPEditor/./node_modules/lz-string/libs/lz-string.js","webpack://OPEditor/webpack/bootstrap","webpack://OPEditor/webpack/runtime/compat get default export","webpack://OPEditor/webpack/runtime/define property getters","webpack://OPEditor/webpack/runtime/hasOwnProperty shorthand","webpack://OPEditor/webpack/runtime/make namespace object","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isObject.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isString.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/getTag.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/tags.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isPrimitive.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isTypedArray.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/object/cloneDeepWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isElement.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isFunction.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isLength.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/mergeWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/object/clone.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/function/noop.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/merge.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-utils/dist/index.js","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/toKey.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/toString.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/toPath.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/get.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/isKey.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/updateWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/set.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/toFinite.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/toNumber.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/times.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/toInteger.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/keysIn.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isBuffer.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/assignIn.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/function/debounce.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/function/debounce.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/function/after.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isPlainObject.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isEqualWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isEqualWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/predicate/isEqual.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/clone.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isArray.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-engine/dist/index.js","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/function/throttle.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-core/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-icons/dist/index.js","webpack://OPEditor/./node_modules/color-parse/node_modules/color-name/index.js","webpack://OPEditor/./node_modules/color-parse/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/utils/math.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/utils/convert.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/utils/compare.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/utils/dom.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/components/slider.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/components/hue.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/components/saturation.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/styles/color-picker.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/components/color-picker.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/styles/hue.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/styles/saturation.js","webpack://OPEditor/./node_modules/vanilla-colorful/lib/entrypoints/hex.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-ui/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-editor-decoupled/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-typing/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-enter/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-widget/dist/index.js","webpack://OPEditor/./src/plugins/op-macro-toc-plugin.js","webpack://OPEditor/./src/plugins/op-macro-embedded-table/utils.js","webpack://OPEditor/./src/plugins/op-context/op-context.js","webpack://OPEditor/./src/plugins/op-macro-embedded-table/embedded-table-editing.js","webpack://OPEditor/./src/helpers/create-toolbar-edit-button.js","webpack://OPEditor/./src/icons/edit.svg","webpack://OPEditor/./src/helpers/create-toolbar.js","webpack://OPEditor/./src/plugins/op-macro-embedded-table/embedded-table-toolbar.js","webpack://OPEditor/./src/plugins/op-macro-wp-button/utils.js","webpack://OPEditor/./src/plugins/op-macro-wp-button/op-macro-wp-button-editing.js","webpack://OPEditor/./src/plugins/op-macro-wp-button/op-macro-wp-button-toolbar.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-upload/dist/index.js","webpack://OPEditor/./src/plugins/op-upload-resource-adapter.js","webpack://OPEditor/./node_modules/es-toolkit/dist/function/identity.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/matches.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/object/cloneDeep.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/has.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/util/iteratee.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/property.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/object/mapValues.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/object/mapValues.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-undo/dist/index.js","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/function/identity.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-image/dist/index.js","webpack://OPEditor/./src/plugins/op-macro-child-pages/utils.js","webpack://OPEditor/./src/plugins/op-macro-child-pages/op-macro-child-pages-editing.js","webpack://OPEditor/./src/plugins/op-macro-child-pages/op-macro-child-pages-toolbar.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-select-all/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-heading/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-link/dist/index.js","webpack://OPEditor/./node_modules/es-toolkit/dist/compat/string/upperFirst.mjs","webpack://OPEditor/./node_modules/es-toolkit/dist/string/upperFirst.mjs","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-font/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-list/dist/index.js","webpack://OPEditor/./src/icons/code-block.svg","webpack://OPEditor/./src/plugins/code-block/widget.js","webpack://OPEditor/./src/plugins/code-block/click-observer.js","webpack://OPEditor/./src/plugins/code-block/code-block-editing.js","webpack://OPEditor/./src/plugins/code-block/converters.js","webpack://OPEditor/./src/plugins/code-block/code-block-toolbar.js","webpack://OPEditor/./src/helpers/button-disabler.js","webpack://OPEditor/./node_modules/@rails/request.js/src/fetch_response.js","webpack://OPEditor/./node_modules/@rails/request.js/src/request_interceptor.js","webpack://OPEditor/./node_modules/@rails/request.js/src/lib/utils.js","webpack://OPEditor/./node_modules/@rails/request.js/src/fetch_request.js","webpack://OPEditor/./node_modules/@rails/request.js/src/verbs.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-table/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js","webpack://OPEditor/./node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js","webpack://OPEditor/./node_modules/turndown/lib/turndown.browser.es.js","webpack://OPEditor/./src/commonmark/utils/preprocessor.js","webpack://OPEditor/./src/commonmark/utils/page-breaks.js","webpack://OPEditor/./node_modules/mdurl/lib/decode.mjs","webpack://OPEditor/./node_modules/mdurl/lib/encode.mjs","webpack://OPEditor/./node_modules/mdurl/lib/format.mjs","webpack://OPEditor/./node_modules/mdurl/lib/parse.mjs","webpack://OPEditor/./node_modules/uc.micro/categories/P/regex.mjs","webpack://OPEditor/./node_modules/uc.micro/categories/S/regex.mjs","webpack://OPEditor/./node_modules/uc.micro/properties/Any/regex.mjs","webpack://OPEditor/./node_modules/uc.micro/categories/Cc/regex.mjs","webpack://OPEditor/./node_modules/uc.micro/categories/Cf/regex.mjs","webpack://OPEditor/./node_modules/uc.micro/categories/Z/regex.mjs","webpack://OPEditor/./node_modules/entities/lib/esm/generated/decode-data-html.js","webpack://OPEditor/./node_modules/entities/lib/esm/generated/decode-data-xml.js","webpack://OPEditor/./node_modules/entities/lib/esm/decode_codepoint.js","webpack://OPEditor/./node_modules/entities/lib/esm/decode.js","webpack://OPEditor/./node_modules/entities/lib/esm/generated/encode-html.js","webpack://OPEditor/./node_modules/entities/lib/esm/escape.js","webpack://OPEditor/./node_modules/entities/lib/esm/index.js","webpack://OPEditor/./node_modules/markdown-it/lib/common/utils.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/helpers/parse_link_label.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/helpers/parse_link_destination.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/helpers/parse_link_title.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/renderer.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/ruler.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/token.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/state_core.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/normalize.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/linkify.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/replacements.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/smartquotes.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/parser_core.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/block.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/inline.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_core/text_join.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/state_block.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/table.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/list.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/common/html_blocks.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/common/html_re.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/html_block.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/parser_block.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/code.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/fence.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/blockquote.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/hr.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/reference.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/heading.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/lheading.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_block/paragraph.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/state_inline.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/text.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/linkify.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/escape.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/strikethrough.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/emphasis.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/autolink.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/entity.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/parser_inline.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/newline.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/backticks.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/link.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/image.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/html_inline.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/rules_inline/fragments_join.mjs","webpack://OPEditor/./node_modules/linkify-it/index.mjs","webpack://OPEditor/./node_modules/linkify-it/lib/re.mjs","webpack://OPEditor/./node_modules/punycode.js/punycode.es6.js","webpack://OPEditor/./node_modules/markdown-it/lib/index.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/presets/default.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/presets/zero.mjs","webpack://OPEditor/./node_modules/markdown-it/lib/presets/commonmark.mjs","webpack://OPEditor/./src/commonmark/commonmarkdataprocessor.js","webpack://OPEditor/./src/commonmark/utils/fix-tasklist-whitespaces.js","webpack://OPEditor/./src/commonmark/utils/fix-breaks.js","webpack://OPEditor/./src/commonmark/utils/hoist-task-list-checkboxes.js","webpack://OPEditor/./src/icons/source.svg","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-mention/dist/index.js","webpack://OPEditor/./src/plugins/op-macro-wp-quickinfo/predicate.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-page-break/dist/index.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-autosave/dist/index.js","webpack://OPEditor/./src/plugins/op-content-revisions/utils.js","webpack://OPEditor/./src/plugins/op-content-revisions/storage.js","webpack://OPEditor/./src/plugins/op-content-revisions/ui.js","webpack://OPEditor/./src/icons/revisions.svg","webpack://OPEditor/./src/plugins/op-content-revisions/command.js","webpack://OPEditor/./src/plugins/op-content-revisions/op-content-revisions.js","webpack://OPEditor/./src/plugins/op-macro-wp-quickinfo/op-macro-wp-quickinfo-plugin.js","webpack://OPEditor/./src/plugins/op-macro-wiki-page-link/op-macro-wiki-page-link-plugin.js","webpack://OPEditor/./src/op-plugins.js","webpack://OPEditor/./src/plugins/op-macro-embedded-table/embedded-table-plugin.js","webpack://OPEditor/./src/plugins/op-macro-wp-button/op-macro-wp-button-plugin.js","webpack://OPEditor/./src/plugins/op-macro-child-pages/op-macro-child-pages-plugin.js","webpack://OPEditor/./src/plugins/op-upload-plugin.js","webpack://OPEditor/./src/plugins/op-attachment-listener-plugin.js","webpack://OPEditor/./node_modules/@ckeditor/ckeditor5-essentials/dist/index.js","webpack://OPEditor/./src/plugins/op-image-attachment-lookup/op-image-attachment-lookup-plugin.js","webpack://OPEditor/./src/mentions/mentions-caster.js","webpack://OPEditor/./src/plugins/op-help-link-plugin/op-help-link-plugin.js","webpack://OPEditor/./src/icons/help.svg","webpack://OPEditor/./src/plugins/op-preview.plugin.js","webpack://OPEditor/./src/icons/preview.svg","webpack://OPEditor/./src/plugins/op-source-code.plugin.js","webpack://OPEditor/./src/icons/wysiwyg.svg","webpack://OPEditor/./src/plugins/code-block/code-block.js","webpack://OPEditor/./src/commonmark/commonmark.js","webpack://OPEditor/./src/plugins/op-macro-list-plugin.js","webpack://OPEditor/./src/plugins/op-custom-css-classes-plugin.js","webpack://OPEditor/./src/mentions/work-package-mentions.js","webpack://OPEditor/./src/mentions/mentions-item-renderer.js","webpack://OPEditor/./src/op-ckeditor-config.js","webpack://OPEditor/./src/mentions/user-mentions.js","webpack://OPEditor/./src/mentions/emoji-mentions.js","webpack://OPEditor/./src/op-config-customizer.js","webpack://OPEditor/./src/op-ckeditor.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OPEditor\"] = factory();\n\telse\n\t\troot[\"OPEditor\"] = factory();\n})(self, () => {\nreturn ","// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-task-lists-in-all-markdown-documents\n\nvar disableCheckboxes = true;\nvar useLabelWrapper = false;\nvar useLabelAfter = false;\n\nmodule.exports = function(md, options) {\n\tif (options) {\n\t\tdisableCheckboxes = !options.enabled;\n\t\tuseLabelWrapper = !!options.label;\n\t\tuseLabelAfter = !!options.labelAfter;\n\t}\n\n\tmd.core.ruler.after('inline', 'github-task-lists', function(state) {\n\t\tvar tokens = state.tokens;\n\t\tfor (var i = 2; i < tokens.length; i++) {\n\t\t\tif (isTodoItem(tokens, i)) {\n\t\t\t\ttodoify(tokens[i], state.Token);\n\t\t\t\tattrSet(tokens[i-2], 'class', 'task-list-item' + (!disableCheckboxes ? ' enabled' : ''));\n\t\t\t\tattrSet(tokens[parentToken(tokens, i-2)], 'class', 'contains-task-list');\n\t\t\t}\n\t\t}\n\t});\n};\n\nfunction attrSet(token, name, value) {\n\tvar index = token.attrIndex(name);\n\tvar attr = [name, value];\n\n\tif (index < 0) {\n\t\ttoken.attrPush(attr);\n\t} else {\n\t\ttoken.attrs[index] = attr;\n\t}\n}\n\nfunction parentToken(tokens, index) {\n\tvar targetLevel = tokens[index].level - 1;\n\tfor (var i = index - 1; i >= 0; i--) {\n\t\tif (tokens[i].level === targetLevel) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction isTodoItem(tokens, index) {\n\treturn isInline(tokens[index]) &&\n\t isParagraph(tokens[index - 1]) &&\n\t isListItem(tokens[index - 2]) &&\n\t startsWithTodoMarkdown(tokens[index]);\n}\n\nfunction todoify(token, TokenConstructor) {\n\ttoken.children.unshift(makeCheckbox(token, TokenConstructor));\n\ttoken.children[1].content = token.children[1].content.slice(3);\n\ttoken.content = token.content.slice(3);\n\n\tif (useLabelWrapper) {\n\t\tif (useLabelAfter) {\n\t\t\ttoken.children.pop();\n\n\t\t\t// Use large random number as id property of the checkbox.\n\t\t\tvar id = 'task-item-' + Math.ceil(Math.random() * (10000 * 1000) - 1000);\n\t\t\ttoken.children[0].content = token.children[0].content.slice(0, -1) + ' id=\"' + id + '\">';\n\t\t\ttoken.children.push(afterLabel(token.content, id, TokenConstructor));\n\t\t} else {\n\t\t\ttoken.children.unshift(beginLabel(TokenConstructor));\n\t\t\ttoken.children.push(endLabel(TokenConstructor));\n\t\t}\n\t}\n}\n\nfunction makeCheckbox(token, TokenConstructor) {\n\tvar checkbox = new TokenConstructor('html_inline', '', 0);\n\tvar disabledAttr = disableCheckboxes ? ' disabled=\"\" ' : '';\n\tif (token.content.indexOf('[ ] ') === 0) {\n\t\tcheckbox.content = '';\n\t} else if (token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0) {\n\t\tcheckbox.content = '';\n\t}\n\treturn checkbox;\n}\n\n// these next two functions are kind of hacky; probably should really be a\n// true block-level token with .tag=='label'\nfunction beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '';\n\treturn token;\n}\n\nfunction afterLabel(content, id, TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '';\n\ttoken.attrs = [{for: id}];\n\treturn token;\n}\n\nfunction isInline(token) { return token.type === 'inline'; }\nfunction isParagraph(token) { return token.type === 'paragraph_open'; }\nfunction isListItem(token) { return token.type === 'list_item_open'; }\n\nfunction startsWithTodoMarkdown(token) {\n\t// leading whitespace in a list item is already trimmed off by markdown-it\n\treturn token.content.indexOf('[ ] ') === 0 || token.content.indexOf('[x] ') === 0 || token.content.indexOf('[X] ') === 0;\n}\n","// Copyright (c) 2013 Pieroxy \n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function isObject(value) {\n return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nexport { isObject };\n","function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport { isString };\n","function isPlainObject(object) {\n if (typeof object !== 'object') {\n return false;\n }\n if (object == null) {\n return false;\n }\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n if (Object.prototype.toString.call(object) !== '[object Object]') {\n const tag = object[Symbol.toStringTag];\n if (tag == null) {\n return false;\n }\n const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;\n if (isTagReadonly) {\n return false;\n }\n return object.toString() === `[object ${tag}]`;\n }\n let proto = object;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(object) === proto;\n}\n\nexport { isPlainObject };\n","function getSymbols(object) {\n return Object.getOwnPropertySymbols(object).filter(symbol => Object.prototype.propertyIsEnumerable.call(object, symbol));\n}\n\nexport { getSymbols };\n","function getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n\nexport { getTag };\n","const regexpTag = '[object RegExp]';\nconst stringTag = '[object String]';\nconst numberTag = '[object Number]';\nconst booleanTag = '[object Boolean]';\nconst argumentsTag = '[object Arguments]';\nconst symbolTag = '[object Symbol]';\nconst dateTag = '[object Date]';\nconst mapTag = '[object Map]';\nconst setTag = '[object Set]';\nconst arrayTag = '[object Array]';\nconst functionTag = '[object Function]';\nconst arrayBufferTag = '[object ArrayBuffer]';\nconst objectTag = '[object Object]';\nconst errorTag = '[object Error]';\nconst dataViewTag = '[object DataView]';\nconst uint8ArrayTag = '[object Uint8Array]';\nconst uint8ClampedArrayTag = '[object Uint8ClampedArray]';\nconst uint16ArrayTag = '[object Uint16Array]';\nconst uint32ArrayTag = '[object Uint32Array]';\nconst bigUint64ArrayTag = '[object BigUint64Array]';\nconst int8ArrayTag = '[object Int8Array]';\nconst int16ArrayTag = '[object Int16Array]';\nconst int32ArrayTag = '[object Int32Array]';\nconst bigInt64ArrayTag = '[object BigInt64Array]';\nconst float32ArrayTag = '[object Float32Array]';\nconst float64ArrayTag = '[object Float64Array]';\n\nexport { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };\n","function isPrimitive(value) {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\nexport { isPrimitive };\n","function isTypedArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\nexport { isTypedArray };\n","import { getSymbols } from '../compat/_internal/getSymbols.mjs';\nimport { getTag } from '../compat/_internal/getTag.mjs';\nimport { uint32ArrayTag, uint16ArrayTag, uint8ClampedArrayTag, uint8ArrayTag, symbolTag, stringTag, setTag, regexpTag, objectTag, numberTag, mapTag, int32ArrayTag, int16ArrayTag, int8ArrayTag, float64ArrayTag, float32ArrayTag, dateTag, booleanTag, dataViewTag, arrayBufferTag, arrayTag, argumentsTag } from '../compat/_internal/tags.mjs';\nimport { isPrimitive } from '../predicate/isPrimitive.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction cloneDeepWith(obj, cloneValue) {\n return cloneDeepWithImpl(obj, undefined, obj, new Map(), cloneValue);\n}\nfunction cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = new Map(), cloneValue = undefined) {\n const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);\n if (cloned !== undefined) {\n return cloned;\n }\n if (isPrimitive(valueToClone)) {\n return valueToClone;\n }\n if (stack.has(valueToClone)) {\n return stack.get(valueToClone);\n }\n if (Array.isArray(valueToClone)) {\n const result = new Array(valueToClone.length);\n stack.set(valueToClone, result);\n for (let i = 0; i < valueToClone.length; i++) {\n result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n }\n if (Object.hasOwn(valueToClone, 'index')) {\n result.index = valueToClone.index;\n }\n if (Object.hasOwn(valueToClone, 'input')) {\n result.input = valueToClone.input;\n }\n return result;\n }\n if (valueToClone instanceof Date) {\n return new Date(valueToClone.getTime());\n }\n if (valueToClone instanceof RegExp) {\n const result = new RegExp(valueToClone.source, valueToClone.flags);\n result.lastIndex = valueToClone.lastIndex;\n return result;\n }\n if (valueToClone instanceof Map) {\n const result = new Map();\n stack.set(valueToClone, result);\n for (const [key, value] of valueToClone) {\n result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));\n }\n return result;\n }\n if (valueToClone instanceof Set) {\n const result = new Set();\n stack.set(valueToClone, result);\n for (const value of valueToClone) {\n result.add(cloneDeepWithImpl(value, undefined, objectToClone, stack, cloneValue));\n }\n return result;\n }\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer(valueToClone)) {\n return valueToClone.subarray();\n }\n if (isTypedArray(valueToClone)) {\n const result = new (Object.getPrototypeOf(valueToClone).constructor)(valueToClone.length);\n stack.set(valueToClone, result);\n for (let i = 0; i < valueToClone.length; i++) {\n result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n }\n return result;\n }\n if (valueToClone instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && valueToClone instanceof SharedArrayBuffer)) {\n return valueToClone.slice(0);\n }\n if (valueToClone instanceof DataView) {\n const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (typeof File !== 'undefined' && valueToClone instanceof File) {\n const result = new File([valueToClone], valueToClone.name, {\n type: valueToClone.type,\n });\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (typeof Blob !== 'undefined' && valueToClone instanceof Blob) {\n const result = new Blob([valueToClone], { type: valueToClone.type });\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof Error) {\n const result = structuredClone(valueToClone);\n stack.set(valueToClone, result);\n result.message = valueToClone.message;\n result.name = valueToClone.name;\n result.stack = valueToClone.stack;\n result.cause = valueToClone.cause;\n result.constructor = valueToClone.constructor;\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof Boolean) {\n const result = new Boolean(valueToClone.valueOf());\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof Number) {\n const result = new Number(valueToClone.valueOf());\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof String) {\n const result = new String(valueToClone.valueOf());\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (typeof valueToClone === 'object' && isCloneableObject(valueToClone)) {\n const result = Object.create(Object.getPrototypeOf(valueToClone));\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n return valueToClone;\n}\nfunction copyProperties(target, source, objectToClone = target, stack, cloneValue) {\n const keys = [...Object.keys(source), ...getSymbols(source)];\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const descriptor = Object.getOwnPropertyDescriptor(target, key);\n if (descriptor == null || descriptor.writable) {\n target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);\n }\n }\n}\nfunction isCloneableObject(object) {\n switch (getTag(object)) {\n case argumentsTag:\n case arrayTag:\n case arrayBufferTag:\n case dataViewTag:\n case booleanTag:\n case dateTag:\n case float32ArrayTag:\n case float64ArrayTag:\n case int8ArrayTag:\n case int16ArrayTag:\n case int32ArrayTag:\n case mapTag:\n case numberTag:\n case objectTag:\n case regexpTag:\n case setTag:\n case stringTag:\n case symbolTag:\n case uint8ArrayTag:\n case uint8ClampedArrayTag:\n case uint16ArrayTag:\n case uint32ArrayTag: {\n return true;\n }\n default: {\n return false;\n }\n }\n}\n\nexport { cloneDeepWith, cloneDeepWithImpl, copyProperties };\n","import { cloneDeepWith as cloneDeepWith$1, copyProperties } from '../../object/cloneDeepWith.mjs';\nimport { getTag } from '../_internal/getTag.mjs';\nimport { objectTag, argumentsTag, booleanTag, stringTag, numberTag } from '../_internal/tags.mjs';\n\nfunction cloneDeepWith(obj, customizer) {\n return cloneDeepWith$1(obj, (value, key, object, stack) => {\n const cloned = customizer?.(value, key, object, stack);\n if (cloned !== undefined) {\n return cloned;\n }\n if (typeof obj !== 'object') {\n return undefined;\n }\n if (getTag(obj) === objectTag && typeof obj.constructor !== 'function') {\n const result = {};\n stack.set(obj, result);\n copyProperties(result, obj, object, stack);\n return result;\n }\n switch (Object.prototype.toString.call(obj)) {\n case numberTag:\n case stringTag:\n case booleanTag: {\n const result = new obj.constructor(obj?.valueOf());\n copyProperties(result, obj);\n return result;\n }\n case argumentsTag: {\n const result = {};\n copyProperties(result, obj);\n result.length = obj.length;\n result[Symbol.iterator] = obj[Symbol.iterator];\n return result;\n }\n default: {\n return undefined;\n }\n }\n });\n}\n\nexport { cloneDeepWith };\n","function isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\n\nexport { isObjectLike };\n","import { isObjectLike } from './isObjectLike.mjs';\nimport { isPlainObject } from './isPlainObject.mjs';\n\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport { isElement };\n","function isFunction(value) {\n return typeof value === 'function';\n}\n\nexport { isFunction };\n","import { cloneDeepWith } from './cloneDeepWith.mjs';\n\nfunction cloneDeep(obj) {\n return cloneDeepWith(obj);\n}\n\nexport { cloneDeep };\n","function isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexport { isUnsafeProperty };\n","import { getTag } from '../_internal/getTag.mjs';\n\nfunction isArguments(value) {\n return value !== null && typeof value === 'object' && getTag(value) === '[object Arguments]';\n}\n\nexport { isArguments };\n","import { isLength } from '../../predicate/isLength.mjs';\n\nfunction isArrayLike(value) {\n return value != null && typeof value !== 'function' && isLength(value.length);\n}\n\nexport { isArrayLike };\n","function isLength(value) {\n return Number.isSafeInteger(value) && value >= 0;\n}\n\nexport { isLength };\n","import { isTypedArray as isTypedArray$1 } from '../../predicate/isTypedArray.mjs';\n\nfunction isTypedArray(x) {\n return isTypedArray$1(x);\n}\n\nexport { isTypedArray };\n","import { cloneDeep } from './cloneDeep.mjs';\nimport { isUnsafeProperty } from '../../_internal/isUnsafeProperty.mjs';\nimport { clone } from '../../object/clone.mjs';\nimport { isPrimitive } from '../../predicate/isPrimitive.mjs';\nimport { getSymbols } from '../_internal/getSymbols.mjs';\nimport { isArguments } from '../predicate/isArguments.mjs';\nimport { isArrayLikeObject } from '../predicate/isArrayLikeObject.mjs';\nimport { isObjectLike } from '../predicate/isObjectLike.mjs';\nimport { isPlainObject } from '../predicate/isPlainObject.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction mergeWith(object, ...otherArgs) {\n const sources = otherArgs.slice(0, -1);\n const merge = otherArgs[otherArgs.length - 1];\n let result = object;\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n result = mergeWithDeep(result, source, merge, new Map());\n }\n return result;\n}\nfunction mergeWithDeep(target, source, merge, stack) {\n if (isPrimitive(target)) {\n target = Object(target);\n }\n if (source == null || typeof source !== 'object') {\n return target;\n }\n if (stack.has(source)) {\n return clone(stack.get(source));\n }\n stack.set(source, target);\n if (Array.isArray(source)) {\n source = source.slice();\n for (let i = 0; i < source.length; i++) {\n source[i] = source[i] ?? undefined;\n }\n }\n const sourceKeys = [...Object.keys(source), ...getSymbols(source)];\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n if (isUnsafeProperty(key)) {\n continue;\n }\n let sourceValue = source[key];\n let targetValue = target[key];\n if (isArguments(sourceValue)) {\n sourceValue = { ...sourceValue };\n }\n if (isArguments(targetValue)) {\n targetValue = { ...targetValue };\n }\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer(sourceValue)) {\n sourceValue = cloneDeep(sourceValue);\n }\n if (Array.isArray(sourceValue)) {\n if (Array.isArray(targetValue)) {\n const cloned = [];\n const targetKeys = Reflect.ownKeys(targetValue);\n for (let i = 0; i < targetKeys.length; i++) {\n const targetKey = targetKeys[i];\n cloned[targetKey] = targetValue[targetKey];\n }\n targetValue = cloned;\n }\n else if (isArrayLikeObject(targetValue)) {\n const cloned = [];\n for (let i = 0; i < targetValue.length; i++) {\n cloned[i] = targetValue[i];\n }\n targetValue = cloned;\n }\n else {\n targetValue = [];\n }\n }\n const merged = merge(targetValue, sourceValue, key, target, source, stack);\n if (merged !== undefined) {\n target[key] = merged;\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);\n }\n else if (isObjectLike(targetValue) &&\n isObjectLike(sourceValue) &&\n (isPlainObject(targetValue) ||\n isPlainObject(sourceValue) ||\n isTypedArray(targetValue) ||\n isTypedArray(sourceValue))) {\n target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);\n }\n else if (targetValue == null && isPlainObject(sourceValue)) {\n target[key] = mergeWithDeep({}, sourceValue, merge, stack);\n }\n else if (targetValue == null && isTypedArray(sourceValue)) {\n target[key] = cloneDeep(sourceValue);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\n\nexport { mergeWith };\n","import { isPrimitive } from '../predicate/isPrimitive.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction clone(obj) {\n if (isPrimitive(obj)) {\n return obj;\n }\n if (Array.isArray(obj) ||\n isTypedArray(obj) ||\n obj instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && obj instanceof SharedArrayBuffer)) {\n return obj.slice(0);\n }\n const prototype = Object.getPrototypeOf(obj);\n if (prototype == null) {\n return Object.assign(Object.create(prototype), obj);\n }\n const Constructor = prototype.constructor;\n if (obj instanceof Date || obj instanceof Map || obj instanceof Set) {\n return new Constructor(obj);\n }\n if (obj instanceof RegExp) {\n const newRegExp = new Constructor(obj);\n newRegExp.lastIndex = obj.lastIndex;\n return newRegExp;\n }\n if (obj instanceof DataView) {\n return new Constructor(obj.buffer.slice(0));\n }\n if (obj instanceof Error) {\n let newError;\n if (obj instanceof AggregateError) {\n newError = new Constructor(obj.errors, obj.message, { cause: obj.cause });\n }\n else {\n newError = new Constructor(obj.message, { cause: obj.cause });\n }\n newError.stack = obj.stack;\n Object.assign(newError, obj);\n return newError;\n }\n if (typeof File !== 'undefined' && obj instanceof File) {\n const newFile = new Constructor([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });\n return newFile;\n }\n if (typeof obj === 'object') {\n const newObject = Object.create(prototype);\n return Object.assign(newObject, obj);\n }\n return obj;\n}\n\nexport { clone };\n","import { isArrayLike } from './isArrayLike.mjs';\nimport { isObjectLike } from './isObjectLike.mjs';\n\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport { isArrayLikeObject };\n","function noop() { }\n\nexport { noop };\n","import { mergeWith } from './mergeWith.mjs';\nimport { noop } from '../../function/noop.mjs';\n\nfunction merge(object, ...sources) {\n return mergeWith(object, ...sources, noop);\n}\n\nexport { merge };\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\nimport { isObject as isObject$1, isString, isPlainObject, cloneDeepWith, isElement as isElement$1, isFunction, merge } from 'es-toolkit/compat';\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/global\n */ // This interface exists to make our API pages more readable.\n/**\n * A helper (module) giving an access to the global DOM objects such as `window` and `document`.\n */ /**\n * A helper (module) giving an access to the global DOM objects such as `window` and\n * `document`. Accessing these objects using this helper allows easy and bulletproof\n * testing, i.e. stubbing native properties:\n *\n * ```ts\n * import { global } from 'ckeditor5';\n *\n * // This stub will work for any code using global module.\n * testUtils.sinon.stub( global, 'window', {\n * \tinnerWidth: 10000\n * } );\n *\n * console.log( global.window.innerWidth );\n * ```\n */ let globalVar; // named globalVar instead of global: https://github.com/ckeditor/ckeditor5/issues/12971\n// In some environments window and document API might not be available.\ntry {\n globalVar = {\n window,\n document\n };\n} catch {\n // It's not possible to mock a window object to simulate lack of a window object without writing extremely convoluted code.\n /* istanbul ignore next -- @preserve */ // Let's cast it to not change module's API.\n // We only handle this so loading editor in environments without window and document doesn't fail.\n // For better DX we shouldn't introduce mixed types and require developers to check the type manually.\n // This module should not be used on purpose in any environment outside browser.\n globalVar = {\n window: {},\n document: {}\n };\n}\n\n/**\n * Safely returns `userAgent` from browser's navigator API in a lower case.\n * If navigator API is not available it will return an empty string.\n *\n * @internal\n */ function getUserAgent() {\n // In some environments navigator API might not be available.\n try {\n return navigator.userAgent.toLowerCase();\n } catch {\n return '';\n }\n}\nconst userAgent = /* #__PURE__ */ getUserAgent();\n/**\n * A namespace containing environment and browser information.\n */ const env = {\n isMac: /* #__PURE__ */ isMac(userAgent),\n isWindows: /* #__PURE__ */ isWindows(userAgent),\n isGecko: /* #__PURE__ */ isGecko(userAgent),\n isSafari: /* #__PURE__ */ isSafari(userAgent),\n isiOS: /* #__PURE__ */ isiOS(userAgent),\n isAndroid: /* #__PURE__ */ isAndroid(userAgent),\n isBlink: /* #__PURE__ */ isBlink(userAgent),\n get isMediaForcedColors () {\n return isMediaForcedColors();\n },\n get isMotionReduced () {\n return isMotionReduced();\n },\n features: {\n isRegExpUnicodePropertySupported: /* #__PURE__ */ isRegExpUnicodePropertySupported()\n }\n};\n/**\n * Checks if User Agent represented by the string is running on Macintosh.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Macintosh or not.\n */ function isMac(userAgent) {\n return userAgent.indexOf('macintosh') > -1;\n}\n/**\n * Checks if User Agent represented by the string is running on Windows.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Windows or not.\n */ function isWindows(userAgent) {\n return userAgent.indexOf('windows') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Firefox (Gecko).\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Firefox or not.\n */ function isGecko(userAgent) {\n return !!userAgent.match(/gecko\\/\\d+/);\n}\n/**\n * Checks if User Agent represented by the string is Safari.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */ function isSafari(userAgent) {\n return userAgent.indexOf(' applewebkit/') > -1 && userAgent.indexOf('chrome') === -1;\n}\n/**\n * Checks if User Agent represented by the string is running in iOS.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running in iOS or not.\n */ function isiOS(userAgent) {\n // \"Request mobile site\" || \"Request desktop site\".\n return !!userAgent.match(/iphone|ipad/i) || isMac(userAgent) && navigator.maxTouchPoints > 0;\n}\n/**\n * Checks if User Agent represented by the string is Android mobile device.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */ function isAndroid(userAgent) {\n return userAgent.indexOf('android') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Blink engine.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Blink engine or not.\n */ function isBlink(userAgent) {\n // The Edge browser before switching to the Blink engine used to report itself as Chrome (and \"Edge/\")\n // but after switching to the Blink it replaced \"Edge/\" with \"Edg/\".\n return userAgent.indexOf('chrome/') > -1 && userAgent.indexOf('edge/') < 0;\n}\n/**\n * Checks if the current environment supports ES2018 Unicode properties like `\\p{P}` or `\\p{L}`.\n * More information about unicode properties might be found\n * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).\n *\n * @internal\n */ function isRegExpUnicodePropertySupported() {\n let isSupported = false;\n // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.\n // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.\n try {\n // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).\n isSupported = 'ć'.search(new RegExp('[\\\\p{L}]', 'u')) === 0;\n } catch {\n // Firefox throws a SyntaxError when the group is unsupported.\n }\n return isSupported;\n}\n/**\n * Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).\n *\n * Returns `false` in environments where `window` global object is not available.\n *\n * @internal\n */ function isMediaForcedColors() {\n return globalVar.window.matchMedia ? globalVar.window.matchMedia('(forced-colors: active)').matches : false;\n}\n/**\n * Checks if the user enabled \"prefers reduced motion\" setting in browser.\n *\n * Returns `false` in environments where `window` global object is not available.\n *\n * @internal\n */ function isMotionReduced() {\n return globalVar.window.matchMedia ? globalVar.window.matchMedia('(prefers-reduced-motion)').matches : false;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/fastdiff\n */ /**\n * Finds positions of the first and last change in the given string/array and generates a set of changes:\n *\n * ```ts\n * fastDiff( '12a', '12xyza' );\n * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]\n *\n * fastDiff( '12a', '12aa' );\n * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]\n *\n * fastDiff( '12xyza', '12a' );\n * // [ { index: 2, type: 'delete', howMany: 3 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );\n * // [ { index: 3, type: 'delete', howMany: 1 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );\n * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]\n * ```\n *\n * Passed arrays can contain any type of data, however to compare them correctly custom comparator function\n * should be passed as a third parameter:\n *\n * ```ts\n * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {\n * \treturn a.value === b.value;\n * } );\n * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]\n * ```\n *\n * The resulted set of changes can be applied to the input in order to transform it into the output, for example:\n *\n * ```ts\n * let input = '12abc3';\n * const output = '2ab';\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * or in case of arrays:\n *\n * ```ts\n * let input = [ '1', '2', 'a', 'b', 'c', '3' ];\n * const output = [ '2', 'a', 'b' ];\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with\n * the {@link module:utils/diff~diff `diff()`} function:\n *\n * ```ts\n * fastDiff( '12a', '12xyza', undefined, true );\n * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]\n * ```\n *\n * The default output format of this function is compatible with the output format of\n * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,\n * compatible with the output of {@link module:utils/diff~diff `diff()`}:\n *\n * ```ts\n * const a = '1234';\n * const b = '12xyz34';\n *\n * // Both calls will return the same results (grouped changes format).\n * fastDiff( a, b );\n * diffToChanges( diff( a, b ) );\n *\n * // Again, both calls will return the same results (atomic changes format).\n * fastDiff( a, b, undefined, true );\n * diff( a, b );\n * ```\n *\n * @typeParam T The type of array elements.\n * @typeParam AtomicChanges The type of `atomicChanges` parameter (selects the result type).\n * @param a Input array or string.\n * @param b Input array or string.\n * @param cmp Optional function used to compare array values, by default `===` (strict equal operator) is used.\n * @param atomicChanges Whether an array of `inset|delete|equal` operations should\n * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.\n * Defaults to `false`.\n * @returns Array of changes. The elements are either {@link module:utils/diff~DiffResult} or {@link module:utils/difftochanges~Change},\n * depending on `atomicChanges` parameter.\n */ function fastDiff(a, b, cmp, atomicChanges) {\n // Set the comparator function.\n cmp = cmp || function(a, b) {\n return a === b;\n };\n // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,\n // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.\n // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.\n // See ckeditor/ckeditor5#3147.\n //\n // We need to make sure here that fastDiff() works identical to diff().\n const arrayA = Array.isArray(a) ? a : Array.prototype.slice.call(a);\n const arrayB = Array.isArray(b) ? b : Array.prototype.slice.call(b);\n // Find first and last change.\n const changeIndexes = findChangeBoundaryIndexes(arrayA, arrayB, cmp);\n // Transform into changes array.\n const result = atomicChanges ? changeIndexesToAtomicChanges(changeIndexes, arrayB.length) : changeIndexesToChanges(arrayB, changeIndexes);\n return result;\n}\n/**\n * Finds position of the first and last change in the given arrays. For example:\n *\n * ```ts\n * const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );\n * console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }\n * ```\n *\n * The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.\n * Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one\n * can be generated.\n */ function findChangeBoundaryIndexes(arr1, arr2, cmp) {\n // Find the first difference between passed values.\n const firstIndex = findFirstDifferenceIndex(arr1, arr2, cmp);\n // If arrays are equal return -1 indexes object.\n if (firstIndex === -1) {\n return {\n firstIndex: -1,\n lastIndexOld: -1,\n lastIndexNew: -1\n };\n }\n // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.\n const oldArrayReversed = cutAndReverse(arr1, firstIndex);\n const newArrayReversed = cutAndReverse(arr2, firstIndex);\n // Find the first difference between reversed values.\n // It should be treated as \"how many elements from the end the last difference occurred\".\n //\n // For example:\n //\n // \t\t\t\tinitial\t->\tafter cut\t-> reversed:\n // oldValue:\t'321ba'\t->\t'21ba'\t\t-> 'ab12'\n // newValue:\t'31xba'\t->\t'1xba'\t\t-> 'abx1'\n // lastIndex:\t\t\t\t\t\t\t-> 2\n //\n // So the last change occurred two characters from the end of the arrays.\n const lastIndex = findFirstDifferenceIndex(oldArrayReversed, newArrayReversed, cmp);\n // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).\n const lastIndexOld = arr1.length - lastIndex;\n const lastIndexNew = arr2.length - lastIndex;\n return {\n firstIndex,\n lastIndexOld,\n lastIndexNew\n };\n}\n/**\n * Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.\n */ function findFirstDifferenceIndex(arr1, arr2, cmp) {\n for(let i = 0; i < Math.max(arr1.length, arr2.length); i++){\n if (arr1[i] === undefined || arr2[i] === undefined || !cmp(arr1[i], arr2[i])) {\n return i;\n }\n }\n return -1; // Return -1 if arrays are equal.\n}\n/**\n * Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.\n *\n * @param arr Array to be processed.\n * @param howMany How many elements from array beginning to remove.\n * @returns Shortened and reversed array.\n */ function cutAndReverse(arr, howMany) {\n return arr.slice(howMany).reverse();\n}\n/**\n * Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will\n * generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).\n *\n * @param newArray New array for which change indexes were calculated.\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @returns Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.\n */ function changeIndexesToChanges(newArray, changeIndexes) {\n const result = [];\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}\n // in most cases. However, 'diffToChanges' does not stick to any order so in some cases\n // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.\n if (lastIndexNew - firstIndex > 0) {\n result.push({\n index: firstIndex,\n type: 'insert',\n values: newArray.slice(firstIndex, lastIndexNew)\n });\n }\n if (lastIndexOld - firstIndex > 0) {\n result.push({\n index: firstIndex + (lastIndexNew - firstIndex),\n type: 'delete',\n howMany: lastIndexOld - firstIndex\n });\n }\n return result;\n}\n/**\n * Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.\n *\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @param newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.\n * @returns Array of changes compatible with {@link module:utils/diff~diff} format.\n */ function changeIndexesToAtomicChanges(changeIndexes, newLength) {\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // No changes.\n if (firstIndex === -1) {\n return Array(newLength).fill('equal');\n }\n let result = [];\n if (firstIndex > 0) {\n result = result.concat(Array(firstIndex).fill('equal'));\n }\n if (lastIndexNew - firstIndex > 0) {\n result = result.concat(Array(lastIndexNew - firstIndex).fill('insert'));\n }\n if (lastIndexOld - firstIndex > 0) {\n result = result.concat(Array(lastIndexOld - firstIndex).fill('delete'));\n }\n if (lastIndexNew < newLength) {\n result = result.concat(Array(newLength - lastIndexNew).fill('equal'));\n }\n return result;\n}\n\n// The following code is based on the \"O(NP) Sequence Comparison Algorithm\"\n// by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n/**\n * Calculates the difference between two arrays or strings producing an array containing a list of changes\n * necessary to transform input into output.\n *\n * ```ts\n * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]\n * ```\n *\n * This function is based on the \"O(NP) Sequence Comparison Algorithm\" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).\n * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting\n * such a scenario. The return formats of both functions are identical.\n *\n * @param a Input array or string.\n * @param b Output array or string.\n * @param cmp Optional function used to compare array values, by default === is used.\n * @returns Array of changes.\n */ function diff(a, b, cmp) {\n // Set the comparator function.\n cmp = cmp || function(a, b) {\n return a === b;\n };\n const aLength = a.length;\n const bLength = b.length;\n // Perform `fastDiff` for longer strings/arrays (see #269).\n if (aLength > 200 || bLength > 200 || aLength + bLength > 300) {\n return diff.fastDiff(a, b, cmp, true);\n }\n // Temporary action type statics.\n let _insert, _delete;\n // Swapped the arrays to use the shorter one as the first one.\n if (bLength < aLength) {\n const tmp = a;\n a = b;\n b = tmp;\n // We swap the action types as well.\n _insert = 'delete';\n _delete = 'insert';\n } else {\n _insert = 'insert';\n _delete = 'delete';\n }\n const m = a.length;\n const n = b.length;\n const delta = n - m;\n // Edit scripts, for each diagonal.\n const es = {};\n // Furthest points, the furthest y we can get on each diagonal.\n const fp = {};\n function snake(k) {\n // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).\n // Furthest points (y) on the diagonal below k.\n const y1 = (fp[k - 1] !== undefined ? fp[k - 1] : -1) + 1;\n // Furthest points (y) on the diagonal above k.\n const y2 = fp[k + 1] !== undefined ? fp[k + 1] : -1;\n // The way we should go to get further.\n const dir = y1 > y2 ? -1 : 1;\n // Clone previous changes array (if any).\n if (es[k + dir]) {\n es[k] = es[k + dir].slice(0);\n }\n // Create changes array.\n if (!es[k]) {\n es[k] = [];\n }\n // Push the action.\n es[k].push(y1 > y2 ? _insert : _delete);\n // Set the beginning coordinates.\n let y = Math.max(y1, y2);\n let x = y - k;\n // Traverse the diagonal as long as the values match.\n while(x < m && y < n && cmp(a[x], b[y])){\n x++;\n y++;\n // Push no change action.\n es[k].push('equal');\n }\n return y;\n }\n let p = 0;\n let k;\n // Traverse the graph until we reach the end of the longer string.\n do {\n // Updates furthest points and edit scripts for diagonals below delta.\n for(k = -p; k < delta; k++){\n fp[k] = snake(k);\n }\n // Updates furthest points and edit scripts for diagonals above delta.\n for(k = delta + p; k > delta; k--){\n fp[k] = snake(k);\n }\n // Updates furthest point and edit script for the delta diagonal.\n // note that the delta diagonal is the one which goes through the sink (m, n).\n fp[delta] = snake(delta);\n p++;\n }while (fp[delta] !== n)\n // Return the final list of edit changes.\n // We remove the first item that represents the action for the injected nulls.\n return es[delta].slice(1);\n}\n// Store the API in static property to easily overwrite it in tests.\n// Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.\ndiff.fastDiff = fastDiff;\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/difftochanges\n */ /**\n * Creates a set of changes which need to be applied to the input in order to transform\n * it into the output. This function can be used with strings or arrays.\n *\n * ```ts\n * const input = Array.from( 'abc' );\n * const output = Array.from( 'xaby' );\n * const changes = diffToChanges( diff( input, output ), output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput.splice( change.index, 0, ...change.values );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput.splice( change.index, change.howMany );\n * \t}\n * } );\n *\n * input.join( '' ) == output.join( '' ); // -> true\n * ```\n *\n * @typeParam T The type of output array element.\n * @param diff Result of {@link module:utils/diff~diff}.\n * @param output The string or array which was passed as diff's output.\n * @returns Set of changes (insert or delete) which need to be applied to the input\n * in order to transform it into the output.\n */ function diffToChanges(diff, output) {\n const changes = [];\n let index = 0;\n let lastOperation = null;\n diff.forEach((change)=>{\n if (change == 'equal') {\n pushLast();\n index++;\n } else if (change == 'insert') {\n if (lastOperation && lastOperation.type == 'insert') {\n lastOperation.values.push(output[index]);\n } else {\n pushLast();\n lastOperation = {\n type: 'insert',\n index,\n values: [\n output[index]\n ]\n };\n }\n index++;\n } else /* if ( change == 'delete' ) */ {\n if (lastOperation && lastOperation.type == 'delete') {\n lastOperation.howMany++;\n } else {\n pushLast();\n lastOperation = {\n type: 'delete',\n index,\n howMany: 1\n };\n }\n }\n });\n pushLast();\n return changes;\n function pushLast() {\n if (lastOperation) {\n changes.push(lastOperation);\n lastOperation = null;\n }\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/areconnectedthroughproperties\n */ /**\n * Traverses both structures to find out whether there is a reference that is shared between both structures.\n */ function areConnectedThroughProperties(obj1, obj2) {\n if (obj1 === obj2 && isObject(obj1)) {\n return true;\n }\n const subNodes1 = getSubNodes(obj1);\n const subNodes2 = getSubNodes(obj2);\n for (const node of subNodes1){\n if (subNodes2.has(node)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Traverses JS structure and stores all sub-nodes, including the head node.\n * It walks into each iterable structures with the `try catch` block to omit errors that might be thrown during\n * tree walking. All primitives, functions and built-ins are skipped.\n */ function getSubNodes(head) {\n const nodes = [\n head\n ];\n // Nodes are stored to prevent infinite looping.\n const subNodes = new Set();\n while(nodes.length > 0){\n const node = nodes.shift();\n if (subNodes.has(node) || shouldNodeBeSkipped(node)) {\n continue;\n }\n subNodes.add(node);\n // Handle arrays, maps, sets, custom collections that implements `[ Symbol.iterator ]()`, etc.\n if (node[Symbol.iterator]) {\n // The custom editor iterators might cause some problems if the editor is crashed.\n try {\n nodes.push(...node);\n } // eslint-disable-next-line no-empty\n catch {}\n } else {\n nodes.push(...Object.values(node));\n }\n }\n return subNodes;\n}\nfunction shouldNodeBeSkipped(node) {\n const type = Object.prototype.toString.call(node);\n return type === '[object Number]' || type === '[object Boolean]' || type === '[object String]' || type === '[object Symbol]' || type === '[object Function]' || type === '[object Date]' || type === '[object RegExp]' || node === undefined || node === null || // Skip native DOM objects, e.g. Window, nodes, events, etc.\n node instanceof EventTarget || node instanceof Event;\n}\nfunction isObject(structure) {\n return typeof structure === 'object' && structure !== null;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/spy\n */ /**\n * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.\n *\n * The following are the present features:\n *\n * * spy.called: property set to `true` if the function has been called at least once.\n *\n * @returns The spy function.\n */ function spy() {\n return function spy() {\n spy.called = true;\n };\n}\n\n/**\n * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to\n * manipulate it.\n */ class EventInfo {\n /**\n\t * The object that fired the event.\n\t */ source;\n /**\n\t * The event name.\n\t */ name;\n /**\n\t * Path this event has followed. See {@link module:utils/emittermixin~Emitter#delegate}.\n\t */ path;\n /**\n\t * Stops the event emitter to call further callbacks for this event interaction.\n\t */ stop;\n /**\n\t * Removes the current callback from future interactions of this event.\n\t */ off;\n /**\n\t * The value which will be returned by {@link module:utils/emittermixin~Emitter#fire}.\n\t *\n\t * It's `undefined` by default and can be changed by an event listener:\n\t *\n\t * ```ts\n\t * dataController.fire( 'getSelectedContent', ( evt ) => {\n\t * \t// This listener will make `dataController.fire( 'getSelectedContent' )`\n\t * \t// always return an empty DocumentFragment.\n\t * \tevt.return = new DocumentFragment();\n\t *\n\t * \t// Make sure no other listeners are executed.\n\t * \tevt.stop();\n\t * } );\n\t * ```\n\t */ return;\n /**\n\t * @param source The emitter.\n\t * @param name The event name.\n\t */ constructor(source, name){\n this.source = source;\n this.name = name;\n this.path = [];\n // The following methods are defined in the constructor because they must be re-created per instance.\n this.stop = spy();\n this.off = spy();\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/uid\n */ /**\n * A hash table of hex numbers to avoid using toString() in uid() which is costly.\n * [ '00', '01', '02', ..., 'fe', 'ff' ]\n */ const HEX_NUMBERS = new Array(256).fill('').map((_, index)=>('0' + index.toString(16)).slice(-2));\n/**\n * Returns a unique id. The id starts with an \"e\" character and a randomly generated string of\n * 32 alphanumeric characters.\n *\n * **Note**: The characters the unique id is built from correspond to the hex number notation\n * (from \"0\" to \"9\", from \"a\" to \"f\"). In other words, each id corresponds to an \"e\" followed\n * by 16 8-bit numbers next to each other.\n *\n * @returns An unique id string.\n */ function uid() {\n // Let's create some positive random 32bit integers first.\n const [r1, r2, r3, r4] = crypto.getRandomValues(new Uint32Array(4));\n // Make sure that id does not start with number.\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/priorities\n */ /**\n * String representing a priority value.\n */ /**\n * Provides group of constants to use instead of hardcoding numeric priority values.\n */ const priorities = {\n get (priority = 'normal') {\n if (typeof priority != 'number') {\n return this[priority] || this.normal;\n } else {\n return priority;\n }\n },\n highest: 100000,\n high: 1000,\n normal: 0,\n low: -1e3,\n lowest: -1e5\n};\n\n/**\n * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.\n *\n * @param objects Array of objects with priority to insert object to.\n * @param objectToInsert Object with `priority` property.\n */ function insertToPriorityArray(objects, objectToInsert) {\n const priority = priorities.get(objectToInsert.priority);\n // Binary search for better performance in large tables.\n let left = 0;\n let right = objects.length;\n while(left < right){\n const mid = left + right >> 1; // Use bitwise operator for faster floor division by 2.\n const midPriority = priorities.get(objects[mid].priority);\n if (midPriority < priority) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n objects.splice(left, 0, objectToInsert);\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/ckeditorerror\n */ /**\n * URL to the documentation with error codes.\n */ const DOCUMENTATION_URL = 'https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html';\n/**\n * The CKEditor error class.\n *\n * You should throw `CKEditorError` when:\n *\n * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled\n * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),\n * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use\n * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and\n * {@link module:utils/ckeditorerror~logError `logError()`}\n * to improve developers experience and let them see the a working editor as soon as possible.\n *\n * ```ts\n * /**\n * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n * *\n * * @error plugin-load\n * * @param pluginName The name of the plugin that could not be loaded.\n * * @param moduleName The name of the module which tried to load this plugin.\n * *\\/\n * throw new CKEditorError( 'plugin-load', {\n * \tpluginName: 'foo',\n * \tmoduleName: 'bar'\n * } );\n * ```\n */ class CKEditorError extends Error {\n /**\n\t * A context of the error by which the Watchdog is able to determine which editor crashed.\n\t */ context;\n /**\n\t * The additional error data passed to the constructor. Undefined if none was passed.\n\t */ data;\n /**\n\t * Creates an instance of the CKEditorError class.\n\t *\n\t * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added\n\t * to the thrown error's `message`.\n\t * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n\t * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n\t * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n\t * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n\t * to check if the object works as the context.\n\t * @param data Additional data describing the error. A stringified version of this object\n\t * will be appended to the error message, so the data are quickly visible in the console. The original\n\t * data object will also be later available under the {@link #data} property.\n\t * @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.\n\t */ constructor(errorName, context, data, originalError){\n super(getErrorMessage(errorName, data, originalError));\n this.name = 'CKEditorError';\n this.context = context;\n this.data = data;\n // Wrapping an original error in a CKEditorError instance.\n if (originalError) {\n // Restore the original stack trace to make the error look like the original one.\n // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.\n this.stack = originalError.stack;\n }\n }\n /**\n\t * Checks if the error is of the `CKEditorError` type.\n\t */ is(type) {\n return type === 'CKEditorError';\n }\n /**\n\t * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n\t * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n\t * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n\t *\n\t * @param error The error to rethrow.\n\t * @param context An object connected through properties with the editor instance. This context will be used\n\t * by the watchdog to verify which editor should be restarted.\n\t */ static rethrowUnexpectedError(error, context) {\n if (error.is && error.is('CKEditorError')) {\n throw error;\n }\n /**\n\t\t * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n\t\t * to make the debugging easier.\n\t\t *\n\t\t * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n\t\t * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n\t\t *\n\t\t * @error unexpected-error\n\t\t */ throw new CKEditorError('unexpected-error', context, undefined, error);\n }\n}\n/**\n * Logs a warning to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log a warning to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logWarning( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log\n * a warning or an error to the console.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */ function logWarning(errorName, data) {\n console.warn(...formatConsoleArguments(errorName, data));\n}\n/**\n * Logs an error to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log an error to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logError( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */ function logError(errorName, data) {\n console.error(...formatConsoleArguments(errorName, data));\n}\n/**\n * Returns formatted link to documentation message.\n */ function getLinkToDocumentationMessage(errorName) {\n return `\\nRead more: ${DOCUMENTATION_URL}#error-${errorName}`;\n}\n/**\n * Returns formatted error message.\n */ function getErrorMessage(errorName, data, originalError) {\n const processedObjects = new WeakSet();\n const circularReferencesReplacer = (key, value)=>{\n if (typeof value === 'object' && value !== null) {\n if (processedObjects.has(value)) {\n return `[object ${value.constructor.name}]`;\n }\n processedObjects.add(value);\n }\n return value;\n };\n const stringifiedData = data ? ` ${JSON.stringify(data, circularReferencesReplacer)}` : '';\n const documentationLink = getLinkToDocumentationMessage(errorName);\n const originalErrorMessage = originalError ? `\\nOriginal error: ${originalError.name}: ${originalError.message}` : '';\n return errorName + stringifiedData + documentationLink + originalErrorMessage;\n}\n/**\n * Returns formatted console error arguments.\n */ function formatConsoleArguments(errorName, data) {\n const documentationMessage = getLinkToDocumentationMessage(errorName);\n return data ? [\n errorName,\n data,\n documentationMessage\n ] : [\n errorName,\n documentationMessage\n ];\n}\n\nconst version = '48.0.0';\n// The second argument is not a month. It is `monthIndex` and starts from `0`.\nconst releaseDate = new Date(2026, 2, 31);\n/* istanbul ignore next -- @preserve */ if (globalThis.CKEDITOR_VERSION) {\n /**\n\t * This error is thrown when, due to a mistake in the way CKEditor 5 was installed,\n\t * imported, or initialized, some of its modules were evaluated and executed twice.\n\t * Duplicate modules inevitably lead to runtime errors and increased bundle size.\n\t *\n\t * # Check dependency versions\n\t *\n\t * First, make sure that you use the latest version of all CKEditor 5 dependencies.\n\t * Depending on the installation method, you should check the versions of the `ckeditor5`,\n\t * `ckeditor5-premium-features`, or `@ckeditor/ckeditor5-` packages. If you cannot update\n\t * to the latest version, ensure that all the CKEditor 5 packages are\n\t * in the same version.\n\t *\n\t * If you use third-party plugins, make sure to update them, too. If they are incompatible\n\t * with the version of CKEditor 5 you use, you may need to downgrade the CKEditor 5 packages\n\t * (which we do not recommend). Ask the plugin's author to upgrade the dependencies,\n\t * or fork their project and update it yourself.\n\t *\n\t * # Check imports\n\t *\n\t * The next step is to look at how you import CKEditor 5 into your project.\n\t *\n\t * **The {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n\t * are designed to prevent module duplication, so if you are not using them yet, you should consider\n\t * updating your project**. However, several legacy installation methods are still supported for backward\n\t * compatibility, and mixing them may result in module duplication.\n\t *\n\t * These are the most common import methods of the CKEditor 5 packages.\n\t *\n\t * - **New installation methods (NIM)** – Imports from the `ckeditor5` and `ckeditor5-premium-features` packages.\n\t * - **Optimized build** for the new installation methods – Imports from the `@ckeditor/ckeditor5-/dist/index.js`.\n\t * - **Predefined builds** (no longer supported) – Imports from the `@ckeditor/ckeditor5-build-` packages.\n\t * - **Default imports** (legacy) – Imports from the `@ckeditor/ckeditor5-` packages (default export).\n\t * - **`src`** (legacy) – Imports from the `@ckeditor/ckeditor5-/src/*`.\n\t * - **DLL builds** (legacy) – Imports from the `ckeditor5/build/` and `@ckeditor/ckeditor5-/build/*`.\n\t *\n\t * The best way to avoid duplicate modules is to avoid mixing these installation methods. For example, if you use imports\n\t * specific to the optimized build, you should use them for all CKEditor 5 packages. In addition, since\n\t * the DLL builds already include the core of the editor, they cannot be used with other types of imports.\n\t *\n\t * Here is a matrix showing which installation methods are compatible with each other:\n\t *\n\t * | | NIM | Optimized build | Predefined builds | Default imports | `src` | DLL builds |\n\t * |------------------|-----|-----------------|-------------------|-----------------|-------|------------|\n\t * | NIM | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n\t * | Optimized builds | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n\t * | Predefined build | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |\n\t * | Default imports | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |\n\t * | `src` | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |\n\t * | DLL builds | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |\n\t *\n\t * If you use any third-party plugins, make sure the way you import them is compatible with\n\t * the way you import CKEditor 5.\n\t *\n\t *
    \n\t * New installation methods and optimized builds\n\t *\n\t * If you use the {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods},\n\t * you should only import { code } from the `ckeditor5` and `ckeditor5-premium-features` packages.\n\t * Do not import { code } from the `@ckeditor/ckeditor5-` packages unless you follow\n\t * the {@glink getting-started/setup/optimizing-build-size Optimizing build size} guide and the imports from\n\t * the `@ckeditor/ckeditor5-` packages end with `/dist/index.js`.\n\t *\n\t * If you use a CDN, ensure that some files are not included twice in your project.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor, Highlight } from 'ckeditor5'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight.js'; // ❌\n\t * ```\n\t *
    \n\t *\n\t *
    \n\t * (Deprecated) Predefined builds\n\t *\n\t * **As of April, 2025 predefined build are no longer supported. Please refer to the\n\t * {@glink getting-started/index Quick Start} guide\n\t * to choose one of the modern installation and integration methods available**.\n\t *\n\t * If you use the predefined builds, you cannot import any additional plugins.\n\t * These builds already include the editor's core and selected plugins and importing additional\n\t * ones will cause some modules to be bundled and loaded twice.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic'; // ✅\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight'; // ❌\n\t * ```\n\t *\n\t * If you are missing some features from the list of plugins, you should switch to the\n\t * {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n\t * which do not have this limitation.\n\t *
    \n\t *\n\t *
    \n\t * (Legacy) Default imports and `src` imports\n\t *\n\t * If you use the legacy customized installation\n\t * method, you should only import code from the `@ckeditor/ckeditor5-` packages. While you can import code from\n\t * the `@ckeditor/ckeditor5-/src/*` files, it is not recommended as it can make migration to the new installation\n\t * methods more difficult.\n\t *\n\t * If you use this installation method, you should not import { code } from the `ckeditor5` or `ckeditor5-premium-features` packages.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ✅ (not recommended)\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight'; // ❌\n\t * ```\n\t *
    \n\t *\n\t *
    \n\t * (Legacy) DLL builds\n\t *\n\t * If you are using the {@glink updating/nim-migration/dll-builds legacy DLL builds},\n\t * you should not import any non-DLL modules.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import 'ckeditor5/build/ckeditor5-dll.js';// ✅\n\t * import '@ckeditor/ckeditor5-editor-classic/build/editor-classic.js';// ✅\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight.js';// ✅\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ❌\n\t * ```\n\t *
    \n\t *\n\t * # Reinstall `node_modules`\n\t *\n\t * Usually, npm and other package managers deduplicate all packages - for example, `ckeditor5` is only installed once\n\t * in `node_modules/`. However, it is known to fail to do so occasionally.\n\t *\n\t * To rule out this possibility, you can try the following:\n\t *\n\t * 1. Remove the `node_modules` directory.\n\t * 2. Remove the `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml` files (depending on the package manager used).\n\t * 3. Run `npm install` to reinstall all packages.\n\t * 4. Run `npm ls` to check how many times packages like `@ckeditor/ckeditor5-core` are installed.\n\t * If they are installed more than once, verify which package causes that.\n\t *\n\t * @error ckeditor-duplicated-modules\n\t */ throw new CKEditorError('ckeditor-duplicated-modules', null);\n} else {\n globalThis.CKEDITOR_VERSION = version;\n}\n\nconst _listeningTo = Symbol('listeningTo');\nconst _emitterId = Symbol('emitterId');\nconst _delegations = Symbol('delegations');\nconst defaultEmitterClass$1 = /* #__PURE__ */ EmitterMixin(Object);\nfunction EmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass$1;\n }\n class Mixin extends base {\n on(event, callback, options) {\n this.listenTo(this, event, callback, options);\n }\n once(event, callback, options) {\n let wasFired = false;\n const onceCallback = (event, ...args)=>{\n // Ensure the callback is called only once even if the callback itself leads to re-firing the event\n // (which would call the callback again).\n if (!wasFired) {\n wasFired = true;\n // Go off() at the first call.\n event.off();\n // Go with the original callback.\n callback.call(this, event, ...args);\n }\n };\n // Make a similar on() call, simply replacing the callback.\n this.listenTo(this, event, onceCallback, options);\n }\n off(event, callback) {\n this.stopListening(this, event, callback);\n }\n listenTo(emitter, event, callback, options = {}) {\n let emitterInfo, eventCallbacks;\n // _listeningTo contains a list of emitters that this object is listening to.\n // This list has the following format:\n //\n // _listeningTo: {\n // emitterId: {\n // emitter: emitter,\n // callbacks: {\n // event1: [ callback1, callback2, ... ]\n // ....\n // }\n // },\n // ...\n // }\n if (!this[_listeningTo]) {\n this[_listeningTo] = {};\n }\n const emitters = this[_listeningTo];\n if (!_getEmitterId(emitter)) {\n _setEmitterId(emitter);\n }\n const emitterId = _getEmitterId(emitter);\n if (!(emitterInfo = emitters[emitterId])) {\n emitterInfo = emitters[emitterId] = {\n emitter,\n callbacks: {}\n };\n }\n if (!(eventCallbacks = emitterInfo.callbacks[event])) {\n eventCallbacks = emitterInfo.callbacks[event] = [];\n }\n eventCallbacks.push(callback);\n // Finally register the callback to the event.\n addEventListener(this, emitter, event, callback, options);\n }\n stopListening(emitter, event, callback) {\n const emitters = this[_listeningTo];\n let emitterId = emitter && _getEmitterId(emitter);\n const emitterInfo = emitters && emitterId ? emitters[emitterId] : undefined;\n const eventCallbacks = emitterInfo && event ? emitterInfo.callbacks[event] : undefined;\n // Stop if nothing has been listened.\n if (!emitters || emitter && !emitterInfo || event && !eventCallbacks) {\n return;\n }\n // All params provided. off() that single callback.\n if (callback) {\n removeEventListener(this, emitter, event, callback);\n // We must remove callbacks as well in order to prevent memory leaks.\n // See https://github.com/ckeditor/ckeditor5/pull/8480\n const index = eventCallbacks.indexOf(callback);\n if (index !== -1) {\n if (eventCallbacks.length === 1) {\n delete emitterInfo.callbacks[event];\n } else {\n removeEventListener(this, emitter, event, callback);\n }\n }\n } else if (eventCallbacks) {\n while(callback = eventCallbacks.pop()){\n removeEventListener(this, emitter, event, callback);\n }\n delete emitterInfo.callbacks[event];\n } else if (emitterInfo) {\n for(event in emitterInfo.callbacks){\n this.stopListening(emitter, event);\n }\n delete emitters[emitterId];\n } else {\n for(emitterId in emitters){\n this.stopListening(emitters[emitterId].emitter);\n }\n delete this[_listeningTo];\n }\n }\n fire(eventOrInfo, ...args) {\n try {\n const eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n const event = eventInfo.name;\n let callbacks = getCallbacksForEvent(this, event);\n // Record that the event passed this emitter on its path.\n eventInfo.path.push(this);\n // Handle event listener callbacks first.\n if (callbacks) {\n // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks\n // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but\n // failed if callbacks were added to the queue before currently processed callback.\n // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same\n // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.\n callbacks = callbacks.slice();\n for(let i = 0; i < callbacks.length; i++){\n const fn = callbacks[i].callback;\n fn.call(this, eventInfo, ...args);\n // Remove the callback from future requests if off() has been called.\n if (eventInfo.off.called) {\n // Remove the called mark for the next calls.\n delete eventInfo.off.called;\n this._removeEventListener(event, fn);\n }\n // Do not execute next callbacks if stop() was called.\n if (eventInfo.stop.called) {\n break;\n }\n }\n }\n // Delegate event to other emitters if needed.\n const delegations = this[_delegations];\n if (delegations) {\n const destinations = delegations.get(event);\n const passAllDestinations = delegations.get('*');\n if (destinations) {\n fireDelegatedEvents(destinations, eventInfo, args);\n }\n if (passAllDestinations) {\n fireDelegatedEvents(passAllDestinations, eventInfo, args);\n }\n }\n return eventInfo.return;\n } catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */ CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n delegate(...events) {\n return {\n to: (emitter, nameOrFunction)=>{\n if (!this[_delegations]) {\n this[_delegations] = new Map();\n }\n // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow\n // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.\n events.forEach((eventName)=>{\n const destinations = this[_delegations].get(eventName);\n if (!destinations) {\n this[_delegations].set(eventName, new Map([\n [\n emitter,\n nameOrFunction\n ]\n ]));\n } else {\n destinations.set(emitter, nameOrFunction);\n }\n });\n }\n };\n }\n stopDelegating(event, emitter) {\n if (!this[_delegations]) {\n return;\n }\n if (!event) {\n this[_delegations].clear();\n } else if (!emitter) {\n this[_delegations].delete(event);\n } else {\n const destinations = this[_delegations].get(event);\n if (destinations) {\n destinations.delete(emitter);\n }\n }\n }\n _addEventListener(event, callback, options) {\n createEventNamespace(this, event);\n const lists = getCallbacksListsForNamespace(this, event);\n const priority = priorities.get(options.priority);\n const callbackDefinition = {\n callback,\n priority\n };\n // Add the callback to all callbacks list.\n for (const callbacks of lists){\n // Add the callback to the list in the right priority position.\n insertToPriorityArray(callbacks, callbackDefinition);\n }\n }\n _removeEventListener(event, callback) {\n const lists = getCallbacksListsForNamespace(this, event);\n for (const callbacks of lists){\n for(let i = 0; i < callbacks.length; i++){\n if (callbacks[i].callback == callback) {\n // Remove the callback from the list (fixing the next index).\n callbacks.splice(i, 1);\n i--;\n }\n }\n }\n }\n }\n return Mixin;\n}\n/**\n * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.\n * If not, returns `null`.\n *\n * @internal\n * @param listeningEmitter An emitter that listens.\n * @param listenedToEmitterId Unique emitter id of emitter listened to.\n */ function _getEmitterListenedTo(listeningEmitter, listenedToEmitterId) {\n const listeningTo = listeningEmitter[_listeningTo];\n if (listeningTo && listeningTo[listenedToEmitterId]) {\n return listeningTo[listenedToEmitterId].emitter;\n }\n return null;\n}\n/**\n * Sets emitter's unique id.\n *\n * **Note:** `_emitterId` can be set only once.\n *\n * @internal\n * @param emitter An emitter for which id will be set.\n * @param id Unique id to set. If not passed, random unique id will be set.\n */ function _setEmitterId(emitter, id) {\n if (!emitter[_emitterId]) {\n emitter[_emitterId] = id || uid();\n }\n}\n/**\n * Returns emitter's unique id.\n *\n * @internal\n * @param emitter An emitter which id will be returned.\n */ function _getEmitterId(emitter) {\n return emitter[_emitterId];\n}\n/**\n * Gets the internal `_events` property of the given object.\n * `_events` property store all lists with callbacks for registered event names.\n * If there were no events registered on the object, empty `_events` object is created.\n */ function getEvents(source) {\n if (!source._events) {\n Object.defineProperty(source, '_events', {\n value: {}\n });\n }\n return source._events;\n}\n/**\n * Creates event node for generic-specific events relation architecture.\n */ function makeEventNode() {\n return {\n callbacks: [],\n childEvents: []\n };\n}\n/**\n * Creates an architecture for generic-specific events relation.\n * If needed, creates all events for given eventName, i.e. if the first registered event\n * is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.\n * It also copies callbacks from more generic events to more specific events when\n * specific events are created.\n */ function createEventNamespace(source, eventName) {\n const events = getEvents(source);\n // First, check if the event we want to add to the structure already exists.\n if (events[eventName]) {\n // If it exists, we don't have to do anything.\n return;\n }\n // In other case, we have to create the structure for the event.\n // Note, that we might need to create intermediate events too.\n // I.e. if foo:bar:abc is being registered and we only have foo in the structure,\n // we need to also register foo:bar.\n // Currently processed event name.\n let name = eventName;\n // Name of the event that is a child event for currently processed event.\n let childEventName = null;\n // Array containing all newly created specific events.\n const newEventNodes = [];\n // While loop can't check for ':' index because we have to handle generic events too.\n // In each loop, we truncate event name, going from the most specific name to the generic one.\n // I.e. foo:bar:abc -> foo:bar -> foo.\n while(name !== ''){\n if (events[name]) {\n break;\n }\n // If this event is not yet registered, create a new object for it.\n events[name] = makeEventNode();\n // Add it to the array with newly created events.\n newEventNodes.push(events[name]);\n // Add previously processed event name as a child of this event.\n if (childEventName) {\n events[name].childEvents.push(childEventName);\n }\n childEventName = name;\n // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.\n name = name.substr(0, name.lastIndexOf(':'));\n }\n if (name !== '') {\n // If name is not empty, we found an already registered event that was a parent of the\n // event we wanted to register.\n // Copy that event's callbacks to newly registered events.\n for (const node of newEventNodes){\n node.callbacks = events[name].callbacks.slice();\n }\n // Add last newly created event to the already registered event.\n events[name].childEvents.push(childEventName);\n }\n}\n/**\n * Gets an array containing callbacks list for a given event and it's more specific events.\n * I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will\n * return callback list of foo:bar and foo:bar:abc (but not foo).\n */ function getCallbacksListsForNamespace(source, eventName) {\n const eventNode = getEvents(source)[eventName];\n if (!eventNode) {\n return [];\n }\n let callbacksLists = [\n eventNode.callbacks\n ];\n for(let i = 0; i < eventNode.childEvents.length; i++){\n const childCallbacksLists = getCallbacksListsForNamespace(source, eventNode.childEvents[i]);\n callbacksLists = callbacksLists.concat(childCallbacksLists);\n }\n return callbacksLists;\n}\n/**\n * Get the list of callbacks for a given event, but only if there any callbacks have been registered.\n * If there are no callbacks registered for given event, it checks if this is a specific event and looks\n * for callbacks for it's more generic version.\n */ function getCallbacksForEvent(source, eventName) {\n if (!source._events) {\n return null;\n }\n let currentEventName = eventName;\n do {\n const event = source._events[currentEventName];\n if (event && event.callbacks && event.callbacks.length) {\n return event.callbacks;\n }\n const colonIndex = currentEventName.lastIndexOf(':');\n currentEventName = colonIndex > -1 ? currentEventName.substring(0, colonIndex) : '';\n }while (currentEventName)\n return null;\n}\n/**\n * Fires delegated events for given map of destinations.\n *\n * @param destinations A map containing `[ {@link module:utils/emittermixin~Emitter}, \"event name\" ]` pair destinations.\n * @param eventInfo The original event info object.\n * @param fireArgs Arguments the original event was fired with.\n */ function fireDelegatedEvents(destinations, eventInfo, fireArgs) {\n for (let [emitter, name] of destinations){\n if (!name) {\n name = eventInfo.name;\n } else if (typeof name == 'function') {\n name = name(eventInfo.name);\n }\n const delegatedInfo = new EventInfo(eventInfo.source, name);\n delegatedInfo.path = [\n ...eventInfo.path\n ];\n emitter.fire(delegatedInfo, ...fireArgs);\n }\n}\n/**\n * Helper for registering event callback on the emitter.\n */ function addEventListener(listener, emitter, event, callback, options) {\n if (emitter._addEventListener) {\n emitter._addEventListener(event, callback, options);\n } else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n listener._addEventListener.call(emitter, event, callback, options);\n }\n}\n/**\n * Helper for removing event callback from the emitter.\n */ function removeEventListener(listener, emitter, event, callback) {\n if (emitter._removeEventListener) {\n emitter._removeEventListener(event, callback);\n } else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n listener._removeEventListener.call(emitter, event, callback);\n }\n}\n\nconst observablePropertiesSymbol = Symbol('observableProperties');\nconst boundObservablesSymbol = Symbol('boundObservables');\nconst boundPropertiesSymbol = Symbol('boundProperties');\nconst decoratedMethods = Symbol('decoratedMethods');\nconst decoratedOriginal = Symbol('decoratedOriginal');\nconst defaultObservableClass = /* #__PURE__ */ ObservableMixin(/* #__PURE__ */ EmitterMixin());\nfunction ObservableMixin(base) {\n if (!base) {\n return defaultObservableClass;\n }\n class Mixin extends base {\n set(name, value) {\n // If the first parameter is an Object, iterate over its properties.\n if (isObject$1(name)) {\n Object.keys(name).forEach((property)=>{\n this.set(property, name[property]);\n }, this);\n return;\n }\n initObservable(this);\n const properties = this[observablePropertiesSymbol];\n if (name in this && !properties.has(name)) {\n /**\n\t\t\t\t * Cannot override an existing property.\n\t\t\t\t *\n\t\t\t\t * This error is thrown when trying to {@link module:utils/observablemixin~Observable#set set} a property with\n\t\t\t\t * a name of an already existing property. For example:\n\t\t\t\t *\n\t\t\t\t * ```ts\n\t\t\t\t * let observable = new Model();\n\t\t\t\t * observable.property = 1;\n\t\t\t\t * observable.set( 'property', 2 );\t\t\t// throws\n\t\t\t\t *\n\t\t\t\t * observable.set( 'property', 1 );\n\t\t\t\t * observable.set( 'property', 2 );\t\t\t// ok, because this is an existing property.\n\t\t\t\t * ```\n\t\t\t\t *\n\t\t\t\t * @error observable-set-cannot-override\n\t\t\t\t */ throw new CKEditorError('observable-set-cannot-override', this);\n }\n Object.defineProperty(this, name, {\n enumerable: true,\n configurable: true,\n get () {\n return properties.get(name);\n },\n set (value) {\n const oldValue = properties.get(name);\n // Fire `set` event before the new value will be set to make it possible\n // to override observable property without affecting `change` event.\n // See https://github.com/ckeditor/ckeditor5-utils/issues/171.\n let newValue = this.fire(`set:${name}`, name, value, oldValue);\n if (newValue === undefined) {\n newValue = value;\n }\n // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).\n // Note: When properties map has no such own property, then its value is undefined.\n if (oldValue !== newValue || !properties.has(name)) {\n properties.set(name, newValue);\n this.fire(`change:${name}`, name, newValue, oldValue);\n }\n }\n });\n this[name] = value;\n }\n bind(...bindProperties) {\n if (!bindProperties.length || !isStringArray(bindProperties)) {\n /**\n\t\t\t\t * All properties must be strings.\n\t\t\t\t *\n\t\t\t\t * @error observable-bind-wrong-properties\n\t\t\t\t */ throw new CKEditorError('observable-bind-wrong-properties', this);\n }\n if (new Set(bindProperties).size !== bindProperties.length) {\n /**\n\t\t\t\t * Properties must be unique.\n\t\t\t\t *\n\t\t\t\t * @error observable-bind-duplicate-properties\n\t\t\t\t */ throw new CKEditorError('observable-bind-duplicate-properties', this);\n }\n initObservable(this);\n const boundProperties = this[boundPropertiesSymbol];\n bindProperties.forEach((propertyName)=>{\n if (boundProperties.has(propertyName)) {\n /**\n\t\t\t\t\t * Cannot bind the same property more than once.\n\t\t\t\t\t *\n\t\t\t\t\t * @error observable-bind-rebind\n\t\t\t\t\t */ throw new CKEditorError('observable-bind-rebind', this);\n }\n });\n const bindings = new Map();\n bindProperties.forEach((a)=>{\n const binding = {\n property: a,\n to: []\n };\n boundProperties.set(a, binding);\n bindings.set(a, binding);\n });\n return {\n to: bindTo,\n toMany: bindToMany,\n _observable: this,\n _bindProperties: bindProperties,\n _to: [],\n _bindings: bindings\n };\n }\n unbind(...unbindProperties) {\n // Nothing to do here if not inited yet.\n if (!this[observablePropertiesSymbol]) {\n return;\n }\n const boundProperties = this[boundPropertiesSymbol];\n const boundObservables = this[boundObservablesSymbol];\n if (unbindProperties.length) {\n if (!isStringArray(unbindProperties)) {\n /**\n\t\t\t\t\t * Properties must be strings.\n\t\t\t\t\t *\n\t\t\t\t\t * @error observable-unbind-wrong-properties\n\t\t\t\t\t */ throw new CKEditorError('observable-unbind-wrong-properties', this);\n }\n unbindProperties.forEach((propertyName)=>{\n const binding = boundProperties.get(propertyName);\n // Nothing to do if the binding is not defined\n if (!binding) {\n return;\n }\n binding.to.forEach(([toObservable, toProperty])=>{\n const toProperties = boundObservables.get(toObservable);\n const toPropertyBindings = toProperties[toProperty];\n toPropertyBindings.delete(binding);\n if (!toPropertyBindings.size) {\n delete toProperties[toProperty];\n }\n if (!Object.keys(toProperties).length) {\n boundObservables.delete(toObservable);\n this.stopListening(toObservable, 'change');\n }\n });\n boundProperties.delete(propertyName);\n });\n } else {\n boundObservables.forEach((bindings, boundObservable)=>{\n this.stopListening(boundObservable, 'change');\n });\n boundObservables.clear();\n boundProperties.clear();\n }\n }\n decorate(methodName) {\n initObservable(this);\n const originalMethod = this[methodName];\n if (!originalMethod) {\n /**\n\t\t\t\t * Cannot decorate an undefined method.\n\t\t\t\t *\n\t\t\t\t * @error observablemixin-cannot-decorate-undefined\n\t\t\t\t * @param {object} object The object which method should be decorated.\n\t\t\t\t * @param {string} methodName Name of the method which does not exist.\n\t\t\t\t */ throw new CKEditorError('observablemixin-cannot-decorate-undefined', this, {\n object: this,\n methodName\n });\n }\n this.on(methodName, (evt, args)=>{\n evt.return = originalMethod.apply(this, args);\n });\n this[methodName] = function(...args) {\n return this.fire(methodName, args);\n };\n this[methodName][decoratedOriginal] = originalMethod;\n if (!this[decoratedMethods]) {\n this[decoratedMethods] = [];\n }\n this[decoratedMethods].push(methodName);\n }\n // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.\n // This is needed in case of:\n // 1. Have x.foo() decorated.\n // 2. Call x.stopListening()\n // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)\n stopListening(emitter, event, callback) {\n // Removing all listeners so let's clean the decorated methods to the original state.\n if (!emitter && this[decoratedMethods]) {\n for (const methodName of this[decoratedMethods]){\n this[methodName] = this[methodName][decoratedOriginal];\n }\n delete this[decoratedMethods];\n }\n super.stopListening(emitter, event, callback);\n }\n [observablePropertiesSymbol];\n [decoratedMethods];\n [boundPropertiesSymbol];\n [boundObservablesSymbol];\n }\n return Mixin;\n}\n// Init symbol properties needed for the observable mechanism to work.\nfunction initObservable(observable) {\n // Do nothing if already inited.\n if (observable[observablePropertiesSymbol]) {\n return;\n }\n // The internal hash containing the observable's state.\n Object.defineProperty(observable, observablePropertiesSymbol, {\n value: new Map()\n });\n // Map containing bindings to external observables. It shares the binding objects\n // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~Observable#_boundProperties} and\n // it is used to observe external observables to update own properties accordingly.\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] ),\n //\t\t\t\t\tz: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t},\n //\t\t\t\tC: {\n //\t\t\t\t\tw: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n Object.defineProperty(observable, boundObservablesSymbol, {\n value: new Map()\n });\n // Object that stores which properties of this observable are bound and how. It shares\n // the binding objects (`{ observable: A, property: 'a', to: ... }`) with\n // {@link module:utils/observablemixin~Observable#_boundObservables}. This data structure is\n // a reverse of {@link module:utils/observablemixin~Observable#_boundObservables} and it is helpful for\n // {@link module:utils/observablemixin~Observable#unbind}.\n //\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },\n //\t\t\t\td: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t} )\n Object.defineProperty(observable, boundPropertiesSymbol, {\n value: new Map()\n });\n}\n/**\n * A chaining for {@link module:utils/observablemixin~Observable#bind} providing `.to()` interface.\n *\n * @param args Arguments of the `.to( args )` binding.\n */ function bindTo(...args) {\n const parsedArgs = parseBindToArgs(...args);\n const bindingsKeys = Array.from(this._bindings.keys());\n const numberOfBindings = bindingsKeys.length;\n // Eliminate A.bind( 'x' ).to( B, C )\n if (!parsedArgs.callback && parsedArgs.to.length > 1) {\n /**\n\t\t * Binding multiple observables only possible with callback.\n\t\t *\n\t\t * @error observable-bind-to-no-callback\n\t\t */ throw new CKEditorError('observable-bind-to-no-callback', this);\n }\n // Eliminate A.bind( 'x', 'y' ).to( B, callback )\n if (numberOfBindings > 1 && parsedArgs.callback) {\n /**\n\t\t * Cannot bind multiple properties and use a callback in one binding.\n\t\t *\n\t\t * @error observable-bind-to-extra-callback\n\t\t */ throw new CKEditorError('observable-bind-to-extra-callback', this);\n }\n parsedArgs.to.forEach((to)=>{\n // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )\n if (to.properties.length && to.properties.length !== numberOfBindings) {\n /**\n\t\t\t * The number of properties must match.\n\t\t\t *\n\t\t\t * @error observable-bind-to-properties-length\n\t\t\t */ throw new CKEditorError('observable-bind-to-properties-length', this);\n }\n // When no to.properties specified, observing source properties instead i.e.\n // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y\n if (!to.properties.length) {\n to.properties = this._bindProperties;\n }\n });\n this._to = parsedArgs.to;\n // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.\n if (parsedArgs.callback) {\n this._bindings.get(bindingsKeys[0]).callback = parsedArgs.callback;\n }\n attachBindToListeners(this._observable, this._to);\n // Update observable._boundProperties and observable._boundObservables.\n updateBindToBound(this);\n // Set initial values of bound properties.\n this._bindProperties.forEach((propertyName)=>{\n updateBoundObservableProperty(this._observable, propertyName);\n });\n}\n/**\n * Binds to an attribute in a set of iterable observables.\n */ function bindToMany(observables, attribute, callback) {\n if (this._bindings.size > 1) {\n /**\n\t\t * Binding one attribute to many observables only possible with one attribute.\n\t\t *\n\t\t * @error observable-bind-to-many-not-one-binding\n\t\t */ throw new CKEditorError('observable-bind-to-many-not-one-binding', this);\n }\n this.to(// Bind to #attribute of each observable...\n ...getBindingTargets(observables, attribute), // ...using given callback to parse attribute values.\n callback);\n}\n/**\n * Returns an array of binding components for\n * {@link Observable#bind} from a set of iterable observables.\n */ function getBindingTargets(observables, attribute) {\n const observableAndAttributePairs = observables.map((observable)=>[\n observable,\n attribute\n ]);\n // Merge pairs to one-dimension array of observables and attributes.\n return Array.prototype.concat.apply([], observableAndAttributePairs);\n}\n/**\n * Check if all entries of the array are of `String` type.\n */ function isStringArray(arr) {\n return arr.every((a)=>typeof a == 'string');\n}\n/**\n * Parses and validates {@link Observable#bind}`.to( args )` arguments and returns\n * an object with a parsed structure. For example\n *\n * ```ts\n * A.bind( 'x' ).to( B, 'a', C, 'b', call );\n * ```\n *\n * becomes\n *\n * ```ts\n * {\n * \tto: [\n * \t\t{ observable: B, properties: [ 'a' ] },\n * \t\t{ observable: C, properties: [ 'b' ] },\n * \t],\n * \tcallback: call\n * }\n *\n * @param args Arguments of {@link Observable#bind}`.to( args )`.\n */ function parseBindToArgs(...args) {\n // Eliminate A.bind( 'x' ).to()\n if (!args.length) {\n /**\n\t\t * Invalid argument syntax in `to()`.\n\t\t *\n\t\t * @error observable-bind-to-parse-error\n\t\t */ throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n const parsed = {\n to: []\n };\n let lastObservable;\n if (typeof args[args.length - 1] == 'function') {\n parsed.callback = args.pop();\n }\n args.forEach((a)=>{\n if (typeof a == 'string') {\n lastObservable.properties.push(a);\n } else if (typeof a == 'object') {\n lastObservable = {\n observable: a,\n properties: []\n };\n parsed.to.push(lastObservable);\n } else {\n throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n });\n return parsed;\n}\n/**\n * Synchronizes {@link module:utils/observable#_boundObservables} with {@link Binding}.\n *\n * @param binding A binding to store in {@link Observable#_boundObservables}.\n * @param toObservable A observable, which is a new component of `binding`.\n * @param toPropertyName A name of `toObservable`'s property, a new component of the `binding`.\n */ function updateBoundObservables(observable, binding, toObservable, toPropertyName) {\n const boundObservables = observable[boundObservablesSymbol];\n const bindingsToObservable = boundObservables.get(toObservable);\n const bindings = bindingsToObservable || {};\n if (!bindings[toPropertyName]) {\n bindings[toPropertyName] = new Set();\n }\n // Pass the binding to a corresponding Set in `observable._boundObservables`.\n bindings[toPropertyName].add(binding);\n if (!bindingsToObservable) {\n boundObservables.set(toObservable, bindings);\n }\n}\n/**\n * Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}\n * with {@link BindChain}.\n *\n * Assuming the following binding being created\n *\n * ```ts\n * A.bind( 'a', 'b' ).to( B, 'x', 'y' );\n * ```\n *\n * the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:\n *\n * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [] },\n * \tb: { observable: A, property: 'b', to: [] },\n * }\n * ```\n *\n * Iterate over all bindings in this chain and fill their `to` properties with\n * corresponding to( ... ) arguments (components of the binding), so\n *\n * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [ B, 'x' ] },\n * \tb: { observable: A, property: 'b', to: [ B, 'y' ] },\n * }\n * ```\n *\n * Then update the structure of {@link Observable#_boundObservables} with updated\n * binding, so it becomes:\n *\n * ```ts\n * Map( {\n * \tB: {\n * \t\tx: Set( [\n * \t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] }\n * \t\t] ),\n * \t\ty: Set( [\n * \t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n * \t\t] )\n * \t}\n * } )\n * ```\n *\n * @param chain The binding initialized by {@link Observable#bind}.\n */ function updateBindToBound(chain) {\n let toProperty;\n chain._bindings.forEach((binding, propertyName)=>{\n // Note: For a binding without a callback, this will run only once\n // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )\n // TODO: ES6 destructuring.\n chain._to.forEach((to)=>{\n toProperty = to.properties[binding.callback ? 0 : chain._bindProperties.indexOf(propertyName)];\n binding.to.push([\n to.observable,\n toProperty\n ]);\n updateBoundObservables(chain._observable, binding, to.observable, toProperty);\n });\n });\n}\n/**\n * Updates an property of a {@link Observable} with a value\n * determined by an entry in {@link Observable#_boundProperties}.\n *\n * @param observable A observable which property is to be updated.\n * @param propertyName An property to be updated.\n */ function updateBoundObservableProperty(observable, propertyName) {\n const boundProperties = observable[boundPropertiesSymbol];\n const binding = boundProperties.get(propertyName);\n let propertyValue;\n // When a binding with callback is created like\n //\n // \t\tA.bind( 'a' ).to( B, 'b', C, 'c', callback );\n //\n // collect B.b and C.c, then pass them to callback to set A.a.\n if (binding.callback) {\n propertyValue = binding.callback.apply(observable, binding.to.map((to)=>to[0][to[1]]));\n } else {\n propertyValue = binding.to[0];\n propertyValue = propertyValue[0][propertyValue[1]];\n }\n if (Object.prototype.hasOwnProperty.call(observable, propertyName)) {\n observable[propertyName] = propertyValue;\n } else {\n observable.set(propertyName, propertyValue);\n }\n}\n/**\n * Starts listening to changes in {@link BindChain._to} observables to update\n * {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the\n * initial state of {@link BindChain._observable}.\n *\n * @param chain The chain initialized by {@link Observable#bind}.\n */ function attachBindToListeners(observable, toBindings) {\n toBindings.forEach((to)=>{\n const boundObservables = observable[boundObservablesSymbol];\n let bindings;\n // If there's already a chain between the observables (`observable` listens to\n // `to.observable`), there's no need to create another `change` event listener.\n if (!boundObservables.get(to.observable)) {\n observable.listenTo(to.observable, 'change', (evt, propertyName)=>{\n bindings = boundObservables.get(to.observable)[propertyName];\n // Note: to.observable will fire for any property change, react\n // to changes of properties which are bound only.\n if (bindings) {\n bindings.forEach((binding)=>{\n updateBoundObservableProperty(observable, binding.property);\n });\n }\n });\n }\n });\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/elementreplacer\n */ /**\n * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove\n * the original elements from the DOM.\n */ class ElementReplacer {\n /**\n\t * The elements replaced by {@link #replace} and their replacements.\n\t */ _replacedElements;\n constructor(){\n this._replacedElements = [];\n }\n /**\n\t * Hides the `element` and, if specified, inserts the the given element next to it.\n\t *\n\t * The effect of this method can be reverted by {@link #restore}.\n\t *\n\t * @param element The element to replace.\n\t * @param newElement The replacement element. If not passed, then the `element` will just be hidden.\n\t */ replace(element, newElement) {\n this._replacedElements.push({\n element,\n newElement\n });\n element.style.display = 'none';\n if (newElement) {\n element.parentNode.insertBefore(newElement, element.nextSibling);\n }\n }\n /**\n\t * Restores what {@link #replace} did.\n\t */ restore() {\n this._replacedElements.forEach(({ element, newElement })=>{\n element.style.display = '';\n if (newElement) {\n newElement.remove();\n }\n });\n this._replacedElements = [];\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/abortabledebounce\n */ /**\n * Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.\n *\n * @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.\n */ function abortableDebounce(func) {\n let controller = new AbortController();\n function abortable(...args) {\n controller.abort();\n controller = new AbortController();\n return func(controller.signal, ...args);\n }\n abortable.abort = ()=>controller.abort();\n return abortable;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/count\n */ /**\n * Returns the number of items return by the iterator.\n *\n * ```ts\n * count( [ 1, 2, 3, 4, 5 ] ); // 5;\n * ```\n *\n * @param iterable Any iterable.\n * @returns Number of items returned by that iterable.\n */ function count(iterable) {\n let count = 0;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n for (const _ of iterable){\n count++;\n }\n return count;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/comparearrays\n */ /**\n * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array\n * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,\n * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned\n * it means that arrays differ.\n *\n * ```ts\n * compareArrays( [ 0, 2 ], [ 0, 2 ] );\t\t// 'same'\n * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );\t\t// 'prefix'\n * compareArrays( [ 0, 2 ], [ 0 ] );\t\t\t// 'extension'\n * compareArrays( [ 0, 2 ], [ 1, 2 ] );\t\t// 0\n * compareArrays( [ 0, 2 ], [ 0, 1 ] );\t\t// 1\n * ```\n *\n * @param a Array that is compared.\n * @param b Array to compare with.\n * @returns How array `a` is related to `b`.\n */ function compareArrays(a, b) {\n const minLen = Math.min(a.length, b.length);\n for(let i = 0; i < minLen; i++){\n if (a[i] != b[i]) {\n // The arrays are different.\n return i;\n }\n }\n // Both arrays were same at all points.\n if (a.length == b.length) {\n // If their length is also same, they are the same.\n return 'same';\n } else if (a.length < b.length) {\n // Compared array is shorter so it is a prefix of the other array.\n return 'prefix';\n } else {\n // Compared array is longer so it is an extension of the other array.\n return 'extension';\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/isiterable\n */ /**\n * Checks if value implements iterator interface.\n *\n * @param value The value to check.\n * @returns True if value implements iterator interface.\n */ function isIterable(value) {\n return !!(value && value[Symbol.iterator]);\n}\n\n/**\n * Creates an HTML or SVG element with attributes and children elements.\n *\n * ```ts\n * createElement( document, 'p' ); //

    \n * createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' } ); // \n * ```\n *\n * @param doc Document used to create the element.\n * @param name Name of the element.\n * @param attributes Object where keys represent attribute keys and values represent attribute values.\n * @param children Child or any iterable of children. Strings will be automatically turned into Text nodes.\n * @returns HTML or SVG element.\n */ function createElement(doc, name, attributes = {}, children = []) {\n const namespace = attributes && attributes.xmlns;\n const element = namespace ? doc.createElementNS(namespace, name) : doc.createElement(name);\n for(const key in attributes){\n element.setAttribute(key, attributes[key]);\n }\n if (isString(children) || !isIterable(children)) {\n children = [\n children\n ];\n }\n for (let child of children){\n if (isString(child)) {\n child = doc.createTextNode(child);\n }\n element.appendChild(child);\n }\n return element;\n}\n\n/**\n * Handles a configuration dictionary.\n *\n * @typeParam Cfg A type of the configuration dictionary.\n */ class Config {\n /**\n\t * Store for the whole configuration.\n\t */ _config;\n /**\n\t * Creates an instance of the {@link ~Config} class.\n\t *\n\t * @param configurations The initial configurations to be set. Usually, provided by the user.\n\t * @param defaultConfigurations The default configurations. Usually, provided by the system.\n\t */ constructor(configurations, defaultConfigurations){\n this._config = Object.create(null);\n // Set default configuration.\n if (defaultConfigurations) {\n // Clone the configuration to make sure that the properties will not be shared\n // between editors and make the watchdog feature work correctly.\n this.define(cloneConfig(defaultConfigurations));\n }\n // Set initial configuration.\n if (configurations) {\n this._setObjectToTarget(this._config, configurations);\n }\n }\n set(name, value) {\n this._setToTarget(this._config, name, value);\n }\n define(name, value) {\n const isDefine = true;\n this._setToTarget(this._config, name, value, isDefine);\n }\n /**\n\t * Gets the value for a configuration entry.\n\t *\n\t * ```ts\n\t * config.get( 'name' );\n\t * ```\n\t *\n\t * Deep configurations can be retrieved by separating each part with a dot.\n\t *\n\t * ```ts\n\t * config.get( 'toolbar.collapsed' );\n\t * ```\n\t *\n\t * @param name The configuration name. Configuration names are case-sensitive.\n\t * @returns The configuration value or `undefined` if the configuration entry was not found.\n\t */ get(name) {\n return this._getFromSource(this._config, name);\n }\n /**\n\t * Iterates over all top level configuration names.\n\t */ *names() {\n for (const name of Object.keys(this._config)){\n yield name;\n }\n }\n /**\n\t * Saves passed configuration to the specified target (nested object).\n\t *\n\t * @param target Nested config object.\n\t * @param name The configuration name or an object from which take properties as\n\t * configuration entries. Configuration names are case-sensitive.\n\t * @param value The configuration value. Used if a name is passed.\n\t * @param isDefine Define if passed configuration should overwrite existing one.\n\t */ _setToTarget(target, name, value, isDefine = false) {\n // In case of an object, iterate through it and call `_setToTarget` again for each property.\n if (isPlainObject(name)) {\n this._setObjectToTarget(target, name, isDefine);\n return;\n }\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts){\n // If there is no object for specified part then create one.\n if (!isPlainObject(target[part])) {\n target[part] = Object.create(null);\n }\n // Nested object becomes a target.\n target = target[part];\n }\n // In case of value is an object.\n if (isPlainObject(value)) {\n // We take care of proper config structure.\n if (!isPlainObject(target[name])) {\n target[name] = Object.create(null);\n }\n target = target[name];\n // And iterate through this object calling `_setToTarget` again for each property.\n this._setObjectToTarget(target, value, isDefine);\n return;\n }\n // Do nothing if we are defining configuration for non empty name.\n if (isDefine && typeof target[name] != 'undefined') {\n return;\n }\n target[name] = value;\n }\n /**\n\t * Get specified configuration from specified source (nested object).\n\t *\n\t * @param source level of nested object.\n\t * @param name The configuration name. Configuration names are case-sensitive.\n\t * @returns The configuration value or `undefined` if the configuration entry was not found.\n\t */ _getFromSource(source, name) {\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts){\n if (!isPlainObject(source[part])) {\n source = null;\n break;\n }\n // Nested object becomes a source.\n source = source[part];\n }\n // Always returns undefined for non existing configuration.\n return source ? cloneConfig(source[name]) : undefined;\n }\n /**\n\t * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.\n\t *\n\t * @param target Nested config object.\n\t * @param configuration Configuration data set\n\t * @param isDefine Defines if passed configuration is default configuration or not.\n\t */ _setObjectToTarget(target, configuration, isDefine) {\n Object.keys(configuration).forEach((key)=>{\n this._setToTarget(target, key, configuration[key], isDefine);\n });\n }\n}\n/**\n * Clones configuration object or value.\n */ function cloneConfig(source) {\n return cloneDeepWith(source, leaveItemReferences);\n}\n/**\n * A customized function for cloneDeepWith.\n * In case if it's a DOM Element it will leave references to DOM Elements instead of cloning them.\n * If it's a function it will leave reference to actuall function.\n */ function leaveItemReferences(value) {\n return isElement$1(value) || typeof value === 'function' ? value : undefined;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/isnode\n */ /**\n * Checks if the object is a native DOM Node.\n */ function isNode(obj) {\n if (obj) {\n if (obj.defaultView) {\n return obj instanceof obj.defaultView.Document;\n } else if (obj.ownerDocument && obj.ownerDocument.defaultView) {\n return obj instanceof obj.ownerDocument.defaultView.Node;\n }\n }\n return false;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/iswindow\n */ /**\n * Checks if the object is a native DOM Window.\n */ function isWindow(obj) {\n const stringifiedObject = Object.prototype.toString.apply(obj);\n // Returns `true` for the `window` object in browser environments.\n if (stringifiedObject == '[object Window]') {\n return true;\n }\n // Returns `true` for the `window` object in the Electron environment.\n if (stringifiedObject == '[object global]') {\n return true;\n }\n return false;\n}\n\nconst defaultEmitterClass = /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ EmitterMixin());\nfunction DomEmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass;\n }\n class Mixin extends base {\n listenTo(emitter, event, callback, options = {}) {\n // Check if emitter is an instance of DOM Node. If so, use corresponding ProxyEmitter (or create one if not existing).\n if (isNode(emitter) || isWindow(emitter) || emitter instanceof globalVar.window.EventTarget) {\n const proxyOptions = {\n capture: !!options.useCapture,\n passive: !!options.usePassive\n };\n const proxyEmitter = this._getProxyEmitter(emitter, proxyOptions) || new ProxyEmitter(emitter, proxyOptions);\n this.listenTo(proxyEmitter, event, callback, options);\n } else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.listenTo(emitter, event, callback, options);\n }\n }\n stopListening(emitter, event, callback) {\n // Check if the emitter is an instance of DOM Node. If so, forward the call to the corresponding ProxyEmitters.\n if (isNode(emitter) || isWindow(emitter) || emitter instanceof globalVar.window.EventTarget) {\n const proxyEmitters = this._getAllProxyEmitters(emitter);\n for (const proxy of proxyEmitters){\n this.stopListening(proxy, event, callback);\n }\n } else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.stopListening(emitter, event, callback);\n }\n }\n /**\n\t\t * Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.\n\t\t *\n\t\t * @param node DOM Node of the ProxyEmitter.\n\t\t * @param options Additional options.\n\t\t * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t\t * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t\t * and prevents blocking browser's main thread by this event handler.\n\t\t * @returns ProxyEmitter instance bound to the DOM Node.\n\t\t */ _getProxyEmitter(node, options) {\n return _getEmitterListenedTo(this, getProxyEmitterId(node, options));\n }\n /**\n\t\t * Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.\n\t\t *\n\t\t * @param node DOM Node of the ProxyEmitter.\n\t\t */ _getAllProxyEmitters(node) {\n return [\n {\n capture: false,\n passive: false\n },\n {\n capture: false,\n passive: true\n },\n {\n capture: true,\n passive: false\n },\n {\n capture: true,\n passive: true\n }\n ].map((options)=>this._getProxyEmitter(node, options)).filter((proxy)=>!!proxy);\n }\n }\n return Mixin;\n}\n/**\n * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events\n * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~Emitter#on}.\n * There is a separate instance for each combination of modes (useCapture & usePassive). The mode is concatenated with\n * UID stored in HTMLElement to give each instance unique identifier.\n *\n * listenTo( click, ... )\n * +-----------------------------------------+\n * | stopListening( ... ) |\n * +----------------------------+ | addEventListener( click, ... )\n * | Host | | +---------------------------------------------+\n * +----------------------------+ | | removeEventListener( click, ... ) |\n * | _listeningTo: { | +----------v-------------+ |\n * | UID+mode: { | | ProxyEmitter | |\n * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+\n * | callbacks: { | | events: { | | Node (HTMLElement) |\n * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+\n * | } | | }, | | data-ck-expando: UID |\n * | } | | _domNode: Node, | +-----------------------+\n * | } | | _domListeners: {}, | |\n * | +------------------------+ | | _emitterId: UID+mode | |\n * | | DomEmitterMixin | | +--------------^---------+ |\n * | +------------------------+ | | | |\n * +--------------^-------------+ | +---------------------------------------------+\n * | | click (DOM Event)\n * +-----------------------------------------+\n * fire( click, DOM Event )\n */ class ProxyEmitter extends /* #__PURE__ */ EmitterMixin() {\n _domNode;\n _options;\n /**\n\t * @param node DOM Node that fires events.\n\t * @param options Additional options.\n\t * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t * and prevents blocking browser's main thread by this event handler.\n\t */ constructor(node, options){\n super();\n // Set emitter ID to match DOM Node \"expando\" property.\n _setEmitterId(this, getProxyEmitterId(node, options));\n // Remember the DOM Node this ProxyEmitter is bound to.\n this._domNode = node;\n // And given options.\n this._options = options;\n }\n /**\n\t * Collection of native DOM listeners.\n\t */ _domListeners;\n /**\n\t * Registers a callback function to be executed when an event is fired.\n\t *\n\t * It attaches a native DOM listener to the DOM Node. When fired,\n\t * a corresponding Emitter event will also fire with DOM Event object as an argument.\n\t *\n\t * **Note**: This is automatically called by the\n\t * {@link module:utils/emittermixin~Emitter#listenTo `Emitter#listenTo()`}.\n\t *\n\t * @param event The name of the event.\n\t */ attach(event) {\n // If the DOM Listener for given event already exist it is pointless\n // to attach another one.\n if (this._domListeners && this._domListeners[event]) {\n return;\n }\n const domListener = this._createDomListener(event);\n // Attach the native DOM listener to DOM Node.\n this._domNode.addEventListener(event, domListener, this._options);\n if (!this._domListeners) {\n this._domListeners = {};\n }\n // Store the native DOM listener in this ProxyEmitter. It will be helpful\n // when stopping listening to the event.\n this._domListeners[event] = domListener;\n }\n /**\n\t * Stops executing the callback on the given event.\n\t *\n\t * **Note**: This is automatically called by the\n\t * {@link module:utils/emittermixin~Emitter#stopListening `Emitter#stopListening()`}.\n\t *\n\t * @param event The name of the event.\n\t */ detach(event) {\n let events;\n // Remove native DOM listeners which are orphans. If no callbacks\n // are awaiting given event, detach native DOM listener from DOM Node.\n // See: {@link attach}.\n if (this._domListeners[event] && (!(events = this._events[event]) || !events.callbacks.length)) {\n this._domListeners[event].removeListener();\n }\n }\n /**\n\t * Adds callback to emitter for given event.\n\t *\n\t * @internal\n\t * @param event The name of the event.\n\t * @param callback The function to be called on event.\n\t * @param options Additional options.\n\t */ _addEventListener(event, callback, options) {\n this.attach(event);\n EmitterMixin().prototype._addEventListener.call(this, event, callback, options);\n }\n /**\n\t * Removes callback from emitter for given event.\n\t *\n\t * @internal\n\t * @param event The name of the event.\n\t * @param callback The function to stop being called.\n\t */ _removeEventListener(event, callback) {\n EmitterMixin().prototype._removeEventListener.call(this, event, callback);\n this.detach(event);\n }\n /**\n\t * Creates a native DOM listener callback. When the native DOM event\n\t * is fired it will fire corresponding event on this ProxyEmitter.\n\t * Note: A native DOM Event is passed as an argument.\n\t *\n\t * @param event The name of the event.\n\t * @returns The DOM listener callback.\n\t */ _createDomListener(event) {\n const domListener = (domEvt)=>{\n this.fire(event, domEvt);\n };\n // Supply the DOM listener callback with a function that will help\n // detach it from the DOM Node, when it is no longer necessary.\n // See: {@link detach}.\n domListener.removeListener = ()=>{\n this._domNode.removeEventListener(event, domListener, this._options);\n delete this._domListeners[event];\n };\n return domListener;\n }\n}\n/**\n * Gets an unique DOM Node identifier. The identifier will be set if not defined.\n *\n * @returns UID for given DOM Node.\n */ function getNodeUID(node) {\n return node['data-ck-expando'] || (node['data-ck-expando'] = uid());\n}\n/**\n * Gets id of the ProxyEmitter for the given node.\n */ function getProxyEmitterId(node, options) {\n let id = getNodeUID(node);\n for (const option of Object.keys(options).sort()){\n if (options[option]) {\n id += '-' + option;\n }\n }\n return id;\n}\n\n/**\n * Returns the closest scrollable ancestor of a DOM element.\n *\n * @param domElement DOM element.\n * @returns First ancestor of `domElement` that is scrollable or null if such ancestor doesn't exist.\n */ function findClosestScrollableAncestor(domElement) {\n let element = domElement.parentElement;\n if (!element) {\n return null;\n }\n while(element.tagName != 'BODY'){\n const overflow = element.style.overflowY || globalVar.window.getComputedStyle(element).overflowY;\n if (overflow === 'auto' || overflow === 'scroll') {\n break;\n }\n element = element.parentElement;\n if (!element) {\n return null;\n }\n }\n return element;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getancestors\n */ /**\n * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the\n * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is\n * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`\n * at most, which will be returned).\n *\n * @param node DOM node.\n * @returns Array of given `node` parents.\n */ function getAncestors(node) {\n const nodes = [];\n let currentNode = node;\n // We are interested in `Node`s `DocumentFragment`s only.\n while(currentNode && currentNode.nodeType != Node.DOCUMENT_NODE){\n nodes.unshift(currentNode);\n currentNode = currentNode.parentNode;\n }\n return nodes;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getdatafromelement\n */ /**\n * Gets data from a given source element.\n *\n * @param el The element from which the data will be retrieved.\n * @returns The data string.\n */ function getDataFromElement(el) {\n if (el instanceof HTMLTextAreaElement) {\n return el.value;\n }\n return el.innerHTML;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getborderwidths\n */ /**\n * Returns an object containing CSS border widths of a specified HTML element.\n *\n * @param element An element which has CSS borders.\n * @returns An object containing `top`, `left`, `right` and `bottom` properties\n * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.\n */ function getBorderWidths(element) {\n // Call getComputedStyle on the window the element document belongs to.\n const style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n top: parseInt(style.borderTopWidth, 10),\n right: parseInt(style.borderRightWidth, 10),\n bottom: parseInt(style.borderBottomWidth, 10),\n left: parseInt(style.borderLeftWidth, 10)\n };\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getrangefrommouseevent\n */ /**\n * Returns a DOM range from a given point specified by a mouse event.\n *\n * @param domEvent The mouse event.\n * @returns The DOM range.\n */ function getRangeFromMouseEvent(domEvent) {\n if (!domEvent.target) {\n return null;\n }\n const domDoc = domEvent.target.ownerDocument;\n const x = domEvent.clientX;\n const y = domEvent.clientY;\n let domRange = null;\n // Webkit & Blink.\n if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) {\n domRange = domDoc.caretRangeFromPoint(x, y);\n } else if (domEvent.rangeParent) {\n domRange = domDoc.createRange();\n domRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n domRange.collapse(true);\n }\n return domRange;\n}\n\n/**\n * Searches and returns the lowest common ancestor of two given nodes.\n *\n * @param nodeA First node.\n * @param nodeB Second node.\n * @returns Lowest common ancestor of both nodes or `null` if nodes do not have a common ancestor.\n */ function getCommonAncestor(nodeA, nodeB) {\n const ancestorsA = getAncestors(nodeA);\n const ancestorsB = getAncestors(nodeB);\n let i = 0;\n // It does not matter which array is shorter.\n while(ancestorsA[i] == ancestorsB[i] && ancestorsA[i]){\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n}\n\n/**\n * For a given element, returns the nearest ancestor element which CSS position is not \"static\".\n *\n * @param element The native DOM element to be checked.\n */ function getPositionedAncestor(element) {\n if (!element || !element.parentNode) {\n return null;\n }\n if (element.offsetParent === globalVar.document.body) {\n return null;\n }\n return element.offsetParent;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/istext\n */ /**\n * Checks if the object is a native DOM Text node.\n */ function isText(obj) {\n return Object.prototype.toString.call(obj) == '[object Text]';\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/isrange\n */ /**\n * Checks if the object is a native DOM Range.\n */ function isRange(obj) {\n return Object.prototype.toString.apply(obj) == '[object Range]';\n}\n\nconst RECT_PROPERTIES = [\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height'\n];\nconst POSITIONING_VALUES = new Set([\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky'\n]);\n/**\n * A helper class representing a `ClientRect` object, e.g. value returned by\n * the native `object.getBoundingClientRect()` method. Provides a set of methods\n * to manipulate the rect and compare it against other rect instances.\n */ class Rect {\n /**\n\t * The \"top\" value of the rect.\n\t *\n\t * @readonly\n\t */ top;\n /**\n\t * The \"right\" value of the rect.\n\t *\n\t * @readonly\n\t */ right;\n /**\n\t * The \"bottom\" value of the rect.\n\t *\n\t * @readonly\n\t */ bottom;\n /**\n\t * The \"left\" value of the rect.\n\t *\n\t * @readonly\n\t */ left;\n /**\n\t * The \"width\" value of the rect.\n\t *\n\t * @readonly\n\t */ width;\n /**\n\t * The \"height\" value of the rect.\n\t *\n\t * @readonly\n\t */ height;\n /**\n\t * The object this rect is for.\n\t *\n\t * @readonly\n\t */ _source;\n /**\n\t * Creates an instance of rect.\n\t *\n\t * ```ts\n\t * // Rect of an HTMLElement.\n\t * const rectA = new Rect( document.body );\n\t *\n\t * // Rect of a DOM Range.\n\t * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );\n\t *\n\t * // Rect of a window (web browser viewport).\n\t * const rectC = new Rect( window );\n\t *\n\t * // Rect out of an object.\n\t * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );\n\t *\n\t * // Rect out of another Rect instance.\n\t * const rectE = new Rect( rectD );\n\t *\n\t * // Rect out of a ClientRect.\n\t * const rectF = new Rect( document.body.getClientRects().item( 0 ) );\n\t * ```\n\t *\n\t * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)\n\t * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}\n\t * to get the inner part of the rect.\n\t *\n\t * @param source A source object to create the rect.\n\t */ constructor(source){\n const isSourceRange = isRange(source);\n Object.defineProperty(this, '_source', {\n // If the source is a Rect instance, copy it's #_source.\n value: source._source || source,\n writable: true,\n enumerable: false\n });\n if (isDomElement(source) || isSourceRange) {\n // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source\n // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods\n // will fail to obtain the geometry and the rect instance makes little sense to the features using it.\n // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.\n // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;\n // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {\n // @if CK_DEBUG // \tconsole.warn(\n // @if CK_DEBUG // \t\t'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',\n // @if CK_DEBUG // \t\t{ source } );\n // @if CK_DEBUG // }\n if (isSourceRange) {\n const rangeRects = Rect.getDomRangeRects(source);\n copyRectProperties(this, Rect.getBoundingRect(rangeRects));\n } else {\n copyRectProperties(this, source.getBoundingClientRect());\n }\n } else if (isWindow(source)) {\n const { innerWidth, innerHeight } = source;\n copyRectProperties(this, {\n top: 0,\n right: innerWidth,\n bottom: innerHeight,\n left: 0,\n width: innerWidth,\n height: innerHeight\n });\n } else {\n copyRectProperties(this, source);\n }\n }\n /**\n\t * Returns a clone of the rect.\n\t *\n\t * @returns A cloned rect.\n\t */ clone() {\n return new Rect(this);\n }\n /**\n\t * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.\n\t *\n\t * @param x Desired horizontal location.\n\t * @param y Desired vertical location.\n\t * @returns A rect which has been moved.\n\t */ moveTo(x, y) {\n this.top = y;\n this.right = x + this.width;\n this.bottom = y + this.height;\n this.left = x;\n return this;\n }\n /**\n\t * Moves the rect in–place by a dedicated offset.\n\t *\n\t * @param x A horizontal offset.\n\t * @param y A vertical offset\n\t * @returns A rect which has been moved.\n\t */ moveBy(x, y) {\n this.top += y;\n this.right += x;\n this.left += x;\n this.bottom += y;\n return this;\n }\n /**\n\t * Returns a new rect a a result of intersection with another rect.\n\t */ getIntersection(anotherRect) {\n const rect = {\n top: Math.max(this.top, anotherRect.top),\n right: Math.min(this.right, anotherRect.right),\n bottom: Math.min(this.bottom, anotherRect.bottom),\n left: Math.max(this.left, anotherRect.left),\n width: 0,\n height: 0\n };\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n if (rect.width < 0 || rect.height < 0) {\n return null;\n } else {\n const newRect = new Rect(rect);\n newRect._source = this._source;\n return newRect;\n }\n }\n /**\n\t * Returns the area of intersection with another rect.\n\t *\n\t * @returns Area of intersection.\n\t */ getIntersectionArea(anotherRect) {\n const rect = this.getIntersection(anotherRect);\n if (rect) {\n return rect.getArea();\n } else {\n return 0;\n }\n }\n /**\n\t * Returns the area of the rect.\n\t */ getArea() {\n return this.width * this.height;\n }\n /**\n\t * Returns a new rect, a part of the original rect, which is actually visible to the user and is relative to the,`body`,\n\t * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS\n\t * other than `\"visible\"`.\n\t *\n\t * If there's no such visible rect, which is when the rect is limited by one or many of\n\t * the ancestors, `null` is returned.\n\t *\n\t * **Note**: This method does not consider the boundaries of the viewport (window).\n\t * To get a rect cropped by all ancestors and the viewport, use an intersection such as:\n\t *\n\t * ```ts\n\t * const visibleInViewportRect = new Rect( window ).getIntersection( new Rect( source ).getVisible() );\n\t * ```\n\t *\n\t * @returns A visible rect instance or `null`, if there's none.\n\t */ getVisible() {\n const source = this._source;\n let visibleRect = this.clone();\n // There's no ancestor to crop with the overflow.\n if (isBody(source)) {\n return visibleRect;\n }\n let child = source;\n let parent = source.parentNode || source.commonAncestorContainer;\n let lastPositionedChildElement;\n // Check the ancestors all the way up to the .\n while(parent && !isBody(parent)){\n const isNonClippingParent = getElementOverflow(parent) === 'visible';\n if (isPositioned(child)) {\n lastPositionedChildElement = child;\n }\n // 1. If a parent has overflow: visible, it can be safely skipped in consideration for any parent-child configuration.\n // 2. If a parent has any other overflow (it clips), for the actual clipping to happen the following must be true:\n // * the last positioned child must have `position: absolute`,\n // * the parent must have a position other than `position: static`.\n //\n // https://github.com/ckeditor/ckeditor5/issues/14107.\n if (isNonClippingParent || lastPositionedChildElement && getElementPosition(lastPositionedChildElement) === 'absolute' && !isPositioned(parent)) {\n child = parent;\n parent = parent.parentNode;\n continue;\n }\n const parentRect = new Rect(parent);\n const intersectionRect = visibleRect.getIntersection(parentRect);\n if (intersectionRect) {\n if (intersectionRect.getArea() < visibleRect.getArea()) {\n // Reduce the visible rect to the intersection.\n visibleRect = intersectionRect;\n }\n } else {\n // There's no intersection, the rect is completely invisible.\n return null;\n }\n child = parent;\n parent = parent.parentNode;\n }\n return visibleRect;\n }\n /**\n\t * Checks if all property values ({@link #top}, {@link #left}, {@link #right},\n\t * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect\n\t * instances.\n\t *\n\t * @param anotherRect A rect instance to compare with.\n\t * @returns `true` when Rects are equal. `false` otherwise.\n\t */ isEqual(anotherRect) {\n for (const prop of RECT_PROPERTIES){\n if (this[prop] !== anotherRect[prop]) {\n return false;\n }\n }\n return true;\n }\n /**\n\t * Checks whether a rect fully contains another rect instance.\n\t *\n\t * @param anotherRect\n\t * @returns `true` if contains, `false` otherwise.\n\t */ contains(anotherRect) {\n const intersectRect = this.getIntersection(anotherRect);\n return !!(intersectRect && intersectRect.isEqual(anotherRect));\n }\n /**\n\t * Recalculates screen coordinates to coordinates relative to the positioned ancestor offset.\n\t */ toAbsoluteRect() {\n const { scrollX, scrollY } = globalVar.window;\n const absoluteRect = this.clone().moveBy(scrollX, scrollY);\n if (isDomElement(absoluteRect._source)) {\n const positionedAncestor = getPositionedAncestor(absoluteRect._source);\n if (positionedAncestor) {\n shiftRectToCompensatePositionedAncestor(absoluteRect, positionedAncestor);\n }\n }\n return absoluteRect;\n }\n /**\n\t * Excludes scrollbars and CSS borders from the rect.\n\t *\n\t * * Borders are removed when {@link #_source} is an HTML element.\n\t * * Scrollbars are excluded from HTML elements and the `window`.\n\t *\n\t * @returns A rect which has been updated.\n\t */ excludeScrollbarsAndBorders() {\n const source = this._source;\n let scrollBarWidth, scrollBarHeight, direction;\n if (isWindow(source)) {\n scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;\n scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;\n direction = source.getComputedStyle(source.document.documentElement).direction;\n } else {\n const borderWidths = getBorderWidths(source);\n scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;\n scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;\n direction = source.ownerDocument.defaultView.getComputedStyle(source).direction;\n this.left += borderWidths.left;\n this.top += borderWidths.top;\n this.right -= borderWidths.right;\n this.bottom -= borderWidths.bottom;\n this.width = this.right - this.left;\n this.height = this.bottom - this.top;\n }\n this.width -= scrollBarWidth;\n if (direction === 'ltr') {\n this.right -= scrollBarWidth;\n } else {\n this.left += scrollBarWidth;\n }\n this.height -= scrollBarHeight;\n this.bottom -= scrollBarHeight;\n return this;\n }\n /**\n\t * Returns an array of rects of the given native DOM Range.\n\t *\n\t * Also see {@link module:utils/dom/rect~Rect.getDomElementRects}.\n\t *\n\t * @param range A native DOM range.\n\t * @returns DOM Range rects.\n\t */ static getDomRangeRects(range) {\n const rects = [];\n // Safari does not iterate over ClientRectList using for...of loop.\n const clientRects = Array.from(range.getClientRects());\n if (clientRects.length) {\n for (const rect of clientRects){\n const r = new Rect(rect);\n // Point the rect source to the DOM range instead of of the DOM client rect to allow proper clipping,\n // in `Rect#getVisible()` method.\n r._source = range;\n rects.push(r);\n }\n } else {\n let startContainer = range.startContainer;\n if (isText(startContainer)) {\n startContainer = startContainer.parentNode;\n }\n const rect = new Rect(startContainer.getBoundingClientRect());\n rect.right = rect.left;\n rect.width = 0;\n rects.push(rect);\n }\n return rects;\n }\n /**\n\t * Returns an array of Rects of the given DOM Element based on its native `getClientRects()` method.\n\t *\n\t * Also see {@link module:utils/dom/rect~Rect.getDomRangeRects}.\n\t */ static getDomElementRects(element) {\n return Array.from(element.getClientRects()).map((clientRect)=>{\n const rect = new Rect(clientRect);\n // Point the rect source to the DOM element instead of of the DOM client rect to allow proper clipping,\n // in `Rect#getVisible()` method.\n rect._source = element;\n return rect;\n });\n }\n /**\n\t * Returns a bounding rectangle that contains all the given `rects`.\n\t *\n\t * @param rects A list of rectangles that should be contained in the result rectangle.\n\t * @returns Bounding rectangle or `null` if no `rects` were given.\n\t */ static getBoundingRect(rects) {\n const boundingRectData = {\n left: Number.POSITIVE_INFINITY,\n top: Number.POSITIVE_INFINITY,\n right: Number.NEGATIVE_INFINITY,\n bottom: Number.NEGATIVE_INFINITY,\n width: 0,\n height: 0\n };\n let rectangleCount = 0;\n for (const rect of rects){\n rectangleCount++;\n boundingRectData.left = Math.min(boundingRectData.left, rect.left);\n boundingRectData.top = Math.min(boundingRectData.top, rect.top);\n boundingRectData.right = Math.max(boundingRectData.right, rect.right);\n boundingRectData.bottom = Math.max(boundingRectData.bottom, rect.bottom);\n }\n if (rectangleCount == 0) {\n return null;\n }\n boundingRectData.width = boundingRectData.right - boundingRectData.left;\n boundingRectData.height = boundingRectData.bottom - boundingRectData.top;\n return new Rect(boundingRectData);\n }\n}\n/**\n * Acquires all the rect properties from the passed source.\n */ function copyRectProperties(rect, source) {\n for (const p of RECT_PROPERTIES){\n rect[p] = source[p];\n }\n}\n/**\n * Checks if provided object is a HTML element.\n */ function isBody(value) {\n if (!isDomElement(value)) {\n return false;\n }\n return value === value.ownerDocument.body;\n}\n/**\n * Checks if provided object \"looks like\" a DOM Element and has API required by `Rect` class.\n */ function isDomElement(value) {\n // Note: earlier we used `isElement()` from lodash library, however that function is less performant because\n // it makes complicated checks to make sure that given value is a DOM element.\n return value !== null && typeof value === 'object' && value.nodeType === 1 && typeof value.getBoundingClientRect === 'function';\n}\n/**\n * Returns the value of the `position` style of an `HTMLElement`.\n */ function getElementPosition(element) {\n return element.ownerDocument.defaultView.getComputedStyle(element).position;\n}\n/**\n * Returns the value of the `overflow` style of an `HTMLElement` or a `Range`.\n */ function getElementOverflow(element) {\n return element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).overflow : 'visible';\n}\n/**\n * Checks if the given node is positioned in any other way than `position: static`.\n */ function isPositioned(node) {\n return node instanceof HTMLElement && POSITIONING_VALUES.has(getElementPosition(node));\n}\n/**\n * For a given absolute Rect coordinates object and a positioned element ancestor, it updates its\n * coordinates that make up for the position and the scroll of the ancestor.\n *\n * This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates\n * are used in real–life to position elements with `position: absolute`, which are scoped by any positioned\n * (and scrollable) ancestors.\n */ function shiftRectToCompensatePositionedAncestor(rect, positionedElementAncestor) {\n const ancestorPosition = new Rect(positionedElementAncestor);\n const ancestorBorderWidths = getBorderWidths(positionedElementAncestor);\n let moveX = 0;\n let moveY = 0;\n // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)\n // If there's some positioned ancestor of the panel, then its `Rect` must be taken into\n // consideration. `Rect` is always relative to the viewport while `position: absolute` works\n // with respect to that positioned ancestor.\n moveX -= ancestorPosition.left;\n moveY -= ancestorPosition.top;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, not only its position must be taken into\n // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`\n // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`\n // must compensate that scrolling.\n moveX += positionedElementAncestor.scrollLeft;\n moveY += positionedElementAncestor.scrollTop;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`\n // while `position: absolute` positioning does not consider it.\n // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,\n // not upper-left corner of its border.\n moveX -= ancestorBorderWidths.left;\n moveY -= ancestorBorderWidths.top;\n rect.moveBy(moveX, moveY);\n}\n\n/**\n * A helper class which instances allow performing custom actions when native DOM elements are resized.\n *\n * ```ts\n * const editableElement = editor.editing.view.getDomRoot();\n *\n * const observer = new ResizeObserver( editableElement, entry => {\n * \tconsole.log( 'The editable element has been resized in DOM.' );\n * \tconsole.log( entry.target ); // -> editableElement\n * \tconsole.log( entry.contentRect.width ); // -> e.g. '423px'\n * } );\n * ```\n *\n * It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)\n * under the hood.\n */ class ResizeObserver {\n /**\n\t * The element observed by this observer.\n\t */ _element;\n /**\n\t * The callback executed each time {@link #_element} is resized.\n\t */ _callback;\n /**\n\t * The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t */ static _observerInstance = null;\n /**\n\t * A mapping of native DOM elements and their callbacks shared across all\n\t * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t */ static _elementCallbacks = null;\n /**\n\t * Creates an instance of the `ResizeObserver` class.\n\t *\n\t * @param element A DOM element that is to be observed for resizing. Note that\n\t * the element must be visible (i.e. not detached from DOM) for the observer to work.\n\t * @param callback A function called when the observed element was resized. It passes\n\t * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n\t * object with information about the resize event.\n\t */ constructor(element, callback){\n // **Note**: For the maximum performance, this class ensures only a single instance of the native\n // observer is used no matter how many instances of this class were created.\n if (!ResizeObserver._observerInstance) {\n ResizeObserver._createObserver();\n }\n this._element = element;\n this._callback = callback;\n ResizeObserver._addElementCallback(element, callback);\n ResizeObserver._observerInstance.observe(element);\n }\n /**\n\t * The element observed by this observer.\n\t */ get element() {\n return this._element;\n }\n /**\n\t * Destroys the observer which disables the `callback` passed to the {@link #constructor}.\n\t */ destroy() {\n ResizeObserver._deleteElementCallback(this._element, this._callback);\n }\n /**\n\t * Registers a new resize callback for the DOM element.\n\t */ static _addElementCallback(element, callback) {\n if (!ResizeObserver._elementCallbacks) {\n ResizeObserver._elementCallbacks = new Map();\n }\n let callbacks = ResizeObserver._elementCallbacks.get(element);\n if (!callbacks) {\n callbacks = new Set();\n ResizeObserver._elementCallbacks.set(element, callbacks);\n }\n callbacks.add(callback);\n }\n /**\n\t * Removes a resize callback from the DOM element. If no callbacks are left\n\t * for the element, it removes the element from the native observer.\n\t */ static _deleteElementCallback(element, callback) {\n const callbacks = ResizeObserver._getElementCallbacks(element);\n // Remove the element callback. Check if exist first in case someone\n // called destroy() twice.\n if (callbacks) {\n callbacks.delete(callback);\n // If no callbacks left for the element, also remove the element.\n if (!callbacks.size) {\n ResizeObserver._elementCallbacks.delete(element);\n ResizeObserver._observerInstance.unobserve(element);\n }\n }\n if (ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size) {\n ResizeObserver._observerInstance = null;\n ResizeObserver._elementCallbacks = null;\n }\n }\n /**\n\t * Returns are registered resize callbacks for the DOM element.\n\t */ static _getElementCallbacks(element) {\n if (!ResizeObserver._elementCallbacks) {\n return null;\n }\n return ResizeObserver._elementCallbacks.get(element);\n }\n /**\n\t * Creates the single native observer shared across all `ResizeObserver` instances.\n\t */ static _createObserver() {\n ResizeObserver._observerInstance = new globalVar.window.ResizeObserver((entries)=>{\n for (const entry of entries){\n const callbacks = ResizeObserver._getElementCallbacks(entry.target);\n if (callbacks) {\n for (const callback of callbacks){\n callback(entry);\n }\n }\n }\n });\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/setdatainelement\n */ /**\n * Sets data in a given element.\n *\n * @param el The element in which the data will be set.\n * @param data The data string.\n */ function setDataInElement(el, data) {\n if (el instanceof HTMLTextAreaElement) {\n el.value = data;\n }\n el.innerHTML = data;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/tounit\n */ /**\n * Returns a helper function, which adds a desired trailing\n * `unit` to the passed value.\n *\n * @param unit An unit like \"px\" or \"em\".\n */ function toUnit(unit) {\n return (value)=>value + unit;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/indexof\n */ /**\n * Returns index of the node in the parent element.\n *\n * @param node Node which index is tested.\n * @returns Index of the node in the parent element. Returns 0 if node has no parent.\n */ function indexOf(node) {\n let index = 0;\n while(node.previousSibling){\n node = node.previousSibling;\n index++;\n }\n return index;\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/insertat\n */ /**\n * Inserts node to the parent at given index.\n *\n * @param parentElement Parent element.\n * @param index Insertions index.\n * @param nodeToInsert Node to insert.\n */ function insertAt(parentElement, index, nodeToInsert) {\n parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/iscomment\n */ /**\n * Checks whether the object is a native DOM Comment node.\n */ function isComment(obj) {\n return obj && obj.nodeType === Node.COMMENT_NODE;\n}\n\n/**\n * Checks if the given attribute name is valid in terms of HTML.\n *\n * @param name Attribute name.\n */ function isValidAttributeName(name) {\n try {\n globalVar.document.createAttribute(name);\n } catch {\n return false;\n }\n return true;\n}\n\n/**\n * Checks whether the element is visible to the user in DOM:\n *\n * * connected to the root of the document,\n * * has no `display: none`,\n * * has no ancestors with `display: none`.\n *\n * **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..\n * To check that, use {@link module:utils/dom/rect~Rect} instead.\n */ function isVisible(element) {\n if (!element) {\n return false;\n }\n if (isText(element)) {\n return isVisible(element.parentElement);\n }\n if (element.getClientRects) {\n return !!element.getClientRects().length;\n }\n return false;\n}\n\n// @if CK_DEBUG_POSITION // const {\n// @if CK_DEBUG_POSITION // \tdefault: RectDrawer,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesBlack,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesRed\n// @if CK_DEBUG_POSITION // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );\n// @if CK_DEBUG_POSITION // const TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineStyle: 'dashed', outlineColor: 'blue', outlineOffset: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION //\t\t...diagonalStylesBlack,\n// @if CK_DEBUG_POSITION //\t\topacity: '1',\n// @if CK_DEBUG_POSITION //\t\tbackgroundColor: '#00000033',\n// @if CK_DEBUG_POSITION //\t\toutlineWidth: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VIEWPORT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px',\n// @if CK_DEBUG_POSITION // \toutlineStyle: 'solid',\n// @if CK_DEBUG_POSITION // \toutlineColor: 'red'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_LIMITER_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \t...diagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const ELEMENT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineColor: 'orange', outlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const CHOSEN_POSITION_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \topacity: .5, outlineColor: 'magenta', backgroundColor: 'magenta'\n// @if CK_DEBUG_POSITION // };\n/**\n * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the\n * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry\n * into consideration.\n *\n * **Note**: If there are no position coordinates found that meet the requirements (arguments of this helper),\n * `null` is returned.\n *\n * ```ts\n * // The element which is to be positioned.\n * const element = document.body.querySelector( '#toolbar' );\n *\n * // A target to which the element is positioned relatively.\n * const target = document.body.querySelector( '#container' );\n *\n * // Finding the optimal coordinates for the positioning.\n * const { left, top, name } = getOptimalPosition( {\n * \telement: element,\n * \ttarget: target,\n *\n * \t// The algorithm will chose among these positions to meet the requirements such\n * \t// as \"limiter\" element or \"fitInViewport\", set below. The positions are considered\n * \t// in the order of the array.\n * \tpositions: [\n * \t\t//\n * \t \t//\t[ Target ]\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\n * \t\ttargetRect => ( {\n * \t\t\ttop: targetRect.bottom,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'mySouthEastPosition'\n * \t\t} ),\n *\n * \t\t//\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\t[ Target ]\n * \t\t//\n * \t\t( targetRect, elementRect ) => ( {\n * \t\t\ttop: targetRect.top - elementRect.height,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'myNorthEastPosition'\n * \t\t} )\n * \t],\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of .\n * \tlimiter: document.body,\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of the browser viewport.\n * \tfitInViewport: true\n * } );\n *\n * // The best position which fits into document.body and the viewport. May be useful\n * // to set proper class on the `element`.\n * console.log( name ); // -> \"myNorthEastPosition\"\n *\n * // Using the absolute coordinates which has been found to position the element\n * // as in the diagram depicting the \"myNorthEastPosition\" position.\n * element.style.top = top;\n * element.style.left = left;\n * ```\n *\n * @param options The input data and configuration of the helper.\n */ function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }) {\n // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-utils/issues/157\n if (isFunction(target)) {\n target = target();\n }\n // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-ui/issues/260\n if (isFunction(limiter)) {\n limiter = limiter();\n }\n const positionedElementAncestor = getPositionedAncestor(element);\n const constrainedViewportRect = getConstrainedViewportRect(viewportOffsetConfig);\n const elementRect = new Rect(element);\n const visibleTargetRect = getVisibleViewportIntersectionRect(target, constrainedViewportRect);\n let bestPosition;\n // @if CK_DEBUG_POSITION // const targetRect = new Rect( target );\n // @if CK_DEBUG_POSITION // RectDrawer.clear();\n // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, TARGET_RECT_STYLE, 'Target' );\n // @if CK_DEBUG_POSITION // if ( constrainedViewportRect ) {\n // @if CK_DEBUG_POSITION //\t\tRectDrawer.draw( constrainedViewportRect, VIEWPORT_RECT_STYLE, 'Viewport' );\n // @if CK_DEBUG_POSITION // }\n // If the target got cropped by ancestors or went off the screen, positioning does not make any sense.\n if (!visibleTargetRect || !constrainedViewportRect.getIntersection(visibleTargetRect)) {\n return null;\n }\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( visibleTargetRect, VISIBLE_TARGET_RECT_STYLE, 'VisTgt' );\n const positionOptions = {\n targetRect: visibleTargetRect,\n elementRect,\n positionedElementAncestor,\n viewportRect: constrainedViewportRect\n };\n // If there are no limits, just grab the very first position and be done with that drama.\n if (!limiter && !fitInViewport) {\n bestPosition = new PositionObject(positions[0], positionOptions);\n } else {\n if (limiter) {\n const visibleLimiterRect = getVisibleViewportIntersectionRect(limiter, constrainedViewportRect);\n if (visibleLimiterRect) {\n positionOptions.limiterRect = visibleLimiterRect;\n // @if CK_DEBUG_POSITION // RectDrawer.draw( visibleLimiterRect, VISIBLE_LIMITER_RECT_STYLE, 'VisLim' );\n }\n }\n // If there's no best position found, i.e. when all intersections have no area because\n // rects have no width or height, then just return `null`\n bestPosition = getBestPosition(positions, positionOptions);\n }\n return bestPosition;\n}\n/**\n * Returns intersection of visible source `Rect` with Viewport `Rect`. In case when source `Rect` is not visible\n * or there is no intersection between source `Rect` and Viewport `Rect`, `null` will be returned.\n */ function getVisibleViewportIntersectionRect(source, viewportRect) {\n const visibleSourceRect = new Rect(source).getVisible();\n if (!visibleSourceRect) {\n return null;\n }\n return visibleSourceRect.getIntersection(viewportRect);\n}\n/**\n * Returns a viewport `Rect` shrunk by the viewport offset config from all sides.\n */ function getConstrainedViewportRect(viewportOffsetConfig) {\n viewportOffsetConfig = Object.assign({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n }, viewportOffsetConfig);\n const viewportRect = new Rect(globalVar.window);\n viewportRect.top += viewportOffsetConfig.top;\n viewportRect.height -= viewportOffsetConfig.top;\n viewportRect.bottom -= viewportOffsetConfig.bottom;\n viewportRect.height -= viewportOffsetConfig.bottom;\n viewportRect.left += viewportOffsetConfig.left;\n viewportRect.right -= viewportOffsetConfig.right;\n viewportRect.width -= viewportOffsetConfig.left + viewportOffsetConfig.right;\n return viewportRect;\n}\n/**\n * For a given array of positioning functions, returns such that provides the best\n * fit of the `elementRect` into the `limiterRect` and `viewportRect`.\n */ function getBestPosition(positions, options) {\n const { elementRect } = options;\n // This is when element is fully visible.\n const elementRectArea = elementRect.getArea();\n const positionInstances = positions.map((positioningFunction)=>new PositionObject(positioningFunction, options))// Some positioning functions may return `null` if they don't want to participate.\n .filter((position)=>!!position.name);\n let maxFitFactor = 0;\n let bestPosition = null;\n for (const position of positionInstances){\n const { limiterIntersectionArea, viewportIntersectionArea } = position;\n // If a such position is found that element is fully contained by the limiter then, obviously,\n // there will be no better one, so finishing.\n if (limiterIntersectionArea === elementRectArea) {\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, CHOSEN_POSITION_RECT_STYLE, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'100% fit',\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\n return position;\n }\n // To maximize both viewport and limiter intersection areas we use distance on _viewportIntersectionArea\n // and _limiterIntersectionArea plane (without sqrt because we are looking for max value).\n const fitFactor = viewportIntersectionArea ** 2 + limiterIntersectionArea ** 2;\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, { opacity: .4 }, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'Vi=' + Math.round( viewportIntersectionArea ),\n // @if CK_DEBUG_POSITION //\t\t'Li=' + Math.round( limiterIntersectionArea )\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\n if (fitFactor > maxFitFactor) {\n maxFitFactor = fitFactor;\n bestPosition = position;\n }\n }\n // @if CK_DEBUG_POSITION // if ( bestPosition ) {\n // @if CK_DEBUG_POSITION // \tRectDrawer.draw( bestPosition._rect, CHOSEN_POSITION_RECT_STYLE );\n // @if CK_DEBUG_POSITION // }\n return bestPosition;\n}\n/**\n * A position class which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.\n *\n * {@link module:utils/dom/position~Position#top} and {@link module:utils/dom/position~Position#left} properties of the position instance\n * translate directly to the `top` and `left` properties in CSS \"`position: absolute` coordinate system\". If set on the positioned element\n * in DOM, they will make it display it in the right place in the viewport.\n */ class PositionObject {\n name;\n config;\n _positioningFunctionCoordinates;\n _options;\n _cachedRect;\n _cachedAbsoluteRect;\n /**\n\t * Creates an instance of the {@link module:utils/dom/position~PositionObject} class.\n\t *\n\t * @param positioningFunction function The function that defines the expected\n\t * coordinates the positioned element should move to.\n\t * @param options options object.\n\t * @param options.elementRect The positioned element rect.\n\t * @param options.targetRect The target element rect.\n\t * @param options.viewportRect The viewport rect.\n\t * @param options.limiterRect The limiter rect.\n\t * @param options.positionedElementAncestor Nearest element ancestor element which CSS position is not \"static\".\n\t */ constructor(positioningFunction, options){\n const positioningFunctionOutput = positioningFunction(options.targetRect, options.elementRect, options.viewportRect, options.limiterRect);\n // Nameless position for a function that didn't participate.\n if (!positioningFunctionOutput) {\n return;\n }\n const { left, top, name, config } = positioningFunctionOutput;\n this.name = name;\n this.config = config;\n this._positioningFunctionCoordinates = {\n left,\n top\n };\n this._options = options;\n }\n /**\n\t * The left value in pixels in the CSS `position: absolute` coordinate system.\n\t * Set it on the positioned element in DOM to move it to the position.\n\t */ get left() {\n return this._absoluteRect.left;\n }\n /**\n\t * The top value in pixels in the CSS `position: absolute` coordinate system.\n\t * Set it on the positioned element in DOM to move it to the position.\n\t */ get top() {\n return this._absoluteRect.top;\n }\n /**\n\t * An intersection area between positioned element and limiter within viewport constraints.\n\t */ get limiterIntersectionArea() {\n const limiterRect = this._options.limiterRect;\n if (limiterRect) {\n return limiterRect.getIntersectionArea(this._rect);\n }\n return 0;\n }\n /**\n\t * An intersection area between positioned element and viewport.\n\t */ get viewportIntersectionArea() {\n const viewportRect = this._options.viewportRect;\n return viewportRect.getIntersectionArea(this._rect);\n }\n /**\n\t * An already positioned element rect. A clone of the element rect passed to the constructor\n\t * but placed in the viewport according to the positioning function.\n\t */ get _rect() {\n if (this._cachedRect) {\n return this._cachedRect;\n }\n this._cachedRect = this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left, this._positioningFunctionCoordinates.top);\n return this._cachedRect;\n }\n /**\n\t * An already absolutely positioned element rect. See ({@link #_rect}).\n\t */ get _absoluteRect() {\n if (this._cachedAbsoluteRect) {\n return this._cachedAbsoluteRect;\n }\n this._cachedAbsoluteRect = this._rect.toAbsoluteRect();\n return this._cachedAbsoluteRect;\n }\n}\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/remove\n */ /**\n * Removes given node from parent.\n *\n * @param node Node to remove.\n */ function remove(node) {\n const parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n}\n\n/**\n * Returns the visual viewport offsets to adjust elements with `position: fixed` style.\n */ function getVisualViewportOffset() {\n const visualViewport = globalVar.window.visualViewport;\n if (!visualViewport || !(env.isiOS || env.isSafari)) {\n return {\n left: 0,\n top: 0\n };\n }\n const left = Math.max(Math.round(visualViewport.offsetLeft), 0);\n const top = Math.max(Math.round(visualViewport.offsetTop), 0);\n return {\n left,\n top\n };\n}\n\n/**\n * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.\n * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to\n * the user. If the `target` is already visible, nothing will happen.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.target A target, which supposed to become visible to the user.\n * @param options.viewportOffset An offset from the edge of the viewport (in pixels)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the viewport and thus making it easier to\n * read or edit by the user.\n * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the ancestors and thus making it easier to\n * read or edit by the user.\n * @param options.alignToTop When set `true`, the helper will make sure the `target` is scrolled up\n * to the top boundary of the viewport and/or scrollable ancestors if scrolled up. When not set\n * (default), the `target` will be revealed by scrolling as little as possible. This option will\n * not affect `targets` that must be scrolled down because they will appear at the top of the boundary\n * anyway.\n *\n * ```\n * scrollViewportToShowTarget() with scrollViewportToShowTarget() with\n * Initial state alignToTop unset (default) alignToTop = true\n *\n * ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐\n * │ │▲│ │ │▲│ │ [ Target to be revealed ] │▲│\n * │ │ │ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │ │ │ │█│ │ │ │\n * │ │ │ │ │█│ │ │█│\n * │ │ │ │ │ │ │ │█│\n * │ │▼│ │ [ Target to be revealed ] │▼│ │ │▼│\n * └────────────────────────────────┴─┘ └────────────────────────────────┴─┘ └────────────────────────────────┴─┘\n *\n *\n * [ Target to be revealed ]\n *```\n *\n * @param options.forceScroll When set `true`, the `target` will be aligned to the top of the viewport\n * and scrollable ancestors whether it is already visible or not. This option will only work when `alignToTop`\n * is `true`\n */ function scrollViewportToShowTarget({ target, viewportOffset = 0, ancestorOffset = 0, alignToTop, forceScroll }) {\n const targetWindow = getWindow(target);\n let currentWindow = targetWindow;\n let currentFrame = null;\n viewportOffset = normalizeViewportOffset(viewportOffset);\n // Iterate over all windows, starting from target's parent window up to window#top.\n while(currentWindow){\n let firstAncestorToScroll;\n // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls\n // settled down, the algorithm can eventually scroll the viewport of the current window.\n //\n // Note: If the current window is target's **original** window (e.g. the first one),\n // start scrolling the closest parent of the target. If not, scroll the closest parent\n // of an iframe that resides in the current window.\n if (currentWindow == targetWindow) {\n firstAncestorToScroll = getParentElement(target);\n } else {\n firstAncestorToScroll = getParentElement(currentFrame);\n }\n // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.\n scrollAncestorsToShowRect({\n parent: firstAncestorToScroll,\n getRect: ()=>{\n // Note: If the target does not belong to the current window **directly**,\n // i.e. it resides in an iframe belonging to the window, obtain the target's rect\n // in the coordinates of the current window. By default, a Rect returns geometry\n // relative to the current window's viewport. To make it work in a parent window,\n // it must be shifted.\n return getRectRelativeToWindow(target, currentWindow);\n },\n alignToTop,\n ancestorOffset,\n forceScroll\n });\n // Obtain the rect of the target after it has been scrolled within its ancestors.\n // It's time to scroll the viewport.\n let targetRect = getRectRelativeToWindow(target, currentWindow);\n // Detect situation where the target is higher than the first scrollable ancestor.\n // In such case scrolling the viewport to reveal the target might be malfunctioning because\n // the target `.top` position is lower than the ancestor's `.top` position. If it's large enough it can be negative.\n // It causes the `scrollWindowToShowRect` to scroll the viewport to the negative top position which is not possible\n // and leads to the viewport being scrolled to the absolute top of the document. To prevent this, the target's rect\n // must be shifted to the ancestor's top position. It should not affect the target's visibility because the ancestor\n // is already scrolled to reveal the target.\n // See more: https://github.com/ckeditor/ckeditor5/issues/17079\n const ancestorWindowRelativeRect = getRectRelativeToWindow(firstAncestorToScroll, currentWindow);\n if (targetRect.height > ancestorWindowRelativeRect.height) {\n const ancestorTargetIntersection = targetRect.getIntersection(ancestorWindowRelativeRect);\n if (ancestorTargetIntersection) {\n targetRect = ancestorTargetIntersection;\n }\n }\n scrollWindowToShowRect({\n window: currentWindow,\n rect: targetRect,\n viewportOffset,\n alignToTop,\n forceScroll\n });\n if (currentWindow.parent != currentWindow) {\n // Keep the reference to the