From 0e8580f99c2c0ede29808e109f583ca32143d117 Mon Sep 17 00:00:00 2001 From: eduauto Date: Wed, 16 Apr 2025 15:30:47 +0800 Subject: [PATCH] autoUpdataFile --- color.less | 68 +++--- index.html | 10 +- ...s__index.layout.6c7edf77.699e0fb9.async.js | 0 ...Lists__Attendance__index.fa811f5e.async.js | 40 +-- ...StudentStatistics__index.7d5c70a6.async.js | 2 +- ...ssrooms__Lists__Students.9aceb61f.async.js | 10 +- ...ed__Assembly__TeamDateil.99afb539.async.js | 2 +- ...nnovation__PublicDataSet.98e857a6.async.js | 10 +- ...c.js => p__Trial__Detail.2dfb7f6c.async.js | 168 ++++++------- p__Trial__Index.16d49aca.async.js | 213 ---------------- p__Trial__Index.72399620.async.js | 228 ++++++++++++++++++ ....css => p__Trial__Index.9778935a.chunk.css | 25 ++ static/statistics.e3247b82.svg | 13 + static/statistics_light.2693fd23.svg | 13 + umi.ad33a87a.js => umi.17103b90.js | 4 +- 15 files changed, 440 insertions(+), 366 deletions(-) rename layouts__CoreDetail__index.layouts__ShixunDetail__index.layouts__SimpleLayouts.layouts__index.layout.c40fe19d.699e0fb9.async.js => layouts__CoreDetail__index.layouts__ShixunDetail__index.layouts__SimpleLayouts.layouts__index.layout.6c7edf77.699e0fb9.async.js (100%) rename p__Trial__Detail.22188a70.async.js => p__Trial__Detail.2dfb7f6c.async.js (86%) delete mode 100644 p__Trial__Index.16d49aca.async.js create mode 100644 p__Trial__Index.72399620.async.js rename p__Trial__Index.3f51e89d.chunk.css => p__Trial__Index.9778935a.chunk.css (99%) create mode 100644 static/statistics.e3247b82.svg create mode 100644 static/statistics_light.2693fd23.svg rename umi.ad33a87a.js => umi.17103b90.js (99%) diff --git a/color.less b/color.less index 0943d19b7f..d2525172ef 100644 --- a/color.less +++ b/color.less @@ -86,13 +86,17 @@ html {--antd-wave-shadow-color: @primary-color;} .ant-alert {color: @text-color;border-radius: 2px;} <<<<<<< HEAD .ant-alert-success {background-color: color(~`colorPalette("@{warning-color}", 1)`);border: 1px solid color(~`colorPalette("@{warning-color}", 3)`);} +.ant-alert-success .ant-alert-icon {color: @success-color;} +.ant-alert-info {background-color: color(~`colorPalette("@{primary-color}", 1)`);border: 1px solid color(~`colorPalette("@{primary-color}", 3)`);} +.ant-alert-info .ant-alert-icon {color: @primary-color;} +.ant-alert-warning {background-color: color(~`colorPalette("@{warning-color}", 1)`);border: 1px solid color(~`colorPalette("@{warning-color}", 3)`);} ======= .ant-alert-success {background-color: color(~`colorPalette("@{success-color}", 1)`);border: 1px solid color(~`colorPalette("@{success-color}", 3)`);} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 .ant-alert-success .ant-alert-icon {color: @success-color;} .ant-alert-info {background-color: color(~`colorPalette("@{primary-color}", 1)`);border: 1px solid color(~`colorPalette("@{primary-color}", 3)`);} .ant-alert-info .ant-alert-icon {color: @primary-color;} -.ant-alert-warning {background-color: color(~`colorPalette("@{warning-color}", 1)`);border: 1px solid color(~`colorPalette("@{warning-color}", 3)`);} +.ant-alert-warning {background-color: color(~`colorPalette("@{modal-header-bg}", 1)`);border: 1px solid color(~`colorPalette("@{warning-color}", 3)`);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-alert-warning .ant-alert-icon {color: @warning-color;} .ant-alert-error {background-color: color(~`colorPalette("@{error-color}", 1)`);border: 1px solid color(~`colorPalette("@{error-color}", 3)`);} .ant-alert-error .ant-alert-icon {color: @error-color;} @@ -738,12 +742,12 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-form-item-has-warning .ant-input-affix-wrapper input:focus {box-shadow: none !important;} .ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(218, 29, 35, 0.2);} ======= -.ant-form-item-has-warning .ant-input:focus, .ant-form-item-has-warning .ant-input-affix-wrapper:focus, .ant-form-item-has-warning .ant-input-focused, .ant-form-item-has-warning .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(78, 70, 148, 0.2);} +.ant-form-item-has-warning .ant-input:focus, .ant-form-item-has-warning .ant-input-affix-wrapper:focus, .ant-form-item-has-warning .ant-input-focused, .ant-form-item-has-warning .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(206, 99, 242, 0.2);} .ant-form-item-has-warning .ant-input:not(.ant-form-item-has-warning .ant-input-disabled) {background-color: #fff;} .ant-form-item-has-warning .ant-input-affix-wrapper:not(.ant-form-item-has-warning .ant-input-affix-wrapper-disabled) {background-color: #fff;} .ant-form-item-has-warning .ant-input-affix-wrapper input:focus {box-shadow: none !important;} -.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(78, 70, 148, 0.2);} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(206, 99, 242, 0.2);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-form-item-has-warning .ant-input-prefix {color: @warning-color;} .ant-form-item-has-warning .ant-input-group-addon {color: @warning-color;border-color: @warning-color;} .ant-form-item-has-warning .has-feedback {color: @warning-color;} @@ -763,19 +767,19 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-form-item-has-error .ant-input-affix-wrapper input:focus {box-shadow: none !important;} .ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(107, 176, 68, 0.2);} ======= -.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(78, 70, 148, 0.2);} +.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(206, 99, 242, 0.2);} .ant-form-item-has-warning .ant-input-number, .ant-form-item-has-warning .ant-picker {border-color: @warning-color;} -.ant-form-item-has-warning .ant-input-number-focused, .ant-form-item-has-warning .ant-picker-focused, .ant-form-item-has-warning .ant-input-number:focus, .ant-form-item-has-warning .ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(78, 70, 148, 0.2);} +.ant-form-item-has-warning .ant-input-number-focused, .ant-form-item-has-warning .ant-picker-focused, .ant-form-item-has-warning .ant-input-number:focus, .ant-form-item-has-warning .ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(206, 99, 242, 0.2);} .ant-form-item-has-warning .ant-input-number:not([disabled]):hover, .ant-form-item-has-warning .ant-picker:not([disabled]):hover {border-color: @warning-color;} -.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(78, 70, 148, 0.2);} +.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(206, 99, 242, 0.2);} .ant-form-item-has-error .ant-form-item-explain, .ant-form-item-has-error .ant-form-item-split {color: @error-color;} .ant-form-item-has-error .ant-input, .ant-form-item-has-error .ant-input-affix-wrapper, .ant-form-item-has-error .ant-input:hover, .ant-form-item-has-error .ant-input-affix-wrapper:hover {border-color: @error-color;} -.ant-form-item-has-error .ant-input:focus, .ant-form-item-has-error .ant-input-affix-wrapper:focus, .ant-form-item-has-error .ant-input-focused, .ant-form-item-has-error .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} +.ant-form-item-has-error .ant-input:focus, .ant-form-item-has-error .ant-input-affix-wrapper:focus, .ant-form-item-has-error .ant-input-focused, .ant-form-item-has-error .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} .ant-form-item-has-error .ant-input:not(.ant-form-item-has-error .ant-input-disabled) {background-color: #fff;} .ant-form-item-has-error .ant-input-affix-wrapper:not(.ant-form-item-has-error .ant-input-affix-wrapper-disabled) {background-color: #fff;} .ant-form-item-has-error .ant-input-affix-wrapper input:focus {box-shadow: none !important;} -.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-form-item-has-error .ant-input-prefix {color: @error-color;} .ant-form-item-has-error .ant-input-group-addon {color: @error-color;border-color: @error-color;} .ant-form-item-has-error .has-feedback {color: @error-color;} @@ -792,16 +796,16 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(107, 176, 68, 0.2);} .ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(107, 176, 68, 0.2);} ======= -.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} +.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} .ant-form-item-has-error .ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {border: 0;} .ant-form-item-has-error .ant-select.ant-select-auto-complete .ant-input:focus {border-color: @error-color;} .ant-form-item-has-error .ant-input-number, .ant-form-item-has-error .ant-picker {border-color: @error-color;} -.ant-form-item-has-error .ant-input-number-focused, .ant-form-item-has-error .ant-picker-focused, .ant-form-item-has-error .ant-input-number:focus, .ant-form-item-has-error .ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} +.ant-form-item-has-error .ant-input-number-focused, .ant-form-item-has-error .ant-picker-focused, .ant-form-item-has-error .ant-input-number:focus, .ant-form-item-has-error .ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} .ant-form-item-has-error .ant-input-number:not([disabled]):hover, .ant-form-item-has-error .ant-picker:not([disabled]):hover {border-color: @error-color;} .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover {border-color: @error-color;} -.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} -.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(190, 101, 159, 0.2);} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} +.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(108, 188, 143, 0.2);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-form-item-has-error .ant-transfer-list {border-color: @error-color;} .ant-form-item-has-error .ant-transfer-list-search:not([disabled]) {border-color: @border-color-base;} .ant-form-item-has-error .ant-transfer-list-search:not([disabled]):hover {border-color: color(~`colorPalette("@{primary-color}", 5)`);border-right-width: 1px !important;} @@ -1000,11 +1004,11 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: @error-color;} .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: #fff1f0;} ======= -.ant-menu-item-danger.ant-menu-item:active {background: color(~`colorPalette("@{modal-close-color}", 1)`);} +.ant-menu-item-danger.ant-menu-item:active {background: color(~`colorPalette("@{link-color}", 1)`);} .ant-menu-item-danger.ant-menu-item-selected {color: @error-color;} .ant-menu-item-danger.ant-menu-item-selected > a, .ant-menu-item-danger.ant-menu-item-selected > a:hover {color: @error-color;} -.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: color(~`colorPalette("@{modal-close-color}", 1)`);} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {background-color: color(~`colorPalette("@{link-color}", 1)`);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-menu-inline .ant-menu-item-danger.ant-menu-item::after {border-right-color: @error-color;} .ant-menu-dark .ant-menu-item-danger.ant-menu-item, .ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover, .ant-menu-dark .ant-menu-item-danger.ant-menu-item > a {color: @error-color;} .ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected {color: #fff;background-color: @error-color;} @@ -1503,19 +1507,15 @@ tr.ant-table-expanded-row:hover > td {background: #fbfbfb;} .ant-tag-checkable:active, .ant-tag-checkable-checked {color: #fff;} .ant-tag-checkable-checked {background-color: @primary-color;} .ant-tag-checkable:active {background-color: color(~`colorPalette("@{primary-color}", 7)`);} -<<<<<<< HEAD .ant-tag-pink {color: #eb2f96;background: #fff0f6;border-color: #ffadd2;} .ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} .ant-tag-magenta {color: #eb2f96;background: #fff0f6;border-color: #ffadd2;} .ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} +<<<<<<< HEAD .ant-tag-red {color: #f5222d;background: #fff1f0;border-color: #ffa39e;} ======= -.ant-tag-pink {color: #eb2f96;background: color(~`colorPalette("@{layout-body-background}", 1)`);border-color: #ffadd2;} -.ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} -.ant-tag-magenta {color: #eb2f96;background: color(~`colorPalette("@{layout-body-background}", 1)`);border-color: #ffadd2;} -.ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} -.ant-tag-red {color: #f5222d;background: color(~`colorPalette("@{modal-close-color}", 1)`);border-color: #ffa39e;} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-tag-red {color: #f5222d;background: color(~`colorPalette("@{link-color}", 1)`);border-color: #ffa39e;} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-tag-red-inverse {color: #fff;background: #f5222d;border-color: #f5222d;} .ant-tag-volcano {color: #fa541c;background: #fff2e8;border-color: #ffbb96;} .ant-tag-volcano-inverse {color: #fff;background: #fa541c;border-color: #fa541c;} @@ -1531,23 +1531,27 @@ tr.ant-table-expanded-row:hover > td {background: #fbfbfb;} .ant-tag-lime-inverse {color: #fff;background: #a0d911;border-color: #a0d911;} .ant-tag-green {color: #52c41a;background: #f6ffed;border-color: #b7eb8f;} .ant-tag-green-inverse {color: #fff;background: #52c41a;border-color: #52c41a;} +<<<<<<< HEAD .ant-tag-blue {color: #1890ff;background: #e6f7ff;border-color: #91d5ff;} .ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} .ant-tag-geekblue {color: #2f54eb;background: #f0f5ff;border-color: #adc6ff;} .ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} -<<<<<<< HEAD .ant-tag-purple {color: #722ed1;background: color(~`colorPalette("@{border-color-base}", 1)`);border-color: #d3adf7;} .ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;} .ant-tag-success {color: #52c41a;background: #f6ffed;border-color: #b7eb8f;} .ant-tag-processing {color: #1890ff;background: #e6f7ff;border-color: #91d5ff;} .ant-tag-error {color: #f5222d;background: #fff1f0;border-color: #ffa39e;} ======= +.ant-tag-blue {color: #1890ff;background: color(~`colorPalette("@{modal-heading-color}", 1)`);border-color: #91d5ff;} +.ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} +.ant-tag-geekblue {color: #2f54eb;background: #f0f5ff;border-color: #adc6ff;} +.ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} .ant-tag-purple {color: #722ed1;background: #f9f0ff;border-color: #d3adf7;} .ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;} .ant-tag-success {color: #52c41a;background: #f6ffed;border-color: #b7eb8f;} -.ant-tag-processing {color: #1890ff;background: #e6f7ff;border-color: #91d5ff;} -.ant-tag-error {color: #f5222d;background: color(~`colorPalette("@{modal-close-color}", 1)`);border-color: #ffa39e;} ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +.ant-tag-processing {color: #1890ff;background: color(~`colorPalette("@{modal-heading-color}", 1)`);border-color: #91d5ff;} +.ant-tag-error {color: #f5222d;background: color(~`colorPalette("@{link-color}", 1)`);border-color: #ffa39e;} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-tag-warning {color: #fa8c16;background: #fff7e6;border-color: #ffd591;} .ant-timeline {color: @text-color;} .ant-timeline-item-tail {border-left: 2px solid #f0f0f0;} @@ -1747,7 +1751,11 @@ a.ant-typography[disabled], .ant-typography a[disabled] {color: @disabled-color; .ant-upload-list-picture .ant-upload-list-item-error, .ant-upload-list-picture-card .ant-upload-list-item-error {border-color: @error-color;} .ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info, .ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info {background: transparent;} .ant-upload-list-picture .ant-upload-list-item-uploading, .ant-upload-list-picture-card .ant-upload-list-item-uploading {border-style: dashed;} +<<<<<<< HEAD .ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#e6f7ff'] {fill: color(~`colorPalette("@{error-color}", 1)`);} +======= +.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{modal-heading-color}", 1)`)'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='color(~`colorPalette("@{modal-heading-color}", 1)`)'] {fill: color(~`colorPalette("@{error-color}", 1)`);} +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab .ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'], .ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill='#1890ff'] {fill: @error-color;} .ant-upload-list-picture-card .ant-upload-list-item-info::before {background-color: rgba(0, 0, 0, 0.5);} .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download, .ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete {color: rgba(255, 255, 255, 0.85);} diff --git a/index.html b/index.html index e32a86bdbf..43020496de 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ >>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab /> @@ -30,7 +30,7 @@ content="(EduCoder)是信息技术类实践教学平台。(EduCoder)涵盖了计算机、大数据、云计算、人工智能、软件工程、物联网等专业课程。超60000个实训案例,建立学、练、评、测一体化实验环境。" ======= content="“101计划”实践平台是教育部“101计划”的核心课程实践资源共建共享平台,联合高校和产业力量,为计算概论、数据结构、算法设计与分析、离散数学、计算机系统导论、操作系统、计算机组成与系统结构、编译原理、计算机网络、数据库、软件工程、人工智能引论等 12 门核心课程开发配套实践内容与案例,将课程体系、教学内容、实践载体、增效手段融会贯通,构建“教师、学生、教材、课程、平台”五位一体的教育思想、课程建设、课堂提升、课程实践的教育教学新模式,持续推动核心课程、核心实践项目的建设和应用。" ->>>>>>> 5e534d6fb49645613cf22cc451c645d107cc6d52 +>>>>>>> a08b70631197ae152726dfdf2ffc0b47ac01fcab /> /,ke.html=Xe(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Xe(ke._paragraph).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.blockquote=Xe(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Ye({},ke),ke.gfm=Ye({},ke.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ke.gfm.nptable=Xe(ke.gfm.nptable).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.gfm.table=Xe(ke.gfm.table).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.pedantic=Ye({},ke.normal,{html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Je,paragraph:Xe(ke.normal._paragraph).replace("hr",ke.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",Y.punctuation=Xe(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=Xe(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=Xe(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=Xe(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=Xe(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=Xe(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=Xe(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=Xe(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=Xe(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=Xe(Y._blockSkip,"g").getRegex(),Y.overlapSkip=Xe(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Y.autolink=Xe(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=Xe(Y.tag).replace("comment",ke._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=Xe(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=Xe(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=Xe(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=Ye({},Y),Y.pedantic=Ye({},Y.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=Ye({},Y.normal,{escape:Xe(Y.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(le="x"+le.toString(16)),ce+="&#"+le+";";return ce}var Fe=function(){function ne(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||_,this.options.tokenizer=this.options.tokenizer||new Ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:J.normal,inline:ae.normal};this.options.pedantic?(le.block=J.pedantic,le.inline=ae.pedantic):this.options.gfm&&(le.block=J.gfm,this.options.breaks?le.inline=ae.breaks:le.inline=ae.gfm),this.tokenizer.rules=le}ne.lex=function(le,ue){var ye=new ne(ue);return ye.lex(le)};var ce=ne.prototype;return ce.lex=function(le){return le=le.replace(/\r\n|\r/g,` +`?ue[1].slice(0,-1):ue[1]}},ce.text=function(le,ue){var ye=this.rules.block.text.exec(le);if(ye){var we=ue[ue.length-1];return we&&we.type==="text"?{raw:ye[0],text:ye[0]}:{type:"text",raw:ye[0],text:ye[0]}}},ce.escape=function(le){var ue=this.rules.inline.escape.exec(le);if(ue)return{type:"escape",raw:ue[0],text:Oe(ue[1])}},ce.tag=function(le,ue,ye){var we=this.rules.inline.tag.exec(le);if(we)return!ue&&/^/i.test(we[0])&&(ue=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(we[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(we[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:we[0],inLink:ue,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):Oe(we[0]):we[0]}},ce.link=function(le){var ue=this.rules.inline.link.exec(le);if(ue){var ye=We(ue[2],"()");if(ye>-1){var we=ue[0].indexOf("!")===0?5:4,Ne=we+ue[1].length+ye;ue[2]=ue[2].substring(0,ye),ue[0]=ue[0].substring(0,Ne).trim(),ue[3]=""}var Ie=ue[2],lt="";if(this.options.pedantic){var Pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);Pt?(Ie=Pt[1],lt=Pt[3]):lt=""}else lt=ue[3]?ue[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var Zt=je(ue,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:lt&<.replace(this.rules.inline._escapes,"$1")},ue[0]);return Zt}},ce.reflink=function(le,ue){var ye;if((ye=this.rules.inline.reflink.exec(le))||(ye=this.rules.inline.nolink.exec(le))){var we=(ye[2]||ye[1]).replace(/\s+/g," ");if(we=ue[we.toLowerCase()],!we||!we.href){var Ne=ye[0].charAt(0);return{type:"text",raw:Ne,text:Ne}}var Ie=je(ye,we,ye[0]);return Ie}},ce.strong=function(le,ue,ye){ye===void 0&&(ye="");var we=this.rules.inline.strong.start.exec(le);if(we&&(!we[1]||we[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){ue=ue.slice(-1*le.length);var Ne=we[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ne.lastIndex=0;for(var Ie;(we=Ne.exec(ue))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ue.slice(0,we.index+3)),Ie)return{type:"strong",raw:le.slice(0,Ie[0].length),text:le.slice(2,Ie[0].length-2)}}},ce.em=function(le,ue,ye){ye===void 0&&(ye="");var we=this.rules.inline.em.start.exec(le);if(we&&(!we[1]||we[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){ue=ue.slice(-1*le.length);var Ne=we[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ne.lastIndex=0;for(var Ie;(we=Ne.exec(ue))!=null;)if(Ie=this.rules.inline.em.middle.exec(ue.slice(0,we.index+2)),Ie)return{type:"em",raw:le.slice(0,Ie[0].length),text:le.slice(1,Ie[0].length-1)}}},ce.codespan=function(le){var ue=this.rules.inline.code.exec(le);if(ue){var ye=ue[2].replace(/\n/g," "),we=/[^ ]/.test(ye),Ne=ye.startsWith(" ")&&ye.endsWith(" ");return we&&Ne&&(ye=ye.substring(1,ye.length-1)),ye=Oe(ye,!0),{type:"codespan",raw:ue[0],text:ye}}},ce.br=function(le){var ue=this.rules.inline.br.exec(le);if(ue)return{type:"br",raw:ue[0]}},ce.del=function(le){var ue=this.rules.inline.del.exec(le);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},ce.autolink=function(le,ue){var ye=this.rules.inline.autolink.exec(le);if(ye){var we,Ne;return ye[2]==="@"?(we=Oe(this.options.mangle?ue(ye[1]):ye[1]),Ne="mailto:"+we):(we=Oe(ye[1]),Ne=we),{type:"link",raw:ye[0],text:we,href:Ne,tokens:[{type:"text",raw:we,text:we}]}}},ce.url=function(le,ue){var ye;if(ye=this.rules.inline.url.exec(le)){var we,Ne;if(ye[2]==="@")we=Oe(this.options.mangle?ue(ye[0]):ye[0]),Ne="mailto:"+we;else{var Ie;do Ie=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while(Ie!==ye[0]);we=Oe(ye[0]),ye[1]==="www."?Ne="http://"+we:Ne=we}return{type:"link",raw:ye[0],text:we,href:Ne,tokens:[{type:"text",raw:we,text:we}]}}},ce.inlineText=function(le,ue,ye){var we=this.rules.inline.text.exec(le);if(we){var Ne;return ue?Ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):Oe(we[0]):we[0]:Ne=Oe(this.options.smartypants?ye(we[0]):we[0]),{type:"text",raw:we[0],text:Ne}}},ne}(),Ze=pe.noopTest,Xe=pe.edit,Qe=pe.merge,ke={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ze,table:Ze,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ke._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ke._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ke.def=Xe(ke.def).replace("label",ke._label).replace("title",ke._title).getRegex(),ke.bullet=/(?:[*+-]|\d{1,9}[.)])/,ke.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ke.item=Xe(ke.item,"gm").replace(/bull/g,ke.bullet).getRegex(),ke.list=Xe(ke.list).replace(/bull/g,ke.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ke.def.source+")").getRegex(),ke._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke._comment=//,ke.html=Xe(ke.html,"i").replace("comment",ke._comment).replace("tag",ke._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ke.paragraph=Xe(ke._paragraph).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.blockquote=Xe(ke.blockquote).replace("paragraph",ke.paragraph).getRegex(),ke.normal=Qe({},ke),ke.gfm=Qe({},ke.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ke.gfm.nptable=Xe(ke.gfm.nptable).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.gfm.table=Xe(ke.gfm.table).replace("hr",ke.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ke._tag).getRegex(),ke.pedantic=Qe({},ke.normal,{html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ze,paragraph:Xe(ke.normal._paragraph).replace("hr",ke.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ke.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ze,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ze,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",Y.punctuation=Xe(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=Xe(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=Xe(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=Xe(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=Xe(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=Xe(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=Xe(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=Xe(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=Xe(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=Xe(Y._blockSkip,"g").getRegex(),Y.overlapSkip=Xe(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Y.autolink=Xe(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=Xe(Y.tag).replace("comment",ke._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=Xe(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=Xe(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=Xe(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=Qe({},Y),Y.pedantic=Qe({},Y.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=Qe({},Y.normal,{escape:Xe(Y.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(le="x"+le.toString(16)),ce+="&#"+le+";";return ce}var Fe=function(){function ne(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||_,this.options.tokenizer=this.options.tokenizer||new Ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:J.normal,inline:ae.normal};this.options.pedantic?(le.block=J.pedantic,le.inline=ae.pedantic):this.options.gfm&&(le.block=J.gfm,this.options.breaks?le.inline=ae.breaks:le.inline=ae.gfm),this.tokenizer.rules=le}ne.lex=function(le,ue){var ye=new ne(ue);return ye.lex(le)};var ce=ne.prototype;return ce.lex=function(le){return le=le.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(le,ue,ye){ue===void 0&&(ue=[]),ye===void 0&&(ye=!0),le=le.replace(/^ +$/gm,"");for(var we,Ne,Ie,lt;le;){if(we=this.tokenizer.space(le)){le=le.substring(we.raw.length),we.type&&ue.push(we);continue}if(we=this.tokenizer.code(le,ue)){le=le.substring(we.raw.length),we.type?ue.push(we):(lt=ue[ue.length-1],lt.raw+=` `+we.raw,lt.text+=` `+we.text);continue}if(we=this.tokenizer.fences(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.heading(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.nptable(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.hr(le)){le=le.substring(we.raw.length),ue.push(we);continue}if(we=this.tokenizer.blockquote(le)){le=le.substring(we.raw.length),we.tokens=this.blockTokens(we.text,[],ye),ue.push(we);continue}if(we=this.tokenizer.list(le)){for(le=le.substring(we.raw.length),Ie=we.items.length,Ne=0;Ne':"<"+ye+">";return we+le+" `},ce.strong=function(le){return""+le+""},ce.em=function(le){return""+le+""},ce.codespan=function(le){return""+le+""},ce.br=function(){return this.options.xhtml?"
":"
"},ce.del=function(le){return""+le+""},ce.link=function(le,ue,ye){if(le=at(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var we='
",we},ce.image=function(le,ue,ye){if(le=at(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var we=''+ye+'":">",we},ce.text=function(le){return le},ne}(),tt=function(){function ne(){}var ce=ne.prototype;return ce.strong=function(le){return le},ce.em=function(le){return le},ce.codespan=function(le){return le},ce.del=function(le){return le},ce.html=function(le){return le},ce.text=function(le){return le},ce.link=function(le,ue,ye){return""+ye},ce.image=function(le,ue,ye){return""+ye},ce.br=function(){return""},ne}(),bt=function(){function ne(){this.seen={}}var ce=ne.prototype;return ce.slug=function(le){var ue=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var ye=ue;do this.seen[ye]++,ue=ye+"-"+this.seen[ye];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},ne}(),_t=se.defaults,Lt=pe.unescape,Ot=function(){function ne(me){this.options=me||_t,this.options.renderer=this.options.renderer||new nt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new bt}ne.parse=function(le,ue){var ye=new ne(ue);return ye.parse(le)};var ce=ne.prototype;return ce.parse=function(le,ue){ue===void 0&&(ue=!0);var ye="",we,Ne,Ie,lt,Pt,Zt,$t,Kr,Jt,Yt,jn,Qr,Kn,Dn,Br,eo,qu,to,$n=le.length;for(we=0;we<$n;we++){Yt=le[we];switch(Yt.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(Yt.tokens),Yt.depth,Lt(this.parseInline(Yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(Yt.text,Yt.lang,Yt.escaped);continue}case"table":{for(Kr="",$t="",lt=Yt.header.length,Ne=0;Ne0&&Br.tokens[0].type==="text"?(Br.tokens[0].text=to+" "+Br.tokens[0].text,Br.tokens[0].tokens&&Br.tokens[0].tokens.length>0&&Br.tokens[0].tokens[0].type==="text"&&(Br.tokens[0].tokens[0].text=to+" "+Br.tokens[0].tokens[0].text)):Br.tokens.unshift({type:"text",text:to}):Dn+=to),Dn+=this.parse(Br.tokens,Kn),Jt+=this.renderer.listitem(Dn,qu,eo);ye+=this.renderer.list(Jt,jn,Qr);continue}case"html":{ye+=this.renderer.html(Yt.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(Yt.tokens));continue}case"text":{for(Jt=Yt.tokens?this.parseInline(Yt.tokens):Yt.text;we+1<$n&&le[we+1].type==="text";)Yt=le[++we],Jt+=` `+(Yt.tokens?this.parseInline(Yt.tokens):Yt.text);ye+=ue?this.renderer.paragraph(Jt):Jt;continue}default:{var ec='Token with "'+Yt.type+'" type was not found.';if(this.options.silent){console.error(ec);return}else throw new Error(ec)}}}return ye},ce.parseInline=function(le,ue){ue=ue||this.renderer;var ye="",we,Ne,Ie=le.length;for(we=0;weAn error occurred:

"+Nt(Ie.message+"",!0)+"
";throw Ie}}ge.options=ge.setOptions=function(ne){return xt(ge.defaults,ne),Ht(ge.defaults),ge},ge.getDefaults=mt,ge.defaults=Vt,ge.use=function(ne){var ce=xt({},ne);if(ne.renderer&&function(){var le=ge.defaults.renderer||new nt,ue=function(Ne){var Ie=le[Ne];le[Ne]=function(){for(var lt=arguments.length,Pt=new Array(lt),Zt=0;Zt1&&arguments[1]!==void 0?arguments[1]:1,me=tt.length,le=0;le1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(Ce).map(function(Oe,We){if(!K.isValidElement(Oe)||!Oe.type)return null;var Ue=Oe.type.isSelectOptGroup,ct=Oe.key,Ge=Oe.props,Je=Ge.children,Xe=Object(se.a)(Ge,["children"]);return be||!Ue?w(Oe):Object(E.a)(Object(E.a)({key:"__RC_SELECT_GRP__".concat(ct===null?We:ct,"__"),label:ct},Xe),{},{options:b(Je)})}).filter(function(Oe){return Oe})}var m=He("2Qr1"),v=He("qNPg"),g=He("U8pU"),R=He("Kwbf"),O=He("WKfj");function G(Ce){var be=Ce.mode,Oe=Ce.options,We=Ce.children,Ue=Ce.backfill,ct=Ce.allowClear,Ge=Ce.placeholder,Je=Ce.getInputElement,Xe=Ce.showSearch,Ye=Ce.onSearch,ke=Ce.defaultOpen,Y=Ce.autoFocus,A=Ce.labelInValue,_=Ce.value,J=Ce.inputValue,ae=Ce.optionLabelProp,$=be==="multiple"||be==="tags",Se=Xe!==void 0?Xe:$||be==="combobox",Fe=Oe||b(We);if(Object(R.a)(be!=="tags"||Fe.every(function(nt){return!nt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),be==="tags"||be==="combobox"){var $e=Fe.some(function(nt){return nt.options?nt.options.some(function(tt){return typeof("value"in tt?tt.value:tt.key)=="number"}):typeof("value"in nt?nt.value:nt.key)=="number"});Object(R.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)(be!=="combobox"||!ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)(be==="combobox"||!Ue,"`backfill` only works with `combobox` mode."),Object(R.a)(be==="combobox"||!Je,"`getInputElement` only work with `combobox` mode."),Object(R.b)(be!=="combobox"||!Je||!ct||!Ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ye&&!Se&&be!=="combobox"&&be!=="tags"&&Object(R.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(R.b)(!ke||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),_!=null){var at=Object(O.d)(_);Object(R.a)(!A||at.every(function(nt){return Object(g.a)(nt)==="object"&&("key"in nt||"value"in nt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(R.a)(!$||Array.isArray(_),"`value` should be array when `mode` is `multiple` or `tags`")}if(We){var Ke=null;Object(k.a)(We).some(function(nt){if(!K.isValidElement(nt)||!nt.type)return!1;var tt=nt.type;if(tt.isSelectOption)return!1;if(tt.isSelectOptGroup){var bt=Object(k.a)(nt.props.children).every(function(_t){return!K.isValidElement(_t)||!nt.type||_t.type.isSelectOption?!0:(Ke=_t.type,!1)});return!bt}return Ke=tt,!0}),Ke&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(R.a)(J===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Z=G,ee=Object(v.a)({prefixCls:"rc-select",components:{optionList:d},convertChildrenToData:b,flattenOptions:m.d,getLabeledValue:m.e,filterOptions:m.b,isValueDisabled:m.g,findValueOption:m.c,warningProps:Z,fillOptionsWithMissingValue:m.a}),fe=function(Ce){Object(H.a)(Oe,Ce);var be=Object(oe.a)(Oe);function Oe(){var We;return Object(ze.a)(this,Oe),We=be.apply(this,arguments),We.selectRef=K.createRef(),We.focus=function(){We.selectRef.current.focus()},We.blur=function(){We.selectRef.current.blur()},We}return Object(re.a)(Oe,[{key:"render",value:function(){return K.createElement(ee,Object.assign({ref:this.selectRef},this.props))}}]),Oe}(K.Component);fe.Option=p,fe.OptGroup=x;var pe=fe,xe=dr.c=pe},OLES:function(Pr,dr,He){"use strict";var ze=He("U8pU"),re=He("VTBJ"),H=He("Ff2n"),oe=He("q1tI"),K=He("uciX"),B=He("7ixt"),se=function(W){var M=W.overlay,P=W.prefixCls,I=W.id,C=W.overlayInnerStyle;return oe.createElement("div",{className:"".concat(P,"-inner"),id:I,role:"tooltip",style:C},typeof M=="function"?M():M)},q=se,X=function(W,M){var P=W.overlayClassName,I=W.trigger,C=I===void 0?["hover"]:I,d=W.mouseEnterDelay,f=d===void 0?0:d,p=W.mouseLeaveDelay,T=p===void 0?.1:p,x=W.overlayStyle,E=W.prefixCls,k=E===void 0?"rc-tooltip":E,w=W.children,b=W.onVisibleChange,m=W.afterVisibleChange,v=W.transitionName,g=W.animation,R=W.placement,O=R===void 0?"right":R,G=W.align,Z=G===void 0?{}:G,ee=W.destroyTooltipOnHide,fe=ee===void 0?!1:ee,pe=W.defaultVisible,xe=W.getTooltipContainer,Ce=W.overlayInnerStyle,be=Object(H.a)(W,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Oe=Object(oe.useRef)(null);Object(oe.useImperativeHandle)(M,function(){return Oe.current});var We=Object(re.a)({},be);"visible"in W&&(We.popupVisible=W.visible);var Ue=function(){var Ye=W.arrowContent,ke=Ye===void 0?null:Ye,Y=W.overlay,A=W.id;return[oe.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},ke),oe.createElement(q,{key:"content",prefixCls:k,id:A,overlay:Y,overlayInnerStyle:Ce})]},ct=!1,Ge=!1;if(typeof fe=="boolean")ct=fe;else if(fe&&Object(ze.a)(fe)==="object"){var Je=fe.keepParent;ct=Je===!0,Ge=Je===!1}return oe.createElement(K.a,Object.assign({popupClassName:P,prefixCls:k,popup:Ue,action:C,builtinPlacements:B.a,popupPlacement:O,ref:Oe,popupAlign:Z,getPopupContainer:xe,onPopupVisibleChange:b,afterPopupVisibleChange:m,popupTransitionName:v,popupAnimation:g,defaultPopupVisible:pe,destroyPopupOnHide:ct,autoDestroy:Ge,mouseLeaveDelay:T,popupStyle:x,mouseEnterDelay:f},We),w)},V=Object(oe.forwardRef)(X),L=dr.a=V},SJMd:function(Pr,dr){/** +Please report this to https://github.com/markedjs/marked.`,ce.silent)return"

An error occurred:

"+Nt(Ie.message+"",!0)+"
";throw Ie}}ge.options=ge.setOptions=function(ne){return xt(ge.defaults,ne),Ht(ge.defaults),ge},ge.getDefaults=mt,ge.defaults=Vt,ge.use=function(ne){var ce=xt({},ne);if(ne.renderer&&function(){var le=ge.defaults.renderer||new nt,ue=function(Ne){var Ie=le[Ne];le[Ne]=function(){for(var lt=arguments.length,Pt=new Array(lt),Zt=0;Zt1&&arguments[1]!==void 0?arguments[1]:1,me=tt.length,le=0;le1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(Ce).map(function(Oe,We){if(!K.isValidElement(Oe)||!Oe.type)return null;var je=Oe.type.isSelectOptGroup,ct=Oe.key,Ge=Oe.props,Ze=Ge.children,Xe=Object(se.a)(Ge,["children"]);return be||!je?w(Oe):Object(E.a)(Object(E.a)({key:"__RC_SELECT_GRP__".concat(ct===null?We:ct,"__"),label:ct},Xe),{},{options:b(Ze)})}).filter(function(Oe){return Oe})}var m=He("2Qr1"),v=He("qNPg"),g=He("U8pU"),R=He("Kwbf"),O=He("WKfj");function H(Ce){var be=Ce.mode,Oe=Ce.options,We=Ce.children,je=Ce.backfill,ct=Ce.allowClear,Ge=Ce.placeholder,Ze=Ce.getInputElement,Xe=Ce.showSearch,Qe=Ce.onSearch,ke=Ce.defaultOpen,Y=Ce.autoFocus,A=Ce.labelInValue,_=Ce.value,J=Ce.inputValue,ae=Ce.optionLabelProp,$=be==="multiple"||be==="tags",Se=Xe!==void 0?Xe:$||be==="combobox",Fe=Oe||b(We);if(Object(R.a)(be!=="tags"||Fe.every(function(nt){return!nt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),be==="tags"||be==="combobox"){var $e=Fe.some(function(nt){return nt.options?nt.options.some(function(tt){return typeof("value"in tt?tt.value:tt.key)=="number"}):typeof("value"in nt?nt.value:nt.key)=="number"});Object(R.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)(be!=="combobox"||!ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)(be==="combobox"||!je,"`backfill` only works with `combobox` mode."),Object(R.a)(be==="combobox"||!Ze,"`getInputElement` only work with `combobox` mode."),Object(R.b)(be!=="combobox"||!Ze||!ct||!Ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Qe&&!Se&&be!=="combobox"&&be!=="tags"&&Object(R.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(R.b)(!ke||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),_!=null){var at=Object(O.d)(_);Object(R.a)(!A||at.every(function(nt){return Object(g.a)(nt)==="object"&&("key"in nt||"value"in nt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(R.a)(!$||Array.isArray(_),"`value` should be array when `mode` is `multiple` or `tags`")}if(We){var Ke=null;Object(k.a)(We).some(function(nt){if(!K.isValidElement(nt)||!nt.type)return!1;var tt=nt.type;if(tt.isSelectOption)return!1;if(tt.isSelectOptGroup){var bt=Object(k.a)(nt.props.children).every(function(_t){return!K.isValidElement(_t)||!nt.type||_t.type.isSelectOption?!0:(Ke=_t.type,!1)});return!bt}return Ke=tt,!0}),Ke&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(R.a)(J===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Z=H,ee=Object(v.a)({prefixCls:"rc-select",components:{optionList:d},convertChildrenToData:b,flattenOptions:m.d,getLabeledValue:m.e,filterOptions:m.b,isValueDisabled:m.g,findValueOption:m.c,warningProps:Z,fillOptionsWithMissingValue:m.a}),fe=function(Ce){Object(z.a)(Oe,Ce);var be=Object(oe.a)(Oe);function Oe(){var We;return Object(ze.a)(this,Oe),We=be.apply(this,arguments),We.selectRef=K.createRef(),We.focus=function(){We.selectRef.current.focus()},We.blur=function(){We.selectRef.current.blur()},We}return Object(re.a)(Oe,[{key:"render",value:function(){return K.createElement(ee,Object.assign({ref:this.selectRef},this.props))}}]),Oe}(K.Component);fe.Option=p,fe.OptGroup=x;var pe=fe,xe=dr.c=pe},OLES:function(Pr,dr,He){"use strict";var ze=He("U8pU"),re=He("VTBJ"),z=He("Ff2n"),oe=He("q1tI"),K=He("uciX"),B=He("7ixt"),se=function(G){var I=G.overlay,P=G.prefixCls,M=G.id,C=G.overlayInnerStyle;return oe.createElement("div",{className:"".concat(P,"-inner"),id:M,role:"tooltip",style:C},typeof I=="function"?I():I)},q=se,X=function(G,I){var P=G.overlayClassName,M=G.trigger,C=M===void 0?["hover"]:M,d=G.mouseEnterDelay,f=d===void 0?0:d,p=G.mouseLeaveDelay,T=p===void 0?.1:p,x=G.overlayStyle,E=G.prefixCls,k=E===void 0?"rc-tooltip":E,w=G.children,b=G.onVisibleChange,m=G.afterVisibleChange,v=G.transitionName,g=G.animation,R=G.placement,O=R===void 0?"right":R,H=G.align,Z=H===void 0?{}:H,ee=G.destroyTooltipOnHide,fe=ee===void 0?!1:ee,pe=G.defaultVisible,xe=G.getTooltipContainer,Ce=G.overlayInnerStyle,be=Object(z.a)(G,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Oe=Object(oe.useRef)(null);Object(oe.useImperativeHandle)(I,function(){return Oe.current});var We=Object(re.a)({},be);"visible"in G&&(We.popupVisible=G.visible);var je=function(){var Qe=G.arrowContent,ke=Qe===void 0?null:Qe,Y=G.overlay,A=G.id;return[oe.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},ke),oe.createElement(q,{key:"content",prefixCls:k,id:A,overlay:Y,overlayInnerStyle:Ce})]},ct=!1,Ge=!1;if(typeof fe=="boolean")ct=fe;else if(fe&&Object(ze.a)(fe)==="object"){var Ze=fe.keepParent;ct=Ze===!0,Ge=Ze===!1}return oe.createElement(K.a,Object.assign({popupClassName:P,prefixCls:k,popup:je,action:C,builtinPlacements:B.a,popupPlacement:O,ref:Oe,popupAlign:Z,getPopupContainer:xe,onPopupVisibleChange:b,afterPopupVisibleChange:m,popupTransitionName:v,popupAnimation:g,defaultPopupVisible:pe,destroyPopupOnHide:ct,autoDestroy:Ge,mouseLeaveDelay:T,popupStyle:x,mouseEnterDelay:f},We),w)},V=Object(oe.forwardRef)(X),L=dr.a=V},SJMd:function(Pr,dr){/** * @license * Copyright (C) 2006 Google Inc. * @@ -157,12 +157,12 @@ Please report this to https://github.com/markedjs/marked.`,ce.silent)return"

A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var He,ze,re,H=!1,oe,K;window.PR_SHOULD_USE_CONTINUATION=!0;var B,se;(function(){var q=window,X=["break,continue,do,else,for,if,return,while"],V=[X,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],L=[V,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],U=[L,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],W=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],M=[L,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],P="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",I=[L,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],C="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",d=[X,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],f=[X,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],p=[X,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[U,M,W,I,C,d,f,p],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,E="str",k="kwd",w="com",b="typ",m="lit",v="pun",g="pln",R="tag",O="dec",G="src",Z="atn",ee="atv",fe="nocode",pe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function xe(Se){for(var Fe=0,$e=!1,at=!1,Ke=0,nt=Se.length;Ke122||(le<65||me>90||Ht.push([Math.max(65,me)|32,Math.min(le,90)|32]),le<97||me>122||Ht.push([Math.max(97,me)&~32,Math.min(le,122)&~32]))}}Ht.sort(function(Ne,Ie){return Ne[0]-Ie[0]||Ie[1]-Ne[1]});for(var ue=[],ye=[],ie=0;iewe[0]&&(we[1]+1>we[0]&&ge.push("-"),ge.push(Lt(we[1])))}return ge.push("]"),ge.join("")}function xt(Nt){for(var mt=Nt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ht=mt.length,Vt=[],ge=0,ie=0;ge=2&&me==="["?mt[ge]=Ot(ne):me!=="\\"&&(mt[ge]=ne.replace(/[a-zA-Z]/g,function(ye){var we=ye.charCodeAt(0);return"["+String.fromCharCode(we&~32,we|32)+"]"}))}return mt.join("")}for(var jt=[],Ke=0,nt=Se.length;Ke|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function xe(Se){for(var Fe=0,$e=!1,at=!1,Ke=0,nt=Se.length;Ke122||(le<65||me>90||Ht.push([Math.max(65,me)|32,Math.min(le,90)|32]),le<97||me>122||Ht.push([Math.max(97,me)&~32,Math.min(le,122)&~32]))}}Ht.sort(function(Ne,Ie){return Ne[0]-Ie[0]||Ie[1]-Ne[1]});for(var ue=[],ye=[],ie=0;iewe[0]&&(we[1]+1>we[0]&&ge.push("-"),ge.push(Lt(we[1])))}return ge.push("]"),ge.join("")}function xt(Nt){for(var mt=Nt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ht=mt.length,Vt=[],ge=0,ie=0;ge=2&&me==="["?mt[ge]=Ot(ne):me!=="\\"&&(mt[ge]=ne.replace(/[a-zA-Z]/g,function(ye){var we=ye.charCodeAt(0);return"["+String.fromCharCode(we&~32,we|32)+"]"}))}return mt.join("")}for(var jt=[],Ke=0,nt=Se.length;Ke=0;)$e[jt.charAt(Nt)]=xt;var mt=xt[1],Ht=""+mt;_t.hasOwnProperty(Ht)||(bt.push(mt),_t[Ht]=null)}bt.push(/[\0-\uffff]/),at=xe(bt)})();var Ke=Fe.length,nt=function(tt){for(var bt=tt.sourceCode,_t=tt.basePos,Lt=tt.sourceNode,Ot=[_t,g],xt=0,jt=bt.match(at)||[],Nt={},mt=0,Ht=jt.length;mt=5&&ge.substring(0,5)==="lang-",ne&&!(ie&&typeof ie[1]=="string")&&(ne=!1,ge=G),ne||(Nt[Vt]=ge)}var le=xt;if(xt+=Vt.length,!ne)Ot.push(_t+le,ge);else{var ue=ie[1],ye=Vt.indexOf(ue),we=ye+ue.length;ie[2]&&(we=Vt.length-ie[2].length,ye=we-ue.length);var Ne=ge.substring(5);be(Lt,_t+le,Vt.substring(0,ye),nt,Ot),be(Lt,_t+le+ye,ue,Y(Ne,ue),Ot),be(Lt,_t+le+we,Vt.substring(we),nt,Ot)}}tt.decorations=Ot};return nt}function ct(Se){var Fe=[],$e=[];Se.tripleQuotedStrings?Fe.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Fe.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&$e.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var at=Se.hashComments;at&&(Se.cStyleComments?(at>1?Fe.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([w,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&($e.push([w,/^\/\/[^\r\n]*/,null]),$e.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=Se.regexLiterals;if(Ke){var nt=Ke>1?"":` +`):jt=jt.replace(/[ \t\r\n]+/g," "),at[tt]=jt,nt[tt<<1]=Ke,Ke+=jt.length,nt[tt++<<1|1]=_t)}}return bt(Se),{sourceCode:at.join("").replace(/\n$/,""),spans:nt}}function be(Se,Fe,$e,at,Ke){if(!$e)return;var nt={sourceNode:Se,pre:1,langExtension:null,numberLines:null,sourceCode:$e,spans:null,basePos:Fe,decorations:null};at(nt),Ke.push.apply(Ke,nt.decorations)}var Oe=/\S/;function We(Se){for(var Fe=void 0,$e=Se.firstChild;$e;$e=$e.nextSibling){var at=$e.nodeType;Fe=at===1?Fe?Se:$e:at===3&&Oe.test($e.nodeValue)?Se:Fe}return Fe===Se?void 0:Fe}function je(Se,Fe){var $e={},at;(function(){for(var tt=Se.concat(Fe),bt=[],_t={},Lt=0,Ot=tt.length;Lt=0;)$e[jt.charAt(Nt)]=xt;var mt=xt[1],Ht=""+mt;_t.hasOwnProperty(Ht)||(bt.push(mt),_t[Ht]=null)}bt.push(/[\0-\uffff]/),at=xe(bt)})();var Ke=Fe.length,nt=function(tt){for(var bt=tt.sourceCode,_t=tt.basePos,Lt=tt.sourceNode,Ot=[_t,g],xt=0,jt=bt.match(at)||[],Nt={},mt=0,Ht=jt.length;mt=5&&ge.substring(0,5)==="lang-",ne&&!(ie&&typeof ie[1]=="string")&&(ne=!1,ge=H),ne||(Nt[Vt]=ge)}var le=xt;if(xt+=Vt.length,!ne)Ot.push(_t+le,ge);else{var ue=ie[1],ye=Vt.indexOf(ue),we=ye+ue.length;ie[2]&&(we=Vt.length-ie[2].length,ye=we-ue.length);var Ne=ge.substring(5);be(Lt,_t+le,Vt.substring(0,ye),nt,Ot),be(Lt,_t+le+ye,ue,Y(Ne,ue),Ot),be(Lt,_t+le+we,Vt.substring(we),nt,Ot)}}tt.decorations=Ot};return nt}function ct(Se){var Fe=[],$e=[];Se.tripleQuotedStrings?Fe.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Fe.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&$e.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var at=Se.hashComments;at&&(Se.cStyleComments?(at>1?Fe.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([w,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&($e.push([w,/^\/\/[^\r\n]*/,null]),$e.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=Se.regexLiterals;if(Ke){var nt=Ke>1?"":` \r`,tt=nt?".":"[\\S\\s]",bt="/(?=[^/*"+nt+"])(?:[^/\\x5B\\x5C"+nt+"]|\\x5C"+tt+"|\\x5B(?:[^\\x5C\\x5D"+nt+"]|\\x5C"+tt+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+pe+"("+bt+")")])}var _t=Se.types;_t&&$e.push([b,_t]);var Lt=(""+Se.keywords).replace(/^ | $/g,"");Lt.length&&$e.push([k,new RegExp("^(?:"+Lt.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([g,/^\s+/,null,` \r - \xA0`]);var Ot="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&(Ot+="(?!s*/)"),$e.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[g,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[g,/^\\[\s\S]?/,null],[v,new RegExp(Ot),null]),Ue(Fe,$e)}var Ge=ct({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Je(Se,Fe,$e){for(var at=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,nt=Se.ownerDocument,tt=nt.createElement("li");Se.firstChild;)tt.appendChild(Se.firstChild);var bt=[tt];function _t(mt){var Ht=mt.nodeType;if(Ht==1&&!at.test(mt.className))if(mt.nodeName==="br")Lt(mt),mt.parentNode&&mt.parentNode.removeChild(mt);else for(var Vt=mt.firstChild;Vt;Vt=Vt.nextSibling)_t(Vt);else if((Ht==3||Ht==4)&&$e){var ge=mt.nodeValue,ie=ge.match(Ke);if(ie){var ne=ge.substring(0,ie.index);mt.nodeValue=ne;var ce=ge.substring(ie.index+ie[0].length);if(ce){var me=mt.parentNode;me.insertBefore(nt.createTextNode(ce),mt.nextSibling)}Lt(mt),ne||mt.parentNode.removeChild(mt)}}}function Lt(mt){for(;!mt.nextSibling;)if(mt=mt.parentNode,!mt)return;function Ht(ie,ne){var ce=ne?ie.cloneNode(!1):ie,me=ie.parentNode;if(me){var le=Ht(me,1),ue=ie.nextSibling;le.appendChild(ce);for(var ye=ue;ye;ye=ue)ue=ye.nextSibling,le.appendChild(ye)}return ce}for(var Vt=Ht(mt.nextSibling,0),ge;(ge=Vt.parentNode)&&ge.nodeType===1;)Vt=ge;bt.push(Vt)}for(var Ot=0;Ot=me&&(_t+=2),nt>=le&&(xt+=2)}}finally{ge&&(ge.style.display=ie)}}var Ye={};function ke(Se,Fe){for(var $e=Fe.length;--$e>=0;){var at=Fe[$e];Ye.hasOwnProperty(at)?q.console&&console.warn("cannot override language handler %s",at):Ye[at]=Se}}function Y(Se,Fe){return Se&&Ye.hasOwnProperty(Se)||(Se=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[v,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ke(Ue([[g,/^[\s]+/,null,` \r -`],[ee,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[R,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[v,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ke(Ue([],[[ee,/^[\s\S]+/]]),["uq.val"]),ke(ct({keywords:U,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ke(ct({keywords:"null,true,false"}),["json"]),ke(ct({keywords:M,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ke(ct({keywords:W,cStyleComments:!0}),["java"]),ke(ct({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ke(ct({keywords:d,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ke(ct({keywords:C,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ke(ct({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ke(ct({keywords:I,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ke(ct({keywords:P,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ke(Ue([],[[E,/^[\s\S]+/]]),["regex"]);function A(Se){var Fe=Se.langExtension;try{var $e=Ce(Se.sourceNode,Se.pre),at=$e.sourceCode;Se.sourceCode=at,Se.spans=$e.spans,Se.basePos=0,Y(Fe,at)(Se),Xe(Se)}catch(Ke){q.console&&console.log(Ke&&Ke.stack||Ke)}}function _(Se,Fe,$e){var at=$e||!1,Ke=Fe||null,nt=document.createElement("div");nt.innerHTML="

"+Se+"
",nt=nt.firstChild,at&&Je(nt,at,!0);var tt={langExtension:Ke,numberLines:at,sourceNode:nt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return A(tt),nt.innerHTML}function J(Se,Fe){var $e=Fe||document.body,at=$e.ownerDocument||document;function Ke(ce){return $e.getElementsByTagName(ce)}for(var nt=[Ke("pre"),Ke("code"),Ke("xmp")],tt=[],bt=0;bt=me&&(_t+=2),nt>=le&&(xt+=2)}}finally{ge&&(ge.style.display=ie)}}var Qe={};function ke(Se,Fe){for(var $e=Fe.length;--$e>=0;){var at=Fe[$e];Qe.hasOwnProperty(at)?q.console&&console.warn("cannot override language handler %s",at):Qe[at]=Se}}function Y(Se,Fe){return Se&&Qe.hasOwnProperty(Se)||(Se=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[v,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ke(je([[g,/^[\s]+/,null,` \r +`],[ee,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[R,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[v,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ke(je([],[[ee,/^[\s\S]+/]]),["uq.val"]),ke(ct({keywords:U,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ke(ct({keywords:"null,true,false"}),["json"]),ke(ct({keywords:I,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ke(ct({keywords:G,cStyleComments:!0}),["java"]),ke(ct({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ke(ct({keywords:d,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ke(ct({keywords:C,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ke(ct({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ke(ct({keywords:M,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ke(ct({keywords:P,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ke(je([],[[E,/^[\s\S]+/]]),["regex"]);function A(Se){var Fe=Se.langExtension;try{var $e=Ce(Se.sourceNode,Se.pre),at=$e.sourceCode;Se.sourceCode=at,Se.spans=$e.spans,Se.basePos=0,Y(Fe,at)(Se),Xe(Se)}catch(Ke){q.console&&console.log(Ke&&Ke.stack||Ke)}}function _(Se,Fe,$e){var at=$e||!1,Ke=Fe||null,nt=document.createElement("div");nt.innerHTML="
"+Se+"
",nt=nt.firstChild,at&&Ze(nt,at,!0);var tt={langExtension:Ke,numberLines:at,sourceNode:nt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return A(tt),nt.innerHTML}function J(Se,Fe){var $e=Fe||document.body,at=$e.ownerDocument||document;function Ke(ce){return $e.getElementsByTagName(ce)}for(var nt=[Ke("pre"),Ke("code"),Ke("xmp")],tt=[],bt=0;bt0&&ae[ae.length-1])||Ke[0]!==6&&Ke[0]!==2)){Se=0;continue}if(Ke[0]===3&&(!ae||Ke[1]>ae[0]&&Ke[1]0&&ae[ae.length-1])||Ke[0]!==6&&Ke[0]!==2)){Se=0;continue}if(Ke[0]===3&&(!ae||Ke[1]>ae[0]&&Ke[1]',"select"),this.addActionButton(J,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(J,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(J,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(J,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(J,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(J,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(J,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Se=document.createElement("div");Se.className=""+_.toolbarButtonStyleClass.name,Se.setAttribute("data-type-name",$.typeName),Se.innerHTML=$.icon,Se.addEventListener("click",function(){_.markerToolbarButtonClicked(Se,$)}),_.buttons.push(Se),_.markerButtons.push(Se)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",ae.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ae),this.addActionButton(ae,'',"render"),this.addActionButton(ae,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(A){this.buttonClickListeners.push(A)},Y.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_',"select"),this.addActionButton(J,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(J,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(J,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(J,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(J,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(J,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(J,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Se=document.createElement("div");Se.className=""+_.toolbarButtonStyleClass.name,Se.setAttribute("data-type-name",$.typeName),Se.innerHTML=$.icon,Se.addEventListener("click",function(){_.markerToolbarButtonClicked(Se,$)}),_.buttons.push(Se),_.markerButtons.push(Se)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",ae.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ae),this.addActionButton(ae,'',"render"),this.addActionButton(ae,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(A){this.buttonClickListeners.push(A)},Y.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_0&&this.buttonClickListeners.forEach(function(J){return J("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(A,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(A){var _=this.markerButtons.find(function(J){return J.getAttribute("data-type-name")===A});_&&this.setActiveButton(_)},Y.prototype.setCurrentMarker=function(A){var _=this;this.currentMarker=A,this.buttons.filter(function(J){return/delete|notes/.test(J.getAttribute("data-action"))}).forEach(function(J){_.currentMarker===void 0?(J.style.fillOpacity="0.4",J.style.pointerEvents="none"):(J.style.fillOpacity="1",J.style.pointerEvents="all")})},Y}(),M=function(){function Y(A,_,J,ae){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=_,this.uiStyleSettings=J,this.styles=ae,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new U("toolbox",` + `))},Y.prototype.markerToolbarButtonClicked=function(A,_){this.setActiveButton(A),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(A,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(A){var _=this.markerButtons.find(function(J){return J.getAttribute("data-type-name")===A});_&&this.setActiveButton(_)},Y.prototype.setCurrentMarker=function(A){var _=this;this.currentMarker=A,this.buttons.filter(function(J){return/delete|notes/.test(J.getAttribute("data-action"))}).forEach(function(J){_.currentMarker===void 0?(J.style.fillOpacity="0.4",J.style.pointerEvents="none"):(J.style.fillOpacity="1",J.style.pointerEvents="all")})},Y}(),I=function(){function Y(A,_,J,ae){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=_,this.uiStyleSettings=J,this.styles=ae,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new U("toolbox",` width: 100%; flex-shrink: 0; display: flex; @@ -280,15 +280,15 @@ PERFORMANCE OF THIS SOFTWARE. background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new L("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; - `))},Y.prototype.show=function(A){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(A){var _,J,ae=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((J=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&J!==void 0?J:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Se;$.uiStyleSettings=ae.uiStyleSettings;var Fe=document.createElement("div");Fe.className=ae.toolboxButtonStyleClass.name+" "+((Se=ae.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Se!==void 0?Se:ae.toolboxButtonStyleColorsClass.name),Fe.innerHTML=$.icon,Fe.title=$.title,Fe.addEventListener("click",function(){ae.panelButtonClick($)}),ae.panelButtons.push(Fe),ae.buttonRow.appendChild(Fe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(A){var _=this,J=-1;if(A!==this.activePanel){J=this.panels.indexOf(A),this.panelRow.innerHTML="";var ae=A.getUi();ae.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ae),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Se){var Fe,$e;$.className=_.toolboxButtonStyleClass.name+" "+(Se===J?""+((Fe=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:_.toolboxActiveButtonStyleColorsClass.name):""+(($e=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:_.toolboxButtonStyleColorsClass.name))})},Y}(),P=function(Y,A){this.title=Y,this.icon=A},I=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.colors=[],Se.addTransparent=!1,Se.colorBoxes=[],Se.colors=J,Se.currentColor=ae,Se.setCurrentColor=Se.setCurrentColor.bind(Se),Se.getColorBox=Se.getColorBox.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.whiteSpace="nowrap",this.colors.forEach(function(ae){var $=_.getColorBox(ae);J.appendChild($),_.colorBoxes.push($)}),J},A.prototype.getColorBox=function(_){var J=this,ae=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-ae,Se=document.createElement("div");Se.style.display="inline-block",Se.style.boxSizing="content-box",Se.style.width=$-2+"px",Se.style.height=$-2+"px",Se.style.padding="1px",Se.style.marginRight="2px",Se.style.marginBottom="2px",Se.style.borderWidth="2px",Se.style.borderStyle="solid",Se.style.borderRadius=($+2)/2+"px",Se.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Se.addEventListener("click",function(){J.setCurrentColor(_,Se)});var Fe=document.createElement("div");return Fe.style.display="inline-block",Fe.style.width=$-2+"px",Fe.style.height=$-2+"px",Fe.style.backgroundColor=_,Fe.style.borderRadius=$/2+"px",_==="transparent"&&(Fe.style.fill=this.uiStyleSettings.toolboxAccentColor,Fe.innerHTML=` + `))},Y.prototype.show=function(A){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(A){var _,J,ae=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((J=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&J!==void 0?J:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Se;$.uiStyleSettings=ae.uiStyleSettings;var Fe=document.createElement("div");Fe.className=ae.toolboxButtonStyleClass.name+" "+((Se=ae.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Se!==void 0?Se:ae.toolboxButtonStyleColorsClass.name),Fe.innerHTML=$.icon,Fe.title=$.title,Fe.addEventListener("click",function(){ae.panelButtonClick($)}),ae.panelButtons.push(Fe),ae.buttonRow.appendChild(Fe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(A){var _=this,J=-1;if(A!==this.activePanel){J=this.panels.indexOf(A),this.panelRow.innerHTML="";var ae=A.getUi();ae.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ae),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Se){var Fe,$e;$.className=_.toolboxButtonStyleClass.name+" "+(Se===J?""+((Fe=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:_.toolboxActiveButtonStyleColorsClass.name):""+(($e=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:_.toolboxButtonStyleColorsClass.name))})},Y}(),P=function(Y,A){this.title=Y,this.icon=A},M=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.colors=[],Se.addTransparent=!1,Se.colorBoxes=[],Se.colors=J,Se.currentColor=ae,Se.setCurrentColor=Se.setCurrentColor.bind(Se),Se.getColorBox=Se.getColorBox.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.whiteSpace="nowrap",this.colors.forEach(function(ae){var $=_.getColorBox(ae);J.appendChild($),_.colorBoxes.push($)}),J},A.prototype.getColorBox=function(_){var J=this,ae=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-ae,Se=document.createElement("div");Se.style.display="inline-block",Se.style.boxSizing="content-box",Se.style.width=$-2+"px",Se.style.height=$-2+"px",Se.style.padding="1px",Se.style.marginRight="2px",Se.style.marginBottom="2px",Se.style.borderWidth="2px",Se.style.borderStyle="solid",Se.style.borderRadius=($+2)/2+"px",Se.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Se.addEventListener("click",function(){J.setCurrentColor(_,Se)});var Fe=document.createElement("div");return Fe.style.display="inline-block",Fe.style.width=$-2+"px",Fe.style.height=$-2+"px",Fe.style.backgroundColor=_,Fe.style.borderRadius=$/2+"px",_==="transparent"&&(Fe.style.fill=this.uiStyleSettings.toolboxAccentColor,Fe.innerHTML=` `),Se.appendChild(Fe),Se},A.prototype.setCurrentColor=function(_,J){var ae=this;this.currentColor=_,this.colorBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(_)},A}(P),C=function(){function Y(A,_,J){this._state="new",this._isSelected=!1,this._container=A,this._overlayContainer=_,this.globalSettings=J,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(A){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(A,_){},Y.prototype.dblClick=function(A,_){},Y.prototype.manipulate=function(A){},Y.prototype.pointerUp=function(A){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(A){this.container.childNodes.length>0?this.container.insertBefore(A,this.container.childNodes[0]):this.container.appendChild(A)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(A){this._state=A.state,this.notes=A.notes},Y.prototype.scale=function(A,_){},Y.prototype.colorChanged=function(A){this.onColorChanged&&this.onColorChanged(A),this.stateChanged()},Y.prototype.fillColorChanged=function(A){this.onFillColorChanged&&this.onFillColorChanged(A),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var A=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),A.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(A)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),d=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(A){return this.topLeft.ownsTarget(A)?this.topLeft:this.topCenter.ownsTarget(A)?this.topCenter:this.topRight.ownsTarget(A)?this.topRight:this.centerLeft.ownsTarget(A)?this.centerLeft:this.centerRight.ownsTarget(A)?this.centerRight:this.bottomLeft.ownsTarget(A)?this.bottomLeft:this.bottomCenter.ownsTarget(A)?this.bottomCenter:this.bottomRight.ownsTarget(A)?this.bottomRight:void 0},Y}(),f=function(){function Y(){this.GRIP_SIZE=10,this.visual=B.createGroup(),this.visual.appendChild(B.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(B.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},Y}(),p=function(){function Y(){}return Y.toITransformMatrix=function(A){return{a:A.a,b:A.b,c:A.c,d:A.d,e:A.e,f:A.f}},Y.toSVGMatrix=function(A,_){return A.a=_.a,A.b=_.b,A.c=_.c,A.d=_.d,A.e=_.e,A.f=_.f,A},Y}(),T=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(B.createTransform()),$.setupControlBox(),$}return re(A,Y),Object.defineProperty(A.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"visual",{get:function(){return this._visual},set:function(_){this._visual=_;var J=B.createTransform();this._visual.transform.baseVal.appendItem(J)},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(_){return!!Y.prototype.ownsTarget.call(this,_)||!!(this.controlGrips.findGripByVisual(_)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(_))},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="new"&&(this.left=_.x,this.top=_.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ae=this.unrotatePoint(_);if(this.manipulationStartX=ae.x,this.manipulationStartY=ae.y,this.offsetX=ae.x-this.left,this.offsetY=ae.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(J),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(J)){this.activeGrip=this.rotatorGrip;var $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Se=this.container.transform.baseVal.getItem(0);Se.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Se,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},A.prototype.pointerUp=function(_){var J=this.state;Y.prototype.pointerUp.call(this,_),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(_),this._state="select",J==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},A.prototype.moveVisual=function(_){this.visual.style.transform="translate("+_.x+"px, "+_.y+"px)"},A.prototype.manipulate=function(_){var J=this.unrotatePoint(_);this.state==="creating"?this.resize(_):this.state==="move"?(this.left=this.manipulationStartLeft+(J.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(J.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(J):this.state==="rotate"&&this.rotate(_)},A.prototype.resize=function(_){var J=this.manipulationStartLeft,ae=this.manipulationStartWidth,$=this.manipulationStartTop,Se=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:J=this.manipulationStartLeft+_.x-this.manipulationStartX,ae=this.manipulationStartWidth+this.manipulationStartLeft-J;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ae=this.manipulationStartWidth+_.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+_.y-this.manipulationStartY,Se=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Se=this.manipulationStartHeight+_.y-this.manipulationStartY}ae>=0?(this.left=J,this.width=ae):(this.left=J+ae,this.width=-ae),Se>=0?(this.top=$,this.height=Se):(this.top=$+Se,this.height=-Se),this.setSize()},A.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},A.prototype.rotate=function(_){if(Math.abs(_.x-this.centerX)>.1){var J=Math.sign(_.x-this.centerX);this.rotationAngle=180*Math.atan((_.y-this.centerY)/(_.x-this.centerX))/Math.PI+90*J,this.applyRotation()}},A.prototype.applyRotation=function(){var _=this.container.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_,0)},A.prototype.rotatePoint=function(_){if(this.rotationAngle===0)return _;var J=this.container.getCTM(),ae=B.createPoint(_.x,_.y);return{x:(ae=ae.matrixTransform(J)).x,y:ae.y}},A.prototype.unrotatePoint=function(_){if(this.rotationAngle===0)return _;var J=this.container.getCTM();J=J.inverse();var ae=B.createPoint(_.x,_.y);return{x:(ae=ae.matrixTransform(J)).x,y:ae.y}},A.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=B.createGroup();var _=B.createTransform();_.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(_),this.container.appendChild(this.controlBox),this.controlRect=B.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=B.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new d,this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){var _=this.controlBox.transform.baseVal.getItem(0);_.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(_,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},A.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},A.prototype.createGrip=function(){var _=new f;return _.visual.transform.baseVal.appendItem(B.createTransform()),this.controlBox.appendChild(_.visual),_},A.prototype.positionGrips=function(){var _=this.controlGrips.topLeft.GRIP_SIZE,J=-_/2,ae=J,$=(this.width+this.CB_DISTANCE)/2-_/2,Se=(this.height+this.CB_DISTANCE)/2-_/2,Fe=this.height+this.CB_DISTANCE-_/2,$e=this.width+this.CB_DISTANCE-_/2;this.positionGrip(this.controlGrips.topLeft.visual,J,ae),this.positionGrip(this.controlGrips.topCenter.visual,$,ae),this.positionGrip(this.controlGrips.topRight.visual,$e,ae),this.positionGrip(this.controlGrips.centerLeft.visual,J,Se),this.positionGrip(this.controlGrips.centerRight.visual,$e,Se),this.positionGrip(this.controlGrips.bottomLeft.visual,J,Fe),this.positionGrip(this.controlGrips.bottomCenter.visual,$,Fe),this.positionGrip(this.controlGrips.bottomRight.visual,$e,Fe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,ae-3*this.CB_DISTANCE)},A.prototype.positionGrip=function(_,J,ae){var $=_.transform.baseVal.getItem(0);$.setTranslate(J,ae),_.transform.baseVal.replaceItem($,0)},A.prototype.hideControlBox=function(){this.controlBox.style.display="none"},A.prototype.showControlBox=function(){this.controlBox.style.display=""},A.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:p.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:p.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.left=J.left,this.top=J.top,this.width=J.width,this.height=J.height,this.rotationAngle=J.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(p.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,J.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(p.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,J.containerTransformMatrix))},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J);var ae=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:ae.x*_,y:ae.y*J});this.left=$.x,this.top=$.y,this.width=this.width*_,this.height=this.height*J,this.adjustControlBox()},A}(C),x=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual)},A.prototype.createVisual=function(){this.visual=B.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},A.prototype.manipulate=function(_){Y.prototype.manipulate.call(this,_)},A.prototype.resize=function(_){Y.prototype.resize.call(this,_),this.setSize()},A.prototype.setSize=function(){Y.prototype.setSize.call(this),B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(_){Y.prototype.pointerUp.call(this,_),this.setSize()},A.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&B.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},A.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&B.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},A.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&B.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&B.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},A.prototype.restoreState=function(_){var J=_;this.fillColor=J.fillColor,this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.opacity=J.opacity,this.createVisual(),Y.prototype.restoreState.call(this,_),this.setSize()},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.setSize()},A.title="Rectangle marker",A}(T),E=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.widths=[],Se.widthBoxes=[],Se.widths=J,Se.currentWidth=ae,Se.setCurrentWidth=Se.setCurrentWidth.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.widths.forEach(function(ae){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ae===_.currentWidth?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentWidth(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.innerText=ae.toString(),Se.style.marginRight="5px",$.appendChild(Se);var Fe=document.createElement("div");Fe.style.minHeight="20px",Fe.style.flexGrow="2",Fe.style.display="flex",Fe.style.alignItems="center";var $e=document.createElement("hr");$e.style.minWidth="20px",$e.style.border="0px",$e.style.borderTop=ae+"px solid "+_.uiStyleSettings.toolboxColor,$e.style.flexGrow="2",Fe.appendChild($e),$.appendChild(Fe),_.widthBoxes.push($)}),J},A.prototype.setCurrentWidth=function(_,J){var ae=this;this.currentWidth=_,this.widthBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},A}(P),k=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.styles=[],Se.styleBoxes=[],Se.styles=J,Se.currentStyle=ae,Se.setCurrentStyle=Se.setCurrentStyle.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.styles.forEach(function(ae){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/_.styles.length-5+"%",$.style.borderColor=ae===_.currentStyle?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentStyle(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.overflow="hidden";var Fe=` - `;Se.innerHTML=Fe,$.appendChild(Se),_.styleBoxes.push($)}),J},A.prototype.setCurrentStyle=function(_,J){var ae=this;this.currentStyle=_,this.styleBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(P),w=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new I("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="FrameMarker",A.title="Frame marker",A.icon='',A}(x),b=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},m=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return re(A,Y),A.prototype.ownsTarget=function(_){return!!Y.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(J)?this.activeGrip=this.grip1:this.grip2.ownsTarget(J)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(_){var J=this.state;Y.prototype.pointerUp.call(this,_),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(_),this._state="select",J==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},A.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=B.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var _=new f;return _.visual.transform.baseVal.appendItem(B.createTransform()),this.controlBox.appendChild(_.visual),_},A.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},A.prototype.positionGrip=function(_,J,ae){var $=_.transform.baseVal.getItem(0);$.setTranslate(J,ae),_.transform.baseVal.replaceItem($,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.x1=J.x1,this.y1=J.y1,this.x2=J.x2,this.y2=J.y2},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.x1=this.x1*_,this.y1=this.y1*J,this.x2=this.x2*_,this.y2=this.y2*J,this.adjustVisual(),this.adjustControlBox()},A}(C),v=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new I("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),B.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},A.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},A.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='',A}(m),g=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.fonts=[],Se.fontBoxes=[],Se.fonts=J,Se.currentFont=ae,Se.setCurrentFont=Se.setCurrentFont.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.flexGrow="2",this.fonts.forEach(function(ae){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/_.fonts.length-5+"%",$.style.borderColor=ae===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentFont(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.style.display="flex",Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.fontFamily=ae,Se.style.overflow="hidden";var Fe=document.createElement("div");Fe.style.whiteSpace="nowrap",Fe.style.overflow="hidden",Fe.style.textOverflow="ellipsis",Fe.innerHTML="The quick brown fox jumps over the lazy dog",Se.appendChild(Fe),$.appendChild(Se),_.fontBoxes.push($)}),J},A.prototype.setCurrentFont=function(_,J){var ae=this;this.currentFont=_,this.fontBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(P),R=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=ae.defaultColor,$.fontFamily=ae.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new I("Color",ae.defaultColorSet,ae.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new g("Font",ae.defaultFontFamilies,ae.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return re(A,Y),A.prototype.ownsTarget=function(_){if(Y.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var J=!1;return this.textElement.childNodes.forEach(function(ae){ae===_&&(J=!0)}),J},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.bgRectangle=B.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=B.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},A.prototype.renderText=function(){var _=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(J){_.textElement.appendChild(B.createTSpan(J.trim()===""?" ":J.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var _=this.textElement.getBBox(),J=1;if(_.width>0&&_.height>0){var ae=(1*this.width-this.width*this.padding*2/100)/_.width,$=(1*this.height-this.height*this.padding*2/100)/_.height;J=Math.min(ae,$)}return J},A.prototype.getTextPosition=function(_){var J=this.textElement.getBBox(),ae=0,$=0;return J.width>0&&J.height>0&&(ae=(this.width-J.width*_)/2,$=this.height/2-J.height*_/2),{x:ae,y:$}},A.prototype.sizeText=function(){var _=this.textElement.getBBox(),J=this.getTextScale(),ae=this.getTextPosition(J);ae.y-=_.y*J,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ae.x+"px, "+ae.y+"px) scale("+J+", "+J+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ae.x,ae.y),this.textElement.transform.baseVal.getItem(1).setScale(J,J))},A.prototype.manipulate=function(_){Y.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(_){Y.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(_){var J=this.state;J==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,_),this.setSize(),(J==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(J){J.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var J=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&J>.9;)J-=.1,_.textEditor.style.fontSize=Math.max(J,.9)+"em"}),this.textEditor.addEventListener("keyup",function(J){J.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(J){if(J.clipboardData){var ae=J.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(ae)),J.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),J=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ae=this.textElement.getBBox(),$={x:ae.width*_,y:ae.height*_};J.x-=$.x/2,J.y-=$.y/2,this.textEditor.style.top=J.y+"px",this.textEditor.style.left=J.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-J.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},A.prototype.dblClick=function(_,J){Y.prototype.dblClick.call(this,_,J),this.showTextEditor()},A.prototype.setColor=function(_){this.textElement&&B.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},A.prototype.setFont=function(_){this.textElement&&B.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){var J=_;this.color=J.color,this.fontFamily=J.fontFamily,this.padding=J.padding,this.text=J.text,this.createVisual(),Y.prototype.restoreState.call(this,_),this.setSize()},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.icon='',A}(T),O=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=ae.defaultColor,$.lineWidth=ae.defaultStrokeWidth,$.pixelRatio=ae.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new I("Color",ae.defaultColorSet,ae.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.drawingImage=B.createImage(),this.visual.appendChild(this.drawingImage);var _=B.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):Y.prototype.pointerDown.call(this,_,J)},A.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,_)},A.prototype.resize=function(_){Y.prototype.resize.call(this,_),B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,_)},A.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),J=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ae=J[0],$=J[1],Se=J[2],Fe=J[3],$e=!1,at=0;at0&&($e=!0,at<$&&($=at),KeFe&&(Fe=at),Ke>Se&&(Se=Ke));if($e){this.left=ae/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Se-ae)/this.pixelRatio,this.height=(Fe-$)/this.pixelRatio;var nt=document.createElement("canvas");nt.width=Se-ae,nt.height=Fe-$,nt.getContext("2d").putImageData(this.canvasContext.getImageData(ae,$,Se-ae,Fe-$),0,0),this.drawingImgUrl=nt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},A.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){this.createVisual(),Y.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.icon='',A}(T),G=function(Y){function A(_,J,ae){var $=Y.call(this,_,ae||'')||this;return $.typeBoxes=[],$.currentType=J,$.setCurrentType=$.setCurrentType.bind($),$}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2";for(var ae=function(Fe){var $e="both";switch(Fe){case 0:$e="both";break;case 1:$e="start";break;case 2:$e="end";break;case 3:$e="none"}var at=document.createElement("div");if(at.style.display="flex",at.style.flexGrow="2",at.style.alignItems="center",at.style.justifyContent="space-between",at.style.padding="5px",at.style.borderWidth="2px",at.style.borderStyle="solid",at.style.borderColor=$e===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",at.addEventListener("click",function(){_.setCurrentType($e,at)}),J.appendChild(at),$e==="both"||$e==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=` + `;Se.innerHTML=Fe,$.appendChild(Se),_.styleBoxes.push($)}),J},A.prototype.setCurrentStyle=function(_,J){var ae=this;this.currentStyle=_,this.styleBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(P),w=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new M("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="FrameMarker",A.title="Frame marker",A.icon='',A}(x),b=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},m=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return re(A,Y),A.prototype.ownsTarget=function(_){return!!Y.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(J)?this.activeGrip=this.grip1:this.grip2.ownsTarget(J)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(_){var J=this.state;Y.prototype.pointerUp.call(this,_),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(_),this._state="select",J==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},A.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=B.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var _=new f;return _.visual.transform.baseVal.appendItem(B.createTransform()),this.controlBox.appendChild(_.visual),_},A.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},A.prototype.positionGrip=function(_,J,ae){var $=_.transform.baseVal.getItem(0);$.setTranslate(J,ae),_.transform.baseVal.replaceItem($,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.x1=J.x1,this.y1=J.y1,this.x2=J.x2,this.y2=J.y2},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.x1=this.x1*_,this.y1=this.y1*J,this.x2=this.x2*_,this.y2=this.y2*J,this.adjustVisual(),this.adjustControlBox()},A}(C),v=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new M("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),B.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},A.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},A.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='',A}(m),g=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.fonts=[],Se.fontBoxes=[],Se.fonts=J,Se.currentFont=ae,Se.setCurrentFont=Se.setCurrentFont.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.flexGrow="2",this.fonts.forEach(function(ae){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/_.fonts.length-5+"%",$.style.borderColor=ae===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentFont(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.style.display="flex",Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.fontFamily=ae,Se.style.overflow="hidden";var Fe=document.createElement("div");Fe.style.whiteSpace="nowrap",Fe.style.overflow="hidden",Fe.style.textOverflow="ellipsis",Fe.innerHTML="The quick brown fox jumps over the lazy dog",Se.appendChild(Fe),$.appendChild(Se),_.fontBoxes.push($)}),J},A.prototype.setCurrentFont=function(_,J){var ae=this;this.currentFont=_,this.fontBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(P),R=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=ae.defaultColor,$.fontFamily=ae.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new M("Color",ae.defaultColorSet,ae.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new g("Font",ae.defaultFontFamilies,ae.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return re(A,Y),A.prototype.ownsTarget=function(_){if(Y.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var J=!1;return this.textElement.childNodes.forEach(function(ae){ae===_&&(J=!0)}),J},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.bgRectangle=B.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=B.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},A.prototype.renderText=function(){var _=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(J){_.textElement.appendChild(B.createTSpan(J.trim()===""?" ":J.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var _=this.textElement.getBBox(),J=1;if(_.width>0&&_.height>0){var ae=(1*this.width-this.width*this.padding*2/100)/_.width,$=(1*this.height-this.height*this.padding*2/100)/_.height;J=Math.min(ae,$)}return J},A.prototype.getTextPosition=function(_){var J=this.textElement.getBBox(),ae=0,$=0;return J.width>0&&J.height>0&&(ae=(this.width-J.width*_)/2,$=this.height/2-J.height*_/2),{x:ae,y:$}},A.prototype.sizeText=function(){var _=this.textElement.getBBox(),J=this.getTextScale(),ae=this.getTextPosition(J);ae.y-=_.y*J,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ae.x+"px, "+ae.y+"px) scale("+J+", "+J+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ae.x,ae.y),this.textElement.transform.baseVal.getItem(1).setScale(J,J))},A.prototype.manipulate=function(_){Y.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(_){Y.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(_){var J=this.state;J==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,_),this.setSize(),(J==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(J){J.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var J=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&J>.9;)J-=.1,_.textEditor.style.fontSize=Math.max(J,.9)+"em"}),this.textEditor.addEventListener("keyup",function(J){J.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(J){if(J.clipboardData){var ae=J.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(ae)),J.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),J=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ae=this.textElement.getBBox(),$={x:ae.width*_,y:ae.height*_};J.x-=$.x/2,J.y-=$.y/2,this.textEditor.style.top=J.y+"px",this.textEditor.style.left=J.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-J.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},A.prototype.dblClick=function(_,J){Y.prototype.dblClick.call(this,_,J),this.showTextEditor()},A.prototype.setColor=function(_){this.textElement&&B.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},A.prototype.setFont=function(_){this.textElement&&B.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){var J=_;this.color=J.color,this.fontFamily=J.fontFamily,this.padding=J.padding,this.text=J.text,this.createVisual(),Y.prototype.restoreState.call(this,_),this.setSize()},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.icon='',A}(T),O=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=ae.defaultColor,$.lineWidth=ae.defaultStrokeWidth,$.pixelRatio=ae.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new M("Color",ae.defaultColorSet,ae.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.drawingImage=B.createImage(),this.visual.appendChild(this.drawingImage);var _=B.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):Y.prototype.pointerDown.call(this,_,J)},A.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,_)},A.prototype.resize=function(_){Y.prototype.resize.call(this,_),B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,_)},A.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),J=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ae=J[0],$=J[1],Se=J[2],Fe=J[3],$e=!1,at=0;at0&&($e=!0,at<$&&($=at),KeFe&&(Fe=at),Ke>Se&&(Se=Ke));if($e){this.left=ae/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Se-ae)/this.pixelRatio,this.height=(Fe-$)/this.pixelRatio;var nt=document.createElement("canvas");nt.width=Se-ae,nt.height=Fe-$,nt.getContext("2d").putImageData(this.canvasContext.getImageData(ae,$,Se-ae,Fe-$),0,0),this.drawingImgUrl=nt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},A.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){this.createVisual(),Y.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(_,J){Y.prototype.scale.call(this,_,J),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.icon='',A}(T),H=function(Y){function A(_,J,ae){var $=Y.call(this,_,ae||'')||this;return $.typeBoxes=[],$.currentType=J,$.setCurrentType=$.setCurrentType.bind($),$}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2";for(var ae=function(Fe){var $e="both";switch(Fe){case 0:$e="both";break;case 1:$e="start";break;case 2:$e="end";break;case 3:$e="none"}var at=document.createElement("div");if(at.style.display="flex",at.style.flexGrow="2",at.style.alignItems="center",at.style.justifyContent="space-between",at.style.padding="5px",at.style.borderWidth="2px",at.style.borderStyle="solid",at.style.borderColor=$e===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",at.addEventListener("click",function(){_.setCurrentType($e,at)}),J.appendChild(at),$e==="both"||$e==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=` `,Ke.style.marginLeft="5px",at.appendChild(Ke)}var nt=document.createElement("div");nt.style.display="flex",nt.style.alignItems="center",nt.style.minHeight="20px",nt.style.flexGrow="2";var tt=document.createElement("hr");if(tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),tt.style.flexGrow="2",nt.appendChild(tt),at.appendChild(nt),$e==="both"||$e==="end"){var bt=document.createElement("div");bt.style.display="flex",bt.style.alignItems="center",bt.style.minHeight="20px",bt.innerHTML=` - `,bt.style.marginRight="5px",at.appendChild(bt)}$.typeBoxes.push(at)},$=this,Se=0;Se<4;Se++)ae(Se);return J},A.prototype.setCurrentType=function(_,J){var ae=this;this.currentType=_,this.typeBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(P),Z=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new G("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},A.prototype.getArrowPoints=function(_,J){var ae=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return _-ae/2+","+(J+$/2)+" "+_+","+(J-$/2)+" "+(_+ae/2)+","+(J+$/2)},A.prototype.createTips=function(){this.arrow1=B.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=B.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",B.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),B.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.arrow1.transform.baseVal.getItem(0);J.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(J,0);var ae=this.arrow2.transform.baseVal.getItem(0);ae.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ae,0)}},A.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.arrowType=J.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='',A}(v),ee=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.fillColor=ae.defaultFillColor,$.strokeWidth=0,$.fillPanel=new I("Color",ae.defaultColorSet,ae.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="CoverMarker",A.title="Cover marker",A.icon='',A}(x),fe=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.opacities=[],Se.opacityBoxes=[],Se.opacities=J,Se.currentOpacity=ae,Se.setCurrentOpacity=Se.setCurrentOpacity.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",J.style.justifyContent="space-between",this.opacities.forEach(function(ae){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ae===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentOpacity(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.innerText=100*ae+"%",$.appendChild(Se),_.opacityBoxes.push($)}),J},A.prototype.setCurrentOpacity=function(_,J){var ae=this;this.currentOpacity=_,this.opacityBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(P),pe=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=ae.defaultHighlightColor,$.strokeWidth=0,$.opacity=ae.defaultHighlightOpacity,$.fillPanel=new I("Color",ae.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new fe("Opacity",ae.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return re(A,Y),A.prototype.setOpacity=function(_){this.opacity=_,this.visual&&B.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="HighlightMarker",A.title="Highlight marker",A.icon='',A}(ee),xe='',Ce=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=ae.defaultStrokeColor,$.bgColor=ae.defaultFillColor,$.fontFamily=ae.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new I("Text color",ae.defaultColorSet,$.color,''),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new I("Fill color",ae.defaultColorSet,$.bgColor,xe),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new g("Font",ae.defaultFontFamilies,ae.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new f,$.tipGrip.visual.transform.baseVal.appendItem(B.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return re(A,Y),A.prototype.ownsTarget=function(_){return Y.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},A.prototype.createTip=function(){B.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=B.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(_,J){this.state==="new"&&Y.prototype.pointerDown.call(this,_,J),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(J)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,_,J)},A.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,_);else{var J=this.state==="creating";Y.prototype.pointerUp.call(this,_),this.setTipPoints(J),this.positionTip()}},A.prototype.manipulate=function(_){if(this.tipMoving){var J=this.unrotatePoint(_);this.tipPosition={x:J.x-this.manipulationStartLeft,y:J.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,_)},A.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(B.setAttributes(this.bgRectangle,[["fill",_]]),B.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},A.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},A.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var J=Math.min(this.height/2,15),ae=this.height/5;_&&(this.tipPosition={x:J+ae/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?$.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.tip1.transform.baseVal.getItem(0);J.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(J,0);var ae=this.tip2.transform.baseVal.getItem(0);ae.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ae,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.icon='',A}(v),We=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokePanel.colors=ae.defaultColorSet,$.fillColor="transparent",$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.icon='',A}(be),Ue=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ct=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new I("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorCurve=B.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=B.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(J)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),B.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=B.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=B.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},A.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),Y.prototype.manipulate.call(this,_)},A.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),Y.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},A.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},A.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},A.prototype.scale=function(_,J){this.curveX=this.curveX*_,this.curveY=this.curveY*J,Y.prototype.scale.call(this,_,J)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.curveX=J.curveX,this.curveY=J.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.icon='',A}(m),Ge=function(){function Y(A,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=_}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Je=function(Y){function A(_,J,ae){var $=Y.call(this,_,!1)||this;return $.dataUrl=J,$.state=ae,$}return re(A,Y),A}(Ge),Xe=function(Y){function A(_,J,ae){ae===void 0&&(ae=!1);var $=Y.call(this,_,ae)||this;return $.marker=J,$}return re(A,Y),A}(Ge),Ye=function(){function Y(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Y.prototype.addEventListener=function(A,_){this[A].push(_)},Y.prototype.removeEventListener=function(A,_){var J=this[A].indexOf(_);J>-1&&this[A].splice(J,1)},Y}(),ke=function(){function Y(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new b,this._isOpen=!1,this.undoRedoManager=new Ue,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ye,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new V(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[w,O,Z,R,We,be,pe,Ce,Oe,ee,v,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[w,O,Z,R,be,pe,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[w,O,Z,R,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var _=this;this._availableMarkerTypes.splice(0),A.forEach(function(J){if(typeof J=="string"){var ae=_.ALL_MARKER_TYPES.find(function($){return $.typeName===J});ae!==void 0&&_._availableMarkerTypes.push(ae)}else _._availableMarkerTypes.push(J)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(A){this._zoomLevel=A,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&X.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=X.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new Ge(A))})},Y.prototype.render=function(){return H(this,void 0,void 0,function(){var A;return oe(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(A=new q).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},Y.prototype.close=function(A){var _=this;if(A===void 0&&(A=!1),this.isOpen){var J=!1;A||this.eventListeners.beforeclose.forEach(function(ae){var $=new Ge(_,!0);ae($),$.defaultPrevented&&(J=!0)}),J||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ae){return ae(new Ge(_))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var A,_=[],J=0;Jthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,J=_',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Y.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new W(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(A),1),A.dispose()},Y.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Y.prototype.toolbarButtonClicked=function(A,_){if(A==="marker"&&_!==void 0)this.createNewMarker(_);else if(A==="action")switch(_){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var A=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ae){var $=new Xe(A,A._currentMarker,!0);ae($),$.defaultPrevented&&(_=!0)}),!_){var J=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ae){return ae(new Xe(A,J))})}}},Y.prototype.clear=function(){var A=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Se){var Fe=new Xe(A,void 0,!0);Se(Fe),Fe.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var J=function(Se){var Fe=ae.markers[Se];ae.setCurrentMarker(ae.markers[Se]),ae._currentMarker.dispose(),ae.markerImage.removeChild(ae._currentMarker.container),ae.markers.splice(ae.markers.indexOf(ae._currentMarker),1),ae.eventListeners.markerdelete.forEach(function($e){return $e(new Xe(A,Fe))})},ae=this,$=this.markers.length-1;$>=0;$--)J($);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var A;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",this.overlayContainer.appendChild(this.notesArea))},Y.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),J=this.undoRedoManager.getLastUndoStep();if(!J||J.width===_.width&&J.height===_.height){var ae=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),ae1&&this.panTo({x:A.clientX,y:A.clientY}))},Y.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(A,_){var J=this.markerImage.getBoundingClientRect();return{x:(A-J.left)/this.zoomLevel,y:(_-J.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Y.prototype.addLicenseKey=function(A){se.addKey(A)},Y.prototype.addEventListener=function(A,_){this.eventListeners.addEventListener(A,_)},Y.prototype.removeEventListener=function(A,_){this.eventListeners.removeEventListener(A,_)},Y.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new Ge(A))}))},Y.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new Ge(A))}))},Y.instanceCounter=0,Y}()},Vg4E:function(Pr,dr,He){},Y1PL:function(Pr,dr,He){"use strict";He.r(dr),He.d(dr,"ResizableTextArea",function(){return We});var ze=He("wx14"),re=He("1OyB"),H=He("vuIU"),oe=He("Ji7U"),K=He("LK+K"),B=He("q1tI"),se=He("VTBJ"),q=He("rePB"),X=He("Zm9Q"),V=He("Kwbf"),L=He("c+Xe"),U=He("m+aA"),W=He("bdgK"),M=new Map;function P(Ge){Ge.forEach(function(Je){var Xe,Ye=Je.target;(Xe=M.get(Ye))===null||Xe===void 0||Xe.forEach(function(ke){return ke(Ye)})})}var I=new W.default(P),C=null,d=null;function f(Ge,Je){M.has(Ge)||(M.set(Ge,new Set),I.observe(Ge)),M.get(Ge).add(Je)}function p(Ge,Je){M.has(Ge)&&(M.get(Ge).delete(Je),M.get(Ge).size||(I.unobserve(Ge),M.delete(Ge)))}var T=function(Ge){Object(oe.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(){return Object(re.a)(this,Xe),Je.apply(this,arguments)}return Object(H.a)(Xe,[{key:"render",value:function(){return this.props.children}}]),Xe}(B.Component),x=B.createContext(null);function E(Ge){var Je=Ge.children,Xe=Ge.onBatchResize,Ye=B.useRef(0),ke=B.useRef([]),Y=B.useContext(x),A=B.useCallback(function(_,J,ae){Ye.current+=1;var $=Ye.current;ke.current.push({size:_,element:J,data:ae}),Promise.resolve().then(function(){$===Ye.current&&(Xe==null||Xe(ke.current),ke.current=[])}),Y==null||Y(_,J,ae)},[Xe,Y]);return B.createElement(x.Provider,{value:A},Je)}function k(Ge){var Je=Ge.children,Xe=Ge.disabled,Ye=B.useRef(null),ke=B.useRef(null),Y=B.useContext(x),A=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_=B.isValidElement(Je)&&Object(L.c)(Je),J=_?Je.ref:null,ae=B.useMemo(function(){return Object(L.a)(J,Ye)},[J,Ye]),$=B.useRef(Ge);$.current=Ge;var Se=B.useCallback(function(Fe){var $e=$.current,at=$e.onResize,Ke=$e.data,nt=Fe.getBoundingClientRect(),tt=nt.width,bt=nt.height,_t=Fe.offsetWidth,Lt=Fe.offsetHeight,Ot=Math.floor(tt),xt=Math.floor(bt);if(A.current.width!==Ot||A.current.height!==xt||A.current.offsetWidth!==_t||A.current.offsetHeight!==Lt){var jt={width:Ot,height:xt,offsetWidth:_t,offsetHeight:Lt};A.current=jt;var Nt=_t===Math.round(tt)?tt:_t,mt=Lt===Math.round(bt)?bt:Lt,Ht=Object(se.a)(Object(se.a)({},jt),{},{offsetWidth:Nt,offsetHeight:mt});Y==null||Y(Ht,Fe,Ke),at&&Promise.resolve().then(function(){at(Ht,Fe)})}},[]);return B.useEffect(function(){var Fe=Object(U.a)(Ye.current)||Object(U.a)(ke.current);return Fe&&!Xe&&f(Fe,Se),function(){return p(Fe,Se)}},[Ye.current,Xe]),B.createElement(T,{ref:ke},_?B.cloneElement(Je,{ref:ae}):Je)}var w="rc-observer-key";function b(Ge){var Je=Ge.children,Xe=Object(X.a)(Je);return Xe.map(function(Ye,ke){var Y=(Ye==null?void 0:Ye.key)||"".concat(w,"-").concat(ke);return B.createElement(k,Object(ze.a)({},Ge,{key:Y}),Ye)})}b.Collection=E;var m=b,v=He("bT9E"),g=He("TSYQ"),R=He.n(g),O=` + `,bt.style.marginRight="5px",at.appendChild(bt)}$.typeBoxes.push(at)},$=this,Se=0;Se<4;Se++)ae(Se);return J},A.prototype.setCurrentType=function(_,J){var ae=this;this.currentType=_,this.typeBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(P),Z=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new H("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},A.prototype.getArrowPoints=function(_,J){var ae=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return _-ae/2+","+(J+$/2)+" "+_+","+(J-$/2)+" "+(_+ae/2)+","+(J+$/2)},A.prototype.createTips=function(){this.arrow1=B.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=B.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",B.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),B.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.arrow1.transform.baseVal.getItem(0);J.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(J,0);var ae=this.arrow2.transform.baseVal.getItem(0);ae.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ae,0)}},A.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.arrowType=J.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='',A}(v),ee=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.fillColor=ae.defaultFillColor,$.strokeWidth=0,$.fillPanel=new M("Color",ae.defaultColorSet,ae.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="CoverMarker",A.title="Cover marker",A.icon='',A}(x),fe=function(Y){function A(_,J,ae,$){var Se=Y.call(this,_,$||'')||this;return Se.opacities=[],Se.opacityBoxes=[],Se.opacities=J,Se.currentOpacity=ae,Se.setCurrentOpacity=Se.setCurrentOpacity.bind(Se),Se}return re(A,Y),A.prototype.getUi=function(){var _=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",J.style.justifyContent="space-between",this.opacities.forEach(function(ae){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=ae===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){_.setCurrentOpacity(ae,$)}),J.appendChild($);var Se=document.createElement("div");Se.innerText=100*ae+"%",$.appendChild(Se),_.opacityBoxes.push($)}),J},A.prototype.setCurrentOpacity=function(_,J){var ae=this;this.currentOpacity=_,this.opacityBoxes.forEach(function($){$.style.borderColor=$===J?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(P),pe=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=ae.defaultHighlightColor,$.strokeWidth=0,$.opacity=ae.defaultHighlightOpacity,$.fillPanel=new M("Color",ae.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new fe("Opacity",ae.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return re(A,Y),A.prototype.setOpacity=function(_){this.opacity=_,this.visual&&B.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="HighlightMarker",A.title="Highlight marker",A.icon='',A}(ee),xe='',Ce=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=ae.defaultStrokeColor,$.bgColor=ae.defaultFillColor,$.fontFamily=ae.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new M("Text color",ae.defaultColorSet,$.color,''),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new M("Fill color",ae.defaultColorSet,$.bgColor,xe),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new g("Font",ae.defaultFontFamilies,ae.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new f,$.tipGrip.visual.transform.baseVal.appendItem(B.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return re(A,Y),A.prototype.ownsTarget=function(_){return Y.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},A.prototype.createTip=function(){B.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=B.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(_,J){this.state==="new"&&Y.prototype.pointerDown.call(this,_,J),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(J)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,_,J)},A.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,_);else{var J=this.state==="creating";Y.prototype.pointerUp.call(this,_),this.setTipPoints(J),this.positionTip()}},A.prototype.manipulate=function(_){if(this.tipMoving){var J=this.unrotatePoint(_);this.tipPosition={x:J.x-this.manipulationStartLeft,y:J.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,_)},A.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(B.setAttributes(this.bgRectangle,[["fill",_]]),B.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},A.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},A.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var J=Math.min(this.height/2,15),ae=this.height/5;_&&(this.tipPosition={x:J+ae/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?$.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.tip1.transform.baseVal.getItem(0);J.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(J,0);var ae=this.tip2.transform.baseVal.getItem(0);ae.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ae,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.icon='',A}(v),We=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokePanel.colors=ae.defaultColorSet,$.fillColor="transparent",$}return re(A,Y),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Y.prototype.getState.call(this);return _.typeName=A.typeName,_},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.icon='',A}(be),je=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ct=function(Y){function A(_,J,ae){var $=Y.call(this,_,J,ae)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=ae.defaultColor,$.strokeWidth=ae.defaultStrokeWidth,$.strokeDasharray=ae.defaultStrokeDasharray,$.strokePanel=new M("Line color",ae.defaultColorSet,ae.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new E("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new k("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return re(A,Y),A.prototype.ownsTarget=function(_){return!(!Y.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorCurve=B.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=B.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(_,J){Y.prototype.pointerDown.call(this,_,J),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(J)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),B.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=B.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=B.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},A.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),Y.prototype.manipulate.call(this,_)},A.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),Y.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},A.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},A.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},A.prototype.scale=function(_,J){this.curveX=this.curveX*_,this.curveY=this.curveY*J,Y.prototype.scale.call(this,_,J)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return _.typeName=A.typeName,_},A.prototype.restoreState=function(_){Y.prototype.restoreState.call(this,_);var J=_;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.curveX=J.curveX,this.curveY=J.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.icon='',A}(m),Ge=function(){function Y(A,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=_}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Ze=function(Y){function A(_,J,ae){var $=Y.call(this,_,!1)||this;return $.dataUrl=J,$.state=ae,$}return re(A,Y),A}(Ge),Xe=function(Y){function A(_,J,ae){ae===void 0&&(ae=!1);var $=Y.call(this,_,ae)||this;return $.marker=J,$}return re(A,Y),A}(Ge),Qe=function(){function Y(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Y.prototype.addEventListener=function(A,_){this[A].push(_)},Y.prototype.removeEventListener=function(A,_){var J=this[A].indexOf(_);J>-1&&this[A].splice(J,1)},Y}(),ke=function(){function Y(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new b,this._isOpen=!1,this.undoRedoManager=new je,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Qe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new V(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[w,O,Z,R,We,be,pe,Ce,Oe,ee,v,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[w,O,Z,R,be,pe,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[w,O,Z,R,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var _=this;this._availableMarkerTypes.splice(0),A.forEach(function(J){if(typeof J=="string"){var ae=_.ALL_MARKER_TYPES.find(function($){return $.typeName===J});ae!==void 0&&_._availableMarkerTypes.push(ae)}else _._availableMarkerTypes.push(J)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(A){this._zoomLevel=A,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&X.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=X.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new Ge(A))})},Y.prototype.render=function(){return z(this,void 0,void 0,function(){var A;return oe(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(A=new q).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},Y.prototype.close=function(A){var _=this;if(A===void 0&&(A=!1),this.isOpen){var J=!1;A||this.eventListeners.beforeclose.forEach(function(ae){var $=new Ge(_,!0);ae($),$.defaultPrevented&&(J=!0)}),J||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ae){return ae(new Ge(_))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var A,_=[],J=0;Jthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,J=_',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Y.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new G(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(A),1),A.dispose()},Y.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Y.prototype.toolbarButtonClicked=function(A,_){if(A==="marker"&&_!==void 0)this.createNewMarker(_);else if(A==="action")switch(_){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var A=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ae){var $=new Xe(A,A._currentMarker,!0);ae($),$.defaultPrevented&&(_=!0)}),!_){var J=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ae){return ae(new Xe(A,J))})}}},Y.prototype.clear=function(){var A=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Se){var Fe=new Xe(A,void 0,!0);Se(Fe),Fe.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var J=function(Se){var Fe=ae.markers[Se];ae.setCurrentMarker(ae.markers[Se]),ae._currentMarker.dispose(),ae.markerImage.removeChild(ae._currentMarker.container),ae.markers.splice(ae.markers.indexOf(ae._currentMarker),1),ae.eventListeners.markerdelete.forEach(function($e){return $e(new Xe(A,Fe))})},ae=this,$=this.markers.length-1;$>=0;$--)J($);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var A;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",this.overlayContainer.appendChild(this.notesArea))},Y.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),J=this.undoRedoManager.getLastUndoStep();if(!J||J.width===_.width&&J.height===_.height){var ae=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),ae1&&this.panTo({x:A.clientX,y:A.clientY}))},Y.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(A,_){var J=this.markerImage.getBoundingClientRect();return{x:(A-J.left)/this.zoomLevel,y:(_-J.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Y.prototype.addLicenseKey=function(A){se.addKey(A)},Y.prototype.addEventListener=function(A,_){this.eventListeners.addEventListener(A,_)},Y.prototype.removeEventListener=function(A,_){this.eventListeners.removeEventListener(A,_)},Y.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new Ge(A))}))},Y.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new Ge(A))}))},Y.instanceCounter=0,Y}()},Vg4E:function(Pr,dr,He){},Y1PL:function(Pr,dr,He){"use strict";He.r(dr),He.d(dr,"ResizableTextArea",function(){return We});var ze=He("wx14"),re=He("1OyB"),z=He("vuIU"),oe=He("Ji7U"),K=He("LK+K"),B=He("q1tI"),se=He("VTBJ"),q=He("rePB"),X=He("Zm9Q"),V=He("Kwbf"),L=He("c+Xe"),U=He("m+aA"),G=He("bdgK"),I=new Map;function P(Ge){Ge.forEach(function(Ze){var Xe,Qe=Ze.target;(Xe=I.get(Qe))===null||Xe===void 0||Xe.forEach(function(ke){return ke(Qe)})})}var M=new G.default(P),C=null,d=null;function f(Ge,Ze){I.has(Ge)||(I.set(Ge,new Set),M.observe(Ge)),I.get(Ge).add(Ze)}function p(Ge,Ze){I.has(Ge)&&(I.get(Ge).delete(Ze),I.get(Ge).size||(M.unobserve(Ge),I.delete(Ge)))}var T=function(Ge){Object(oe.a)(Xe,Ge);var Ze=Object(K.a)(Xe);function Xe(){return Object(re.a)(this,Xe),Ze.apply(this,arguments)}return Object(z.a)(Xe,[{key:"render",value:function(){return this.props.children}}]),Xe}(B.Component),x=B.createContext(null);function E(Ge){var Ze=Ge.children,Xe=Ge.onBatchResize,Qe=B.useRef(0),ke=B.useRef([]),Y=B.useContext(x),A=B.useCallback(function(_,J,ae){Qe.current+=1;var $=Qe.current;ke.current.push({size:_,element:J,data:ae}),Promise.resolve().then(function(){$===Qe.current&&(Xe==null||Xe(ke.current),ke.current=[])}),Y==null||Y(_,J,ae)},[Xe,Y]);return B.createElement(x.Provider,{value:A},Ze)}function k(Ge){var Ze=Ge.children,Xe=Ge.disabled,Qe=B.useRef(null),ke=B.useRef(null),Y=B.useContext(x),A=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_=B.isValidElement(Ze)&&Object(L.c)(Ze),J=_?Ze.ref:null,ae=B.useMemo(function(){return Object(L.a)(J,Qe)},[J,Qe]),$=B.useRef(Ge);$.current=Ge;var Se=B.useCallback(function(Fe){var $e=$.current,at=$e.onResize,Ke=$e.data,nt=Fe.getBoundingClientRect(),tt=nt.width,bt=nt.height,_t=Fe.offsetWidth,Lt=Fe.offsetHeight,Ot=Math.floor(tt),xt=Math.floor(bt);if(A.current.width!==Ot||A.current.height!==xt||A.current.offsetWidth!==_t||A.current.offsetHeight!==Lt){var jt={width:Ot,height:xt,offsetWidth:_t,offsetHeight:Lt};A.current=jt;var Nt=_t===Math.round(tt)?tt:_t,mt=Lt===Math.round(bt)?bt:Lt,Ht=Object(se.a)(Object(se.a)({},jt),{},{offsetWidth:Nt,offsetHeight:mt});Y==null||Y(Ht,Fe,Ke),at&&Promise.resolve().then(function(){at(Ht,Fe)})}},[]);return B.useEffect(function(){var Fe=Object(U.a)(Qe.current)||Object(U.a)(ke.current);return Fe&&!Xe&&f(Fe,Se),function(){return p(Fe,Se)}},[Qe.current,Xe]),B.createElement(T,{ref:ke},_?B.cloneElement(Ze,{ref:ae}):Ze)}var w="rc-observer-key";function b(Ge){var Ze=Ge.children,Xe=Object(X.a)(Ze);return Xe.map(function(Qe,ke){var Y=(Qe==null?void 0:Qe.key)||"".concat(w,"-").concat(ke);return B.createElement(k,Object(ze.a)({},Ge,{key:Y}),Qe)})}b.Collection=E;var m=b,v=He("bT9E"),g=He("TSYQ"),R=He.n(g),O=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -298,7 +298,7 @@ PERFORMANCE OF THIS SOFTWARE. z-index:-1000 !important; top:0 !important; right:0 !important -`,G=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],Z={},ee;function fe(Ge){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=Ge.getAttribute("id")||Ge.getAttribute("data-reactid")||Ge.getAttribute("name");if(Je&&Z[Xe])return Z[Xe];var Ye=window.getComputedStyle(Ge),ke=Ye.getPropertyValue("box-sizing")||Ye.getPropertyValue("-moz-box-sizing")||Ye.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(Ye.getPropertyValue("padding-bottom"))+parseFloat(Ye.getPropertyValue("padding-top")),A=parseFloat(Ye.getPropertyValue("border-bottom-width"))+parseFloat(Ye.getPropertyValue("border-top-width")),_=G.map(function(ae){return"".concat(ae,":").concat(Ye.getPropertyValue(ae))}).join(";"),J={sizingStyle:_,paddingSize:Y,borderSize:A,boxSizing:ke};return Je&&Xe&&(Z[Xe]=J),J}function pe(Ge){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ee||(ee=document.createElement("textarea"),ee.setAttribute("tab-index","-1"),ee.setAttribute("aria-hidden","true"),document.body.appendChild(ee)),Ge.getAttribute("wrap")?ee.setAttribute("wrap",Ge.getAttribute("wrap")):ee.removeAttribute("wrap");var ke=fe(Ge,Je),Y=ke.paddingSize,A=ke.borderSize,_=ke.boxSizing,J=ke.sizingStyle;ee.setAttribute("style","".concat(J,";").concat(O)),ee.value=Ge.value||Ge.placeholder||"";var ae=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER,Se=ee.scrollHeight,Fe;if(_==="border-box"?Se+=A:_==="content-box"&&(Se-=Y),Xe!==null||Ye!==null){ee.value=" ";var $e=ee.scrollHeight-Y;Xe!==null&&(ae=$e*Xe,_==="border-box"&&(ae=ae+Y+A),Se=Math.max(ae,Se)),Ye!==null&&($=$e*Ye,_==="border-box"&&($=$+Y+A),Fe=Se>$?"":"hidden",Se=Math.min($,Se))}return{height:Se,minHeight:ae,maxHeight:$,overflowY:Fe,resize:"none"}}var xe=He("Gytx"),Ce=He.n(xe),be;(function(Ge){Ge[Ge.NONE=0]="NONE",Ge[Ge.RESIZING=1]="RESIZING",Ge[Ge.RESIZED=2]="RESIZED"})(be||(be={}));var Oe=function(Ge){Object(oe.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(Ye){var ke;return Object(re.a)(this,Xe),ke=Je.call(this,Ye),ke.nextFrameActionId=void 0,ke.resizeFrameId=void 0,ke.textArea=void 0,ke.saveTextArea=function(Y){ke.textArea=Y},ke.handleResize=function(Y){var A=ke.state.resizeStatus,_=ke.props,J=_.autoSize,ae=_.onResize;if(A!==be.NONE)return;typeof ae=="function"&&ae(Y),J&&ke.resizeOnNextFrame()},ke.resizeOnNextFrame=function(){cancelAnimationFrame(ke.nextFrameActionId),ke.nextFrameActionId=requestAnimationFrame(ke.resizeTextarea)},ke.resizeTextarea=function(){var Y=ke.props.autoSize;if(!Y||!ke.textArea)return;var A=Y.minRows,_=Y.maxRows,J=pe(ke.textArea,!1,A,_);ke.setState({textareaStyles:J,resizeStatus:be.RESIZING},function(){cancelAnimationFrame(ke.resizeFrameId),ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.RESIZED},function(){ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.NONE}),ke.fixFirefoxAutoScroll()})})})})},ke.renderTextArea=function(){var Y=ke.props,A=Y.prefixCls,_=A===void 0?"rc-textarea":A,J=Y.autoSize,ae=Y.onResize,$=Y.className,Se=Y.disabled,Fe=ke.state,$e=Fe.textareaStyles,at=Fe.resizeStatus,Ke=Object(v.a)(ke.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),nt=R()(_,$,Object(q.a)({},"".concat(_,"-disabled"),Se));"value"in Ke&&(Ke.value=Ke.value||"");var tt=Object(se.a)(Object(se.a)(Object(se.a)({},ke.props.style),$e),at===be.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(m,{onResize:ke.handleResize,disabled:!(J||ae)},B.createElement("textarea",Object(ze.a)({},Ke,{className:nt,style:tt,ref:ke.saveTextArea})))},ke.state={textareaStyles:{},resizeStatus:be.NONE},ke}return Object(H.a)(Xe,[{key:"componentDidUpdate",value:function(ke){(ke.value!==this.props.value||!Ce()(ke.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ke=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(ke,Y)}}catch(A){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Xe}(B.Component),We=Oe,Ue=function(Ge){Object(oe.a)(Xe,Ge);var Je=Object(K.a)(Xe);function Xe(Ye){var ke;Object(re.a)(this,Xe),ke=Je.call(this,Ye),ke.resizableTextArea=void 0,ke.focus=function(){ke.resizableTextArea.textArea.focus()},ke.saveTextArea=function(A){ke.resizableTextArea=A},ke.handleChange=function(A){var _=ke.props.onChange;ke.setValue(A.target.value,function(){ke.resizableTextArea.resizeTextarea()}),_&&_(A)},ke.handleKeyDown=function(A){var _=ke.props,J=_.onPressEnter,ae=_.onKeyDown;A.keyCode===13&&J&&J(A),ae&&ae(A)};var Y=typeof Ye.value=="undefined"||Ye.value===null?Ye.defaultValue:Ye.value;return ke.state={value:Y},ke}return Object(H.a)(Xe,[{key:"setValue",value:function(ke,Y){"value"in this.props||this.setState({value:ke},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(We,Object(ze.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ke){return"value"in ke?{value:ke.value}:null}}]),Xe}(B.Component),ct=dr.default=Ue},bT9E:function(Pr,dr,He){"use strict";He.d(dr,"a",function(){return re});var ze=He("VTBJ");function re(H,oe){var K=Object(ze.a)({},H);return Array.isArray(oe)&&oe.forEach(function(B){delete K[B]}),K}},"o/Ze":function(Pr,dr,He){Pr.exports={flex_box_center:"flex_box_center___33Y_2",flex_space_between:"flex_space_between___2l153",flex_box_vertical_center:"flex_box_vertical_center___23Tf8",flex_box_center_end:"flex_box_center_end___3eAIy",flex_box_column:"flex_box_column___2YVAm",form:"form___2JK57",btn:"btn___3UI5y",img:"img___mvEHH"}},p5ED:function(Pr,dr,He){"use strict";var ze=He("+L6B"),re=He("2/Rp"),H=He("5Dmo"),oe=He("3S7+"),K=He("k1fw"),B=He("9og8"),se=He("tJVT"),q=He("WmNS"),X=He.n(q),V=He("q1tI"),L=He.n(V),U=He("vHTk"),W=He.n(U),M=He("yEEn"),P=He("ZW9T"),I=He("1vsH"),C=He("V0Rq"),d=He("m3rI");dr.a=function(f){var p,T,x,E,k,w,b,m=f.editOffice,v=m===void 0?"view":m,g=f.data,R=f.theme,O=f.type,G=f.filename,Z=f.monacoEditor,ee=f.className,fe=f.style,pe=f.close,xe=f.onClose,Ce=f.hasMask,be=f.disabledDownload,Oe=Object(V.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),We=Object(se.a)(Oe,2),Ue=We[0],ct=We[1],Ge=Object(V.useState)(""),Je=Object(se.a)(Ge,2),Xe=Je[0],Ye=Je[1],ke=Object(V.useState)(),Y=Object(se.a)(ke,2),A=Y[0],_=Y[1],J=window.ENV==="build"?"/react/build":"",ae=d.a.PROXY_SERVER||location.origin,$,Se=1024*1024,Fe=10*Se,$e=Object(V.useRef)();(p=g)!==null&&p!==void 0&&p.startsWith("/api")&&O!=="txt"&&(g=(d.a.API_SERVER||location.origin)+g),O==="office"&&($=Object(I.T)(g).filesize,$>Fe&&(O="other")),G&&Z&&(Z.filename=G),Object(V.useEffect)(function(){var tt,bt,_t=(tt=document.cookie)===null||tt===void 0||((bt=tt.replace(/\s/g,""))===null||bt===void 0)?void 0:bt.split(";");_t==null||_t.map(function(Lt){var Ot=Lt.split("=");Ot[0]==="_educoder_session"&&Ye(Ot[1])})},[]),Object(V.useEffect)(function(){O==="office"&&at()},[O,g]);var at=function(){var tt=Object(B.a)(X.a.mark(function bt(){var _t,Lt,Ot;return X.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return console.log("data:",g),_t=g,g.startsWith("http")||(_t=location.origin+_t),Lt=new URL(_t).pathname.split("/").pop(),jt.next=6,Object(C.V)({attachment_id:Lt});case 6:Ot=jt.sent,_(Ot);case 8:case"end":return jt.stop()}},bt)}));return function(){return tt.apply(this,arguments)}}(),Ke=function(){if(g.startsWith("http")||g.startsWith("blob:")){nt();return}Object(I.z)(G||"educoder",g,G)},nt=function(){Object(I.x)(G||"educoder",decodeURIComponent(g))};return L.a.createElement("div",{style:Object(K.a)({},fe||{}),className:"".concat(Ce&&W.a.bgBlack," ").concat(O?W.a.wrp:"hide")},pe&&L.a.createElement("div",{className:W.a.close,ref:$e},!be&&L.a.createElement(oe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{onClick:nt},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(oe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{className:"",onClick:xe},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(W.a[ee]," ").concat(ee," ").concat(W.a.monaco," ").concat(O==="txt"?"show":"hide")},O==="txt"&&L.a.createElement(P.b,Z)),O==="audio"&&L.a.createElement("audio",{src:"".concat(((T=g)===null||T===void 0?void 0:T.indexOf("http://"))>-1||((x=g)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),O==="video"&&L.a.createElement(L.a.Fragment,null,((E=g)===null||E===void 0?void 0:E.indexOf("http"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(g),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})),O==="office"&&A&&L.a.createElement("iframe",{src:"".concat(J,"/office.html?key=").concat(A.key,"&url=").concat(ae+A.url,"&callbackUrl=").concat(ae+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(v,"&officeServer=").concat(d.a.OFFICE_SERVER,"&disabledDownload=").concat(!!be)}),O==="html"&&L.a.createElement("iframe",{src:g+"&disposition=inline"}),O==="pdf"&&L.a.createElement("iframe",{src:"".concat(J,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!be)}),O==="image"&&L.a.createElement("img",{src:"".concat(((k=g)===null||k===void 0?void 0:k.indexOf("http://"))>-1||((w=g)===null||w===void 0?void 0:w.indexOf("https://"))>-1||(b=g)!==null&&b!==void 0&&b.startsWith("/api")?"":"data:image/png;base64,").concat(g)}),O==="other"&&L.a.createElement("div",null,L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(M.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),O==="download"&&L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(M.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},phzI:function(Pr,dr,He){"use strict";var ze=He("k1fw"),re=He("9og8"),H=He("tJVT"),oe=He("WmNS"),K=He.n(oe),B=He("q1tI"),se=He.n(B),q=He("yyNy");/*! ***************************************************************************** +`,H=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],Z={},ee;function fe(Ge){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=Ge.getAttribute("id")||Ge.getAttribute("data-reactid")||Ge.getAttribute("name");if(Ze&&Z[Xe])return Z[Xe];var Qe=window.getComputedStyle(Ge),ke=Qe.getPropertyValue("box-sizing")||Qe.getPropertyValue("-moz-box-sizing")||Qe.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(Qe.getPropertyValue("padding-bottom"))+parseFloat(Qe.getPropertyValue("padding-top")),A=parseFloat(Qe.getPropertyValue("border-bottom-width"))+parseFloat(Qe.getPropertyValue("border-top-width")),_=H.map(function(ae){return"".concat(ae,":").concat(Qe.getPropertyValue(ae))}).join(";"),J={sizingStyle:_,paddingSize:Y,borderSize:A,boxSizing:ke};return Ze&&Xe&&(Z[Xe]=J),J}function pe(Ge){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Qe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ee||(ee=document.createElement("textarea"),ee.setAttribute("tab-index","-1"),ee.setAttribute("aria-hidden","true"),document.body.appendChild(ee)),Ge.getAttribute("wrap")?ee.setAttribute("wrap",Ge.getAttribute("wrap")):ee.removeAttribute("wrap");var ke=fe(Ge,Ze),Y=ke.paddingSize,A=ke.borderSize,_=ke.boxSizing,J=ke.sizingStyle;ee.setAttribute("style","".concat(J,";").concat(O)),ee.value=Ge.value||Ge.placeholder||"";var ae=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER,Se=ee.scrollHeight,Fe;if(_==="border-box"?Se+=A:_==="content-box"&&(Se-=Y),Xe!==null||Qe!==null){ee.value=" ";var $e=ee.scrollHeight-Y;Xe!==null&&(ae=$e*Xe,_==="border-box"&&(ae=ae+Y+A),Se=Math.max(ae,Se)),Qe!==null&&($=$e*Qe,_==="border-box"&&($=$+Y+A),Fe=Se>$?"":"hidden",Se=Math.min($,Se))}return{height:Se,minHeight:ae,maxHeight:$,overflowY:Fe,resize:"none"}}var xe=He("Gytx"),Ce=He.n(xe),be;(function(Ge){Ge[Ge.NONE=0]="NONE",Ge[Ge.RESIZING=1]="RESIZING",Ge[Ge.RESIZED=2]="RESIZED"})(be||(be={}));var Oe=function(Ge){Object(oe.a)(Xe,Ge);var Ze=Object(K.a)(Xe);function Xe(Qe){var ke;return Object(re.a)(this,Xe),ke=Ze.call(this,Qe),ke.nextFrameActionId=void 0,ke.resizeFrameId=void 0,ke.textArea=void 0,ke.saveTextArea=function(Y){ke.textArea=Y},ke.handleResize=function(Y){var A=ke.state.resizeStatus,_=ke.props,J=_.autoSize,ae=_.onResize;if(A!==be.NONE)return;typeof ae=="function"&&ae(Y),J&&ke.resizeOnNextFrame()},ke.resizeOnNextFrame=function(){cancelAnimationFrame(ke.nextFrameActionId),ke.nextFrameActionId=requestAnimationFrame(ke.resizeTextarea)},ke.resizeTextarea=function(){var Y=ke.props.autoSize;if(!Y||!ke.textArea)return;var A=Y.minRows,_=Y.maxRows,J=pe(ke.textArea,!1,A,_);ke.setState({textareaStyles:J,resizeStatus:be.RESIZING},function(){cancelAnimationFrame(ke.resizeFrameId),ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.RESIZED},function(){ke.resizeFrameId=requestAnimationFrame(function(){ke.setState({resizeStatus:be.NONE}),ke.fixFirefoxAutoScroll()})})})})},ke.renderTextArea=function(){var Y=ke.props,A=Y.prefixCls,_=A===void 0?"rc-textarea":A,J=Y.autoSize,ae=Y.onResize,$=Y.className,Se=Y.disabled,Fe=ke.state,$e=Fe.textareaStyles,at=Fe.resizeStatus,Ke=Object(v.a)(ke.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),nt=R()(_,$,Object(q.a)({},"".concat(_,"-disabled"),Se));"value"in Ke&&(Ke.value=Ke.value||"");var tt=Object(se.a)(Object(se.a)(Object(se.a)({},ke.props.style),$e),at===be.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(m,{onResize:ke.handleResize,disabled:!(J||ae)},B.createElement("textarea",Object(ze.a)({},Ke,{className:nt,style:tt,ref:ke.saveTextArea})))},ke.state={textareaStyles:{},resizeStatus:be.NONE},ke}return Object(z.a)(Xe,[{key:"componentDidUpdate",value:function(ke){(ke.value!==this.props.value||!Ce()(ke.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ke=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(ke,Y)}}catch(A){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Xe}(B.Component),We=Oe,je=function(Ge){Object(oe.a)(Xe,Ge);var Ze=Object(K.a)(Xe);function Xe(Qe){var ke;Object(re.a)(this,Xe),ke=Ze.call(this,Qe),ke.resizableTextArea=void 0,ke.focus=function(){ke.resizableTextArea.textArea.focus()},ke.saveTextArea=function(A){ke.resizableTextArea=A},ke.handleChange=function(A){var _=ke.props.onChange;ke.setValue(A.target.value,function(){ke.resizableTextArea.resizeTextarea()}),_&&_(A)},ke.handleKeyDown=function(A){var _=ke.props,J=_.onPressEnter,ae=_.onKeyDown;A.keyCode===13&&J&&J(A),ae&&ae(A)};var Y=typeof Qe.value=="undefined"||Qe.value===null?Qe.defaultValue:Qe.value;return ke.state={value:Y},ke}return Object(z.a)(Xe,[{key:"setValue",value:function(ke,Y){"value"in this.props||this.setState({value:ke},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(We,Object(ze.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ke){return"value"in ke?{value:ke.value}:null}}]),Xe}(B.Component),ct=dr.default=je},bT9E:function(Pr,dr,He){"use strict";He.d(dr,"a",function(){return re});var ze=He("VTBJ");function re(z,oe){var K=Object(ze.a)({},z);return Array.isArray(oe)&&oe.forEach(function(B){delete K[B]}),K}},"o/Ze":function(Pr,dr,He){Pr.exports={flex_box_center:"flex_box_center___33Y_2",flex_space_between:"flex_space_between___2l153",flex_box_vertical_center:"flex_box_vertical_center___23Tf8",flex_box_center_end:"flex_box_center_end___3eAIy",flex_box_column:"flex_box_column___2YVAm",form:"form___2JK57",btn:"btn___3UI5y",img:"img___mvEHH"}},p5ED:function(Pr,dr,He){"use strict";var ze=He("+L6B"),re=He("2/Rp"),z=He("5Dmo"),oe=He("3S7+"),K=He("k1fw"),B=He("9og8"),se=He("tJVT"),q=He("WmNS"),X=He.n(q),V=He("q1tI"),L=He.n(V),U=He("vHTk"),G=He.n(U),I=He("yEEn"),P=He("ZW9T"),M=He("1vsH"),C=He("V0Rq"),d=He("m3rI");dr.a=function(f){var p,T,x,E,k,w,b,m=f.editOffice,v=m===void 0?"view":m,g=f.data,R=f.theme,O=f.type,H=f.filename,Z=f.monacoEditor,ee=f.className,fe=f.style,pe=f.close,xe=f.onClose,Ce=f.hasMask,be=f.disabledDownload,Oe=Object(V.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),We=Object(se.a)(Oe,2),je=We[0],ct=We[1],Ge=Object(V.useState)(""),Ze=Object(se.a)(Ge,2),Xe=Ze[0],Qe=Ze[1],ke=Object(V.useState)(),Y=Object(se.a)(ke,2),A=Y[0],_=Y[1],J=window.ENV==="build"?"/react/build":"",ae=d.a.PROXY_SERVER||location.origin,$,Se=1024*1024,Fe=10*Se,$e=Object(V.useRef)();(p=g)!==null&&p!==void 0&&p.startsWith("/api")&&O!=="txt"&&(g=(d.a.API_SERVER||location.origin)+g),O==="office"&&($=Object(M.T)(g).filesize,$>Fe&&(O="other")),H&&Z&&(Z.filename=H),Object(V.useEffect)(function(){var tt,bt,_t=(tt=document.cookie)===null||tt===void 0||((bt=tt.replace(/\s/g,""))===null||bt===void 0)?void 0:bt.split(";");_t==null||_t.map(function(Lt){var Ot=Lt.split("=");Ot[0]==="_educoder_session"&&Qe(Ot[1])})},[]),Object(V.useEffect)(function(){O==="office"&&at()},[O,g]);var at=function(){var tt=Object(B.a)(X.a.mark(function bt(){var _t,Lt,Ot;return X.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return console.log("data:",g),_t=g,g.startsWith("http")||(_t=location.origin+_t),Lt=new URL(_t).pathname.split("/").pop(),jt.next=6,Object(C.V)({attachment_id:Lt});case 6:Ot=jt.sent,_(Ot);case 8:case"end":return jt.stop()}},bt)}));return function(){return tt.apply(this,arguments)}}(),Ke=function(){if(g.startsWith("http")||g.startsWith("blob:")){nt();return}Object(M.z)(H||"educoder",g,H)},nt=function(){Object(M.x)(H||"educoder",decodeURIComponent(g))};return L.a.createElement("div",{style:Object(K.a)({},fe||{}),className:"".concat(Ce&&G.a.bgBlack," ").concat(O?G.a.wrp:"hide")},pe&&L.a.createElement("div",{className:G.a.close,ref:$e},!be&&L.a.createElement(oe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{onClick:nt},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(oe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},L.a.createElement("span",{className:"",onClick:xe},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(G.a[ee]," ").concat(ee," ").concat(G.a.monaco," ").concat(O==="txt"?"show":"hide")},O==="txt"&&L.a.createElement(P.b,Z)),O==="audio"&&L.a.createElement("audio",{src:"".concat(((T=g)===null||T===void 0?void 0:T.indexOf("http://"))>-1||((x=g)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),O==="video"&&L.a.createElement(L.a.Fragment,null,((E=g)===null||E===void 0?void 0:E.indexOf("http"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(g),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})),O==="office"&&A&&L.a.createElement("iframe",{src:"".concat(J,"/office.html?key=").concat(A.key,"&url=").concat(ae+A.url,"&callbackUrl=").concat(ae+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(v,"&officeServer=").concat(d.a.OFFICE_SERVER,"&disabledDownload=").concat(!!be)}),O==="html"&&L.a.createElement("iframe",{src:g+"&disposition=inline"}),O==="pdf"&&L.a.createElement("iframe",{src:"".concat(J,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!be)}),O==="image"&&L.a.createElement("img",{src:"".concat(((k=g)===null||k===void 0?void 0:k.indexOf("http://"))>-1||((w=g)===null||w===void 0?void 0:w.indexOf("https://"))>-1||(b=g)!==null&&b!==void 0&&b.startsWith("/api")?"":"data:image/png;base64,").concat(g)}),O==="other"&&L.a.createElement("div",null,L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(I.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),O==="download"&&L.a.createElement(re.a,{type:"primary",size:"large",onClick:Ke},L.a.createElement(I.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},phzI:function(Pr,dr,He){"use strict";var ze=He("k1fw"),re=He("9og8"),z=He("tJVT"),oe=He("WmNS"),K=He.n(oe),B=He("q1tI"),se=He.n(B),q=He("yyNy");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -311,43 +311,43 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var X=function(){return X=Object.assign||function(d){for(var f,p=1,T=arguments.length;p0)&&!(T=E.next()).done;)k.push(T.value)}catch(w){x={error:w}}finally{try{T&&!T.done&&(p=E.return)&&p.call(E)}finally{if(x)throw x.error}}return k}function L(d){var f=d.defaultContent,p=f===void 0?[]:f,T=d.onCreated,x=d.defaultHtml,E=x===void 0?"":x,k=d.value,w=k===void 0?"":k,b=d.onChange,m=d.defaultConfig,v=m===void 0?{}:m,g=d.mode,R=g===void 0?"default":g,O=d.style,G=O===void 0?{}:O,Z=d.className,ee=Object(B.useRef)(null),fe=V(Object(B.useState)(null),2),pe=fe[0],xe=fe[1],Ce=V(Object(B.useState)(""),2),be=Ce[0],Oe=Ce[1],We=function(Ge){T&&T(Ge);var Je=v.onCreated;Je&&Je(Ge)},Ue=function(Ge){Oe(Ge.getHtml()),b&&b(Ge);var Je=v.onChange;Je&&Je(Ge)},ct=function(Ge){var Je=v.onDestroyed;xe(null),Je&&Je(Ge)};return Object(B.useEffect)(function(){if(pe!=null&&w!==be)try{pe.setHtml(w)}catch(Ge){console.error(Ge)}},[w]),Object(B.useEffect)(function(){var Ge;if(ee.current!=null&&pe==null&&!((Ge=ee.current)===null||Ge===void 0?void 0:Ge.getAttribute("data-w-e-textarea"))){var Je=Object(q.a)({selector:ee.current,config:X(X({},v),{onCreated:We,onChange:Ue,onDestroyed:ct}),content:p,html:E||w,mode:R});xe(Je)}},[pe]),se.a.createElement("div",{style:G,ref:ee,className:Z})}function U(d){var f=d.editor,p=d.defaultConfig,T=p===void 0?{}:p,x=d.mode,E=x===void 0?"default":x,k=d.style,w=k===void 0?{}:k,b=d.className,m=Object(B.useRef)(null);return Object(B.useEffect)(function(){m.current!=null&&f!=null&&q.b({editor:f,selector:m.current,config:T,mode:E})},[f]),se.a.createElement("div",{style:w,ref:m,className:b})}var W=He("ErOA"),M=He("9kvl"),P=He("Vg4E"),I=function(f){var p=f.defaultvalue,T=f.onChange,x=f.style,E=f.user,k=f.placeholder,w=1024*1024*2,b=Object(B.useRef)(null),m=4,v=Object(B.useState)(null),g=Object(H.a)(v,2),R=g[0],O=g[1],G=Object(B.useState)(""),Z=Object(H.a)(G,2),ee=Z[0],fe=Z[1];Object(B.useEffect)(function(){fe(p)},[p]),Object(B.useEffect)(function(){T(ee)},[ee]);var pe={},xe={placeholder:k||"\u8BF7\u8F93\u5165\u5185\u5BB9...",MENU_CONF:{}};return xe.MENU_CONF.uploadImage={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var Ue,ct;return K.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Ue=new FormData,Ue.append("file",be),Je.next=4,Object(W.a)("/api/attachments.json",{method:"post",body:Ue},!0);case 4:ct=Je.sent,Oe(ct==null?void 0:ct.url,"","");case 6:case"end":return Je.stop()}},We)}))()}},xe.MENU_CONF.uploadVideo={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var Ue,ct,Ge,Je,Xe,Ye,ke,Y,A,_,J,ae,$,Se,Fe,$e;return K.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Ue=be.size,ct=Math.ceil(Ue/w),Ke.prev=2,Ke.next=5,Object(W.a)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:be.name,chunkCount:ct,user_id:E==null||((Ge=E.userInfo)===null||Ge===void 0)?void 0:Ge.user_id}});case 5:if(Xe=Ke.sent,!((Xe==null?void 0:Xe.status)!==0)){Ke.next=8;break}throw new Error;case 8:for(Ye=Xe.upload_id,b.current=new AbortController,ke=[],Y=0,A=function(tt){var bt=tt*w,_t=Math.min(bt+w,Ue),Lt=be.slice(bt,_t),Ot=new FormData;Ot.append("chunk",Lt),Ot.append("fileName",be.name),Ot.append("chunkIndex",(tt+1).toString()),Ot.append("uploadId",Ye),ke.push(function(){return Object(W.a)("/api/attachments/multipart_upload",{method:"POST",body:Ot,signal:b.current.signal},!0).then(function(xt){})})},_=0;_0)){Ke.next=24;break}return Ke.next=22,Promise.all(Se);case 22:Fe=Ke.sent,J+=ae;case 24:Ke.next=17;break;case 26:return Ke.next=28,Object(W.a)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:be.name,chunkCount:ct,uploadId:Ye,user_id:E==null||((Je=E.userInfo)===null||Je===void 0)?void 0:Je.user_id}});case 28:$e=Ke.sent,Oe($e==null?void 0:$e.object,""),Ke.next=34;break;case 32:Ke.prev=32,Ke.t0=Ke.catch(2);case 34:case"end":return Ke.stop()}},We,null,[[2,32]])}))()}},Object(B.useEffect)(function(){return function(){if(R==null)return;R.destroy(),O(null),T(null)}},[R]),se.a.createElement(se.a.Fragment,null,se.a.createElement("div",{style:{border:"1px solid #ccc",zIndex:100}},se.a.createElement(U,{editor:R,defaultConfig:pe,mode:"default",style:{borderBottom:"1px solid #ccc"}}),se.a.createElement(L,{defaultConfig:xe,value:ee,onCreated:O,onChange:function(be){return fe(be.getHtml())},mode:"default",style:Object(ze.a)({height:"500px",overflowY:"hidden"},x)})))},C=dr.a=Object(M.a)(function(d){var f=d.user;return{user:f}})(I)},rUJ1:function(Pr,dr){const He=/[&<>"']/,ze=/[&<>"']/g,re=/[<>"']|&(?!#?\w+;)/,H=/[<>"']|&(?!#?\w+;)/g,oe={"&":"&","<":"<",">":">",'"':""","'":"'"},K=w=>oe[w];function B(w,b){if(b){if(He.test(w))return w.replace(ze,K)}else if(re.test(w))return w.replace(H,K);return w}const se=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function q(w){return w.replace(se,(b,m)=>(m=m.toLowerCase(),m==="colon"?":":m.charAt(0)==="#"?m.charAt(1)==="x"?String.fromCharCode(parseInt(m.substring(2),16)):String.fromCharCode(+m.substring(1)):""))}const X=/(^|[^\[])\^/g;function V(w,b){w=w.source||w,b=b||"";const m={replace:(v,g)=>(g=g.source||g,g=g.replace(X,"$1"),w=w.replace(v,g),m),getRegex:()=>new RegExp(w,b)};return m}const L=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function W(w,b,m){if(w){let v;try{v=decodeURIComponent(q(m)).replace(L,"").toLowerCase()}catch(g){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}b&&!U.test(m)&&(m=d(b,m));try{m=encodeURI(m).replace(/%25/g,"%")}catch(v){return null}return m}const M={},P=/^[^:]+:\/*[^/]*$/,I=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(w,b){M[" "+w]||(P.test(w)?M[" "+w]=w+"/":M[" "+w]=x(w,"/",!0)),w=M[" "+w];const m=w.indexOf(":")===-1;return b.substring(0,2)==="//"?m?b:w.replace(I,"$1")+b:b.charAt(0)==="/"?m?b:w.replace(C,"$1")+b:w+b}const f={exec:function(){}};function p(w){let b=1,m,v;for(;b{let Z=!1,ee=O;for(;--ee>=0&&G[ee]==="\\";)Z=!Z;return Z?"|":" |"}),v=m.split(/ \|/);let g=0;if(v.length>b)v.splice(b);else for(;v.length0},!1)}function L(U,W){for(var M={main:[W]},P={main:[]},I={main:{}};V(M);)for(var C=Object.keys(M),d=0;d=2*k/b||G<=ee)return;var fe=Number.POSITIVE_INFINITY,pe;for(pe=C.level-1;pe>v;pe--){var xe=m[pe].maxBitrate;if(fe=k*xe/(8*.8*O),fe=G)return;var Ce=this.bwEstimator.getEstimate();V.logger.warn("Fragment "+C.sn+(d?" part "+d.index:"")+" of level "+C.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+pe+` +***************************************************************************** */var X=function(){return X=Object.assign||function(d){for(var f,p=1,T=arguments.length;p0)&&!(T=E.next()).done;)k.push(T.value)}catch(w){x={error:w}}finally{try{T&&!T.done&&(p=E.return)&&p.call(E)}finally{if(x)throw x.error}}return k}function L(d){var f=d.defaultContent,p=f===void 0?[]:f,T=d.onCreated,x=d.defaultHtml,E=x===void 0?"":x,k=d.value,w=k===void 0?"":k,b=d.onChange,m=d.defaultConfig,v=m===void 0?{}:m,g=d.mode,R=g===void 0?"default":g,O=d.style,H=O===void 0?{}:O,Z=d.className,ee=Object(B.useRef)(null),fe=V(Object(B.useState)(null),2),pe=fe[0],xe=fe[1],Ce=V(Object(B.useState)(""),2),be=Ce[0],Oe=Ce[1],We=function(Ge){T&&T(Ge);var Ze=v.onCreated;Ze&&Ze(Ge)},je=function(Ge){Oe(Ge.getHtml()),b&&b(Ge);var Ze=v.onChange;Ze&&Ze(Ge)},ct=function(Ge){var Ze=v.onDestroyed;xe(null),Ze&&Ze(Ge)};return Object(B.useEffect)(function(){if(pe!=null&&w!==be)try{pe.setHtml(w)}catch(Ge){console.error(Ge)}},[w]),Object(B.useEffect)(function(){var Ge;if(ee.current!=null&&pe==null&&!((Ge=ee.current)===null||Ge===void 0?void 0:Ge.getAttribute("data-w-e-textarea"))){var Ze=Object(q.a)({selector:ee.current,config:X(X({},v),{onCreated:We,onChange:je,onDestroyed:ct}),content:p,html:E||w,mode:R});xe(Ze)}},[pe]),se.a.createElement("div",{style:H,ref:ee,className:Z})}function U(d){var f=d.editor,p=d.defaultConfig,T=p===void 0?{}:p,x=d.mode,E=x===void 0?"default":x,k=d.style,w=k===void 0?{}:k,b=d.className,m=Object(B.useRef)(null);return Object(B.useEffect)(function(){m.current!=null&&f!=null&&q.b({editor:f,selector:m.current,config:T,mode:E})},[f]),se.a.createElement("div",{style:w,ref:m,className:b})}var G=He("ErOA"),I=He("9kvl"),P=He("Vg4E"),M=function(f){var p=f.defaultvalue,T=f.onChange,x=f.style,E=f.user,k=f.placeholder,w=1024*1024*2,b=Object(B.useRef)(null),m=4,v=Object(B.useState)(null),g=Object(z.a)(v,2),R=g[0],O=g[1],H=Object(B.useState)(""),Z=Object(z.a)(H,2),ee=Z[0],fe=Z[1];Object(B.useEffect)(function(){fe(p)},[p]),Object(B.useEffect)(function(){T(ee)},[ee]);var pe={},xe={placeholder:k||"\u8BF7\u8F93\u5165\u5185\u5BB9...",MENU_CONF:{}};return xe.MENU_CONF.uploadImage={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var je,ct;return K.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return je=new FormData,je.append("file",be),Ze.next=4,Object(G.a)("/api/attachments.json",{method:"post",body:je},!0);case 4:ct=Ze.sent,Oe(ct==null?void 0:ct.url,"","");case 6:case"end":return Ze.stop()}},We)}))()}},xe.MENU_CONF.uploadVideo={customUpload:function(be,Oe){return Object(re.a)(K.a.mark(function We(){var je,ct,Ge,Ze,Xe,Qe,ke,Y,A,_,J,ae,$,Se,Fe,$e;return K.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return je=be.size,ct=Math.ceil(je/w),Ke.prev=2,Ke.next=5,Object(G.a)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:be.name,chunkCount:ct,user_id:E==null||((Ge=E.userInfo)===null||Ge===void 0)?void 0:Ge.user_id}});case 5:if(Xe=Ke.sent,!((Xe==null?void 0:Xe.status)!==0)){Ke.next=8;break}throw new Error;case 8:for(Qe=Xe.upload_id,b.current=new AbortController,ke=[],Y=0,A=function(tt){var bt=tt*w,_t=Math.min(bt+w,je),Lt=be.slice(bt,_t),Ot=new FormData;Ot.append("chunk",Lt),Ot.append("fileName",be.name),Ot.append("chunkIndex",(tt+1).toString()),Ot.append("uploadId",Qe),ke.push(function(){return Object(G.a)("/api/attachments/multipart_upload",{method:"POST",body:Ot,signal:b.current.signal},!0).then(function(xt){})})},_=0;_0)){Ke.next=24;break}return Ke.next=22,Promise.all(Se);case 22:Fe=Ke.sent,J+=ae;case 24:Ke.next=17;break;case 26:return Ke.next=28,Object(G.a)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:be.name,chunkCount:ct,uploadId:Qe,user_id:E==null||((Ze=E.userInfo)===null||Ze===void 0)?void 0:Ze.user_id}});case 28:$e=Ke.sent,Oe($e==null?void 0:$e.object,""),Ke.next=34;break;case 32:Ke.prev=32,Ke.t0=Ke.catch(2);case 34:case"end":return Ke.stop()}},We,null,[[2,32]])}))()}},Object(B.useEffect)(function(){return function(){if(R==null)return;R.destroy(),O(null),T(null)}},[R]),se.a.createElement(se.a.Fragment,null,se.a.createElement("div",{style:{border:"1px solid #ccc",zIndex:100}},se.a.createElement(U,{editor:R,defaultConfig:pe,mode:"default",style:{borderBottom:"1px solid #ccc"}}),se.a.createElement(L,{defaultConfig:xe,value:ee,onCreated:O,onChange:function(be){return fe(be.getHtml())},mode:"default",style:Object(ze.a)({height:"500px",overflowY:"hidden"},x)})))},C=dr.a=Object(I.a)(function(d){var f=d.user;return{user:f}})(M)},rUJ1:function(Pr,dr){const He=/[&<>"']/,ze=/[&<>"']/g,re=/[<>"']|&(?!#?\w+;)/,z=/[<>"']|&(?!#?\w+;)/g,oe={"&":"&","<":"<",">":">",'"':""","'":"'"},K=w=>oe[w];function B(w,b){if(b){if(He.test(w))return w.replace(ze,K)}else if(re.test(w))return w.replace(z,K);return w}const se=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function q(w){return w.replace(se,(b,m)=>(m=m.toLowerCase(),m==="colon"?":":m.charAt(0)==="#"?m.charAt(1)==="x"?String.fromCharCode(parseInt(m.substring(2),16)):String.fromCharCode(+m.substring(1)):""))}const X=/(^|[^\[])\^/g;function V(w,b){w=w.source||w,b=b||"";const m={replace:(v,g)=>(g=g.source||g,g=g.replace(X,"$1"),w=w.replace(v,g),m),getRegex:()=>new RegExp(w,b)};return m}const L=/[^\w:]/g,U=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function G(w,b,m){if(w){let v;try{v=decodeURIComponent(q(m)).replace(L,"").toLowerCase()}catch(g){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}b&&!U.test(m)&&(m=d(b,m));try{m=encodeURI(m).replace(/%25/g,"%")}catch(v){return null}return m}const I={},P=/^[^:]+:\/*[^/]*$/,M=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(w,b){I[" "+w]||(P.test(w)?I[" "+w]=w+"/":I[" "+w]=x(w,"/",!0)),w=I[" "+w];const m=w.indexOf(":")===-1;return b.substring(0,2)==="//"?m?b:w.replace(M,"$1")+b:b.charAt(0)==="/"?m?b:w.replace(C,"$1")+b:w+b}const f={exec:function(){}};function p(w){let b=1,m,v;for(;b{let Z=!1,ee=O;for(;--ee>=0&&H[ee]==="\\";)Z=!Z;return Z?"|":" |"}),v=m.split(/ \|/);let g=0;if(v.length>b)v.splice(b);else for(;v.length0},!1)}function L(U,G){for(var I={main:[G]},P={main:[]},M={main:{}};V(I);)for(var C=Object.keys(I),d=0;d=2*k/b||H<=ee)return;var fe=Number.POSITIVE_INFINITY,pe;for(pe=C.level-1;pe>v;pe--){var xe=m[pe].maxBitrate;if(fe=k*xe/(8*.8*O),fe=H)return;var Ce=this.bwEstimator.getEstimate();V.logger.warn("Fragment "+C.sn+(d?" part "+d.index:"")+" of level "+C.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+pe+` Current BW estimate: `+(Object(oe.isFiniteNumber)(Ce)?(Ce/1024).toFixed(3):"Unknown")+` Kb/s - Estimated load time for current fragment: `+G.toFixed(3)+` s + Estimated load time for current fragment: `+H.toFixed(3)+` s Estimated load time for the next fragment: `+fe.toFixed(3)+` s - Time to underbuffer: `+ee.toFixed(3)+" s"),f.nextLoadLevel=pe,this.bwEstimator.sample(w,E.loaded),this.clearTimer(),C.loader&&(this.fragCurrent=this.partCurrent=null,C.loader.abort()),f.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:C,part:d,stats:E})},P.onFragLoaded=function(C,d){var f=d.frag,p=d.part;if(f.type===X.PlaylistLevelType.MAIN&&Object(oe.isFiniteNumber)(f.sn)){var T=p?p.stats:f.stats,x=p?p.duration:f.duration;if(this.clearTimer(),this.lastLoadedFragLevel=f.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var E=this.hls.levels[f.level],k=(E.loaded?E.loaded.bytes:0)+T.loaded,w=(E.loaded?E.loaded.duration:0)+x;E.loaded={bytes:k,duration:w},E.realBitrate=Math.round(8*k/w)}if(f.bitrateTest){var b={stats:T,frag:f,part:p,id:f.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,b),f.bitrateTest=!1}}},P.onFragBuffered=function(C,d){var f=d.frag,p=d.part,T=p?p.stats:f.stats;if(T.aborted)return;if(f.type!==X.PlaylistLevelType.MAIN||f.sn==="initSegment")return;var x=T.parsing.end-T.loading.start;this.bwEstimator.sample(x,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),f.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},P.onError=function(C,d){switch(d.details){case q.ErrorDetails.FRAG_LOAD_ERROR:case q.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},P.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},P.getNextABRAutoLevel=function(){var C=this.fragCurrent,d=this.partCurrent,f=this.hls,p=f.maxAutoLevel,T=f.config,x=f.minAutoLevel,E=f.media,k=d?d.duration:C?C.duration:0,w=E?E.currentTime:0,b=E&&E.playbackRate!==0?Math.abs(E.playbackRate):1,m=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,v=(se.BufferHelper.bufferInfo(E,w,T.maxBufferHole).end-w)/b,g=this.findBestLevel(m,x,p,v,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(g>=0)return g;V.logger.trace((v?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var R=k?Math.min(k,T.maxStarvationDelay):T.maxStarvationDelay,O=T.abrBandWidthFactor,G=T.abrBandWidthUpFactor;if(!v){var Z=this.bitrateTestDelay;if(Z){var ee=k?Math.min(k,T.maxLoadingDelay):T.maxLoadingDelay;R=ee-Z,V.logger.trace("bitrate test took "+Math.round(1e3*Z)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*R)+" ms"),O=G=1}}return g=this.findBestLevel(m,x,p,v+R,O,G),Math.max(g,0)},P.findBestLevel=function(C,d,f,p,T,x){for(var E,k=this.fragCurrent,w=this.partCurrent,b=this.lastLoadedFragLevel,m=this.hls.levels,v=m[b],g=!!(v!=null&&(E=v.details)!==null&&E!==void 0&&E.live),R=v==null?void 0:v.codecSet,O=w?w.duration:k?k.duration:0,G=f;G>=d;G--){var Z=m[G];if(!Z||R&&Z.codecSet!==R)continue;var ee=Z.details,fe=(w?ee==null?void 0:ee.partTarget:ee==null?void 0:ee.averagetargetduration)||O,pe=void 0;G<=b?pe=T*C:pe=x*C;var xe=m[G].maxBitrate,Ce=xe*fe/pe;if(V.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+G+"/"+Math.round(pe)+"/"+xe+"/"+fe+"/"+p+"/"+Ce),pe>xe&&(!Ce||g&&!this.bitrateTestDelay||Ce0&&v===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()},b.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var v,g=this.levels,R=this.trackId,O=g==null||((v=g[R])===null||v===void 0)?void 0:v.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var G,Z=performance.now(),ee=this.retryDate;(!ee||Z>=ee||(G=this.media)!==null&&G!==void 0&&G.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=K.State.IDLE);break}case K.State.WAITING_INIT_PTS:{var fe=this.waitingData;if(fe){var pe=fe.frag,xe=fe.part,Ce=fe.cache,be=fe.complete;if(this.initPTS[pe.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var Oe=Ce.flush(),We={frag:pe,part:xe,payload:Oe,networkDetails:null};this._handleFragmentLoadProgress(We),be&&k.prototype._handleFragmentLoadComplete.call(this,We)}else if(this.videoTrackCC!==this.waitingVideoCC)d.logger.log("Waiting fragment cc ("+pe.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ue=this.getLoadPosition(),ct=se.BufferHelper.bufferInfo(this.mediaBuffer,Ue,this.config.maxBufferHole),Ge=Object(P.fragmentWithinToleranceTest)(ct.end,this.config.maxFragLookUpTolerance,pe);Ge<0&&(d.logger.log("Waiting fragment cc ("+pe.cc+") @ "+pe.start+" cancelled because another fragment at "+ct.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var v=this.waitingData;v&&(this.fragmentTracker.removeFragment(v.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},b.onTickEnd=function(){var v=this.media;if(!v||!v.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:v,R=g.buffered;!this.loadedmetadata&&R.length&&(this.loadedmetadata=!0),this.lastCurrentTime=v.currentTime},b.doTickIdle=function(){var v,g,R=this.hls,O=this.levels,G=this.media,Z=this.trackId,ee=R.config;if(!O||!O[Z])return;if(!G&&(this.startFragRequested||!ee.startFragPrefetch))return;var fe=O[Z],pe=fe.details;if(!pe||pe.live&&this.levelLastLoaded!==Z||this.waitForCdnTuneIn(pe)){this.state=K.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,L.ElementaryStreamTypes.AUDIO,V.PlaylistLevelType.AUDIO));var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,V.PlaylistLevelType.AUDIO);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(),Oe=this.audioSwitch;if(Ce>=be&&!Oe)return;if(!Oe&&this._streamEnded(xe,pe)){R.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var We=pe.fragments,Ue=We[0].start,ct=xe.end;if(Oe){var Ge=this.getLoadPosition();ct=Ge,pe.PTSKnown&&GeUe||xe.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),G.currentTime=Ue+.05))}var Je=this.getNextFragment(ct,pe);if(!Je){this.bufferFlushed=!0;return}((v=Je.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((g=Je.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Je,pe):this.loadFragment(Je,pe,ct)},b.getMaxBufferLength=function(){var v=k.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,V.PlaylistLevelType.MAIN);return g===null?v:Math.max(v,g.len)},b.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(v,g){var R=g.audioTracks;this.resetTransmuxer(),this.levels=R.map(function(O){return new X.Level(O)})},b.onAudioTrackSwitching=function(v,g){var R=!!g.url;this.trackId=g.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),R?this.setInterval(x):this.resetTransmuxer(),R?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(v,g){this.mainDetails=g.details},b.onAudioTrackLoaded=function(v,g){var R,O=this.levels,G=g.details,Z=g.id;if(!O){this.warn("Audio tracks were reset while loading level "+Z);return}this.log("Track "+Z+" loaded ["+G.startSN+","+G.endSN+"],duration:"+G.totalduration);var ee=O[Z],fe=0;if(G.live||(R=ee.details)!==null&&R!==void 0&&R.live){var pe=this.mainDetails;if(G.fragments[0]||(G.deltaUpdateFailed=!0),G.deltaUpdateFailed||!pe)return;!ee.details&&G.hasProgramDateTime&&pe.hasProgramDateTime?(Object(I.alignMediaPlaylistByPDT)(G,pe),fe=G.fragments[0].start):fe=this.alignPlaylists(G,ee.details)}ee.details=G,this.levelLastLoaded=Z,!this.startFragRequested&&(this.mainDetails||!G.live)&&this.setStartPosition(ee.details,fe),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(G)&&(this.state=K.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(v){var g,R=v.frag,O=v.part,G=v.payload,Z=this.config,ee=this.trackId,fe=this.levels;if(!fe){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+R.sn+" of level "+R.level+" will not be buffered");return}var pe=fe[ee];console.assert(pe,"Audio track is defined on fragment load progress");var xe=pe.details;console.assert(xe,"Audio track details are defined on fragment load progress");var Ce=Z.defaultAudioCodec||pe.audioCodec||"mp4a.40.2",be=this.transmuxer;be||(be=this.transmuxer=new W.default(this.hls,V.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Oe=this.initPTS[R.cc],We=(g=R.initSegment)===null||g===void 0?void 0:g.data;if(Oe!==void 0){var Ue=!1,ct=O?O.index:-1,Ge=ct!==-1,Je=new M.ChunkMetadata(R.level,R.sn,R.stats.chunkCount,G.byteLength,ct,Ge);be.push(G,We,Ce,"",R,O,xe.totalduration,Ue,Je,Oe)}else{d.logger.log("Unknown video PTS for cc "+R.cc+", waiting for video PTS before demuxing audio frag "+R.sn+" of ["+xe.startSN+" ,"+xe.endSN+"],track "+ee);var Xe=this.waitingData=this.waitingData||{frag:R,part:O,cache:new U.default,complete:!1},Ye=Xe.cache;Ye.push(new Uint8Array(G)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(v){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,v)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(v,g){var R=g.tracks.audio;R&&(this.mediaBuffer=R.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},b.onFragBuffered=function(v,g){var R=g.frag,O=g.part;if(R.type!==V.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(R)){this.warn("Fragment "+R.sn+(O?" p: "+O.index:"")+" of level "+R.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}R.sn!=="initSegment"&&(this.fragPrevious=R,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(R,O)},b.onError=function(v,g){switch(g.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:case C.ErrorDetails.KEY_LOAD_ERROR:case C.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.AUDIO,g);break;case C.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case C.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=g.fatal?K.State.ERROR:K.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case C.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var R=!0,O=this.getFwdBufferInfo(this.mediaBuffer,V.PlaylistLevelType.AUDIO);O&&O.len>.5&&(R=!this.reduceMaxBufferLength(O.len)),R&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(v,g){var R=g.type;R===L.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(v){var g,R="audio",O=this.hls,G=v.remuxResult,Z=v.chunkMeta,ee=this.getCurrentContext(Z);if(!ee){this.warn("The loading context changed while buffering fragment "+Z.sn+" of level "+Z.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(Z.level);return}var fe=ee.frag,pe=ee.part,xe=G.audio,Ce=G.text,be=G.id3,Oe=G.initSegment;if(this.fragContextChanged(fe))return;if(this.state=K.State.PARSING,this.audioSwitch&&xe&&this.completeAudioSwitch(),Oe!=null&&Oe.tracks&&(this._bufferInitSegment(Oe.tracks,fe,Z),O.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:fe,id:R,tracks:Oe.tracks})),xe){var We=xe.startPTS,Ue=xe.endPTS,ct=xe.startDTS,Ge=xe.endDTS;pe&&(pe.elementaryStreams[L.ElementaryStreamTypes.AUDIO]={startPTS:We,endPTS:Ue,startDTS:ct,endDTS:Ge}),fe.setElementaryStreamInfo(L.ElementaryStreamTypes.AUDIO,We,Ue,ct,Ge),this.bufferFragmentData(xe,fe,pe,Z)}if(be!=null&&(g=be.samples)!==null&&g!==void 0&&g.length){var Je=f({frag:fe,id:R},be);O.trigger(B.Events.FRAG_PARSING_METADATA,Je)}if(Ce){var Xe=f({frag:fe,id:R},Ce);O.trigger(B.Events.FRAG_PARSING_USERDATA,Xe)}},b._bufferInitSegment=function(v,g,R){if(this.state!==K.State.PARSING)return;v.video&&delete v.video;var O=v.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,v);var G=O.initSegment;if(G!=null&&G.byteLength){var Z={type:"audio",frag:g,part:null,chunkMeta:R,parent:g.type,data:G};this.hls.trigger(B.Events.BUFFER_APPENDING,Z)}this.tick()},b.loadFragment=function(v,g,R){var O=this.fragmentTracker.getState(v);this.fragCurrent=v,(this.audioSwitch||O===q.FragmentState.NOT_LOADED||O===q.FragmentState.PARTIAL)&&(v.sn==="initSegment"?this._loadInitSegment(v):g.live&&!Object(oe.isFiniteNumber)(this.initPTS[v.cc])?(this.log("Waiting for video PTS in continuity counter "+v.cc+" of live stream before loading audio fragment "+v.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,v,g,R)))},b.completeAudioSwitch=function(){var v=this.hls,g=this.media,R=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,v.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:R})},w}(K.default);re.default=E},"./src/controller/audio-track-controller.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/events.ts"),K=H("./src/errors.ts"),B=H("./src/controller/base-playlist-controller.ts"),se=H("./src/types/loader.ts");function q(W,M){for(var P=0;P=d.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var f=d[this.trackId];this.log("Now switching to audio-track index "+C);var p=d[C],T=p.id,x=p.groupId,E=x===void 0?"":x,k=p.name,w=p.type,b=p.url;if(this.trackId=C,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger(oe.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:E,name:k,type:w,url:b}),p.details&&!p.details.live)return;var m=this.switchParams(p.url,f==null?void 0:f.details);this.loadPlaylist(m)},P.selectInitialTrack=function(){var C=this.tracksInGroup;console.assert(C.length,"Initial audio track should be selected when tracks are known");var d=this.trackName,f=this.findTrackId(d)||this.findTrackId();f!==-1?this.setAudioTrack(f):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},P.findTrackId=function(C){for(var d=this.tracksInGroup,f=0;fM.partTarget&&(p+=1)}if(Object(oe.isFiniteNumber)(f))return new K.HlsUrlParameters(f,Object(oe.isFiniteNumber)(p)?p:void 0,K.HlsSkip.No)}}},L.loadPlaylist=function(W){},L.shouldLoadTrack=function(W){return this.canLoad&&W&&!!W.url&&(!W.details||W.details.live)},L.playlistLoaded=function(W,M,P){var I=this,C=M.details,d=M.stats,f=d.loading.end?Math.max(0,self.performance.now()-d.loading.end):0;if(C.advancedDateTime=Date.now()-f,C.live||P!=null&&P.live){if(C.reloaded(P),P&&this.log("live playlist "+W+" "+(C.advanced?"REFRESHED "+C.lastPartSn+"-"+C.lastPartIndex:"MISSED")),P&&C.fragments.length>0&&Object(B.mergeDetails)(P,C),!this.canLoad||!C.live)return;var p,T=void 0,x=void 0;if(C.canBlockReload&&C.endSN&&C.advanced){var E=this.hls.config.lowLatencyMode,k=C.lastPartSn,w=C.endSN,b=C.lastPartIndex,m=b!==-1,v=k===w,g=E?0:b;m?(T=v?w+1:k,x=v?g:b+1):T=w+1;var R=C.age,O=R+C.ageHeader,G=Math.min(O-C.partTarget,C.targetduration*1.5);if(G>0){if(P&&G>P.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+P.tuneInGoal+" to: "+G+" with playlist age: "+C.age),G=0;else{var Z=Math.floor(G/C.targetduration);if(T+=Z,x!==void 0){var ee=Math.round(G%C.targetduration/C.partTarget);x+=ee}this.log("CDN Tune-in age: "+C.ageHeader+"s last advanced "+R.toFixed(2)+"s goal: "+G+" skip sn "+Z+" to part "+x)}C.tuneInGoal=G}if(p=this.getDeliveryDirectives(C,M.deliveryDirectives,T,x),E||!v){this.loadPlaylist(p);return}}else p=this.getDeliveryDirectives(C,M.deliveryDirectives,T,x);var fe=Object(B.computeReloadInterval)(C,d);T!==void 0&&C.canBlockReload&&(fe-=C.partTarget||1),this.log("reload live playlist "+W+" in "+Math.round(fe)+" ms"),this.timer=self.setTimeout(function(){return I.loadPlaylist(p)},fe)}else this.clearTimer()},L.getDeliveryDirectives=function(W,M,P,I){var C=Object(K.getSkipValue)(W,P);return M!=null&&M.skip&&W.deltaUpdateFailed&&(P=M.msn,I=M.part,C=K.HlsSkip.No),new K.HlsUrlParameters(P,I,C)},L.retryLoadingOrFail=function(W){var M=this,P=this.hls.config,I=this.retryCount-1&&(C=W.context)!==null&&C!==void 0&&C.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+W.details+'"'),this.loadPlaylist();else{var d=Math.min(Math.pow(2,this.retryCount)*P.levelLoadingRetryDelay,P.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return M.loadPlaylist()},d),this.warn("retry playlist loading #"+this.retryCount+" in "+d+' ms after "'+W.details+'"')}}else this.warn('cannot recover from error "'+W.details+'"'),this.clearTimer(),W.fatal=!0;return I},V}()},"./src/controller/base-stream-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"State",function(){return w}),H.d(re,"default",function(){return b});var oe=H("./src/polyfills/number.ts"),K=H("./src/task-loop.ts"),B=H("./src/controller/fragment-tracker.ts"),se=H("./src/utils/buffer-helper.ts"),q=H("./src/utils/logger.ts"),X=H("./src/events.ts"),V=H("./src/errors.ts"),L=H("./src/types/transmuxer.ts"),U=H("./src/utils/mp4-tools.ts"),W=H("./src/utils/discontinuities.ts"),M=H("./src/controller/fragment-finders.ts"),P=H("./src/controller/level-helper.ts"),I=H("./src/loader/fragment-loader.ts"),C=H("./src/crypt/decrypter.ts"),d=H("./src/utils/time-ranges.ts"),f=H("./src/types/loader.ts");function p(m,v){for(var g=0;gOe;(pe0&&pe&&pe.key&&pe.iv&&pe.method==="AES-128"){var xe=self.performance.now();return G.decrypter.webCryptoDecrypt(new Uint8Array(fe),pe.key.buffer,pe.iv.buffer).then(function(Ce){var be=self.performance.now();return ee.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:Ce,stats:{tstart:xe,tdecrypt:be}}),Z.payload=Ce,Z})}return Z}).then(function(Z){var ee=G.fragCurrent,fe=G.hls,pe=G.levels;if(!pe)throw new Error("init load aborted, missing levels");var xe=pe[O.level].details;console.assert(xe,"Level details are defined when init segment is loaded");var Ce=O.stats;G.state=w.IDLE,G.fragLoadError=0,O.data=new Uint8Array(Z.payload),Ce.parsing.start=Ce.buffering.start=self.performance.now(),Ce.parsing.end=Ce.buffering.end=self.performance.now(),Z.frag===ee&&fe.trigger(X.Events.FRAG_BUFFERED,{stats:Ce,frag:ee,part:null,id:O.type}),G.tick()}).catch(function(Z){G.warn(Z),G.resetFragmentLoading(O)})},g.fragContextChanged=function(O){var G=this.fragCurrent;return!O||!G||O.level!==G.level||O.sn!==G.sn||O.urlId!==G.urlId},g.fragBufferedComplete=function(O,G){var Z=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(G?" part: "+G.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+d.default.toString(se.BufferHelper.getBuffered(Z))),this.state=w.IDLE,this.tick()},g._handleFragmentLoadComplete=function(O){var G=this.transmuxer;if(!G)return;var Z=O.frag,ee=O.part,fe=O.partsLoaded,pe=!fe||fe.length===0||fe.some(function(Ce){return!Ce}),xe=new L.ChunkMetadata(Z.level,Z.sn,Z.stats.chunkCount+1,0,ee?ee.index:-1,!pe);G.flush(xe)},g._handleFragmentLoadProgress=function(O){},g._doFragLoad=function(O,G,Z,ee){var fe=this;if(Z===void 0&&(Z=null),!this.levels)throw new Error("frag load aborted, missing levels");if(Z=Math.max(O.start,Z||0),this.config.lowLatencyMode&&G){var pe=G.partList;if(pe&&ee){Z>O.end&&G.fragmentHint&&(O=G.fragmentHint);var xe=this.getNextPart(pe,O,Z);if(xe>-1){var Ce=pe[xe];return this.log("Loading part sn: "+O.sn+" p: "+Ce.index+" cc: "+O.cc+" of playlist ["+G.startSN+"-"+G.endSN+"] parts [0-"+xe+"-"+(pe.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Z.toFixed(3))),this.nextLoadPosition=Ce.start+Ce.duration,this.state=w.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,part:pe[xe],targetBufferTime:Z}),this.doFragPartsLoad(O,pe,xe,ee).catch(function(be){return fe.handleFragLoadError(be)})}else if(!O.url||this.loadedEndOfParts(pe,Z))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(G?"of ["+G.startSN+"-"+G.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Z.toFixed(3))),Object(oe.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=w.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,targetBufferTime:Z}),this.fragmentLoader.load(O,ee).catch(function(be){return fe.handleFragLoadError(be)})},g.doFragPartsLoad=function(O,G,Z,ee){var fe=this;return new Promise(function(pe,xe){var Ce=[],be=function Oe(We){var Ue=G[We];fe.fragmentLoader.loadPart(O,Ue,ee).then(function(ct){Ce[Ue.index]=ct;var Ge=ct.part;fe.hls.trigger(X.Events.FRAG_LOADED,ct);var Je=G[We+1];if(Je&&Je.fragment===O)Oe(We+1);else return pe({frag:O,part:Ge,partsLoaded:Ce})}).catch(xe)};be(Z)})},g.handleFragLoadError=function(O){var G=O.data;return G&&G.details===V.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(G.frag,G.part):this.hls.trigger(X.Events.ERROR,G),null},g._handleTransmuxerFlush=function(O){var G=this.getCurrentContext(O);if(!G||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var Z=G.frag,ee=G.part,fe=G.level,pe=self.performance.now();Z.stats.parsing.end=pe,ee&&(ee.stats.parsing.end=pe),this.updateLevelTiming(Z,ee,fe,O.partial)},g.getCurrentContext=function(O){var G=this.levels,Z=O.level,ee=O.sn,fe=O.part;if(!G||!G[Z])return this.warn("Levels object was unset while buffering fragment "+ee+" of level "+Z+". The current chunk will not be buffered."),null;var pe=G[Z],xe=fe>-1?Object(P.getPartWith)(pe,ee,fe):null,Ce=xe?xe.fragment:Object(P.getFragmentWithSN)(pe,ee,this.fragCurrent);return Ce?{frag:Ce,part:xe,level:pe}:null},g.bufferFragmentData=function(O,G,Z,ee){if(!O||this.state!==w.PARSING)return;var fe=O.data1,pe=O.data2,xe=fe;if(fe&&pe&&(xe=Object(U.appendUint8Array)(fe,pe)),!xe||!xe.length)return;var Ce={type:O.type,frag:G,part:Z,chunkMeta:ee,parent:G.type,data:xe};this.hls.trigger(X.Events.BUFFER_APPENDING,Ce),O.dropped&&O.independent&&!Z&&this.flushBufferGap(G)},g.flushBufferGap=function(O){var G=this.media;if(!G)return;if(!se.BufferHelper.isBuffered(G,G.currentTime)){this.flushMainBuffer(0,O.start);return}var Z=G.currentTime,ee=se.BufferHelper.bufferInfo(G,Z,0),fe=O.duration,pe=Math.min(this.config.maxFragLookUpTolerance*2,fe*.25),xe=Math.max(Math.min(O.start-pe,ee.end-pe),Z+pe);O.start-xe>pe&&this.flushMainBuffer(xe,O.start)},g.getFwdBufferInfo=function(O,G){var Z=this.config,ee=this.getLoadPosition();if(!Object(oe.isFiniteNumber)(ee))return null;var fe=se.BufferHelper.bufferInfo(O,ee,Z.maxBufferHole);if(fe.len===0&&fe.nextStart!==void 0){var pe=this.fragmentTracker.getBufferedFrag(ee,G);if(pe&&fe.nextStart=Z?(G.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+G.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(O,G){var Z,ee,fe=G.fragments,pe=fe.length;if(!pe)return null;var xe=this.config,Ce=fe[0].start,be;if(G.live){var Oe=xe.initialLiveManifestSize;if(pe-1&&ZZ.start&&Z.loaded},g.getInitialLiveFragment=function(O,G){var Z=this.fragPrevious,ee=null;if(Z){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+Z.programDateTime),ee=Object(M.findFragmentByPDT)(G,Z.endProgramDateTime,this.config.maxFragLookUpTolerance)),!ee){var fe=Z.sn+1;if(fe>=O.startSN&&fe<=O.endSN){var pe=G[fe-O.startSN];Z.cc===pe.cc&&(ee=pe,this.log("Live playlist, switching playlist, load frag with next SN: "+ee.sn))}ee||(ee=Object(M.findFragWithCC)(G,Z.cc),ee&&this.log("Live playlist, switching playlist, load frag with same CC: "+ee.sn))}}else{var xe=this.hls.liveSyncPosition;xe!==null&&(ee=this.getFragmentAtPosition(xe,this.bitrateTest?O.fragmentEnd:O.edge,O))}return ee},g.getFragmentAtPosition=function(O,G,Z){var ee=this.config,fe=this.fragPrevious,pe=Z.fragments,xe=Z.endSN,Ce=Z.fragmentHint,be=ee.maxFragLookUpTolerance,Oe=!!(ee.lowLatencyMode&&Z.partList&&Ce);Oe&&Ce&&!this.bitrateTest&&(pe=pe.concat(Ce),xe=Ce.sn);var We;if(OG-be?0:be;We=Object(M.findFragmentByPTS)(fe,pe,O,Ue)}else We=pe[pe.length-1];if(We){var ct=We.sn-Z.startSN,Ge=fe&&We.level===fe.level,Je=pe[ct+1],Xe=this.fragmentTracker.getState(We);if(Xe===B.FragmentState.BACKTRACKED){We=null;for(var Ye=ct;pe[Ye]&&this.fragmentTracker.getState(pe[Ye])===B.FragmentState.BACKTRACKED;)fe?We=pe[Ye--]:We=pe[--Ye];We||(We=Je)}else fe&&We.sn===fe.sn&&!Oe&&(Ge&&(We.sn=pe-G.maxFragLookUpTolerance&&fe<=xe;if(ee!==null&&Z.duration>ee&&(fe"+O.startSN+" prev-sn: "+(fe?fe.sn:"na")+" fragments: "+xe),We}return Ce},g.waitForCdnTuneIn=function(O){var G=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*G)},g.setStartPosition=function(O,G){var Z=this.startPosition;if(Z"+O))}}]),v}(K.default)},"./src/controller/buffer-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return M});var oe=H("./src/polyfills/number.ts"),K=H("./src/events.ts"),B=H("./src/utils/logger.ts"),se=H("./src/errors.ts"),q=H("./src/utils/buffer-helper.ts"),X=H("./src/utils/mediasource-helper.ts"),V=H("./src/loader/fragment.ts"),L=H("./src/controller/buffer-operation-queue.ts"),U=Object(X.getMediaSource)(),W=/([ha]vc.)(?:\.[^.,]+)+/,M=function(){function P(C){var d=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var f=d.hls,p=d.media,T=d.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),p&&(d.updateMediaElementDuration(),f.trigger(K.Events.MEDIA_ATTACHED,{media:p})),T&&T.removeEventListener("sourceopen",d._onMediaSourceOpen),d.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=C,this._initSourceBuffer(),this.registerListeners()}var I=P.prototype;return I.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},I.destroy=function(){this.unregisterListeners(),this.details=null},I.registerListeners=function(){var d=this.hls;d.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(K.Events.BUFFER_RESET,this.onBufferReset,this),d.on(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(K.Events.BUFFER_EOS,this.onBufferEos,this),d.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.on(K.Events.FRAG_PARSED,this.onFragParsed,this),d.on(K.Events.FRAG_CHANGED,this.onFragChanged,this)},I.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(K.Events.BUFFER_RESET,this.onBufferReset,this),d.off(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(K.Events.BUFFER_EOS,this.onBufferEos,this),d.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.off(K.Events.FRAG_PARSED,this.onFragParsed,this),d.off(K.Events.FRAG_CHANGED,this.onFragChanged,this)},I._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new L.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},I.onManifestParsed=function(d,f){var p=2;(f.audio&&!f.video||!f.altAudio)&&(p=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=p,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},I.onMediaAttaching=function(d,f){var p=this.media=f.media;if(p&&U){var T=this.mediaSource=new U;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),p.src=self.URL.createObjectURL(T),this._objectUrl=p.src}},I.onMediaDetaching=function(){var d=this.media,f=this.mediaSource,p=this._objectUrl;if(f){if(B.logger.log("[buffer-controller]: media source detaching"),f.readyState==="open")try{f.endOfStream()}catch(T){B.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),f.removeEventListener("sourceopen",this._onMediaSourceOpen),f.removeEventListener("sourceended",this._onMediaSourceEnded),f.removeEventListener("sourceclose",this._onMediaSourceClose),d&&(p&&self.URL.revokeObjectURL(p),d.src===p?(d.removeAttribute("src"),d.load()):B.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(K.Events.MEDIA_DETACHED,void 0)},I.onBufferReset=function(){var d=this;this.getSourceBufferTypes().forEach(function(f){var p=d.sourceBuffer[f];try{p&&(d.removeBufferListeners(f),d.mediaSource&&d.mediaSource.removeSourceBuffer(p),d.sourceBuffer[f]=void 0)}catch(T){B.logger.warn("[buffer-controller]: Failed to reset the "+f+" buffer",T)}}),this._initSourceBuffer()},I.onBufferCodecs=function(d,f){var p=this,T=this.getSourceBufferTypes().length;if(Object.keys(f).forEach(function(x){if(T){var E=p.tracks[x];if(E&&typeof E.buffer.changeType=="function"){var k=f[x],w=k.codec,b=k.levelCodec,m=k.container,v=(E.levelCodec||E.codec).replace(W,"$1"),g=(b||w).replace(W,"$1");if(v!==g){var R=m+";codecs="+(b||w);p.appendChangeType(x,R)}}}else p.pendingTracks[x]=f[x]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},I.appendChangeType=function(d,f){var p=this,T=this.operationQueue,x={execute:function(){var k=p.sourceBuffer[d];k&&(B.logger.log("[buffer-controller]: changing "+d+" sourceBuffer type to "+f),k.changeType(f)),T.shiftAndExecuteNext(d)},onStart:function(){},onComplete:function(){},onError:function(k){B.logger.warn("[buffer-controller]: Failed to change "+d+" SourceBuffer type",k)}};T.append(x,d)},I.onBufferAppending=function(d,f){var p=this,T=this.hls,x=this.operationQueue,E=this.tracks,k=f.data,w=f.type,b=f.frag,m=f.part,v=f.chunkMeta,g=v.buffering[w],R=self.performance.now();g.start=R;var O=b.stats.buffering,G=m?m.stats.buffering:null;O.start===0&&(O.start=R),G&&G.start===0&&(G.start=R);var Z=E.audio,ee=w==="audio"&&v.id===1&&(Z==null?void 0:Z.container)==="audio/mpeg",fe={execute:function(){if(g.executeStart=self.performance.now(),ee){var xe=p.sourceBuffer[w];if(xe){var Ce=b.start-xe.timestampOffset;Math.abs(Ce)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+Ce+") sn: "+b.sn+")"),xe.timestampOffset=b.start)}}p.appendExecutor(k,w)},onStart:function(){},onComplete:function(){var xe=self.performance.now();g.executeEnd=g.end=xe,O.first===0&&(O.first=xe),G&&G.first===0&&(G.first=xe);var Ce=p.sourceBuffer,be={};for(var Oe in Ce)be[Oe]=q.BufferHelper.getBuffered(Ce[Oe]);p.appendError=0,p.hls.trigger(K.Events.BUFFER_APPENDED,{type:w,frag:b,part:m,chunkMeta:v,parent:b.type,timeRanges:be})},onError:function(xe){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",xe);var Ce={type:se.ErrorTypes.MEDIA_ERROR,parent:b.type,details:se.ErrorDetails.BUFFER_APPEND_ERROR,err:xe,fatal:!1};xe.code===DOMException.QUOTA_EXCEEDED_ERR?Ce.details=se.ErrorDetails.BUFFER_FULL_ERROR:(p.appendError++,Ce.details=se.ErrorDetails.BUFFER_APPEND_ERROR,p.appendError>T.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),Ce.fatal=!0)),T.trigger(K.Events.ERROR,Ce)}};x.append(fe,w)},I.onBufferFlushing=function(d,f){var p=this,T=this.operationQueue,x=function(k){return{execute:p.removeExecutor.bind(p,k,f.startOffset,f.endOffset),onStart:function(){},onComplete:function(){p.hls.trigger(K.Events.BUFFER_FLUSHED,{type:k})},onError:function(b){B.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",b)}}};f.type?T.append(x(f.type),f.type):this.getSourceBufferTypes().forEach(function(E){T.append(x(E),E)})},I.onFragParsed=function(d,f){var p=this,T=f.frag,x=f.part,E=[],k=x?x.elementaryStreams:T.elementaryStreams;k[V.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(k[V.ElementaryStreamTypes.AUDIO]&&E.push("audio"),k[V.ElementaryStreamTypes.VIDEO]&&E.push("video"));var w=function(){var m=self.performance.now();T.stats.buffering.end=m,x&&(x.stats.buffering.end=m);var v=x?x.stats:T.stats;p.hls.trigger(K.Events.FRAG_BUFFERED,{frag:T,part:x,stats:v,id:T.type})};E.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(w,E)},I.onFragChanged=function(d,f){this.flushBackBuffer()},I.onBufferEos=function(d,f){var p=this,T=this.getSourceBufferTypes().reduce(function(x,E){var k=p.sourceBuffer[E];return(!f.type||f.type===E)&&(k&&!k.ended&&(k.ended=!0,B.logger.log("[buffer-controller]: "+E+" sourceBuffer now EOS"))),x&&!!(!k||k.ended)},!0);T&&this.blockBuffers(function(){var x=p.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},I.onLevelUpdated=function(d,f){var p=f.details;if(!p.fragments.length)return;this.details=p,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},I.flushBackBuffer=function(){var d=this.hls,f=this.details,p=this.media,T=this.sourceBuffer;if(!p||f===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var E=f.live&&d.config.liveBackBufferLength!==null?d.config.liveBackBufferLength:d.config.backBufferLength;if(!Object(oe.isFiniteNumber)(E)||E<0)return;var k=p.currentTime,w=f.levelTargetDuration,b=Math.max(E,w),m=Math.floor(k/w)*w-b;x.forEach(function(v){var g=T[v];if(g){var R=q.BufferHelper.getBuffered(g);R.length>0&&m>R.start(0)&&(d.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:m}),f.live&&d.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:m}),d.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:m,type:v}))}})},I.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var d=this.details,f=this.hls,p=this.media,T=this.mediaSource,x=d.fragments[0].start+d.totalduration,E=p.duration,k=Object(oe.isFiniteNumber)(T.duration)?T.duration:0;d.live&&f.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(d)):(x>k&&x>E||!Object(oe.isFiniteNumber)(E))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),T.duration=x)},I.updateSeekableRange=function(d){var f=this.mediaSource,p=d.fragments,T=p.length;if(T&&d.live&&f!==null&&f!==void 0&&f.setLiveSeekableRange){var x=Math.max(0,p[0].start),E=Math.max(x,x+d.totalduration);f.setLiveSeekableRange(x,E)}},I.checkPendingTracks=function(){var d=this.bufferCodecEventsExpected,f=this.operationQueue,p=this.pendingTracks,T=Object.keys(p).length;if(T&&!d||T===2){this.createSourceBuffers(p),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(E){f.executeNext(E)})}},I.createSourceBuffers=function(d){var f=this.sourceBuffer,p=this.mediaSource;if(!p)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var x in d)if(!f[x]){var E=d[x];if(!E)throw Error("source buffer exists for track "+x+", however track does not");var k=E.levelCodec||E.codec,w=E.container+";codecs="+k;B.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var b=f[x]=p.addSourceBuffer(w),m=x;this.addBufferListener(m,"updatestart",this._onSBUpdateStart),this.addBufferListener(m,"updateend",this._onSBUpdateEnd),this.addBufferListener(m,"error",this._onSBUpdateError),this.tracks[x]={buffer:b,codec:k,container:E.container,levelCodec:E.levelCodec,id:E.id},T++}catch(v){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+v.message),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:v,mimeType:w})}}T&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},I._onSBUpdateStart=function(d){var f=this.operationQueue,p=f.current(d);p.onStart()},I._onSBUpdateEnd=function(d){var f=this.operationQueue,p=f.current(d);p.onComplete(),f.shiftAndExecuteNext(d)},I._onSBUpdateError=function(d,f){B.logger.error("[buffer-controller]: "+d+" SourceBuffer error",f),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var p=this.operationQueue.current(d);p&&p.onError(f)},I.removeExecutor=function(d,f,p){var T=this.media,x=this.mediaSource,E=this.operationQueue,k=this.sourceBuffer,w=k[d];if(!T||!x||!w){B.logger.warn("[buffer-controller]: Attempting to remove from the "+d+" SourceBuffer, but it does not exist"),E.shiftAndExecuteNext(d);return}var b=Object(oe.isFiniteNumber)(T.duration)?T.duration:Infinity,m=Object(oe.isFiniteNumber)(x.duration)?x.duration:Infinity,v=Math.max(0,f),g=Math.min(p,b,m);g>v?(B.logger.log("[buffer-controller]: Removing ["+v+","+g+"] from the "+d+" SourceBuffer"),console.assert(!w.updating,d+" sourceBuffer must not be updating"),w.remove(v,g)):E.shiftAndExecuteNext(d)},I.appendExecutor=function(d,f){var p=this.operationQueue,T=this.sourceBuffer,x=T[f];if(!x){B.logger.warn("[buffer-controller]: Attempting to append to the "+f+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(f);return}x.ended=!1,console.assert(!x.updating,f+" sourceBuffer must not be updating"),x.appendBuffer(d)},I.blockBuffers=function(d,f){var p=this;if(f===void 0&&(f=this.getSourceBufferTypes()),!f.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(d);return}var T=this.operationQueue,x=f.map(function(E){return T.appendBlocker(E)});Promise.all(x).then(function(){d(),f.forEach(function(E){var k=p.sourceBuffer[E];(!k||!k.updating)&&T.shiftAndExecuteNext(E)})})},I.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},I.addBufferListener=function(d,f,p){var T=this.sourceBuffer[d];if(!T)return;var x=p.bind(this,d);this.listeners[d].push({event:f,listener:x}),T.addEventListener(f,x)},I.removeBufferListeners=function(d){var f=this.sourceBuffer[d];if(!f)return;this.listeners[d].forEach(function(p){f.removeEventListener(p.event,p.listener)})},P}()},"./src/controller/buffer-operation-queue.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return K});var oe=H("./src/utils/logger.ts"),K=function(){function B(q){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=q}var se=B.prototype;return se.append=function(X,V){var L=this.queues[V];L.push(X),L.length===1&&this.buffers[V]&&this.executeNext(V)},se.insertAbort=function(X,V){var L=this.queues[V];L.unshift(X),this.executeNext(V)},se.appendBlocker=function(X){var V,L=new Promise(function(W){V=W}),U={execute:V,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(U,X),L},se.executeNext=function(X){var V=this.buffers,L=this.queues,U=V[X],W=L[X];if(W.length){var M=W[0];try{M.execute()}catch(P){oe.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),M.onError(P),(!U||!U.updating)&&(W.shift(),this.executeNext(X))}}},se.shiftAndExecuteNext=function(X){this.queues[X].shift(),this.executeNext(X)},se.current=function(X){return this.queues[X][0]},B}()},"./src/controller/cap-level-controller.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/events.ts");function K(q,X){for(var V=0;V0&&this.mediaWidth>0){var L=this.hls.levels;if(L.length){var U=this.hls;U.autoLevelCapping=this.getMaxLevel(L.length-1),U.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=U.autoLevelCapping}}},X.getMaxLevel=function(L){var U=this,W=this.hls.levels;if(!W.length)return-1;var M=W.filter(function(P,I){return q.isLevelAllowed(I,U.restrictedLevels)&&I<=L});return this.clientRect=null,q.getMaxLevelByMediaSize(M,this.mediaWidth,this.mediaHeight)},X.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},X.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},X.getDimensions=function(){if(this.clientRect)return this.clientRect;var L=this.media,U={width:0,height:0};if(L){var W=L.getBoundingClientRect();U.width=W.width,U.height=W.height,!U.width&&!U.height&&(U.width=W.right-W.left||L.width||0,U.height=W.bottom-W.top||L.height||0)}return this.clientRect=U,U},q.isLevelAllowed=function(L,U){return U===void 0&&(U=[]),U.indexOf(L)===-1},q.getMaxLevelByMediaSize=function(L,U,W){if(!L||!L.length)return-1;for(var M=function(f,p){return p?f.width!==p.width||f.height!==p.height:!0},P=L.length-1,I=0;I=U||C.height>=W)&&M(C,L[I+1])){P=I;break}}return P},B(q,[{key:"mediaWidth",get:function(){return this.getDimensions().width*q.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*q.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var L=1;try{L=self.devicePixelRatio}catch(U){}return L}}]),q}();re.default=se},"./src/controller/cmcd-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return M});var oe=H("./src/events.ts"),K=H("./src/types/cmcd.ts"),B=H("./src/utils/buffer-helper.ts"),se=H("./src/utils/logger.ts");function q(P,I){for(var C=0;C=P.length?{done:!0}:{done:!1,value:P[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(P,I){if(!P)return;if(typeof P=="string")return U(P,I);var C=Object.prototype.toString.call(P).slice(8,-1);if(C==="Object"&&P.constructor&&(C=P.constructor.name),C==="Map"||C==="Set")return Array.from(P);if(C==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C))return U(P,I)}function U(P,I){(I==null||I>P.length)&&(I=P.length);for(var C=0,d=new Array(I);Cf&&(f=E.bitrate)}return f>0?f:NaN},I.getBufferLength=function(d){var f=this.hls.media,p=d===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!p||!f)return NaN;var T=B.BufferHelper.bufferInfo(p,f.currentTime,this.config.maxBufferHole);return T.len*1e3},I.createPlaylistLoader=function(){var d=this.config.pLoader,f=this.applyPlaylistData,p=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new p(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,w,b){f(k),this.loader.load(k,w,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},I.createFragmentLoader=function(){var d=this.config.fLoader,f=this.applyFragmentData,p=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new p(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,w,b){f(k),this.loader.load(k,w,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},P.uuid=function(){var d=URL.createObjectURL(new Blob),f=d.toString();return URL.revokeObjectURL(d),f.substr(f.lastIndexOf("/")+1)},P.serialize=function(d){for(var f=[],p=function(ee){return!Number.isNaN(ee)&&ee!=null&&ee!==""&&ee!==!1},T=function(ee){return Math.round(ee)},x=function(ee){return T(ee/100)*100},E=function(ee){return encodeURIComponent(ee)},k={br:T,d:T,bl:x,dl:x,mtp:x,nor:E,rtp:x,tb:T},w=Object.keys(d||{}).sort(),b=V(w),m;!(m=b()).done;){var v=m.value,g=d[v];if(!p(g))continue;if(v==="v"&&g===1)continue;if(v=="pr"&&g===1)continue;var R=k[v];R&&(g=R(g));var O=typeof g,G=void 0;v==="ot"||v==="sf"||v==="st"?G=v+"="+g:O==="boolean"?G=v:O==="number"?G=v+"="+g:G=v+"="+JSON.stringify(g),f.push(G)}return f.join(",")},P.toHeaders=function(d){for(var f=Object.keys(d),p={},T=["Object","Request","Session","Status"],x=[{},{},{},{}],E={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},k=0,w=f;kV){this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var E=V-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+E+" attempts left"),this._requestLicense(f,p)}break}},P._generateLicenseRequestChallenge=function(C,d){switch(C.mediaKeySystemDomain){case se.KeySystems.WIDEVINE:return d}throw new Error("unsupported key-system: "+C.mediaKeySystemDomain)},P._requestLicense=function(C,d){B.logger.log("Requesting content license for key-system");var f=this._mediaKeysList[0];if(!f){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var p=this.getLicenseServerUrl(f.mediaKeySystemDomain),T=this._createLicenseXhr(p,C,d);B.logger.log("Sending license request to URL: "+p);var x=this._generateLicenseRequestChallenge(f,C);T.send(x)}catch(E){B.logger.error("Failure requesting DRM license: "+E),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},P.onMediaAttached=function(C,d){if(!this._emeEnabled)return;var f=d.media;this._media=f,f.addEventListener("encrypted",this._onMediaEncrypted)},P.onMediaDetached=function(){var C=this._media,d=this._mediaKeysList;if(!C)return;C.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(d.map(function(f){if(f.mediaKeysSession)return f.mediaKeysSession.close().catch(function(){})})).then(function(){return C.setMediaKeys(null)}).catch(function(){})},P.onManifestParsed=function(C,d){if(!this._emeEnabled)return;var f=d.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),p=d.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(se.KeySystems.WIDEVINE,f,p)},X(M,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),M}();re.default=W},"./src/controller/fps-controller.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/events.ts"),K=H("./src/utils/logger.ts"),B=function(){function se(X){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=X,this.registerListeners()}var q=se.prototype;return q.setStreamController=function(V){this.streamController=V},q.registerListeners=function(){this.hls.on(oe.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},q.unregisterListeners=function(){this.hls.off(oe.Events.MEDIA_ATTACHING,this.onMediaAttaching)},q.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},q.onMediaAttaching=function(V,L){var U=this.hls.config;if(U.capLevelOnFPSDrop){var W=L.media instanceof self.HTMLVideoElement?L.media:null;this.media=W,W&&typeof W.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),U.fpsDroppedMonitoringPeriod)}},q.checkFPS=function(V,L,U){var W=performance.now();if(L){if(this.lastTime){var M=W-this.lastTime,P=U-this.lastDroppedFrames,I=L-this.lastDecodedFrames,C=1e3*P/M,d=this.hls;if(d.trigger(oe.Events.FPS_DROP,{currentDropped:P,currentDecoded:I,totalDroppedFrames:U}),C>0&&P>d.config.fpsDroppedMonitoringThreshold*I){var f=d.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=f)&&(f=f-1,d.trigger(oe.Events.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:d.currentLevel}),d.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=W,this.lastDroppedFrames=U,this.lastDecodedFrames=L}},q.checkFPSInterval=function(){var V=this.media;if(V)if(this.isVideoPlaybackQualityAvailable){var L=V.getVideoPlaybackQuality();this.checkFPS(V,L.totalVideoFrames,L.droppedVideoFrames)}else this.checkFPS(V,V.webkitDecodedFrameCount,V.webkitDroppedFrameCount)},se}();re.default=B},"./src/controller/fragment-finders.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"findFragmentByPDT",function(){return B}),H.d(re,"findFragmentByPTS",function(){return se}),H.d(re,"fragmentWithinToleranceTest",function(){return q}),H.d(re,"pdtWithinToleranceTest",function(){return X}),H.d(re,"findFragWithCC",function(){return V});var oe=H("./src/polyfills/number.ts"),K=H("./src/utils/binary-search.ts");function B(L,U,W){if(U===null||!Array.isArray(L)||!L.length||!Object(oe.isFiniteNumber)(U))return null;var M=L[0].programDateTime;if(U<(M||0))return null;var P=L[L.length-1].endProgramDateTime;if(U>=(P||0))return null;W=W||0;for(var I=0;IL&&W.start?-1:0}function X(L,U,W){var M=Math.min(U,W.duration+(W.deltaPTS?W.deltaPTS:0))*1e3,P=W.endProgramDateTime||0;return P-M>L}function V(L,U){return K.default.search(L,function(W){return W.ccU?-1:0})}},"./src/controller/fragment-tracker.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"FragmentState",function(){return B}),H.d(re,"FragmentTracker",function(){return se});var oe=H("./src/events.ts"),K=H("./src/types/loader.ts"),B;(function(V){V.NOT_LOADED="NOT_LOADED",V.BACKTRACKED="BACKTRACKED",V.APPENDING="APPENDING",V.PARTIAL="PARTIAL",V.OK="OK"})(B||(B={}));var se=function(){function V(U){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=U,this._registerListeners()}var L=V.prototype;return L._registerListeners=function(){var W=this.hls;W.on(oe.Events.BUFFER_APPENDED,this.onBufferAppended,this),W.on(oe.Events.FRAG_BUFFERED,this.onFragBuffered,this),W.on(oe.Events.FRAG_LOADED,this.onFragLoaded,this)},L._unregisterListeners=function(){var W=this.hls;W.off(oe.Events.BUFFER_APPENDED,this.onBufferAppended,this),W.off(oe.Events.FRAG_BUFFERED,this.onFragBuffered,this),W.off(oe.Events.FRAG_LOADED,this.onFragLoaded,this)},L.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},L.getAppendedFrag=function(W,M){if(M===K.PlaylistLevelType.MAIN){var P=this.activeFragment,I=this.activeParts;if(!P)return null;if(I)for(var C=I.length;C--;){var d=I[C],f=d?d.end:P.appendedPTS;if(d.start<=W&&f!==void 0&&W<=f)return C>9&&(this.activeParts=I.slice(C-9)),d}else if(P.start<=W&&P.appendedPTS!==void 0&&W<=P.appendedPTS)return P}return this.getBufferedFrag(W,M)},L.getBufferedFrag=function(W,M){for(var P=this.fragments,I=Object.keys(P),C=I.length;C--;){var d=P[I[C]];if((d==null?void 0:d.body.type)===M&&d.buffered){var f=d.body;if(f.start<=W&&W<=f.end)return f}}return null},L.detectEvictedFragments=function(W,M,P){var I=this;Object.keys(this.fragments).forEach(function(C){var d=I.fragments[C];if(!d)return;if(!d.buffered){d.body.type===P&&I.removeFragment(d.body);return}var f=d.range[W];if(!f)return;f.time.some(function(p){var T=!I.isTimeBuffered(p.startPTS,p.endPTS,M);return T&&I.removeFragment(d.body),T})})},L.detectPartialFragments=function(W){var M=this,P=this.timeRanges,I=W.frag,C=W.part;if(!P||I.sn==="initSegment")return;var d=X(I),f=this.fragments[d];if(!f)return;Object.keys(P).forEach(function(p){var T=I.elementaryStreams[p];if(!T)return;var x=P[p],E=C!==null||T.partial===!0;f.range[p]=M.getBufferedTimes(I,C,E,x)}),f.backtrack=f.loaded=null,Object.keys(f.range).length?f.buffered=!0:this.removeFragment(f.body)},L.fragBuffered=function(W){var M=X(W),P=this.fragments[M];P&&(P.backtrack=P.loaded=null,P.buffered=!0)},L.getBufferedTimes=function(W,M,P,I){for(var C={time:[],partial:P},d=M?M.start:W.start,f=M?M.end:W.end,p=W.minEndPTS||f,T=W.maxStartPTS||d,x=0;x=E&&p<=k){C.time.push({startPTS:Math.max(d,I.start(x)),endPTS:Math.min(f,I.end(x))});break}else if(dE)C.partial=!0,C.time.push({startPTS:Math.max(d,I.start(x)),endPTS:Math.min(f,I.end(x))});else if(f<=E)break}return C},L.getPartialFragment=function(W){var M=null,P,I,C,d=0,f=this.bufferPadding,p=this.fragments;return Object.keys(p).forEach(function(T){var x=p[T];if(!x)return;q(x)&&(I=x.body.start-f,C=x.body.end+f,W>=I&&W<=C&&(P=Math.min(W-I,C-W),d<=P&&(M=x.body,d=P)))}),M},L.getState=function(W){var M=X(W),P=this.fragments[M];return P?P.buffered?q(P)?B.PARTIAL:B.OK:P.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},L.backtrack=function(W,M){var P=X(W),I=this.fragments[P];if(!I||I.backtrack)return null;var C=I.backtrack=M||I.loaded;return I.loaded=null,C},L.getBacktrackData=function(W){var M=X(W),P=this.fragments[M];if(P){var I,C=P.backtrack;if(C!=null&&(I=C.payload)!==null&&I!==void 0&&I.byteLength)return C;this.removeFragment(W)}return null},L.isTimeBuffered=function(W,M,P){for(var I,C,d=0;d=I&&M<=C)return!0;if(M<=I)return!1}return!1},L.onFragLoaded=function(W,M){var P=M.frag,I=M.part;if(P.sn==="initSegment"||P.bitrateTest||I)return;var C=X(P);this.fragments[C]={body:P,loaded:M,backtrack:null,buffered:!1,range:Object.create(null)}},L.onBufferAppended=function(W,M){var P=this,I=M.frag,C=M.part,d=M.timeRanges;if(I.type===K.PlaylistLevelType.MAIN)if(this.activeFragment=I,C){var f=this.activeParts;f||(this.activeParts=f=[]),f.push(C)}else this.activeParts=null;this.timeRanges=d,Object.keys(d).forEach(function(p){var T=d[p];if(P.detectEvictedFragments(p,T),!C)for(var x=0;xW&&I.removeFragment(f)}})},L.removeFragment=function(W){var M=X(W);W.stats.loaded=0,W.clearElementaryStreamInfo(),delete this.fragments[M]},L.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},V}();function q(V){var L,U;return V.buffered&&(((L=V.range.video)===null||L===void 0?void 0:L.partial)||((U=V.range.audio)===null||U===void 0?void 0:U.partial))}function X(V){return V.type+"_"+V.level+"_"+V.urlId+"_"+V.sn}},"./src/controller/gap-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"STALL_MINIMUM_DURATION_MS",function(){return q}),H.d(re,"MAX_START_GAP_JUMP",function(){return X}),H.d(re,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return V}),H.d(re,"SKIP_BUFFER_RANGE_START",function(){return L}),H.d(re,"default",function(){return U});var oe=H("./src/utils/buffer-helper.ts"),K=H("./src/errors.ts"),B=H("./src/events.ts"),se=H("./src/utils/logger.ts"),q=250,X=2,V=.1,L=.05,U=function(){function W(P,I,C,d){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=P,this.media=I,this.fragmentTracker=C,this.hls=d}var M=W.prototype;return M.destroy=function(){this.hls=this.fragmentTracker=this.media=null},M.poll=function(I){var C=this.config,d=this.media,f=this.stalled,p=d.currentTime,T=d.seeking,x=this.seeking&&!T,E=!this.seeking&&T;if(this.seeking=T,p!==I){if(this.moved=!0,f!==null){if(this.stallReported){var k=self.performance.now()-f;se.logger.warn("playback not stuck anymore @"+p+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((E||x)&&(this.stalled=null),d.paused||d.ended||d.playbackRate===0||!oe.BufferHelper.getBuffered(d).length)return;var w=oe.BufferHelper.bufferInfo(d,p,0),b=w.len>0,m=w.nextStart||0;if(!b&&!m)return;if(T){var v=w.len>X,g=!m||m-p>X&&!this.fragmentTracker.getPartialFragment(p);if(v||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var R,O=Math.max(m,w.start||0)-p,G=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,Z=G==null||((R=G.details)===null||R===void 0)?void 0:R.live,ee=Z?G.details.targetduration*2:X;if(O>0&&O<=ee){this._trySkipBufferHole(null);return}}var fe=self.performance.now();if(f===null){this.stalled=fe;return}var pe=fe-f;!T&&pe>=q&&this._reportStall(w.len);var xe=oe.BufferHelper.bufferInfo(d,p,C.maxBufferHole);this._tryFixBufferStall(xe,pe)},M._tryFixBufferStall=function(I,C){var d=this.config,f=this.fragmentTracker,p=this.media,T=p.currentTime,x=f.getPartialFragment(T);if(x){var E=this._trySkipBufferHole(x);if(E)return}I.len>d.maxBufferHole&&C>d.highBufferWatchdogPeriod*1e3&&(se.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},M._reportStall=function(I){var C=this.hls,d=this.media,f=this.stallReported;f||(this.stallReported=!0,se.logger.warn("Playback stalling at @"+d.currentTime+" due to low buffer (buffer="+I+")"),C.trigger(B.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:I}))},M._trySkipBufferHole=function(I){for(var C=this.config,d=this.hls,f=this.media,p=f.currentTime,T=0,x=oe.BufferHelper.getBuffered(f),E=0;E=T&&p.05&&this.forwardBufferLength>1){var E=Math.min(2,Math.max(1,d)),k=Math.round(2/(1+Math.exp(-.75*p-this.edgeStalled))*20)/20;W.playbackRate=Math.min(E,Math.max(1,k))}else W.playbackRate!==1&&W.playbackRate!==0&&(W.playbackRate=1)},L.estimateLiveEdge=function(){var W=this.levelDetails;return W===null?null:W.edge+W.age},L.computeLatency=function(){var W=this.estimateLiveEdge();return W===null?null:W-this.currentTime},q(V,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var W=this.config,M=this.levelDetails;return W.liveMaxLatencyDuration!==void 0?W.liveMaxLatencyDuration:M?W.liveMaxLatencyDurationCount*M.targetduration:0}},{key:"targetLatency",get:function(){var W=this.levelDetails;if(W===null)return null;var M=W.holdBack,P=W.partHoldBack,I=W.targetduration,C=this.config,d=C.liveSyncDuration,f=C.liveSyncDurationCount,p=C.lowLatencyMode,T=this.hls.userConfig,x=p&&P||M;(T.liveSyncDuration||T.liveSyncDurationCount||x===0)&&(x=d!==void 0?d:f*I);var E=I,k=1;return x+Math.min(this.stallCount*k,E)}},{key:"liveSyncPosition",get:function(){var W=this.estimateLiveEdge(),M=this.targetLatency,P=this.levelDetails;if(W===null||M===null||P===null)return null;var I=P.edge,C=W-M-this.edgeStalled,d=I-P.totalduration,f=I-(this.config.lowLatencyMode&&P.partTarget||P.targetduration);return Math.min(Math.max(d,C),f)}},{key:"drift",get:function(){var W=this.levelDetails;return W===null?1:W.drift}},{key:"edgeStalled",get:function(){var W=this.levelDetails;if(W===null)return 0;var M=(this.config.lowLatencyMode&&W.partTarget||W.targetduration)*3;return Math.max(W.age-M,0)}},{key:"forwardBufferLength",get:function(){var W=this.media,M=this.levelDetails;if(!W||!M)return 0;var P=W.buffered.length;return P?W.buffered.end(P-1):M.edge-this.currentTime}}]),V}()},"./src/controller/level-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return C});var oe=H("./src/types/level.ts"),K=H("./src/events.ts"),B=H("./src/errors.ts"),se=H("./src/utils/codecs.ts"),q=H("./src/controller/level-helper.ts"),X=H("./src/controller/base-playlist-controller.ts"),V=H("./src/types/loader.ts");function L(){return L=Object.assign||function(d){for(var f=1;f0){m=k[0].bitrate,k.sort(function(pe,xe){return pe.bitrate-xe.bitrate}),this._levels=k;for(var Z=0;Zthis.hls.config.fragLoadingMaxRetry&&(v=E.frag.level)):v=E.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(m=!1),v=k.level),b=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:v=E.level,b=!0;break}v!==void 0&&this.recoverLevel(E,v,b,m)},p.recoverLevel=function(x,E,k,w){var b=x.details,m=this._levels[E];if(m.loadError++,k){var v=this.retryLoadingOrFail(x);if(v)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var g=m.url.length;if(g>1&&m.loadError1){var w=(E.urlId+1)%k;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(b){b.urlId=w}),this.level=x}},p.onFragLoaded=function(x,E){var k=E.frag;if(k!==void 0&&k.type===V.PlaylistLevelType.MAIN){var w=this._levels[k.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},p.onLevelLoaded=function(x,E){var k,w=E.level,b=E.details,m=this._levels[w];if(!m){var v;this.warn("Invalid level index "+w),(v=E.deliveryDirectives)!==null&&v!==void 0&&v.skip&&(b.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(w,E,m.details)):(k=E.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(b.deltaUpdateFailed=!0)},p.onAudioTrackSwitched=function(x,E){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var w=-1,b=this.hls.audioTracks[E.id].groupId,m=0;m0){var w=k.urlId,b=k.url[w];if(x)try{b=x.addDirectives(b)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+E+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+w+" "+b),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:b,level:E,id:w,deliveryDirectives:x||null})}},p.removeLevel=function(x,E){var k=function(m,v){return v!==E},w=this._levels.filter(function(b,m){return m!==x?!0:b.url.length>1&&E!==void 0?(b.url=b.url.filter(k),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(k)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(k)),b.urlId=0,!0):!1}).map(function(b,m){var v=b.details;return v!=null&&v.fragments&&v.fragments.forEach(function(g){g.level=m}),b});this._levels=w,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:w})},W(f,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var E,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===x&&(E=k[x])!==null&&E!==void 0&&E.details)return;if(x<0||x>=k.length){var w=x<0;if(this.hls.trigger(K.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:w,reason:"invalid level idx"}),w)return;x=Math.min(x,k.length-1)}this.clearTimer();var b=this.currentLevelIndex,m=k[b],v=k[x];this.log("switching to level "+x+" from "+b),this.currentLevelIndex=x;var g=L({},v,{level:x,maxBitrate:v.maxBitrate,uri:v.uri,urlId:v.urlId});delete g._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,g);var R=v.details;if(!R||R.live){var O=this.switchParams(v.uri,m==null?void 0:m.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),f}(X.default)},"./src/controller/level-helper.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"addGroupId",function(){return B}),H.d(re,"assignTrackIdsByGroup",function(){return se}),H.d(re,"updatePTS",function(){return q}),H.d(re,"updateFragPTSDTS",function(){return V}),H.d(re,"mergeDetails",function(){return L}),H.d(re,"mapPartIntersection",function(){return U}),H.d(re,"mapFragmentIntersection",function(){return W}),H.d(re,"adjustSliding",function(){return M}),H.d(re,"addSliding",function(){return P}),H.d(re,"computeReloadInterval",function(){return I}),H.d(re,"getFragmentWithSN",function(){return C}),H.d(re,"getPartWith",function(){return d});var oe=H("./src/polyfills/number.ts"),K=H("./src/utils/logger.ts");function B(f,p,T){switch(p){case"audio":f.audioGroupIds||(f.audioGroupIds=[]),f.audioGroupIds.push(T);break;case"text":f.textGroupIds||(f.textGroupIds=[]),f.textGroupIds.push(T);break}}function se(f){var p={};f.forEach(function(T){var x=T.groupId||"";T.id=p[x]=p[x]||0,p[x]++})}function q(f,p,T){var x=f[p],E=f[T];X(x,E)}function X(f,p){var T=p.startPTS;if(Object(oe.isFiniteNumber)(T)){var x=0,E;p.sn>f.sn?(x=T-f.start,E=f):(x=f.start-T,E=p),E.duration!==x&&(E.duration=x)}else if(p.sn>f.sn){var k=f.cc===p.cc;k&&f.minEndPTS?p.start=f.start+(f.minEndPTS-f.start):p.start=f.start+f.duration}else p.start=Math.max(f.start-p.duration,0)}function V(f,p,T,x,E,k){var w=x-T;w<=0&&(K.logger.warn("Fragment should have a positive duration",p),x=T+p.duration,k=E+p.duration);var b=T,m=x,v=p.startPTS,g=p.endPTS;if(Object(oe.isFiniteNumber)(v)){var R=Math.abs(v-T);Object(oe.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(R,p.deltaPTS):p.deltaPTS=R,b=Math.max(T,v),T=Math.min(T,v),E=Math.min(E,p.startDTS),m=Math.min(x,g),x=Math.max(x,g),k=Math.max(k,p.endDTS)}p.duration=x-T;var O=T-p.start;p.appendedPTS=x,p.start=p.startPTS=T,p.maxStartPTS=b,p.startDTS=E,p.endPTS=x,p.minEndPTS=m,p.endDTS=k;var G=p.sn;if(!f||Gf.endSN)return 0;var Z,ee=G-f.startSN,fe=f.fragments;for(fe[ee]=p,Z=ee;Z>0;Z--)X(fe[Z],fe[Z-1]);for(Z=ee;Z=0;E--){var k=x[E].initSegment;if(k){T=k;break}}f.fragmentHint&&delete f.fragmentHint.endPTS;var w=0,b;if(W(f,p,function(Z,ee){Z.relurl&&(w=Z.cc-ee.cc),Object(oe.isFiniteNumber)(Z.startPTS)&&Object(oe.isFiniteNumber)(Z.endPTS)&&(ee.start=ee.startPTS=Z.startPTS,ee.startDTS=Z.startDTS,ee.appendedPTS=Z.appendedPTS,ee.maxStartPTS=Z.maxStartPTS,ee.endPTS=Z.endPTS,ee.endDTS=Z.endDTS,ee.minEndPTS=Z.minEndPTS,ee.duration=Z.endPTS-Z.startPTS,ee.duration&&(b=ee),p.PTSKnown=p.alignedSliding=!0),ee.elementaryStreams=Z.elementaryStreams,ee.loader=Z.loader,ee.stats=Z.stats,ee.urlId=Z.urlId,Z.initSegment&&(ee.initSegment=Z.initSegment,T=Z.initSegment)}),T){var m=p.fragmentHint?p.fragments.concat(p.fragmentHint):p.fragments;m.forEach(function(Z){var ee;(!Z.initSegment||Z.initSegment.relurl===((ee=T)===null||ee===void 0?void 0:ee.relurl))&&(Z.initSegment=T)})}if(p.skippedSegments&&(p.deltaUpdateFailed=p.fragments.some(function(Z){return!Z}),p.deltaUpdateFailed)){K.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var v=p.skippedSegments;v--;)p.fragments.shift();p.startSN=p.fragments[0].sn,p.startCC=p.fragments[0].cc}var g=p.fragments;if(w){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var R=0;R=x.length)return;P(p,x[T].start)}function P(f,p){if(p){for(var T=f.fragments,x=f.skippedSegments;x0&&E0&&m===-1&&(this.log("Override startPosition with lastCurrentTime @"+v.toFixed(3)),m=v),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,E.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var m,v=this.levels,g=this.level,R=v==null||((m=v[g])===null||m===void 0)?void 0:m.details;if(R&&(!R.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(R))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var O,G=self.performance.now(),Z=this.retryDate;(!Z||G>=Z||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){E.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var m,v,g=this.hls,R=this.levelLastLoaded,O=this.levels,G=this.media,Z=g.config,ee=g.nextLoadLevel;if(R===null||!G&&(this.startFragRequested||!Z.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[ee])return;var fe=O[ee];this.level=g.nextLoadLevel=ee;var pe=fe.details;if(!pe||this.state===K.State.WAITING_LEVEL||pe.live&&this.levelLastLoaded!==ee){this.state=K.State.WAITING_LEVEL;return}var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:G,V.PlaylistLevelType.MAIN);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(fe.maxBitrate);if(Ce>=be)return;if(this._streamEnded(xe,pe)){var Oe={};this.altAudio&&(Oe.type="video"),this.hls.trigger(se.Events.BUFFER_EOS,Oe),this.state=K.State.ENDED;return}var We=xe.end,Ue=this.getNextFragment(We,pe);if(this.couldBacktrack&&!this.fragPrevious&&Ue&&Ue.sn!=="initSegment"){var ct=Ue.sn-pe.startSN;ct>1&&(Ue=pe.fragments[ct-1],this.fragmentTracker.removeFragment(Ue))}if(Ue&&this.fragmentTracker.getState(Ue)===X.FragmentState.OK&&this.nextLoadPosition>We){var Ge=this.audioOnly&&!this.altAudio?L.ElementaryStreamTypes.AUDIO:L.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(G,Ge,V.PlaylistLevelType.MAIN),Ue=this.getNextFragment(this.nextLoadPosition,pe)}if(!Ue)return;Ue.initSegment&&!Ue.initSegment.data&&!this.bitrateTest&&(Ue=Ue.initSegment),((m=Ue.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((v=Ue.decryptdata)!==null&&v!==void 0&&v.key)?this.loadKey(Ue,pe):this.loadFragment(Ue,pe,We)},w.loadFragment=function(m,v,g){var R,O=this.fragmentTracker.getState(m);if(this.fragCurrent=m,O===X.FragmentState.BACKTRACKED){var G=this.fragmentTracker.getBacktrackData(m);if(G){this._handleFragmentLoadProgress(G),this._handleFragmentLoadComplete(G);return}else O=X.FragmentState.NOT_LOADED}O===X.FragmentState.NOT_LOADED||O===X.FragmentState.PARTIAL?m.sn==="initSegment"?this._loadInitSegment(m):this.bitrateTest?(m.bitrateTest=!0,this.log("Fragment "+m.sn+" of level "+m.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(m)):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,m,v,g)):O===X.FragmentState.APPENDING?this.reduceMaxBufferLength(m.duration)&&this.fragmentTracker.removeFragment(m):((R=this.media)===null||R===void 0?void 0:R.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(m){var v=this.fragmentTracker.getAppendedFrag(m,V.PlaylistLevelType.MAIN);return v&&"fragment"in v?v.fragment:v},w.getBufferedFrag=function(m){return this.fragmentTracker.getBufferedFrag(m,V.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(m){return m?this.getBufferedFrag(m.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var m=this.levels,v=this.media;if(v!=null&&v.readyState){var g,R=this.getAppendedFrag(v.currentTime);if(R&&R.start>1&&this.flushMainBuffer(0,R.start-1),!v.paused&&m){var O=this.hls.nextLoadLevel,G=m[O],Z=this.fragLastKbps;Z&&this.fragCurrent?g=this.fragCurrent.duration*G.maxBitrate/(1e3*Z)+1:g=0}else g=0;var ee=this.getBufferedFrag(v.currentTime+g);if(ee){var fe=this.followingBufferedFrag(ee);if(fe){this.abortCurrentFrag();var pe=fe.maxStartPTS?fe.maxStartPTS:fe.start,xe=fe.duration,Ce=Math.max(ee.end,pe+Math.min(Math.max(xe-this.config.maxFragLookUpTolerance,xe*.5),xe*.75));this.flushMainBuffer(Ce,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var m=this.fragCurrent;this.fragCurrent=null,m!=null&&m.loader&&m.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(m,v){E.prototype.flushMainBuffer.call(this,m,v,this.altAudio?"video":null)},w.onMediaAttached=function(m,v){E.prototype.onMediaAttached.call(this,m,v);var g=v.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new M.default(this.config,g,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var m=this.media;m&&(m.removeEventListener("playing",this.onvplaying),m.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),E.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var m=this.media,v=m?m.currentTime:null;Object(oe.isFiniteNumber)(v)&&this.log("Media seeked to "+v.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(se.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(m,v){var g=!1,R=!1,O;v.levels.forEach(function(G){O=G.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(g=!0),O.indexOf("mp4a.40.5")!==-1&&(R=!0))}),this.audioCodecSwitch=g&&R&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=v.levels,this.startFragRequested=!1},w.onLevelLoading=function(m,v){var g=this.levels;if(!g||this.state!==K.State.IDLE)return;var R=g[v.level];(!R.details||R.details.live&&this.levelLastLoaded!==v.level||this.waitForCdnTuneIn(R.details))&&(this.state=K.State.WAITING_LEVEL)},w.onLevelLoaded=function(m,v){var g,R=this.levels,O=v.level,G=v.details,Z=G.totalduration;if(!R){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+G.startSN+","+G.endSN+"], cc ["+G.startCC+", "+G.endCC+"] duration:"+Z);var ee=this.fragCurrent;ee&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&(ee.level!==v.level&&ee.loader&&(this.state=K.State.IDLE,ee.loader.abort()));var fe=R[O],pe=0;if(G.live||(g=fe.details)!==null&&g!==void 0&&g.live){if(G.fragments[0]||(G.deltaUpdateFailed=!0),G.deltaUpdateFailed)return;pe=this.alignPlaylists(G,fe.details)}if(fe.details=G,this.levelLastLoaded=O,this.hls.trigger(se.Events.LEVEL_UPDATED,{details:G,level:O}),this.state===K.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(G))return;this.state=K.State.IDLE}this.startFragRequested?G.live&&this.synchronizeToLiveEdge(G):this.setStartPosition(G,pe),this.tick()},w._handleFragmentLoadProgress=function(m){var v,g=m.frag,R=m.part,O=m.payload,G=this.levels;if(!G){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var Z=G[g.level],ee=Z.details;if(!ee){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var fe=Z.videoCodec,pe=ee.PTSKnown||!ee.live,xe=(v=g.initSegment)===null||v===void 0?void 0:v.data,Ce=this._getAudioCodec(Z),be=this.transmuxer=this.transmuxer||new U.default(this.hls,V.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Oe=R?R.index:-1,We=Oe!==-1,Ue=new W.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,O.byteLength,Oe,We),ct=this.initPTS[g.cc];be.push(O,xe,Ce,fe,g,R,ee.totalduration,pe,Ue,ct)},w.onAudioTrackSwitching=function(m,v){var g=this.altAudio,R=!!v.url,O=v.id;if(!R){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var G=this.fragCurrent;G!=null&&G.loader&&(this.log("Switching to main audio track, cancel main fragment load"),G.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var Z=this.hls;g&&Z.trigger(se.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),Z.trigger(se.Events.AUDIO_TRACK_SWITCHED,{id:O})}},w.onAudioTrackSwitched=function(m,v){var g=v.id,R=!!this.hls.audioTracks[g].url;if(R){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=R,this.tick()},w.onBufferCreated=function(m,v){var g=v.tracks,R,O,G=!1;for(var Z in g){var ee=g[Z];if(ee.id==="main"){if(O=Z,R=ee,Z==="video"){var fe=g[Z];fe&&(this.videoBuffer=fe.buffer)}}else G=!0}G&&R?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=R.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(m,v){var g=v.frag,R=v.part;if(g&&g.type!==V.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(R?" p: "+R.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var O=R?R.stats:g.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,R)},w.onError=function(m,v){switch(v.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.MAIN,v);break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==K.State.ERROR&&(v.fatal?(this.warn(""+v.details),this.state=K.State.ERROR):!v.levelRetry&&this.state===K.State.WAITING_LEVEL&&(this.state=K.State.IDLE));break;case P.ErrorDetails.BUFFER_FULL_ERROR:if(v.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var g=!0,R=this.getFwdBufferInfo(this.media,V.PlaylistLevelType.MAIN);R&&R.len>.5&&(g=!this.reduceMaxBufferLength(R.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var m=this.media,v=this.gapController;if(!m||!v||!m.readyState)return;var g=q.BufferHelper.getBuffered(m);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):v.poll(this.lastCurrentTime),this.lastCurrentTime=m.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(m,v){var g=v.type;if(g!==L.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var R=(g===L.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(R,g,V.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(m,v){this.levels=v.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var m=this.media,v=m.currentTime,g=this.startPosition;if(g>=0&&v0&&(G1&&m.seeking===!1){var g=m.currentTime;if(q.BufferHelper.isBuffered(m,g)?v=this.getAppendedFrag(g):q.BufferHelper.isBuffered(m,g+.1)&&(v=this.getAppendedFrag(g+.1)),v){var R=this.fragPlaying,O=v.level;(!R||v.sn!==R.sn||R.level!==O||v.urlId!==R.urlId)&&(this.hls.trigger(se.Events.FRAG_CHANGED,{frag:v}),(!R||R.level!==O)&&this.hls.trigger(se.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=v)}}},d(k,[{key:"nextLevel",get:function(){var m=this.nextBufferedFrag;return m?m.level:-1}},{key:"currentLevel",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);if(v)return v.level}return-1}},{key:"nextBufferedFrag",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);return this.followingBufferedFrag(v)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(K.default)},"./src/controller/subtitle-stream-controller.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"SubtitleStreamController",function(){return f});var oe=H("./src/events.ts"),K=H("./src/utils/logger.ts"),B=H("./src/utils/buffer-helper.ts"),se=H("./src/controller/fragment-finders.ts"),q=H("./src/utils/discontinuities.ts"),X=H("./src/controller/level-helper.ts"),V=H("./src/controller/fragment-tracker.ts"),L=H("./src/controller/base-stream-controller.ts"),U=H("./src/types/loader.ts"),W=H("./src/types/level.ts");function M(p,T){for(var x=0;x=v[O].start&&R<=v[O].end){g=v[O];break}var G=b.start+b.duration;g?g.end=G:(g={start:R,end:G},v.push(g)),this.fragmentTracker.fragBuffered(b)},x.onBufferFlushing=function(k,w){var b=w.startOffset,m=w.endOffset;if(b===0&&m!==Number.POSITIVE_INFINITY){var v=this.currentTrackId,g=this.levels;if(!g.length||!g[v]||!g[v].details)return;var R=g[v].details,O=R.targetduration,G=m-O;if(G<=0)return;w.endOffsetSubtitles=Math.max(0,G),this.tracksBuffered.forEach(function(Z){for(var ee=0;ee=R.length||v!==g||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,m.live||(b=O.details)!==null&&b!==void 0&&b.live){var G=this.mainDetails;if(m.deltaUpdateFailed||!G)return;var Z=G.fragments[0];if(!O.details)m.hasProgramDateTime&&G.hasProgramDateTime?Object(q.alignMediaPlaylistByPDT)(m,G):Z&&Object(X.addSliding)(m,Z.start);else{var ee=this.alignPlaylists(m,O.details);ee===0&&Z&&Object(X.addSliding)(m,Z.start)}}if(O.details=m,this.levelLastLoaded=v,this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===L.State.IDLE){var fe=Object(se.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);fe||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},x._handleFragmentLoadComplete=function(k){var w=k.frag,b=k.payload,m=w.decryptdata,v=this.hls;if(this.fragContextChanged(w))return;if(b&&b.byteLength>0&&m&&m.key&&m.iv&&m.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),m.key.buffer,m.iv.buffer).then(function(R){var O=performance.now();v.trigger(oe.Events.FRAG_DECRYPTED,{frag:w,payload:R,stats:{tstart:g,tdecrypt:O}})})}},x.doTick=function(){if(!this.media){this.state=L.State.IDLE;return}if(this.state===L.State.IDLE){var k,w=this.currentTrackId,b=this.levels;if(!b.length||!b[w]||!b[w].details)return;var m=b[w].details,v=m.targetduration,g=this.config,R=this.media,O=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,R.currentTime-v,g.maxBufferHole),G=O.end,Z=O.len,ee=this.getMaxBufferLength()+v;if(Z>ee)return;console.assert(m,"Subtitle track details are defined on idle subtitle stream controller tick");var fe=m.fragments,pe=fe.length,xe=m.edge,Ce,be=this.fragPrevious;if(G-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},I.pollTrackChange=function(d){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,d)},I.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var d=W(this.media.textTracks);d.forEach(function(f){Object(K.clearCurrentCues)(f)}),this.subtitleTrack=-1,this.media=null},I.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},I.onManifestParsed=function(d,f){this.tracks=f.subtitleTracks},I.onSubtitleTrackLoaded=function(d,f){var p=f.id,T=f.details,x=this.trackId,E=this.tracksInGroup[x];if(!E){this.warn("Invalid subtitle track id "+p);return}var k=E.details;E.details=f.details,this.log("subtitle track "+p+" loaded ["+T.startSN+"-"+T.endSN+"]"),p===this.trackId&&(this.retryCount=0,this.playlistLoaded(p,f,k))},I.onLevelLoading=function(d,f){this.switchLevel(f.level)},I.onLevelSwitching=function(d,f){this.switchLevel(f.level)},I.switchLevel=function(d){var f=this.hls.levels[d];if(!(f!=null&&f.textGroupIds))return;var p=f.textGroupIds[f.urlId];if(this.groupId!==p){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(w){return!p||w.groupId===p});this.tracksInGroup=x;var E=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=p;var k={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+p+'" group-id'),this.hls.trigger(oe.Events.SUBTITLE_TRACKS_UPDATED,k),E!==-1&&this.setSubtitleTrack(E,T)}},I.findTrackId=function(d){for(var f=this.tracksInGroup,p=0;p=T.length)return;this.clearTimer();var x=T[d];if(this.log("Switching to subtitle track "+d),this.trackId=d,x){var E=x.id,k=x.groupId,w=k===void 0?"":k,b=x.name,m=x.type,v=x.url;this.hls.trigger(oe.Events.SUBTITLE_TRACK_SWITCH,{id:E,groupId:w,name:b,type:m,url:v});var g=this.switchParams(x.url,f==null?void 0:f.details);this.loadPlaylist(g)}else this.hls.trigger(oe.Events.SUBTITLE_TRACK_SWITCH,{id:d})},I.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var d=-1,f=W(this.media.textTracks),p=0;p=0&&(m[0]=Math.min(m[0],T),m[1]=Math.max(m[1],x),w=!0,v/(x-T)>.5))return}if(w||k.push([T,x]),this.config.renderTextTracksNatively){var g=this.captionsTracks[p];this.Cues.newCue(g,T,x,E)}else{var R=this.Cues.newCue(null,T,x,E);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:R,track:p})}},d.onInitPtsFound=function(p,T){var x=this,E=T.frag,k=T.id,w=T.initPTS,b=T.timescale,m=this.unparsedVttFrags;k==="main"&&(this.initPTS[E.cc]=w,this.timescale[E.cc]=b),m.length&&(this.unparsedVttFrags=[],m.forEach(function(v){x.onFragLoaded(K.Events.FRAG_LOADED,v)}))},d.getExistingTrack=function(p){var T=this.media;if(T)for(var x=0;x>>8^b&255^99,V[E]=b,L[b]=E;var m=x[E],v=x[m],g=x[v],R=x[b]*257^b*16843008;W[E]=R<<24|R>>>8,M[E]=R<<16|R>>>16,P[E]=R<<8|R>>>24,I[E]=R,R=g*16843009^v*65537^m*257^E*16843008,d[b]=R<<24|R>>>8,f[b]=R<<16|R>>>16,p[b]=R<<8|R>>>24,T[b]=R,E?(E=m^x[x[x[g^m]]],k^=x[x[k]]):E=k=1}},q.expandKey=function(V){for(var L=this.uint8ArrayToUint32Array_(V),U=!0,W=0;W>>6)+1;var R=(p[T+2]&60)>>>2;if(R>g.length-1){f.trigger(B.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+R});return}return w=(p[T+2]&1)<<2,w|=(p[T+3]&192)>>>6,oe.logger.log("manifest codec:"+x+", ADTS type:"+E+", samplingIndex:"+R),/firefox/i.test(m)?R>=6?(E=5,b=new Array(4),k=R-3):(E=2,b=new Array(2),k=R):m.indexOf("android")!==-1?(E=2,b=new Array(2),k=R):(E=5,b=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&R>=6?k=R-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(R>=6&&w===1||/vivaldi/i.test(m))||!x&&w===1)&&(E=2,b=new Array(2)),k=R)),b[0]=E<<3,b[0]|=(R&14)>>1,b[1]|=(R&1)<<7,b[1]|=w<<3,E===5&&(b[1]|=(k&14)>>1,b[2]=(k&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:g[R],channelCount:w,codec:"mp4a.40."+E,manifestCodec:v}}function q(f,p){return f[p]===255&&(f[p+1]&246)===240}function X(f,p){return f[p+1]&1?7:9}function V(f,p){return(f[p+3]&3)<<11|f[p+4]<<3|(f[p+5]&224)>>>5}function L(f,p){return p+5=f.length)return!1;var x=V(f,p);if(x<=T)return!1;var E=p+x;return E===f.length||U(f,E)}return!1}function P(f,p,T,x,E){if(!f.samplerate){var k=se(p,T,x,E);if(!k)return;f.config=k.config,f.samplerate=k.samplerate,f.channelCount=k.channelCount,f.codec=k.codec,f.manifestCodec=k.manifestCodec,oe.logger.log("parsed codec:"+f.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function I(f){return 1024*9e4/f}function C(f,p,T,x,E){var k=X(f,p),w=V(f,p);if(w-=k,w>0){var b=T+x*E;return{headerLength:k,frameLength:w,stamp:b}}}function d(f,p,T,x,E){var k=I(f.samplerate),w=C(p,T,x,E,k);if(w){var b=w.frameLength,m=w.headerLength,v=w.stamp,g=m+b,R=Math.max(0,T+g-p.length),O;R?(O=new Uint8Array(g-m),O.set(p.subarray(T+m,p.length),0)):O=p.subarray(T+m,T+g);var G={unit:O,pts:v};return R||f.samples.push(G),{sample:G,length:g,missing:R}}}},"./src/demux/base-audio-demuxer.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"initPTSFn",function(){return V});var oe=H("./src/polyfills/number.ts"),K=H("./src/demux/id3.ts"),B=H("./src/demux/dummy-demuxed-track.ts"),se=H("./src/utils/mp4-tools.ts"),q=H("./src/utils/typed-array.ts"),X=function(){function L(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var U=L.prototype;return U.resetInitSegment=function(M,P,I){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},U.resetTimeStamp=function(){},U.resetContiguity=function(){},U.canParse=function(M,P){return!1},U.appendFrame=function(M,P,I){},U.demux=function(M,P){this.cachedData&&(M=Object(se.appendUint8Array)(this.cachedData,M),this.cachedData=null);var I=K.getID3Data(M,0),C=I?I.length:0,d,f,p=this._audioTrack,T=this._id3Track,x=I?K.getTimeStamp(I):void 0,E=M.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=V(x,P)),I&&I.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:I}),f=this.initPTS;CX?(this.word<<=X,this.bitsAvailable-=X):(X-=this.bitsAvailable,V=X>>3,X-=V>>3,this.bytesAvailable-=V,this.loadWord(),this.word<<=X,this.bitsAvailable-=X)},se.readBits=function(X){var V=Math.min(this.bitsAvailable,X),L=this.word>>>32-V;return X>32&&oe.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=V,this.bitsAvailable>0?this.word<<=V:this.bytesAvailable>0&&this.loadWord(),V=X-V,V>0&&this.bitsAvailable?L<>>X)!==0)return this.word<<=X,this.bitsAvailable-=X,X;return this.loadWord(),X+this.skipLZ()},se.skipUEG=function(){this.skipBits(1+this.skipLZ())},se.skipEG=function(){this.skipBits(1+this.skipLZ())},se.readUEG=function(){var X=this.skipLZ();return this.readBits(X+1)-1},se.readEG=function(){var X=this.readUEG();return 1&X?1+X>>>1:-1*(X>>>1)},se.readBoolean=function(){return this.readBits(1)===1},se.readUByte=function(){return this.readBits(8)},se.readUShort=function(){return this.readBits(16)},se.readUInt=function(){return this.readBits(32)},se.skipScalingList=function(X){for(var V=8,L=8,U,W=0;W0?E.subarray(w,w+b):void 0},se=function(E,k){var w=0;return w=(E[k]&127)<<21,w|=(E[k+1]&127)<<14,w|=(E[k+2]&127)<<7,w|=E[k+3]&127,w},q=function(E,k){return oe(E,k)&&se(E,k+6)+10<=E.length-k},X=function(E){for(var k=U(E),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:G+=String.fromCharCode(g);break;case 12:case 13:R=E[Z++],G+=String.fromCharCode((g&31)<<6|R&63);break;case 14:R=E[Z++],O=E[Z++],G+=String.fromCharCode((g&15)<<12|(R&63)<<6|(O&63)<<0);break;default:}}return G},f={decodeTextFrame:P},p;function T(){return!p&&typeof self.TextDecoder!="undefined"&&(p=new self.TextDecoder("utf-8")),p}},"./src/demux/mp3demuxer.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/demux/base-audio-demuxer.ts"),K=H("./src/demux/id3.ts"),B=H("./src/utils/logger.ts"),se=H("./src/demux/mpegaudio.ts");function q(L,U){L.prototype=Object.create(U.prototype),L.prototype.constructor=L,X(L,U)}function X(L,U){return X=Object.setPrototypeOf||function(M,P){return M.__proto__=P,M},X(L,U)}var V=function(L){q(U,L);function U(){return L.apply(this,arguments)||this}var W=U.prototype;return W.resetInitSegment=function(P,I,C){L.prototype.resetInitSegment.call(this,P,I,C),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:P,duration:C,inputTimeScale:9e4,dropped:0}},U.probe=function(P){if(!P)return!1;for(var I=K.getID3Data(P,0)||[],C=I.length,d=P.length;C0},q.demux=function(V){var L=V,U=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(L=Object(oe.appendUint8Array)(this.remainderData,V));var W=Object(oe.segmentValidRange)(L);this.remainderData=W.remainder,U.samples=W.valid||new Uint8Array}else U.samples=L;return{audioTrack:Object(K.dummyTrack)(),avcTrack:U,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.flush=function(){var V=Object(K.dummyTrack)();return V.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(K.dummyTrack)(),avcTrack:V,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.demuxSampleAes=function(V,L,U){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},q.destroy=function(){},se}();B.minProbeByteLength=1024,re.default=B},"./src/demux/mpegaudio.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"appendFrame",function(){return X}),H.d(re,"parseHeader",function(){return V}),H.d(re,"isHeaderPattern",function(){return L}),H.d(re,"isHeader",function(){return U}),H.d(re,"canParse",function(){return W}),H.d(re,"probe",function(){return M});var oe=null,K=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],se=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],q=[0,1,1,4];function X(P,I,C,d,f){if(C+24>I.length)return;var p=V(I,C);if(p&&C+p.frameLength<=I.length){var T=p.samplesPerFrame*9e4/p.sampleRate,x=d+f*T,E={unit:I.subarray(C,C+p.frameLength),pts:x,dts:x};return P.config=[],P.channelCount=p.channelCount,P.samplerate=p.sampleRate,P.samples.push(E),{sample:E,length:p.frameLength,missing:0}}}function V(P,I){var C=P[I+1]>>3&3,d=P[I+1]>>1&3,f=P[I+2]>>4&15,p=P[I+2]>>2&3;if(C!==1&&f!==0&&f!==15&&p!==3){var T=P[I+2]>>1&1,x=P[I+3]>>6,E=C===3?3-d:d===3?3:4,k=K[E*14+f-1]*1e3,w=C===3?0:C===2?1:2,b=B[w*3+p],m=x===3?1:2,v=se[C][d],g=q[d],R=v*8*g,O=Math.floor(v*k/b+T)*g;if(oe===null){var G=navigator.userAgent||"",Z=G.match(/Chrome\/(\d+)/i);oe=Z?parseInt(Z[1]):0}var ee=!!oe&&oe<=87;return ee&&d===2&&k>=224e3&&x===0&&(P[I+3]=P[I+3]|128),{sampleRate:b,channelCount:m,frameLength:O,samplesPerFrame:R}}}function L(P,I){return P[I]===255&&(P[I+1]&224)===224&&(P[I+1]&6)!==0}function U(P,I){return I+1=V.length){U();return}if(V[L].unit.length<32)continue;var W=this.decrypter.isSync();if(this.decryptAacSample(V,L,U,W),!W)return}},q.getAvcEncryptedData=function(V){for(var L=Math.floor((V.length-48)/160)*16+16,U=new Int8Array(L),W=0,M=32;M<=V.length-16;M+=160,W+=16)U.set(V.subarray(M,M+16),W);return U},q.getAvcDecryptedUnit=function(V,L){for(var U=new Uint8Array(L),W=0,M=32;M<=V.length-16;M+=160,W+=16)V.set(U.subarray(W,W+16),M);return V},q.decryptAvcSample=function(V,L,U,W,M,P){var I=Object(K.discardEPB)(M.data),C=this.getAvcEncryptedData(I),d=this;this.decryptBuffer(C.buffer,function(f){M.data=d.getAvcDecryptedUnit(I,f),P||d.decryptAvcSamples(V,L,U+1,W)})},q.decryptAvcSamples=function(V,L,U,W){if(V instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;L++,U=0){if(L>=V.length){W();return}for(var M=V[L].units;!(U>=M.length);U++){var P=M[U];if(P.data.length<=48||P.type!==1&&P.type!==5)continue;var I=this.decrypter.isSync();if(this.decryptAvcSample(V,L,U,W,P,I),!I)return}}},se}();re.default=B},"./src/demux/transmuxer-interface.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return M});var oe=H("./node_modules/webworkify-webpack/index.js"),K=H.n(oe),B=H("./src/events.ts"),se=H("./src/demux/transmuxer.ts"),q=H("./src/utils/logger.ts"),X=H("./src/errors.ts"),V=H("./src/utils/mediasource-helper.ts"),L=H("./node_modules/eventemitter3/index.js"),U=H.n(L),W=Object(V.getMediaSource)()||{isTypeSupported:function(){return!1}},M=function(){function P(C,d,f,p){var T=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=C,this.id=d,this.onTransmuxComplete=f,this.onFlush=p;var x=C.config,E=function(v,g){g=g||{},g.frag=T.frag,g.id=T.id,C.trigger(v,g)};this.observer=new L.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,E),this.observer.on(B.Events.ERROR,E);var k={mp4:W.isTypeSupported("video/mp4"),mpeg:W.isTypeSupported("audio/mpeg"),mp3:W.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){q.logger.log("demuxing in webworker");var b;try{b=this.worker=oe("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(m){C.trigger(B.Events.ERROR,{type:X.ErrorTypes.OTHER_ERROR,details:X.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(m.message+" ("+m.filename+":"+m.lineno+")")})},b.postMessage({cmd:"init",typeSupported:k,vendor:w,id:d,config:JSON.stringify(x)})}catch(m){q.logger.warn("Error in worker:",m),q.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new se.default(this.observer,k,x,w,d),this.worker=null}}else this.transmuxer=new se.default(this.observer,k,x,w,d)}var I=P.prototype;return I.destroy=function(){var d=this.worker;if(d)d.removeEventListener("message",this.onwmsg),d.terminate(),this.worker=null;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var p=this.observer;p&&p.removeAllListeners(),this.observer=null},I.push=function(d,f,p,T,x,E,k,w,b,m){var v=this;b.transmuxing.start=self.performance.now();var g=this.transmuxer,R=this.worker,O=E?E.start:x.start,G=x.decryptdata,Z=this.frag,ee=!(Z&&x.cc===Z.cc),fe=!(Z&&b.level===Z.level),pe=Z?b.sn-Z.sn:-1,xe=this.part?b.part-this.part.index:1,Ce=!fe&&(pe===1||pe===0&&xe===1),be=self.performance.now();(fe||pe||x.stats.parsing.start===0)&&(x.stats.parsing.start=be),E&&(xe||!Ce)&&(E.stats.parsing.start=be);var Oe=new se.TransmuxState(ee,Ce,w,fe,O);if(!Ce||ee){q.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+` + Time to underbuffer: `+ee.toFixed(3)+" s"),f.nextLoadLevel=pe,this.bwEstimator.sample(w,E.loaded),this.clearTimer(),C.loader&&(this.fragCurrent=this.partCurrent=null,C.loader.abort()),f.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:C,part:d,stats:E})},P.onFragLoaded=function(C,d){var f=d.frag,p=d.part;if(f.type===X.PlaylistLevelType.MAIN&&Object(oe.isFiniteNumber)(f.sn)){var T=p?p.stats:f.stats,x=p?p.duration:f.duration;if(this.clearTimer(),this.lastLoadedFragLevel=f.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var E=this.hls.levels[f.level],k=(E.loaded?E.loaded.bytes:0)+T.loaded,w=(E.loaded?E.loaded.duration:0)+x;E.loaded={bytes:k,duration:w},E.realBitrate=Math.round(8*k/w)}if(f.bitrateTest){var b={stats:T,frag:f,part:p,id:f.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,b),f.bitrateTest=!1}}},P.onFragBuffered=function(C,d){var f=d.frag,p=d.part,T=p?p.stats:f.stats;if(T.aborted)return;if(f.type!==X.PlaylistLevelType.MAIN||f.sn==="initSegment")return;var x=T.parsing.end-T.loading.start;this.bwEstimator.sample(x,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),f.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},P.onError=function(C,d){switch(d.details){case q.ErrorDetails.FRAG_LOAD_ERROR:case q.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},P.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},P.getNextABRAutoLevel=function(){var C=this.fragCurrent,d=this.partCurrent,f=this.hls,p=f.maxAutoLevel,T=f.config,x=f.minAutoLevel,E=f.media,k=d?d.duration:C?C.duration:0,w=E?E.currentTime:0,b=E&&E.playbackRate!==0?Math.abs(E.playbackRate):1,m=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,v=(se.BufferHelper.bufferInfo(E,w,T.maxBufferHole).end-w)/b,g=this.findBestLevel(m,x,p,v,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(g>=0)return g;V.logger.trace((v?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var R=k?Math.min(k,T.maxStarvationDelay):T.maxStarvationDelay,O=T.abrBandWidthFactor,H=T.abrBandWidthUpFactor;if(!v){var Z=this.bitrateTestDelay;if(Z){var ee=k?Math.min(k,T.maxLoadingDelay):T.maxLoadingDelay;R=ee-Z,V.logger.trace("bitrate test took "+Math.round(1e3*Z)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*R)+" ms"),O=H=1}}return g=this.findBestLevel(m,x,p,v+R,O,H),Math.max(g,0)},P.findBestLevel=function(C,d,f,p,T,x){for(var E,k=this.fragCurrent,w=this.partCurrent,b=this.lastLoadedFragLevel,m=this.hls.levels,v=m[b],g=!!(v!=null&&(E=v.details)!==null&&E!==void 0&&E.live),R=v==null?void 0:v.codecSet,O=w?w.duration:k?k.duration:0,H=f;H>=d;H--){var Z=m[H];if(!Z||R&&Z.codecSet!==R)continue;var ee=Z.details,fe=(w?ee==null?void 0:ee.partTarget:ee==null?void 0:ee.averagetargetduration)||O,pe=void 0;H<=b?pe=T*C:pe=x*C;var xe=m[H].maxBitrate,Ce=xe*fe/pe;if(V.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+H+"/"+Math.round(pe)+"/"+xe+"/"+fe+"/"+p+"/"+Ce),pe>xe&&(!Ce||g&&!this.bitrateTestDelay||Ce0&&v===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()},b.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var v,g=this.levels,R=this.trackId,O=g==null||((v=g[R])===null||v===void 0)?void 0:v.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var H,Z=performance.now(),ee=this.retryDate;(!ee||Z>=ee||(H=this.media)!==null&&H!==void 0&&H.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=K.State.IDLE);break}case K.State.WAITING_INIT_PTS:{var fe=this.waitingData;if(fe){var pe=fe.frag,xe=fe.part,Ce=fe.cache,be=fe.complete;if(this.initPTS[pe.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var Oe=Ce.flush(),We={frag:pe,part:xe,payload:Oe,networkDetails:null};this._handleFragmentLoadProgress(We),be&&k.prototype._handleFragmentLoadComplete.call(this,We)}else if(this.videoTrackCC!==this.waitingVideoCC)d.logger.log("Waiting fragment cc ("+pe.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var je=this.getLoadPosition(),ct=se.BufferHelper.bufferInfo(this.mediaBuffer,je,this.config.maxBufferHole),Ge=Object(P.fragmentWithinToleranceTest)(ct.end,this.config.maxFragLookUpTolerance,pe);Ge<0&&(d.logger.log("Waiting fragment cc ("+pe.cc+") @ "+pe.start+" cancelled because another fragment at "+ct.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var v=this.waitingData;v&&(this.fragmentTracker.removeFragment(v.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},b.onTickEnd=function(){var v=this.media;if(!v||!v.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:v,R=g.buffered;!this.loadedmetadata&&R.length&&(this.loadedmetadata=!0),this.lastCurrentTime=v.currentTime},b.doTickIdle=function(){var v,g,R=this.hls,O=this.levels,H=this.media,Z=this.trackId,ee=R.config;if(!O||!O[Z])return;if(!H&&(this.startFragRequested||!ee.startFragPrefetch))return;var fe=O[Z],pe=fe.details;if(!pe||pe.live&&this.levelLastLoaded!==Z||this.waitForCdnTuneIn(pe)){this.state=K.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,L.ElementaryStreamTypes.AUDIO,V.PlaylistLevelType.AUDIO));var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,V.PlaylistLevelType.AUDIO);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(),Oe=this.audioSwitch;if(Ce>=be&&!Oe)return;if(!Oe&&this._streamEnded(xe,pe)){R.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var We=pe.fragments,je=We[0].start,ct=xe.end;if(Oe){var Ge=this.getLoadPosition();ct=Ge,pe.PTSKnown&&Geje||xe.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),H.currentTime=je+.05))}var Ze=this.getNextFragment(ct,pe);if(!Ze){this.bufferFlushed=!0;return}((v=Ze.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((g=Ze.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Ze,pe):this.loadFragment(Ze,pe,ct)},b.getMaxBufferLength=function(){var v=k.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,V.PlaylistLevelType.MAIN);return g===null?v:Math.max(v,g.len)},b.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(v,g){var R=g.audioTracks;this.resetTransmuxer(),this.levels=R.map(function(O){return new X.Level(O)})},b.onAudioTrackSwitching=function(v,g){var R=!!g.url;this.trackId=g.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),R?this.setInterval(x):this.resetTransmuxer(),R?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(v,g){this.mainDetails=g.details},b.onAudioTrackLoaded=function(v,g){var R,O=this.levels,H=g.details,Z=g.id;if(!O){this.warn("Audio tracks were reset while loading level "+Z);return}this.log("Track "+Z+" loaded ["+H.startSN+","+H.endSN+"],duration:"+H.totalduration);var ee=O[Z],fe=0;if(H.live||(R=ee.details)!==null&&R!==void 0&&R.live){var pe=this.mainDetails;if(H.fragments[0]||(H.deltaUpdateFailed=!0),H.deltaUpdateFailed||!pe)return;!ee.details&&H.hasProgramDateTime&&pe.hasProgramDateTime?(Object(M.alignMediaPlaylistByPDT)(H,pe),fe=H.fragments[0].start):fe=this.alignPlaylists(H,ee.details)}ee.details=H,this.levelLastLoaded=Z,!this.startFragRequested&&(this.mainDetails||!H.live)&&this.setStartPosition(ee.details,fe),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(H)&&(this.state=K.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(v){var g,R=v.frag,O=v.part,H=v.payload,Z=this.config,ee=this.trackId,fe=this.levels;if(!fe){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+R.sn+" of level "+R.level+" will not be buffered");return}var pe=fe[ee];console.assert(pe,"Audio track is defined on fragment load progress");var xe=pe.details;console.assert(xe,"Audio track details are defined on fragment load progress");var Ce=Z.defaultAudioCodec||pe.audioCodec||"mp4a.40.2",be=this.transmuxer;be||(be=this.transmuxer=new G.default(this.hls,V.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Oe=this.initPTS[R.cc],We=(g=R.initSegment)===null||g===void 0?void 0:g.data;if(Oe!==void 0){var je=!1,ct=O?O.index:-1,Ge=ct!==-1,Ze=new I.ChunkMetadata(R.level,R.sn,R.stats.chunkCount,H.byteLength,ct,Ge);be.push(H,We,Ce,"",R,O,xe.totalduration,je,Ze,Oe)}else{d.logger.log("Unknown video PTS for cc "+R.cc+", waiting for video PTS before demuxing audio frag "+R.sn+" of ["+xe.startSN+" ,"+xe.endSN+"],track "+ee);var Xe=this.waitingData=this.waitingData||{frag:R,part:O,cache:new U.default,complete:!1},Qe=Xe.cache;Qe.push(new Uint8Array(H)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(v){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,v)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(v,g){var R=g.tracks.audio;R&&(this.mediaBuffer=R.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},b.onFragBuffered=function(v,g){var R=g.frag,O=g.part;if(R.type!==V.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(R)){this.warn("Fragment "+R.sn+(O?" p: "+O.index:"")+" of level "+R.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}R.sn!=="initSegment"&&(this.fragPrevious=R,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(R,O)},b.onError=function(v,g){switch(g.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:case C.ErrorDetails.KEY_LOAD_ERROR:case C.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.AUDIO,g);break;case C.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case C.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=g.fatal?K.State.ERROR:K.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case C.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var R=!0,O=this.getFwdBufferInfo(this.mediaBuffer,V.PlaylistLevelType.AUDIO);O&&O.len>.5&&(R=!this.reduceMaxBufferLength(O.len)),R&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(v,g){var R=g.type;R===L.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(v){var g,R="audio",O=this.hls,H=v.remuxResult,Z=v.chunkMeta,ee=this.getCurrentContext(Z);if(!ee){this.warn("The loading context changed while buffering fragment "+Z.sn+" of level "+Z.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(Z.level);return}var fe=ee.frag,pe=ee.part,xe=H.audio,Ce=H.text,be=H.id3,Oe=H.initSegment;if(this.fragContextChanged(fe))return;if(this.state=K.State.PARSING,this.audioSwitch&&xe&&this.completeAudioSwitch(),Oe!=null&&Oe.tracks&&(this._bufferInitSegment(Oe.tracks,fe,Z),O.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:fe,id:R,tracks:Oe.tracks})),xe){var We=xe.startPTS,je=xe.endPTS,ct=xe.startDTS,Ge=xe.endDTS;pe&&(pe.elementaryStreams[L.ElementaryStreamTypes.AUDIO]={startPTS:We,endPTS:je,startDTS:ct,endDTS:Ge}),fe.setElementaryStreamInfo(L.ElementaryStreamTypes.AUDIO,We,je,ct,Ge),this.bufferFragmentData(xe,fe,pe,Z)}if(be!=null&&(g=be.samples)!==null&&g!==void 0&&g.length){var Ze=f({frag:fe,id:R},be);O.trigger(B.Events.FRAG_PARSING_METADATA,Ze)}if(Ce){var Xe=f({frag:fe,id:R},Ce);O.trigger(B.Events.FRAG_PARSING_USERDATA,Xe)}},b._bufferInitSegment=function(v,g,R){if(this.state!==K.State.PARSING)return;v.video&&delete v.video;var O=v.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,v);var H=O.initSegment;if(H!=null&&H.byteLength){var Z={type:"audio",frag:g,part:null,chunkMeta:R,parent:g.type,data:H};this.hls.trigger(B.Events.BUFFER_APPENDING,Z)}this.tick()},b.loadFragment=function(v,g,R){var O=this.fragmentTracker.getState(v);this.fragCurrent=v,(this.audioSwitch||O===q.FragmentState.NOT_LOADED||O===q.FragmentState.PARTIAL)&&(v.sn==="initSegment"?this._loadInitSegment(v):g.live&&!Object(oe.isFiniteNumber)(this.initPTS[v.cc])?(this.log("Waiting for video PTS in continuity counter "+v.cc+" of live stream before loading audio fragment "+v.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,v,g,R)))},b.completeAudioSwitch=function(){var v=this.hls,g=this.media,R=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,v.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:R})},w}(K.default);re.default=E},"./src/controller/audio-track-controller.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/events.ts"),K=z("./src/errors.ts"),B=z("./src/controller/base-playlist-controller.ts"),se=z("./src/types/loader.ts");function q(G,I){for(var P=0;P=d.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var f=d[this.trackId];this.log("Now switching to audio-track index "+C);var p=d[C],T=p.id,x=p.groupId,E=x===void 0?"":x,k=p.name,w=p.type,b=p.url;if(this.trackId=C,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger(oe.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:E,name:k,type:w,url:b}),p.details&&!p.details.live)return;var m=this.switchParams(p.url,f==null?void 0:f.details);this.loadPlaylist(m)},P.selectInitialTrack=function(){var C=this.tracksInGroup;console.assert(C.length,"Initial audio track should be selected when tracks are known");var d=this.trackName,f=this.findTrackId(d)||this.findTrackId();f!==-1?this.setAudioTrack(f):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},P.findTrackId=function(C){for(var d=this.tracksInGroup,f=0;fI.partTarget&&(p+=1)}if(Object(oe.isFiniteNumber)(f))return new K.HlsUrlParameters(f,Object(oe.isFiniteNumber)(p)?p:void 0,K.HlsSkip.No)}}},L.loadPlaylist=function(G){},L.shouldLoadTrack=function(G){return this.canLoad&&G&&!!G.url&&(!G.details||G.details.live)},L.playlistLoaded=function(G,I,P){var M=this,C=I.details,d=I.stats,f=d.loading.end?Math.max(0,self.performance.now()-d.loading.end):0;if(C.advancedDateTime=Date.now()-f,C.live||P!=null&&P.live){if(C.reloaded(P),P&&this.log("live playlist "+G+" "+(C.advanced?"REFRESHED "+C.lastPartSn+"-"+C.lastPartIndex:"MISSED")),P&&C.fragments.length>0&&Object(B.mergeDetails)(P,C),!this.canLoad||!C.live)return;var p,T=void 0,x=void 0;if(C.canBlockReload&&C.endSN&&C.advanced){var E=this.hls.config.lowLatencyMode,k=C.lastPartSn,w=C.endSN,b=C.lastPartIndex,m=b!==-1,v=k===w,g=E?0:b;m?(T=v?w+1:k,x=v?g:b+1):T=w+1;var R=C.age,O=R+C.ageHeader,H=Math.min(O-C.partTarget,C.targetduration*1.5);if(H>0){if(P&&H>P.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+P.tuneInGoal+" to: "+H+" with playlist age: "+C.age),H=0;else{var Z=Math.floor(H/C.targetduration);if(T+=Z,x!==void 0){var ee=Math.round(H%C.targetduration/C.partTarget);x+=ee}this.log("CDN Tune-in age: "+C.ageHeader+"s last advanced "+R.toFixed(2)+"s goal: "+H+" skip sn "+Z+" to part "+x)}C.tuneInGoal=H}if(p=this.getDeliveryDirectives(C,I.deliveryDirectives,T,x),E||!v){this.loadPlaylist(p);return}}else p=this.getDeliveryDirectives(C,I.deliveryDirectives,T,x);var fe=Object(B.computeReloadInterval)(C,d);T!==void 0&&C.canBlockReload&&(fe-=C.partTarget||1),this.log("reload live playlist "+G+" in "+Math.round(fe)+" ms"),this.timer=self.setTimeout(function(){return M.loadPlaylist(p)},fe)}else this.clearTimer()},L.getDeliveryDirectives=function(G,I,P,M){var C=Object(K.getSkipValue)(G,P);return I!=null&&I.skip&&G.deltaUpdateFailed&&(P=I.msn,M=I.part,C=K.HlsSkip.No),new K.HlsUrlParameters(P,M,C)},L.retryLoadingOrFail=function(G){var I=this,P=this.hls.config,M=this.retryCount-1&&(C=G.context)!==null&&C!==void 0&&C.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+G.details+'"'),this.loadPlaylist();else{var d=Math.min(Math.pow(2,this.retryCount)*P.levelLoadingRetryDelay,P.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return I.loadPlaylist()},d),this.warn("retry playlist loading #"+this.retryCount+" in "+d+' ms after "'+G.details+'"')}}else this.warn('cannot recover from error "'+G.details+'"'),this.clearTimer(),G.fatal=!0;return M},V}()},"./src/controller/base-stream-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"State",function(){return w}),z.d(re,"default",function(){return b});var oe=z("./src/polyfills/number.ts"),K=z("./src/task-loop.ts"),B=z("./src/controller/fragment-tracker.ts"),se=z("./src/utils/buffer-helper.ts"),q=z("./src/utils/logger.ts"),X=z("./src/events.ts"),V=z("./src/errors.ts"),L=z("./src/types/transmuxer.ts"),U=z("./src/utils/mp4-tools.ts"),G=z("./src/utils/discontinuities.ts"),I=z("./src/controller/fragment-finders.ts"),P=z("./src/controller/level-helper.ts"),M=z("./src/loader/fragment-loader.ts"),C=z("./src/crypt/decrypter.ts"),d=z("./src/utils/time-ranges.ts"),f=z("./src/types/loader.ts");function p(m,v){for(var g=0;gOe;(pe0&&pe&&pe.key&&pe.iv&&pe.method==="AES-128"){var xe=self.performance.now();return H.decrypter.webCryptoDecrypt(new Uint8Array(fe),pe.key.buffer,pe.iv.buffer).then(function(Ce){var be=self.performance.now();return ee.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:Ce,stats:{tstart:xe,tdecrypt:be}}),Z.payload=Ce,Z})}return Z}).then(function(Z){var ee=H.fragCurrent,fe=H.hls,pe=H.levels;if(!pe)throw new Error("init load aborted, missing levels");var xe=pe[O.level].details;console.assert(xe,"Level details are defined when init segment is loaded");var Ce=O.stats;H.state=w.IDLE,H.fragLoadError=0,O.data=new Uint8Array(Z.payload),Ce.parsing.start=Ce.buffering.start=self.performance.now(),Ce.parsing.end=Ce.buffering.end=self.performance.now(),Z.frag===ee&&fe.trigger(X.Events.FRAG_BUFFERED,{stats:Ce,frag:ee,part:null,id:O.type}),H.tick()}).catch(function(Z){H.warn(Z),H.resetFragmentLoading(O)})},g.fragContextChanged=function(O){var H=this.fragCurrent;return!O||!H||O.level!==H.level||O.sn!==H.sn||O.urlId!==H.urlId},g.fragBufferedComplete=function(O,H){var Z=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(H?" part: "+H.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+d.default.toString(se.BufferHelper.getBuffered(Z))),this.state=w.IDLE,this.tick()},g._handleFragmentLoadComplete=function(O){var H=this.transmuxer;if(!H)return;var Z=O.frag,ee=O.part,fe=O.partsLoaded,pe=!fe||fe.length===0||fe.some(function(Ce){return!Ce}),xe=new L.ChunkMetadata(Z.level,Z.sn,Z.stats.chunkCount+1,0,ee?ee.index:-1,!pe);H.flush(xe)},g._handleFragmentLoadProgress=function(O){},g._doFragLoad=function(O,H,Z,ee){var fe=this;if(Z===void 0&&(Z=null),!this.levels)throw new Error("frag load aborted, missing levels");if(Z=Math.max(O.start,Z||0),this.config.lowLatencyMode&&H){var pe=H.partList;if(pe&&ee){Z>O.end&&H.fragmentHint&&(O=H.fragmentHint);var xe=this.getNextPart(pe,O,Z);if(xe>-1){var Ce=pe[xe];return this.log("Loading part sn: "+O.sn+" p: "+Ce.index+" cc: "+O.cc+" of playlist ["+H.startSN+"-"+H.endSN+"] parts [0-"+xe+"-"+(pe.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Z.toFixed(3))),this.nextLoadPosition=Ce.start+Ce.duration,this.state=w.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,part:pe[xe],targetBufferTime:Z}),this.doFragPartsLoad(O,pe,xe,ee).catch(function(be){return fe.handleFragLoadError(be)})}else if(!O.url||this.loadedEndOfParts(pe,Z))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(H?"of ["+H.startSN+"-"+H.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(Z.toFixed(3))),Object(oe.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=w.FRAG_LOADING,this.hls.trigger(X.Events.FRAG_LOADING,{frag:O,targetBufferTime:Z}),this.fragmentLoader.load(O,ee).catch(function(be){return fe.handleFragLoadError(be)})},g.doFragPartsLoad=function(O,H,Z,ee){var fe=this;return new Promise(function(pe,xe){var Ce=[],be=function Oe(We){var je=H[We];fe.fragmentLoader.loadPart(O,je,ee).then(function(ct){Ce[je.index]=ct;var Ge=ct.part;fe.hls.trigger(X.Events.FRAG_LOADED,ct);var Ze=H[We+1];if(Ze&&Ze.fragment===O)Oe(We+1);else return pe({frag:O,part:Ge,partsLoaded:Ce})}).catch(xe)};be(Z)})},g.handleFragLoadError=function(O){var H=O.data;return H&&H.details===V.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(H.frag,H.part):this.hls.trigger(X.Events.ERROR,H),null},g._handleTransmuxerFlush=function(O){var H=this.getCurrentContext(O);if(!H||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var Z=H.frag,ee=H.part,fe=H.level,pe=self.performance.now();Z.stats.parsing.end=pe,ee&&(ee.stats.parsing.end=pe),this.updateLevelTiming(Z,ee,fe,O.partial)},g.getCurrentContext=function(O){var H=this.levels,Z=O.level,ee=O.sn,fe=O.part;if(!H||!H[Z])return this.warn("Levels object was unset while buffering fragment "+ee+" of level "+Z+". The current chunk will not be buffered."),null;var pe=H[Z],xe=fe>-1?Object(P.getPartWith)(pe,ee,fe):null,Ce=xe?xe.fragment:Object(P.getFragmentWithSN)(pe,ee,this.fragCurrent);return Ce?{frag:Ce,part:xe,level:pe}:null},g.bufferFragmentData=function(O,H,Z,ee){if(!O||this.state!==w.PARSING)return;var fe=O.data1,pe=O.data2,xe=fe;if(fe&&pe&&(xe=Object(U.appendUint8Array)(fe,pe)),!xe||!xe.length)return;var Ce={type:O.type,frag:H,part:Z,chunkMeta:ee,parent:H.type,data:xe};this.hls.trigger(X.Events.BUFFER_APPENDING,Ce),O.dropped&&O.independent&&!Z&&this.flushBufferGap(H)},g.flushBufferGap=function(O){var H=this.media;if(!H)return;if(!se.BufferHelper.isBuffered(H,H.currentTime)){this.flushMainBuffer(0,O.start);return}var Z=H.currentTime,ee=se.BufferHelper.bufferInfo(H,Z,0),fe=O.duration,pe=Math.min(this.config.maxFragLookUpTolerance*2,fe*.25),xe=Math.max(Math.min(O.start-pe,ee.end-pe),Z+pe);O.start-xe>pe&&this.flushMainBuffer(xe,O.start)},g.getFwdBufferInfo=function(O,H){var Z=this.config,ee=this.getLoadPosition();if(!Object(oe.isFiniteNumber)(ee))return null;var fe=se.BufferHelper.bufferInfo(O,ee,Z.maxBufferHole);if(fe.len===0&&fe.nextStart!==void 0){var pe=this.fragmentTracker.getBufferedFrag(ee,H);if(pe&&fe.nextStart=Z?(H.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+H.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(O,H){var Z,ee,fe=H.fragments,pe=fe.length;if(!pe)return null;var xe=this.config,Ce=fe[0].start,be;if(H.live){var Oe=xe.initialLiveManifestSize;if(pe-1&&ZZ.start&&Z.loaded},g.getInitialLiveFragment=function(O,H){var Z=this.fragPrevious,ee=null;if(Z){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+Z.programDateTime),ee=Object(I.findFragmentByPDT)(H,Z.endProgramDateTime,this.config.maxFragLookUpTolerance)),!ee){var fe=Z.sn+1;if(fe>=O.startSN&&fe<=O.endSN){var pe=H[fe-O.startSN];Z.cc===pe.cc&&(ee=pe,this.log("Live playlist, switching playlist, load frag with next SN: "+ee.sn))}ee||(ee=Object(I.findFragWithCC)(H,Z.cc),ee&&this.log("Live playlist, switching playlist, load frag with same CC: "+ee.sn))}}else{var xe=this.hls.liveSyncPosition;xe!==null&&(ee=this.getFragmentAtPosition(xe,this.bitrateTest?O.fragmentEnd:O.edge,O))}return ee},g.getFragmentAtPosition=function(O,H,Z){var ee=this.config,fe=this.fragPrevious,pe=Z.fragments,xe=Z.endSN,Ce=Z.fragmentHint,be=ee.maxFragLookUpTolerance,Oe=!!(ee.lowLatencyMode&&Z.partList&&Ce);Oe&&Ce&&!this.bitrateTest&&(pe=pe.concat(Ce),xe=Ce.sn);var We;if(OH-be?0:be;We=Object(I.findFragmentByPTS)(fe,pe,O,je)}else We=pe[pe.length-1];if(We){var ct=We.sn-Z.startSN,Ge=fe&&We.level===fe.level,Ze=pe[ct+1],Xe=this.fragmentTracker.getState(We);if(Xe===B.FragmentState.BACKTRACKED){We=null;for(var Qe=ct;pe[Qe]&&this.fragmentTracker.getState(pe[Qe])===B.FragmentState.BACKTRACKED;)fe?We=pe[Qe--]:We=pe[--Qe];We||(We=Ze)}else fe&&We.sn===fe.sn&&!Oe&&(Ge&&(We.sn=pe-H.maxFragLookUpTolerance&&fe<=xe;if(ee!==null&&Z.duration>ee&&(fe"+O.startSN+" prev-sn: "+(fe?fe.sn:"na")+" fragments: "+xe),We}return Ce},g.waitForCdnTuneIn=function(O){var H=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*H)},g.setStartPosition=function(O,H){var Z=this.startPosition;if(Z"+O))}}]),v}(K.default)},"./src/controller/buffer-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var oe=z("./src/polyfills/number.ts"),K=z("./src/events.ts"),B=z("./src/utils/logger.ts"),se=z("./src/errors.ts"),q=z("./src/utils/buffer-helper.ts"),X=z("./src/utils/mediasource-helper.ts"),V=z("./src/loader/fragment.ts"),L=z("./src/controller/buffer-operation-queue.ts"),U=Object(X.getMediaSource)(),G=/([ha]vc.)(?:\.[^.,]+)+/,I=function(){function P(C){var d=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var f=d.hls,p=d.media,T=d.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),p&&(d.updateMediaElementDuration(),f.trigger(K.Events.MEDIA_ATTACHED,{media:p})),T&&T.removeEventListener("sourceopen",d._onMediaSourceOpen),d.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=C,this._initSourceBuffer(),this.registerListeners()}var M=P.prototype;return M.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},M.destroy=function(){this.unregisterListeners(),this.details=null},M.registerListeners=function(){var d=this.hls;d.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(K.Events.BUFFER_RESET,this.onBufferReset,this),d.on(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(K.Events.BUFFER_EOS,this.onBufferEos,this),d.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.on(K.Events.FRAG_PARSED,this.onFragParsed,this),d.on(K.Events.FRAG_CHANGED,this.onFragChanged,this)},M.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(K.Events.BUFFER_RESET,this.onBufferReset,this),d.off(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),d.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(K.Events.BUFFER_EOS,this.onBufferEos,this),d.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),d.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),d.off(K.Events.FRAG_PARSED,this.onFragParsed,this),d.off(K.Events.FRAG_CHANGED,this.onFragChanged,this)},M._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new L.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},M.onManifestParsed=function(d,f){var p=2;(f.audio&&!f.video||!f.altAudio)&&(p=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=p,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},M.onMediaAttaching=function(d,f){var p=this.media=f.media;if(p&&U){var T=this.mediaSource=new U;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),p.src=self.URL.createObjectURL(T),this._objectUrl=p.src}},M.onMediaDetaching=function(){var d=this.media,f=this.mediaSource,p=this._objectUrl;if(f){if(B.logger.log("[buffer-controller]: media source detaching"),f.readyState==="open")try{f.endOfStream()}catch(T){B.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),f.removeEventListener("sourceopen",this._onMediaSourceOpen),f.removeEventListener("sourceended",this._onMediaSourceEnded),f.removeEventListener("sourceclose",this._onMediaSourceClose),d&&(p&&self.URL.revokeObjectURL(p),d.src===p?(d.removeAttribute("src"),d.load()):B.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(K.Events.MEDIA_DETACHED,void 0)},M.onBufferReset=function(){var d=this;this.getSourceBufferTypes().forEach(function(f){var p=d.sourceBuffer[f];try{p&&(d.removeBufferListeners(f),d.mediaSource&&d.mediaSource.removeSourceBuffer(p),d.sourceBuffer[f]=void 0)}catch(T){B.logger.warn("[buffer-controller]: Failed to reset the "+f+" buffer",T)}}),this._initSourceBuffer()},M.onBufferCodecs=function(d,f){var p=this,T=this.getSourceBufferTypes().length;if(Object.keys(f).forEach(function(x){if(T){var E=p.tracks[x];if(E&&typeof E.buffer.changeType=="function"){var k=f[x],w=k.codec,b=k.levelCodec,m=k.container,v=(E.levelCodec||E.codec).replace(G,"$1"),g=(b||w).replace(G,"$1");if(v!==g){var R=m+";codecs="+(b||w);p.appendChangeType(x,R)}}}else p.pendingTracks[x]=f[x]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},M.appendChangeType=function(d,f){var p=this,T=this.operationQueue,x={execute:function(){var k=p.sourceBuffer[d];k&&(B.logger.log("[buffer-controller]: changing "+d+" sourceBuffer type to "+f),k.changeType(f)),T.shiftAndExecuteNext(d)},onStart:function(){},onComplete:function(){},onError:function(k){B.logger.warn("[buffer-controller]: Failed to change "+d+" SourceBuffer type",k)}};T.append(x,d)},M.onBufferAppending=function(d,f){var p=this,T=this.hls,x=this.operationQueue,E=this.tracks,k=f.data,w=f.type,b=f.frag,m=f.part,v=f.chunkMeta,g=v.buffering[w],R=self.performance.now();g.start=R;var O=b.stats.buffering,H=m?m.stats.buffering:null;O.start===0&&(O.start=R),H&&H.start===0&&(H.start=R);var Z=E.audio,ee=w==="audio"&&v.id===1&&(Z==null?void 0:Z.container)==="audio/mpeg",fe={execute:function(){if(g.executeStart=self.performance.now(),ee){var xe=p.sourceBuffer[w];if(xe){var Ce=b.start-xe.timestampOffset;Math.abs(Ce)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+Ce+") sn: "+b.sn+")"),xe.timestampOffset=b.start)}}p.appendExecutor(k,w)},onStart:function(){},onComplete:function(){var xe=self.performance.now();g.executeEnd=g.end=xe,O.first===0&&(O.first=xe),H&&H.first===0&&(H.first=xe);var Ce=p.sourceBuffer,be={};for(var Oe in Ce)be[Oe]=q.BufferHelper.getBuffered(Ce[Oe]);p.appendError=0,p.hls.trigger(K.Events.BUFFER_APPENDED,{type:w,frag:b,part:m,chunkMeta:v,parent:b.type,timeRanges:be})},onError:function(xe){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",xe);var Ce={type:se.ErrorTypes.MEDIA_ERROR,parent:b.type,details:se.ErrorDetails.BUFFER_APPEND_ERROR,err:xe,fatal:!1};xe.code===DOMException.QUOTA_EXCEEDED_ERR?Ce.details=se.ErrorDetails.BUFFER_FULL_ERROR:(p.appendError++,Ce.details=se.ErrorDetails.BUFFER_APPEND_ERROR,p.appendError>T.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),Ce.fatal=!0)),T.trigger(K.Events.ERROR,Ce)}};x.append(fe,w)},M.onBufferFlushing=function(d,f){var p=this,T=this.operationQueue,x=function(k){return{execute:p.removeExecutor.bind(p,k,f.startOffset,f.endOffset),onStart:function(){},onComplete:function(){p.hls.trigger(K.Events.BUFFER_FLUSHED,{type:k})},onError:function(b){B.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",b)}}};f.type?T.append(x(f.type),f.type):this.getSourceBufferTypes().forEach(function(E){T.append(x(E),E)})},M.onFragParsed=function(d,f){var p=this,T=f.frag,x=f.part,E=[],k=x?x.elementaryStreams:T.elementaryStreams;k[V.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(k[V.ElementaryStreamTypes.AUDIO]&&E.push("audio"),k[V.ElementaryStreamTypes.VIDEO]&&E.push("video"));var w=function(){var m=self.performance.now();T.stats.buffering.end=m,x&&(x.stats.buffering.end=m);var v=x?x.stats:T.stats;p.hls.trigger(K.Events.FRAG_BUFFERED,{frag:T,part:x,stats:v,id:T.type})};E.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(w,E)},M.onFragChanged=function(d,f){this.flushBackBuffer()},M.onBufferEos=function(d,f){var p=this,T=this.getSourceBufferTypes().reduce(function(x,E){var k=p.sourceBuffer[E];return(!f.type||f.type===E)&&(k&&!k.ended&&(k.ended=!0,B.logger.log("[buffer-controller]: "+E+" sourceBuffer now EOS"))),x&&!!(!k||k.ended)},!0);T&&this.blockBuffers(function(){var x=p.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},M.onLevelUpdated=function(d,f){var p=f.details;if(!p.fragments.length)return;this.details=p,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},M.flushBackBuffer=function(){var d=this.hls,f=this.details,p=this.media,T=this.sourceBuffer;if(!p||f===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var E=f.live&&d.config.liveBackBufferLength!==null?d.config.liveBackBufferLength:d.config.backBufferLength;if(!Object(oe.isFiniteNumber)(E)||E<0)return;var k=p.currentTime,w=f.levelTargetDuration,b=Math.max(E,w),m=Math.floor(k/w)*w-b;x.forEach(function(v){var g=T[v];if(g){var R=q.BufferHelper.getBuffered(g);R.length>0&&m>R.start(0)&&(d.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:m}),f.live&&d.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:m}),d.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:m,type:v}))}})},M.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var d=this.details,f=this.hls,p=this.media,T=this.mediaSource,x=d.fragments[0].start+d.totalduration,E=p.duration,k=Object(oe.isFiniteNumber)(T.duration)?T.duration:0;d.live&&f.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(d)):(x>k&&x>E||!Object(oe.isFiniteNumber)(E))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),T.duration=x)},M.updateSeekableRange=function(d){var f=this.mediaSource,p=d.fragments,T=p.length;if(T&&d.live&&f!==null&&f!==void 0&&f.setLiveSeekableRange){var x=Math.max(0,p[0].start),E=Math.max(x,x+d.totalduration);f.setLiveSeekableRange(x,E)}},M.checkPendingTracks=function(){var d=this.bufferCodecEventsExpected,f=this.operationQueue,p=this.pendingTracks,T=Object.keys(p).length;if(T&&!d||T===2){this.createSourceBuffers(p),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(E){f.executeNext(E)})}},M.createSourceBuffers=function(d){var f=this.sourceBuffer,p=this.mediaSource;if(!p)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var x in d)if(!f[x]){var E=d[x];if(!E)throw Error("source buffer exists for track "+x+", however track does not");var k=E.levelCodec||E.codec,w=E.container+";codecs="+k;B.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var b=f[x]=p.addSourceBuffer(w),m=x;this.addBufferListener(m,"updatestart",this._onSBUpdateStart),this.addBufferListener(m,"updateend",this._onSBUpdateEnd),this.addBufferListener(m,"error",this._onSBUpdateError),this.tracks[x]={buffer:b,codec:k,container:E.container,levelCodec:E.levelCodec,id:E.id},T++}catch(v){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+v.message),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:v,mimeType:w})}}T&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},M._onSBUpdateStart=function(d){var f=this.operationQueue,p=f.current(d);p.onStart()},M._onSBUpdateEnd=function(d){var f=this.operationQueue,p=f.current(d);p.onComplete(),f.shiftAndExecuteNext(d)},M._onSBUpdateError=function(d,f){B.logger.error("[buffer-controller]: "+d+" SourceBuffer error",f),this.hls.trigger(K.Events.ERROR,{type:se.ErrorTypes.MEDIA_ERROR,details:se.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var p=this.operationQueue.current(d);p&&p.onError(f)},M.removeExecutor=function(d,f,p){var T=this.media,x=this.mediaSource,E=this.operationQueue,k=this.sourceBuffer,w=k[d];if(!T||!x||!w){B.logger.warn("[buffer-controller]: Attempting to remove from the "+d+" SourceBuffer, but it does not exist"),E.shiftAndExecuteNext(d);return}var b=Object(oe.isFiniteNumber)(T.duration)?T.duration:Infinity,m=Object(oe.isFiniteNumber)(x.duration)?x.duration:Infinity,v=Math.max(0,f),g=Math.min(p,b,m);g>v?(B.logger.log("[buffer-controller]: Removing ["+v+","+g+"] from the "+d+" SourceBuffer"),console.assert(!w.updating,d+" sourceBuffer must not be updating"),w.remove(v,g)):E.shiftAndExecuteNext(d)},M.appendExecutor=function(d,f){var p=this.operationQueue,T=this.sourceBuffer,x=T[f];if(!x){B.logger.warn("[buffer-controller]: Attempting to append to the "+f+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(f);return}x.ended=!1,console.assert(!x.updating,f+" sourceBuffer must not be updating"),x.appendBuffer(d)},M.blockBuffers=function(d,f){var p=this;if(f===void 0&&(f=this.getSourceBufferTypes()),!f.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(d);return}var T=this.operationQueue,x=f.map(function(E){return T.appendBlocker(E)});Promise.all(x).then(function(){d(),f.forEach(function(E){var k=p.sourceBuffer[E];(!k||!k.updating)&&T.shiftAndExecuteNext(E)})})},M.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},M.addBufferListener=function(d,f,p){var T=this.sourceBuffer[d];if(!T)return;var x=p.bind(this,d);this.listeners[d].push({event:f,listener:x}),T.addEventListener(f,x)},M.removeBufferListeners=function(d){var f=this.sourceBuffer[d];if(!f)return;this.listeners[d].forEach(function(p){f.removeEventListener(p.event,p.listener)})},P}()},"./src/controller/buffer-operation-queue.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return K});var oe=z("./src/utils/logger.ts"),K=function(){function B(q){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=q}var se=B.prototype;return se.append=function(X,V){var L=this.queues[V];L.push(X),L.length===1&&this.buffers[V]&&this.executeNext(V)},se.insertAbort=function(X,V){var L=this.queues[V];L.unshift(X),this.executeNext(V)},se.appendBlocker=function(X){var V,L=new Promise(function(G){V=G}),U={execute:V,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(U,X),L},se.executeNext=function(X){var V=this.buffers,L=this.queues,U=V[X],G=L[X];if(G.length){var I=G[0];try{I.execute()}catch(P){oe.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),I.onError(P),(!U||!U.updating)&&(G.shift(),this.executeNext(X))}}},se.shiftAndExecuteNext=function(X){this.queues[X].shift(),this.executeNext(X)},se.current=function(X){return this.queues[X][0]},B}()},"./src/controller/cap-level-controller.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/events.ts");function K(q,X){for(var V=0;V0&&this.mediaWidth>0){var L=this.hls.levels;if(L.length){var U=this.hls;U.autoLevelCapping=this.getMaxLevel(L.length-1),U.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=U.autoLevelCapping}}},X.getMaxLevel=function(L){var U=this,G=this.hls.levels;if(!G.length)return-1;var I=G.filter(function(P,M){return q.isLevelAllowed(M,U.restrictedLevels)&&M<=L});return this.clientRect=null,q.getMaxLevelByMediaSize(I,this.mediaWidth,this.mediaHeight)},X.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},X.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},X.getDimensions=function(){if(this.clientRect)return this.clientRect;var L=this.media,U={width:0,height:0};if(L){var G=L.getBoundingClientRect();U.width=G.width,U.height=G.height,!U.width&&!U.height&&(U.width=G.right-G.left||L.width||0,U.height=G.bottom-G.top||L.height||0)}return this.clientRect=U,U},q.isLevelAllowed=function(L,U){return U===void 0&&(U=[]),U.indexOf(L)===-1},q.getMaxLevelByMediaSize=function(L,U,G){if(!L||!L.length)return-1;for(var I=function(f,p){return p?f.width!==p.width||f.height!==p.height:!0},P=L.length-1,M=0;M=U||C.height>=G)&&I(C,L[M+1])){P=M;break}}return P},B(q,[{key:"mediaWidth",get:function(){return this.getDimensions().width*q.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*q.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var L=1;try{L=self.devicePixelRatio}catch(U){}return L}}]),q}();re.default=se},"./src/controller/cmcd-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var oe=z("./src/events.ts"),K=z("./src/types/cmcd.ts"),B=z("./src/utils/buffer-helper.ts"),se=z("./src/utils/logger.ts");function q(P,M){for(var C=0;C=P.length?{done:!0}:{done:!1,value:P[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(P,M){if(!P)return;if(typeof P=="string")return U(P,M);var C=Object.prototype.toString.call(P).slice(8,-1);if(C==="Object"&&P.constructor&&(C=P.constructor.name),C==="Map"||C==="Set")return Array.from(P);if(C==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(C))return U(P,M)}function U(P,M){(M==null||M>P.length)&&(M=P.length);for(var C=0,d=new Array(M);Cf&&(f=E.bitrate)}return f>0?f:NaN},M.getBufferLength=function(d){var f=this.hls.media,p=d===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!p||!f)return NaN;var T=B.BufferHelper.bufferInfo(p,f.currentTime,this.config.maxBufferHole);return T.len*1e3},M.createPlaylistLoader=function(){var d=this.config.pLoader,f=this.applyPlaylistData,p=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new p(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,w,b){f(k),this.loader.load(k,w,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},M.createFragmentLoader=function(){var d=this.config.fLoader,f=this.applyFragmentData,p=d||this.config.loader;return function(){function T(E){this.loader=void 0,this.loader=new p(E)}var x=T.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(k,w,b){f(k),this.loader.load(k,w,b)},X(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},P.uuid=function(){var d=URL.createObjectURL(new Blob),f=d.toString();return URL.revokeObjectURL(d),f.substr(f.lastIndexOf("/")+1)},P.serialize=function(d){for(var f=[],p=function(ee){return!Number.isNaN(ee)&&ee!=null&&ee!==""&&ee!==!1},T=function(ee){return Math.round(ee)},x=function(ee){return T(ee/100)*100},E=function(ee){return encodeURIComponent(ee)},k={br:T,d:T,bl:x,dl:x,mtp:x,nor:E,rtp:x,tb:T},w=Object.keys(d||{}).sort(),b=V(w),m;!(m=b()).done;){var v=m.value,g=d[v];if(!p(g))continue;if(v==="v"&&g===1)continue;if(v=="pr"&&g===1)continue;var R=k[v];R&&(g=R(g));var O=typeof g,H=void 0;v==="ot"||v==="sf"||v==="st"?H=v+"="+g:O==="boolean"?H=v:O==="number"?H=v+"="+g:H=v+"="+JSON.stringify(g),f.push(H)}return f.join(",")},P.toHeaders=function(d){for(var f=Object.keys(d),p={},T=["Object","Request","Session","Status"],x=[{},{},{},{}],E={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},k=0,w=f;kV){this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var E=V-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+E+" attempts left"),this._requestLicense(f,p)}break}},P._generateLicenseRequestChallenge=function(C,d){switch(C.mediaKeySystemDomain){case se.KeySystems.WIDEVINE:return d}throw new Error("unsupported key-system: "+C.mediaKeySystemDomain)},P._requestLicense=function(C,d){B.logger.log("Requesting content license for key-system");var f=this._mediaKeysList[0];if(!f){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var p=this.getLicenseServerUrl(f.mediaKeySystemDomain),T=this._createLicenseXhr(p,C,d);B.logger.log("Sending license request to URL: "+p);var x=this._generateLicenseRequestChallenge(f,C);T.send(x)}catch(E){B.logger.error("Failure requesting DRM license: "+E),this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},P.onMediaAttached=function(C,d){if(!this._emeEnabled)return;var f=d.media;this._media=f,f.addEventListener("encrypted",this._onMediaEncrypted)},P.onMediaDetached=function(){var C=this._media,d=this._mediaKeysList;if(!C)return;C.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(d.map(function(f){if(f.mediaKeysSession)return f.mediaKeysSession.close().catch(function(){})})).then(function(){return C.setMediaKeys(null)}).catch(function(){})},P.onManifestParsed=function(C,d){if(!this._emeEnabled)return;var f=d.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),p=d.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(se.KeySystems.WIDEVINE,f,p)},X(I,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),I}();re.default=G},"./src/controller/fps-controller.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/events.ts"),K=z("./src/utils/logger.ts"),B=function(){function se(X){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=X,this.registerListeners()}var q=se.prototype;return q.setStreamController=function(V){this.streamController=V},q.registerListeners=function(){this.hls.on(oe.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},q.unregisterListeners=function(){this.hls.off(oe.Events.MEDIA_ATTACHING,this.onMediaAttaching)},q.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},q.onMediaAttaching=function(V,L){var U=this.hls.config;if(U.capLevelOnFPSDrop){var G=L.media instanceof self.HTMLVideoElement?L.media:null;this.media=G,G&&typeof G.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),U.fpsDroppedMonitoringPeriod)}},q.checkFPS=function(V,L,U){var G=performance.now();if(L){if(this.lastTime){var I=G-this.lastTime,P=U-this.lastDroppedFrames,M=L-this.lastDecodedFrames,C=1e3*P/I,d=this.hls;if(d.trigger(oe.Events.FPS_DROP,{currentDropped:P,currentDecoded:M,totalDroppedFrames:U}),C>0&&P>d.config.fpsDroppedMonitoringThreshold*M){var f=d.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=f)&&(f=f-1,d.trigger(oe.Events.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:d.currentLevel}),d.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=G,this.lastDroppedFrames=U,this.lastDecodedFrames=L}},q.checkFPSInterval=function(){var V=this.media;if(V)if(this.isVideoPlaybackQualityAvailable){var L=V.getVideoPlaybackQuality();this.checkFPS(V,L.totalVideoFrames,L.droppedVideoFrames)}else this.checkFPS(V,V.webkitDecodedFrameCount,V.webkitDroppedFrameCount)},se}();re.default=B},"./src/controller/fragment-finders.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"findFragmentByPDT",function(){return B}),z.d(re,"findFragmentByPTS",function(){return se}),z.d(re,"fragmentWithinToleranceTest",function(){return q}),z.d(re,"pdtWithinToleranceTest",function(){return X}),z.d(re,"findFragWithCC",function(){return V});var oe=z("./src/polyfills/number.ts"),K=z("./src/utils/binary-search.ts");function B(L,U,G){if(U===null||!Array.isArray(L)||!L.length||!Object(oe.isFiniteNumber)(U))return null;var I=L[0].programDateTime;if(U<(I||0))return null;var P=L[L.length-1].endProgramDateTime;if(U>=(P||0))return null;G=G||0;for(var M=0;ML&&G.start?-1:0}function X(L,U,G){var I=Math.min(U,G.duration+(G.deltaPTS?G.deltaPTS:0))*1e3,P=G.endProgramDateTime||0;return P-I>L}function V(L,U){return K.default.search(L,function(G){return G.ccU?-1:0})}},"./src/controller/fragment-tracker.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"FragmentState",function(){return B}),z.d(re,"FragmentTracker",function(){return se});var oe=z("./src/events.ts"),K=z("./src/types/loader.ts"),B;(function(V){V.NOT_LOADED="NOT_LOADED",V.BACKTRACKED="BACKTRACKED",V.APPENDING="APPENDING",V.PARTIAL="PARTIAL",V.OK="OK"})(B||(B={}));var se=function(){function V(U){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=U,this._registerListeners()}var L=V.prototype;return L._registerListeners=function(){var G=this.hls;G.on(oe.Events.BUFFER_APPENDED,this.onBufferAppended,this),G.on(oe.Events.FRAG_BUFFERED,this.onFragBuffered,this),G.on(oe.Events.FRAG_LOADED,this.onFragLoaded,this)},L._unregisterListeners=function(){var G=this.hls;G.off(oe.Events.BUFFER_APPENDED,this.onBufferAppended,this),G.off(oe.Events.FRAG_BUFFERED,this.onFragBuffered,this),G.off(oe.Events.FRAG_LOADED,this.onFragLoaded,this)},L.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},L.getAppendedFrag=function(G,I){if(I===K.PlaylistLevelType.MAIN){var P=this.activeFragment,M=this.activeParts;if(!P)return null;if(M)for(var C=M.length;C--;){var d=M[C],f=d?d.end:P.appendedPTS;if(d.start<=G&&f!==void 0&&G<=f)return C>9&&(this.activeParts=M.slice(C-9)),d}else if(P.start<=G&&P.appendedPTS!==void 0&&G<=P.appendedPTS)return P}return this.getBufferedFrag(G,I)},L.getBufferedFrag=function(G,I){for(var P=this.fragments,M=Object.keys(P),C=M.length;C--;){var d=P[M[C]];if((d==null?void 0:d.body.type)===I&&d.buffered){var f=d.body;if(f.start<=G&&G<=f.end)return f}}return null},L.detectEvictedFragments=function(G,I,P){var M=this;Object.keys(this.fragments).forEach(function(C){var d=M.fragments[C];if(!d)return;if(!d.buffered){d.body.type===P&&M.removeFragment(d.body);return}var f=d.range[G];if(!f)return;f.time.some(function(p){var T=!M.isTimeBuffered(p.startPTS,p.endPTS,I);return T&&M.removeFragment(d.body),T})})},L.detectPartialFragments=function(G){var I=this,P=this.timeRanges,M=G.frag,C=G.part;if(!P||M.sn==="initSegment")return;var d=X(M),f=this.fragments[d];if(!f)return;Object.keys(P).forEach(function(p){var T=M.elementaryStreams[p];if(!T)return;var x=P[p],E=C!==null||T.partial===!0;f.range[p]=I.getBufferedTimes(M,C,E,x)}),f.backtrack=f.loaded=null,Object.keys(f.range).length?f.buffered=!0:this.removeFragment(f.body)},L.fragBuffered=function(G){var I=X(G),P=this.fragments[I];P&&(P.backtrack=P.loaded=null,P.buffered=!0)},L.getBufferedTimes=function(G,I,P,M){for(var C={time:[],partial:P},d=I?I.start:G.start,f=I?I.end:G.end,p=G.minEndPTS||f,T=G.maxStartPTS||d,x=0;x=E&&p<=k){C.time.push({startPTS:Math.max(d,M.start(x)),endPTS:Math.min(f,M.end(x))});break}else if(dE)C.partial=!0,C.time.push({startPTS:Math.max(d,M.start(x)),endPTS:Math.min(f,M.end(x))});else if(f<=E)break}return C},L.getPartialFragment=function(G){var I=null,P,M,C,d=0,f=this.bufferPadding,p=this.fragments;return Object.keys(p).forEach(function(T){var x=p[T];if(!x)return;q(x)&&(M=x.body.start-f,C=x.body.end+f,G>=M&&G<=C&&(P=Math.min(G-M,C-G),d<=P&&(I=x.body,d=P)))}),I},L.getState=function(G){var I=X(G),P=this.fragments[I];return P?P.buffered?q(P)?B.PARTIAL:B.OK:P.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},L.backtrack=function(G,I){var P=X(G),M=this.fragments[P];if(!M||M.backtrack)return null;var C=M.backtrack=I||M.loaded;return M.loaded=null,C},L.getBacktrackData=function(G){var I=X(G),P=this.fragments[I];if(P){var M,C=P.backtrack;if(C!=null&&(M=C.payload)!==null&&M!==void 0&&M.byteLength)return C;this.removeFragment(G)}return null},L.isTimeBuffered=function(G,I,P){for(var M,C,d=0;d=M&&I<=C)return!0;if(I<=M)return!1}return!1},L.onFragLoaded=function(G,I){var P=I.frag,M=I.part;if(P.sn==="initSegment"||P.bitrateTest||M)return;var C=X(P);this.fragments[C]={body:P,loaded:I,backtrack:null,buffered:!1,range:Object.create(null)}},L.onBufferAppended=function(G,I){var P=this,M=I.frag,C=I.part,d=I.timeRanges;if(M.type===K.PlaylistLevelType.MAIN)if(this.activeFragment=M,C){var f=this.activeParts;f||(this.activeParts=f=[]),f.push(C)}else this.activeParts=null;this.timeRanges=d,Object.keys(d).forEach(function(p){var T=d[p];if(P.detectEvictedFragments(p,T),!C)for(var x=0;xG&&M.removeFragment(f)}})},L.removeFragment=function(G){var I=X(G);G.stats.loaded=0,G.clearElementaryStreamInfo(),delete this.fragments[I]},L.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},V}();function q(V){var L,U;return V.buffered&&(((L=V.range.video)===null||L===void 0?void 0:L.partial)||((U=V.range.audio)===null||U===void 0?void 0:U.partial))}function X(V){return V.type+"_"+V.level+"_"+V.urlId+"_"+V.sn}},"./src/controller/gap-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"STALL_MINIMUM_DURATION_MS",function(){return q}),z.d(re,"MAX_START_GAP_JUMP",function(){return X}),z.d(re,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return V}),z.d(re,"SKIP_BUFFER_RANGE_START",function(){return L}),z.d(re,"default",function(){return U});var oe=z("./src/utils/buffer-helper.ts"),K=z("./src/errors.ts"),B=z("./src/events.ts"),se=z("./src/utils/logger.ts"),q=250,X=2,V=.1,L=.05,U=function(){function G(P,M,C,d){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=P,this.media=M,this.fragmentTracker=C,this.hls=d}var I=G.prototype;return I.destroy=function(){this.hls=this.fragmentTracker=this.media=null},I.poll=function(M){var C=this.config,d=this.media,f=this.stalled,p=d.currentTime,T=d.seeking,x=this.seeking&&!T,E=!this.seeking&&T;if(this.seeking=T,p!==M){if(this.moved=!0,f!==null){if(this.stallReported){var k=self.performance.now()-f;se.logger.warn("playback not stuck anymore @"+p+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((E||x)&&(this.stalled=null),d.paused||d.ended||d.playbackRate===0||!oe.BufferHelper.getBuffered(d).length)return;var w=oe.BufferHelper.bufferInfo(d,p,0),b=w.len>0,m=w.nextStart||0;if(!b&&!m)return;if(T){var v=w.len>X,g=!m||m-p>X&&!this.fragmentTracker.getPartialFragment(p);if(v||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var R,O=Math.max(m,w.start||0)-p,H=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,Z=H==null||((R=H.details)===null||R===void 0)?void 0:R.live,ee=Z?H.details.targetduration*2:X;if(O>0&&O<=ee){this._trySkipBufferHole(null);return}}var fe=self.performance.now();if(f===null){this.stalled=fe;return}var pe=fe-f;!T&&pe>=q&&this._reportStall(w.len);var xe=oe.BufferHelper.bufferInfo(d,p,C.maxBufferHole);this._tryFixBufferStall(xe,pe)},I._tryFixBufferStall=function(M,C){var d=this.config,f=this.fragmentTracker,p=this.media,T=p.currentTime,x=f.getPartialFragment(T);if(x){var E=this._trySkipBufferHole(x);if(E)return}M.len>d.maxBufferHole&&C>d.highBufferWatchdogPeriod*1e3&&(se.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},I._reportStall=function(M){var C=this.hls,d=this.media,f=this.stallReported;f||(this.stallReported=!0,se.logger.warn("Playback stalling at @"+d.currentTime+" due to low buffer (buffer="+M+")"),C.trigger(B.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:M}))},I._trySkipBufferHole=function(M){for(var C=this.config,d=this.hls,f=this.media,p=f.currentTime,T=0,x=oe.BufferHelper.getBuffered(f),E=0;E=T&&p.05&&this.forwardBufferLength>1){var E=Math.min(2,Math.max(1,d)),k=Math.round(2/(1+Math.exp(-.75*p-this.edgeStalled))*20)/20;G.playbackRate=Math.min(E,Math.max(1,k))}else G.playbackRate!==1&&G.playbackRate!==0&&(G.playbackRate=1)},L.estimateLiveEdge=function(){var G=this.levelDetails;return G===null?null:G.edge+G.age},L.computeLatency=function(){var G=this.estimateLiveEdge();return G===null?null:G-this.currentTime},q(V,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var G=this.config,I=this.levelDetails;return G.liveMaxLatencyDuration!==void 0?G.liveMaxLatencyDuration:I?G.liveMaxLatencyDurationCount*I.targetduration:0}},{key:"targetLatency",get:function(){var G=this.levelDetails;if(G===null)return null;var I=G.holdBack,P=G.partHoldBack,M=G.targetduration,C=this.config,d=C.liveSyncDuration,f=C.liveSyncDurationCount,p=C.lowLatencyMode,T=this.hls.userConfig,x=p&&P||I;(T.liveSyncDuration||T.liveSyncDurationCount||x===0)&&(x=d!==void 0?d:f*M);var E=M,k=1;return x+Math.min(this.stallCount*k,E)}},{key:"liveSyncPosition",get:function(){var G=this.estimateLiveEdge(),I=this.targetLatency,P=this.levelDetails;if(G===null||I===null||P===null)return null;var M=P.edge,C=G-I-this.edgeStalled,d=M-P.totalduration,f=M-(this.config.lowLatencyMode&&P.partTarget||P.targetduration);return Math.min(Math.max(d,C),f)}},{key:"drift",get:function(){var G=this.levelDetails;return G===null?1:G.drift}},{key:"edgeStalled",get:function(){var G=this.levelDetails;if(G===null)return 0;var I=(this.config.lowLatencyMode&&G.partTarget||G.targetduration)*3;return Math.max(G.age-I,0)}},{key:"forwardBufferLength",get:function(){var G=this.media,I=this.levelDetails;if(!G||!I)return 0;var P=G.buffered.length;return P?G.buffered.end(P-1):I.edge-this.currentTime}}]),V}()},"./src/controller/level-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return C});var oe=z("./src/types/level.ts"),K=z("./src/events.ts"),B=z("./src/errors.ts"),se=z("./src/utils/codecs.ts"),q=z("./src/controller/level-helper.ts"),X=z("./src/controller/base-playlist-controller.ts"),V=z("./src/types/loader.ts");function L(){return L=Object.assign||function(d){for(var f=1;f0){m=k[0].bitrate,k.sort(function(pe,xe){return pe.bitrate-xe.bitrate}),this._levels=k;for(var Z=0;Zthis.hls.config.fragLoadingMaxRetry&&(v=E.frag.level)):v=E.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(m=!1),v=k.level),b=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:v=E.level,b=!0;break}v!==void 0&&this.recoverLevel(E,v,b,m)},p.recoverLevel=function(x,E,k,w){var b=x.details,m=this._levels[E];if(m.loadError++,k){var v=this.retryLoadingOrFail(x);if(v)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var g=m.url.length;if(g>1&&m.loadError1){var w=(E.urlId+1)%k;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(b){b.urlId=w}),this.level=x}},p.onFragLoaded=function(x,E){var k=E.frag;if(k!==void 0&&k.type===V.PlaylistLevelType.MAIN){var w=this._levels[k.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},p.onLevelLoaded=function(x,E){var k,w=E.level,b=E.details,m=this._levels[w];if(!m){var v;this.warn("Invalid level index "+w),(v=E.deliveryDirectives)!==null&&v!==void 0&&v.skip&&(b.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(w,E,m.details)):(k=E.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(b.deltaUpdateFailed=!0)},p.onAudioTrackSwitched=function(x,E){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var w=-1,b=this.hls.audioTracks[E.id].groupId,m=0;m0){var w=k.urlId,b=k.url[w];if(x)try{b=x.addDirectives(b)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+E+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+w+" "+b),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:b,level:E,id:w,deliveryDirectives:x||null})}},p.removeLevel=function(x,E){var k=function(m,v){return v!==E},w=this._levels.filter(function(b,m){return m!==x?!0:b.url.length>1&&E!==void 0?(b.url=b.url.filter(k),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(k)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(k)),b.urlId=0,!0):!1}).map(function(b,m){var v=b.details;return v!=null&&v.fragments&&v.fragments.forEach(function(g){g.level=m}),b});this._levels=w,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:w})},G(f,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var E,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===x&&(E=k[x])!==null&&E!==void 0&&E.details)return;if(x<0||x>=k.length){var w=x<0;if(this.hls.trigger(K.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:w,reason:"invalid level idx"}),w)return;x=Math.min(x,k.length-1)}this.clearTimer();var b=this.currentLevelIndex,m=k[b],v=k[x];this.log("switching to level "+x+" from "+b),this.currentLevelIndex=x;var g=L({},v,{level:x,maxBitrate:v.maxBitrate,uri:v.uri,urlId:v.urlId});delete g._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,g);var R=v.details;if(!R||R.live){var O=this.switchParams(v.uri,m==null?void 0:m.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),f}(X.default)},"./src/controller/level-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"addGroupId",function(){return B}),z.d(re,"assignTrackIdsByGroup",function(){return se}),z.d(re,"updatePTS",function(){return q}),z.d(re,"updateFragPTSDTS",function(){return V}),z.d(re,"mergeDetails",function(){return L}),z.d(re,"mapPartIntersection",function(){return U}),z.d(re,"mapFragmentIntersection",function(){return G}),z.d(re,"adjustSliding",function(){return I}),z.d(re,"addSliding",function(){return P}),z.d(re,"computeReloadInterval",function(){return M}),z.d(re,"getFragmentWithSN",function(){return C}),z.d(re,"getPartWith",function(){return d});var oe=z("./src/polyfills/number.ts"),K=z("./src/utils/logger.ts");function B(f,p,T){switch(p){case"audio":f.audioGroupIds||(f.audioGroupIds=[]),f.audioGroupIds.push(T);break;case"text":f.textGroupIds||(f.textGroupIds=[]),f.textGroupIds.push(T);break}}function se(f){var p={};f.forEach(function(T){var x=T.groupId||"";T.id=p[x]=p[x]||0,p[x]++})}function q(f,p,T){var x=f[p],E=f[T];X(x,E)}function X(f,p){var T=p.startPTS;if(Object(oe.isFiniteNumber)(T)){var x=0,E;p.sn>f.sn?(x=T-f.start,E=f):(x=f.start-T,E=p),E.duration!==x&&(E.duration=x)}else if(p.sn>f.sn){var k=f.cc===p.cc;k&&f.minEndPTS?p.start=f.start+(f.minEndPTS-f.start):p.start=f.start+f.duration}else p.start=Math.max(f.start-p.duration,0)}function V(f,p,T,x,E,k){var w=x-T;w<=0&&(K.logger.warn("Fragment should have a positive duration",p),x=T+p.duration,k=E+p.duration);var b=T,m=x,v=p.startPTS,g=p.endPTS;if(Object(oe.isFiniteNumber)(v)){var R=Math.abs(v-T);Object(oe.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(R,p.deltaPTS):p.deltaPTS=R,b=Math.max(T,v),T=Math.min(T,v),E=Math.min(E,p.startDTS),m=Math.min(x,g),x=Math.max(x,g),k=Math.max(k,p.endDTS)}p.duration=x-T;var O=T-p.start;p.appendedPTS=x,p.start=p.startPTS=T,p.maxStartPTS=b,p.startDTS=E,p.endPTS=x,p.minEndPTS=m,p.endDTS=k;var H=p.sn;if(!f||Hf.endSN)return 0;var Z,ee=H-f.startSN,fe=f.fragments;for(fe[ee]=p,Z=ee;Z>0;Z--)X(fe[Z],fe[Z-1]);for(Z=ee;Z=0;E--){var k=x[E].initSegment;if(k){T=k;break}}f.fragmentHint&&delete f.fragmentHint.endPTS;var w=0,b;if(G(f,p,function(Z,ee){Z.relurl&&(w=Z.cc-ee.cc),Object(oe.isFiniteNumber)(Z.startPTS)&&Object(oe.isFiniteNumber)(Z.endPTS)&&(ee.start=ee.startPTS=Z.startPTS,ee.startDTS=Z.startDTS,ee.appendedPTS=Z.appendedPTS,ee.maxStartPTS=Z.maxStartPTS,ee.endPTS=Z.endPTS,ee.endDTS=Z.endDTS,ee.minEndPTS=Z.minEndPTS,ee.duration=Z.endPTS-Z.startPTS,ee.duration&&(b=ee),p.PTSKnown=p.alignedSliding=!0),ee.elementaryStreams=Z.elementaryStreams,ee.loader=Z.loader,ee.stats=Z.stats,ee.urlId=Z.urlId,Z.initSegment&&(ee.initSegment=Z.initSegment,T=Z.initSegment)}),T){var m=p.fragmentHint?p.fragments.concat(p.fragmentHint):p.fragments;m.forEach(function(Z){var ee;(!Z.initSegment||Z.initSegment.relurl===((ee=T)===null||ee===void 0?void 0:ee.relurl))&&(Z.initSegment=T)})}if(p.skippedSegments&&(p.deltaUpdateFailed=p.fragments.some(function(Z){return!Z}),p.deltaUpdateFailed)){K.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var v=p.skippedSegments;v--;)p.fragments.shift();p.startSN=p.fragments[0].sn,p.startCC=p.fragments[0].cc}var g=p.fragments;if(w){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var R=0;R=x.length)return;P(p,x[T].start)}function P(f,p){if(p){for(var T=f.fragments,x=f.skippedSegments;x0&&E0&&m===-1&&(this.log("Override startPosition with lastCurrentTime @"+v.toFixed(3)),m=v),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,E.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var m,v=this.levels,g=this.level,R=v==null||((m=v[g])===null||m===void 0)?void 0:m.details;if(R&&(!R.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(R))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var O,H=self.performance.now(),Z=this.retryDate;(!Z||H>=Z||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){E.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var m,v,g=this.hls,R=this.levelLastLoaded,O=this.levels,H=this.media,Z=g.config,ee=g.nextLoadLevel;if(R===null||!H&&(this.startFragRequested||!Z.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[ee])return;var fe=O[ee];this.level=g.nextLoadLevel=ee;var pe=fe.details;if(!pe||this.state===K.State.WAITING_LEVEL||pe.live&&this.levelLastLoaded!==ee){this.state=K.State.WAITING_LEVEL;return}var xe=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:H,V.PlaylistLevelType.MAIN);if(xe===null)return;var Ce=xe.len,be=this.getMaxBufferLength(fe.maxBitrate);if(Ce>=be)return;if(this._streamEnded(xe,pe)){var Oe={};this.altAudio&&(Oe.type="video"),this.hls.trigger(se.Events.BUFFER_EOS,Oe),this.state=K.State.ENDED;return}var We=xe.end,je=this.getNextFragment(We,pe);if(this.couldBacktrack&&!this.fragPrevious&&je&&je.sn!=="initSegment"){var ct=je.sn-pe.startSN;ct>1&&(je=pe.fragments[ct-1],this.fragmentTracker.removeFragment(je))}if(je&&this.fragmentTracker.getState(je)===X.FragmentState.OK&&this.nextLoadPosition>We){var Ge=this.audioOnly&&!this.altAudio?L.ElementaryStreamTypes.AUDIO:L.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(H,Ge,V.PlaylistLevelType.MAIN),je=this.getNextFragment(this.nextLoadPosition,pe)}if(!je)return;je.initSegment&&!je.initSegment.data&&!this.bitrateTest&&(je=je.initSegment),((m=je.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((v=je.decryptdata)!==null&&v!==void 0&&v.key)?this.loadKey(je,pe):this.loadFragment(je,pe,We)},w.loadFragment=function(m,v,g){var R,O=this.fragmentTracker.getState(m);if(this.fragCurrent=m,O===X.FragmentState.BACKTRACKED){var H=this.fragmentTracker.getBacktrackData(m);if(H){this._handleFragmentLoadProgress(H),this._handleFragmentLoadComplete(H);return}else O=X.FragmentState.NOT_LOADED}O===X.FragmentState.NOT_LOADED||O===X.FragmentState.PARTIAL?m.sn==="initSegment"?this._loadInitSegment(m):this.bitrateTest?(m.bitrateTest=!0,this.log("Fragment "+m.sn+" of level "+m.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(m)):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,m,v,g)):O===X.FragmentState.APPENDING?this.reduceMaxBufferLength(m.duration)&&this.fragmentTracker.removeFragment(m):((R=this.media)===null||R===void 0?void 0:R.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(m){var v=this.fragmentTracker.getAppendedFrag(m,V.PlaylistLevelType.MAIN);return v&&"fragment"in v?v.fragment:v},w.getBufferedFrag=function(m){return this.fragmentTracker.getBufferedFrag(m,V.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(m){return m?this.getBufferedFrag(m.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var m=this.levels,v=this.media;if(v!=null&&v.readyState){var g,R=this.getAppendedFrag(v.currentTime);if(R&&R.start>1&&this.flushMainBuffer(0,R.start-1),!v.paused&&m){var O=this.hls.nextLoadLevel,H=m[O],Z=this.fragLastKbps;Z&&this.fragCurrent?g=this.fragCurrent.duration*H.maxBitrate/(1e3*Z)+1:g=0}else g=0;var ee=this.getBufferedFrag(v.currentTime+g);if(ee){var fe=this.followingBufferedFrag(ee);if(fe){this.abortCurrentFrag();var pe=fe.maxStartPTS?fe.maxStartPTS:fe.start,xe=fe.duration,Ce=Math.max(ee.end,pe+Math.min(Math.max(xe-this.config.maxFragLookUpTolerance,xe*.5),xe*.75));this.flushMainBuffer(Ce,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var m=this.fragCurrent;this.fragCurrent=null,m!=null&&m.loader&&m.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(m,v){E.prototype.flushMainBuffer.call(this,m,v,this.altAudio?"video":null)},w.onMediaAttached=function(m,v){E.prototype.onMediaAttached.call(this,m,v);var g=v.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new I.default(this.config,g,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var m=this.media;m&&(m.removeEventListener("playing",this.onvplaying),m.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),E.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var m=this.media,v=m?m.currentTime:null;Object(oe.isFiniteNumber)(v)&&this.log("Media seeked to "+v.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(se.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(m,v){var g=!1,R=!1,O;v.levels.forEach(function(H){O=H.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(g=!0),O.indexOf("mp4a.40.5")!==-1&&(R=!0))}),this.audioCodecSwitch=g&&R&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=v.levels,this.startFragRequested=!1},w.onLevelLoading=function(m,v){var g=this.levels;if(!g||this.state!==K.State.IDLE)return;var R=g[v.level];(!R.details||R.details.live&&this.levelLastLoaded!==v.level||this.waitForCdnTuneIn(R.details))&&(this.state=K.State.WAITING_LEVEL)},w.onLevelLoaded=function(m,v){var g,R=this.levels,O=v.level,H=v.details,Z=H.totalduration;if(!R){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+H.startSN+","+H.endSN+"], cc ["+H.startCC+", "+H.endCC+"] duration:"+Z);var ee=this.fragCurrent;ee&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&(ee.level!==v.level&&ee.loader&&(this.state=K.State.IDLE,ee.loader.abort()));var fe=R[O],pe=0;if(H.live||(g=fe.details)!==null&&g!==void 0&&g.live){if(H.fragments[0]||(H.deltaUpdateFailed=!0),H.deltaUpdateFailed)return;pe=this.alignPlaylists(H,fe.details)}if(fe.details=H,this.levelLastLoaded=O,this.hls.trigger(se.Events.LEVEL_UPDATED,{details:H,level:O}),this.state===K.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(H))return;this.state=K.State.IDLE}this.startFragRequested?H.live&&this.synchronizeToLiveEdge(H):this.setStartPosition(H,pe),this.tick()},w._handleFragmentLoadProgress=function(m){var v,g=m.frag,R=m.part,O=m.payload,H=this.levels;if(!H){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var Z=H[g.level],ee=Z.details;if(!ee){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var fe=Z.videoCodec,pe=ee.PTSKnown||!ee.live,xe=(v=g.initSegment)===null||v===void 0?void 0:v.data,Ce=this._getAudioCodec(Z),be=this.transmuxer=this.transmuxer||new U.default(this.hls,V.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Oe=R?R.index:-1,We=Oe!==-1,je=new G.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,O.byteLength,Oe,We),ct=this.initPTS[g.cc];be.push(O,xe,Ce,fe,g,R,ee.totalduration,pe,je,ct)},w.onAudioTrackSwitching=function(m,v){var g=this.altAudio,R=!!v.url,O=v.id;if(!R){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var H=this.fragCurrent;H!=null&&H.loader&&(this.log("Switching to main audio track, cancel main fragment load"),H.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var Z=this.hls;g&&Z.trigger(se.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),Z.trigger(se.Events.AUDIO_TRACK_SWITCHED,{id:O})}},w.onAudioTrackSwitched=function(m,v){var g=v.id,R=!!this.hls.audioTracks[g].url;if(R){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=R,this.tick()},w.onBufferCreated=function(m,v){var g=v.tracks,R,O,H=!1;for(var Z in g){var ee=g[Z];if(ee.id==="main"){if(O=Z,R=ee,Z==="video"){var fe=g[Z];fe&&(this.videoBuffer=fe.buffer)}}else H=!0}H&&R?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=R.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(m,v){var g=v.frag,R=v.part;if(g&&g.type!==V.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(R?" p: "+R.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var O=R?R.stats:g.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,R)},w.onError=function(m,v){switch(v.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(V.PlaylistLevelType.MAIN,v);break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==K.State.ERROR&&(v.fatal?(this.warn(""+v.details),this.state=K.State.ERROR):!v.levelRetry&&this.state===K.State.WAITING_LEVEL&&(this.state=K.State.IDLE));break;case P.ErrorDetails.BUFFER_FULL_ERROR:if(v.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var g=!0,R=this.getFwdBufferInfo(this.media,V.PlaylistLevelType.MAIN);R&&R.len>.5&&(g=!this.reduceMaxBufferLength(R.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var m=this.media,v=this.gapController;if(!m||!v||!m.readyState)return;var g=q.BufferHelper.getBuffered(m);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):v.poll(this.lastCurrentTime),this.lastCurrentTime=m.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(m,v){var g=v.type;if(g!==L.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var R=(g===L.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(R,g,V.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(m,v){this.levels=v.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var m=this.media,v=m.currentTime,g=this.startPosition;if(g>=0&&v0&&(H1&&m.seeking===!1){var g=m.currentTime;if(q.BufferHelper.isBuffered(m,g)?v=this.getAppendedFrag(g):q.BufferHelper.isBuffered(m,g+.1)&&(v=this.getAppendedFrag(g+.1)),v){var R=this.fragPlaying,O=v.level;(!R||v.sn!==R.sn||R.level!==O||v.urlId!==R.urlId)&&(this.hls.trigger(se.Events.FRAG_CHANGED,{frag:v}),(!R||R.level!==O)&&this.hls.trigger(se.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=v)}}},d(k,[{key:"nextLevel",get:function(){var m=this.nextBufferedFrag;return m?m.level:-1}},{key:"currentLevel",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);if(v)return v.level}return-1}},{key:"nextBufferedFrag",get:function(){var m=this.media;if(m){var v=this.getAppendedFrag(m.currentTime);return this.followingBufferedFrag(v)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(K.default)},"./src/controller/subtitle-stream-controller.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"SubtitleStreamController",function(){return f});var oe=z("./src/events.ts"),K=z("./src/utils/logger.ts"),B=z("./src/utils/buffer-helper.ts"),se=z("./src/controller/fragment-finders.ts"),q=z("./src/utils/discontinuities.ts"),X=z("./src/controller/level-helper.ts"),V=z("./src/controller/fragment-tracker.ts"),L=z("./src/controller/base-stream-controller.ts"),U=z("./src/types/loader.ts"),G=z("./src/types/level.ts");function I(p,T){for(var x=0;x=v[O].start&&R<=v[O].end){g=v[O];break}var H=b.start+b.duration;g?g.end=H:(g={start:R,end:H},v.push(g)),this.fragmentTracker.fragBuffered(b)},x.onBufferFlushing=function(k,w){var b=w.startOffset,m=w.endOffset;if(b===0&&m!==Number.POSITIVE_INFINITY){var v=this.currentTrackId,g=this.levels;if(!g.length||!g[v]||!g[v].details)return;var R=g[v].details,O=R.targetduration,H=m-O;if(H<=0)return;w.endOffsetSubtitles=Math.max(0,H),this.tracksBuffered.forEach(function(Z){for(var ee=0;ee=R.length||v!==g||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,m.live||(b=O.details)!==null&&b!==void 0&&b.live){var H=this.mainDetails;if(m.deltaUpdateFailed||!H)return;var Z=H.fragments[0];if(!O.details)m.hasProgramDateTime&&H.hasProgramDateTime?Object(q.alignMediaPlaylistByPDT)(m,H):Z&&Object(X.addSliding)(m,Z.start);else{var ee=this.alignPlaylists(m,O.details);ee===0&&Z&&Object(X.addSliding)(m,Z.start)}}if(O.details=m,this.levelLastLoaded=v,this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===L.State.IDLE){var fe=Object(se.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);fe||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},x._handleFragmentLoadComplete=function(k){var w=k.frag,b=k.payload,m=w.decryptdata,v=this.hls;if(this.fragContextChanged(w))return;if(b&&b.byteLength>0&&m&&m.key&&m.iv&&m.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),m.key.buffer,m.iv.buffer).then(function(R){var O=performance.now();v.trigger(oe.Events.FRAG_DECRYPTED,{frag:w,payload:R,stats:{tstart:g,tdecrypt:O}})})}},x.doTick=function(){if(!this.media){this.state=L.State.IDLE;return}if(this.state===L.State.IDLE){var k,w=this.currentTrackId,b=this.levels;if(!b.length||!b[w]||!b[w].details)return;var m=b[w].details,v=m.targetduration,g=this.config,R=this.media,O=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,R.currentTime-v,g.maxBufferHole),H=O.end,Z=O.len,ee=this.getMaxBufferLength()+v;if(Z>ee)return;console.assert(m,"Subtitle track details are defined on idle subtitle stream controller tick");var fe=m.fragments,pe=fe.length,xe=m.edge,Ce,be=this.fragPrevious;if(H-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},M.pollTrackChange=function(d){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,d)},M.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var d=G(this.media.textTracks);d.forEach(function(f){Object(K.clearCurrentCues)(f)}),this.subtitleTrack=-1,this.media=null},M.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},M.onManifestParsed=function(d,f){this.tracks=f.subtitleTracks},M.onSubtitleTrackLoaded=function(d,f){var p=f.id,T=f.details,x=this.trackId,E=this.tracksInGroup[x];if(!E){this.warn("Invalid subtitle track id "+p);return}var k=E.details;E.details=f.details,this.log("subtitle track "+p+" loaded ["+T.startSN+"-"+T.endSN+"]"),p===this.trackId&&(this.retryCount=0,this.playlistLoaded(p,f,k))},M.onLevelLoading=function(d,f){this.switchLevel(f.level)},M.onLevelSwitching=function(d,f){this.switchLevel(f.level)},M.switchLevel=function(d){var f=this.hls.levels[d];if(!(f!=null&&f.textGroupIds))return;var p=f.textGroupIds[f.urlId];if(this.groupId!==p){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(w){return!p||w.groupId===p});this.tracksInGroup=x;var E=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=p;var k={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+p+'" group-id'),this.hls.trigger(oe.Events.SUBTITLE_TRACKS_UPDATED,k),E!==-1&&this.setSubtitleTrack(E,T)}},M.findTrackId=function(d){for(var f=this.tracksInGroup,p=0;p=T.length)return;this.clearTimer();var x=T[d];if(this.log("Switching to subtitle track "+d),this.trackId=d,x){var E=x.id,k=x.groupId,w=k===void 0?"":k,b=x.name,m=x.type,v=x.url;this.hls.trigger(oe.Events.SUBTITLE_TRACK_SWITCH,{id:E,groupId:w,name:b,type:m,url:v});var g=this.switchParams(x.url,f==null?void 0:f.details);this.loadPlaylist(g)}else this.hls.trigger(oe.Events.SUBTITLE_TRACK_SWITCH,{id:d})},M.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var d=-1,f=G(this.media.textTracks),p=0;p=0&&(m[0]=Math.min(m[0],T),m[1]=Math.max(m[1],x),w=!0,v/(x-T)>.5))return}if(w||k.push([T,x]),this.config.renderTextTracksNatively){var g=this.captionsTracks[p];this.Cues.newCue(g,T,x,E)}else{var R=this.Cues.newCue(null,T,x,E);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:R,track:p})}},d.onInitPtsFound=function(p,T){var x=this,E=T.frag,k=T.id,w=T.initPTS,b=T.timescale,m=this.unparsedVttFrags;k==="main"&&(this.initPTS[E.cc]=w,this.timescale[E.cc]=b),m.length&&(this.unparsedVttFrags=[],m.forEach(function(v){x.onFragLoaded(K.Events.FRAG_LOADED,v)}))},d.getExistingTrack=function(p){var T=this.media;if(T)for(var x=0;x>>8^b&255^99,V[E]=b,L[b]=E;var m=x[E],v=x[m],g=x[v],R=x[b]*257^b*16843008;G[E]=R<<24|R>>>8,I[E]=R<<16|R>>>16,P[E]=R<<8|R>>>24,M[E]=R,R=g*16843009^v*65537^m*257^E*16843008,d[b]=R<<24|R>>>8,f[b]=R<<16|R>>>16,p[b]=R<<8|R>>>24,T[b]=R,E?(E=m^x[x[x[g^m]]],k^=x[x[k]]):E=k=1}},q.expandKey=function(V){for(var L=this.uint8ArrayToUint32Array_(V),U=!0,G=0;G>>6)+1;var R=(p[T+2]&60)>>>2;if(R>g.length-1){f.trigger(B.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+R});return}return w=(p[T+2]&1)<<2,w|=(p[T+3]&192)>>>6,oe.logger.log("manifest codec:"+x+", ADTS type:"+E+", samplingIndex:"+R),/firefox/i.test(m)?R>=6?(E=5,b=new Array(4),k=R-3):(E=2,b=new Array(2),k=R):m.indexOf("android")!==-1?(E=2,b=new Array(2),k=R):(E=5,b=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&R>=6?k=R-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(R>=6&&w===1||/vivaldi/i.test(m))||!x&&w===1)&&(E=2,b=new Array(2)),k=R)),b[0]=E<<3,b[0]|=(R&14)>>1,b[1]|=(R&1)<<7,b[1]|=w<<3,E===5&&(b[1]|=(k&14)>>1,b[2]=(k&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:g[R],channelCount:w,codec:"mp4a.40."+E,manifestCodec:v}}function q(f,p){return f[p]===255&&(f[p+1]&246)===240}function X(f,p){return f[p+1]&1?7:9}function V(f,p){return(f[p+3]&3)<<11|f[p+4]<<3|(f[p+5]&224)>>>5}function L(f,p){return p+5=f.length)return!1;var x=V(f,p);if(x<=T)return!1;var E=p+x;return E===f.length||U(f,E)}return!1}function P(f,p,T,x,E){if(!f.samplerate){var k=se(p,T,x,E);if(!k)return;f.config=k.config,f.samplerate=k.samplerate,f.channelCount=k.channelCount,f.codec=k.codec,f.manifestCodec=k.manifestCodec,oe.logger.log("parsed codec:"+f.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function M(f){return 1024*9e4/f}function C(f,p,T,x,E){var k=X(f,p),w=V(f,p);if(w-=k,w>0){var b=T+x*E;return{headerLength:k,frameLength:w,stamp:b}}}function d(f,p,T,x,E){var k=M(f.samplerate),w=C(p,T,x,E,k);if(w){var b=w.frameLength,m=w.headerLength,v=w.stamp,g=m+b,R=Math.max(0,T+g-p.length),O;R?(O=new Uint8Array(g-m),O.set(p.subarray(T+m,p.length),0)):O=p.subarray(T+m,T+g);var H={unit:O,pts:v};return R||f.samples.push(H),{sample:H,length:g,missing:R}}}},"./src/demux/base-audio-demuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"initPTSFn",function(){return V});var oe=z("./src/polyfills/number.ts"),K=z("./src/demux/id3.ts"),B=z("./src/demux/dummy-demuxed-track.ts"),se=z("./src/utils/mp4-tools.ts"),q=z("./src/utils/typed-array.ts"),X=function(){function L(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var U=L.prototype;return U.resetInitSegment=function(I,P,M){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},U.resetTimeStamp=function(){},U.resetContiguity=function(){},U.canParse=function(I,P){return!1},U.appendFrame=function(I,P,M){},U.demux=function(I,P){this.cachedData&&(I=Object(se.appendUint8Array)(this.cachedData,I),this.cachedData=null);var M=K.getID3Data(I,0),C=M?M.length:0,d,f,p=this._audioTrack,T=this._id3Track,x=M?K.getTimeStamp(M):void 0,E=I.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=V(x,P)),M&&M.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:M}),f=this.initPTS;CX?(this.word<<=X,this.bitsAvailable-=X):(X-=this.bitsAvailable,V=X>>3,X-=V>>3,this.bytesAvailable-=V,this.loadWord(),this.word<<=X,this.bitsAvailable-=X)},se.readBits=function(X){var V=Math.min(this.bitsAvailable,X),L=this.word>>>32-V;return X>32&&oe.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=V,this.bitsAvailable>0?this.word<<=V:this.bytesAvailable>0&&this.loadWord(),V=X-V,V>0&&this.bitsAvailable?L<>>X)!==0)return this.word<<=X,this.bitsAvailable-=X,X;return this.loadWord(),X+this.skipLZ()},se.skipUEG=function(){this.skipBits(1+this.skipLZ())},se.skipEG=function(){this.skipBits(1+this.skipLZ())},se.readUEG=function(){var X=this.skipLZ();return this.readBits(X+1)-1},se.readEG=function(){var X=this.readUEG();return 1&X?1+X>>>1:-1*(X>>>1)},se.readBoolean=function(){return this.readBits(1)===1},se.readUByte=function(){return this.readBits(8)},se.readUShort=function(){return this.readBits(16)},se.readUInt=function(){return this.readBits(32)},se.skipScalingList=function(X){for(var V=8,L=8,U,G=0;G0?E.subarray(w,w+b):void 0},se=function(E,k){var w=0;return w=(E[k]&127)<<21,w|=(E[k+1]&127)<<14,w|=(E[k+2]&127)<<7,w|=E[k+3]&127,w},q=function(E,k){return oe(E,k)&&se(E,k+6)+10<=E.length-k},X=function(E){for(var k=U(E),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:H+=String.fromCharCode(g);break;case 12:case 13:R=E[Z++],H+=String.fromCharCode((g&31)<<6|R&63);break;case 14:R=E[Z++],O=E[Z++],H+=String.fromCharCode((g&15)<<12|(R&63)<<6|(O&63)<<0);break;default:}}return H},f={decodeTextFrame:P},p;function T(){return!p&&typeof self.TextDecoder!="undefined"&&(p=new self.TextDecoder("utf-8")),p}},"./src/demux/mp3demuxer.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/demux/base-audio-demuxer.ts"),K=z("./src/demux/id3.ts"),B=z("./src/utils/logger.ts"),se=z("./src/demux/mpegaudio.ts");function q(L,U){L.prototype=Object.create(U.prototype),L.prototype.constructor=L,X(L,U)}function X(L,U){return X=Object.setPrototypeOf||function(I,P){return I.__proto__=P,I},X(L,U)}var V=function(L){q(U,L);function U(){return L.apply(this,arguments)||this}var G=U.prototype;return G.resetInitSegment=function(P,M,C){L.prototype.resetInitSegment.call(this,P,M,C),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:P,duration:C,inputTimeScale:9e4,dropped:0}},U.probe=function(P){if(!P)return!1;for(var M=K.getID3Data(P,0)||[],C=M.length,d=P.length;C0},q.demux=function(V){var L=V,U=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(L=Object(oe.appendUint8Array)(this.remainderData,V));var G=Object(oe.segmentValidRange)(L);this.remainderData=G.remainder,U.samples=G.valid||new Uint8Array}else U.samples=L;return{audioTrack:Object(K.dummyTrack)(),avcTrack:U,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.flush=function(){var V=Object(K.dummyTrack)();return V.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(K.dummyTrack)(),avcTrack:V,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},q.demuxSampleAes=function(V,L,U){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},q.destroy=function(){},se}();B.minProbeByteLength=1024,re.default=B},"./src/demux/mpegaudio.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"appendFrame",function(){return X}),z.d(re,"parseHeader",function(){return V}),z.d(re,"isHeaderPattern",function(){return L}),z.d(re,"isHeader",function(){return U}),z.d(re,"canParse",function(){return G}),z.d(re,"probe",function(){return I});var oe=null,K=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],se=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],q=[0,1,1,4];function X(P,M,C,d,f){if(C+24>M.length)return;var p=V(M,C);if(p&&C+p.frameLength<=M.length){var T=p.samplesPerFrame*9e4/p.sampleRate,x=d+f*T,E={unit:M.subarray(C,C+p.frameLength),pts:x,dts:x};return P.config=[],P.channelCount=p.channelCount,P.samplerate=p.sampleRate,P.samples.push(E),{sample:E,length:p.frameLength,missing:0}}}function V(P,M){var C=P[M+1]>>3&3,d=P[M+1]>>1&3,f=P[M+2]>>4&15,p=P[M+2]>>2&3;if(C!==1&&f!==0&&f!==15&&p!==3){var T=P[M+2]>>1&1,x=P[M+3]>>6,E=C===3?3-d:d===3?3:4,k=K[E*14+f-1]*1e3,w=C===3?0:C===2?1:2,b=B[w*3+p],m=x===3?1:2,v=se[C][d],g=q[d],R=v*8*g,O=Math.floor(v*k/b+T)*g;if(oe===null){var H=navigator.userAgent||"",Z=H.match(/Chrome\/(\d+)/i);oe=Z?parseInt(Z[1]):0}var ee=!!oe&&oe<=87;return ee&&d===2&&k>=224e3&&x===0&&(P[M+3]=P[M+3]|128),{sampleRate:b,channelCount:m,frameLength:O,samplesPerFrame:R}}}function L(P,M){return P[M]===255&&(P[M+1]&224)===224&&(P[M+1]&6)!==0}function U(P,M){return M+1=V.length){U();return}if(V[L].unit.length<32)continue;var G=this.decrypter.isSync();if(this.decryptAacSample(V,L,U,G),!G)return}},q.getAvcEncryptedData=function(V){for(var L=Math.floor((V.length-48)/160)*16+16,U=new Int8Array(L),G=0,I=32;I<=V.length-16;I+=160,G+=16)U.set(V.subarray(I,I+16),G);return U},q.getAvcDecryptedUnit=function(V,L){for(var U=new Uint8Array(L),G=0,I=32;I<=V.length-16;I+=160,G+=16)V.set(U.subarray(G,G+16),I);return V},q.decryptAvcSample=function(V,L,U,G,I,P){var M=Object(K.discardEPB)(I.data),C=this.getAvcEncryptedData(M),d=this;this.decryptBuffer(C.buffer,function(f){I.data=d.getAvcDecryptedUnit(M,f),P||d.decryptAvcSamples(V,L,U+1,G)})},q.decryptAvcSamples=function(V,L,U,G){if(V instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;L++,U=0){if(L>=V.length){G();return}for(var I=V[L].units;!(U>=I.length);U++){var P=I[U];if(P.data.length<=48||P.type!==1&&P.type!==5)continue;var M=this.decrypter.isSync();if(this.decryptAvcSample(V,L,U,G,P,M),!M)return}}},se}();re.default=B},"./src/demux/transmuxer-interface.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I});var oe=z("./node_modules/webworkify-webpack/index.js"),K=z.n(oe),B=z("./src/events.ts"),se=z("./src/demux/transmuxer.ts"),q=z("./src/utils/logger.ts"),X=z("./src/errors.ts"),V=z("./src/utils/mediasource-helper.ts"),L=z("./node_modules/eventemitter3/index.js"),U=z.n(L),G=Object(V.getMediaSource)()||{isTypeSupported:function(){return!1}},I=function(){function P(C,d,f,p){var T=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=C,this.id=d,this.onTransmuxComplete=f,this.onFlush=p;var x=C.config,E=function(v,g){g=g||{},g.frag=T.frag,g.id=T.id,C.trigger(v,g)};this.observer=new L.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,E),this.observer.on(B.Events.ERROR,E);var k={mp4:G.isTypeSupported("video/mp4"),mpeg:G.isTypeSupported("audio/mpeg"),mp3:G.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){q.logger.log("demuxing in webworker");var b;try{b=this.worker=oe("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(m){C.trigger(B.Events.ERROR,{type:X.ErrorTypes.OTHER_ERROR,details:X.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(m.message+" ("+m.filename+":"+m.lineno+")")})},b.postMessage({cmd:"init",typeSupported:k,vendor:w,id:d,config:JSON.stringify(x)})}catch(m){q.logger.warn("Error in worker:",m),q.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new se.default(this.observer,k,x,w,d),this.worker=null}}else this.transmuxer=new se.default(this.observer,k,x,w,d)}var M=P.prototype;return M.destroy=function(){var d=this.worker;if(d)d.removeEventListener("message",this.onwmsg),d.terminate(),this.worker=null;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var p=this.observer;p&&p.removeAllListeners(),this.observer=null},M.push=function(d,f,p,T,x,E,k,w,b,m){var v=this;b.transmuxing.start=self.performance.now();var g=this.transmuxer,R=this.worker,O=E?E.start:x.start,H=x.decryptdata,Z=this.frag,ee=!(Z&&x.cc===Z.cc),fe=!(Z&&b.level===Z.level),pe=Z?b.sn-Z.sn:-1,xe=this.part?b.part-this.part.index:1,Ce=!fe&&(pe===1||pe===0&&xe===1),be=self.performance.now();(fe||pe||x.stats.parsing.start===0)&&(x.stats.parsing.start=be),E&&(xe||!Ce)&&(E.stats.parsing.start=be);var Oe=new se.TransmuxState(ee,Ce,w,fe,O);if(!Ce||ee){q.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+` discontinuity: `+ee+` trackSwitch: `+fe+` contiguous: `+Ce+` accurateTimeOffset: `+w+` - timeOffset: `+O);var We=new se.TransmuxConfig(p,T,f,k,m);this.configureTransmuxer(We)}if(this.frag=x,this.part=E,R)R.postMessage({cmd:"demux",data:d,decryptdata:G,chunkMeta:b,state:Oe},d instanceof ArrayBuffer?[d]:[]);else if(g){var Ue=g.push(d,G,b,Oe);Object(se.isPromise)(Ue)?Ue.then(function(ct){v.handleTransmuxComplete(ct)}):this.handleTransmuxComplete(Ue)}},I.flush=function(d){var f=this;d.transmuxing.start=self.performance.now();var p=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:d});else if(p){var x=p.flush(d);Object(se.isPromise)(x)?x.then(function(E){f.handleFlushResult(E,d)}):this.handleFlushResult(x,d)}},I.handleFlushResult=function(d,f){var p=this;d.forEach(function(T){p.handleTransmuxComplete(T)}),this.onFlush(f)},I.onWorkerMessage=function(d){var f=d.data,p=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,p.trigger(f.event,f.data);break}}},I.configureTransmuxer=function(d){var f=this.worker,p=this.transmuxer;f?f.postMessage({cmd:"configure",config:d}):p&&p.configure(d)},I.handleTransmuxComplete=function(d){d.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(d)},P}()},"./src/demux/transmuxer-worker.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return X});var oe=H("./src/demux/transmuxer.ts"),K=H("./src/events.ts"),B=H("./src/utils/logger.ts"),se=H("./node_modules/eventemitter3/index.js"),q=H.n(se);function X(M){var P=new se.EventEmitter,I=function(d,f){M.postMessage({event:d,data:f})};P.on(K.Events.FRAG_DECRYPTED,I),P.on(K.Events.ERROR,I),M.addEventListener("message",function(C){var d=C.data;switch(d.cmd){case"init":{var f=JSON.parse(d.config);M.transmuxer=new oe.default(P,d.typeSupported,f,d.vendor,d.id),Object(B.enableLogs)(f.debug),I("init",null);break}case"configure":{M.transmuxer.configure(d.config);break}case"demux":{var p=M.transmuxer.push(d.data,d.decryptdata,d.chunkMeta,d.state);Object(oe.isPromise)(p)?p.then(function(E){V(M,E)}):V(M,p);break}case"flush":{var T=d.chunkMeta,x=M.transmuxer.flush(T);Object(oe.isPromise)(x)?x.then(function(E){U(M,E,T)}):U(M,x,T);break}default:break}})}function V(M,P){if(W(P.remuxResult))return;var I=[],C=P.remuxResult,d=C.audio,f=C.video;d&&L(I,d),f&&L(I,f),M.postMessage({event:"transmuxComplete",data:P},I)}function L(M,P){P.data1&&M.push(P.data1.buffer),P.data2&&M.push(P.data2.buffer)}function U(M,P,I){P.forEach(function(C){V(M,C)}),M.postMessage({event:"flush",data:I})}function W(M){return!M.audio&&!M.video&&!M.text&&!M.id3&&!M.initSegment}},"./src/demux/transmuxer.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return f}),H.d(re,"isPromise",function(){return x}),H.d(re,"TransmuxConfig",function(){return E}),H.d(re,"TransmuxState",function(){return k});var oe=H("./src/events.ts"),K=H("./src/errors.ts"),B=H("./src/crypt/decrypter.ts"),se=H("./src/demux/aacdemuxer.ts"),q=H("./src/demux/mp4demuxer.ts"),X=H("./src/demux/tsdemuxer.ts"),V=H("./src/demux/mp3demuxer.ts"),L=H("./src/remux/mp4-remuxer.ts"),U=H("./src/remux/passthrough-remuxer.ts"),W=H("./src/demux/chunk-cache.ts"),M=H("./src/utils/mp4-tools.ts"),P=H("./src/utils/logger.ts"),I;try{I=self.performance.now.bind(self.performance)}catch(w){P.logger.debug("Unable to use Performance API on this environment"),I=self.Date.now}var C=[{demux:X.default,remux:L.default},{demux:q.default,remux:U.default},{demux:se.default,remux:L.default},{demux:V.default,remux:L.default}],d=1024;C.forEach(function(w){var b=w.demux;d=Math.max(d,b.minProbeByteLength)});var f=function(){function w(m,v,g,R,O){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new W.default,this.observer=m,this.typeSupported=v,this.config=g,this.vendor=R,this.id=O}var b=w.prototype;return b.configure=function(v){this.transmuxConfig=v,this.decrypter&&this.decrypter.reset()},b.push=function(v,g,R,O){var G=this,Z=R.transmuxing;Z.executeStart=I();var ee=new Uint8Array(v),fe=this.cache,pe=this.config,xe=this.currentTransmuxState,Ce=this.transmuxConfig;O&&(this.currentTransmuxState=O);var be=p(ee,g);if(be&&be.method==="AES-128"){var Oe=this.getDecrypter();if(pe.enableSoftwareAES){var We=Oe.softwareDecrypt(ee,be.key.buffer,be.iv.buffer);if(!We)return Z.executeEnd=I(),T(R);ee=new Uint8Array(We)}else return this.decryptionPromise=Oe.webCryptoDecrypt(ee,be.key.buffer,be.iv.buffer).then(function(Fe){var $e=G.push(Fe,null,R);return G.decryptionPromise=null,$e}),this.decryptionPromise}var Ue=O||xe,ct=Ue.contiguous,Ge=Ue.discontinuity,Je=Ue.trackSwitch,Xe=Ue.accurateTimeOffset,Ye=Ue.timeOffset,ke=Ce.audioCodec,Y=Ce.videoCodec,A=Ce.defaultInitPts,_=Ce.duration,J=Ce.initSegmentData;if((Ge||Je)&&this.resetInitSegment(J,ke,Y,_),Ge&&this.resetInitialTimestamp(A),ct||this.resetContiguity(),this.needsProbing(ee,Ge,Je)){if(fe.dataLength){var ae=fe.flush();ee=Object(M.appendUint8Array)(ae,ee)}this.configureTransmuxer(ee,Ce)}var $=this.transmux(ee,be,Ye,Xe,R),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,Z.executeEnd=I(),$},b.flush=function(v){var g=this,R=v.transmuxing;R.executeStart=I();var O=this.decrypter,G=this.cache,Z=this.currentTransmuxState,ee=this.decryptionPromise;if(ee)return ee.then(function(){return g.flush(v)});var fe=[],pe=Z.timeOffset;if(O){var xe=O.flush();xe&&fe.push(this.push(xe,null,v))}var Ce=G.dataLength;G.reset();var be=this.demuxer,Oe=this.remuxer;if(!be||!Oe)return Ce>=d&&this.observer.emit(oe.Events.ERROR,oe.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),R.executeEnd=I(),[T(v)];var We=be.flush(pe);return x(We)?We.then(function(Ue){return g.flushRemux(fe,Ue,v),fe}):(this.flushRemux(fe,We,v),fe)},b.flushRemux=function(v,g,R){var O=g.audioTrack,G=g.avcTrack,Z=g.id3Track,ee=g.textTrack,fe=this.currentTransmuxState,pe=fe.accurateTimeOffset,xe=fe.timeOffset;P.logger.log("[transmuxer.ts]: Flushed fragment "+R.sn+(R.part>-1?" p: "+R.part:"")+" of level "+R.level);var Ce=this.remuxer.remux(O,G,Z,ee,xe,pe,!0,this.id);v.push({remuxResult:Ce,chunkMeta:R}),R.transmuxing.executeEnd=I()},b.resetInitialTimestamp=function(v){var g=this.demuxer,R=this.remuxer;if(!g||!R)return;g.resetTimeStamp(v),R.resetTimeStamp(v)},b.resetContiguity=function(){var v=this.demuxer,g=this.remuxer;if(!v||!g)return;v.resetContiguity(),g.resetNextTimestamp()},b.resetInitSegment=function(v,g,R,O){var G=this.demuxer,Z=this.remuxer;if(!G||!Z)return;G.resetInitSegment(g,R,O),Z.resetInitSegment(v,g,R)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(v,g,R,O,G){var Z;return g&&g.method==="SAMPLE-AES"?Z=this.transmuxSampleAes(v,g,R,O,G):Z=this.transmuxUnencrypted(v,R,O,G),Z},b.transmuxUnencrypted=function(v,g,R,O){var G=this.demuxer.demux(v,g,!1,!this.config.progressive),Z=G.audioTrack,ee=G.avcTrack,fe=G.id3Track,pe=G.textTrack,xe=this.remuxer.remux(Z,ee,fe,pe,g,R,!1,this.id);return{remuxResult:xe,chunkMeta:O}},b.transmuxSampleAes=function(v,g,R,O,G){var Z=this;return this.demuxer.demuxSampleAes(v,g,R).then(function(ee){var fe=Z.remuxer.remux(ee.audioTrack,ee.avcTrack,ee.id3Track,ee.textTrack,R,O,!1,Z.id);return{remuxResult:fe,chunkMeta:G}})},b.configureTransmuxer=function(v,g){for(var R=this.config,O=this.observer,G=this.typeSupported,Z=this.vendor,ee=g.audioCodec,fe=g.defaultInitPts,pe=g.duration,xe=g.initSegmentData,Ce=g.videoCodec,be,Oe=0,We=C.length;Oe0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(m=b),m}var T=function(b){return{remuxResult:{},chunkMeta:b}};function x(w){return"then"in w&&w.then instanceof Function}var E=function(b,m,v,g,R){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=m,this.initSegmentData=v,this.duration=g,this.defaultInitPts=R},k=function(b,m,v,g,R){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=m,this.accurateTimeOffset=v,this.trackSwitch=g,this.timeOffset=R}},"./src/demux/tsdemuxer.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"discardEPB",function(){return T});var oe=H("./src/demux/adts.ts"),K=H("./src/demux/mpegaudio.ts"),B=H("./src/demux/exp-golomb.ts"),se=H("./src/demux/id3.ts"),q=H("./src/demux/sample-aes.ts"),X=H("./src/events.ts"),V=H("./src/utils/mp4-tools.ts"),L=H("./src/utils/logger.ts"),U=H("./src/errors.ts"),W={video:1,audio:2,id3:3,text:4},M=function(){function x(k,w,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=k,this.config=w,this.typeSupported=b}x.probe=function(w){var b=x.syncOffset(w);return b<0?!1:(b&&L.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},x.syncOffset=function(w){for(var b=Math.min(1e3,w.length-3*188),m=0;m>4,ke=void 0;if(Ye>1){if(ke=Ge+5+w[Ge+4],ke===Ge+188)continue}else ke=Ge+4;switch(Xe){case Z:Je&&(ee&&(g=d(ee))&&this.parseAVCPES(g,!1),ee={data:[],size:0}),ee&&(ee.data.push(w.subarray(ke,Ge+188)),ee.size+=Ge+188-ke);break;case fe:Je&&(xe&&(g=d(xe))&&(O.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),xe={data:[],size:0}),xe&&(xe.data.push(w.subarray(ke,Ge+188)),xe.size+=Ge+188-ke);break;case pe:Je&&(Ce&&(g=d(Ce))&&this.parseID3PES(g),Ce={data:[],size:0}),Ce&&(Ce.data.push(w.subarray(ke,Ge+188)),Ce.size+=Ge+188-ke);break;case 0:Je&&(ke+=w[ke]+1),We=this._pmtId=I(w,ke);break;case We:{Je&&(ke+=w[ke]+1);var Y=C(w,ke,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,m);Z=Y.avc,Z>0&&(R.pid=Z),fe=Y.audio,fe>0&&(O.pid=fe,O.isAAC=Y.isAAC),pe=Y.id3,pe>0&&(G.pid=pe),be&&!Oe&&(L.logger.log("reparse from beginning"),be=!1,Ge=ct-188),Oe=this.pmtParsed=!0;break}case 17:case 8191:break;default:be=!0;break}}else this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});R.pesData=ee,O.pesData=xe,G.pesData=Ce;var A={audioTrack:O,avcTrack:R,id3Track:G,textTrack:this._txtTrack};return v&&this.extractRemainingSamples(A),A},E.flush=function(){var w=this.remainderData;this.remainderData=null;var b;return w?b=this.demux(w,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},E.extractRemainingSamples=function(w){var b=w.audioTrack,m=w.avcTrack,v=w.id3Track,g=m.pesData,R=b.pesData,O=v.pesData,G;g&&(G=d(g))?(this.parseAVCPES(G,!0),m.pesData=null):m.pesData=g,R&&(G=d(R))?(b.isAAC?this.parseAACPES(G):this.parseMPEGPES(G),b.pesData=null):(R!=null&&R.size&&L.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=R),O&&(G=d(O))?(this.parseID3PES(G),v.pesData=null):v.pesData=O},E.demuxSampleAes=function(w,b,m){var v=this.demux(w,m,!0,!this.config.progressive),g=this.sampleAes=new q.default(this.observer,this.config,b);return this.decrypt(v,g)},E.decrypt=function(w,b){return new Promise(function(m){var v=w.audioTrack,g=w.avcTrack;v.samples&&v.isAAC?b.decryptAacSamples(v.samples,0,function(){g.samples?b.decryptAvcSamples(g.samples,0,0,function(){m(w)}):m(w)}):g.samples&&b.decryptAvcSamples(g.samples,0,0,function(){m(w)})})},E.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},E.parseAVCPES=function(w,b){var m=this,v=this._avcTrack,g=this.parseAVCNALu(w.data),R=!1,O=this.avcSample,G,Z=!1;w.data=null,O&&g.length&&!v.audFound&&(f(O,v),O=this.avcSample=P(!1,w.pts,w.dts,"")),g.forEach(function(ee){switch(ee.type){case 1:{G=!0,O||(O=m.avcSample=P(!0,w.pts,w.dts,"")),R&&(O.debug+="NDR "),O.frame=!0;var fe=ee.data;if(Z&&fe.length>4){var pe=new B.default(fe).readSliceType();(pe===2||pe===4||pe===7||pe===9)&&(O.key=!0)}break}case 5:G=!0,O||(O=m.avcSample=P(!0,w.pts,w.dts,"")),R&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{G=!0,R&&O&&(O.debug+="SEI ");var xe=new B.default(T(ee.data));xe.readUByte();for(var Ce=0,be=0,Oe=!1,We=0;!Oe&&xe.bytesAvailable>1;){Ce=0;do We=xe.readUByte(),Ce+=We;while(We===255);be=0;do We=xe.readUByte(),be+=We;while(We===255);if(Ce===4&&xe.bytesAvailable!==0){Oe=!0;var Ue=xe.readUByte();if(Ue===181){var ct=xe.readUShort();if(ct===49){var Ge=xe.readUInt();if(Ge===1195456820){var Je=xe.readUByte();if(Je===3){for(var Xe=xe.readUByte(),Ye=xe.readUByte(),ke=31&Xe,Y=[Xe,Ye],A=0;A16){for(var _=[],J=0;J<16;J++)_.push(xe.readUByte().toString(16)),(J===3||J===5||J===7||J===9)&&_.push("-");for(var ae=be-16,$=new Uint8Array(ae),Se=0;Se=0){var xe={data:w.subarray(fe,O-v-1),type:pe};R.push(xe)}else{var Ce=this.getLastNalUnit();if(Ce&&(g&&O<=4-g&&(Ce.state&&(Ce.data=Ce.data.subarray(0,Ce.data.byteLength-g))),Z=O-v-1,Z>0)){var be=new Uint8Array(Ce.data.byteLength+Z);be.set(Ce.data,0),be.set(w.subarray(0,Z),Ce.data.byteLength),Ce.data=be,Ce.state=0}}O=0&&v>=0){var Oe={data:w.subarray(fe,b),type:pe,state:v};R.push(Oe)}if(R.length===0){var We=this.getLastNalUnit();if(We){var Ue=new Uint8Array(We.data.byteLength+w.byteLength);Ue.set(We.data,0),Ue.set(w,We.data.byteLength),We.data=Ue}}return m.naluState=v,R},E.parseAACPES=function(w){var b=0,m=this._audioTrack,v=this.aacOverFlow,g=w.data;if(v){this.aacOverFlow=null;var R=v.sample.unit.byteLength,O=Math.min(v.missing,R),G=R-O;v.sample.unit.set(g.subarray(0,O),G),m.samples.push(v.sample),b=v.missing}var Z,ee;for(Z=b,ee=g.length;Z1;){var R=new Uint8Array(g[0].length+g[1].length);R.set(g[0]),R.set(g[1],g[0].length),g[0]=R,g.splice(1,1)}k=g[0];var O=(k[0]<<16)+(k[1]<<8)+k[2];if(O===1){if(w=(k[4]<<8)+k[5],w&&w>x.size-6)return null;var G=k[7];G&192&&(m=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,G&64?(v=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,m-v>60*9e4&&(L.logger.warn(Math.round((m-v)/9e4)+"s delta between PTS and DTS, align them"),m=v)):v=m),b=k[8];var Z=b+9;if(x.size<=Z)return null;x.size-=Z;for(var ee=new Uint8Array(x.size),fe=0,pe=g.length;fexe){Z-=xe;continue}else k=k.subarray(Z),xe-=Z,Z=0;ee.set(k,E),E+=xe}return w&&(w-=b+3),{data:ee,pts:m,dts:v,len:w}}return null}function f(x,E){if(x.units.length&&x.frame){if(x.pts===void 0){var k=E.samples,w=k.length;if(w){var b=k[w-1];x.pts=b.pts,x.dts=b.dts}else{E.dropped++;return}}E.samples.push(x)}x.debug.length&&L.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function p(x,E){var k=x.length;if(k>0){if(E.pts>=x[k-1].pts)x.push(E);else for(var w=k-1;w>=0;w--)if(E.ptsm)return g;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,m=this.autoLevelCapping,v;return m===-1&&b&&b.length?v=b.length-1:v=m,v}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var m=this.audioTrackController;m&&(m.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return d.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return E.defaultConfig?E.defaultConfig:P.hlsDefaultConfig},set:function(b){E.defaultConfig=b}}]),E}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"isSupported",function(){return B}),H.d(re,"changeTypeSupported",function(){return se});var oe=H("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var q=Object(oe.getMediaSource)();if(!q)return!1;var X=K(),V=q&&typeof q.isTypeSupported=="function"&&q.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),L=!X||X.prototype&&typeof X.prototype.appendBuffer=="function"&&typeof X.prototype.remove=="function";return!!V&&!!L}function se(){var q,X=K();return typeof(X==null||((q=X.prototype)===null||q===void 0)?void 0:q.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return M}),H.d(re,"LoadError",function(){return I});var oe=H("./src/polyfills/number.ts"),K=H("./src/errors.ts");function B(C,d){C.prototype=Object.create(d.prototype),C.prototype.constructor=C,L(C,d)}function se(C){var d=typeof Map=="function"?new Map:void 0;return se=function(p){if(p===null||!V(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(p))return d.get(p);d.set(p,T)}function T(){return q(p,arguments,U(this).constructor)}return T.prototype=Object.create(p.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L(T,p)},se(C)}function q(C,d,f){return X()?q=Reflect.construct:q=function(T,x,E){var k=[null];k.push.apply(k,x);var w=Function.bind.apply(T,k),b=new w;return E&&L(b,E.prototype),b},q.apply(null,arguments)}function X(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}function V(C){return Function.toString.call(C).indexOf("[native code]")!==-1}function L(C,d){return L=Object.setPrototypeOf||function(p,T){return p.__proto__=T,p},L(C,d)}function U(C){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},U(C)}var W=Math.pow(2,17),M=function(){function C(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var d=C.prototype;return d.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},d.abort=function(){this.loader&&this.loader.abort()},d.load=function(p,T){var x=this,E=p.url;if(!E)return Promise.reject(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,networkDetails:null},"Fragment does not have a "+(E?"part list":"url")));this.abort();var k=this.config,w=k.fLoader,b=k.loader;return new Promise(function(m,v){x.loader&&x.loader.destroy();var g=x.loader=p.loader=w?new w(k):new b(k),R=P(p),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:W};p.stats=g.stats,g.load(R,O,{onSuccess:function(Z,ee,fe,pe){x.resetLoader(p,g),m({frag:p,part:null,payload:Z.data,networkDetails:pe})},onError:function(Z,ee,fe){x.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,response:Z,networkDetails:fe}))},onAbort:function(Z,ee,fe){x.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:p,networkDetails:fe}))},onTimeout:function(Z,ee,fe){x.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:p,networkDetails:fe}))},onProgress:function(Z,ee,fe,pe){T&&T({frag:p,part:null,payload:fe,networkDetails:pe})}})})},d.loadPart=function(p,T,x){var E=this;this.abort();var k=this.config,w=k.fLoader,b=k.loader;return new Promise(function(m,v){E.loader&&E.loader.destroy();var g=E.loader=p.loader=w?new w(k):new b(k),R=P(p,T),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:W};T.stats=g.stats,g.load(R,O,{onSuccess:function(Z,ee,fe,pe){E.resetLoader(p,g),E.updateStatsFromPart(p,T);var xe={frag:p,part:T,payload:Z.data,networkDetails:pe};x(xe),m(xe)},onError:function(Z,ee,fe){E.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,part:T,response:Z,networkDetails:fe}))},onAbort:function(Z,ee,fe){p.stats.aborted=T.stats.aborted,E.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:p,part:T,networkDetails:fe}))},onTimeout:function(Z,ee,fe){E.resetLoader(p,g),v(new I({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:p,part:T,networkDetails:fe}))}})})},d.updateStatsFromPart=function(p,T){var x=p.stats,E=T.stats,k=E.total;if(x.loaded+=E.loaded,k){var w=Math.round(p.duration/T.duration),b=Math.min(Math.round(x.loaded/k),w),m=w-b,v=m*Math.round(x.loaded/b);x.total=x.loaded+v}else x.total=Math.max(x.loaded,x.total);var g=x.loading,R=E.loading;g.start?g.first+=R.first-R.start:(g.start=R.start,g.first=R.first),g.end=R.end},d.resetLoader=function(p,T){p.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},C}();function P(C,d){d===void 0&&(d=null);var f=d||C,p={frag:C,part:d,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},T=f.byteRangeStartOffset,x=f.byteRangeEndOffset;return Object(oe.isFiniteNumber)(T)&&Object(oe.isFiniteNumber)(x)&&(p.rangeStart=T,p.rangeEnd=x),p}var I=function(C){B(d,C);function d(f){for(var p,T=arguments.length,x=new Array(T>1?T-1:0),E=1;E>8*(15-k)&255;return E},p.setDecryptDataFromLevelKey=function(x,E){var k=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(k=q.LevelKey.fromURI(x.uri),k.method=x.method,k.iv=this.createInitializationVector(E),k.keyFormat="identity"),k},p.setElementaryStreamInfo=function(x,E,k,w,b,m){m===void 0&&(m=!1);var v=this.elementaryStreams,g=v[x];if(!g){v[x]={startPTS:E,endPTS:k,startDTS:w,endDTS:b,partial:m};return}g.startPTS=Math.min(g.startPTS,E),g.endPTS=Math.max(g.endPTS,k),g.startDTS=Math.min(g.startDTS,w),g.endDTS=Math.max(g.endDTS,b)},p.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[M.AUDIO]=null,x[M.VIDEO]=null,x[M.AUDIOVIDEO]=null},W(f,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&se.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(oe.isFiniteNumber)(this.programDateTime))return null;var x=Object(oe.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),f}(P),C=function(d){V(f,d);function f(p,T,x,E,k){var w;w=d.call(this,x)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new X.LoadStats,w.duration=p.decimalFloatingPoint("DURATION"),w.gap=p.bool("GAP"),w.independent=p.bool("INDEPENDENT"),w.relurl=p.enumeratedString("URI"),w.fragment=T,w.index=E;var b=p.enumeratedString("BYTERANGE");return b&&w.setByteRange(b,k),k&&(w.fragOffset=k.fragOffset+k.duration),w}return W(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),f}(P)},"./src/loader/key-loader.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return se});var oe=H("./src/events.ts"),K=H("./src/errors.ts"),B=H("./src/utils/logger.ts"),se=function(){function q(V){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=V,this._registerListeners()}var X=q.prototype;return X._registerListeners=function(){this.hls.on(oe.Events.KEY_LOADING,this.onKeyLoading,this)},X._unregisterListeners=function(){this.hls.off(oe.Events.KEY_LOADING,this.onKeyLoading)},X.destroy=function(){this._unregisterListeners();for(var L in this.loaders){var U=this.loaders[L];U&&U.destroy()}this.loaders={}},X.onKeyLoading=function(L,U){var W=U.frag,M=W.type,P=this.loaders[M];if(!W.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var I=W.decryptdata.uri;if(I!==this.decrypturl||this.decryptkey===null){var C=this.hls.config;if(P&&(B.logger.warn("abort previous key loader for type:"+M),P.abort()),!I){B.logger.warn("key uri is falsy");return}var d=C.loader,f=W.loader=this.loaders[M]=new d(C);this.decrypturl=I,this.decryptkey=null;var p={url:I,frag:W,responseType:"arraybuffer"},T={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:C.fragLoadingRetryDelay,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(p,T,x)}else this.decryptkey&&(W.decryptdata.key=this.decryptkey,this.hls.trigger(oe.Events.KEY_LOADED,{frag:W}))},X.loadsuccess=function(L,U,W){var M=W.frag;if(!M.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=M.decryptdata.key=new Uint8Array(L.data),M.loader=null,delete this.loaders[M.type],this.hls.trigger(oe.Events.KEY_LOADED,{frag:M})},X.loaderror=function(L,U){var W=U.frag,M=W.loader;M&&M.abort(),delete this.loaders[W.type],this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:W,response:L})},X.loadtimeout=function(L,U){var W=U.frag,M=W.loader;M&&M.abort(),delete this.loaders[W.type],this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:W})},q}()},"./src/loader/level-details.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"LevelDetails",function(){return q});var oe=H("./src/polyfills/number.ts");function K(X,V){for(var L=0;LU.endSN||W>0||W===0&&M>0,this.updated||this.advanced?this.misses=Math.floor(U.misses*.6):this.misses=U.misses+1,this.availabilityDelay=U.availabilityDelay},B(X,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(oe.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||se}},{key:"drift",get:function(){var U=this.driftEndTime-this.driftStartTime;if(U>0){var W=this.driftEnd-this.driftStart;return W*1e3/U}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var U;return(U=this.fragments)!==null&&U!==void 0&&U.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),X}()},"./src/loader/level-key.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"LevelKey",function(){return q});var oe=H("./node_modules/url-toolkit/src/url-toolkit.js"),K=H.n(oe);function B(X,V){for(var L=0;L2){var v=m.shift()+".";return v+=parseInt(m.shift()).toString(16),v+=("000"+parseInt(m.shift()).toString(16)).substr(-4),v}return b},k.resolve=function(b,m){return K.buildAbsoluteURL(m,b,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(b,m){var v=[],g={},R=!1;W.lastIndex=0;for(var O;(O=W.exec(b))!=null;)if(O[1]){var G=new V.AttrList(O[1]),Z={attrs:G,bitrate:G.decimalInteger("AVERAGE-BANDWIDTH")||G.decimalInteger("BANDWIDTH"),name:G.NAME,url:k.resolve(O[2],m)},ee=G.decimalResolution("RESOLUTION");ee&&(Z.width=ee.width,Z.height=ee.height),p((G.CODECS||"").split(/[ ,]+/).filter(function(pe){return pe}),Z),Z.videoCodec&&Z.videoCodec.indexOf("avc1")!==-1&&(Z.videoCodec=k.convertAVC1ToAVCOTI(Z.videoCodec)),v.push(Z)}else if(O[3]){var fe=new V.AttrList(O[3]);fe["DATA-ID"]&&(R=!0,g[fe["DATA-ID"]]=fe)}return{levels:v,sessionData:R?g:null}},k.parseMasterPlaylistMedia=function(b,m,v,g){g===void 0&&(g=[]);var R,O=[],G=0;for(M.lastIndex=0;(R=M.exec(b))!==null;){var Z=new V.AttrList(R[1]);if(Z.TYPE===v){var ee={attrs:Z,bitrate:0,id:G++,groupId:Z["GROUP-ID"],instreamId:Z["INSTREAM-ID"],name:Z.NAME||Z.LANGUAGE||"",type:v,default:Z.bool("DEFAULT"),autoselect:Z.bool("AUTOSELECT"),forced:Z.bool("FORCED"),lang:Z.LANGUAGE,url:Z.URI?k.resolve(Z.URI,m):""};if(g.length){var fe=k.findGroup(g,ee.groupId)||g[0];T(ee,fe,"audioCodec"),T(ee,fe,"textCodec")}O.push(ee)}}return O},k.parseLevelPlaylist=function(b,m,v,g,R){var O=new q.LevelDetails(m),G=O.fragments,Z=null,ee=0,fe=0,pe=0,xe=0,Ce=null,be=new se.Fragment(g,m),Oe,We,Ue,ct=-1,Ge=!1;for(P.lastIndex=0,O.m3u8=b;(Oe=P.exec(b))!==null;){Ge&&(Ge=!1,be=new se.Fragment(g,m),be.start=pe,be.sn=ee,be.cc=xe,be.level=v,Z&&(be.initSegment=Z,be.rawProgramDateTime=Z.rawProgramDateTime));var Je=Oe[1];if(Je){be.duration=parseFloat(Je);var Xe=(" "+Oe[2]).slice(1);be.title=Xe||null,be.tagList.push(Xe?["INF",Je,Xe]:["INF",Je])}else if(Oe[3])Object(oe.isFiniteNumber)(be.duration)&&(be.start=pe,Ue&&(be.levelkey=Ue),be.sn=ee,be.level=v,be.cc=xe,be.urlId=R,G.push(be),be.relurl=(" "+Oe[3]).slice(1),E(be,Ce),Ce=be,pe+=be.duration,ee++,fe=0,Ge=!0);else if(Oe[4]){var Ye=(" "+Oe[4]).slice(1);Ce?be.setByteRange(Ye,Ce):be.setByteRange(Ye)}else if(Oe[5])be.rawProgramDateTime=(" "+Oe[5]).slice(1),be.tagList.push(["PROGRAM-DATE-TIME",be.rawProgramDateTime]),ct===-1&&(ct=G.length);else{if(Oe=Oe[0].match(I),!Oe){L.logger.warn("No matches on slow regex match for level playlist!");continue}for(We=1;We-1){L.logger.warn("Keyformat "+bt+" is not supported from the manifest");continue}else if(bt!=="identity")continue;$e&&(Ue=X.LevelKey.fromURL(m,at),at&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(Ue.method=$e,Ue.keyFormat=bt,tt&&(Ue.keyID=tt),nt&&(Ue.keyFormatVersions=nt),Ue.iv=Ke));break}case"START":{var Lt=new V.AttrList(Y),Ot=Lt.decimalFloatingPoint("TIME-OFFSET");Object(oe.isFiniteNumber)(Ot)&&(O.startTimeOffset=Ot);break}case"MAP":{var xt=new V.AttrList(Y);be.relurl=xt.URI,xt.BYTERANGE&&be.setByteRange(xt.BYTERANGE),be.level=v,be.sn="initSegment",Ue&&(be.levelkey=Ue),be.initSegment=null,Z=be,Ge=!0;break}case"SERVER-CONTROL":{var jt=new V.AttrList(Y);O.canBlockReload=jt.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=jt.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&jt.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=jt.optionalFloat("PART-HOLD-BACK",0),O.holdBack=jt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Nt=new V.AttrList(Y);O.partTarget=Nt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var mt=O.partList;mt||(mt=O.partList=[]);var Ht=fe>0?mt[mt.length-1]:void 0,Vt=fe++,ge=new se.Part(new V.AttrList(Y),be,m,Vt,Ht);mt.push(ge),be.duration+=ge.duration;break}case"PRELOAD-HINT":{var ie=new V.AttrList(Y);O.preloadHint=ie;break}case"RENDITION-REPORT":{var ne=new V.AttrList(Y);O.renditionReports=O.renditionReports||[],O.renditionReports.push(ne);break}default:L.logger.warn("line parsed but not handled: "+Oe);break}}}Ce&&!Ce.relurl?(G.pop(),pe-=Ce.duration,O.partList&&(O.fragmentHint=Ce)):O.partList&&(E(be,Ce),be.cc=xe,O.fragmentHint=be);var ce=G.length,me=G[0],le=G[ce-1];if(pe+=O.skippedSegments*O.targetduration,pe>0&&ce&&le){O.averagetargetduration=pe/ce;var ue=le.sn;O.endSN=ue!=="initSegment"?ue:0,me&&(O.startCC=me.cc,me.initSegment||O.fragments.every(function(ye){return ye.relurl&&d(ye.relurl)})&&(L.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),be=new se.Fragment(g,m),be.relurl=le.relurl,be.level=v,be.sn="initSegment",me.initSegment=be,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(pe+=O.fragmentHint.duration),O.totalduration=pe,O.endCC=xe,ct>0&&x(G,ct),O},k}();function p(k,w){["video","audio","text"].forEach(function(b){var m=k.filter(function(g){return Object(U.isCodecType)(g,b)});if(m.length){var v=m.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});w[b+"Codec"]=v.length>0?v[0]:m[0],k=k.filter(function(g){return m.indexOf(g)===-1})}}),w.unknownCodecs=k}function T(k,w,b){var m=w[b];m&&(k[b]=m)}function x(k,w){for(var b=k[w],m=w;m--;){var v=k[m];if(!v)return;v.programDateTime=b.programDateTime-v.duration*1e3,b=v}}function E(k,w){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):w!=null&&w.programDateTime&&(k.programDateTime=w.endProgramDateTime),Object(oe.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/polyfills/number.ts"),K=H("./src/events.ts"),B=H("./src/errors.ts"),se=H("./src/utils/logger.ts"),q=H("./src/utils/mp4-tools.ts"),X=H("./src/loader/m3u8-parser.ts"),V=H("./src/types/loader.ts"),L=H("./src/utils/attr-list.ts");function U(P){var I=P.type;switch(I){case V.PlaylistContextType.AUDIO_TRACK:return V.PlaylistLevelType.AUDIO;case V.PlaylistContextType.SUBTITLE_TRACK:return V.PlaylistLevelType.SUBTITLE;default:return V.PlaylistLevelType.MAIN}}function W(P,I){var C=P.url;return(C===void 0||C.indexOf("data:")===0)&&(C=I.url),C}var M=function(){function P(C){this.hls=void 0,this.loaders=Object.create(null),this.hls=C,this.registerListeners()}var I=P.prototype;return I.registerListeners=function(){var d=this.hls;d.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},I.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},I.createInternalLoader=function(d){var f=this.hls.config,p=f.pLoader,T=f.loader,x=p||T,E=new x(f);return d.loader=E,this.loaders[d.type]=E,E},I.getInternalLoader=function(d){return this.loaders[d.type]},I.resetInternalLoader=function(d){this.loaders[d]&&delete this.loaders[d]},I.destroyInternalLoaders=function(){for(var d in this.loaders){var f=this.loaders[d];f&&f.destroy(),this.resetInternalLoader(d)}},I.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},I.onManifestLoading=function(d,f){var p=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:V.PlaylistContextType.MANIFEST,url:p,deliveryDirectives:null})},I.onLevelLoading=function(d,f){var p=f.id,T=f.level,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:null,level:T,responseType:"text",type:V.PlaylistContextType.LEVEL,url:x,deliveryDirectives:E})},I.onAudioTrackLoading=function(d,f){var p=f.id,T=f.groupId,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:E})},I.onSubtitleTrackLoading=function(d,f){var p=f.id,T=f.groupId,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:E})},I.load=function(d){var f,p=this.hls.config,T=this.getInternalLoader(d);if(T){var x=T.context;if(x&&x.url===d.url){se.logger.trace("[playlist-loader]: playlist request ongoing");return}se.logger.log("[playlist-loader]: aborting previous loader for type: "+d.type),T.abort()}var E,k,w,b;switch(d.type){case V.PlaylistContextType.MANIFEST:E=p.manifestLoadingMaxRetry,k=p.manifestLoadingTimeOut,w=p.manifestLoadingRetryDelay,b=p.manifestLoadingMaxRetryTimeout;break;case V.PlaylistContextType.LEVEL:case V.PlaylistContextType.AUDIO_TRACK:case V.PlaylistContextType.SUBTITLE_TRACK:E=0,k=p.levelLoadingTimeOut;break;default:E=p.levelLoadingMaxRetry,k=p.levelLoadingTimeOut,w=p.levelLoadingRetryDelay,b=p.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(d),(f=d.deliveryDirectives)!==null&&f!==void 0&&f.part){var m;if(d.type===V.PlaylistContextType.LEVEL&&d.level!==null?m=this.hls.levels[d.level].details:d.type===V.PlaylistContextType.AUDIO_TRACK&&d.id!==null?m=this.hls.audioTracks[d.id].details:d.type===V.PlaylistContextType.SUBTITLE_TRACK&&d.id!==null&&(m=this.hls.subtitleTracks[d.id].details),m){var v=m.partTarget,g=m.targetduration;v&&g&&(k=Math.min(Math.max(v*3,g*.8)*1e3,k))}}var R={timeout:k,maxRetry:E,retryDelay:w,maxRetryDelay:b,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(d,R,O)},I.loadsuccess=function(d,f,p,T){if(T===void 0&&(T=null),p.isSidxRequest){this.handleSidxRequest(d,p),this.handlePlaylistLoaded(d,f,p,T);return}this.resetInternalLoader(p.type);var x=d.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,p,"no EXTM3U delimiter",T);return}f.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(d,f,p,T):this.handleMasterPlaylist(d,f,p,T)},I.loaderror=function(d,f,p){p===void 0&&(p=null),this.handleNetworkError(f,p,!1,d)},I.loadtimeout=function(d,f,p){p===void 0&&(p=null),this.handleNetworkError(f,p,!0)},I.handleMasterPlaylist=function(d,f,p,T){var x=this.hls,E=d.data,k=W(d,p),w=X.default.parseMasterPlaylist(E,k),b=w.levels,m=w.sessionData;if(!b.length){this.handleManifestParsingError(d,p,"no level found in manifest",T);return}var v=b.map(function(ee){return{id:ee.attrs.AUDIO,audioCodec:ee.audioCodec}}),g=b.map(function(ee){return{id:ee.attrs.SUBTITLES,textCodec:ee.textCodec}}),R=X.default.parseMasterPlaylistMedia(E,k,"AUDIO",v),O=X.default.parseMasterPlaylistMedia(E,k,"SUBTITLES",g),G=X.default.parseMasterPlaylistMedia(E,k,"CLOSED-CAPTIONS");if(R.length){var Z=R.some(function(ee){return!ee.url});!Z&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(se.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),R.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new L.AttrList({}),bitrate:0,url:""}))}x.trigger(K.Events.MANIFEST_LOADED,{levels:b,audioTracks:R,subtitles:O,captions:G,url:k,stats:f,networkDetails:T,sessionData:m})},I.handleTrackOrLevelPlaylist=function(d,f,p,T){var x=this.hls,E=p.id,k=p.level,w=p.type,b=W(d,p),m=Object(oe.isFiniteNumber)(E)?E:0,v=Object(oe.isFiniteNumber)(k)?k:m,g=U(p),R=X.default.parseLevelPlaylist(d.data,b,v,g,m);if(!R.fragments.length){x.trigger(K.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof p.level=="number"?p.level:void 0});return}if(w===V.PlaylistContextType.MANIFEST){var O={attrs:new L.AttrList({}),bitrate:0,details:R,name:"",url:b};x.trigger(K.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:b,stats:f,networkDetails:T,sessionData:null})}if(f.parsing.end=performance.now(),R.needSidxRanges){var G,Z=(G=R.fragments[0].initSegment)===null||G===void 0?void 0:G.url;this.load({url:Z,isSidxRequest:!0,type:w,level:k,levelDetails:R,id:E,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}p.levelDetails=R,this.handlePlaylistLoaded(d,f,p,T)},I.handleSidxRequest=function(d,f){var p=Object(q.parseSegmentIndex)(new Uint8Array(d.data));if(!p)return;var T=p.references,x=f.levelDetails;T.forEach(function(E,k){var w=E.info,b=x.fragments[k];b.byteRange.length===0&&b.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),b.initSegment&&b.initSegment.setByteRange(String(p.moovEndOffset)+"@0")})},I.handleManifestParsingError=function(d,f,p,T){this.hls.trigger(K.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===V.PlaylistContextType.MANIFEST,url:d.url,reason:p,response:d,context:f,networkDetails:T})},I.handleNetworkError=function(d,f,p,T){p===void 0&&(p=!1),se.logger.warn("[playlist-loader]: A network "+(p?"timeout":"error")+" occurred while loading "+d.type+" level: "+d.level+" id: "+d.id+' group-id: "'+d.groupId+'"');var x=B.ErrorDetails.UNKNOWN,E=!1,k=this.getInternalLoader(d);switch(d.type){case V.PlaylistContextType.MANIFEST:x=p?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,E=!0;break;case V.PlaylistContextType.LEVEL:x=p?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.AUDIO_TRACK:x=p?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.SUBTITLE_TRACK:x=p?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,E=!1;break}k&&this.resetInternalLoader(d.type);var w={type:B.ErrorTypes.NETWORK_ERROR,details:x,fatal:E,url:d.url,loader:k,context:d,networkDetails:f};T&&(w.response=T),this.hls.trigger(K.Events.ERROR,w)},I.handlePlaylistLoaded=function(d,f,p,T){var x=p.type,E=p.level,k=p.id,w=p.groupId,b=p.loader,m=p.levelDetails,v=p.deliveryDirectives;if(!(m!=null&&m.targetduration)){this.handleManifestParsingError(d,p,"invalid target duration",T);return}if(!b)return;m.live&&(b.getCacheAge&&(m.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(m.ageHeader))&&(m.ageHeader=0));switch(x){case V.PlaylistContextType.MANIFEST:case V.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:m,level:E||0,id:k||0,stats:f,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:m,id:k||0,groupId:w||"",stats:f,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:m,id:k||0,groupId:w||"",stats:f,networkDetails:T,deliveryDirectives:v});break}},P}();re.default=M},"./src/polyfills/number.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"isFiniteNumber",function(){return oe}),H.d(re,"MAX_SAFE_INTEGER",function(){return K});var oe=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ze,re,H){"use strict";H.r(re);var oe=function(){function K(){}return K.getSilentFrame=function(se,q){switch(se){case"mp4a.40.2":if(q===1)return new Uint8Array([0,200,0,128,35,128]);if(q===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(q===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(q===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(q===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(q===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(q===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},K}();re.default=oe},"./src/remux/mp4-generator.ts":function(ze,re,H){"use strict";H.r(re);var oe=Math.pow(2,32)-1,K=function(){function B(){}return B.init=function(){B.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var q;for(q in B.types)B.types.hasOwnProperty(q)&&(B.types[q]=[q.charCodeAt(0),q.charCodeAt(1),q.charCodeAt(2),q.charCodeAt(3)]);var X=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),V=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);B.HDLR_TYPES={video:X,audio:V};var L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),U=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=U,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var W=new Uint8Array([105,115,111,109]),M=new Uint8Array([97,118,99,49]),P=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,W,P,W,M),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,L))},B.box=function(q){for(var X=8,V=arguments.length,L=new Array(V>1?V-1:0),U=1;U>24&255,P[1]=X>>16&255,P[2]=X>>8&255,P[3]=X&255,P.set(q,4),W=0,X=8;W>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},B.mdia=function(q){return B.box(B.types.mdia,B.mdhd(q.timescale,q.duration),B.hdlr(q.type),B.minf(q))},B.mfhd=function(q){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,q>>24,q>>16&255,q>>8&255,q&255]))},B.minf=function(q){return q.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(q)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(q))},B.moof=function(q,X,V){return B.box(B.types.moof,B.mfhd(q),B.traf(V,X))},B.moov=function(q){for(var X=q.length,V=[];X--;)V[X]=B.trak(q[X]);return B.box.apply(null,[B.types.moov,B.mvhd(q[0].timescale,q[0].duration)].concat(V).concat(B.mvex(q)))},B.mvex=function(q){for(var X=q.length,V=[];X--;)V[X]=B.trex(q[X]);return B.box.apply(null,[B.types.mvex].concat(V))},B.mvhd=function(q,X){X*=q;var V=Math.floor(X/(oe+1)),L=Math.floor(X%(oe+1)),U=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,q>>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,U)},B.sdtp=function(q){var X=q.samples||[],V=new Uint8Array(4+X.length),L,U;for(L=0;L>>8&255),X.push(W&255),X=X.concat(Array.prototype.slice.call(U));for(L=0;L>>8&255),V.push(W&255),V=V.concat(Array.prototype.slice.call(U));var M=B.box(B.types.avcC,new Uint8Array([1,X[3],X[4],X[5],252|3,224|q.sps.length].concat(X).concat([q.pps.length]).concat(V))),P=q.width,I=q.height,C=q.pixelRatio[0],d=q.pixelRatio[1];return B.box(B.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,P>>8&255,P&255,I>>8&255,I&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),M,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([C>>24,C>>16&255,C>>8&255,C&255,d>>24,d>>16&255,d>>8&255,d&255])))},B.esds=function(q){var X=q.config.length;return new Uint8Array([0,0,0,0,3,23+X,0,1,0,4,15+X,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([X]).concat(q.config).concat([6,1,2]))},B.mp4a=function(q){var X=q.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]),B.box(B.types.esds,B.esds(q)))},B.mp3=function(q){var X=q.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]))},B.stsd=function(q){return q.type==="audio"?!q.isAAC&&q.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(q)):B.box(B.types.stsd,B.STSD,B.mp4a(q)):B.box(B.types.stsd,B.STSD,B.avc1(q))},B.tkhd=function(q){var X=q.id,V=q.duration*q.timescale,L=q.width,U=q.height,W=Math.floor(V/(oe+1)),M=Math.floor(V%(oe+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255,M>>24,M>>16&255,M>>8&255,M&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,L>>8&255,L&255,0,0,U>>8&255,U&255,0,0]))},B.traf=function(q,X){var V=B.sdtp(q),L=q.id,U=Math.floor(X/(oe+1)),W=Math.floor(X%(oe+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,U>>24,U>>16&255,U>>8&255,U&255,W>>24,W>>16&255,W>>8&255,W&255])),B.trun(q,V.length+16+20+8+16+8+8),V)},B.trak=function(q){return q.duration=q.duration||4294967295,B.box(B.types.trak,B.tkhd(q),B.mdia(q))},B.trex=function(q){var X=q.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,X>>24,X>>16&255,X>>8&255,X&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(q,X){var V=q.samples||[],L=V.length,U=12+16*L,W=new Uint8Array(U),M,P,I,C,d,f;for(X+=8+U,W.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255],0),M=0;M>>24&255,I>>>16&255,I>>>8&255,I&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&240<<8,d.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*M);return B.box(B.types.trun,W)},B.initSegment=function(q){B.types||B.init();var X=B.moov(q),V=new Uint8Array(B.FTYP.byteLength+X.byteLength);return V.set(B.FTYP),V.set(X,B.FTYP.byteLength),V},B}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0,re.default=K},"./src/remux/mp4-remuxer.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return f}),H.d(re,"normalizePts",function(){return p});var oe=H("./src/polyfills/number.ts"),K=H("./src/remux/aac-helper.ts"),B=H("./src/remux/mp4-generator.ts"),se=H("./src/events.ts"),q=H("./src/errors.ts"),X=H("./src/utils/logger.ts"),V=H("./src/types/loader.ts"),L=H("./src/utils/timescale-conversion.ts");function U(){return U=Object.assign||function(k){for(var w=1;w0?R:O.pts},m[0].pts);return v&&X.logger.debug("PTS rollover detected"),g},w.remux=function(m,v,g,R,O,G,Z,ee){var fe,pe,xe,Ce,be,Oe,We=O,Ue=O,ct=m.pid>-1,Ge=v.pid>-1,Je=v.samples.length,Xe=m.samples.length>0,Ye=Je>1,ke=(!ct||Xe)&&(!Ge||Ye)||this.ISGenerated||Z;if(ke){this.ISGenerated||(xe=this.generateIS(m,v,O));var Y=this.isVideoContiguous,A=-1;if(Ye&&(A=T(v.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(Oe=!0,A>0){X.logger.warn("[mp4-remuxer]: Dropped "+A+" out of "+Je+" video samples due to a missing keyframe");var _=this.getVideoStartPts(v.samples);v.samples=v.samples.slice(A),v.dropped+=A,Ue+=(v.samples[0].pts-_)/(v.timescale||9e4)}else A===-1&&(X.logger.warn("[mp4-remuxer]: No keyframe found out of "+Je+" video samples"),Oe=!1);if(this.ISGenerated){if(Xe&&Ye){var J=this.getVideoStartPts(v.samples),ae=p(m.samples[0].pts,J)-J,$=ae/v.inputTimeScale;We+=Math.max(0,$),Ue+=Math.max(0,-$)}if(Xe){if(m.samplerate||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),xe=this.generateIS(m,v,O)),pe=this.remuxAudio(m,We,this.isAudioContiguous,G,Ge||Ye||ee===V.PlaylistLevelType.AUDIO?Ue:void 0),Ye){var Se=pe?pe.endPTS-pe.startPTS:0;v.inputTimeScale||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),xe=this.generateIS(m,v,O)),fe=this.remuxVideo(v,Ue,Y,Se)}}else Ye&&(fe=this.remuxVideo(v,Ue,Y,0));fe&&(fe.firstKeyFrame=A,fe.independent=A!==-1)}}return this.ISGenerated&&(g.samples.length&&(be=this.remuxID3(g,O)),R.samples.length&&(Ce=this.remuxText(R,O))),{audio:pe,video:fe,initSegment:xe,independent:Oe,text:Ce,id3:be}},w.generateIS=function(m,v,g){var R=m.samples,O=v.samples,G=this.typeSupported,Z={},ee=!Object(oe.isFiniteNumber)(this._initPTS),fe="audio/mp4",pe,xe,Ce;if(ee&&(pe=xe=Infinity),m.config&&R.length&&(m.timescale=m.samplerate,m.isAAC||(G.mpeg?(fe="audio/mpeg",m.codec=""):G.mp3&&(m.codec="mp3")),Z.audio={id:"audio",container:fe,codec:m.codec,initSegment:!m.isAAC&&G.mpeg?new Uint8Array(0):B.default.initSegment([m]),metadata:{channelCount:m.channelCount}},ee&&(Ce=m.inputTimeScale,pe=xe=R[0].pts-Math.round(Ce*g))),v.sps&&v.pps&&O.length&&(v.timescale=v.inputTimeScale,Z.video={id:"main",container:"video/mp4",codec:v.codec,initSegment:B.default.initSegment([v]),metadata:{width:v.width,height:v.height}},ee)){Ce=v.inputTimeScale;var be=this.getVideoStartPts(O),Oe=Math.round(Ce*g);xe=Math.min(xe,p(O[0].dts,be)-Oe),pe=Math.min(pe,be-Oe)}if(Object.keys(Z).length)return this.ISGenerated=!0,ee&&(this._initPTS=pe,this._initDTS=xe),{tracks:Z,initPTS:pe,timescale:Ce}},w.remuxVideo=function(m,v,g,R){var O=m.inputTimeScale,G=m.samples,Z=[],ee=G.length,fe=this._initPTS,pe=this.nextAvcDts,xe=8,Ce,be,Oe,We=Number.POSITIVE_INFINITY,Ue=Number.NEGATIVE_INFINITY,ct=0,Ge=!1;if(!g||pe===null){var Je=v*O,Xe=G[0].pts-p(G[0].dts,G[0].pts);pe=Je-Xe}for(var Ye=0;Yeke.pts){var Y=9e4*.2;ct=Math.max(Math.min(ct,ke.pts-ke.dts),-1*Y)}ke.dts0?Ye-1:Ye].dts&&(Ge=!0)}Ge&&G.sort(function(Kr,Jt){var Yt=Kr.dts-Jt.dts,jn=Kr.pts-Jt.pts;return Yt||jn}),be=G[0].dts,Oe=G[G.length-1].dts;var A=Math.round((Oe-be)/(ee-1));if(ct<0){if(ctA,Fe=$<-1;if(Se||Fe){Se?X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms ("+$+"dts) hole between fragments detected, filling it"):X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)(-$,!0)+" ms ("+$+"dts) overlapping between fragments detected"),be=pe;var $e=G[0].pts-$;G[0].dts=be,G[0].pts=$e,X.logger.log("Video: First PTS/DTS adjusted: "+Object(L.toMsFromMpegTsClock)($e,!0)+"/"+Object(L.toMsFromMpegTsClock)(be,!0)+", delta: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms")}}d&&(be=Math.max(0,be));for(var at=0,Ke=0,nt=0;nt0?mt-1:mt].dts;if(ue.stretchShortVideoTrack&&this.nextAudioPts!==null){var we=Math.floor(ue.maxBufferHole*O),Ne=(R?We+R*O:this.nextAudioPts)-Ht.pts;Ne>we?(Ce=Ne-ye,Ce<0&&(Ce=ye),X.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+Ce/90+" ms for the last video frame.")):Ce=ye}else Ce=ye}var Ie=Math.round(Ht.pts-Ht.dts);Z.push(new x(Ht.key,Ce,ge,Ie))}if(Z.length&&I&&I<70){var lt=Z[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(Ce!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=pe=Oe+Ce,this.isVideoContiguous=!0;var Pt=B.default.moof(m.sequenceNumber++,be,U({},m,{samples:Z})),Zt="video",$t={data1:Pt,data2:jt,startPTS:We/O,endPTS:(Ue+Ce)/O,startDTS:be/O,endDTS:pe/O,type:Zt,hasAudio:!1,hasVideo:!0,nb:Z.length,dropped:m.dropped};return m.samples=[],m.dropped=0,console.assert(jt.length,"MDAT length must not be zero"),$t},w.remuxAudio=function(m,v,g,R,O){var G=m.inputTimeScale,Z=m.samplerate?m.samplerate:G,ee=G/Z,fe=m.isAAC?M:P,pe=fe*ee,xe=this._initPTS,Ce=!m.isAAC&&this.typeSupported.mpeg,be=[],Oe=m.samples,We=Ce?0:8,Ue=this.nextAudioPts||-1,ct=v*G;if(this.isAudioContiguous=g=g||Oe.length&&Ue>0&&(R&&Math.abs(ct-Ue)<9e3||Math.abs(p(Oe[0].pts-xe,ct)-Ue)<20*pe),Oe.forEach(function(me){me.pts=p(me.pts-xe,ct)}),!g||Ue<0){if(Oe=Oe.filter(function(me){return me.pts>=0}),!Oe.length)return;O===0?Ue=0:R?Ue=Math.max(0,ct):Ue=Oe[0].pts}if(m.isAAC)for(var Ge=O!==void 0,Je=this.config.maxAudioFramesDrift,Xe=0,Ye=Ue;Xe=Je*pe&&_0){Ke+=We;try{at=new Uint8Array(Ke)}catch(me){this.observer.emit(se.Events.ERROR,se.Events.ERROR,{type:q.ErrorTypes.MUX_ERROR,details:q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ke,reason:"fail allocating audio mdat "+Ke});return}if(!Ce){var jt=new DataView(at.buffer);jt.setUint32(0,Ke),at.set(B.default.types.mdat,4)}}else return;at.set(Lt,We);var Nt=Lt.byteLength;We+=Nt,be.push(new x(!0,fe,Nt,0)),$e=Ot}var mt=be.length;if(!mt)return;var Ht=be[be.length-1];this.nextAudioPts=Ue=$e+ee*Ht.duration;var Vt=Ce?new Uint8Array(0):B.default.moof(m.sequenceNumber++,Fe/ee,U({},m,{samples:be}));m.samples=[];var ge=Fe/G,ie=Ue/G,ne="audio",ce={data1:Vt,data2:at,startPTS:ge,endPTS:ie,startDTS:ge,endDTS:ie,type:ne,hasAudio:!0,hasVideo:!1,nb:mt};return this.isAudioContiguous=!0,console.assert(at.length,"MDAT length must not be zero"),ce},w.remuxEmptyAudio=function(m,v,g,R){var O=m.inputTimeScale,G=m.samplerate?m.samplerate:O,Z=O/G,ee=this.nextAudioPts,fe=(ee!==null?ee:R.startDTS*O)+this._initDTS,pe=R.endDTS*O+this._initDTS,xe=Z*M,Ce=Math.ceil((pe-fe)/xe),be=K.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);if(X.logger.warn("[mp4-remuxer]: remux empty Audio"),!be){X.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Oe=[],We=0;We4294967296;)k+=b;return k}function T(k){for(var w=0;w0?this.lastEndDTS=m:(se.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var v=!!k.audio,g=!!k.video,R="";v&&(R+="audio"),g&&(R+="video");var O={data1:x,startPTS:b,startDTS:b,endPTS:m,endDTS:m,type:R,hasAudio:v,hasVideo:g,nb:1,dropped:0};return T.audio=O.type==="audio"?O:void 0,T.video=O.type!=="audio"?O:void 0,T.text=C,T.id3=I,T.initSegment=E,T},L}(),X=function(U,W,M){return Object(K.getStartDTS)(U,W)-M};function V(L,U){var W=L==null?void 0:L.codec;return W&&W.length>4?W:W==="hvc1"?"hvc1.1.c.L120.90":W==="av01"?"av01.0.04M.08":W==="avc1"||U===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}re.default=q},"./src/task-loop.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"default",function(){return oe});var oe=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=K.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(q){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,q),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},K}()},"./src/types/cmcd.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"CMCDVersion",function(){return oe}),H.d(re,"CMCDObjectType",function(){return K}),H.d(re,"CMCDStreamingFormat",function(){return B}),H.d(re,"CMCDStreamType",function(){return se});var oe=1,K;(function(q){q.MANIFEST="m",q.AUDIO="a",q.VIDEO="v",q.MUXED="av",q.INIT="i",q.CAPTION="c",q.TIMED_TEXT="tt",q.KEY="k",q.OTHER="o"})(K||(K={}));var B;(function(q){q.DASH="d",q.HLS="h",q.SMOOTH="s",q.OTHER="o"})(B||(B={}));var se;(function(q){q.VOD="v",q.LIVE="l"})(se||(se={}))},"./src/types/level.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"HlsSkip",function(){return B}),H.d(re,"getSkipValue",function(){return se}),H.d(re,"HlsUrlParameters",function(){return q}),H.d(re,"Level",function(){return X});function oe(V,L){for(var U=0;UNumber.MAX_SAFE_INTEGER?Infinity:L},q.hexadecimalInteger=function(V){if(this[V]){var L=(this[V]||"0x").slice(2);L=(L.length&1?"0":"")+L;for(var U=new Uint8Array(L.length/2),W=0;WNumber.MAX_SAFE_INTEGER?Infinity:L},q.decimalFloatingPoint=function(V){return parseFloat(this[V])},q.optionalFloat=function(V,L){var U=this[V];return U?parseFloat(U):L},q.enumeratedString=function(V){return this[V]},q.bool=function(V){return this[V]==="YES"},q.decimalResolution=function(V){var L=oe.exec(this[V]);return L===null?void 0:{width:parseInt(L[1],10),height:parseInt(L[2],10)}},se.parseAttrList=function(V){var L,U={},W='"';for(K.lastIndex=0;(L=K.exec(V))!==null;){var M=L[2];M.indexOf(W)===0&&M.lastIndexOf(W)===M.length-1&&(M=M.slice(1,-1)),U[L[1]]=M}return U},se}()},"./src/utils/binary-search.ts":function(ze,re,H){"use strict";H.r(re);var oe={search:function(B,se){for(var q=0,X=B.length-1,V=null,L=null;q<=X;){V=(q+X)/2|0,L=B[V];var U=se(L);if(U>0)q=V+1;else if(U<0)X=V-1;else return L}return null}};re.default=oe},"./src/utils/buffer-helper.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"BufferHelper",function(){return B});var oe=H("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function se(){}return se.isBuffered=function(X,V){try{if(X){for(var L=se.getBuffered(X),U=0;U=L.start(U)&&V<=L.end(U))return!0}}catch(W){}return!1},se.bufferInfo=function(X,V,L){try{if(X){var U=se.getBuffered(X),W=[],M;for(M=0;MP&&(U[M-1].end=X[W].end):U.push(X[W])}else U.push(X[W])}else U=X;for(var I=0,C,d=V,f=V,p=0;p=T&&V=g&&oe.logger.log(this.time+" ["+g+"] "+R)},b}(),I=function(m){for(var v=[],g=0;gq&&(this.logger.log(M.DEBUG,"Too large cursor position "+this.pos),this.pos=q)},m.moveCursor=function(g){var R=this.pos+g;if(g>1)for(var O=this.pos+1;O=144&&this.backSpace();var R=B(g);if(this.pos>=q){this.logger.log(M.ERROR,"Cannot insert "+g.toString(16)+" ("+R+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(R,this.currPenState),this.moveCursor(1)},m.clearFromPos=function(g){var R;for(R=g;R0&&(g?O="["+R.join(" | ")+"]":O=R.join(` -`)),O},m.getTextAndFormat=function(){return this.rows},b}(),T=function(){function b(v,g,R){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=v,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new p(R),this.nonDisplayedMemory=new p(R),this.lastOutputScreen=new p(R),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=R}var m=b.prototype;return m.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},m.getHandler=function(){return this.outputFilter},m.setHandler=function(g){this.outputFilter=g},m.setPAC=function(g){this.writeScreen.setPAC(g)},m.setBkgData=function(g){this.writeScreen.setBkgData(g)},m.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(M.INFO,"MODE="+g),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=g},m.insertChars=function(g){for(var R=0;R=46,R.italics)R.foreground="white";else{var O=Math.floor(g/2)-16,G=["white","green","blue","cyan","red","yellow","magenta"];R.foreground=G[O]}this.logger.log(M.INFO,"MIDROW: "+JSON.stringify(R)),this.writeScreen.setPen(R)},m.outputDataUpdate=function(g){g===void 0&&(g=!1);var R=this.logger.time;if(R===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=R:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,R,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:R),this.lastOutputScreen.copy(this.displayedMemory))},m.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},b}(),x=function(){function b(v,g,R){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new P;this.channels=[null,new T(v,g,O),new T(v+1,R,O)],this.cmdHistory=w(),this.logger=O}var m=b.prototype;return m.getHandler=function(g){return this.channels[g].getHandler()},m.setHandler=function(g,R){this.channels[g].setHandler(R)},m.addData=function(g,R){var O,G,Z,ee=!1;this.logger.time=g;for(var fe=0;fe ("+I([G,Z])+")"),O=this.parseCmd(G,Z),O||(O=this.parseMidrow(G,Z)),O||(O=this.parsePAC(G,Z)),O||(O=this.parseBackgroundAttributes(G,Z)),!O&&(ee=this.parseChars(G,Z),ee)){var pe=this.currentChannel;if(pe&&pe>0){var xe=this.channels[pe];xe.insertChars(ee)}else this.logger.log(M.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!ee&&this.logger.log(M.WARNING,"Couldn't parse cleaned data "+I([G,Z])+" orig: "+I([R[fe],R[fe+1]]))}},m.parseCmd=function(g,R){var O=this.cmdHistory,G=(g===20||g===28||g===21||g===29)&&R>=32&&R<=47,Z=(g===23||g===31)&&R>=33&&R<=35;if(!(G||Z))return!1;if(k(g,R,O))return E(null,null,O),this.logger.log(M.DEBUG,"Repeated command ("+I([g,R])+") is dropped"),!0;var ee=g===20||g===21||g===23?1:2,fe=this.channels[ee];return g===20||g===21||g===28||g===29?R===32?fe.ccRCL():R===33?fe.ccBS():R===34?fe.ccAOF():R===35?fe.ccAON():R===36?fe.ccDER():R===37?fe.ccRU(2):R===38?fe.ccRU(3):R===39?fe.ccRU(4):R===40?fe.ccFON():R===41?fe.ccRDC():R===42?fe.ccTR():R===43?fe.ccRTD():R===44?fe.ccEDM():R===45?fe.ccCR():R===46?fe.ccENM():R===47&&fe.ccEOC():fe.ccTO(R-32),E(g,R,O),this.currentChannel=ee,!0},m.parseMidrow=function(g,R){var O=0;if((g===17||g===25)&&R>=32&&R<=47){if(g===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(M.ERROR,"Mismatch channel in midrow parsing"),!1;var G=this.channels[O];return G?(G.ccMIDROW(R),this.logger.log(M.DEBUG,"MIDROW ("+I([g,R])+")"),!0):!1}return!1},m.parsePAC=function(g,R){var O,G=this.cmdHistory,Z=(g>=17&&g<=23||g>=25&&g<=31)&&R>=64&&R<=127,ee=(g===16||g===24)&&R>=64&&R<=95;if(!(Z||ee))return!1;if(k(g,R,G))return E(null,null,G),!0;var fe=g<=23?1:2;R>=64&&R<=95?O=fe===1?X[g]:L[g]:O=fe===1?V[g]:U[g];var pe=this.channels[fe];return pe?(pe.setPAC(this.interpretPAC(O,R)),E(g,R,G),this.currentChannel=fe,!0):!1},m.interpretPAC=function(g,R){var O,G={color:null,italics:!1,indent:null,underline:!1,row:g};return R>95?O=R-96:O=R-64,G.underline=(O&1)===1,O<=13?G.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(G.italics=!0,G.color="white"):G.indent=Math.floor((O-16)/2)*4,G},m.parseChars=function(g,R){var O,G=null,Z=null;if(g>=25?(O=2,Z=g-8):(O=1,Z=g),Z>=17&&Z<=19){var ee;Z===17?ee=R+80:Z===18?ee=R+112:ee=R+144,this.logger.log(M.INFO,"Special char '"+B(ee)+"' in channel "+O),G=[ee]}else g>=32&&g<=127&&(G=R===0?[g]:[g,R]);if(G){var fe=I(G);this.logger.log(M.DEBUG,"Char codes = "+fe.join(",")),E(g,R,this.cmdHistory)}return G},m.parseBackgroundAttributes=function(g,R){var O=(g===16||g===24)&&R>=32&&R<=47,G=(g===23||g===31)&&R>=45&&R<=47;if(!(O||G))return!1;var Z,ee={};g===16||g===24?(Z=Math.floor((R-32)/2),ee.background=W[Z],R%2===1&&(ee.background=ee.background+"_semi")):R===45?ee.background="transparent":(ee.foreground="black",R===47&&(ee.underline=!0));var fe=g<=23?1:2,pe=this.channels[fe];return pe.setBkgData(ee),E(g,R,this.cmdHistory),!0},m.reset=function(){for(var g=0;g=16?d--:d++;var E=Object(oe.fixLineBreaks)(f.trim()),k=Object(K.generateCueId)(L,U,E);(!V||!V.cues||!V.cues.getCueById(k))&&(I=new p(L,U,E),I.id=k,I.line=T+1,I.align="left",I.position=10+Math.min(80,Math.floor(d*8/32)*10),M.push(I))}return V&&M.length&&(M.sort(function(w,b){return w.line==="auto"||b.line==="auto"?0:w.line>8&&b.line>8?b.line-w.line:w.line-b.line}),M.forEach(function(w){return Object(B.addCueToTrack)(V,w)})),M}};re.default=q},"./src/utils/discontinuities.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"findFirstFragWithCC",function(){return se}),H.d(re,"shouldAlignOnDiscontinuities",function(){return q}),H.d(re,"findDiscontinuousReferenceFrag",function(){return X}),H.d(re,"adjustSlidingStart",function(){return L}),H.d(re,"alignStream",function(){return U}),H.d(re,"alignPDT",function(){return M}),H.d(re,"alignFragmentByPDTDelta",function(){return P}),H.d(re,"alignMediaPlaylistByPDT",function(){return I});var oe=H("./src/polyfills/number.ts"),K=H("./src/utils/logger.ts"),B=H("./src/controller/level-helper.ts");function se(C,d){for(var f=null,p=0,T=C.length;pf.startCC||C&&C.cc=this.minWeight_},se.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},se.destroy=function(){},B}();re.default=K},"./src/utils/ewma.ts":function(ze,re,H){"use strict";H.r(re);var oe=function(){function K(se,q,X){q===void 0&&(q=0),X===void 0&&(X=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=se,this.alpha_=se?Math.exp(Math.log(.5)/se):0,this.estimate_=q,this.totalWeight_=X}var B=K.prototype;return B.sample=function(q,X){var V=Math.pow(this.alpha_,q);this.estimate_=X*(1-V)+V*this.estimate_,this.totalWeight_+=q},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var q=1-Math.pow(this.alpha_,this.totalWeight_);if(q)return this.estimate_/q}return this.estimate_},K}();re.default=oe},"./src/utils/fetch-loader.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"fetchSupported",function(){return P});var oe=H("./src/polyfills/number.ts"),K=H("./src/loader/load-stats.ts"),B=H("./src/demux/chunk-cache.ts");function se(p,T){p.prototype=Object.create(T.prototype),p.prototype.constructor=p,U(p,T)}function q(p){var T=typeof Map=="function"?new Map:void 0;return q=function(E){if(E===null||!L(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(E))return T.get(E);T.set(E,k)}function k(){return X(E,arguments,W(this).constructor)}return k.prototype=Object.create(E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),U(k,E)},q(p)}function X(p,T,x){return V()?X=Reflect.construct:X=function(k,w,b){var m=[null];m.push.apply(m,w);var v=Function.bind.apply(k,m),g=new v;return b&&U(g,b.prototype),g},X.apply(null,arguments)}function V(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(p){return!1}}function L(p){return Function.toString.call(p).indexOf("[native code]")!==-1}function U(p,T){return U=Object.setPrototypeOf||function(E,k){return E.__proto__=k,E},U(p,T)}function W(p){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},W(p)}function M(){return M=Object.assign||function(p){for(var T=1;T=b&&m(k,w,v.flush(),E)):m(k,w,Z,E),O()}).catch(function(){return Promise.reject()})};return R()},p}();function C(p,T){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(M({},p.headers))};return p.rangeEnd&&x.headers.set("Range","bytes="+p.rangeStart+"-"+String(p.rangeEnd-1)),x}function d(p,T){return new self.Request(p.url,T)}var f=function(p){se(T,p);function T(x,E,k){var w;return w=p.call(this,x)||this,w.code=void 0,w.details=void 0,w.code=E,w.details=k,w}return T}(q(Error));re.default=I},"./src/utils/imsc1-ttml-parser.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"IMSC1_CODEC",function(){return L}),H.d(re,"parseIMSC1",function(){return P});var oe=H("./src/utils/mp4-tools.ts"),K=H("./src/utils/vttparser.ts"),B=H("./src/utils/vttcue.ts"),se=H("./src/demux/id3.ts"),q=H("./src/utils/timescale-conversion.ts"),X=H("./src/utils/webvtt-parser.ts");function V(){return V=Object.assign||function(b){for(var m=1;m"):oe}function q(L){for(var U=arguments.length,W=new Array(U>1?U-1:0),M=1;M>24,T[x+1]=E>>16&255,T[x+2]=E>>8&255,T[x+3]=E&255}function U(T,x){var E=[];if(!x.length)return E;var k,w,b;"data"in T?(k=T.data,w=T.start,b=T.end):(k=T,w=0,b=k.byteLength);for(var m=w;m1?m+v:b;if(g===x[0])if(x.length===1)E.push({data:k,start:m+8,end:R});else{var O=U({data:k,start:m+8,end:R},x.slice(1));O.length&&se.apply(E,O)}m=R}return E}function W(T){var x=U(T,["moov"]),E=x[0],k=E?E.end:null,w=U(T,["sidx"]);if(!w||!w[0])return null;var b=[],m=w[0],v=m.data[0],g=v===0?8:16,R=V(m,g);g+=4;var O=0,G=0;v===0?g+=8:g+=16,g+=2;var Z=m.end+G,ee=X(m,g);g+=2;for(var fe=0;fe>>31;if(be===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Oe=V(m,pe);pe+=4,b.push({referenceSize:Ce,subsegmentDuration:Oe,info:{duration:Oe/R,start:Z,end:Z+Ce-1}}),Z+=Ce,pe+=4,g=pe}return{earliestPresentationTime:O,timescale:R,version:v,referencesCount:ee,references:b,moovEndOffset:k}}function M(T){for(var x=[],E=U(T,["moov","trak"]),k=0;kq)&&(this.startTime=q),this.endTime=X,this.screen=V,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"sendAddTrackEvent",function(){return K}),H.d(re,"addCueToTrack",function(){return B}),H.d(re,"clearCurrentCues",function(){return se}),H.d(re,"removeCuesInRange",function(){return q}),H.d(re,"getCuesInRange",function(){return V});var oe=H("./src/utils/logger.ts");function K(L,U){var W;try{W=new Event("addtrack")}catch(M){W=document.createEvent("Event"),W.initEvent("addtrack",!1,!1)}W.track=L,U.dispatchEvent(W)}function B(L,U){var W=L.mode;if(W==="disabled"&&(L.mode="hidden"),L.cues&&!L.cues.getCueById(U.id))try{if(L.addCue(U),!L.cues.getCueById(U.id))throw new Error("addCue is failed for: "+U)}catch(P){oe.logger.debug("[texttrack-utils]: "+P);var M=new self.TextTrackCue(U.startTime,U.endTime,U.text);M.id=U.id,L.addCue(M)}W==="disabled"&&(L.mode=W)}function se(L){var U=L.mode;if(U==="disabled"&&(L.mode="hidden"),L.cues)for(var W=L.cues.length;W--;)L.removeCue(L.cues[W]);U==="disabled"&&(L.mode=U)}function q(L,U,W){var M=L.mode;if(M==="disabled"&&(L.mode="hidden"),L.cues&&L.cues.length>0)for(var P=V(L.cues,U,W),I=0;IL[W].endTime)return-1;for(var M=0,P=W;M<=P;){var I=Math.floor((P+M)/2);if(UL[I].startTime&&M-1)for(var I=P,C=L.length;I=U&&d.endTime<=W)M.push(d);else if(d.startTime>W)return M}return M}},"./src/utils/time-ranges.ts":function(ze,re,H){"use strict";H.r(re);var oe={toString:function(B){for(var se="",q=B.length,X=0;X1?U-1:0),M=1;M100)throw new Error("Position must be between 0 and 100.");b=O,this.hasBeenReset=!0}})),Object.defineProperty(M,"positionAlign",X({},P,{get:function(){return m},set:function(O){var G=q(O);if(!G)throw new SyntaxError("An invalid or illegal string was specified.");m=G,this.hasBeenReset=!0}})),Object.defineProperty(M,"size",X({},P,{get:function(){return v},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");v=O,this.hasBeenReset=!0}})),Object.defineProperty(M,"align",X({},P,{get:function(){return g},set:function(O){var G=q(O);if(!G)throw new SyntaxError("An invalid or illegal string was specified.");g=G,this.hasBeenReset=!0}})),M.displayState=void 0}return V.prototype.getCueAsHTML=function(){var L=self.WebVTT;return L.convertCueToDOMTree(self,this.text)},V}()},"./src/utils/vttparser.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"parseTimeStamp",function(){return B}),H.d(re,"fixLineBreaks",function(){return U}),H.d(re,"VTTParser",function(){return W});var oe=H("./src/utils/vttcue.ts"),K=function(){function M(){}var P=M.prototype;return P.decode=function(C,d){if(!C)return"";if(typeof C!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(C))},M}();function B(M){function P(C,d,f,p){return(C|0)*3600+(d|0)*60+(f|0)+parseFloat(p||0)}var I=M.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return I?parseFloat(I[2])>59?P(I[2],I[3],0,I[4]):P(I[1],I[2],I[3],I[4]):null}var se=function(){function M(){this.values=Object.create(null)}var P=M.prototype;return P.set=function(C,d){!this.get(C)&&d!==""&&(this.values[C]=d)},P.get=function(C,d,f){return f?this.has(C)?this.values[C]:d[f]:this.has(C)?this.values[C]:d},P.has=function(C){return C in this.values},P.alt=function(C,d,f){for(var p=0;p=0&&f<=100)return this.set(C,f),!0}return!1},M}();function q(M,P,I,C){var d=C?M.split(C):[M];for(var f in d){if(typeof d[f]!="string")continue;var p=d[f].split(I);if(p.length!==2)continue;var T=p[0],x=p[1];P(T,x)}}var X=new oe.default(0,0,""),V=X.align==="middle"?"middle":"center";function L(M,P,I){var C=M;function d(){var T=B(M);if(T===null)throw new Error("Malformed timestamp: "+C);return M=M.replace(/^[^\sa-zA-Z-]+/,""),T}function f(T,x){var E=new se;q(T,function(b,m){var v;switch(b){case"region":for(var g=I.length-1;g>=0;g--)if(I[g].id===m){E.set(b,I[g].region);break}break;case"vertical":E.alt(b,m,["rl","lr"]);break;case"line":v=m.split(","),E.integer(b,v[0]),E.percent(b,v[0])&&E.set("snapToLines",!1),E.alt(b,v[0],["auto"]),v.length===2&&E.alt("lineAlign",v[1],["start",V,"end"]);break;case"position":v=m.split(","),E.percent(b,v[0]),v.length===2&&E.alt("positionAlign",v[1],["start",V,"end","line-left","line-right","auto"]);break;case"size":E.percent(b,m);break;case"align":E.alt(b,m,["start",V,"end","left","right"]);break}},/:/,/\s/),x.region=E.get("region",null),x.vertical=E.get("vertical","");var k=E.get("line","auto");k==="auto"&&X.line===-1&&(k=-1),x.line=k,x.lineAlign=E.get("lineAlign","start"),x.snapToLines=E.get("snapToLines",!0),x.size=E.get("size",100),x.align=E.get("align",V);var w=E.get("position","auto");w==="auto"&&X.position===50&&(w=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=w}function p(){M=M.replace(/^\s+/,"")}if(p(),P.startTime=d(),p(),M.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+C);M=M.substr(3),p(),P.endTime=d(),p(),f(M,P)}function U(M){return M.replace(//gi,` -`)}var W=function(){function M(){this.state="INITIAL",this.buffer="",this.decoder=new K,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var P=M.prototype;return P.parse=function(C){var d=this;C&&(d.buffer+=d.decoder.decode(C,{stream:!0}));function f(){var w=d.buffer,b=0;for(w=U(w);b=d&&this.observer.emit(oe.Events.ERROR,oe.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),R.executeEnd=M(),[T(v)];var We=be.flush(pe);return x(We)?We.then(function(je){return g.flushRemux(fe,je,v),fe}):(this.flushRemux(fe,We,v),fe)},b.flushRemux=function(v,g,R){var O=g.audioTrack,H=g.avcTrack,Z=g.id3Track,ee=g.textTrack,fe=this.currentTransmuxState,pe=fe.accurateTimeOffset,xe=fe.timeOffset;P.logger.log("[transmuxer.ts]: Flushed fragment "+R.sn+(R.part>-1?" p: "+R.part:"")+" of level "+R.level);var Ce=this.remuxer.remux(O,H,Z,ee,xe,pe,!0,this.id);v.push({remuxResult:Ce,chunkMeta:R}),R.transmuxing.executeEnd=M()},b.resetInitialTimestamp=function(v){var g=this.demuxer,R=this.remuxer;if(!g||!R)return;g.resetTimeStamp(v),R.resetTimeStamp(v)},b.resetContiguity=function(){var v=this.demuxer,g=this.remuxer;if(!v||!g)return;v.resetContiguity(),g.resetNextTimestamp()},b.resetInitSegment=function(v,g,R,O){var H=this.demuxer,Z=this.remuxer;if(!H||!Z)return;H.resetInitSegment(g,R,O),Z.resetInitSegment(v,g,R)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(v,g,R,O,H){var Z;return g&&g.method==="SAMPLE-AES"?Z=this.transmuxSampleAes(v,g,R,O,H):Z=this.transmuxUnencrypted(v,R,O,H),Z},b.transmuxUnencrypted=function(v,g,R,O){var H=this.demuxer.demux(v,g,!1,!this.config.progressive),Z=H.audioTrack,ee=H.avcTrack,fe=H.id3Track,pe=H.textTrack,xe=this.remuxer.remux(Z,ee,fe,pe,g,R,!1,this.id);return{remuxResult:xe,chunkMeta:O}},b.transmuxSampleAes=function(v,g,R,O,H){var Z=this;return this.demuxer.demuxSampleAes(v,g,R).then(function(ee){var fe=Z.remuxer.remux(ee.audioTrack,ee.avcTrack,ee.id3Track,ee.textTrack,R,O,!1,Z.id);return{remuxResult:fe,chunkMeta:H}})},b.configureTransmuxer=function(v,g){for(var R=this.config,O=this.observer,H=this.typeSupported,Z=this.vendor,ee=g.audioCodec,fe=g.defaultInitPts,pe=g.duration,xe=g.initSegmentData,Ce=g.videoCodec,be,Oe=0,We=C.length;Oe0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(m=b),m}var T=function(b){return{remuxResult:{},chunkMeta:b}};function x(w){return"then"in w&&w.then instanceof Function}var E=function(b,m,v,g,R){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=m,this.initSegmentData=v,this.duration=g,this.defaultInitPts=R},k=function(b,m,v,g,R){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=m,this.accurateTimeOffset=v,this.trackSwitch=g,this.timeOffset=R}},"./src/demux/tsdemuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"discardEPB",function(){return T});var oe=z("./src/demux/adts.ts"),K=z("./src/demux/mpegaudio.ts"),B=z("./src/demux/exp-golomb.ts"),se=z("./src/demux/id3.ts"),q=z("./src/demux/sample-aes.ts"),X=z("./src/events.ts"),V=z("./src/utils/mp4-tools.ts"),L=z("./src/utils/logger.ts"),U=z("./src/errors.ts"),G={video:1,audio:2,id3:3,text:4},I=function(){function x(k,w,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=k,this.config=w,this.typeSupported=b}x.probe=function(w){var b=x.syncOffset(w);return b<0?!1:(b&&L.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},x.syncOffset=function(w){for(var b=Math.min(1e3,w.length-3*188),m=0;m>4,ke=void 0;if(Qe>1){if(ke=Ge+5+w[Ge+4],ke===Ge+188)continue}else ke=Ge+4;switch(Xe){case Z:Ze&&(ee&&(g=d(ee))&&this.parseAVCPES(g,!1),ee={data:[],size:0}),ee&&(ee.data.push(w.subarray(ke,Ge+188)),ee.size+=Ge+188-ke);break;case fe:Ze&&(xe&&(g=d(xe))&&(O.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),xe={data:[],size:0}),xe&&(xe.data.push(w.subarray(ke,Ge+188)),xe.size+=Ge+188-ke);break;case pe:Ze&&(Ce&&(g=d(Ce))&&this.parseID3PES(g),Ce={data:[],size:0}),Ce&&(Ce.data.push(w.subarray(ke,Ge+188)),Ce.size+=Ge+188-ke);break;case 0:Ze&&(ke+=w[ke]+1),We=this._pmtId=M(w,ke);break;case We:{Ze&&(ke+=w[ke]+1);var Y=C(w,ke,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,m);Z=Y.avc,Z>0&&(R.pid=Z),fe=Y.audio,fe>0&&(O.pid=fe,O.isAAC=Y.isAAC),pe=Y.id3,pe>0&&(H.pid=pe),be&&!Oe&&(L.logger.log("reparse from beginning"),be=!1,Ge=ct-188),Oe=this.pmtParsed=!0;break}case 17:case 8191:break;default:be=!0;break}}else this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});R.pesData=ee,O.pesData=xe,H.pesData=Ce;var A={audioTrack:O,avcTrack:R,id3Track:H,textTrack:this._txtTrack};return v&&this.extractRemainingSamples(A),A},E.flush=function(){var w=this.remainderData;this.remainderData=null;var b;return w?b=this.demux(w,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},E.extractRemainingSamples=function(w){var b=w.audioTrack,m=w.avcTrack,v=w.id3Track,g=m.pesData,R=b.pesData,O=v.pesData,H;g&&(H=d(g))?(this.parseAVCPES(H,!0),m.pesData=null):m.pesData=g,R&&(H=d(R))?(b.isAAC?this.parseAACPES(H):this.parseMPEGPES(H),b.pesData=null):(R!=null&&R.size&&L.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=R),O&&(H=d(O))?(this.parseID3PES(H),v.pesData=null):v.pesData=O},E.demuxSampleAes=function(w,b,m){var v=this.demux(w,m,!0,!this.config.progressive),g=this.sampleAes=new q.default(this.observer,this.config,b);return this.decrypt(v,g)},E.decrypt=function(w,b){return new Promise(function(m){var v=w.audioTrack,g=w.avcTrack;v.samples&&v.isAAC?b.decryptAacSamples(v.samples,0,function(){g.samples?b.decryptAvcSamples(g.samples,0,0,function(){m(w)}):m(w)}):g.samples&&b.decryptAvcSamples(g.samples,0,0,function(){m(w)})})},E.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},E.parseAVCPES=function(w,b){var m=this,v=this._avcTrack,g=this.parseAVCNALu(w.data),R=!1,O=this.avcSample,H,Z=!1;w.data=null,O&&g.length&&!v.audFound&&(f(O,v),O=this.avcSample=P(!1,w.pts,w.dts,"")),g.forEach(function(ee){switch(ee.type){case 1:{H=!0,O||(O=m.avcSample=P(!0,w.pts,w.dts,"")),R&&(O.debug+="NDR "),O.frame=!0;var fe=ee.data;if(Z&&fe.length>4){var pe=new B.default(fe).readSliceType();(pe===2||pe===4||pe===7||pe===9)&&(O.key=!0)}break}case 5:H=!0,O||(O=m.avcSample=P(!0,w.pts,w.dts,"")),R&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{H=!0,R&&O&&(O.debug+="SEI ");var xe=new B.default(T(ee.data));xe.readUByte();for(var Ce=0,be=0,Oe=!1,We=0;!Oe&&xe.bytesAvailable>1;){Ce=0;do We=xe.readUByte(),Ce+=We;while(We===255);be=0;do We=xe.readUByte(),be+=We;while(We===255);if(Ce===4&&xe.bytesAvailable!==0){Oe=!0;var je=xe.readUByte();if(je===181){var ct=xe.readUShort();if(ct===49){var Ge=xe.readUInt();if(Ge===1195456820){var Ze=xe.readUByte();if(Ze===3){for(var Xe=xe.readUByte(),Qe=xe.readUByte(),ke=31&Xe,Y=[Xe,Qe],A=0;A16){for(var _=[],J=0;J<16;J++)_.push(xe.readUByte().toString(16)),(J===3||J===5||J===7||J===9)&&_.push("-");for(var ae=be-16,$=new Uint8Array(ae),Se=0;Se=0){var xe={data:w.subarray(fe,O-v-1),type:pe};R.push(xe)}else{var Ce=this.getLastNalUnit();if(Ce&&(g&&O<=4-g&&(Ce.state&&(Ce.data=Ce.data.subarray(0,Ce.data.byteLength-g))),Z=O-v-1,Z>0)){var be=new Uint8Array(Ce.data.byteLength+Z);be.set(Ce.data,0),be.set(w.subarray(0,Z),Ce.data.byteLength),Ce.data=be,Ce.state=0}}O=0&&v>=0){var Oe={data:w.subarray(fe,b),type:pe,state:v};R.push(Oe)}if(R.length===0){var We=this.getLastNalUnit();if(We){var je=new Uint8Array(We.data.byteLength+w.byteLength);je.set(We.data,0),je.set(w,We.data.byteLength),We.data=je}}return m.naluState=v,R},E.parseAACPES=function(w){var b=0,m=this._audioTrack,v=this.aacOverFlow,g=w.data;if(v){this.aacOverFlow=null;var R=v.sample.unit.byteLength,O=Math.min(v.missing,R),H=R-O;v.sample.unit.set(g.subarray(0,O),H),m.samples.push(v.sample),b=v.missing}var Z,ee;for(Z=b,ee=g.length;Z1;){var R=new Uint8Array(g[0].length+g[1].length);R.set(g[0]),R.set(g[1],g[0].length),g[0]=R,g.splice(1,1)}k=g[0];var O=(k[0]<<16)+(k[1]<<8)+k[2];if(O===1){if(w=(k[4]<<8)+k[5],w&&w>x.size-6)return null;var H=k[7];H&192&&(m=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,H&64?(v=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,m-v>60*9e4&&(L.logger.warn(Math.round((m-v)/9e4)+"s delta between PTS and DTS, align them"),m=v)):v=m),b=k[8];var Z=b+9;if(x.size<=Z)return null;x.size-=Z;for(var ee=new Uint8Array(x.size),fe=0,pe=g.length;fexe){Z-=xe;continue}else k=k.subarray(Z),xe-=Z,Z=0;ee.set(k,E),E+=xe}return w&&(w-=b+3),{data:ee,pts:m,dts:v,len:w}}return null}function f(x,E){if(x.units.length&&x.frame){if(x.pts===void 0){var k=E.samples,w=k.length;if(w){var b=k[w-1];x.pts=b.pts,x.dts=b.dts}else{E.dropped++;return}}E.samples.push(x)}x.debug.length&&L.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function p(x,E){var k=x.length;if(k>0){if(E.pts>=x[k-1].pts)x.push(E);else for(var w=k-1;w>=0;w--)if(E.ptsm)return g;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,m=this.autoLevelCapping,v;return m===-1&&b&&b.length?v=b.length-1:v=m,v}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var m=this.audioTrackController;m&&(m.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return d.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return E.defaultConfig?E.defaultConfig:P.hlsDefaultConfig},set:function(b){E.defaultConfig=b}}]),E}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isSupported",function(){return B}),z.d(re,"changeTypeSupported",function(){return se});var oe=z("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var q=Object(oe.getMediaSource)();if(!q)return!1;var X=K(),V=q&&typeof q.isTypeSupported=="function"&&q.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),L=!X||X.prototype&&typeof X.prototype.appendBuffer=="function"&&typeof X.prototype.remove=="function";return!!V&&!!L}function se(){var q,X=K();return typeof(X==null||((q=X.prototype)===null||q===void 0)?void 0:q.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return I}),z.d(re,"LoadError",function(){return M});var oe=z("./src/polyfills/number.ts"),K=z("./src/errors.ts");function B(C,d){C.prototype=Object.create(d.prototype),C.prototype.constructor=C,L(C,d)}function se(C){var d=typeof Map=="function"?new Map:void 0;return se=function(p){if(p===null||!V(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(p))return d.get(p);d.set(p,T)}function T(){return q(p,arguments,U(this).constructor)}return T.prototype=Object.create(p.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L(T,p)},se(C)}function q(C,d,f){return X()?q=Reflect.construct:q=function(T,x,E){var k=[null];k.push.apply(k,x);var w=Function.bind.apply(T,k),b=new w;return E&&L(b,E.prototype),b},q.apply(null,arguments)}function X(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(C){return!1}}function V(C){return Function.toString.call(C).indexOf("[native code]")!==-1}function L(C,d){return L=Object.setPrototypeOf||function(p,T){return p.__proto__=T,p},L(C,d)}function U(C){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},U(C)}var G=Math.pow(2,17),I=function(){function C(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var d=C.prototype;return d.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},d.abort=function(){this.loader&&this.loader.abort()},d.load=function(p,T){var x=this,E=p.url;if(!E)return Promise.reject(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,networkDetails:null},"Fragment does not have a "+(E?"part list":"url")));this.abort();var k=this.config,w=k.fLoader,b=k.loader;return new Promise(function(m,v){x.loader&&x.loader.destroy();var g=x.loader=p.loader=w?new w(k):new b(k),R=P(p),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:G};p.stats=g.stats,g.load(R,O,{onSuccess:function(Z,ee,fe,pe){x.resetLoader(p,g),m({frag:p,part:null,payload:Z.data,networkDetails:pe})},onError:function(Z,ee,fe){x.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,response:Z,networkDetails:fe}))},onAbort:function(Z,ee,fe){x.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:p,networkDetails:fe}))},onTimeout:function(Z,ee,fe){x.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:p,networkDetails:fe}))},onProgress:function(Z,ee,fe,pe){T&&T({frag:p,part:null,payload:fe,networkDetails:pe})}})})},d.loadPart=function(p,T,x){var E=this;this.abort();var k=this.config,w=k.fLoader,b=k.loader;return new Promise(function(m,v){E.loader&&E.loader.destroy();var g=E.loader=p.loader=w?new w(k):new b(k),R=P(p,T),O={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:G};T.stats=g.stats,g.load(R,O,{onSuccess:function(Z,ee,fe,pe){E.resetLoader(p,g),E.updateStatsFromPart(p,T);var xe={frag:p,part:T,payload:Z.data,networkDetails:pe};x(xe),m(xe)},onError:function(Z,ee,fe){E.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:p,part:T,response:Z,networkDetails:fe}))},onAbort:function(Z,ee,fe){p.stats.aborted=T.stats.aborted,E.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:p,part:T,networkDetails:fe}))},onTimeout:function(Z,ee,fe){E.resetLoader(p,g),v(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:p,part:T,networkDetails:fe}))}})})},d.updateStatsFromPart=function(p,T){var x=p.stats,E=T.stats,k=E.total;if(x.loaded+=E.loaded,k){var w=Math.round(p.duration/T.duration),b=Math.min(Math.round(x.loaded/k),w),m=w-b,v=m*Math.round(x.loaded/b);x.total=x.loaded+v}else x.total=Math.max(x.loaded,x.total);var g=x.loading,R=E.loading;g.start?g.first+=R.first-R.start:(g.start=R.start,g.first=R.first),g.end=R.end},d.resetLoader=function(p,T){p.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},C}();function P(C,d){d===void 0&&(d=null);var f=d||C,p={frag:C,part:d,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},T=f.byteRangeStartOffset,x=f.byteRangeEndOffset;return Object(oe.isFiniteNumber)(T)&&Object(oe.isFiniteNumber)(x)&&(p.rangeStart=T,p.rangeEnd=x),p}var M=function(C){B(d,C);function d(f){for(var p,T=arguments.length,x=new Array(T>1?T-1:0),E=1;E>8*(15-k)&255;return E},p.setDecryptDataFromLevelKey=function(x,E){var k=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(k=q.LevelKey.fromURI(x.uri),k.method=x.method,k.iv=this.createInitializationVector(E),k.keyFormat="identity"),k},p.setElementaryStreamInfo=function(x,E,k,w,b,m){m===void 0&&(m=!1);var v=this.elementaryStreams,g=v[x];if(!g){v[x]={startPTS:E,endPTS:k,startDTS:w,endDTS:b,partial:m};return}g.startPTS=Math.min(g.startPTS,E),g.endPTS=Math.max(g.endPTS,k),g.startDTS=Math.min(g.startDTS,w),g.endDTS=Math.max(g.endDTS,b)},p.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[I.AUDIO]=null,x[I.VIDEO]=null,x[I.AUDIOVIDEO]=null},G(f,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&se.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(oe.isFiniteNumber)(this.programDateTime))return null;var x=Object(oe.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),f}(P),C=function(d){V(f,d);function f(p,T,x,E,k){var w;w=d.call(this,x)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new X.LoadStats,w.duration=p.decimalFloatingPoint("DURATION"),w.gap=p.bool("GAP"),w.independent=p.bool("INDEPENDENT"),w.relurl=p.enumeratedString("URI"),w.fragment=T,w.index=E;var b=p.enumeratedString("BYTERANGE");return b&&w.setByteRange(b,k),k&&(w.fragOffset=k.fragOffset+k.duration),w}return G(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),f}(P)},"./src/loader/key-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return se});var oe=z("./src/events.ts"),K=z("./src/errors.ts"),B=z("./src/utils/logger.ts"),se=function(){function q(V){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=V,this._registerListeners()}var X=q.prototype;return X._registerListeners=function(){this.hls.on(oe.Events.KEY_LOADING,this.onKeyLoading,this)},X._unregisterListeners=function(){this.hls.off(oe.Events.KEY_LOADING,this.onKeyLoading)},X.destroy=function(){this._unregisterListeners();for(var L in this.loaders){var U=this.loaders[L];U&&U.destroy()}this.loaders={}},X.onKeyLoading=function(L,U){var G=U.frag,I=G.type,P=this.loaders[I];if(!G.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var M=G.decryptdata.uri;if(M!==this.decrypturl||this.decryptkey===null){var C=this.hls.config;if(P&&(B.logger.warn("abort previous key loader for type:"+I),P.abort()),!M){B.logger.warn("key uri is falsy");return}var d=C.loader,f=G.loader=this.loaders[I]=new d(C);this.decrypturl=M,this.decryptkey=null;var p={url:M,frag:G,responseType:"arraybuffer"},T={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:C.fragLoadingRetryDelay,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(p,T,x)}else this.decryptkey&&(G.decryptdata.key=this.decryptkey,this.hls.trigger(oe.Events.KEY_LOADED,{frag:G}))},X.loadsuccess=function(L,U,G){var I=G.frag;if(!I.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=I.decryptdata.key=new Uint8Array(L.data),I.loader=null,delete this.loaders[I.type],this.hls.trigger(oe.Events.KEY_LOADED,{frag:I})},X.loaderror=function(L,U){var G=U.frag,I=G.loader;I&&I.abort(),delete this.loaders[G.type],this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:G,response:L})},X.loadtimeout=function(L,U){var G=U.frag,I=G.loader;I&&I.abort(),delete this.loaders[G.type],this.hls.trigger(oe.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:G})},q}()},"./src/loader/level-details.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"LevelDetails",function(){return q});var oe=z("./src/polyfills/number.ts");function K(X,V){for(var L=0;LU.endSN||G>0||G===0&&I>0,this.updated||this.advanced?this.misses=Math.floor(U.misses*.6):this.misses=U.misses+1,this.availabilityDelay=U.availabilityDelay},B(X,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(oe.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||se}},{key:"drift",get:function(){var U=this.driftEndTime-this.driftStartTime;if(U>0){var G=this.driftEnd-this.driftStart;return G*1e3/U}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var U;return(U=this.fragments)!==null&&U!==void 0&&U.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var U;return(U=this.partList)!==null&&U!==void 0&&U.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),X}()},"./src/loader/level-key.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"LevelKey",function(){return q});var oe=z("./node_modules/url-toolkit/src/url-toolkit.js"),K=z.n(oe);function B(X,V){for(var L=0;L2){var v=m.shift()+".";return v+=parseInt(m.shift()).toString(16),v+=("000"+parseInt(m.shift()).toString(16)).substr(-4),v}return b},k.resolve=function(b,m){return K.buildAbsoluteURL(m,b,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(b,m){var v=[],g={},R=!1;G.lastIndex=0;for(var O;(O=G.exec(b))!=null;)if(O[1]){var H=new V.AttrList(O[1]),Z={attrs:H,bitrate:H.decimalInteger("AVERAGE-BANDWIDTH")||H.decimalInteger("BANDWIDTH"),name:H.NAME,url:k.resolve(O[2],m)},ee=H.decimalResolution("RESOLUTION");ee&&(Z.width=ee.width,Z.height=ee.height),p((H.CODECS||"").split(/[ ,]+/).filter(function(pe){return pe}),Z),Z.videoCodec&&Z.videoCodec.indexOf("avc1")!==-1&&(Z.videoCodec=k.convertAVC1ToAVCOTI(Z.videoCodec)),v.push(Z)}else if(O[3]){var fe=new V.AttrList(O[3]);fe["DATA-ID"]&&(R=!0,g[fe["DATA-ID"]]=fe)}return{levels:v,sessionData:R?g:null}},k.parseMasterPlaylistMedia=function(b,m,v,g){g===void 0&&(g=[]);var R,O=[],H=0;for(I.lastIndex=0;(R=I.exec(b))!==null;){var Z=new V.AttrList(R[1]);if(Z.TYPE===v){var ee={attrs:Z,bitrate:0,id:H++,groupId:Z["GROUP-ID"],instreamId:Z["INSTREAM-ID"],name:Z.NAME||Z.LANGUAGE||"",type:v,default:Z.bool("DEFAULT"),autoselect:Z.bool("AUTOSELECT"),forced:Z.bool("FORCED"),lang:Z.LANGUAGE,url:Z.URI?k.resolve(Z.URI,m):""};if(g.length){var fe=k.findGroup(g,ee.groupId)||g[0];T(ee,fe,"audioCodec"),T(ee,fe,"textCodec")}O.push(ee)}}return O},k.parseLevelPlaylist=function(b,m,v,g,R){var O=new q.LevelDetails(m),H=O.fragments,Z=null,ee=0,fe=0,pe=0,xe=0,Ce=null,be=new se.Fragment(g,m),Oe,We,je,ct=-1,Ge=!1;for(P.lastIndex=0,O.m3u8=b;(Oe=P.exec(b))!==null;){Ge&&(Ge=!1,be=new se.Fragment(g,m),be.start=pe,be.sn=ee,be.cc=xe,be.level=v,Z&&(be.initSegment=Z,be.rawProgramDateTime=Z.rawProgramDateTime));var Ze=Oe[1];if(Ze){be.duration=parseFloat(Ze);var Xe=(" "+Oe[2]).slice(1);be.title=Xe||null,be.tagList.push(Xe?["INF",Ze,Xe]:["INF",Ze])}else if(Oe[3])Object(oe.isFiniteNumber)(be.duration)&&(be.start=pe,je&&(be.levelkey=je),be.sn=ee,be.level=v,be.cc=xe,be.urlId=R,H.push(be),be.relurl=(" "+Oe[3]).slice(1),E(be,Ce),Ce=be,pe+=be.duration,ee++,fe=0,Ge=!0);else if(Oe[4]){var Qe=(" "+Oe[4]).slice(1);Ce?be.setByteRange(Qe,Ce):be.setByteRange(Qe)}else if(Oe[5])be.rawProgramDateTime=(" "+Oe[5]).slice(1),be.tagList.push(["PROGRAM-DATE-TIME",be.rawProgramDateTime]),ct===-1&&(ct=H.length);else{if(Oe=Oe[0].match(M),!Oe){L.logger.warn("No matches on slow regex match for level playlist!");continue}for(We=1;We-1){L.logger.warn("Keyformat "+bt+" is not supported from the manifest");continue}else if(bt!=="identity")continue;$e&&(je=X.LevelKey.fromURL(m,at),at&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(je.method=$e,je.keyFormat=bt,tt&&(je.keyID=tt),nt&&(je.keyFormatVersions=nt),je.iv=Ke));break}case"START":{var Lt=new V.AttrList(Y),Ot=Lt.decimalFloatingPoint("TIME-OFFSET");Object(oe.isFiniteNumber)(Ot)&&(O.startTimeOffset=Ot);break}case"MAP":{var xt=new V.AttrList(Y);be.relurl=xt.URI,xt.BYTERANGE&&be.setByteRange(xt.BYTERANGE),be.level=v,be.sn="initSegment",je&&(be.levelkey=je),be.initSegment=null,Z=be,Ge=!0;break}case"SERVER-CONTROL":{var jt=new V.AttrList(Y);O.canBlockReload=jt.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=jt.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&jt.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=jt.optionalFloat("PART-HOLD-BACK",0),O.holdBack=jt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Nt=new V.AttrList(Y);O.partTarget=Nt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var mt=O.partList;mt||(mt=O.partList=[]);var Ht=fe>0?mt[mt.length-1]:void 0,Vt=fe++,ge=new se.Part(new V.AttrList(Y),be,m,Vt,Ht);mt.push(ge),be.duration+=ge.duration;break}case"PRELOAD-HINT":{var ie=new V.AttrList(Y);O.preloadHint=ie;break}case"RENDITION-REPORT":{var ne=new V.AttrList(Y);O.renditionReports=O.renditionReports||[],O.renditionReports.push(ne);break}default:L.logger.warn("line parsed but not handled: "+Oe);break}}}Ce&&!Ce.relurl?(H.pop(),pe-=Ce.duration,O.partList&&(O.fragmentHint=Ce)):O.partList&&(E(be,Ce),be.cc=xe,O.fragmentHint=be);var ce=H.length,me=H[0],le=H[ce-1];if(pe+=O.skippedSegments*O.targetduration,pe>0&&ce&&le){O.averagetargetduration=pe/ce;var ue=le.sn;O.endSN=ue!=="initSegment"?ue:0,me&&(O.startCC=me.cc,me.initSegment||O.fragments.every(function(ye){return ye.relurl&&d(ye.relurl)})&&(L.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),be=new se.Fragment(g,m),be.relurl=le.relurl,be.level=v,be.sn="initSegment",me.initSegment=be,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(pe+=O.fragmentHint.duration),O.totalduration=pe,O.endCC=xe,ct>0&&x(H,ct),O},k}();function p(k,w){["video","audio","text"].forEach(function(b){var m=k.filter(function(g){return Object(U.isCodecType)(g,b)});if(m.length){var v=m.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});w[b+"Codec"]=v.length>0?v[0]:m[0],k=k.filter(function(g){return m.indexOf(g)===-1})}}),w.unknownCodecs=k}function T(k,w,b){var m=w[b];m&&(k[b]=m)}function x(k,w){for(var b=k[w],m=w;m--;){var v=k[m];if(!v)return;v.programDateTime=b.programDateTime-v.duration*1e3,b=v}}function E(k,w){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):w!=null&&w.programDateTime&&(k.programDateTime=w.endProgramDateTime),Object(oe.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/polyfills/number.ts"),K=z("./src/events.ts"),B=z("./src/errors.ts"),se=z("./src/utils/logger.ts"),q=z("./src/utils/mp4-tools.ts"),X=z("./src/loader/m3u8-parser.ts"),V=z("./src/types/loader.ts"),L=z("./src/utils/attr-list.ts");function U(P){var M=P.type;switch(M){case V.PlaylistContextType.AUDIO_TRACK:return V.PlaylistLevelType.AUDIO;case V.PlaylistContextType.SUBTITLE_TRACK:return V.PlaylistLevelType.SUBTITLE;default:return V.PlaylistLevelType.MAIN}}function G(P,M){var C=P.url;return(C===void 0||C.indexOf("data:")===0)&&(C=M.url),C}var I=function(){function P(C){this.hls=void 0,this.loaders=Object.create(null),this.hls=C,this.registerListeners()}var M=P.prototype;return M.registerListeners=function(){var d=this.hls;d.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},M.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),d.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},M.createInternalLoader=function(d){var f=this.hls.config,p=f.pLoader,T=f.loader,x=p||T,E=new x(f);return d.loader=E,this.loaders[d.type]=E,E},M.getInternalLoader=function(d){return this.loaders[d.type]},M.resetInternalLoader=function(d){this.loaders[d]&&delete this.loaders[d]},M.destroyInternalLoaders=function(){for(var d in this.loaders){var f=this.loaders[d];f&&f.destroy(),this.resetInternalLoader(d)}},M.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},M.onManifestLoading=function(d,f){var p=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:V.PlaylistContextType.MANIFEST,url:p,deliveryDirectives:null})},M.onLevelLoading=function(d,f){var p=f.id,T=f.level,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:null,level:T,responseType:"text",type:V.PlaylistContextType.LEVEL,url:x,deliveryDirectives:E})},M.onAudioTrackLoading=function(d,f){var p=f.id,T=f.groupId,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:E})},M.onSubtitleTrackLoading=function(d,f){var p=f.id,T=f.groupId,x=f.url,E=f.deliveryDirectives;this.load({id:p,groupId:T,level:null,responseType:"text",type:V.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:E})},M.load=function(d){var f,p=this.hls.config,T=this.getInternalLoader(d);if(T){var x=T.context;if(x&&x.url===d.url){se.logger.trace("[playlist-loader]: playlist request ongoing");return}se.logger.log("[playlist-loader]: aborting previous loader for type: "+d.type),T.abort()}var E,k,w,b;switch(d.type){case V.PlaylistContextType.MANIFEST:E=p.manifestLoadingMaxRetry,k=p.manifestLoadingTimeOut,w=p.manifestLoadingRetryDelay,b=p.manifestLoadingMaxRetryTimeout;break;case V.PlaylistContextType.LEVEL:case V.PlaylistContextType.AUDIO_TRACK:case V.PlaylistContextType.SUBTITLE_TRACK:E=0,k=p.levelLoadingTimeOut;break;default:E=p.levelLoadingMaxRetry,k=p.levelLoadingTimeOut,w=p.levelLoadingRetryDelay,b=p.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(d),(f=d.deliveryDirectives)!==null&&f!==void 0&&f.part){var m;if(d.type===V.PlaylistContextType.LEVEL&&d.level!==null?m=this.hls.levels[d.level].details:d.type===V.PlaylistContextType.AUDIO_TRACK&&d.id!==null?m=this.hls.audioTracks[d.id].details:d.type===V.PlaylistContextType.SUBTITLE_TRACK&&d.id!==null&&(m=this.hls.subtitleTracks[d.id].details),m){var v=m.partTarget,g=m.targetduration;v&&g&&(k=Math.min(Math.max(v*3,g*.8)*1e3,k))}}var R={timeout:k,maxRetry:E,retryDelay:w,maxRetryDelay:b,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(d,R,O)},M.loadsuccess=function(d,f,p,T){if(T===void 0&&(T=null),p.isSidxRequest){this.handleSidxRequest(d,p),this.handlePlaylistLoaded(d,f,p,T);return}this.resetInternalLoader(p.type);var x=d.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,p,"no EXTM3U delimiter",T);return}f.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(d,f,p,T):this.handleMasterPlaylist(d,f,p,T)},M.loaderror=function(d,f,p){p===void 0&&(p=null),this.handleNetworkError(f,p,!1,d)},M.loadtimeout=function(d,f,p){p===void 0&&(p=null),this.handleNetworkError(f,p,!0)},M.handleMasterPlaylist=function(d,f,p,T){var x=this.hls,E=d.data,k=G(d,p),w=X.default.parseMasterPlaylist(E,k),b=w.levels,m=w.sessionData;if(!b.length){this.handleManifestParsingError(d,p,"no level found in manifest",T);return}var v=b.map(function(ee){return{id:ee.attrs.AUDIO,audioCodec:ee.audioCodec}}),g=b.map(function(ee){return{id:ee.attrs.SUBTITLES,textCodec:ee.textCodec}}),R=X.default.parseMasterPlaylistMedia(E,k,"AUDIO",v),O=X.default.parseMasterPlaylistMedia(E,k,"SUBTITLES",g),H=X.default.parseMasterPlaylistMedia(E,k,"CLOSED-CAPTIONS");if(R.length){var Z=R.some(function(ee){return!ee.url});!Z&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(se.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),R.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new L.AttrList({}),bitrate:0,url:""}))}x.trigger(K.Events.MANIFEST_LOADED,{levels:b,audioTracks:R,subtitles:O,captions:H,url:k,stats:f,networkDetails:T,sessionData:m})},M.handleTrackOrLevelPlaylist=function(d,f,p,T){var x=this.hls,E=p.id,k=p.level,w=p.type,b=G(d,p),m=Object(oe.isFiniteNumber)(E)?E:0,v=Object(oe.isFiniteNumber)(k)?k:m,g=U(p),R=X.default.parseLevelPlaylist(d.data,b,v,g,m);if(!R.fragments.length){x.trigger(K.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof p.level=="number"?p.level:void 0});return}if(w===V.PlaylistContextType.MANIFEST){var O={attrs:new L.AttrList({}),bitrate:0,details:R,name:"",url:b};x.trigger(K.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:b,stats:f,networkDetails:T,sessionData:null})}if(f.parsing.end=performance.now(),R.needSidxRanges){var H,Z=(H=R.fragments[0].initSegment)===null||H===void 0?void 0:H.url;this.load({url:Z,isSidxRequest:!0,type:w,level:k,levelDetails:R,id:E,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}p.levelDetails=R,this.handlePlaylistLoaded(d,f,p,T)},M.handleSidxRequest=function(d,f){var p=Object(q.parseSegmentIndex)(new Uint8Array(d.data));if(!p)return;var T=p.references,x=f.levelDetails;T.forEach(function(E,k){var w=E.info,b=x.fragments[k];b.byteRange.length===0&&b.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),b.initSegment&&b.initSegment.setByteRange(String(p.moovEndOffset)+"@0")})},M.handleManifestParsingError=function(d,f,p,T){this.hls.trigger(K.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===V.PlaylistContextType.MANIFEST,url:d.url,reason:p,response:d,context:f,networkDetails:T})},M.handleNetworkError=function(d,f,p,T){p===void 0&&(p=!1),se.logger.warn("[playlist-loader]: A network "+(p?"timeout":"error")+" occurred while loading "+d.type+" level: "+d.level+" id: "+d.id+' group-id: "'+d.groupId+'"');var x=B.ErrorDetails.UNKNOWN,E=!1,k=this.getInternalLoader(d);switch(d.type){case V.PlaylistContextType.MANIFEST:x=p?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,E=!0;break;case V.PlaylistContextType.LEVEL:x=p?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.AUDIO_TRACK:x=p?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,E=!1;break;case V.PlaylistContextType.SUBTITLE_TRACK:x=p?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,E=!1;break}k&&this.resetInternalLoader(d.type);var w={type:B.ErrorTypes.NETWORK_ERROR,details:x,fatal:E,url:d.url,loader:k,context:d,networkDetails:f};T&&(w.response=T),this.hls.trigger(K.Events.ERROR,w)},M.handlePlaylistLoaded=function(d,f,p,T){var x=p.type,E=p.level,k=p.id,w=p.groupId,b=p.loader,m=p.levelDetails,v=p.deliveryDirectives;if(!(m!=null&&m.targetduration)){this.handleManifestParsingError(d,p,"invalid target duration",T);return}if(!b)return;m.live&&(b.getCacheAge&&(m.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(m.ageHeader))&&(m.ageHeader=0));switch(x){case V.PlaylistContextType.MANIFEST:case V.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:m,level:E||0,id:k||0,stats:f,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:m,id:k||0,groupId:w||"",stats:f,networkDetails:T,deliveryDirectives:v});break;case V.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:m,id:k||0,groupId:w||"",stats:f,networkDetails:T,deliveryDirectives:v});break}},P}();re.default=I},"./src/polyfills/number.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"isFiniteNumber",function(){return oe}),z.d(re,"MAX_SAFE_INTEGER",function(){return K});var oe=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ze,re,z){"use strict";z.r(re);var oe=function(){function K(){}return K.getSilentFrame=function(se,q){switch(se){case"mp4a.40.2":if(q===1)return new Uint8Array([0,200,0,128,35,128]);if(q===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(q===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(q===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(q===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(q===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(q===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(q===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},K}();re.default=oe},"./src/remux/mp4-generator.ts":function(ze,re,z){"use strict";z.r(re);var oe=Math.pow(2,32)-1,K=function(){function B(){}return B.init=function(){B.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var q;for(q in B.types)B.types.hasOwnProperty(q)&&(B.types[q]=[q.charCodeAt(0),q.charCodeAt(1),q.charCodeAt(2),q.charCodeAt(3)]);var X=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),V=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);B.HDLR_TYPES={video:X,audio:V};var L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),U=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=U,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var G=new Uint8Array([105,115,111,109]),I=new Uint8Array([97,118,99,49]),P=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,G,P,G,I),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,L))},B.box=function(q){for(var X=8,V=arguments.length,L=new Array(V>1?V-1:0),U=1;U>24&255,P[1]=X>>16&255,P[2]=X>>8&255,P[3]=X&255,P.set(q,4),G=0,X=8;G>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},B.mdia=function(q){return B.box(B.types.mdia,B.mdhd(q.timescale,q.duration),B.hdlr(q.type),B.minf(q))},B.mfhd=function(q){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,q>>24,q>>16&255,q>>8&255,q&255]))},B.minf=function(q){return q.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(q)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(q))},B.moof=function(q,X,V){return B.box(B.types.moof,B.mfhd(q),B.traf(V,X))},B.moov=function(q){for(var X=q.length,V=[];X--;)V[X]=B.trak(q[X]);return B.box.apply(null,[B.types.moov,B.mvhd(q[0].timescale,q[0].duration)].concat(V).concat(B.mvex(q)))},B.mvex=function(q){for(var X=q.length,V=[];X--;)V[X]=B.trex(q[X]);return B.box.apply(null,[B.types.mvex].concat(V))},B.mvhd=function(q,X){X*=q;var V=Math.floor(X/(oe+1)),L=Math.floor(X%(oe+1)),U=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,q>>24&255,q>>16&255,q>>8&255,q&255,V>>24,V>>16&255,V>>8&255,V&255,L>>24,L>>16&255,L>>8&255,L&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,U)},B.sdtp=function(q){var X=q.samples||[],V=new Uint8Array(4+X.length),L,U;for(L=0;L>>8&255),X.push(G&255),X=X.concat(Array.prototype.slice.call(U));for(L=0;L>>8&255),V.push(G&255),V=V.concat(Array.prototype.slice.call(U));var I=B.box(B.types.avcC,new Uint8Array([1,X[3],X[4],X[5],252|3,224|q.sps.length].concat(X).concat([q.pps.length]).concat(V))),P=q.width,M=q.height,C=q.pixelRatio[0],d=q.pixelRatio[1];return B.box(B.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,P>>8&255,P&255,M>>8&255,M&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),I,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([C>>24,C>>16&255,C>>8&255,C&255,d>>24,d>>16&255,d>>8&255,d&255])))},B.esds=function(q){var X=q.config.length;return new Uint8Array([0,0,0,0,3,23+X,0,1,0,4,15+X,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([X]).concat(q.config).concat([6,1,2]))},B.mp4a=function(q){var X=q.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]),B.box(B.types.esds,B.esds(q)))},B.mp3=function(q){var X=q.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,q.channelCount,0,16,0,0,0,0,X>>8&255,X&255,0,0]))},B.stsd=function(q){return q.type==="audio"?!q.isAAC&&q.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(q)):B.box(B.types.stsd,B.STSD,B.mp4a(q)):B.box(B.types.stsd,B.STSD,B.avc1(q))},B.tkhd=function(q){var X=q.id,V=q.duration*q.timescale,L=q.width,U=q.height,G=Math.floor(V/(oe+1)),I=Math.floor(V%(oe+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,L>>8&255,L&255,0,0,U>>8&255,U&255,0,0]))},B.traf=function(q,X){var V=B.sdtp(q),L=q.id,U=Math.floor(X/(oe+1)),G=Math.floor(X%(oe+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,U>>24,U>>16&255,U>>8&255,U&255,G>>24,G>>16&255,G>>8&255,G&255])),B.trun(q,V.length+16+20+8+16+8+8),V)},B.trak=function(q){return q.duration=q.duration||4294967295,B.box(B.types.trak,B.tkhd(q),B.mdia(q))},B.trex=function(q){var X=q.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,X>>24,X>>16&255,X>>8&255,X&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(q,X){var V=q.samples||[],L=V.length,U=12+16*L,G=new Uint8Array(U),I,P,M,C,d,f;for(X+=8+U,G.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255],0),I=0;I>>24&255,M>>>16&255,M>>>8&255,M&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&240<<8,d.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*I);return B.box(B.types.trun,G)},B.initSegment=function(q){B.types||B.init();var X=B.moov(q),V=new Uint8Array(B.FTYP.byteLength+X.byteLength);return V.set(B.FTYP),V.set(X,B.FTYP.byteLength),V},B}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0,re.default=K},"./src/remux/mp4-remuxer.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return f}),z.d(re,"normalizePts",function(){return p});var oe=z("./src/polyfills/number.ts"),K=z("./src/remux/aac-helper.ts"),B=z("./src/remux/mp4-generator.ts"),se=z("./src/events.ts"),q=z("./src/errors.ts"),X=z("./src/utils/logger.ts"),V=z("./src/types/loader.ts"),L=z("./src/utils/timescale-conversion.ts");function U(){return U=Object.assign||function(k){for(var w=1;w0?R:O.pts},m[0].pts);return v&&X.logger.debug("PTS rollover detected"),g},w.remux=function(m,v,g,R,O,H,Z,ee){var fe,pe,xe,Ce,be,Oe,We=O,je=O,ct=m.pid>-1,Ge=v.pid>-1,Ze=v.samples.length,Xe=m.samples.length>0,Qe=Ze>1,ke=(!ct||Xe)&&(!Ge||Qe)||this.ISGenerated||Z;if(ke){this.ISGenerated||(xe=this.generateIS(m,v,O));var Y=this.isVideoContiguous,A=-1;if(Qe&&(A=T(v.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(Oe=!0,A>0){X.logger.warn("[mp4-remuxer]: Dropped "+A+" out of "+Ze+" video samples due to a missing keyframe");var _=this.getVideoStartPts(v.samples);v.samples=v.samples.slice(A),v.dropped+=A,je+=(v.samples[0].pts-_)/(v.timescale||9e4)}else A===-1&&(X.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ze+" video samples"),Oe=!1);if(this.ISGenerated){if(Xe&&Qe){var J=this.getVideoStartPts(v.samples),ae=p(m.samples[0].pts,J)-J,$=ae/v.inputTimeScale;We+=Math.max(0,$),je+=Math.max(0,-$)}if(Xe){if(m.samplerate||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),xe=this.generateIS(m,v,O)),pe=this.remuxAudio(m,We,this.isAudioContiguous,H,Ge||Qe||ee===V.PlaylistLevelType.AUDIO?je:void 0),Qe){var Se=pe?pe.endPTS-pe.startPTS:0;v.inputTimeScale||(X.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),xe=this.generateIS(m,v,O)),fe=this.remuxVideo(v,je,Y,Se)}}else Qe&&(fe=this.remuxVideo(v,je,Y,0));fe&&(fe.firstKeyFrame=A,fe.independent=A!==-1)}}return this.ISGenerated&&(g.samples.length&&(be=this.remuxID3(g,O)),R.samples.length&&(Ce=this.remuxText(R,O))),{audio:pe,video:fe,initSegment:xe,independent:Oe,text:Ce,id3:be}},w.generateIS=function(m,v,g){var R=m.samples,O=v.samples,H=this.typeSupported,Z={},ee=!Object(oe.isFiniteNumber)(this._initPTS),fe="audio/mp4",pe,xe,Ce;if(ee&&(pe=xe=Infinity),m.config&&R.length&&(m.timescale=m.samplerate,m.isAAC||(H.mpeg?(fe="audio/mpeg",m.codec=""):H.mp3&&(m.codec="mp3")),Z.audio={id:"audio",container:fe,codec:m.codec,initSegment:!m.isAAC&&H.mpeg?new Uint8Array(0):B.default.initSegment([m]),metadata:{channelCount:m.channelCount}},ee&&(Ce=m.inputTimeScale,pe=xe=R[0].pts-Math.round(Ce*g))),v.sps&&v.pps&&O.length&&(v.timescale=v.inputTimeScale,Z.video={id:"main",container:"video/mp4",codec:v.codec,initSegment:B.default.initSegment([v]),metadata:{width:v.width,height:v.height}},ee)){Ce=v.inputTimeScale;var be=this.getVideoStartPts(O),Oe=Math.round(Ce*g);xe=Math.min(xe,p(O[0].dts,be)-Oe),pe=Math.min(pe,be-Oe)}if(Object.keys(Z).length)return this.ISGenerated=!0,ee&&(this._initPTS=pe,this._initDTS=xe),{tracks:Z,initPTS:pe,timescale:Ce}},w.remuxVideo=function(m,v,g,R){var O=m.inputTimeScale,H=m.samples,Z=[],ee=H.length,fe=this._initPTS,pe=this.nextAvcDts,xe=8,Ce,be,Oe,We=Number.POSITIVE_INFINITY,je=Number.NEGATIVE_INFINITY,ct=0,Ge=!1;if(!g||pe===null){var Ze=v*O,Xe=H[0].pts-p(H[0].dts,H[0].pts);pe=Ze-Xe}for(var Qe=0;Qeke.pts){var Y=9e4*.2;ct=Math.max(Math.min(ct,ke.pts-ke.dts),-1*Y)}ke.dts0?Qe-1:Qe].dts&&(Ge=!0)}Ge&&H.sort(function(Kr,Jt){var Yt=Kr.dts-Jt.dts,jn=Kr.pts-Jt.pts;return Yt||jn}),be=H[0].dts,Oe=H[H.length-1].dts;var A=Math.round((Oe-be)/(ee-1));if(ct<0){if(ctA,Fe=$<-1;if(Se||Fe){Se?X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms ("+$+"dts) hole between fragments detected, filling it"):X.logger.warn("AVC: "+Object(L.toMsFromMpegTsClock)(-$,!0)+" ms ("+$+"dts) overlapping between fragments detected"),be=pe;var $e=H[0].pts-$;H[0].dts=be,H[0].pts=$e,X.logger.log("Video: First PTS/DTS adjusted: "+Object(L.toMsFromMpegTsClock)($e,!0)+"/"+Object(L.toMsFromMpegTsClock)(be,!0)+", delta: "+Object(L.toMsFromMpegTsClock)($,!0)+" ms")}}d&&(be=Math.max(0,be));for(var at=0,Ke=0,nt=0;nt0?mt-1:mt].dts;if(ue.stretchShortVideoTrack&&this.nextAudioPts!==null){var we=Math.floor(ue.maxBufferHole*O),Ne=(R?We+R*O:this.nextAudioPts)-Ht.pts;Ne>we?(Ce=Ne-ye,Ce<0&&(Ce=ye),X.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+Ce/90+" ms for the last video frame.")):Ce=ye}else Ce=ye}var Ie=Math.round(Ht.pts-Ht.dts);Z.push(new x(Ht.key,Ce,ge,Ie))}if(Z.length&&M&&M<70){var lt=Z[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(Ce!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=pe=Oe+Ce,this.isVideoContiguous=!0;var Pt=B.default.moof(m.sequenceNumber++,be,U({},m,{samples:Z})),Zt="video",$t={data1:Pt,data2:jt,startPTS:We/O,endPTS:(je+Ce)/O,startDTS:be/O,endDTS:pe/O,type:Zt,hasAudio:!1,hasVideo:!0,nb:Z.length,dropped:m.dropped};return m.samples=[],m.dropped=0,console.assert(jt.length,"MDAT length must not be zero"),$t},w.remuxAudio=function(m,v,g,R,O){var H=m.inputTimeScale,Z=m.samplerate?m.samplerate:H,ee=H/Z,fe=m.isAAC?I:P,pe=fe*ee,xe=this._initPTS,Ce=!m.isAAC&&this.typeSupported.mpeg,be=[],Oe=m.samples,We=Ce?0:8,je=this.nextAudioPts||-1,ct=v*H;if(this.isAudioContiguous=g=g||Oe.length&&je>0&&(R&&Math.abs(ct-je)<9e3||Math.abs(p(Oe[0].pts-xe,ct)-je)<20*pe),Oe.forEach(function(me){me.pts=p(me.pts-xe,ct)}),!g||je<0){if(Oe=Oe.filter(function(me){return me.pts>=0}),!Oe.length)return;O===0?je=0:R?je=Math.max(0,ct):je=Oe[0].pts}if(m.isAAC)for(var Ge=O!==void 0,Ze=this.config.maxAudioFramesDrift,Xe=0,Qe=je;Xe=Ze*pe&&_0){Ke+=We;try{at=new Uint8Array(Ke)}catch(me){this.observer.emit(se.Events.ERROR,se.Events.ERROR,{type:q.ErrorTypes.MUX_ERROR,details:q.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ke,reason:"fail allocating audio mdat "+Ke});return}if(!Ce){var jt=new DataView(at.buffer);jt.setUint32(0,Ke),at.set(B.default.types.mdat,4)}}else return;at.set(Lt,We);var Nt=Lt.byteLength;We+=Nt,be.push(new x(!0,fe,Nt,0)),$e=Ot}var mt=be.length;if(!mt)return;var Ht=be[be.length-1];this.nextAudioPts=je=$e+ee*Ht.duration;var Vt=Ce?new Uint8Array(0):B.default.moof(m.sequenceNumber++,Fe/ee,U({},m,{samples:be}));m.samples=[];var ge=Fe/H,ie=je/H,ne="audio",ce={data1:Vt,data2:at,startPTS:ge,endPTS:ie,startDTS:ge,endDTS:ie,type:ne,hasAudio:!0,hasVideo:!1,nb:mt};return this.isAudioContiguous=!0,console.assert(at.length,"MDAT length must not be zero"),ce},w.remuxEmptyAudio=function(m,v,g,R){var O=m.inputTimeScale,H=m.samplerate?m.samplerate:O,Z=O/H,ee=this.nextAudioPts,fe=(ee!==null?ee:R.startDTS*O)+this._initDTS,pe=R.endDTS*O+this._initDTS,xe=Z*I,Ce=Math.ceil((pe-fe)/xe),be=K.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);if(X.logger.warn("[mp4-remuxer]: remux empty Audio"),!be){X.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Oe=[],We=0;We4294967296;)k+=b;return k}function T(k){for(var w=0;w0?this.lastEndDTS=m:(se.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var v=!!k.audio,g=!!k.video,R="";v&&(R+="audio"),g&&(R+="video");var O={data1:x,startPTS:b,startDTS:b,endPTS:m,endDTS:m,type:R,hasAudio:v,hasVideo:g,nb:1,dropped:0};return T.audio=O.type==="audio"?O:void 0,T.video=O.type!=="audio"?O:void 0,T.text=C,T.id3=M,T.initSegment=E,T},L}(),X=function(U,G,I){return Object(K.getStartDTS)(U,G)-I};function V(L,U){var G=L==null?void 0:L.codec;return G&&G.length>4?G:G==="hvc1"?"hvc1.1.c.L120.90":G==="av01"?"av01.0.04M.08":G==="avc1"||U===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}re.default=q},"./src/task-loop.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"default",function(){return oe});var oe=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=K.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(q){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,q),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},K}()},"./src/types/cmcd.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"CMCDVersion",function(){return oe}),z.d(re,"CMCDObjectType",function(){return K}),z.d(re,"CMCDStreamingFormat",function(){return B}),z.d(re,"CMCDStreamType",function(){return se});var oe=1,K;(function(q){q.MANIFEST="m",q.AUDIO="a",q.VIDEO="v",q.MUXED="av",q.INIT="i",q.CAPTION="c",q.TIMED_TEXT="tt",q.KEY="k",q.OTHER="o"})(K||(K={}));var B;(function(q){q.DASH="d",q.HLS="h",q.SMOOTH="s",q.OTHER="o"})(B||(B={}));var se;(function(q){q.VOD="v",q.LIVE="l"})(se||(se={}))},"./src/types/level.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"HlsSkip",function(){return B}),z.d(re,"getSkipValue",function(){return se}),z.d(re,"HlsUrlParameters",function(){return q}),z.d(re,"Level",function(){return X});function oe(V,L){for(var U=0;UNumber.MAX_SAFE_INTEGER?Infinity:L},q.hexadecimalInteger=function(V){if(this[V]){var L=(this[V]||"0x").slice(2);L=(L.length&1?"0":"")+L;for(var U=new Uint8Array(L.length/2),G=0;GNumber.MAX_SAFE_INTEGER?Infinity:L},q.decimalFloatingPoint=function(V){return parseFloat(this[V])},q.optionalFloat=function(V,L){var U=this[V];return U?parseFloat(U):L},q.enumeratedString=function(V){return this[V]},q.bool=function(V){return this[V]==="YES"},q.decimalResolution=function(V){var L=oe.exec(this[V]);return L===null?void 0:{width:parseInt(L[1],10),height:parseInt(L[2],10)}},se.parseAttrList=function(V){var L,U={},G='"';for(K.lastIndex=0;(L=K.exec(V))!==null;){var I=L[2];I.indexOf(G)===0&&I.lastIndexOf(G)===I.length-1&&(I=I.slice(1,-1)),U[L[1]]=I}return U},se}()},"./src/utils/binary-search.ts":function(ze,re,z){"use strict";z.r(re);var oe={search:function(B,se){for(var q=0,X=B.length-1,V=null,L=null;q<=X;){V=(q+X)/2|0,L=B[V];var U=se(L);if(U>0)q=V+1;else if(U<0)X=V-1;else return L}return null}};re.default=oe},"./src/utils/buffer-helper.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"BufferHelper",function(){return B});var oe=z("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function se(){}return se.isBuffered=function(X,V){try{if(X){for(var L=se.getBuffered(X),U=0;U=L.start(U)&&V<=L.end(U))return!0}}catch(G){}return!1},se.bufferInfo=function(X,V,L){try{if(X){var U=se.getBuffered(X),G=[],I;for(I=0;IP&&(U[I-1].end=X[G].end):U.push(X[G])}else U.push(X[G])}else U=X;for(var M=0,C,d=V,f=V,p=0;p=T&&V=g&&oe.logger.log(this.time+" ["+g+"] "+R)},b}(),M=function(m){for(var v=[],g=0;gq&&(this.logger.log(I.DEBUG,"Too large cursor position "+this.pos),this.pos=q)},m.moveCursor=function(g){var R=this.pos+g;if(g>1)for(var O=this.pos+1;O=144&&this.backSpace();var R=B(g);if(this.pos>=q){this.logger.log(I.ERROR,"Cannot insert "+g.toString(16)+" ("+R+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(R,this.currPenState),this.moveCursor(1)},m.clearFromPos=function(g){var R;for(R=g;R0&&(g?O="["+R.join(" | ")+"]":O=R.join(` +`)),O},m.getTextAndFormat=function(){return this.rows},b}(),T=function(){function b(v,g,R){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=v,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new p(R),this.nonDisplayedMemory=new p(R),this.lastOutputScreen=new p(R),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=R}var m=b.prototype;return m.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[se-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},m.getHandler=function(){return this.outputFilter},m.setHandler=function(g){this.outputFilter=g},m.setPAC=function(g){this.writeScreen.setPAC(g)},m.setBkgData=function(g){this.writeScreen.setBkgData(g)},m.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(I.INFO,"MODE="+g),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=g},m.insertChars=function(g){for(var R=0;R=46,R.italics)R.foreground="white";else{var O=Math.floor(g/2)-16,H=["white","green","blue","cyan","red","yellow","magenta"];R.foreground=H[O]}this.logger.log(I.INFO,"MIDROW: "+JSON.stringify(R)),this.writeScreen.setPen(R)},m.outputDataUpdate=function(g){g===void 0&&(g=!1);var R=this.logger.time;if(R===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=R:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,R,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:R),this.lastOutputScreen.copy(this.displayedMemory))},m.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},b}(),x=function(){function b(v,g,R){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new P;this.channels=[null,new T(v,g,O),new T(v+1,R,O)],this.cmdHistory=w(),this.logger=O}var m=b.prototype;return m.getHandler=function(g){return this.channels[g].getHandler()},m.setHandler=function(g,R){this.channels[g].setHandler(R)},m.addData=function(g,R){var O,H,Z,ee=!1;this.logger.time=g;for(var fe=0;fe ("+M([H,Z])+")"),O=this.parseCmd(H,Z),O||(O=this.parseMidrow(H,Z)),O||(O=this.parsePAC(H,Z)),O||(O=this.parseBackgroundAttributes(H,Z)),!O&&(ee=this.parseChars(H,Z),ee)){var pe=this.currentChannel;if(pe&&pe>0){var xe=this.channels[pe];xe.insertChars(ee)}else this.logger.log(I.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!ee&&this.logger.log(I.WARNING,"Couldn't parse cleaned data "+M([H,Z])+" orig: "+M([R[fe],R[fe+1]]))}},m.parseCmd=function(g,R){var O=this.cmdHistory,H=(g===20||g===28||g===21||g===29)&&R>=32&&R<=47,Z=(g===23||g===31)&&R>=33&&R<=35;if(!(H||Z))return!1;if(k(g,R,O))return E(null,null,O),this.logger.log(I.DEBUG,"Repeated command ("+M([g,R])+") is dropped"),!0;var ee=g===20||g===21||g===23?1:2,fe=this.channels[ee];return g===20||g===21||g===28||g===29?R===32?fe.ccRCL():R===33?fe.ccBS():R===34?fe.ccAOF():R===35?fe.ccAON():R===36?fe.ccDER():R===37?fe.ccRU(2):R===38?fe.ccRU(3):R===39?fe.ccRU(4):R===40?fe.ccFON():R===41?fe.ccRDC():R===42?fe.ccTR():R===43?fe.ccRTD():R===44?fe.ccEDM():R===45?fe.ccCR():R===46?fe.ccENM():R===47&&fe.ccEOC():fe.ccTO(R-32),E(g,R,O),this.currentChannel=ee,!0},m.parseMidrow=function(g,R){var O=0;if((g===17||g===25)&&R>=32&&R<=47){if(g===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(I.ERROR,"Mismatch channel in midrow parsing"),!1;var H=this.channels[O];return H?(H.ccMIDROW(R),this.logger.log(I.DEBUG,"MIDROW ("+M([g,R])+")"),!0):!1}return!1},m.parsePAC=function(g,R){var O,H=this.cmdHistory,Z=(g>=17&&g<=23||g>=25&&g<=31)&&R>=64&&R<=127,ee=(g===16||g===24)&&R>=64&&R<=95;if(!(Z||ee))return!1;if(k(g,R,H))return E(null,null,H),!0;var fe=g<=23?1:2;R>=64&&R<=95?O=fe===1?X[g]:L[g]:O=fe===1?V[g]:U[g];var pe=this.channels[fe];return pe?(pe.setPAC(this.interpretPAC(O,R)),E(g,R,H),this.currentChannel=fe,!0):!1},m.interpretPAC=function(g,R){var O,H={color:null,italics:!1,indent:null,underline:!1,row:g};return R>95?O=R-96:O=R-64,H.underline=(O&1)===1,O<=13?H.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(H.italics=!0,H.color="white"):H.indent=Math.floor((O-16)/2)*4,H},m.parseChars=function(g,R){var O,H=null,Z=null;if(g>=25?(O=2,Z=g-8):(O=1,Z=g),Z>=17&&Z<=19){var ee;Z===17?ee=R+80:Z===18?ee=R+112:ee=R+144,this.logger.log(I.INFO,"Special char '"+B(ee)+"' in channel "+O),H=[ee]}else g>=32&&g<=127&&(H=R===0?[g]:[g,R]);if(H){var fe=M(H);this.logger.log(I.DEBUG,"Char codes = "+fe.join(",")),E(g,R,this.cmdHistory)}return H},m.parseBackgroundAttributes=function(g,R){var O=(g===16||g===24)&&R>=32&&R<=47,H=(g===23||g===31)&&R>=45&&R<=47;if(!(O||H))return!1;var Z,ee={};g===16||g===24?(Z=Math.floor((R-32)/2),ee.background=G[Z],R%2===1&&(ee.background=ee.background+"_semi")):R===45?ee.background="transparent":(ee.foreground="black",R===47&&(ee.underline=!0));var fe=g<=23?1:2,pe=this.channels[fe];return pe.setBkgData(ee),E(g,R,this.cmdHistory),!0},m.reset=function(){for(var g=0;g=16?d--:d++;var E=Object(oe.fixLineBreaks)(f.trim()),k=Object(K.generateCueId)(L,U,E);(!V||!V.cues||!V.cues.getCueById(k))&&(M=new p(L,U,E),M.id=k,M.line=T+1,M.align="left",M.position=10+Math.min(80,Math.floor(d*8/32)*10),I.push(M))}return V&&I.length&&(I.sort(function(w,b){return w.line==="auto"||b.line==="auto"?0:w.line>8&&b.line>8?b.line-w.line:w.line-b.line}),I.forEach(function(w){return Object(B.addCueToTrack)(V,w)})),I}};re.default=q},"./src/utils/discontinuities.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"findFirstFragWithCC",function(){return se}),z.d(re,"shouldAlignOnDiscontinuities",function(){return q}),z.d(re,"findDiscontinuousReferenceFrag",function(){return X}),z.d(re,"adjustSlidingStart",function(){return L}),z.d(re,"alignStream",function(){return U}),z.d(re,"alignPDT",function(){return I}),z.d(re,"alignFragmentByPDTDelta",function(){return P}),z.d(re,"alignMediaPlaylistByPDT",function(){return M});var oe=z("./src/polyfills/number.ts"),K=z("./src/utils/logger.ts"),B=z("./src/controller/level-helper.ts");function se(C,d){for(var f=null,p=0,T=C.length;pf.startCC||C&&C.cc=this.minWeight_},se.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},se.destroy=function(){},B}();re.default=K},"./src/utils/ewma.ts":function(ze,re,z){"use strict";z.r(re);var oe=function(){function K(se,q,X){q===void 0&&(q=0),X===void 0&&(X=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=se,this.alpha_=se?Math.exp(Math.log(.5)/se):0,this.estimate_=q,this.totalWeight_=X}var B=K.prototype;return B.sample=function(q,X){var V=Math.pow(this.alpha_,q);this.estimate_=X*(1-V)+V*this.estimate_,this.totalWeight_+=q},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var q=1-Math.pow(this.alpha_,this.totalWeight_);if(q)return this.estimate_/q}return this.estimate_},K}();re.default=oe},"./src/utils/fetch-loader.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"fetchSupported",function(){return P});var oe=z("./src/polyfills/number.ts"),K=z("./src/loader/load-stats.ts"),B=z("./src/demux/chunk-cache.ts");function se(p,T){p.prototype=Object.create(T.prototype),p.prototype.constructor=p,U(p,T)}function q(p){var T=typeof Map=="function"?new Map:void 0;return q=function(E){if(E===null||!L(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(E))return T.get(E);T.set(E,k)}function k(){return X(E,arguments,G(this).constructor)}return k.prototype=Object.create(E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),U(k,E)},q(p)}function X(p,T,x){return V()?X=Reflect.construct:X=function(k,w,b){var m=[null];m.push.apply(m,w);var v=Function.bind.apply(k,m),g=new v;return b&&U(g,b.prototype),g},X.apply(null,arguments)}function V(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(p){return!1}}function L(p){return Function.toString.call(p).indexOf("[native code]")!==-1}function U(p,T){return U=Object.setPrototypeOf||function(E,k){return E.__proto__=k,E},U(p,T)}function G(p){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},G(p)}function I(){return I=Object.assign||function(p){for(var T=1;T=b&&m(k,w,v.flush(),E)):m(k,w,Z,E),O()}).catch(function(){return Promise.reject()})};return R()},p}();function C(p,T){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(I({},p.headers))};return p.rangeEnd&&x.headers.set("Range","bytes="+p.rangeStart+"-"+String(p.rangeEnd-1)),x}function d(p,T){return new self.Request(p.url,T)}var f=function(p){se(T,p);function T(x,E,k){var w;return w=p.call(this,x)||this,w.code=void 0,w.details=void 0,w.code=E,w.details=k,w}return T}(q(Error));re.default=M},"./src/utils/imsc1-ttml-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"IMSC1_CODEC",function(){return L}),z.d(re,"parseIMSC1",function(){return P});var oe=z("./src/utils/mp4-tools.ts"),K=z("./src/utils/vttparser.ts"),B=z("./src/utils/vttcue.ts"),se=z("./src/demux/id3.ts"),q=z("./src/utils/timescale-conversion.ts"),X=z("./src/utils/webvtt-parser.ts");function V(){return V=Object.assign||function(b){for(var m=1;m"):oe}function q(L){for(var U=arguments.length,G=new Array(U>1?U-1:0),I=1;I>24,T[x+1]=E>>16&255,T[x+2]=E>>8&255,T[x+3]=E&255}function U(T,x){var E=[];if(!x.length)return E;var k,w,b;"data"in T?(k=T.data,w=T.start,b=T.end):(k=T,w=0,b=k.byteLength);for(var m=w;m1?m+v:b;if(g===x[0])if(x.length===1)E.push({data:k,start:m+8,end:R});else{var O=U({data:k,start:m+8,end:R},x.slice(1));O.length&&se.apply(E,O)}m=R}return E}function G(T){var x=U(T,["moov"]),E=x[0],k=E?E.end:null,w=U(T,["sidx"]);if(!w||!w[0])return null;var b=[],m=w[0],v=m.data[0],g=v===0?8:16,R=V(m,g);g+=4;var O=0,H=0;v===0?g+=8:g+=16,g+=2;var Z=m.end+H,ee=X(m,g);g+=2;for(var fe=0;fe>>31;if(be===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Oe=V(m,pe);pe+=4,b.push({referenceSize:Ce,subsegmentDuration:Oe,info:{duration:Oe/R,start:Z,end:Z+Ce-1}}),Z+=Ce,pe+=4,g=pe}return{earliestPresentationTime:O,timescale:R,version:v,referencesCount:ee,references:b,moovEndOffset:k}}function I(T){for(var x=[],E=U(T,["moov","trak"]),k=0;kq)&&(this.startTime=q),this.endTime=X,this.screen=V,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"sendAddTrackEvent",function(){return K}),z.d(re,"addCueToTrack",function(){return B}),z.d(re,"clearCurrentCues",function(){return se}),z.d(re,"removeCuesInRange",function(){return q}),z.d(re,"getCuesInRange",function(){return V});var oe=z("./src/utils/logger.ts");function K(L,U){var G;try{G=new Event("addtrack")}catch(I){G=document.createEvent("Event"),G.initEvent("addtrack",!1,!1)}G.track=L,U.dispatchEvent(G)}function B(L,U){var G=L.mode;if(G==="disabled"&&(L.mode="hidden"),L.cues&&!L.cues.getCueById(U.id))try{if(L.addCue(U),!L.cues.getCueById(U.id))throw new Error("addCue is failed for: "+U)}catch(P){oe.logger.debug("[texttrack-utils]: "+P);var I=new self.TextTrackCue(U.startTime,U.endTime,U.text);I.id=U.id,L.addCue(I)}G==="disabled"&&(L.mode=G)}function se(L){var U=L.mode;if(U==="disabled"&&(L.mode="hidden"),L.cues)for(var G=L.cues.length;G--;)L.removeCue(L.cues[G]);U==="disabled"&&(L.mode=U)}function q(L,U,G){var I=L.mode;if(I==="disabled"&&(L.mode="hidden"),L.cues&&L.cues.length>0)for(var P=V(L.cues,U,G),M=0;ML[G].endTime)return-1;for(var I=0,P=G;I<=P;){var M=Math.floor((P+I)/2);if(UL[M].startTime&&I-1)for(var M=P,C=L.length;M=U&&d.endTime<=G)I.push(d);else if(d.startTime>G)return I}return I}},"./src/utils/time-ranges.ts":function(ze,re,z){"use strict";z.r(re);var oe={toString:function(B){for(var se="",q=B.length,X=0;X1?U-1:0),I=1;I100)throw new Error("Position must be between 0 and 100.");b=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",X({},P,{get:function(){return m},set:function(O){var H=q(O);if(!H)throw new SyntaxError("An invalid or illegal string was specified.");m=H,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",X({},P,{get:function(){return v},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");v=O,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",X({},P,{get:function(){return g},set:function(O){var H=q(O);if(!H)throw new SyntaxError("An invalid or illegal string was specified.");g=H,this.hasBeenReset=!0}})),I.displayState=void 0}return V.prototype.getCueAsHTML=function(){var L=self.WebVTT;return L.convertCueToDOMTree(self,this.text)},V}()},"./src/utils/vttparser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"parseTimeStamp",function(){return B}),z.d(re,"fixLineBreaks",function(){return U}),z.d(re,"VTTParser",function(){return G});var oe=z("./src/utils/vttcue.ts"),K=function(){function I(){}var P=I.prototype;return P.decode=function(C,d){if(!C)return"";if(typeof C!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(C))},I}();function B(I){function P(C,d,f,p){return(C|0)*3600+(d|0)*60+(f|0)+parseFloat(p||0)}var M=I.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return M?parseFloat(M[2])>59?P(M[2],M[3],0,M[4]):P(M[1],M[2],M[3],M[4]):null}var se=function(){function I(){this.values=Object.create(null)}var P=I.prototype;return P.set=function(C,d){!this.get(C)&&d!==""&&(this.values[C]=d)},P.get=function(C,d,f){return f?this.has(C)?this.values[C]:d[f]:this.has(C)?this.values[C]:d},P.has=function(C){return C in this.values},P.alt=function(C,d,f){for(var p=0;p=0&&f<=100)return this.set(C,f),!0}return!1},I}();function q(I,P,M,C){var d=C?I.split(C):[I];for(var f in d){if(typeof d[f]!="string")continue;var p=d[f].split(M);if(p.length!==2)continue;var T=p[0],x=p[1];P(T,x)}}var X=new oe.default(0,0,""),V=X.align==="middle"?"middle":"center";function L(I,P,M){var C=I;function d(){var T=B(I);if(T===null)throw new Error("Malformed timestamp: "+C);return I=I.replace(/^[^\sa-zA-Z-]+/,""),T}function f(T,x){var E=new se;q(T,function(b,m){var v;switch(b){case"region":for(var g=M.length-1;g>=0;g--)if(M[g].id===m){E.set(b,M[g].region);break}break;case"vertical":E.alt(b,m,["rl","lr"]);break;case"line":v=m.split(","),E.integer(b,v[0]),E.percent(b,v[0])&&E.set("snapToLines",!1),E.alt(b,v[0],["auto"]),v.length===2&&E.alt("lineAlign",v[1],["start",V,"end"]);break;case"position":v=m.split(","),E.percent(b,v[0]),v.length===2&&E.alt("positionAlign",v[1],["start",V,"end","line-left","line-right","auto"]);break;case"size":E.percent(b,m);break;case"align":E.alt(b,m,["start",V,"end","left","right"]);break}},/:/,/\s/),x.region=E.get("region",null),x.vertical=E.get("vertical","");var k=E.get("line","auto");k==="auto"&&X.line===-1&&(k=-1),x.line=k,x.lineAlign=E.get("lineAlign","start"),x.snapToLines=E.get("snapToLines",!0),x.size=E.get("size",100),x.align=E.get("align",V);var w=E.get("position","auto");w==="auto"&&X.position===50&&(w=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=w}function p(){I=I.replace(/^\s+/,"")}if(p(),P.startTime=d(),p(),I.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+C);I=I.substr(3),p(),P.endTime=d(),p(),f(I,P)}function U(I){return I.replace(//gi,` +`)}var G=function(){function I(){this.state="INITIAL",this.buffer="",this.decoder=new K,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var P=I.prototype;return P.parse=function(C){var d=this;C&&(d.buffer+=d.decoder.decode(C,{stream:!0}));function f(){var w=d.buffer,b=0;for(w=U(w);b")===-1){d.cue.id=T;continue}case"CUE":if(!d.cue){d.state="BADCUE";continue}try{L(T,d.cue,d.regionList)}catch(w){d.cue=null,d.state="BADCUE";continue}d.state="CUETEXT";continue;case"CUETEXT":{var k=T.indexOf("-->")!==-1;if(!T||k&&(E=!0)){d.oncue&&d.cue&&d.oncue(d.cue),d.cue=null,d.state="ID";continue}if(d.cue===null)continue;d.cue.text&&(d.cue.text+=` `),d.cue.text+=T}continue;case"BADCUE":T||(d.state="ID")}}}catch(w){d.state==="CUETEXT"&&d.cue&&d.oncue&&d.oncue(d.cue),d.cue=null,d.state=d.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},P.flush=function(){var C=this;try{if((C.cue||C.state==="HEADER")&&(C.buffer+=` -`,C.parse()),C.state==="INITIAL"||C.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(d){C.onparsingerror&&C.onparsingerror(d)}return C.onflush&&C.onflush(),this},M}()},"./src/utils/webvtt-parser.ts":function(ze,re,H){"use strict";H.r(re),H.d(re,"generateCueId",function(){return W}),H.d(re,"parseWebVTT",function(){return P});var oe=H("./src/polyfills/number.ts"),K=H("./src/utils/vttparser.ts"),B=H("./src/demux/id3.ts"),se=H("./src/utils/timescale-conversion.ts"),q=H("./src/remux/mp4-remuxer.ts"),X=/\r\n|\n\r|\n|\r/g,V=function(C,d,f){return f===void 0&&(f=0),C.substr(f,d.length)===d},L=function(C){var d=parseInt(C.substr(-3)),f=parseInt(C.substr(-6,2)),p=parseInt(C.substr(-9,2)),T=C.length>9?parseInt(C.substr(0,C.indexOf(":"))):0;if(!Object(oe.isFiniteNumber)(d)||!Object(oe.isFiniteNumber)(f)||!Object(oe.isFiniteNumber)(p)||!Object(oe.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+C);return d+=1e3*f,d+=60*1e3*p,d+=60*60*1e3*T,d},U=function(C){for(var d=5381,f=C.length;f;)d=d*33^C.charCodeAt(--f);return(d>>>0).toString()};function W(I,C,d){return U(I.toString())+U(C.toString())+U(d)}var M=function(C,d,f){var p=C[d],T=C[p.prevCC];if(!T||!T.new&&p.new){C.ccOffset=C.presentationOffset=p.start,p.new=!1;return}for(;(x=T)!==null&&x!==void 0&&x.new;){var x;C.ccOffset+=p.start-T.start,p.new=!1,p=T,T=C[p.prevCC]}C.presentationOffset=f};function P(I,C,d,f,p,T,x,E){var k=new K.VTTParser,w=Object(B.utf8ArrayToStr)(new Uint8Array(I)).trim().replace(X,` +`,C.parse()),C.state==="INITIAL"||C.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(d){C.onparsingerror&&C.onparsingerror(d)}return C.onflush&&C.onflush(),this},I}()},"./src/utils/webvtt-parser.ts":function(ze,re,z){"use strict";z.r(re),z.d(re,"generateCueId",function(){return G}),z.d(re,"parseWebVTT",function(){return P});var oe=z("./src/polyfills/number.ts"),K=z("./src/utils/vttparser.ts"),B=z("./src/demux/id3.ts"),se=z("./src/utils/timescale-conversion.ts"),q=z("./src/remux/mp4-remuxer.ts"),X=/\r\n|\n\r|\n|\r/g,V=function(C,d,f){return f===void 0&&(f=0),C.substr(f,d.length)===d},L=function(C){var d=parseInt(C.substr(-3)),f=parseInt(C.substr(-6,2)),p=parseInt(C.substr(-9,2)),T=C.length>9?parseInt(C.substr(0,C.indexOf(":"))):0;if(!Object(oe.isFiniteNumber)(d)||!Object(oe.isFiniteNumber)(f)||!Object(oe.isFiniteNumber)(p)||!Object(oe.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+C);return d+=1e3*f,d+=60*1e3*p,d+=60*60*1e3*T,d},U=function(C){for(var d=5381,f=C.length;f;)d=d*33^C.charCodeAt(--f);return(d>>>0).toString()};function G(M,C,d){return U(M.toString())+U(C.toString())+U(d)}var I=function(C,d,f){var p=C[d],T=C[p.prevCC];if(!T||!T.new&&p.new){C.ccOffset=C.presentationOffset=p.start,p.new=!1;return}for(;(x=T)!==null&&x!==void 0&&x.new;){var x;C.ccOffset+=p.start-T.start,p.new=!1,p=T,T=C[p.prevCC]}C.presentationOffset=f};function P(M,C,d,f,p,T,x,E){var k=new K.VTTParser,w=Object(B.utf8ArrayToStr)(new Uint8Array(M)).trim().replace(X,` `).split(` -`),b=[],m=Object(se.toMpegTsClockFromTimescale)(C,d),v="00:00.000",g=0,R=0,O,G=!0,Z=!1;k.oncue=function(ee){var fe=f[p],pe=f.ccOffset,xe=(g-m)/9e4;if(fe!=null&&fe.new&&(R!==void 0?pe=f.ccOffset=fe.start:M(f,p,xe)),xe&&(pe=xe-f.presentationOffset),Z){var Ce=ee.endTime-ee.startTime,be=Object(q.normalizePts)((ee.startTime+pe-R)*9e4,T*9e4)/9e4;ee.startTime=be,ee.endTime=be+Ce}var Oe=ee.text.trim();ee.text=decodeURIComponent(encodeURIComponent(Oe)),ee.id||(ee.id=W(ee.startTime,ee.endTime,Oe)),ee.endTime>0&&b.push(ee)},k.onparsingerror=function(ee){O=ee},k.onflush=function(){if(O){E(O);return}x(b)},w.forEach(function(ee){if(G)if(V(ee,"X-TIMESTAMP-MAP=")){G=!1,Z=!0,ee.substr(16).split(",").forEach(function(fe){V(fe,"LOCAL:")?v=fe.substr(6):V(fe,"MPEGTS:")&&(g=parseInt(fe.substr(7)))});try{R=L(v)/1e3}catch(fe){Z=!1,O=fe}return}else ee===""&&(G=!1);k.parse(ee+` -`)}),k.flush()}},"./src/utils/xhr-loader.ts":function(ze,re,H){"use strict";H.r(re);var oe=H("./src/utils/logger.ts"),K=H("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,se=function(){function q(V){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=V?V.xhrSetup:null,this.stats=new K.LoadStats,this.retryDelay=0}var X=q.prototype;return X.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},X.abortInternal=function(){var L=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),L&&(L.onreadystatechange=null,L.onprogress=null,L.readyState!==4&&(this.stats.aborted=!0,L.abort()))},X.abort=function(){var L;this.abortInternal(),(L=this.callbacks)!==null&&L!==void 0&&L.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},X.load=function(L,U,W){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=L,this.config=U,this.callbacks=W,this.retryDelay=U.retryDelay,this.loadInternal()},X.loadInternal=function(){var L=this.config,U=this.context;if(!L)return;var W=this.loader=new self.XMLHttpRequest,M=this.stats;M.loading.first=0,M.loaded=0;var P=this.xhrSetup;try{if(P)try{P(W,U.url)}catch(d){W.open("GET",U.url,!0),P(W,U.url)}W.readyState||W.open("GET",U.url,!0);var I=this.context.headers;if(I)for(var C in I)W.setRequestHeader(C,I[C])}catch(d){this.callbacks.onError({code:W.status,text:d.message},U,W);return}U.rangeEnd&&W.setRequestHeader("Range","bytes="+U.rangeStart+"-"+(U.rangeEnd-1)),W.onreadystatechange=this.readystatechange.bind(this),W.onprogress=this.loadprogress.bind(this),W.responseType=U.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),L.timeout),W.send()},X.readystatechange=function(){var L=this.context,U=this.loader,W=this.stats;if(!L||!U)return;var M=U.readyState,P=this.config;if(W.aborted)return;if(M>=2)if(self.clearTimeout(this.requestTimeout),W.loading.first===0&&(W.loading.first=Math.max(self.performance.now(),W.loading.start)),M===4){U.onreadystatechange=null,U.onprogress=null;var I=U.status;if(I>=200&&I<300){W.loading.end=Math.max(self.performance.now(),W.loading.first);var C,d;if(L.responseType==="arraybuffer"?(C=U.response,d=C.byteLength):(C=U.responseText,d=C.length),W.loaded=W.total=d,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(W,L,C,U),!this.callbacks)return;var p={url:U.responseURL,data:C};this.callbacks.onSuccess(p,W,L,U)}else W.retry>=P.maxRetry||I>=400&&I<499?(oe.logger.error(I+" while loading "+L.url),this.callbacks.onError({code:I,text:U.statusText},L,U)):(oe.logger.warn(I+" while loading "+L.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,P.maxRetryDelay),W.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),P.timeout)},X.loadtimeout=function(){oe.logger.warn("timeout while loading "+this.context.url);var L=this.callbacks;L&&(this.abortInternal(),L.onTimeout(this.stats,this.context,this.loader))},X.loadprogress=function(L){var U=this.stats;U.loaded=L.loaded,L.lengthComputable&&(U.total=L.total)},X.getCacheAge=function(){var L=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var U=this.loader.getResponseHeader("age");L=U?parseFloat(U):null}return L},q}();re.default=se}}).default})},vHTk:function(Pr,dr,He){Pr.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yyNy:function(Pr,dr,He){"use strict";(function(ze){He.d(dr,"a",function(){return Nye}),He.d(dr,"b",function(){return jye});var re=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function H(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oe(e){var t={exports:{}};return e(t,t.exports),t.exports}var K,B,se=function(e){return e&&e.Math==Math&&e},q=se(typeof globalThis=="object"&&globalThis)||se(typeof window=="object"&&window)||se(typeof self=="object"&&self)||se(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),X=Function.prototype,V=X.apply,L=X.bind,U=X.call,W=typeof Reflect=="object"&&Reflect.apply||(L?U.bind(V):function(){return U.apply(V,arguments)}),M=Function.prototype,P=M.bind,I=M.call,C=P&&P.bind(I),d=P?function(e){return e&&C(I,e)}:function(e){return e&&function(){return I.apply(e,arguments)}},f=function(e){return typeof e=="function"},p=function(e){try{return!!e()}catch(t){return!0}},T=!p(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),x=Function.prototype.call,E=x.bind?x.bind(x):function(){return x.apply(x,arguments)},k={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,b=w&&!k.call({1:2},1)?function(e){var t=w(this,e);return!!t&&t.enumerable}:k,m={f:b},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=d({}.toString),R=d("".slice),O=function(e){return R(g(e),8,-1)},G=q.Object,Z=d("".split),ee=p(function(){return!G("z").propertyIsEnumerable(0)})?function(e){return O(e)=="String"?Z(e,""):G(e)}:G,fe=q.TypeError,pe=function(e){if(e==null)throw fe("Can't call method on "+e);return e},xe=function(e){return ee(pe(e))},Ce=function(e){return typeof e=="object"?e!==null:f(e)},be={},Oe=function(e){return f(e)?e:void 0},We=function(e,t){return arguments.length<2?Oe(be[e])||Oe(q[e]):be[e]&&be[e][t]||q[e]&&q[e][t]},Ue=d({}.isPrototypeOf),ct=We("navigator","userAgent")||"",Ge=q.process,Je=q.Deno,Xe=Ge&&Ge.versions||Je&&Je.version,Ye=Xe&&Xe.v8;Ye&&(B=(K=Ye.split("."))[0]>0&&K[0]<4?1:+(K[0]+K[1])),!B&&ct&&(!(K=ct.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=ct.match(/Chrome\/(\d+)/))&&(B=+K[1]);var ke,Y=B,A=!!Object.getOwnPropertySymbols&&!p(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Y&&Y<41}),_=A&&!Symbol.sham&&typeof Symbol.iterator=="symbol",J=q.Object,ae=_?function(e){return typeof e=="symbol"}:function(e){var t=We("Symbol");return f(t)&&Ue(t.prototype,J(e))},$=q.String,Se=function(e){try{return $(e)}catch(t){return"Object"}},Fe=q.TypeError,$e=function(e){if(f(e))return e;throw Fe(Se(e)+" is not a function")},at=function(e,t){var r=e[t];return r==null?void 0:$e(r)},Ke=q.TypeError,nt=Object.defineProperty,tt=q["__core-js_shared__"]||function(e,t){try{nt(q,e,{value:t,configurable:!0,writable:!0})}catch(r){q[e]=t}return t}("__core-js_shared__",{}),bt=oe(function(e){(e.exports=function(t,r){return tt[t]||(tt[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),_t=q.Object,Lt=function(e){return _t(pe(e))},Ot=d({}.hasOwnProperty),xt=Object.hasOwn||function(e,t){return Ot(Lt(e),t)},jt=0,Nt=Math.random(),mt=d(1 .toString),Ht=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mt(++jt+Nt,36)},Vt=bt("wks"),ge=q.Symbol,ie=ge&&ge.for,ne=_?ge:ge&&ge.withoutSetter||Ht,ce=function(e){if(!xt(Vt,e)||!A&&typeof Vt[e]!="string"){var t="Symbol."+e;A&&xt(ge,e)?Vt[e]=ge[e]:Vt[e]=_&&ie?ie(t):ne(t)}return Vt[e]},me=q.TypeError,le=ce("toPrimitive"),ue=function(e,t){if(!Ce(e)||ae(e))return e;var r,n=at(e,le);if(n){if(t===void 0&&(t="default"),r=E(n,e,t),!Ce(r)||ae(r))return r;throw me("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&f(a=i.toString)&&!Ce(s=E(a,i)))return s;if(f(a=i.valueOf)&&!Ce(s=E(a,i)))return s;if(o!=="string"&&f(a=i.toString)&&!Ce(s=E(a,i)))return s;throw Ke("Can't convert object to primitive value")}(e,t)},ye=function(e){var t=ue(e,"string");return ae(t)?t:t+""},we=q.document,Ne=Ce(we)&&Ce(we.createElement),Ie=function(e){return Ne?we.createElement(e):{}},lt=!T&&!p(function(){return Object.defineProperty(Ie("div"),"a",{get:function(){return 7}}).a!=7}),Pt=Object.getOwnPropertyDescriptor,Zt=T?Pt:function(e,t){if(e=xe(e),t=ye(t),lt)try{return Pt(e,t)}catch(r){}if(xt(e,t))return v(!E(m.f,e,t),e[t])},$t={f:Zt},Kr=/#|\.prototype\./,Jt=function(e,t){var r=jn[Yt(e)];return r==Kn||r!=Qr&&(f(t)?p(t):!!t)},Yt=Jt.normalize=function(e){return String(e).replace(Kr,".").toLowerCase()},jn=Jt.data={},Qr=Jt.NATIVE="N",Kn=Jt.POLYFILL="P",Dn=Jt,Br=d(d.bind),eo=function(e,t){return $e(e),t===void 0?e:Br?Br(e,t):function(){return e.apply(t,arguments)}},qu=q.String,to=q.TypeError,$n=function(e){if(Ce(e))return e;throw to(qu(e)+" is not an object")},ec=q.TypeError,Cl=Object.defineProperty,Sa=T?Cl:function(e,t,r){if($n(e),t=ye(t),$n(r),lt)try{return Cl(e,t,r)}catch(n){}if("get"in r||"set"in r)throw ec("Accessors not supported");return"value"in r&&(e[t]=r.value),e},ro={f:Sa},ri=T?function(e,t,r){return ro.f(e,t,v(1,r))}:function(e,t,r){return e[t]=r,e},a1=$t.f,li=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return W(e,this,arguments)};return t.prototype=e.prototype,t},wr=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,z=h?q:S?q[c]:(q[c]||{}).prototype,F=h?be:be[c]||ri(be,c,{})[c],N=F.prototype;for(i in t)r=!Dn(h?i:c+(S?".":"#")+i,e.forced)&&z&&xt(z,i),a=F[i],r&&(s=e.noTargetGet?(u=a1(z,i))&&u.value:z[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?eo(o,q):e.wrap&&r?li(o):y&&f(o)?d(o):o,(e.sham||o&&o.sham||a&&a.sham)&&ri(l,"sham",!0),ri(F,i,l),y&&(xt(be,n=c+"Prototype")||ri(be,n,{}),ri(be[n],i,o),e.real&&N&&!N[i]&&ri(N,i,o)))},Ai=bt("keys"),Lr=function(e){return Ai[e]||(Ai[e]=Ht(e))},Fi=!p(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),dn=Lr("IE_PROTO"),Tl=q.Object,ui=Tl.prototype,Al=Fi?Tl.getPrototypeOf:function(e){var t=Lt(e);if(xt(t,dn))return t[dn];var r=t.constructor;return f(r)&&t instanceof r?r.prototype:t instanceof Tl?ui:null},s1=q.String,l1=q.TypeError,Yg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=d(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return $n(n),function(o){if(typeof o=="object"||f(o))return o;throw l1("Can't set "+s1(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),KH=Math.ceil,$H=Math.floor,u1=function(e){var t=+e;return t!=t||t===0?0:(t>0?$H:KH)(t)},XH=Math.max,YH=Math.min,c1=function(e,t){var r=u1(e);return r<0?XH(r+t,0):YH(r,t)},ZH=Math.min,ih=function(e){return(t=e.length)>0?ZH(u1(t),9007199254740991):0;var t},ER=function(e){return function(t,r,n){var i,o=xe(t),a=ih(o),s=c1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},JH={includes:ER(!0),indexOf:ER(!1)},oh={},QH=JH.indexOf,xR=d([].push),SR=function(e,t){var r,n=xe(e),i=0,o=[];for(r in n)!xt(oh,r)&&xt(n,r)&&xR(o,r);for(;t.length>i;)xt(n,r=t[i++])&&(~QH(o,r)||xR(o,r));return o},Zg=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qH=Zg.concat("length","prototype"),ez=Object.getOwnPropertyNames||function(e){return SR(e,qH)},d1={f:ez},Jg={f:Object.getOwnPropertySymbols},tz=d([].concat),rz=We("Reflect","ownKeys")||function(e){var t=d1.f($n(e)),r=Jg.f;return r?tz(t,r(e)):t},h1=Object.keys||function(e){return SR(e,Zg)},nz=T?Object.defineProperties:function(e,t){$n(e);for(var r,n=xe(t),i=h1(t),o=i.length,a=0;o>a;)ro.f(e,r=i[a++],n[r]);return e},iz=We("document","documentElement"),wR=Lr("IE_PROTO"),f1=function(){},CR=function(e){return""},TR=function(e){e.write(CR("")),e.close();var t=e.parentWindow.Object;return e=null,t},Qg=function(){try{ke=new ActiveXObject("htmlfile")}catch(n){}var e,t;Qg=typeof document!="undefined"?document.domain&&ke?TR(ke):((t=Ie("iframe")).style.display="none",iz.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(CR("document.F=Object")),e.close(),e.F):TR(ke);for(var r=Zg.length;r--;)delete Qg.prototype[Zg[r]];return Qg()};oh[wR]=!0;var wa=Object.create||function(e,t){var r;return e!==null?(f1.prototype=$n(e),r=new f1,f1.prototype=null,r[wR]=e):r=Qg(),t===void 0?r:nz(r,t)},p1=function(e,t,r){var n=ye(t);n in e?ro.f(e,n,v(0,r)):e[n]=r},oz=q.Array,az=Math.max,AR=function(e,t,r){for(var n=ih(e),i=c1(t,n),o=c1(r===void 0?n:r,n),a=oz(az(o-i,0)),s=0;i0&&b.push(ee)},k.onparsingerror=function(ee){O=ee},k.onflush=function(){if(O){E(O);return}x(b)},w.forEach(function(ee){if(H)if(V(ee,"X-TIMESTAMP-MAP=")){H=!1,Z=!0,ee.substr(16).split(",").forEach(function(fe){V(fe,"LOCAL:")?v=fe.substr(6):V(fe,"MPEGTS:")&&(g=parseInt(fe.substr(7)))});try{R=L(v)/1e3}catch(fe){Z=!1,O=fe}return}else ee===""&&(H=!1);k.parse(ee+` +`)}),k.flush()}},"./src/utils/xhr-loader.ts":function(ze,re,z){"use strict";z.r(re);var oe=z("./src/utils/logger.ts"),K=z("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,se=function(){function q(V){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=V?V.xhrSetup:null,this.stats=new K.LoadStats,this.retryDelay=0}var X=q.prototype;return X.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},X.abortInternal=function(){var L=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),L&&(L.onreadystatechange=null,L.onprogress=null,L.readyState!==4&&(this.stats.aborted=!0,L.abort()))},X.abort=function(){var L;this.abortInternal(),(L=this.callbacks)!==null&&L!==void 0&&L.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},X.load=function(L,U,G){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=L,this.config=U,this.callbacks=G,this.retryDelay=U.retryDelay,this.loadInternal()},X.loadInternal=function(){var L=this.config,U=this.context;if(!L)return;var G=this.loader=new self.XMLHttpRequest,I=this.stats;I.loading.first=0,I.loaded=0;var P=this.xhrSetup;try{if(P)try{P(G,U.url)}catch(d){G.open("GET",U.url,!0),P(G,U.url)}G.readyState||G.open("GET",U.url,!0);var M=this.context.headers;if(M)for(var C in M)G.setRequestHeader(C,M[C])}catch(d){this.callbacks.onError({code:G.status,text:d.message},U,G);return}U.rangeEnd&&G.setRequestHeader("Range","bytes="+U.rangeStart+"-"+(U.rangeEnd-1)),G.onreadystatechange=this.readystatechange.bind(this),G.onprogress=this.loadprogress.bind(this),G.responseType=U.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),L.timeout),G.send()},X.readystatechange=function(){var L=this.context,U=this.loader,G=this.stats;if(!L||!U)return;var I=U.readyState,P=this.config;if(G.aborted)return;if(I>=2)if(self.clearTimeout(this.requestTimeout),G.loading.first===0&&(G.loading.first=Math.max(self.performance.now(),G.loading.start)),I===4){U.onreadystatechange=null,U.onprogress=null;var M=U.status;if(M>=200&&M<300){G.loading.end=Math.max(self.performance.now(),G.loading.first);var C,d;if(L.responseType==="arraybuffer"?(C=U.response,d=C.byteLength):(C=U.responseText,d=C.length),G.loaded=G.total=d,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(G,L,C,U),!this.callbacks)return;var p={url:U.responseURL,data:C};this.callbacks.onSuccess(p,G,L,U)}else G.retry>=P.maxRetry||M>=400&&M<499?(oe.logger.error(M+" while loading "+L.url),this.callbacks.onError({code:M,text:U.statusText},L,U)):(oe.logger.warn(M+" while loading "+L.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,P.maxRetryDelay),G.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),P.timeout)},X.loadtimeout=function(){oe.logger.warn("timeout while loading "+this.context.url);var L=this.callbacks;L&&(this.abortInternal(),L.onTimeout(this.stats,this.context,this.loader))},X.loadprogress=function(L){var U=this.stats;U.loaded=L.loaded,L.lengthComputable&&(U.total=L.total)},X.getCacheAge=function(){var L=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var U=this.loader.getResponseHeader("age");L=U?parseFloat(U):null}return L},q}();re.default=se}}).default})},vHTk:function(Pr,dr,He){Pr.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yyNy:function(Pr,dr,He){"use strict";(function(ze){He.d(dr,"a",function(){return Nye}),He.d(dr,"b",function(){return jye});var re=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oe(e){var t={exports:{}};return e(t,t.exports),t.exports}var K,B,se=function(e){return e&&e.Math==Math&&e},q=se(typeof globalThis=="object"&&globalThis)||se(typeof window=="object"&&window)||se(typeof self=="object"&&self)||se(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),X=Function.prototype,V=X.apply,L=X.bind,U=X.call,G=typeof Reflect=="object"&&Reflect.apply||(L?U.bind(V):function(){return U.apply(V,arguments)}),I=Function.prototype,P=I.bind,M=I.call,C=P&&P.bind(M),d=P?function(e){return e&&C(M,e)}:function(e){return e&&function(){return M.apply(e,arguments)}},f=function(e){return typeof e=="function"},p=function(e){try{return!!e()}catch(t){return!0}},T=!p(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),x=Function.prototype.call,E=x.bind?x.bind(x):function(){return x.apply(x,arguments)},k={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,b=w&&!k.call({1:2},1)?function(e){var t=w(this,e);return!!t&&t.enumerable}:k,m={f:b},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=d({}.toString),R=d("".slice),O=function(e){return R(g(e),8,-1)},H=q.Object,Z=d("".split),ee=p(function(){return!H("z").propertyIsEnumerable(0)})?function(e){return O(e)=="String"?Z(e,""):H(e)}:H,fe=q.TypeError,pe=function(e){if(e==null)throw fe("Can't call method on "+e);return e},xe=function(e){return ee(pe(e))},Ce=function(e){return typeof e=="object"?e!==null:f(e)},be={},Oe=function(e){return f(e)?e:void 0},We=function(e,t){return arguments.length<2?Oe(be[e])||Oe(q[e]):be[e]&&be[e][t]||q[e]&&q[e][t]},je=d({}.isPrototypeOf),ct=We("navigator","userAgent")||"",Ge=q.process,Ze=q.Deno,Xe=Ge&&Ge.versions||Ze&&Ze.version,Qe=Xe&&Xe.v8;Qe&&(B=(K=Qe.split("."))[0]>0&&K[0]<4?1:+(K[0]+K[1])),!B&&ct&&(!(K=ct.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=ct.match(/Chrome\/(\d+)/))&&(B=+K[1]);var ke,Y=B,A=!!Object.getOwnPropertySymbols&&!p(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Y&&Y<41}),_=A&&!Symbol.sham&&typeof Symbol.iterator=="symbol",J=q.Object,ae=_?function(e){return typeof e=="symbol"}:function(e){var t=We("Symbol");return f(t)&&je(t.prototype,J(e))},$=q.String,Se=function(e){try{return $(e)}catch(t){return"Object"}},Fe=q.TypeError,$e=function(e){if(f(e))return e;throw Fe(Se(e)+" is not a function")},at=function(e,t){var r=e[t];return r==null?void 0:$e(r)},Ke=q.TypeError,nt=Object.defineProperty,tt=q["__core-js_shared__"]||function(e,t){try{nt(q,e,{value:t,configurable:!0,writable:!0})}catch(r){q[e]=t}return t}("__core-js_shared__",{}),bt=oe(function(e){(e.exports=function(t,r){return tt[t]||(tt[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),_t=q.Object,Lt=function(e){return _t(pe(e))},Ot=d({}.hasOwnProperty),xt=Object.hasOwn||function(e,t){return Ot(Lt(e),t)},jt=0,Nt=Math.random(),mt=d(1 .toString),Ht=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mt(++jt+Nt,36)},Vt=bt("wks"),ge=q.Symbol,ie=ge&&ge.for,ne=_?ge:ge&&ge.withoutSetter||Ht,ce=function(e){if(!xt(Vt,e)||!A&&typeof Vt[e]!="string"){var t="Symbol."+e;A&&xt(ge,e)?Vt[e]=ge[e]:Vt[e]=_&&ie?ie(t):ne(t)}return Vt[e]},me=q.TypeError,le=ce("toPrimitive"),ue=function(e,t){if(!Ce(e)||ae(e))return e;var r,n=at(e,le);if(n){if(t===void 0&&(t="default"),r=E(n,e,t),!Ce(r)||ae(r))return r;throw me("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&f(a=i.toString)&&!Ce(s=E(a,i)))return s;if(f(a=i.valueOf)&&!Ce(s=E(a,i)))return s;if(o!=="string"&&f(a=i.toString)&&!Ce(s=E(a,i)))return s;throw Ke("Can't convert object to primitive value")}(e,t)},ye=function(e){var t=ue(e,"string");return ae(t)?t:t+""},we=q.document,Ne=Ce(we)&&Ce(we.createElement),Ie=function(e){return Ne?we.createElement(e):{}},lt=!T&&!p(function(){return Object.defineProperty(Ie("div"),"a",{get:function(){return 7}}).a!=7}),Pt=Object.getOwnPropertyDescriptor,Zt=T?Pt:function(e,t){if(e=xe(e),t=ye(t),lt)try{return Pt(e,t)}catch(r){}if(xt(e,t))return v(!E(m.f,e,t),e[t])},$t={f:Zt},Kr=/#|\.prototype\./,Jt=function(e,t){var r=jn[Yt(e)];return r==Kn||r!=Qr&&(f(t)?p(t):!!t)},Yt=Jt.normalize=function(e){return String(e).replace(Kr,".").toLowerCase()},jn=Jt.data={},Qr=Jt.NATIVE="N",Kn=Jt.POLYFILL="P",Dn=Jt,Br=d(d.bind),eo=function(e,t){return $e(e),t===void 0?e:Br?Br(e,t):function(){return e.apply(t,arguments)}},qu=q.String,to=q.TypeError,$n=function(e){if(Ce(e))return e;throw to(qu(e)+" is not an object")},ec=q.TypeError,Cl=Object.defineProperty,Sa=T?Cl:function(e,t,r){if($n(e),t=ye(t),$n(r),lt)try{return Cl(e,t,r)}catch(n){}if("get"in r||"set"in r)throw ec("Accessors not supported");return"value"in r&&(e[t]=r.value),e},ro={f:Sa},ri=T?function(e,t,r){return ro.f(e,t,v(1,r))}:function(e,t,r){return e[t]=r,e},a1=$t.f,li=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return G(e,this,arguments)};return t.prototype=e.prototype,t},wr=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,W=h?q:S?q[c]:(q[c]||{}).prototype,F=h?be:be[c]||ri(be,c,{})[c],N=F.prototype;for(i in t)r=!Dn(h?i:c+(S?".":"#")+i,e.forced)&&W&&xt(W,i),a=F[i],r&&(s=e.noTargetGet?(u=a1(W,i))&&u.value:W[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?eo(o,q):e.wrap&&r?li(o):y&&f(o)?d(o):o,(e.sham||o&&o.sham||a&&a.sham)&&ri(l,"sham",!0),ri(F,i,l),y&&(xt(be,n=c+"Prototype")||ri(be,n,{}),ri(be[n],i,o),e.real&&N&&!N[i]&&ri(N,i,o)))},Ai=bt("keys"),Lr=function(e){return Ai[e]||(Ai[e]=Ht(e))},Fi=!p(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),dn=Lr("IE_PROTO"),Tl=q.Object,ui=Tl.prototype,Al=Fi?Tl.getPrototypeOf:function(e){var t=Lt(e);if(xt(t,dn))return t[dn];var r=t.constructor;return f(r)&&t instanceof r?r.prototype:t instanceof Tl?ui:null},s1=q.String,l1=q.TypeError,Yg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=d(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return $n(n),function(o){if(typeof o=="object"||f(o))return o;throw l1("Can't set "+s1(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),KH=Math.ceil,$H=Math.floor,u1=function(e){var t=+e;return t!=t||t===0?0:(t>0?$H:KH)(t)},XH=Math.max,YH=Math.min,c1=function(e,t){var r=u1(e);return r<0?XH(r+t,0):YH(r,t)},ZH=Math.min,ih=function(e){return(t=e.length)>0?ZH(u1(t),9007199254740991):0;var t},ER=function(e){return function(t,r,n){var i,o=xe(t),a=ih(o),s=c1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},JH={includes:ER(!0),indexOf:ER(!1)},oh={},QH=JH.indexOf,xR=d([].push),SR=function(e,t){var r,n=xe(e),i=0,o=[];for(r in n)!xt(oh,r)&&xt(n,r)&&xR(o,r);for(;t.length>i;)xt(n,r=t[i++])&&(~QH(o,r)||xR(o,r));return o},Zg=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qH=Zg.concat("length","prototype"),ez=Object.getOwnPropertyNames||function(e){return SR(e,qH)},d1={f:ez},Jg={f:Object.getOwnPropertySymbols},tz=d([].concat),rz=We("Reflect","ownKeys")||function(e){var t=d1.f($n(e)),r=Jg.f;return r?tz(t,r(e)):t},h1=Object.keys||function(e){return SR(e,Zg)},nz=T?Object.defineProperties:function(e,t){$n(e);for(var r,n=xe(t),i=h1(t),o=i.length,a=0;o>a;)ro.f(e,r=i[a++],n[r]);return e},iz=We("document","documentElement"),wR=Lr("IE_PROTO"),f1=function(){},CR=function(e){return""},TR=function(e){e.write(CR("")),e.close();var t=e.parentWindow.Object;return e=null,t},Qg=function(){try{ke=new ActiveXObject("htmlfile")}catch(n){}var e,t;Qg=typeof document!="undefined"?document.domain&&ke?TR(ke):((t=Ie("iframe")).style.display="none",iz.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(CR("document.F=Object")),e.close(),e.F):TR(ke);for(var r=Zg.length;r--;)delete Qg.prototype[Zg[r]];return Qg()};oh[wR]=!0;var wa=Object.create||function(e,t){var r;return e!==null?(f1.prototype=$n(e),r=new f1,f1.prototype=null,r[wR]=e):r=Qg(),t===void 0?r:nz(r,t)},p1=function(e,t,r){var n=ye(t);n in e?ro.f(e,n,v(0,r)):e[n]=r},oz=q.Array,az=Math.max,AR=function(e,t,r){for(var n=ih(e),i=c1(t,n),o=c1(r===void 0?n:r,n),a=oz(az(o-i,0)),s=0;io;o++)if((s=N(e[o]))&&Ue(kR,s))return s;return new qg(!1)}n=function(j,D){var Q=arguments.length<2?_R(j):D;if($e(Q))return $n(E(Q,j));throw Ez(Se(j)+" is not iterable")}(e,i)}for(l=n.next;!(u=E(l,n)).done;){try{s=N(u.value)}catch(j){RR(n,"throw",j)}if(typeof s=="object"&&s&&Ue(kR,s))return s}return new qg(!1)},wz=q.String,sh=function(e){if(ah(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return wz(e)},Cz=function(e,t){return e===void 0?arguments.length<2?"":t:sh(e)},Tz=!p(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",v(1,7)),e.stack!==7)}),Az=ce("toStringTag"),ev=q.Error,Dz=[].push,lh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=Ue(m1,this);Yg?r=Yg(new ev(void 0),i?Al(this):m1):(r=i?this:wa(m1),ri(r,Az,"Error")),ri(r,"message",Cz(t,"")),Tz&&ri(r,"stack",hz(r.stack,1)),fz(r,n);var o=[];return Sz(e,Dz,{that:o}),ri(r,"errors",o),r};Yg?Yg(lh,ev):function(e,t){for(var r=rz(t),n=ro.f,i=$t.f,o=0;o=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),Ca.Arguments=Ca.Array;var Gz=d("".charAt),zR=d("".charCodeAt),Vz=d("".slice),WR=function(e){return function(t,r){var n,i,o=sh(pe(t)),a=u1(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=zR(o,a))<55296||n>56319||a+1===s||(i=zR(o,a+1))<56320||i>57343?e?Gz(o,a):n:e?Vz(o,a,a+2):i-56320+(n-55296<<10)+65536}},Kz={codeAt:WR(!1),charAt:WR(!0)}.charAt,$z=rc.set,Xz=rc.getterFor("String Iterator");HR(String,"String",function(e){$z(this,{type:"String Iterator",string:sh(e),index:0})},function(){var e,t=Xz(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Kz(r,n),t.index+=e.length,{value:e,done:!1})});var Yz=be.AggregateError,GR=ce("toStringTag");for(var S1 in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var VR=q[S1],w1=VR&&VR.prototype;w1&&ah(w1)!==GR&&ri(w1,GR,S1),Ca[S1]=Ca.Array}var qa,ov,Zz=Yz,av=function(e){return e&&e.Math==Math&&e},nr=av(typeof globalThis=="object"&&globalThis)||av(typeof window=="object"&&window)||av(typeof self=="object"&&self)||av(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),Xn=function(e){try{return!!e()}catch(t){return!0}},$o=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),ch=Function.prototype.call,Yn=ch.bind?ch.bind(ch):function(){return ch.apply(ch,arguments)},KR={}.propertyIsEnumerable,$R=Object.getOwnPropertyDescriptor,Jz=$R&&!KR.call({1:2},1)?function(e){var t=$R(this,e);return!!t&&t.enumerable}:KR,Qz={f:Jz},es=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},XR=Function.prototype,C1=XR.bind,T1=XR.call,qz=C1&&C1.bind(T1),Gr=C1?function(e){return e&&qz(T1,e)}:function(e){return e&&function(){return T1.apply(e,arguments)}},eW=Gr({}.toString),tW=Gr("".slice),Ol=function(e){return tW(eW(e),8,-1)},A1=nr.Object,rW=Gr("".split),YR=Xn(function(){return!A1("z").propertyIsEnumerable(0)})?function(e){return Ol(e)=="String"?rW(e,""):A1(e)}:A1,nW=nr.TypeError,sv=function(e){if(e==null)throw nW("Can't call method on "+e);return e},ic=function(e){return YR(sv(e))},On=function(e){return typeof e=="function"},Ao=function(e){return typeof e=="object"?e!==null:On(e)},iW=function(e){return On(e)?e:void 0},dh=function(e,t){return arguments.length<2?iW(nr[e]):nr[e]&&nr[e][t]},lv=Gr({}.isPrototypeOf),D1=dh("navigator","userAgent")||"",ZR=nr.process,JR=nr.Deno,QR=ZR&&ZR.versions||JR&&JR.version,qR=QR&&QR.v8;qR&&(ov=(qa=qR.split("."))[0]>0&&qa[0]<4?1:+(qa[0]+qa[1])),!ov&&D1&&(!(qa=D1.match(/Edge\/(\d+)/))||qa[1]>=74)&&(qa=D1.match(/Chrome\/(\d+)/))&&(ov=+qa[1]);var ek=ov,O1=!!Object.getOwnPropertySymbols&&!Xn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ek&&ek<41}),_1=O1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",oW=nr.Object,R1=_1?function(e){return typeof e=="symbol"}:function(e){var t=dh("Symbol");return On(t)&&lv(t.prototype,oW(e))},aW=nr.String,k1=function(e){try{return aW(e)}catch(t){return"Object"}},sW=nr.TypeError,L1=function(e){if(On(e))return e;throw sW(k1(e)+" is not a function")},hh=function(e,t){var r=e[t];return r==null?void 0:L1(r)},lW=nr.TypeError,uW=Object.defineProperty,P1=function(e,t){try{uW(nr,e,{value:t,configurable:!0,writable:!0})}catch(r){nr[e]=t}return t},ts=nr["__core-js_shared__"]||P1("__core-js_shared__",{}),I1=oe(function(e){(e.exports=function(t,r){return ts[t]||(ts[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),cW=nr.Object,M1=function(e){return cW(sv(e))},dW=Gr({}.hasOwnProperty),Di=Object.hasOwn||function(e,t){return dW(M1(e),t)},hW=0,fW=Math.random(),pW=Gr(1 .toString),tk=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pW(++hW+fW,36)},fh=I1("wks"),_l=nr.Symbol,rk=_l&&_l.for,gW=_1?_l:_l&&_l.withoutSetter||tk,xi=function(e){if(!Di(fh,e)||!O1&&typeof fh[e]!="string"){var t="Symbol."+e;O1&&Di(_l,e)?fh[e]=_l[e]:fh[e]=_1&&rk?rk(t):gW(t)}return fh[e]},vW=nr.TypeError,mW=xi("toPrimitive"),yW=function(e,t){if(!Ao(e)||R1(e))return e;var r,n=hh(e,mW);if(n){if(t===void 0&&(t="default"),r=Yn(n,e,t),!Ao(r)||R1(r))return r;throw vW("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;if(On(a=i.valueOf)&&!Ao(s=Yn(a,i)))return s;if(o!=="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;throw lW("Can't convert object to primitive value")}(e,t)},B1=function(e){var t=yW(e,"string");return R1(t)?t:t+""},F1=nr.document,bW=Ao(F1)&&Ao(F1.createElement),N1=function(e){return bW?F1.createElement(e):{}},nk=!$o&&!Xn(function(){return Object.defineProperty(N1("div"),"a",{get:function(){return 7}}).a!=7}),ik=Object.getOwnPropertyDescriptor,EW=$o?ik:function(e,t){if(e=ic(e),t=B1(t),nk)try{return ik(e,t)}catch(r){}if(Di(e,t))return es(!Yn(Qz.f,e,t),e[t])},j1={f:EW},xW=nr.String,SW=nr.TypeError,Ni=function(e){if(Ao(e))return e;throw SW(xW(e)+" is not an object")},wW=nr.TypeError,ok=Object.defineProperty,CW=$o?ok:function(e,t,r){if(Ni(e),t=B1(t),Ni(r),nk)try{return ok(e,t,r)}catch(n){}if("get"in r||"set"in r)throw wW("Accessors not supported");return"value"in r&&(e[t]=r.value),e},oc={f:CW},Si=$o?function(e,t,r){return oc.f(e,t,es(1,r))}:function(e,t,r){return e[t]=r,e},TW=Gr(Function.toString);On(ts.inspectSource)||(ts.inspectSource=function(e){return TW(e)});var uv,ph,cv,U1=ts.inspectSource,ak=nr.WeakMap,AW=On(ak)&&/native code/.test(U1(ak)),sk=I1("keys"),H1=function(e){return sk[e]||(sk[e]=tk(e))},z1={},W1=nr.TypeError,DW=nr.WeakMap;if(AW||ts.state){var Rl=ts.state||(ts.state=new DW),OW=Gr(Rl.get),lk=Gr(Rl.has),_W=Gr(Rl.set);uv=function(e,t){if(lk(Rl,e))throw new W1("Object already initialized");return t.facade=e,_W(Rl,e,t),t},ph=function(e){return OW(Rl,e)||{}},cv=function(e){return lk(Rl,e)}}else{var ac=H1("state");z1[ac]=!0,uv=function(e,t){if(Di(e,ac))throw new W1("Object already initialized");return t.facade=e,Si(e,ac,t),t},ph=function(e){return Di(e,ac)?e[ac]:{}},cv=function(e){return Di(e,ac)}}var kl={set:uv,get:ph,has:cv,enforce:function(e){return cv(e)?ph(e):uv(e,{})},getterFor:function(e){return function(t){var r;if(!Ao(t)||(r=ph(t)).type!==e)throw W1("Incompatible receiver, "+e+" required");return r}}},uk=Function.prototype,RW=$o&&Object.getOwnPropertyDescriptor,G1=Di(uk,"name"),V1={EXISTS:G1,PROPER:G1&&function(){}.name==="something",CONFIGURABLE:G1&&(!$o||$o&&RW(uk,"name").configurable)},rs=oe(function(e){var t=V1.CONFIGURABLE,r=kl.get,n=kl.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;On(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Di(s,"name")||t&&s.name!==y)&&Si(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==nr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Si(o,a,s)):h?o[a]=s:P1(a,s)})(Function.prototype,"toString",function(){return On(this)&&r(this).source||U1(this)})}),kW=Math.ceil,LW=Math.floor,K1=function(e){var t=+e;return t!=t||t===0?0:(t>0?LW:kW)(t)},PW=Math.max,IW=Math.min,$1=function(e,t){var r=K1(e);return r<0?PW(r+t,0):IW(r,t)},MW=Math.min,ck=function(e){return e>0?MW(K1(e),9007199254740991):0},dv=function(e){return ck(e.length)},dk=function(e){return function(t,r,n){var i,o=ic(t),a=dv(o),s=$1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},BW={includes:dk(!0),indexOf:dk(!1)}.indexOf,hk=Gr([].push),fk=function(e,t){var r,n=ic(e),i=0,o=[];for(r in n)!Di(z1,r)&&Di(n,r)&&hk(o,r);for(;t.length>i;)Di(n,r=t[i++])&&(~BW(o,r)||hk(o,r));return o},hv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],FW=hv.concat("length","prototype"),NW=Object.getOwnPropertyNames||function(e){return fk(e,FW)},jW={f:NW},UW={f:Object.getOwnPropertySymbols},HW=Gr([].concat),zW=dh("Reflect","ownKeys")||function(e){var t=jW.f(Ni(e)),r=UW.f;return r?HW(t,r(e)):t},pk=function(e,t){for(var r=zW(t),n=oc.f,i=j1.f,o=0;oa;)oc.f(e,r=i[a++],n[r]);return e},aG=dh("document","documentElement"),vk=H1("IE_PROTO"),J1=function(){},mk=function(e){return""},yk=function(e){e.write(mk("")),e.close();var t=e.parentWindow.Object;return e=null,t},gv=function(){try{fv=new ActiveXObject("htmlfile")}catch(n){}var e,t;gv=typeof document!="undefined"?document.domain&&fv?yk(fv):((t=N1("iframe")).style.display="none",aG.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(mk("document.F=Object")),e.close(),e.F):yk(fv);for(var r=hv.length;r--;)delete gv.prototype[hv[r]];return gv()};z1[vk]=!0;var bk,Q1,mh=Object.create||function(e,t){var r;return e!==null?(J1.prototype=Ni(e),r=new J1,J1.prototype=null,r[vk]=e):r=gv(),t===void 0?r:oG(r,t)},sG=nr.RegExp,lG=Xn(function(){var e=sG(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),uG=nr.RegExp,cG=Xn(function(){var e=uG("(?
b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),dG=kl.get,hG=I1("native-string-replace",String.prototype.replace),vv=RegExp.prototype.exec,q1=vv,fG=Gr("".charAt),pG=Gr("".indexOf),gG=Gr("".replace),eE=Gr("".slice),tE=(Q1=/b*/g,Yn(vv,bk=/a/,"a"),Yn(vv,Q1,"a"),bk.lastIndex!==0||Q1.lastIndex!==0),Ek=nG.BROKEN_CARET,rE=/()??/.exec("")[1]!==void 0;(tE||rE||Ek||lG||cG)&&(q1=function(e){var t,r,n,i,o,a,s,l=this,u=dG(l),c=Ll(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Yn(q1,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=Ek&&l.sticky,z=Yn(eG,l),F=l.source,N=0,j=c;if(y&&(z=gG(z,"y",""),pG(z,"g")===-1&&(z+="g"),j=eE(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&fG(c,l.lastIndex-1)!==` -`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",z)),rE&&(r=new RegExp("^"+F+"$(?!\\s)",z)),tE&&(n=l.lastIndex),i=Yn(vv,y?r:l,j),y?i?(i.input=eE(i.input,N),i[0]=eE(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:tE&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),rE&&i&&i.length>1&&Yn(hG,i[0],r,function(){for(o=1;o=s?e?"":void 0:(n=xk(o,a))<55296||n>56319||a+1===s||(i=xk(o,a+1))<56320||i>57343?e?mG(o,a):n:e?yG(o,a,a+2):i-56320+(n-55296<<10)+65536}},wk={codeAt:Sk(!1),charAt:Sk(!0)},bG=wk.charAt,EG=function(e,t,r){return t+(r?bG(e,t).length:1)},xG=nr.TypeError,Ck=function(e,t){var r=e.exec;if(On(r)){var n=Yn(r,e,t);return n!==null&&Ni(n),n}if(Ol(e)==="RegExp")return Yn(mv,e,t);throw xG("RegExp#exec called on incompatible receiver")};!function(e,t,r,n){var i=xi(e),o=!Xn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Xn(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[vG]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Gr(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var z=Gr(u),F=c.exec;return F===mv||F===nE.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:z(h,c,S)}:{done:!1}});rs(String.prototype,e,l[0]),rs(nE,i,l[1])}n&&Si(nE[i],"sham",!0)}("match",function(e,t,r){return[function(n){var i=sv(this),o=n==null?void 0:hh(n,e);return o?Yn(o,n,i):new RegExp(n)[e](Ll(i))},function(n){var i=Ni(this),o=Ll(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Ck(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Ck(i,o))!==null;){var h=Ll(l[0]);u[c]=h,h===""&&(i.lastIndex=EG(o,ck(i.lastIndex),s)),c++}return c===0?null:u}]}),vh({global:!0},{globalThis:nr});var SG=!Xn(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Tk=H1("IE_PROTO"),iE=nr.Object,wG=iE.prototype,yh=SG?iE.getPrototypeOf:function(e){var t=M1(e);if(Di(t,Tk))return t[Tk];var r=t.constructor;return On(r)&&t instanceof r?r.prototype:t instanceof iE?wG:null},CG=nr.String,TG=nr.TypeError,sc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Gr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Ni(n),function(o){if(typeof o=="object"||On(o))return o;throw TG("Can't set "+CG(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),AG=nr.Array,DG=Math.max,OG=Gr("".replace),_G=Gr("".split),RG=Gr([].join),oE=String(Error("zxcasd").stack),Ak=/\n\s*at [^:]*:[^\n]*/,kG=Ak.test(oE),LG=/@[^\n]*\n/.test(oE)&&!/zxcasd/.test(oE),PG=function(e,t){if(typeof e!="string")return e;if(kG)for(;t--;)e=OG(e,Ak,"");else if(LG)return RG(function(r,n,i){for(var o,a,s,l,u=dv(r),c=$1(n,u),h=$1(i===void 0?u:i,u),S=AG(DG(h-c,0)),y=0;co;o++)if((s=N(e[o]))&&je(kR,s))return s;return new qg(!1)}n=function(j,D){var Q=arguments.length<2?_R(j):D;if($e(Q))return $n(E(Q,j));throw Ez(Se(j)+" is not iterable")}(e,i)}for(l=n.next;!(u=E(l,n)).done;){try{s=N(u.value)}catch(j){RR(n,"throw",j)}if(typeof s=="object"&&s&&je(kR,s))return s}return new qg(!1)},wz=q.String,sh=function(e){if(ah(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return wz(e)},Cz=function(e,t){return e===void 0?arguments.length<2?"":t:sh(e)},Tz=!p(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",v(1,7)),e.stack!==7)}),Az=ce("toStringTag"),ev=q.Error,Dz=[].push,lh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=je(m1,this);Yg?r=Yg(new ev(void 0),i?Al(this):m1):(r=i?this:wa(m1),ri(r,Az,"Error")),ri(r,"message",Cz(t,"")),Tz&&ri(r,"stack",hz(r.stack,1)),fz(r,n);var o=[];return Sz(e,Dz,{that:o}),ri(r,"errors",o),r};Yg?Yg(lh,ev):function(e,t){for(var r=rz(t),n=ro.f,i=$t.f,o=0;o=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),Ca.Arguments=Ca.Array;var Gz=d("".charAt),zR=d("".charCodeAt),Vz=d("".slice),WR=function(e){return function(t,r){var n,i,o=sh(pe(t)),a=u1(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=zR(o,a))<55296||n>56319||a+1===s||(i=zR(o,a+1))<56320||i>57343?e?Gz(o,a):n:e?Vz(o,a,a+2):i-56320+(n-55296<<10)+65536}},Kz={codeAt:WR(!1),charAt:WR(!0)}.charAt,$z=rc.set,Xz=rc.getterFor("String Iterator");HR(String,"String",function(e){$z(this,{type:"String Iterator",string:sh(e),index:0})},function(){var e,t=Xz(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Kz(r,n),t.index+=e.length,{value:e,done:!1})});var Yz=be.AggregateError,GR=ce("toStringTag");for(var S1 in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var VR=q[S1],w1=VR&&VR.prototype;w1&&ah(w1)!==GR&&ri(w1,GR,S1),Ca[S1]=Ca.Array}var qa,ov,Zz=Yz,av=function(e){return e&&e.Math==Math&&e},nr=av(typeof globalThis=="object"&&globalThis)||av(typeof window=="object"&&window)||av(typeof self=="object"&&self)||av(typeof re=="object"&&re)||function(){return this}()||Function("return this")(),Xn=function(e){try{return!!e()}catch(t){return!0}},$o=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),ch=Function.prototype.call,Yn=ch.bind?ch.bind(ch):function(){return ch.apply(ch,arguments)},KR={}.propertyIsEnumerable,$R=Object.getOwnPropertyDescriptor,Jz=$R&&!KR.call({1:2},1)?function(e){var t=$R(this,e);return!!t&&t.enumerable}:KR,Qz={f:Jz},es=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},XR=Function.prototype,C1=XR.bind,T1=XR.call,qz=C1&&C1.bind(T1),Gr=C1?function(e){return e&&qz(T1,e)}:function(e){return e&&function(){return T1.apply(e,arguments)}},eW=Gr({}.toString),tW=Gr("".slice),Ol=function(e){return tW(eW(e),8,-1)},A1=nr.Object,rW=Gr("".split),YR=Xn(function(){return!A1("z").propertyIsEnumerable(0)})?function(e){return Ol(e)=="String"?rW(e,""):A1(e)}:A1,nW=nr.TypeError,sv=function(e){if(e==null)throw nW("Can't call method on "+e);return e},ic=function(e){return YR(sv(e))},On=function(e){return typeof e=="function"},Ao=function(e){return typeof e=="object"?e!==null:On(e)},iW=function(e){return On(e)?e:void 0},dh=function(e,t){return arguments.length<2?iW(nr[e]):nr[e]&&nr[e][t]},lv=Gr({}.isPrototypeOf),D1=dh("navigator","userAgent")||"",ZR=nr.process,JR=nr.Deno,QR=ZR&&ZR.versions||JR&&JR.version,qR=QR&&QR.v8;qR&&(ov=(qa=qR.split("."))[0]>0&&qa[0]<4?1:+(qa[0]+qa[1])),!ov&&D1&&(!(qa=D1.match(/Edge\/(\d+)/))||qa[1]>=74)&&(qa=D1.match(/Chrome\/(\d+)/))&&(ov=+qa[1]);var ek=ov,O1=!!Object.getOwnPropertySymbols&&!Xn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ek&&ek<41}),_1=O1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",oW=nr.Object,R1=_1?function(e){return typeof e=="symbol"}:function(e){var t=dh("Symbol");return On(t)&&lv(t.prototype,oW(e))},aW=nr.String,k1=function(e){try{return aW(e)}catch(t){return"Object"}},sW=nr.TypeError,L1=function(e){if(On(e))return e;throw sW(k1(e)+" is not a function")},hh=function(e,t){var r=e[t];return r==null?void 0:L1(r)},lW=nr.TypeError,uW=Object.defineProperty,P1=function(e,t){try{uW(nr,e,{value:t,configurable:!0,writable:!0})}catch(r){nr[e]=t}return t},ts=nr["__core-js_shared__"]||P1("__core-js_shared__",{}),I1=oe(function(e){(e.exports=function(t,r){return ts[t]||(ts[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),cW=nr.Object,M1=function(e){return cW(sv(e))},dW=Gr({}.hasOwnProperty),Di=Object.hasOwn||function(e,t){return dW(M1(e),t)},hW=0,fW=Math.random(),pW=Gr(1 .toString),tk=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pW(++hW+fW,36)},fh=I1("wks"),_l=nr.Symbol,rk=_l&&_l.for,gW=_1?_l:_l&&_l.withoutSetter||tk,xi=function(e){if(!Di(fh,e)||!O1&&typeof fh[e]!="string"){var t="Symbol."+e;O1&&Di(_l,e)?fh[e]=_l[e]:fh[e]=_1&&rk?rk(t):gW(t)}return fh[e]},vW=nr.TypeError,mW=xi("toPrimitive"),yW=function(e,t){if(!Ao(e)||R1(e))return e;var r,n=hh(e,mW);if(n){if(t===void 0&&(t="default"),r=Yn(n,e,t),!Ao(r)||R1(r))return r;throw vW("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;if(On(a=i.valueOf)&&!Ao(s=Yn(a,i)))return s;if(o!=="string"&&On(a=i.toString)&&!Ao(s=Yn(a,i)))return s;throw lW("Can't convert object to primitive value")}(e,t)},B1=function(e){var t=yW(e,"string");return R1(t)?t:t+""},F1=nr.document,bW=Ao(F1)&&Ao(F1.createElement),N1=function(e){return bW?F1.createElement(e):{}},nk=!$o&&!Xn(function(){return Object.defineProperty(N1("div"),"a",{get:function(){return 7}}).a!=7}),ik=Object.getOwnPropertyDescriptor,EW=$o?ik:function(e,t){if(e=ic(e),t=B1(t),nk)try{return ik(e,t)}catch(r){}if(Di(e,t))return es(!Yn(Qz.f,e,t),e[t])},j1={f:EW},xW=nr.String,SW=nr.TypeError,Ni=function(e){if(Ao(e))return e;throw SW(xW(e)+" is not an object")},wW=nr.TypeError,ok=Object.defineProperty,CW=$o?ok:function(e,t,r){if(Ni(e),t=B1(t),Ni(r),nk)try{return ok(e,t,r)}catch(n){}if("get"in r||"set"in r)throw wW("Accessors not supported");return"value"in r&&(e[t]=r.value),e},oc={f:CW},Si=$o?function(e,t,r){return oc.f(e,t,es(1,r))}:function(e,t,r){return e[t]=r,e},TW=Gr(Function.toString);On(ts.inspectSource)||(ts.inspectSource=function(e){return TW(e)});var uv,ph,cv,U1=ts.inspectSource,ak=nr.WeakMap,AW=On(ak)&&/native code/.test(U1(ak)),sk=I1("keys"),H1=function(e){return sk[e]||(sk[e]=tk(e))},z1={},W1=nr.TypeError,DW=nr.WeakMap;if(AW||ts.state){var Rl=ts.state||(ts.state=new DW),OW=Gr(Rl.get),lk=Gr(Rl.has),_W=Gr(Rl.set);uv=function(e,t){if(lk(Rl,e))throw new W1("Object already initialized");return t.facade=e,_W(Rl,e,t),t},ph=function(e){return OW(Rl,e)||{}},cv=function(e){return lk(Rl,e)}}else{var ac=H1("state");z1[ac]=!0,uv=function(e,t){if(Di(e,ac))throw new W1("Object already initialized");return t.facade=e,Si(e,ac,t),t},ph=function(e){return Di(e,ac)?e[ac]:{}},cv=function(e){return Di(e,ac)}}var kl={set:uv,get:ph,has:cv,enforce:function(e){return cv(e)?ph(e):uv(e,{})},getterFor:function(e){return function(t){var r;if(!Ao(t)||(r=ph(t)).type!==e)throw W1("Incompatible receiver, "+e+" required");return r}}},uk=Function.prototype,RW=$o&&Object.getOwnPropertyDescriptor,G1=Di(uk,"name"),V1={EXISTS:G1,PROPER:G1&&function(){}.name==="something",CONFIGURABLE:G1&&(!$o||$o&&RW(uk,"name").configurable)},rs=oe(function(e){var t=V1.CONFIGURABLE,r=kl.get,n=kl.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;On(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Di(s,"name")||t&&s.name!==y)&&Si(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==nr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Si(o,a,s)):h?o[a]=s:P1(a,s)})(Function.prototype,"toString",function(){return On(this)&&r(this).source||U1(this)})}),kW=Math.ceil,LW=Math.floor,K1=function(e){var t=+e;return t!=t||t===0?0:(t>0?LW:kW)(t)},PW=Math.max,IW=Math.min,$1=function(e,t){var r=K1(e);return r<0?PW(r+t,0):IW(r,t)},MW=Math.min,ck=function(e){return e>0?MW(K1(e),9007199254740991):0},dv=function(e){return ck(e.length)},dk=function(e){return function(t,r,n){var i,o=ic(t),a=dv(o),s=$1(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},BW={includes:dk(!0),indexOf:dk(!1)}.indexOf,hk=Gr([].push),fk=function(e,t){var r,n=ic(e),i=0,o=[];for(r in n)!Di(z1,r)&&Di(n,r)&&hk(o,r);for(;t.length>i;)Di(n,r=t[i++])&&(~BW(o,r)||hk(o,r));return o},hv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],FW=hv.concat("length","prototype"),NW=Object.getOwnPropertyNames||function(e){return fk(e,FW)},jW={f:NW},UW={f:Object.getOwnPropertySymbols},HW=Gr([].concat),zW=dh("Reflect","ownKeys")||function(e){var t=jW.f(Ni(e)),r=UW.f;return r?HW(t,r(e)):t},pk=function(e,t){for(var r=zW(t),n=oc.f,i=j1.f,o=0;oa;)oc.f(e,r=i[a++],n[r]);return e},aG=dh("document","documentElement"),vk=H1("IE_PROTO"),J1=function(){},mk=function(e){return""},yk=function(e){e.write(mk("")),e.close();var t=e.parentWindow.Object;return e=null,t},gv=function(){try{fv=new ActiveXObject("htmlfile")}catch(n){}var e,t;gv=typeof document!="undefined"?document.domain&&fv?yk(fv):((t=N1("iframe")).style.display="none",aG.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(mk("document.F=Object")),e.close(),e.F):yk(fv);for(var r=hv.length;r--;)delete gv.prototype[hv[r]];return gv()};z1[vk]=!0;var bk,Q1,mh=Object.create||function(e,t){var r;return e!==null?(J1.prototype=Ni(e),r=new J1,J1.prototype=null,r[vk]=e):r=gv(),t===void 0?r:oG(r,t)},sG=nr.RegExp,lG=Xn(function(){var e=sG(".","s");return!(e.dotAll&&e.exec(` +`)&&e.flags==="s")}),uG=nr.RegExp,cG=Xn(function(){var e=uG("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),dG=kl.get,hG=I1("native-string-replace",String.prototype.replace),vv=RegExp.prototype.exec,q1=vv,fG=Gr("".charAt),pG=Gr("".indexOf),gG=Gr("".replace),eE=Gr("".slice),tE=(Q1=/b*/g,Yn(vv,bk=/a/,"a"),Yn(vv,Q1,"a"),bk.lastIndex!==0||Q1.lastIndex!==0),Ek=nG.BROKEN_CARET,rE=/()??/.exec("")[1]!==void 0;(tE||rE||Ek||lG||cG)&&(q1=function(e){var t,r,n,i,o,a,s,l=this,u=dG(l),c=Ll(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Yn(q1,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=Ek&&l.sticky,W=Yn(eG,l),F=l.source,N=0,j=c;if(y&&(W=gG(W,"y",""),pG(W,"g")===-1&&(W+="g"),j=eE(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&fG(c,l.lastIndex-1)!==` +`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",W)),rE&&(r=new RegExp("^"+F+"$(?!\\s)",W)),tE&&(n=l.lastIndex),i=Yn(vv,y?r:l,j),y?i?(i.input=eE(i.input,N),i[0]=eE(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:tE&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),rE&&i&&i.length>1&&Yn(hG,i[0],r,function(){for(o=1;o=s?e?"":void 0:(n=xk(o,a))<55296||n>56319||a+1===s||(i=xk(o,a+1))<56320||i>57343?e?mG(o,a):n:e?yG(o,a,a+2):i-56320+(n-55296<<10)+65536}},wk={codeAt:Sk(!1),charAt:Sk(!0)},bG=wk.charAt,EG=function(e,t,r){return t+(r?bG(e,t).length:1)},xG=nr.TypeError,Ck=function(e,t){var r=e.exec;if(On(r)){var n=Yn(r,e,t);return n!==null&&Ni(n),n}if(Ol(e)==="RegExp")return Yn(mv,e,t);throw xG("RegExp#exec called on incompatible receiver")};!function(e,t,r,n){var i=xi(e),o=!Xn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Xn(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[vG]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=Gr(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var W=Gr(u),F=c.exec;return F===mv||F===nE.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:W(h,c,S)}:{done:!1}});rs(String.prototype,e,l[0]),rs(nE,i,l[1])}n&&Si(nE[i],"sham",!0)}("match",function(e,t,r){return[function(n){var i=sv(this),o=n==null?void 0:hh(n,e);return o?Yn(o,n,i):new RegExp(n)[e](Ll(i))},function(n){var i=Ni(this),o=Ll(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Ck(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Ck(i,o))!==null;){var h=Ll(l[0]);u[c]=h,h===""&&(i.lastIndex=EG(o,ck(i.lastIndex),s)),c++}return c===0?null:u}]}),vh({global:!0},{globalThis:nr});var SG=!Xn(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Tk=H1("IE_PROTO"),iE=nr.Object,wG=iE.prototype,yh=SG?iE.getPrototypeOf:function(e){var t=M1(e);if(Di(t,Tk))return t[Tk];var r=t.constructor;return On(r)&&t instanceof r?r.prototype:t instanceof iE?wG:null},CG=nr.String,TG=nr.TypeError,sc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Gr(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Ni(n),function(o){if(typeof o=="object"||On(o))return o;throw TG("Can't set "+CG(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),AG=nr.Array,DG=Math.max,OG=Gr("".replace),_G=Gr("".split),RG=Gr([].join),oE=String(Error("zxcasd").stack),Ak=/\n\s*at [^:]*:[^\n]*/,kG=Ak.test(oE),LG=/@[^\n]*\n/.test(oE)&&!/zxcasd/.test(oE),PG=function(e,t){if(typeof e!="string")return e;if(kG)for(;t--;)e=OG(e,Ak,"");else if(LG)return RG(function(r,n,i){for(var o,a,s,l,u=dv(r),c=$1(n,u),h=$1(i===void 0?u:i,u),S=AG(DG(h-c,0)),y=0;co;o++)if((s=N(e[o]))&&lv(kk,s))return s;return new yv(!1)}n=function(j,D){var Q=arguments.length<2?_k(j):D;if(L1(Q))return Ni(Yn(Q,j));throw NG(k1(j)+" is not iterable")}(e,i)}for(l=n.next;!(u=Yn(l,n)).done;){try{s=N(u.value)}catch(j){Rk(n,"throw",j)}if(typeof s=="object"&&s&&lv(kk,s))return s}return new yv(!1)},HG=function(e,t){return e===void 0?arguments.length<2?"":t:Ll(e)},zG=!Xn(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",es(1,7)),e.stack!==7)}),WG=xi("toStringTag"),bv=nr.Error,GG=[].push,bh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=lv(aE,this);sc?r=sc(new bv(void 0),i?yh(this):aE):(r=i?this:mh(aE),Si(r,WG,"Error")),Si(r,"message",HG(t,"")),zG&&Si(r,"stack",PG(r.stack,1)),IG(r,n);var o=[];return UG(e,GG,{that:o}),Si(r,"errors",o),r};sc?sc(bh,bv):pk(bh,bv);var aE=bh.prototype=mh(bv.prototype,{constructor:es(1,bh),message:es(1,""),name:es(1,"AggregateError")});vh({global:!0},{AggregateError:bh});var sE=xi("unscopables"),lE=Array.prototype;lE[sE]==null&&oc.f(lE,sE,{configurable:!0,value:mh(null)});var Pl,Lk,Pk,uE=function(e){lE[sE][e]=!0},cE=xi("iterator"),Ik=!1;[].keys&&("next"in(Pk=[].keys())?(Lk=yh(yh(Pk)))!==Object.prototype&&(Pl=Lk):Ik=!0);var VG=Pl==null||Xn(function(){var e={};return Pl[cE].call(e)!==e});VG&&(Pl={}),On(Pl[cE])||rs(Pl,cE,function(){return this});var dE={IteratorPrototype:Pl,BUGGY_SAFARI_ITERATORS:Ik},KG=oc.f,Mk=xi("toStringTag"),Bk=function(e,t,r){e&&!Di(e=r?e:e.prototype,Mk)&&KG(e,Mk,{configurable:!0,value:t})},$G=dE.IteratorPrototype,XG=function(){return this},YG=V1.PROPER,ZG=V1.CONFIGURABLE,Fk=dE.IteratorPrototype,Ev=dE.BUGGY_SAFARI_ITERATORS,Eh=xi("iterator"),JG=function(){return this},Nk=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=mh($G,{next:es(+!te,Q)}),Bk(j,he,!1),lc[he]=XG}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!Ev&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,z=y[Eh]||y["@@iterator"]||i&&y[i],F=!Ev&&z||c(i),N=t=="Array"&&y.entries||z;if(N&&(s=yh(N.call(new e)))!==Object.prototype&&s.next&&(yh(s)!==Fk&&(sc?sc(s,Fk):On(s[Eh])||rs(s,Eh,JG)),Bk(s,h,!0)),YG&&i=="values"&&z&&z.name!=="values"&&(ZG?Si(y,"name","values"):(S=!0,F=function(){return Yn(z,this)})),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(Ev||S||!(u in y))&&rs(y,u,l[u]);else vh({target:t,proto:!0,forced:Ev||S},l);return y[Eh]!==F&&rs(y,Eh,F,{name:i}),lc[t]=F,l},QG=kl.set,qG=kl.getterFor("Array Iterator"),xh=Nk(Array,"Array",function(e,t){QG(this,{type:"Array Iterator",target:ic(e),index:0,kind:t})},function(){var e=qG(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");lc.Arguments=lc.Array,uE("keys"),uE("values"),uE("entries");var eV=wk.charAt,tV=kl.set,rV=kl.getterFor("String Iterator");Nk(String,"String",function(e){tV(this,{type:"String Iterator",string:Ll(e),index:0})},function(){var e,t=rV(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=eV(r,n),t.index+=e.length,{value:e,done:!1})});var hE,xv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fE=N1("span").classList,jk=fE&&fE.constructor&&fE.constructor.prototype,Uk=jk===Object.prototype?void 0:jk,pE=xi("iterator"),Hk=xi("toStringTag"),gE=xh.values,zk=function(e,t){if(e){if(e[pE]!==gE)try{Si(e,pE,gE)}catch(n){e[pE]=gE}if(e[Hk]||Si(e,Hk,t),xv[t]){for(var r in xh)if(e[r]!==xh[r])try{Si(e,r,xh[r])}catch(n){e[r]=xh[r]}}}};for(var vE in xv)zk(nr[vE]&&nr[vE].prototype,vE);(zk(Uk,"DOMTokenList"),typeof ze=="undefined")?("ActiveXObject"in window&&console.error(`\u62B1\u6B49\uFF0CwangEditor V5+ \u7248\u672C\u5F00\u59CB\uFF0C\u4E0D\u5728\u652F\u6301 IE \u6D4F\u89C8\u5668 - Sorry, wangEditor V5+ versions do not support IE browser.`),Wk(),Gk()):ze&&((hE=ze.navigator)===null||hE===void 0?void 0:hE.userAgent.match("QQBrowser"))&&(Wk(),Gk());function Wk(){typeof globalThis=="undefined"&&(window.globalThis=window)}function Gk(){Zz===void 0&&(window.AggregateError=function(e,t){var r=new Error(t);return r.errors=e,r})}var Vk,Sv=Array.isArray||function(e){return O(e)=="Array"},Kk=function(){},nV=[],$k=We("Reflect","construct"),mE=/^\s*(?:class|function)\b/,iV=d(mE.exec),oV=!mE.exec(Kk),Sh=function(e){if(!f(e))return!1;try{return $k(Kk,nV,e),!0}catch(t){return!1}},aV=!$k||p(function(){var e;return Sh(Sh.call)||!Sh(Object)||!Sh(function(){e=!0})||e})?function(e){if(!f(e))return!1;switch(ah(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return oV||!!iV(mE,LR(e))}:Sh,sV=ce("species"),Xk=q.Array,Yk=function(e,t){return new(function(r){var n;return Sv(r)&&(n=r.constructor,(aV(n)&&(n===Xk||Sv(n.prototype))||Ce(n)&&(n=n[sV])===null)&&(n=void 0)),n===void 0?Xk:n}(e))(t===0?0:t)},lV=ce("species"),Zk=ce("isConcatSpreadable"),Jk=q.TypeError,uV=Y>=51||!p(function(){var e=[];return e[Zk]=!1,e.concat()[0]!==e}),cV=(Vk="concat",Y>=51||!p(function(){var e=[];return(e.constructor={})[lV]=function(){return{foo:1}},e[Vk](Boolean).foo!==1})),dV=function(e){if(!Ce(e))return!1;var t=e[Zk];return t!==void 0?!!t:Sv(e)};wr({target:"Array",proto:!0,forced:!uV||!cV},{concat:function(e){var t,r,n,i,o,a=Lt(this),s=Yk(a,0),l=0;for(t=-1,n=arguments.length;t9007199254740991)throw Jk("Maximum allowed index exceeded");for(r=0;r=9007199254740991)throw Jk("Maximum allowed index exceeded");p1(s,l++,o)}return s.length=l,s}});var Qk=d1.f,qk=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],eL={f:function(e){return qk&&O(e)=="Window"?function(t){try{return Qk(t)}catch(r){return AR(qk)}}(e):Qk(xe(e))}},hV=d([].slice),yE={f:ce},fV=ro.f,En=function(e){var t=be.Symbol||(be.Symbol={});xt(t,e)||fV(t,e,{value:yE.f(e)})},tL=d([].push),ns=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,z=Lt(l),F=ee(z),N=eo(u,c),j=ih(F),D=0,Q=h||Yk,te=t?Q(l,j):r||a?Q(l,0):void 0;j>D;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:tL(te,S)}else switch(e){case 4:return!1;case 7:tL(te,S)}return o?-1:n||i?i:te}},wv={forEach:ns(0),map:ns(1),filter:ns(2),some:ns(3),every:ns(4),find:ns(5),findIndex:ns(6),filterReject:ns(7)}.forEach,Oi=Lr("hidden"),rL=ce("toPrimitive"),pV=rc.set,nL=rc.getterFor("Symbol"),Do=Object.prototype,is=q.Symbol,os=is&&is.prototype,iL=q.TypeError,bE=q.QObject,wh=We("JSON","stringify"),oL=$t.f,as=ro.f,aL=eL.f,gV=m.f,sL=d([].push),Ta=bt("symbols"),Ch=bt("op-symbols"),EE=bt("string-to-symbol-registry"),xE=bt("symbol-to-string-registry"),vV=bt("wks"),SE=!bE||!bE.prototype||!bE.prototype.findChild,wE=T&&p(function(){return wa(as({},"a",{get:function(){return as(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=oL(Do,t);n&&delete Do[t],as(e,t,r),n&&e!==Do&&as(Do,t,n)}:as,CE=function(e,t){var r=Ta[e]=wa(os);return pV(r,{type:"Symbol",tag:e,description:t}),T||(r.description=t),r},Cv=function(e,t,r){e===Do&&Cv(Ch,t,r),$n(e);var n=ye(t);return $n(r),xt(Ta,n)?(r.enumerable?(xt(e,Oi)&&e[Oi][n]&&(e[Oi][n]=!1),r=wa(r,{enumerable:v(0,!1)})):(xt(e,Oi)||as(e,Oi,v(1,{})),e[Oi][n]=!0),wE(e,n,r)):as(e,n,r)},lL=function(e,t){$n(e);var r=xe(t),n=h1(r).concat(TE(r));return wv(n,function(i){T&&!E(uL,r,i)||Cv(e,i,r[i])}),e},uL=function(e){var t=ye(e),r=E(gV,this,t);return!(this===Do&&xt(Ta,t)&&!xt(Ch,t))&&(!(r||!xt(this,t)||!xt(Ta,t)||xt(this,Oi)&&this[Oi][t])||r)},cL=function(e,t){var r=xe(e),n=ye(t);if(r!==Do||!xt(Ta,n)||xt(Ch,n)){var i=oL(r,n);return!i||!xt(Ta,n)||xt(r,Oi)&&r[Oi][n]||(i.enumerable=!0),i}},dL=function(e){var t=aL(xe(e)),r=[];return wv(t,function(n){xt(Ta,n)||xt(oh,n)||sL(r,n)}),r},TE=function(e){var t=e===Do,r=aL(t?Ch:xe(e)),n=[];return wv(r,function(i){!xt(Ta,i)||t&&!xt(Do,i)||sL(n,Ta[i])}),n};if(A||(os=(is=function(){if(Ue(os,this))throw iL("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?sh(arguments[0]):void 0,t=Ht(e),r=function(n){this===Do&&E(r,Ch,n),xt(this,Oi)&&xt(this[Oi],t)&&(this[Oi][t]=!1),wE(this,t,v(1,n))};return T&&SE&&wE(Do,t,{configurable:!0,set:r}),CE(t,e)}).prototype,nc(os,"toString",function(){return nL(this).tag}),nc(is,"withoutSetter",function(e){return CE(Ht(e),e)}),m.f=uL,ro.f=Cv,$t.f=cL,d1.f=eL.f=dL,Jg.f=TE,yE.f=function(e){return CE(ce(e),e)},T&&as(os,"description",{configurable:!0,get:function(){return nL(this).description}})),wr({global:!0,wrap:!0,forced:!A,sham:!A},{Symbol:is}),wv(h1(vV),function(e){En(e)}),wr({target:"Symbol",stat:!0,forced:!A},{for:function(e){var t=sh(e);if(xt(EE,t))return EE[t];var r=is(t);return EE[t]=r,xE[r]=t,r},keyFor:function(e){if(!ae(e))throw iL(e+" is not a symbol");if(xt(xE,e))return xE[e]},useSetter:function(){SE=!0},useSimple:function(){SE=!1}}),wr({target:"Object",stat:!0,forced:!A,sham:!T},{create:function(e,t){return t===void 0?wa(e):lL(wa(e),t)},defineProperty:Cv,defineProperties:lL,getOwnPropertyDescriptor:cL}),wr({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:dL,getOwnPropertySymbols:TE}),wr({target:"Object",stat:!0,forced:p(function(){Jg.f(1)})},{getOwnPropertySymbols:function(e){return Jg.f(Lt(e))}}),wh){var mV=!A||p(function(){var e=is();return wh([e])!="[null]"||wh({a:e})!="{}"||wh(Object(e))!="{}"});wr({target:"JSON",stat:!0,forced:mV},{stringify:function(e,t,r){var n=hV(arguments),i=t;if((Ce(t)||e!==void 0)&&!ae(e))return Sv(t)||(t=function(o,a){if(f(i)&&(a=E(i,this,o,a)),!ae(a))return a}),n[1]=t,W(wh,null,n)}})}if(!os[rL]){var yV=os.valueOf;nc(os,rL,function(e){return E(yV,this)})}nv(is,"Symbol"),oh[Oi]=!0,En("asyncIterator"),En("hasInstance"),En("isConcatSpreadable"),En("iterator"),En("match"),En("matchAll"),En("replace"),En("search"),En("species"),En("split"),En("toPrimitive"),En("toStringTag"),En("unscopables"),nv(q.JSON,"JSON",!0);var bV=be.Symbol;En("asyncDispose"),En("dispose"),En("matcher"),En("metadata"),En("observable"),En("patternMatch"),En("replaceAll");var Tv=bV,EV=yE.f("iterator"),xV=oe(function(e){function t(r){return typeof Tv=="function"&&typeof EV=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof Tv=="function"&&n.constructor===Tv&&n!==Tv.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),SV=H(xV),hL=j1.f,wV=Xn(function(){hL(1)});if(vh({target:"Object",stat:!0,forced:!$o||wV,sham:!$o},{getOwnPropertyDescriptor:function(e,t){return hL(ic(e),t)}}),(typeof ze=="undefined"?"undefined":SV(ze))==="object"){var CV=Object.getOwnPropertyDescriptor(ze,"window");ze.window&&!CV.set||(ze.window=ze,ze.requestAnimationFrame=function(){},ze.navigator={userAgent:""},ze.location={hostname:"0.0.0.0",port:0,protocol:"http:"},ze.btoa=function(){},ze.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}}),ze.document!=null&&ze.document.getElementsByTagName==null&&(ze.document.getElementsByTagName=function(){return[]})}/*! +`);return e},IG=function(e,t){Ao(t)&&"cause"in t&&Si(e,"cause",t.cause)},Dk=Gr(Gr.bind),Ok=function(e,t){return L1(e),t===void 0?e:Dk?Dk(e,t):function(){return e.apply(t,arguments)}},lc={},MG=xi("iterator"),BG=Array.prototype,FG=xi("iterator"),_k=function(e){if(e!=null)return hh(e,FG)||hh(e,"@@iterator")||lc[pv(e)]},NG=nr.TypeError,Rk=function(e,t,r){var n,i;Ni(e);try{if(!(n=hh(e,"return"))){if(t==="throw")throw r;return r}n=Yn(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Ni(n),r},jG=nr.TypeError,yv=function(e,t){this.stopped=e,this.result=t},kk=yv.prototype,UG=function(e,t,r){var n,i,o,a,s,l,u,c=r&&r.that,h=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),W=Ok(t,c),F=function(j){return n&&Rk(n,"normal",j),new yv(!0,j)},N=function(j){return h?(Ni(j),y?W(j[0],j[1],F):W(j[0],j[1])):y?W(j,F):W(j)};if(S)n=e;else{if(!(i=_k(e)))throw jG(k1(e)+" is not iterable");if(function(j){return j!==void 0&&(lc.Array===j||BG[MG]===j)}(i)){for(o=0,a=dv(e);a>o;o++)if((s=N(e[o]))&&lv(kk,s))return s;return new yv(!1)}n=function(j,D){var Q=arguments.length<2?_k(j):D;if(L1(Q))return Ni(Yn(Q,j));throw NG(k1(j)+" is not iterable")}(e,i)}for(l=n.next;!(u=Yn(l,n)).done;){try{s=N(u.value)}catch(j){Rk(n,"throw",j)}if(typeof s=="object"&&s&&lv(kk,s))return s}return new yv(!1)},HG=function(e,t){return e===void 0?arguments.length<2?"":t:Ll(e)},zG=!Xn(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",es(1,7)),e.stack!==7)}),WG=xi("toStringTag"),bv=nr.Error,GG=[].push,bh=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,i=lv(aE,this);sc?r=sc(new bv(void 0),i?yh(this):aE):(r=i?this:mh(aE),Si(r,WG,"Error")),Si(r,"message",HG(t,"")),zG&&Si(r,"stack",PG(r.stack,1)),IG(r,n);var o=[];return UG(e,GG,{that:o}),Si(r,"errors",o),r};sc?sc(bh,bv):pk(bh,bv);var aE=bh.prototype=mh(bv.prototype,{constructor:es(1,bh),message:es(1,""),name:es(1,"AggregateError")});vh({global:!0},{AggregateError:bh});var sE=xi("unscopables"),lE=Array.prototype;lE[sE]==null&&oc.f(lE,sE,{configurable:!0,value:mh(null)});var Pl,Lk,Pk,uE=function(e){lE[sE][e]=!0},cE=xi("iterator"),Ik=!1;[].keys&&("next"in(Pk=[].keys())?(Lk=yh(yh(Pk)))!==Object.prototype&&(Pl=Lk):Ik=!0);var VG=Pl==null||Xn(function(){var e={};return Pl[cE].call(e)!==e});VG&&(Pl={}),On(Pl[cE])||rs(Pl,cE,function(){return this});var dE={IteratorPrototype:Pl,BUGGY_SAFARI_ITERATORS:Ik},KG=oc.f,Mk=xi("toStringTag"),Bk=function(e,t,r){e&&!Di(e=r?e:e.prototype,Mk)&&KG(e,Mk,{configurable:!0,value:t})},$G=dE.IteratorPrototype,XG=function(){return this},YG=V1.PROPER,ZG=V1.CONFIGURABLE,Fk=dE.IteratorPrototype,Ev=dE.BUGGY_SAFARI_ITERATORS,Eh=xi("iterator"),JG=function(){return this},Nk=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=mh($G,{next:es(+!te,Q)}),Bk(j,he,!1),lc[he]=XG}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!Ev&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[Eh]||y["@@iterator"]||i&&y[i],F=!Ev&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=yh(N.call(new e)))!==Object.prototype&&s.next&&(yh(s)!==Fk&&(sc?sc(s,Fk):On(s[Eh])||rs(s,Eh,JG)),Bk(s,h,!0)),YG&&i=="values"&&W&&W.name!=="values"&&(ZG?Si(y,"name","values"):(S=!0,F=function(){return Yn(W,this)})),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(Ev||S||!(u in y))&&rs(y,u,l[u]);else vh({target:t,proto:!0,forced:Ev||S},l);return y[Eh]!==F&&rs(y,Eh,F,{name:i}),lc[t]=F,l},QG=kl.set,qG=kl.getterFor("Array Iterator"),xh=Nk(Array,"Array",function(e,t){QG(this,{type:"Array Iterator",target:ic(e),index:0,kind:t})},function(){var e=qG(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");lc.Arguments=lc.Array,uE("keys"),uE("values"),uE("entries");var eV=wk.charAt,tV=kl.set,rV=kl.getterFor("String Iterator");Nk(String,"String",function(e){tV(this,{type:"String Iterator",string:Ll(e),index:0})},function(){var e,t=rV(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=eV(r,n),t.index+=e.length,{value:e,done:!1})});var hE,xv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fE=N1("span").classList,jk=fE&&fE.constructor&&fE.constructor.prototype,Uk=jk===Object.prototype?void 0:jk,pE=xi("iterator"),Hk=xi("toStringTag"),gE=xh.values,zk=function(e,t){if(e){if(e[pE]!==gE)try{Si(e,pE,gE)}catch(n){e[pE]=gE}if(e[Hk]||Si(e,Hk,t),xv[t]){for(var r in xh)if(e[r]!==xh[r])try{Si(e,r,xh[r])}catch(n){e[r]=xh[r]}}}};for(var vE in xv)zk(nr[vE]&&nr[vE].prototype,vE);(zk(Uk,"DOMTokenList"),typeof ze=="undefined")?("ActiveXObject"in window&&console.error(`\u62B1\u6B49\uFF0CwangEditor V5+ \u7248\u672C\u5F00\u59CB\uFF0C\u4E0D\u5728\u652F\u6301 IE \u6D4F\u89C8\u5668 + Sorry, wangEditor V5+ versions do not support IE browser.`),Wk(),Gk()):ze&&((hE=ze.navigator)===null||hE===void 0?void 0:hE.userAgent.match("QQBrowser"))&&(Wk(),Gk());function Wk(){typeof globalThis=="undefined"&&(window.globalThis=window)}function Gk(){Zz===void 0&&(window.AggregateError=function(e,t){var r=new Error(t);return r.errors=e,r})}var Vk,Sv=Array.isArray||function(e){return O(e)=="Array"},Kk=function(){},nV=[],$k=We("Reflect","construct"),mE=/^\s*(?:class|function)\b/,iV=d(mE.exec),oV=!mE.exec(Kk),Sh=function(e){if(!f(e))return!1;try{return $k(Kk,nV,e),!0}catch(t){return!1}},aV=!$k||p(function(){var e;return Sh(Sh.call)||!Sh(Object)||!Sh(function(){e=!0})||e})?function(e){if(!f(e))return!1;switch(ah(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return oV||!!iV(mE,LR(e))}:Sh,sV=ce("species"),Xk=q.Array,Yk=function(e,t){return new(function(r){var n;return Sv(r)&&(n=r.constructor,(aV(n)&&(n===Xk||Sv(n.prototype))||Ce(n)&&(n=n[sV])===null)&&(n=void 0)),n===void 0?Xk:n}(e))(t===0?0:t)},lV=ce("species"),Zk=ce("isConcatSpreadable"),Jk=q.TypeError,uV=Y>=51||!p(function(){var e=[];return e[Zk]=!1,e.concat()[0]!==e}),cV=(Vk="concat",Y>=51||!p(function(){var e=[];return(e.constructor={})[lV]=function(){return{foo:1}},e[Vk](Boolean).foo!==1})),dV=function(e){if(!Ce(e))return!1;var t=e[Zk];return t!==void 0?!!t:Sv(e)};wr({target:"Array",proto:!0,forced:!uV||!cV},{concat:function(e){var t,r,n,i,o,a=Lt(this),s=Yk(a,0),l=0;for(t=-1,n=arguments.length;t9007199254740991)throw Jk("Maximum allowed index exceeded");for(r=0;r=9007199254740991)throw Jk("Maximum allowed index exceeded");p1(s,l++,o)}return s.length=l,s}});var Qk=d1.f,qk=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],eL={f:function(e){return qk&&O(e)=="Window"?function(t){try{return Qk(t)}catch(r){return AR(qk)}}(e):Qk(xe(e))}},hV=d([].slice),yE={f:ce},fV=ro.f,En=function(e){var t=be.Symbol||(be.Symbol={});xt(t,e)||fV(t,e,{value:yE.f(e)})},tL=d([].push),ns=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=Lt(l),F=ee(W),N=eo(u,c),j=ih(F),D=0,Q=h||Yk,te=t?Q(l,j):r||a?Q(l,0):void 0;j>D;D++)if((s||D in F)&&(y=N(S=F[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:tL(te,S)}else switch(e){case 4:return!1;case 7:tL(te,S)}return o?-1:n||i?i:te}},wv={forEach:ns(0),map:ns(1),filter:ns(2),some:ns(3),every:ns(4),find:ns(5),findIndex:ns(6),filterReject:ns(7)}.forEach,Oi=Lr("hidden"),rL=ce("toPrimitive"),pV=rc.set,nL=rc.getterFor("Symbol"),Do=Object.prototype,is=q.Symbol,os=is&&is.prototype,iL=q.TypeError,bE=q.QObject,wh=We("JSON","stringify"),oL=$t.f,as=ro.f,aL=eL.f,gV=m.f,sL=d([].push),Ta=bt("symbols"),Ch=bt("op-symbols"),EE=bt("string-to-symbol-registry"),xE=bt("symbol-to-string-registry"),vV=bt("wks"),SE=!bE||!bE.prototype||!bE.prototype.findChild,wE=T&&p(function(){return wa(as({},"a",{get:function(){return as(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=oL(Do,t);n&&delete Do[t],as(e,t,r),n&&e!==Do&&as(Do,t,n)}:as,CE=function(e,t){var r=Ta[e]=wa(os);return pV(r,{type:"Symbol",tag:e,description:t}),T||(r.description=t),r},Cv=function(e,t,r){e===Do&&Cv(Ch,t,r),$n(e);var n=ye(t);return $n(r),xt(Ta,n)?(r.enumerable?(xt(e,Oi)&&e[Oi][n]&&(e[Oi][n]=!1),r=wa(r,{enumerable:v(0,!1)})):(xt(e,Oi)||as(e,Oi,v(1,{})),e[Oi][n]=!0),wE(e,n,r)):as(e,n,r)},lL=function(e,t){$n(e);var r=xe(t),n=h1(r).concat(TE(r));return wv(n,function(i){T&&!E(uL,r,i)||Cv(e,i,r[i])}),e},uL=function(e){var t=ye(e),r=E(gV,this,t);return!(this===Do&&xt(Ta,t)&&!xt(Ch,t))&&(!(r||!xt(this,t)||!xt(Ta,t)||xt(this,Oi)&&this[Oi][t])||r)},cL=function(e,t){var r=xe(e),n=ye(t);if(r!==Do||!xt(Ta,n)||xt(Ch,n)){var i=oL(r,n);return!i||!xt(Ta,n)||xt(r,Oi)&&r[Oi][n]||(i.enumerable=!0),i}},dL=function(e){var t=aL(xe(e)),r=[];return wv(t,function(n){xt(Ta,n)||xt(oh,n)||sL(r,n)}),r},TE=function(e){var t=e===Do,r=aL(t?Ch:xe(e)),n=[];return wv(r,function(i){!xt(Ta,i)||t&&!xt(Do,i)||sL(n,Ta[i])}),n};if(A||(os=(is=function(){if(je(os,this))throw iL("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?sh(arguments[0]):void 0,t=Ht(e),r=function(n){this===Do&&E(r,Ch,n),xt(this,Oi)&&xt(this[Oi],t)&&(this[Oi][t]=!1),wE(this,t,v(1,n))};return T&&SE&&wE(Do,t,{configurable:!0,set:r}),CE(t,e)}).prototype,nc(os,"toString",function(){return nL(this).tag}),nc(is,"withoutSetter",function(e){return CE(Ht(e),e)}),m.f=uL,ro.f=Cv,$t.f=cL,d1.f=eL.f=dL,Jg.f=TE,yE.f=function(e){return CE(ce(e),e)},T&&as(os,"description",{configurable:!0,get:function(){return nL(this).description}})),wr({global:!0,wrap:!0,forced:!A,sham:!A},{Symbol:is}),wv(h1(vV),function(e){En(e)}),wr({target:"Symbol",stat:!0,forced:!A},{for:function(e){var t=sh(e);if(xt(EE,t))return EE[t];var r=is(t);return EE[t]=r,xE[r]=t,r},keyFor:function(e){if(!ae(e))throw iL(e+" is not a symbol");if(xt(xE,e))return xE[e]},useSetter:function(){SE=!0},useSimple:function(){SE=!1}}),wr({target:"Object",stat:!0,forced:!A,sham:!T},{create:function(e,t){return t===void 0?wa(e):lL(wa(e),t)},defineProperty:Cv,defineProperties:lL,getOwnPropertyDescriptor:cL}),wr({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:dL,getOwnPropertySymbols:TE}),wr({target:"Object",stat:!0,forced:p(function(){Jg.f(1)})},{getOwnPropertySymbols:function(e){return Jg.f(Lt(e))}}),wh){var mV=!A||p(function(){var e=is();return wh([e])!="[null]"||wh({a:e})!="{}"||wh(Object(e))!="{}"});wr({target:"JSON",stat:!0,forced:mV},{stringify:function(e,t,r){var n=hV(arguments),i=t;if((Ce(t)||e!==void 0)&&!ae(e))return Sv(t)||(t=function(o,a){if(f(i)&&(a=E(i,this,o,a)),!ae(a))return a}),n[1]=t,G(wh,null,n)}})}if(!os[rL]){var yV=os.valueOf;nc(os,rL,function(e){return E(yV,this)})}nv(is,"Symbol"),oh[Oi]=!0,En("asyncIterator"),En("hasInstance"),En("isConcatSpreadable"),En("iterator"),En("match"),En("matchAll"),En("replace"),En("search"),En("species"),En("split"),En("toPrimitive"),En("toStringTag"),En("unscopables"),nv(q.JSON,"JSON",!0);var bV=be.Symbol;En("asyncDispose"),En("dispose"),En("matcher"),En("metadata"),En("observable"),En("patternMatch"),En("replaceAll");var Tv=bV,EV=yE.f("iterator"),xV=oe(function(e){function t(r){return typeof Tv=="function"&&typeof EV=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof Tv=="function"&&n.constructor===Tv&&n!==Tv.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),SV=z(xV),hL=j1.f,wV=Xn(function(){hL(1)});if(vh({target:"Object",stat:!0,forced:!$o||wV,sham:!$o},{getOwnPropertyDescriptor:function(e,t){return hL(ic(e),t)}}),(typeof ze=="undefined"?"undefined":SV(ze))==="object"){var CV=Object.getOwnPropertyDescriptor(ze,"window");ze.window&&!CV.set||(ze.window=ze,ze.requestAnimationFrame=function(){},ze.navigator={userAgent:""},ze.location={hostname:"0.0.0.0",port:0,protocol:"http:"},ze.btoa=function(){},ze.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}}),ze.document!=null&&ze.document.getElementsByTagName==null&&(ze.document.getElementsByTagName=function(){return[]})}/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */function fL(e){return Object.prototype.toString.call(e)==="[object Object]"}function ci(e){var t,r;return fL(e)!==!1&&((t=e.constructor)===void 0||fL(r=t.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)}function Oo(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:DE(e)?2:OE(e)?3:0}function AE(e,t){return uc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pL(e,t,r){var n=uc(e);n===2?e.set(t,r):n===3?(e.delete(t),e.add(r)):e[t]=r}function DE(e){return OV&&e instanceof Map}function OE(e){return _V&&e instanceof Set}function Bl(e){return e.o||e.t}function _E(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=kV(e);delete t[ji];for(var r=UE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=TV),Object.freeze(e),t&&Th(e,function(r,n){return RE(n,!0)},!0)),e}function TV(){Oo(2)}function kE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Aa(e){var t=LV[e];return t||Oo(18,e),t}function gL(){return Ah}function LE(e,t){t&&(Aa("Patches"),e.u=[],e.s=[],e.v=t)}function Av(e){PE(e),e.p.forEach(AV),e.p=null}function PE(e){e===Ah&&(Ah=e.l)}function vL(e){return Ah={p:[],l:Ah,h:e,m:!0,_:0}}function AV(e){var t=e[ji];t.i===0||t.i===1?t.j():t.O=!0}function IE(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||Aa("ES5").S(t,e,n),n?(r[ji].P&&(Av(t),Oo(4)),Ml(e)&&(e=Dv(t,e),t.l||Ov(t,e)),t.u&&Aa("Patches").M(r[ji],e,t.u,t.s)):e=Dv(t,r,[]),Av(t),t.u&&t.v(t.u,t.s),e!==SL?e:void 0}function Dv(e,t,r){if(kE(t))return t;var n=t[ji];if(!n)return Th(t,function(o,a){return mL(e,n,t,o,a,r)},!0),t;if(n.A!==e)return t;if(!n.P)return Ov(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=_E(n.k):n.o;Th(n.i===3?new Set(i):i,function(o,a){return mL(e,n,i,o,a,r)}),Ov(e,i,!1),r&&e.u&&Aa("Patches").R(n,r,e.u,e.s)}return n.o}function mL(e,t,r,n,i,o){if(Il(i)){var a=Dv(e,i,o&&t&&t.i!==3&&!AE(t.D,n)?o.concat(n):void 0);if(pL(r,n,a),!Il(a))return;e.m=!1}if(Ml(i)&&!kE(i)){if(!e.h.F&&e._<1)return;Dv(e,i),t&&t.A.l||Ov(e,i)}}function Ov(e,t,r){r===void 0&&(r=!1),e.h.F&&e.m&&RE(t,r)}function ME(e,t){var r=e[ji];return(r?Bl(r):e)[t]}function yL(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function BE(e){e.P||(e.P=!0,e.l&&BE(e.l))}function FE(e){e.o||(e.o=_E(e.t))}function NE(e,t,r){var n=DE(t)?Aa("MapSet").N(t,r):OE(t)?Aa("MapSet").T(t,r):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:gL(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=_v;a&&(l=[s],u=Rv);var c=Proxy.revocable(l,u),h=c.revoke,S=c.proxy;return s.k=S,s.j=h,S}(t,r):Aa("ES5").J(t,r);return(r?r.A:gL()).p.push(n),n}function DV(e){return Il(e)||Oo(22,e),function t(r){if(!Ml(r))return r;var n,i=r[ji],o=uc(r);if(i){if(!i.P&&(i.i<4||!Aa("ES5").K(i)))return i.t;i.I=!0,n=bL(r,o),i.I=!1}else n=bL(r,o);return Th(n,function(a,s){i&&function(l,u){return uc(l)===2?l.get(u):l[u]}(i.t,a)===s||pL(n,a,t(s))}),o===3?new Set(n):n}(e)}function bL(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return _E(e)}var EL,Ah,jE=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",OV=typeof Map!="undefined",_V=typeof Set!="undefined",xL=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",SL=jE?Symbol.for("immer-nothing"):((EL={})["immer-nothing"]=!0,EL),wL=jE?Symbol.for("immer-draftable"):"__$immer_draftable",ji=jE?Symbol.for("immer-state"):"__$immer_state",RV=""+Object.prototype.constructor,UE=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,kV=Object.getOwnPropertyDescriptors||function(e){var t={};return UE(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},LV={},_v={get:function(e,t){if(t===ji)return e;var r=Bl(e);if(!AE(r,t))return function(i,o,a){var s,l=yL(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!Ml(n)?n:n===ME(e.t,t)?(FE(e),e.o[t]=NE(e.A.h,n,e)):n},has:function(e,t){return t in Bl(e)},ownKeys:function(e){return Reflect.ownKeys(Bl(e))},set:function(e,t,r){var n=yL(Bl(e),t);if(n==null?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=ME(Bl(e),t),o=i==null?void 0:i[ji];if(o&&o.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(function(a,s){return a===s?a!==0||1/a==1/s:a!=a&&s!=s}(r,i)&&(r!==void 0||AE(e.t,t)))return!0;FE(e),BE(e)}return e.o[t]===r&&typeof r!="number"&&(r!==void 0||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return ME(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,FE(e),BE(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Bl(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Oo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Oo(12)}},Rv={};Th(_v,function(e,t){Rv[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Rv.deleteProperty=function(e,t){return _v.deleteProperty.call(this,e[0],t)},Rv.set=function(e,t,r){return _v.set.call(this,e[0],t,r,e[0])};var PV=function(){function e(r){var n=this;this.g=xL,this.F=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=n;return function(y){var z=this;y===void 0&&(y=s);for(var F=arguments.length,N=Array(F>1?F-1:0),j=1;j1?u-1:0),h=1;h=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var a=Aa("Patches").$;return Il(r)?a(r,n):this.produce(r,function(s){return a(s,n)})},e}(),Ui=new PV,kv=Ui.produce;Ui.produceWithPatches.bind(Ui),Ui.setAutoFreeze.bind(Ui),Ui.setUseProxies.bind(Ui),Ui.applyPatches.bind(Ui);var CL=Ui.createDraft.bind(Ui),TL=Ui.finishDraft.bind(Ui);function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lv=new WeakMap,Dh=new WeakMap,AL=new WeakMap,DL=new WeakMap,OL=new WeakMap,_L=new WeakMap;function RL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pv(e){for(var t=1;t{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of de.pathRefs(e))cK.transform(r,t);for(var n of de.pointRefs(e))dK.transform(n,t);for(var i of de.rangeRefs(e))fK.transform(i,t);var o=new Set,a=[],s=S=>{if(S){var y=S.join(",");o.has(y)||(o.add(y),a.push(S))}},l=Lv.get(e)||[],u=MV(t);for(var c of l)s(je.transform(c,t));for(var h of u)s(h);Lv.set(e,a),Ve.transform(e,t),e.operations.push(t),de.normalize(e),t.type==="set_selection"&&(e.marks=null),Dh.get(e)||(Dh.set(e,!0),Promise.resolve().then(()=>{Dh.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n}=e;if(n)if(Qe.isExpanded(n))Ve.setNodes(e,{[t]:r},{match:Rt.isText,split:!0});else{var i=Pv(Pv({},de.marks(e)||{}),{},{[t]:r});e.marks=i,Dh.get(e)||e.onChange()}},deleteBackward:t=>{var{selection:r}=e;r&&Qe.isCollapsed(r)&&Ve.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&Qe.isCollapsed(r)&&Ve.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&Qe.isExpanded(r)&&Ve.delete(e,{reverse:t==="backward"})},getFragment:()=>{var{selection:t}=e;return t?St.fragment(e,t):[]},insertBreak:()=>{Ve.splitNodes(e,{always:!0})},insertFragment:t=>{Ve.insertFragment(e,t)},insertNode:t=>{Ve.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var i=Pv({text:t},n);Ve.insertNodes(e,i)}else Ve.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!Rt.isText(r))if(Ut.isElement(r)&&r.children.length===0)Ve.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var i=!de.isEditor(r)&&Ut.isElement(r)&&(e.isInline(r)||r.children.length===0||Rt.isText(r.children[0])||e.isInline(r.children[0])),o=0,a=0;a{var{selection:r}=e;if(r)if(Qe.isExpanded(r))Ve.unsetNodes(e,t,{match:Rt.isText,split:!0});else{var n=Pv({},de.marks(e)||{});delete n[t],e.marks=n,Dh.get(e)||e.onChange()}}};return e},MV=e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return je.levels(t);case"insert_node":var{node:r,path:n}=e,i=je.levels(n),o=Rt.isText(r)?[]:Array.from(St.nodes(r),te=>{var[,he]=te;return n.concat(he)});return[...i,...o];case"merge_node":var{path:a}=e;return[...je.ancestors(a),je.previous(a)];case"move_node":var{path:s,newPath:l}=e;if(je.equals(s,l))return[];var u=[],c=[];for(var h of je.ancestors(s)){var S=je.transform(h,e);u.push(S)}for(var y of je.ancestors(l)){var z=je.transform(y,e);c.push(z)}var F=c[c.length-1],N=l[l.length-1],j=F.concat(N);return[...u,...c,j];case"remove_node":var{path:D}=e;return[...je.ancestors(D)];case"split_node":var{path:Q}=e;return[...je.levels(Q),je.next(Q)];default:return[]}};function Da(e,t){if(e==null)return{};var r,n,i=function(a,s){if(a==null)return{};var l,u,c={},h=Object.keys(a);for(u=0;u=0||(c[l]=a[l]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var ar,HE=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!t,n=t?UV(e):e,i=ar.None,o=ar.None,a=0,s=null;for(var l of n){var u=l.codePointAt(0);if(!u)break;var c=QV(l,u);if([i,o]=r?[o,c]:[c,i],cc(i,ar.ZWJ)&&cc(o,ar.ExtPict)&&!rK(r?e.substring(0,a):e.substring(0,e.length-a)))break;if(cc(i,ar.RI)&&cc(o,ar.RI)&&!(s=s!==null?!s:!!r||iK(e.substring(0,e.length-a))))break;if(i!==ar.None&&o!==ar.None&&eK(i,o))break;a+=l.length}return a||1},BV=/\s/,FV=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,NV=/['\u2018\u2019]/,zE=(e,t,r)=>{if(r){var n=e.length-t;return[e.slice(n,e.length),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]},jV=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(BV.test(t))return!1;if(NV.test(t)){var i=HE(r,n),[o,a]=zE(r,i,n);if(e(o,a,n))return!0}return!FV.test(t)},UV=function*(e){for(var t=e.length-1,r=0;re>=55296&&e<=56319,zV=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(ar||(ar={}));var WV=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,GV=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,VV=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,KV=/^[\u1100-\u115F\uA960-\uA97C]$/,$V=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,XV=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,YV=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ZV=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,JV=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,QV=(e,t)=>{var r=ar.Any;return e.search(WV)!==-1&&(r|=ar.Extend),t===8205&&(r|=ar.ZWJ),t>=127462&&t<=127487&&(r|=ar.RI),e.search(GV)!==-1&&(r|=ar.Prepend),e.search(VV)!==-1&&(r|=ar.SpacingMark),e.search(KV)!==-1&&(r|=ar.L),e.search($V)!==-1&&(r|=ar.V),e.search(XV)!==-1&&(r|=ar.T),e.search(YV)!==-1&&(r|=ar.LV),e.search(ZV)!==-1&&(r|=ar.LVT),e.search(JV)!==-1&&(r|=ar.ExtPict),r};function cc(e,t){return(e&t)!=0}var qV=[[ar.L,ar.L|ar.V|ar.LV|ar.LVT],[ar.LV|ar.V,ar.V|ar.T],[ar.LVT|ar.T,ar.T],[ar.Any,ar.Extend|ar.ZWJ],[ar.Any,ar.SpacingMark],[ar.Prepend,ar.Any],[ar.ZWJ,ar.ExtPict],[ar.RI,ar.RI]];function eK(e,t){return qV.findIndex(r=>cc(e,r[0])&&cc(t,r[1]))===-1}var tK=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,rK=e=>e.search(tK)!==-1,nK=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,iK=e=>{var t=e.match(nK);return t!==null&&t[0].length/2%2==1},kL=e=>ci(e)&&St.isNodeList(e.children)&&!de.isEditor(e),Ut={isAncestor:e=>ci(e)&&St.isNodeList(e.children),isElement:kL,isElementList:e=>Array.isArray(e)&&e.every(t=>Ut.isElement(t)),isElementProps:e=>e.children!==void 0,isElementType:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return kL(e)&&e[r]===t},matches(e,t){for(var r in t)if(r!=="children"&&e[r]!==t[r])return!1;return!0}},oK=["text"],aK=["text"];function LL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:n="lowest",at:i=e.selection,match:o}=t;if(i){var a=de.path(e,i),s=n==="lowest";for(var[l,u]of de.levels(e,{at:a,voids:r,match:o,reverse:s}))if(!Rt.isText(l)&&!je.equals(a,u))return[l,u]}},addMark(e,t,r){e.addMark(t,r)},after(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.point(e,t,{edge:"end"}),focus:de.end(e,[])},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i}))){if(a>o)break;a!==0&&(r=s),a++}return r},before(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.start(e,[]),focus:de.point(e,t,{edge:"start"})},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i,reverse:!0}))){if(a>o)break;a!==0&&(r=s),a++}return r},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{direction:r="forward"}=t;e.deleteFragment(r)},edges:(e,t)=>[de.start(e,t),de.end(e,t)],end:(e,t)=>de.point(e,t,{edge:"end"}),first(e,t){var r=de.path(e,t,{edge:"start"});return de.node(e,r)},fragment(e,t){var r=de.range(e,t);return St.fragment(e,r)},hasBlocks:(e,t)=>t.children.some(r=>de.isBlock(e,r)),hasInlines:(e,t)=>t.children.some(r=>Rt.isText(r)||de.isInline(e,r)),hasTexts:(e,t)=>t.children.every(r=>Rt.isText(r)),insertBreak(e){e.insertBreak()},insertFragment(e,t){e.insertFragment(t)},insertNode(e,t){e.insertNode(t)},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>Ut.isElement(t)&&!e.isInline(t),isEditor(e){if(!ci(e))return!1;var t=PL.get(e);if(t!==void 0)return t;var r=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteBackward=="function"&&typeof e.deleteForward=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isInline=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&(e.marks===null||ci(e.marks))&&(e.selection===null||Qe.isRange(e.selection))&&St.isNodeList(e.children)&&ss.isOperationList(e.operations);return PL.set(e,r),r},isEnd(e,t,r){var n=de.end(e,r);return cr.equals(t,n)},isEdge:(e,t,r)=>de.isStart(e,t,r)||de.isEnd(e,t,r),isEmpty(e,t){var{children:r}=t,[n]=r;return r.length===0||r.length===1&&Rt.isText(n)&&n.text===""&&!e.isVoid(t)},isInline:(e,t)=>Ut.isElement(t)&&e.isInline(t),isNormalizing(e){var t=AL.get(e);return t===void 0||t},isStart(e,t,r){if(t.offset!==0)return!1;var n=de.start(e,r);return cr.equals(t,n)},isVoid:(e,t)=>Ut.isElement(t)&&e.isVoid(t),last(e,t){var r=de.path(e,t,{edge:"end"});return de.node(e,r)},leaf(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.leaf(e,n),n]},*levels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,reverse:n=!1,voids:i=!1}=t,{match:o}=t;if(o==null&&(o=()=>!0),r){var a=[],s=de.path(e,r);for(var[l,u]of St.levels(e,s))if(o(l,u)&&(a.push([l,u]),!i&&de.isVoid(e,l)))break;n&&a.reverse(),yield*a}},marks(e){var{marks:t,selection:r}=e;if(!r)return null;if(t)return t;if(Qe.isExpanded(r)){var[n]=de.nodes(e,{match:Rt.isText});if(n){var[i]=n;return Da(i,oK)}return{}}var{anchor:o}=r,{path:a}=o,[s]=de.leaf(e,a);if(o.offset===0){var l=de.previous(e,{at:a,match:Rt.isText}),u=de.above(e,{match:y=>de.isBlock(e,y)});if(l&&u){var[c,h]=l,[,S]=u;je.isAncestor(S,h)&&(s=c)}}return Da(s,aK)},next(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.after(e,o,{voids:n});if(a){var[,s]=de.last(e,[]),l=[a.path,s];if(je.isPath(o)&&o.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(je.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{at:l,match:i,mode:r,voids:n});return c}}},node(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.get(e,n),n]},*nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,mode:n="all",universal:i=!1,reverse:o=!1,voids:a=!1}=t,{match:s}=t;if(s||(s=()=>!0),r){var l,u;if(sK.isSpan(r))l=r[0],u=r[1];else{var c=de.path(e,r,{edge:"start"}),h=de.path(e,r,{edge:"end"});l=o?h:c,u=o?c:h}var S,y=St.nodes(e,{reverse:o,from:l,to:u,pass:Q=>{var[te]=Q;return!a&&de.isVoid(e,te)}}),z=[];for(var[F,N]of y){var j=S&&je.compare(N,S[1])===0;if(n!=="highest"||!j){if(s(F,N))if(n==="lowest"&&j)S=[F,N];else{var D=n==="lowest"?S:[F,N];D&&(i?z.push(D):yield D),S=[F,N]}else if(i&&!j&&Rt.isText(F))return}}n==="lowest"&&S&&(i?z.push(S):yield S),i&&(yield*z)}},normalize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1}=t,n=o=>Lv.get(o)||[];if(de.isNormalizing(e)){if(r){var i=Array.from(St.nodes(e),o=>{var[,a]=o;return a});Lv.set(e,i)}n(e).length!==0&&de.withoutNormalizing(e,()=>{for(var o of n(e))if(St.has(e,o)){var a=de.node(e,o),[s,l]=a;Ut.isElement(s)&&s.children.length===0&&e.normalizeNode(a)}for(var u=42*n(e).length,c=0;n(e).length!==0;){if(c>u)throw new Error(` + */function fL(e){return Object.prototype.toString.call(e)==="[object Object]"}function ci(e){var t,r;return fL(e)!==!1&&((t=e.constructor)===void 0||fL(r=t.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)}function Oo(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:DE(e)?2:OE(e)?3:0}function AE(e,t){return uc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pL(e,t,r){var n=uc(e);n===2?e.set(t,r):n===3?(e.delete(t),e.add(r)):e[t]=r}function DE(e){return OV&&e instanceof Map}function OE(e){return _V&&e instanceof Set}function Bl(e){return e.o||e.t}function _E(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=kV(e);delete t[ji];for(var r=UE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=TV),Object.freeze(e),t&&Th(e,function(r,n){return RE(n,!0)},!0)),e}function TV(){Oo(2)}function kE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Aa(e){var t=LV[e];return t||Oo(18,e),t}function gL(){return Ah}function LE(e,t){t&&(Aa("Patches"),e.u=[],e.s=[],e.v=t)}function Av(e){PE(e),e.p.forEach(AV),e.p=null}function PE(e){e===Ah&&(Ah=e.l)}function vL(e){return Ah={p:[],l:Ah,h:e,m:!0,_:0}}function AV(e){var t=e[ji];t.i===0||t.i===1?t.j():t.O=!0}function IE(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.g||Aa("ES5").S(t,e,n),n?(r[ji].P&&(Av(t),Oo(4)),Ml(e)&&(e=Dv(t,e),t.l||Ov(t,e)),t.u&&Aa("Patches").M(r[ji],e,t.u,t.s)):e=Dv(t,r,[]),Av(t),t.u&&t.v(t.u,t.s),e!==SL?e:void 0}function Dv(e,t,r){if(kE(t))return t;var n=t[ji];if(!n)return Th(t,function(o,a){return mL(e,n,t,o,a,r)},!0),t;if(n.A!==e)return t;if(!n.P)return Ov(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=_E(n.k):n.o;Th(n.i===3?new Set(i):i,function(o,a){return mL(e,n,i,o,a,r)}),Ov(e,i,!1),r&&e.u&&Aa("Patches").R(n,r,e.u,e.s)}return n.o}function mL(e,t,r,n,i,o){if(Il(i)){var a=Dv(e,i,o&&t&&t.i!==3&&!AE(t.D,n)?o.concat(n):void 0);if(pL(r,n,a),!Il(a))return;e.m=!1}if(Ml(i)&&!kE(i)){if(!e.h.F&&e._<1)return;Dv(e,i),t&&t.A.l||Ov(e,i)}}function Ov(e,t,r){r===void 0&&(r=!1),e.h.F&&e.m&&RE(t,r)}function ME(e,t){var r=e[ji];return(r?Bl(r):e)[t]}function yL(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function BE(e){e.P||(e.P=!0,e.l&&BE(e.l))}function FE(e){e.o||(e.o=_E(e.t))}function NE(e,t,r){var n=DE(t)?Aa("MapSet").N(t,r):OE(t)?Aa("MapSet").T(t,r):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:gL(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=_v;a&&(l=[s],u=Rv);var c=Proxy.revocable(l,u),h=c.revoke,S=c.proxy;return s.k=S,s.j=h,S}(t,r):Aa("ES5").J(t,r);return(r?r.A:gL()).p.push(n),n}function DV(e){return Il(e)||Oo(22,e),function t(r){if(!Ml(r))return r;var n,i=r[ji],o=uc(r);if(i){if(!i.P&&(i.i<4||!Aa("ES5").K(i)))return i.t;i.I=!0,n=bL(r,o),i.I=!1}else n=bL(r,o);return Th(n,function(a,s){i&&function(l,u){return uc(l)===2?l.get(u):l[u]}(i.t,a)===s||pL(n,a,t(s))}),o===3?new Set(n):n}(e)}function bL(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return _E(e)}var EL,Ah,jE=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",OV=typeof Map!="undefined",_V=typeof Set!="undefined",xL=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",SL=jE?Symbol.for("immer-nothing"):((EL={})["immer-nothing"]=!0,EL),wL=jE?Symbol.for("immer-draftable"):"__$immer_draftable",ji=jE?Symbol.for("immer-state"):"__$immer_state",RV=""+Object.prototype.constructor,UE=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,kV=Object.getOwnPropertyDescriptors||function(e){var t={};return UE(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},LV={},_v={get:function(e,t){if(t===ji)return e;var r=Bl(e);if(!AE(r,t))return function(i,o,a){var s,l=yL(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,r,t);var n=r[t];return e.I||!Ml(n)?n:n===ME(e.t,t)?(FE(e),e.o[t]=NE(e.A.h,n,e)):n},has:function(e,t){return t in Bl(e)},ownKeys:function(e){return Reflect.ownKeys(Bl(e))},set:function(e,t,r){var n=yL(Bl(e),t);if(n==null?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=ME(Bl(e),t),o=i==null?void 0:i[ji];if(o&&o.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(function(a,s){return a===s?a!==0||1/a==1/s:a!=a&&s!=s}(r,i)&&(r!==void 0||AE(e.t,t)))return!0;FE(e),BE(e)}return e.o[t]===r&&typeof r!="number"&&(r!==void 0||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return ME(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,FE(e),BE(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Bl(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){Oo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Oo(12)}},Rv={};Th(_v,function(e,t){Rv[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Rv.deleteProperty=function(e,t){return _v.deleteProperty.call(this,e[0],t)},Rv.set=function(e,t,r){return _v.set.call(this,e[0],t,r,e[0])};var PV=function(){function e(r){var n=this;this.g=xL,this.F=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=n;return function(y){var W=this;y===void 0&&(y=s);for(var F=arguments.length,N=Array(F>1?F-1:0),j=1;j1?u-1:0),h=1;h=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var a=Aa("Patches").$;return Il(r)?a(r,n):this.produce(r,function(s){return a(s,n)})},e}(),Ui=new PV,kv=Ui.produce;Ui.produceWithPatches.bind(Ui),Ui.setAutoFreeze.bind(Ui),Ui.setUseProxies.bind(Ui),Ui.applyPatches.bind(Ui);var CL=Ui.createDraft.bind(Ui),TL=Ui.finishDraft.bind(Ui);function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lv=new WeakMap,Dh=new WeakMap,AL=new WeakMap,DL=new WeakMap,OL=new WeakMap,_L=new WeakMap;function RL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pv(e){for(var t=1;t{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of de.pathRefs(e))cK.transform(r,t);for(var n of de.pointRefs(e))dK.transform(n,t);for(var i of de.rangeRefs(e))fK.transform(i,t);var o=new Set,a=[],s=S=>{if(S){var y=S.join(",");o.has(y)||(o.add(y),a.push(S))}},l=Lv.get(e)||[],u=MV(t);for(var c of l)s(Ue.transform(c,t));for(var h of u)s(h);Lv.set(e,a),Ve.transform(e,t),e.operations.push(t),de.normalize(e),t.type==="set_selection"&&(e.marks=null),Dh.get(e)||(Dh.set(e,!0),Promise.resolve().then(()=>{Dh.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n}=e;if(n)if(Je.isExpanded(n))Ve.setNodes(e,{[t]:r},{match:Rt.isText,split:!0});else{var i=Pv(Pv({},de.marks(e)||{}),{},{[t]:r});e.marks=i,Dh.get(e)||e.onChange()}},deleteBackward:t=>{var{selection:r}=e;r&&Je.isCollapsed(r)&&Ve.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&Je.isCollapsed(r)&&Ve.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&Je.isExpanded(r)&&Ve.delete(e,{reverse:t==="backward"})},getFragment:()=>{var{selection:t}=e;return t?St.fragment(e,t):[]},insertBreak:()=>{Ve.splitNodes(e,{always:!0})},insertFragment:t=>{Ve.insertFragment(e,t)},insertNode:t=>{Ve.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var i=Pv({text:t},n);Ve.insertNodes(e,i)}else Ve.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!Rt.isText(r))if(Ut.isElement(r)&&r.children.length===0)Ve.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var i=!de.isEditor(r)&&Ut.isElement(r)&&(e.isInline(r)||r.children.length===0||Rt.isText(r.children[0])||e.isInline(r.children[0])),o=0,a=0;a{var{selection:r}=e;if(r)if(Je.isExpanded(r))Ve.unsetNodes(e,t,{match:Rt.isText,split:!0});else{var n=Pv({},de.marks(e)||{});delete n[t],e.marks=n,Dh.get(e)||e.onChange()}}};return e},MV=e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return Ue.levels(t);case"insert_node":var{node:r,path:n}=e,i=Ue.levels(n),o=Rt.isText(r)?[]:Array.from(St.nodes(r),te=>{var[,he]=te;return n.concat(he)});return[...i,...o];case"merge_node":var{path:a}=e;return[...Ue.ancestors(a),Ue.previous(a)];case"move_node":var{path:s,newPath:l}=e;if(Ue.equals(s,l))return[];var u=[],c=[];for(var h of Ue.ancestors(s)){var S=Ue.transform(h,e);u.push(S)}for(var y of Ue.ancestors(l)){var W=Ue.transform(y,e);c.push(W)}var F=c[c.length-1],N=l[l.length-1],j=F.concat(N);return[...u,...c,j];case"remove_node":var{path:D}=e;return[...Ue.ancestors(D)];case"split_node":var{path:Q}=e;return[...Ue.levels(Q),Ue.next(Q)];default:return[]}};function Da(e,t){if(e==null)return{};var r,n,i=function(a,s){if(a==null)return{};var l,u,c={},h=Object.keys(a);for(u=0;u=0||(c[l]=a[l]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var ar,HE=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!t,n=t?UV(e):e,i=ar.None,o=ar.None,a=0,s=null;for(var l of n){var u=l.codePointAt(0);if(!u)break;var c=QV(l,u);if([i,o]=r?[o,c]:[c,i],cc(i,ar.ZWJ)&&cc(o,ar.ExtPict)&&!rK(r?e.substring(0,a):e.substring(0,e.length-a)))break;if(cc(i,ar.RI)&&cc(o,ar.RI)&&!(s=s!==null?!s:!!r||iK(e.substring(0,e.length-a))))break;if(i!==ar.None&&o!==ar.None&&eK(i,o))break;a+=l.length}return a||1},BV=/\s/,FV=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,NV=/['\u2018\u2019]/,zE=(e,t,r)=>{if(r){var n=e.length-t;return[e.slice(n,e.length),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]},jV=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(BV.test(t))return!1;if(NV.test(t)){var i=HE(r,n),[o,a]=zE(r,i,n);if(e(o,a,n))return!0}return!FV.test(t)},UV=function*(e){for(var t=e.length-1,r=0;re>=55296&&e<=56319,zV=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(ar||(ar={}));var WV=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,GV=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,VV=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,KV=/^[\u1100-\u115F\uA960-\uA97C]$/,$V=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,XV=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,YV=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ZV=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,JV=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,QV=(e,t)=>{var r=ar.Any;return e.search(WV)!==-1&&(r|=ar.Extend),t===8205&&(r|=ar.ZWJ),t>=127462&&t<=127487&&(r|=ar.RI),e.search(GV)!==-1&&(r|=ar.Prepend),e.search(VV)!==-1&&(r|=ar.SpacingMark),e.search(KV)!==-1&&(r|=ar.L),e.search($V)!==-1&&(r|=ar.V),e.search(XV)!==-1&&(r|=ar.T),e.search(YV)!==-1&&(r|=ar.LV),e.search(ZV)!==-1&&(r|=ar.LVT),e.search(JV)!==-1&&(r|=ar.ExtPict),r};function cc(e,t){return(e&t)!=0}var qV=[[ar.L,ar.L|ar.V|ar.LV|ar.LVT],[ar.LV|ar.V,ar.V|ar.T],[ar.LVT|ar.T,ar.T],[ar.Any,ar.Extend|ar.ZWJ],[ar.Any,ar.SpacingMark],[ar.Prepend,ar.Any],[ar.ZWJ,ar.ExtPict],[ar.RI,ar.RI]];function eK(e,t){return qV.findIndex(r=>cc(e,r[0])&&cc(t,r[1]))===-1}var tK=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,rK=e=>e.search(tK)!==-1,nK=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,iK=e=>{var t=e.match(nK);return t!==null&&t[0].length/2%2==1},kL=e=>ci(e)&&St.isNodeList(e.children)&&!de.isEditor(e),Ut={isAncestor:e=>ci(e)&&St.isNodeList(e.children),isElement:kL,isElementList:e=>Array.isArray(e)&&e.every(t=>Ut.isElement(t)),isElementProps:e=>e.children!==void 0,isElementType:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return kL(e)&&e[r]===t},matches(e,t){for(var r in t)if(r!=="children"&&e[r]!==t[r])return!1;return!0}},oK=["text"],aK=["text"];function LL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:n="lowest",at:i=e.selection,match:o}=t;if(i){var a=de.path(e,i),s=n==="lowest";for(var[l,u]of de.levels(e,{at:a,voids:r,match:o,reverse:s}))if(!Rt.isText(l)&&!Ue.equals(a,u))return[l,u]}},addMark(e,t,r){e.addMark(t,r)},after(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.point(e,t,{edge:"end"}),focus:de.end(e,[])},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i}))){if(a>o)break;a!==0&&(r=s),a++}return r},before(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:de.start(e,[]),focus:de.point(e,t,{edge:"start"})},{distance:o=1}=n,a=0;for(var s of de.positions(e,dc(dc({},n),{},{at:i,reverse:!0}))){if(a>o)break;a!==0&&(r=s),a++}return r},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{direction:r="forward"}=t;e.deleteFragment(r)},edges:(e,t)=>[de.start(e,t),de.end(e,t)],end:(e,t)=>de.point(e,t,{edge:"end"}),first(e,t){var r=de.path(e,t,{edge:"start"});return de.node(e,r)},fragment(e,t){var r=de.range(e,t);return St.fragment(e,r)},hasBlocks:(e,t)=>t.children.some(r=>de.isBlock(e,r)),hasInlines:(e,t)=>t.children.some(r=>Rt.isText(r)||de.isInline(e,r)),hasTexts:(e,t)=>t.children.every(r=>Rt.isText(r)),insertBreak(e){e.insertBreak()},insertFragment(e,t){e.insertFragment(t)},insertNode(e,t){e.insertNode(t)},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>Ut.isElement(t)&&!e.isInline(t),isEditor(e){if(!ci(e))return!1;var t=PL.get(e);if(t!==void 0)return t;var r=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteBackward=="function"&&typeof e.deleteForward=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isInline=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&(e.marks===null||ci(e.marks))&&(e.selection===null||Je.isRange(e.selection))&&St.isNodeList(e.children)&&ss.isOperationList(e.operations);return PL.set(e,r),r},isEnd(e,t,r){var n=de.end(e,r);return cr.equals(t,n)},isEdge:(e,t,r)=>de.isStart(e,t,r)||de.isEnd(e,t,r),isEmpty(e,t){var{children:r}=t,[n]=r;return r.length===0||r.length===1&&Rt.isText(n)&&n.text===""&&!e.isVoid(t)},isInline:(e,t)=>Ut.isElement(t)&&e.isInline(t),isNormalizing(e){var t=AL.get(e);return t===void 0||t},isStart(e,t,r){if(t.offset!==0)return!1;var n=de.start(e,r);return cr.equals(t,n)},isVoid:(e,t)=>Ut.isElement(t)&&e.isVoid(t),last(e,t){var r=de.path(e,t,{edge:"end"});return de.node(e,r)},leaf(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.leaf(e,n),n]},*levels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,reverse:n=!1,voids:i=!1}=t,{match:o}=t;if(o==null&&(o=()=>!0),r){var a=[],s=de.path(e,r);for(var[l,u]of St.levels(e,s))if(o(l,u)&&(a.push([l,u]),!i&&de.isVoid(e,l)))break;n&&a.reverse(),yield*a}},marks(e){var{marks:t,selection:r}=e;if(!r)return null;if(t)return t;if(Je.isExpanded(r)){var[n]=de.nodes(e,{match:Rt.isText});if(n){var[i]=n;return Da(i,oK)}return{}}var{anchor:o}=r,{path:a}=o,[s]=de.leaf(e,a);if(o.offset===0){var l=de.previous(e,{at:a,match:Rt.isText}),u=de.above(e,{match:y=>de.isBlock(e,y)});if(l&&u){var[c,h]=l,[,S]=u;Ue.isAncestor(S,h)&&(s=c)}}return Da(s,aK)},next(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.after(e,o,{voids:n});if(a){var[,s]=de.last(e,[]),l=[a.path,s];if(Ue.isPath(o)&&o.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(Ue.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{at:l,match:i,mode:r,voids:n});return c}}},node(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r);return[St.get(e,n),n]},*nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,mode:n="all",universal:i=!1,reverse:o=!1,voids:a=!1}=t,{match:s}=t;if(s||(s=()=>!0),r){var l,u;if(sK.isSpan(r))l=r[0],u=r[1];else{var c=de.path(e,r,{edge:"start"}),h=de.path(e,r,{edge:"end"});l=o?h:c,u=o?c:h}var S,y=St.nodes(e,{reverse:o,from:l,to:u,pass:Q=>{var[te]=Q;return!a&&de.isVoid(e,te)}}),W=[];for(var[F,N]of y){var j=S&&Ue.compare(N,S[1])===0;if(n!=="highest"||!j){if(s(F,N))if(n==="lowest"&&j)S=[F,N];else{var D=n==="lowest"?S:[F,N];D&&(i?W.push(D):yield D),S=[F,N]}else if(i&&!j&&Rt.isText(F))return}}n==="lowest"&&S&&(i?W.push(S):yield S),i&&(yield*W)}},normalize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1}=t,n=o=>Lv.get(o)||[];if(de.isNormalizing(e)){if(r){var i=Array.from(St.nodes(e),o=>{var[,a]=o;return a});Lv.set(e,i)}n(e).length!==0&&de.withoutNormalizing(e,()=>{for(var o of n(e))if(St.has(e,o)){var a=de.node(e,o),[s,l]=a;Ut.isElement(s)&&s.children.length===0&&e.normalizeNode(a)}for(var u=42*n(e).length,c=0;n(e).length!==0;){if(c>u)throw new Error(` Could not completely normalize the editor after `.concat(u,` iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state. - `));var h=n(e).pop();if(St.has(e,h)){var S=de.node(e,h);e.normalizeNode(S)}c++}})}},parent(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r),i=je.parent(n);return de.node(e,i)},path(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:n,edge:i}=r;if(je.isPath(t)){if(i==="start"){var[,o]=St.first(e,t);t=o}else if(i==="end"){var[,a]=St.last(e,t);t=a}}return Qe.isRange(t)&&(t=i==="start"?Qe.start(t):i==="end"?Qe.end(t):je.common(t.anchor.path,t.focus.path)),cr.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},hasPath:(e,t)=>St.has(e,t),pathRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pathRefs(e).delete(i),i.current=null,o}};return de.pathRefs(e).add(i),i},pathRefs(e){var t=DL.get(e);return t||(t=new Set,DL.set(e,t)),t},point(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:n="start"}=r;if(je.isPath(t)){var i;if(n==="end"){var[,o]=St.last(e,t);i=o}else{var[,a]=St.first(e,t);i=a}var s=St.get(e,i);if(!Rt.isText(s))throw new Error("Cannot get the ".concat(n," point in the node at path [").concat(t,"] because it has no ").concat(n," text node."));return{path:i,offset:n==="end"?s.text.length:0}}if(Qe.isRange(t)){var[l,u]=Qe.edges(t);return n==="start"?l:u}return t},pointRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pointRefs(e).delete(i),i.current=null,o}};return de.pointRefs(e).add(i),i},pointRefs(e){var t=OL.get(e);return t||(t=new Set,OL.set(e,t)),t},*positions(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,unit:n="offset",reverse:i=!1,voids:o=!1}=t;if(r){var a=de.range(e,r),[s,l]=Qe.edges(a),u=i?l:s,c=!1,h="",S=0,y=0,z=0;for(var[F,N]of de.nodes(e,{at:r,reverse:i,voids:o})){if(Ut.isElement(F)){if(!o&&e.isVoid(F)){yield de.start(e,N);continue}if(e.isInline(F))continue;if(de.hasInlines(e,F)){var j=je.isAncestor(N,l.path)?l:de.end(e,N),D=je.isAncestor(N,s.path)?s:de.start(e,N);h=de.string(e,{anchor:D,focus:j},{voids:o}),c=!0}}if(Rt.isText(F)){var Q=je.equals(N,u.path);for(Q?(y=i?u.offset:F.text.length-u.offset,z=u.offset):(y=F.text.length,z=i?y:0),(Q||c||n==="offset")&&(yield{path:N,offset:z},c=!1);;){if(S===0){if(h==="")break;S=te(h,n,i),h=zE(h,S,i)[1]}if(z=i?z-S:z+S,(y-=S)<0){S=-y;break}S=0,yield{path:N,offset:z}}}}}function te(he,Ee,ve){return Ee==="character"?HE(he,ve):Ee==="word"?function(De){for(var Pe=arguments.length>1&&arguments[1]!==void 0&&arguments[1],qe=0,ot=!1;De.length>0;){var et=HE(De,Pe),[gt,dt]=zE(De,et,Pe);if(jV(gt,dt,Pe))ot=!0,qe+=et;else{if(ot)break;qe+=et}De=dt}return qe}(he,ve):Ee==="line"||Ee==="block"?he.length:1}},previous(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.before(e,o,{voids:n});if(a){var[,s]=de.first(e,[]),l=[a.path,s];if(je.isPath(o)&&o.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(je.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{reverse:!0,at:l,match:i,mode:r,voids:n});return c}}},range:(e,t,r)=>Qe.isRange(t)&&!r?t:{anchor:de.start(e,t),focus:de.end(e,r||t)},rangeRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.rangeRefs(e).delete(i),i.current=null,o}};return de.rangeRefs(e).add(i),i},rangeRefs(e){var t=_L.get(e);return t||(t=new Set,_L.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){AL.set(e,t)},start:(e,t)=>de.point(e,t,{edge:"start"}),string(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,i=de.range(e,t),[o,a]=Qe.edges(i),s="";for(var[l,u]of de.nodes(e,{at:i,match:Rt.isText,voids:n})){var c=l.text;je.equals(u,a.path)&&(c=c.slice(0,a.offset)),je.equals(u,o.path)&&(c=c.slice(o.offset)),s+=c}return s},unhangRange(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,[i,o]=Qe.edges(t);if(i.offset!==0||o.offset!==0||Qe.isCollapsed(t))return t;var a=de.above(e,{at:o,match:S=>de.isBlock(e,S)}),s=a?a[1]:[],l={anchor:de.start(e,[]),focus:o},u=!0;for(var[c,h]of de.nodes(e,{at:l,match:Rt.isText,reverse:!0,voids:n}))if(u)u=!1;else if(c.text!==""||je.isBefore(h,s)){o={path:h,offset:c.text.length};break}return{anchor:i,focus:o}},void(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return de.above(e,dc(dc({},t),{},{match:r=>de.isVoid(e,r)}))},withoutNormalizing(e,t){var r=de.isNormalizing(e);de.setNormalizing(e,!1);try{t()}finally{de.setNormalizing(e,r)}de.normalize(e)}},Uye={isLocation:e=>je.isPath(e)||cr.isPoint(e)||Qe.isRange(e)},sK={isSpan:e=>Array.isArray(e)&&e.length===2&&e.every(je.isPath)},lK=["children"],uK=["text"],IL=new WeakMap,St={ancestor(e,t){var r=St.get(e,t);if(Rt.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(r));return r},*ancestors(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of je.ancestors(t,r)){var i=[St.ancestor(e,n),n];yield i}},child(e,t){if(Rt.isText(e))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(e)));var r=e.children[t];if(r==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(JSON.stringify(e)));return r},*children(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{reverse:n=!1}=r,i=St.ancestor(e,t),{children:o}=i,a=n?o.length-1:0;n?a>=0:a1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))n.length!==0&&(yield[r,n])},*elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Ut.isElement(r)&&(yield[r,n])},extractProps:e=>Ut.isAncestor(e)?Da(e,lK):Da(e,uK),first(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Rt.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(e)));var r=kv({children:e.children},n=>{var[i,o]=Qe.edges(t),a=St.nodes(n,{reverse:!0,pass:S=>{var[,y]=S;return!Qe.includes(t,y)}});for(var[,s]of a){if(!Qe.includes(t,s)){var l=St.parent(n,s),u=s[s.length-1];l.children.splice(u,1)}if(je.equals(s,o.path)){var c=St.leaf(n,s);c.text=c.text.slice(0,o.offset)}if(je.equals(s,i.path)){var h=St.leaf(n,s);h.text=h.text.slice(i.offset)}}de.isEditor(n)&&(n.selection=null)});return r.children},get(e,t){for(var r=e,n=0;nRt.isText(e)||Ut.isElement(e)||de.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=IL.get(e);if(t!==void 0)return t;var r=e.every(n=>St.isNode(n));return IL.set(e,r),r},last(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;){var i=n.children.length-1;n=n.children[i],r.push(i)}return[n,r]},leaf(e,t){var r=St.get(e,t);if(!Rt.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(r));return r},*levels(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of je.levels(t,r)){var i=St.get(e,n);yield[i,n]}},matches:(e,t)=>Ut.isElement(e)&&Ut.isElementProps(t)&&Ut.matches(e,t)||Rt.isText(e)&&Rt.isTextProps(t)&&Rt.matches(e,t),*nodes(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{pass:r,reverse:n=!1}=t,{from:i=[],to:o}=t,a=new Set,s=[],l=e;!o||!(n?je.isBefore(s,o):je.isAfter(s,o));)if(a.has(l)||(yield[l,s]),a.has(l)||Rt.isText(l)||l.children.length===0||r!=null&&r([l,s])!==!1){if(s.length===0)break;if(!n){var u=je.next(s);if(St.has(e,u)){s=u,l=St.get(e,s);continue}}n&&s[s.length-1]!==0?(s=je.previous(s),l=St.get(e,s)):(s=je.parent(s),l=St.get(e,s),a.add(l))}else{a.add(l);var c=n?l.children.length-1:0;je.isAncestor(s,i)&&(c=i[s.length]),s=s.concat(c),l=St.get(e,s)}},parent(e,t){var r=je.parent(t),n=St.get(e,r);if(Rt.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Rt.isText(e)?e.text:e.children.map(St.string).join(""),*texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Rt.isText(r)&&(yield[r,n])}};function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;tss.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!ci(e))return!1;switch(e.type){case"insert_node":case"remove_node":return je.isPath(e.path)&&St.isNode(e.node);case"insert_text":case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&je.isPath(e.path);case"merge_node":return typeof e.position=="number"&&je.isPath(e.path)&&ci(e.properties);case"move_node":return je.isPath(e.path)&&je.isPath(e.newPath);case"set_node":return je.isPath(e.path)&&ci(e.properties)&&ci(e.newProperties);case"set_selection":return e.properties===null&&Qe.isRange(e.newProperties)||e.newProperties===null&&Qe.isRange(e.properties)||ci(e.properties)&&ci(e.newProperties);case"split_node":return je.isPath(e.path)&&typeof e.position=="number"&&ci(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(t=>ss.isOperation(t)),isSelectionOperation:e=>ss.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ss.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return _n(_n({},e),{},{type:"remove_node"});case"insert_text":return _n(_n({},e),{},{type:"remove_text"});case"merge_node":return _n(_n({},e),{},{type:"split_node",path:je.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(je.equals(t,r))return e;if(je.isSibling(r,t))return _n(_n({},e),{},{path:t,newPath:r});var n=je.transform(r,e),i=je.transform(je.next(r),e);return _n(_n({},e),{},{path:n,newPath:i});case"remove_node":return _n(_n({},e),{},{type:"insert_node"});case"remove_text":return _n(_n({},e),{},{type:"insert_text"});case"set_node":var{properties:o,newProperties:a}=e;return _n(_n({},e),{},{properties:a,newProperties:o});case"set_selection":var{properties:s,newProperties:l}=e;return _n(_n({},e),{},s==null?{properties:l,newProperties:null}:l==null?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return _n(_n({},e),{},{type:"merge_node",path:je.next(e.path)})}}},je={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=je.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;nt[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return je.equals(n,i)&&o>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),i=t.slice(0,r);return je.equals(n,i)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return je.equals(n,i)&&oe.length===t.length&&e.every((r,n)=>r===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>je.compare(e,t)===1,isAncestor:(e,t)=>e.lengthje.compare(e,t)===-1,isChild:(e,t)=>e.length===t.length+1&&je.compare(e,t)===0,isCommon:(e,t)=>e.length<=t.length&&je.compare(e,t)===0,isDescendant:(e,t)=>e.length>t.length&&je.compare(e,t)===0,isParent:(e,t)=>e.length+1===t.length&&je.compare(e,t)===0,isPath:e=>Array.isArray(e)&&(e.length===0||typeof e[0]=="number"),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&je.equals(r,n)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=[],i=0;i<=e.length;i++)n.push(e.slice(0,i));return r&&n.reverse(),n},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!je.isAncestor(t,e)&&!je.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{var{affinity:i="forward"}=r;if(e&&(e==null?void 0:e.length)!==0){if(n===null)return null;switch(t.type){case"insert_node":var{path:o}=t;(je.equals(o,n)||je.endsBefore(o,n)||je.isAncestor(o,n))&&(n[o.length-1]+=1);break;case"remove_node":var{path:a}=t;if(je.equals(a,n)||je.isAncestor(a,n))return null;je.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;je.equals(s,n)||je.endsBefore(s,n)?n[s.length-1]-=1:je.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:u,position:c}=t;if(je.equals(u,n)){if(i==="forward")n[n.length-1]+=1;else if(i!=="backward")return null}else je.endsBefore(u,n)?n[u.length-1]+=1:je.isAncestor(u,n)&&e[u.length]>=c&&(n[u.length-1]+=1,n[u.length]-=c);break;case"move_node":var{path:h,newPath:S}=t;if(je.equals(h,S))return;if(je.isAncestor(h,n)||je.equals(h,n)){var y=S.slice();return je.endsBefore(h,S)&&h.lengtht.offset?1:0:r},isAfter:(e,t)=>cr.compare(e,t)===1,isBefore:(e,t)=>cr.compare(e,t)===-1,equals:(e,t)=>e.offset===t.offset&&je.equals(e.path,t.path),isPoint:e=>ci(e)&&typeof e.offset=="number"&&je.isPath(e.path),transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var{affinity:i="forward"}=r,{path:o,offset:a}=n;switch(t.type){case"insert_node":case"move_node":n.path=je.transform(o,t,r);break;case"insert_text":je.equals(t.path,o)&&t.offset<=a&&(n.offset+=t.text.length);break;case"merge_node":je.equals(t.path,o)&&(n.offset+=t.position),n.path=je.transform(o,t,r);break;case"remove_text":je.equals(t.path,o)&&t.offset<=a&&(n.offset-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(je.equals(t.path,o)||je.isAncestor(t.path,o))return null;n.path=je.transform(o,t,r);break;case"split_node":if(je.equals(t.path,o)){if(t.position===a&&i==null)return null;(t.position1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:i}=e;return Qe.isBackward(e)===r?[n,i]:[i,n]},end(e){var[,t]=Qe.edges(e);return t},equals:(e,t)=>cr.equals(e.anchor,t.anchor)&&cr.equals(e.focus,t.focus),includes(e,t){if(Qe.isRange(t)){if(Qe.includes(e,t.anchor)||Qe.includes(e,t.focus))return!0;var[r,n]=Qe.edges(e),[i,o]=Qe.edges(t);return cr.isBefore(r,i)&&cr.isAfter(n,o)}var[a,s]=Qe.edges(e),l=!1,u=!1;return cr.isPoint(t)?(l=cr.compare(t,a)>=0,u=cr.compare(t,s)<=0):(l=je.compare(t,a.path)>=0,u=je.compare(t,s.path)<=0),l&&u},intersection(e,t){var r=Da(e,hK),[n,i]=Qe.edges(e),[o,a]=Qe.edges(t),s=cr.isBefore(n,o)?o:n,l=cr.isBefore(i,a)?i:a;return cr.isBefore(l,s)?null:function(u){for(var c=1;c!Qe.isCollapsed(e),isForward:e=>!Qe.isBackward(e),isRange:e=>ci(e)&&cr.isPoint(e.anchor)&&cr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Qe.edges(e);return t},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var i,o,{affinity:a="inward"}=r;if(a==="inward"){var s=Qe.isCollapsed(n);Qe.isForward(n)?(i="forward",o=s?i:"backward"):(i="backward",o=s?i:"forward")}else a==="outward"?Qe.isForward(n)?(i="backward",o="forward"):(i="forward",o="backward"):(i=a,o=a);var l=cr.transform(n.anchor,t,{affinity:i}),u=cr.transform(n.focus,t,{affinity:o});if(!l||!u)return null;n.anchor=l,n.focus=u})}},fK={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var i=Qe.transform(r,t,{affinity:n});e.current=i,i==null&&e.unref()}}},jL=(e,t)=>{for(var r in e){var n=e[r],i=t[r];if(ci(n)&&ci(i)){if(!jL(n,i))return!1}else if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return!1;for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:{},{loose:n=!1}=r;function i(o){return Da(o,pK)}return jL(n?i(e):e,n?i(t):t)},isText:e=>ci(e)&&typeof e.text=="string",isTextList:e=>Array.isArray(e)&&e.every(t=>Rt.isText(t)),isTextProps:e=>e.text!==void 0,matches(e,t){for(var r in t)if(r!=="text"&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Oa({},e)];for(var n of t){var i=Da(n,gK),[o,a]=Qe.edges(n),s=[],l=0;for(var u of r){var{length:c}=u.text,h=l;if(l+=c,o.offset<=h&&a.offset>=l)Object.assign(u,i),s.push(u);else if(o.offset!==a.offset&&(o.offset===l||a.offset===h)||o.offset>l||a.offseth){var N=o.offset-h;y=Oa(Oa({},S),{},{text:S.text.slice(0,N)}),S=Oa(Oa({},S),{},{text:S.text.slice(N)})}Object.assign(S,i),y&&s.push(y),s.push(S),z&&s.push(z)}}r=s}return r}};function HL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oh(e){for(var t=1;t{switch(o.type){case"insert_node":var{path:a,node:s}=o,l=St.parent(n,a),u=a[a.length-1];if(u>l.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(a,"] because the destination is past the end of the node."));if(l.children.splice(u,0,s),i)for(var[c,h]of Qe.points(i))i[h]=cr.transform(c,o);break;case"insert_text":var{path:S,offset:y,text:z}=o;if(z.length===0)break;var F=St.leaf(n,S),N=F.text.slice(0,y),j=F.text.slice(y);if(F.text=N+z+j,i)for(var[D,Q]of Qe.points(i))i[Q]=cr.transform(D,o);break;case"merge_node":var{path:te}=o,he=St.get(n,te),Ee=je.previous(te),ve=St.get(n,Ee),De=St.parent(n,te),Pe=te[te.length-1];if(Rt.isText(he)&&Rt.isText(ve))ve.text+=he.text;else{if(Rt.isText(he)||Rt.isText(ve))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(te,"] to nodes of different interfaces: ").concat(he," ").concat(ve));ve.children.push(...he.children)}if(De.children.splice(Pe,1),i)for(var[qe,ot]of Qe.points(i))i[ot]=cr.transform(qe,o);break;case"move_node":var{path:et,newPath:gt}=o;if(je.isAncestor(et,gt))throw new Error("Cannot move a path [".concat(et,"] to new path [").concat(gt,"] because the destination is inside itself."));var dt=St.get(n,et),ht=St.parent(n,et),pt=et[et.length-1];ht.children.splice(pt,1);var Dt=je.transform(et,o),Ft=St.get(n,je.parent(Dt)),Bt=Dt[Dt.length-1];if(Ft.children.splice(Bt,0,dt),i)for(var[It,Re]of Qe.points(i))i[Re]=cr.transform(It,o);break;case"remove_node":var{path:Te}=o,Be=Te[Te.length-1];if(St.parent(n,Te).children.splice(Be,1),i)for(var[it,vt]of Qe.points(i)){var ut=cr.transform(it,o);if(i!=null&&ut!=null)i[vt]=ut;else{var kt=void 0,Xt=void 0;for(var[qt,or]of St.texts(n)){if(je.compare(or,Te)!==-1){Xt=[qt,or];break}kt=[qt,or]}var ft=!1;kt&&Xt&&(ft=je.equals(Xt[1],Te)?!je.hasPrevious(Xt[1]):je.common(kt[1],Te).length2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1,mode:o="lowest"}=r,{at:a,match:s,select:l}=r;if(St.isNode(t)&&(t=[t]),t.length!==0){var[u]=t;if(a||(a=e.selection?e.selection:e.children.length>0?de.end(e,[]):[0],l=!0),l==null&&(l=!1),Qe.isRange(a))if(n||(a=de.unhangRange(e,a)),Qe.isCollapsed(a))a=a.anchor;else{var[,c]=Qe.edges(a),h=de.pointRef(e,c);Ve.delete(e,{at:a}),a=h.unref()}if(cr.isPoint(a)){s==null&&(s=Rt.isText(u)?Ee=>Rt.isText(Ee):e.isInline(u)?Ee=>Rt.isText(Ee)||de.isInline(e,Ee):Ee=>de.isBlock(e,Ee));var[S]=de.nodes(e,{at:a.path,match:s,mode:o,voids:i});if(!S)return;var[,y]=S,z=de.pathRef(e,y),F=de.isEnd(e,a,y);Ve.splitNodes(e,{at:a,match:s,mode:o,voids:i});var N=z.unref();a=F?je.next(N):N}var j=je.parent(a),D=a[a.length-1];if(i||!de.void(e,{at:j})){for(var Q of t){var te=j.concat(D);D++,e.apply({type:"insert_node",path:te,node:Q}),a=je.next(a)}if(a=je.previous(a),l){var he=de.end(e,a);he&&Ve.select(e,he)}}}})},liftNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{at:r=e.selection,mode:n="lowest",voids:i=!1}=t,{match:o}=t;if(o==null&&(o=je.isPath(r)?hc(e,r):Q=>de.isBlock(e,Q)),r){var a=de.nodes(e,{at:r,match:o,mode:n,voids:i}),s=Array.from(a,Q=>{var[,te]=Q;return de.pathRef(e,te)});for(var l of s){var u=l.unref();if(u.length<2)throw new Error("Cannot lift node at a path [".concat(u,"] because it has a depth of less than `2`."));var c=de.node(e,je.parent(u)),[h,S]=c,y=u[u.length-1],{length:z}=h.children;if(z===1){var F=je.next(S);Ve.moveNodes(e,{at:u,to:F,voids:i}),Ve.removeNodes(e,{at:S,voids:i})}else if(y===0)Ve.moveNodes(e,{at:u,to:S,voids:i});else if(y===z-1){var N=je.next(S);Ve.moveNodes(e,{at:u,to:N,voids:i})}else{var j=je.next(u),D=je.next(S);Ve.splitNodes(e,{at:j,voids:i}),Ve.moveNodes(e,{at:u,to:D,voids:i})}}}})},mergeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{match:r,at:n=e.selection}=t,{hanging:i=!1,voids:o=!1,mode:a="lowest"}=t;if(n){if(r==null)if(je.isPath(n)){var[s]=de.parent(e,n);r=Pe=>s.children.includes(Pe)}else r=Pe=>de.isBlock(e,Pe);if(!i&&Qe.isRange(n)&&(n=de.unhangRange(e,n)),Qe.isRange(n))if(Qe.isCollapsed(n))n=n.anchor;else{var[,l]=Qe.edges(n),u=de.pointRef(e,l);Ve.delete(e,{at:n}),n=u.unref(),t.at==null&&Ve.select(e,n)}var[c]=de.nodes(e,{at:n,match:r,voids:o,mode:a}),h=de.previous(e,{at:n,match:r,voids:o,mode:a});if(c&&h){var[S,y]=c,[z,F]=h;if(y.length!==0&&F.length!==0){var N,j,D=je.next(F),Q=je.common(y,F),te=je.isSibling(y,F),he=Array.from(de.levels(e,{at:y}),Pe=>{var[qe]=Pe;return qe}).slice(Q.length).slice(0,-1),Ee=de.above(e,{at:y,mode:"highest",match:Pe=>he.includes(Pe)&&GL(e,Pe)}),ve=Ee&&de.pathRef(e,Ee[1]);if(Rt.isText(S)&&Rt.isText(z)){var De=Da(S,mK);j=z.text.length,N=De}else{if(!Ut.isElement(S)||!Ut.isElement(z))throw new Error("Cannot merge the node at path [".concat(y,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(S)," ").concat(JSON.stringify(z)));De=Da(S,yK),j=z.children.length,N=De}te||Ve.moveNodes(e,{at:y,to:D,voids:o}),ve&&Ve.removeNodes(e,{at:ve.current,voids:o}),Ut.isElement(z)&&de.isEmpty(e,z)||Rt.isText(z)&&z.text===""&&F[F.length-1]!==0?Ve.removeNodes(e,{at:F,voids:o}):e.apply({type:"merge_node",path:D,position:j,properties:N}),ve&&ve.unref()}}}})},moveNodes(e,t){de.withoutNormalizing(e,()=>{var{to:r,at:n=e.selection,mode:i="lowest",voids:o=!1}=t,{match:a}=t;if(n){a==null&&(a=je.isPath(n)?hc(e,n):y=>de.isBlock(e,y));var s=de.pathRef(e,r),l=de.nodes(e,{at:n,match:a,mode:i,voids:o}),u=Array.from(l,y=>{var[,z]=y;return de.pathRef(e,z)});for(var c of u){var h=c.unref(),S=s.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:S}),s.current&&je.isSibling(S,h)&&je.isAfter(S,h)&&(s.current=je.next(s.current))}s.unref()}})},removeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:n=!1,mode:i="lowest"}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=je.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),!r&&Qe.isRange(o)&&(o=de.unhangRange(e,o));var s=de.nodes(e,{at:o,match:a,mode:i,voids:n}),l=Array.from(s,S=>{var[,y]=S;return de.pathRef(e,y)});for(var u of l){var c=u.unref();if(c){var[h]=de.node(e,c);e.apply({type:"remove_node",path:c,node:h})}}}})},setNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{match:n,at:i=e.selection}=r,{hanging:o=!1,mode:a="lowest",split:s=!1,voids:l=!1}=r;if(i){if(n==null&&(n=je.isPath(i)?hc(e,i):he=>de.isBlock(e,he)),!o&&Qe.isRange(i)&&(i=de.unhangRange(e,i)),s&&Qe.isRange(i)){if(Qe.isCollapsed(i)&&de.leaf(e,i.anchor)[0].text.length>0)return;var u=de.rangeRef(e,i,{affinity:"inward"}),[c,h]=Qe.edges(i),S=a==="lowest"?"lowest":"highest",y=de.isEnd(e,h,h.path);Ve.splitNodes(e,{at:h,match:n,mode:S,voids:l,always:!y});var z=de.isStart(e,c,c.path);Ve.splitNodes(e,{at:c,match:n,mode:S,voids:l,always:!z}),i=u.unref(),r.at==null&&Ve.select(e,i)}for(var[F,N]of de.nodes(e,{at:i,match:n,mode:a,voids:l})){var j={},D={};if(N.length!==0){var Q=!1;for(var te in t)te!=="children"&&te!=="text"&&t[te]!==F[te]&&(Q=!0,F.hasOwnProperty(te)&&(j[te]=F[te]),t[te]!=null&&(D[te]=t[te]));Q&&e.apply({type:"set_node",path:N,properties:j,newProperties:D})}}}})},splitNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection,height:a=0,always:s=!1}=t;if(i==null&&(i=dt=>de.isBlock(e,dt)),Qe.isRange(o)&&(o=EK(e,o)),je.isPath(o)){var l=o,u=de.point(e,l),[c]=de.parent(e,l);i=dt=>dt===c,a=u.path.length-l.length+1,o=u,s=!0}if(o){var h=de.pointRef(e,o,{affinity:"backward"}),[S]=de.nodes(e,{at:o,match:i,mode:r,voids:n});if(S){var y=de.void(e,{at:o,mode:"highest"});if(!n&&y){var[z,F]=y;if(Ut.isElement(z)&&e.isInline(z)){var N=de.after(e,F);if(!N){var j=je.next(F);Ve.insertNodes(e,{text:""},{at:j,voids:n}),N=de.point(e,j)}o=N,s=!0}a=o.path.length-F.length+1,s=!0}var D=de.pointRef(e,o),Q=o.path.length-a,[,te]=S,he=o.path.slice(0,Q),Ee=a===0?o.offset:o.path[Q]+0;for(var[ve,De]of de.levels(e,{at:he,reverse:!0,voids:n})){var Pe=!1;if(De.length2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var n={};for(var i of t)n[i]=null;Ve.setNodes(e,n,r)},unwrapNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",split:n=!1,voids:i=!1}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=je.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),je.isPath(o)&&(o=de.range(e,o));var s=Qe.isRange(o)?de.rangeRef(e,o):null,l=de.nodes(e,{at:o,match:a,mode:r,voids:i}),u=Array.from(l,S=>{var[,y]=S;return de.pathRef(e,y)}).reverse(),c=function(S){var y=S.unref(),[z]=de.node(e,y),F=de.range(e,y);n&&s&&(F=Qe.intersection(s.current,F)),Ve.liftNodes(e,{at:F,match:N=>Ut.isAncestor(z)&&z.children.includes(N),voids:i})};for(var h of u)c(h);s&&s.unref()}})},wrapNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{mode:n="lowest",split:i=!1,voids:o=!1}=r,{match:a,at:s=e.selection}=r;if(s){if(a==null&&(a=je.isPath(s)?hc(e,s):e.isInline(t)?N=>de.isInline(e,N)||Rt.isText(N):N=>de.isBlock(e,N)),i&&Qe.isRange(s)){var[l,u]=Qe.edges(s),c=de.rangeRef(e,s,{affinity:"inward"});Ve.splitNodes(e,{at:u,match:a,voids:o}),Ve.splitNodes(e,{at:l,match:a,voids:o}),s=c.unref(),r.at==null&&Ve.select(e,s)}var h=Array.from(de.nodes(e,{at:s,match:e.isInline(t)?N=>de.isBlock(e,N):N=>de.isEditor(N),mode:"lowest",voids:o}));for(var[,S]of h){var y=Qe.isRange(s)?Qe.intersection(s,de.range(e,S)):s;if(y){var z=Array.from(de.nodes(e,{at:y,match:a,mode:n,voids:o}));if(z.length>0){var F=function(){var[N]=z,j=z[z.length-1],[,D]=N,[,Q]=j;if(D.length===0&&Q.length===0)return"continue";var te=je.equals(D,Q)?je.parent(D):je.common(D,Q),he=de.range(e,D,Q),Ee=de.node(e,te),[ve]=Ee,De=te.length+1,Pe=je.next(Q.slice(0,De)),qe=WL(WL({},t),{},{children:[]});Ve.insertNodes(e,qe,{at:Pe,voids:o}),Ve.moveNodes(e,{at:he,match:ot=>Ut.isAncestor(ve)&&ve.children.includes(ot),to:Pe.concat(0),voids:o})}();if(F==="continue")continue}}}}})}},GL=(e,t)=>{if(Ut.isElement(t)){var r=t;return!!de.isVoid(e,t)||r.children.length===1&&GL(e,r.children[0])}return!de.isEditor(t)},EK=(e,t)=>{if(Qe.isCollapsed(t))return t.anchor;var[,r]=Qe.edges(t),n=de.pointRef(e,r);return Ve.delete(e,{at:t}),n.unref()},hc=(e,t)=>{var[r]=de.node(e,t);return n=>n===r};function VL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=t,{selection:n}=e;if(n){if(r==="anchor")Ve.select(e,n.anchor);else if(r==="focus")Ve.select(e,n.focus);else if(r==="start"){var[i]=Qe.edges(n);Ve.select(e,i)}else if(r==="end"){var[,o]=Qe.edges(n);Ve.select(e,o)}}},deselect(e){var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},move(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e,{distance:n=1,unit:i="character",reverse:o=!1}=t,{edge:a=null}=t;if(r){a==="start"&&(a=Qe.isBackward(r)?"focus":"anchor"),a==="end"&&(a=Qe.isBackward(r)?"anchor":"focus");var{anchor:s,focus:l}=r,u={distance:n,unit:i},c={};if(a==null||a==="anchor"){var h=o?de.before(e,s,u):de.after(e,s,u);h&&(c.anchor=h)}if(a==null||a==="focus"){var S=o?de.before(e,l,u):de.after(e,l,u);S&&(c.focus=S)}Ve.setSelection(e,c)}},select(e,t){var{selection:r}=e;if(t=de.range(e,t),r)Ve.setSelection(e,t);else{if(!Qe.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(t)));e.apply({type:"set_selection",properties:r,newProperties:t})}},setPoint(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n}=e,{edge:i="both"}=r;if(n){i==="start"&&(i=Qe.isBackward(n)?"focus":"anchor"),i==="end"&&(i=Qe.isBackward(n)?"anchor":"focus");var{anchor:o,focus:a}=n,s=i==="anchor"?o:a;Ve.setSelection(e,{[i==="anchor"?"anchor":"focus"]:KL(KL({},s),t)})}},setSelection(e,t){var{selection:r}=e,n={},i={};if(r){for(var o in t)(o==="anchor"&&t.anchor!=null&&!cr.equals(t.anchor,r.anchor)||o==="focus"&&t.focus!=null&&!cr.equals(t.focus,r.focus)||o!=="anchor"&&o!=="focus"&&t[o]!==r[o])&&(n[o]=r[o],i[o]=t[o]);Object.keys(n).length>0&&e.apply({type:"set_selection",properties:n,newProperties:i})}}},SK={delete(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{reverse:r=!1,unit:n="character",distance:i=1,voids:o=!1}=t,{at:a=e.selection,hanging:s=!1}=t;if(a){if(Qe.isRange(a)&&Qe.isCollapsed(a)&&(a=a.anchor),cr.isPoint(a)){var l=de.void(e,{at:a,mode:"highest"});if(!o&&l){var[,u]=l;a=u}else{var c={unit:n,distance:i};a={anchor:a,focus:r?de.before(e,a,c)||de.start(e,[]):de.after(e,a,c)||de.end(e,[])},s=!0}}if(je.isPath(a))Ve.removeNodes(e,{at:a,voids:o});else if(!Qe.isCollapsed(a)){if(!s){var[,h]=Qe.edges(a),S=de.end(e,[]);cr.equals(h,S)||(a=de.unhangRange(e,a,{voids:o}))}var[y,z]=Qe.edges(a),F=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:y,voids:o}),N=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:z,voids:o}),j=F&&N&&!je.equals(F[1],N[1]),D=je.equals(y.path,z.path),Q=o?null:de.void(e,{at:y,mode:"highest"}),te=o?null:de.void(e,{at:z,mode:"highest"});if(Q){var he=de.before(e,y);he&&F&&je.isAncestor(F[1],he.path)&&(y=he)}if(te){var Ee=de.after(e,z);Ee&&N&&je.isAncestor(N[1],Ee.path)&&(z=Ee)}var ve,De=[];for(var Pe of de.nodes(e,{at:a,voids:o})){var[qe,ot]=Pe;ve&&je.compare(ot,ve)===0||(!o&&de.isVoid(e,qe)||!je.isCommon(ot,y.path)&&!je.isCommon(ot,z.path))&&(De.push(Pe),ve=ot)}var et=Array.from(De,Xt=>{var[,qt]=Xt;return de.pathRef(e,qt)}),gt=de.pointRef(e,y),dt=de.pointRef(e,z);if(!D&&!Q){var ht=gt.current,[pt]=de.leaf(e,ht),{path:Dt}=ht,{offset:Ft}=y,Bt=pt.text.slice(Ft);Bt.length>0&&e.apply({type:"remove_text",path:Dt,offset:Ft,text:Bt})}for(var It of et){var Re=It.unref();Ve.removeNodes(e,{at:Re,voids:o})}if(!te){var Te=dt.current,[Be]=de.leaf(e,Te),{path:it}=Te,vt=D?y.offset:0,ut=Be.text.slice(vt,z.offset);ut.length>0&&e.apply({type:"remove_text",path:it,offset:vt,text:ut})}!D&&j&&dt.current&>.current&&Ve.mergeNodes(e,{at:dt.current,hanging:!0,voids:o});var kt=r?gt.unref()||dt.unref():dt.unref()||gt.unref();t.at==null&&kt&&Ve.select(e,kt)}}})},insertFragment(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1}=r,{at:o=e.selection}=r;if(t.length&&o){if(Qe.isRange(o))if(n||(o=de.unhangRange(e,o)),Qe.isCollapsed(o))o=o.anchor;else{var[,a]=Qe.edges(o);if(!i&&de.void(e,{at:a}))return;var s=de.pointRef(e,a);Ve.delete(e,{at:o}),o=s.unref()}else je.isPath(o)&&(o=de.start(e,o));if(i||!de.void(e,{at:o})){var l=de.above(e,{at:o,match:Te=>de.isInline(e,Te),mode:"highest",voids:i});if(l){var[,u]=l;de.isEnd(e,o,u)?o=de.after(e,u):de.isStart(e,o,u)&&(o=de.before(e,u))}var c=de.above(e,{match:Te=>de.isBlock(e,Te),at:o,voids:i}),[,h]=c,S=de.isStart(e,o,h),y=de.isEnd(e,o,h),z=S&&y,F=!S||S&&y,N=!y,[,j]=St.first({children:t},[]),[,D]=St.last({children:t},[]),Q=[],te=Te=>{var[Be,it]=Te;return!(it.length===0)&&(!!z||!(F&&je.isAncestor(it,j)&&Ut.isElement(Be)&&!e.isVoid(Be)&&!e.isInline(Be))&&!(N&&je.isAncestor(it,D)&&Ut.isElement(Be)&&!e.isVoid(Be)&&!e.isInline(Be)))};for(var he of St.nodes({children:t},{pass:te}))te(he)&&Q.push(he);var Ee=[],ve=[],De=[],Pe=!0,qe=!1;for(var[ot]of Q)Ut.isElement(ot)&&!e.isInline(ot)?(Pe=!1,qe=!0,ve.push(ot)):Pe?Ee.push(ot):De.push(ot);var[et]=de.nodes(e,{at:o,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),[,gt]=et,dt=de.isStart(e,o,gt),ht=de.isEnd(e,o,gt),pt=de.pathRef(e,y?je.next(h):h),Dt=de.pathRef(e,ht?je.next(gt):gt),Ft=de.pathRef(e,h);Ve.splitNodes(e,{at:o,match:Te=>qe?de.isBlock(e,Te):Rt.isText(Te)||de.isInline(e,Te),mode:qe?"lowest":"highest",voids:i});var Bt=de.pathRef(e,!dt||dt&&ht?je.next(gt):gt);if(Ve.insertNodes(e,Ee,{at:Bt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),z&&ve.length&&Ve.delete(e,{at:Ft.unref(),voids:i}),Ve.insertNodes(e,ve,{at:pt.current,match:Te=>de.isBlock(e,Te),mode:"lowest",voids:i}),Ve.insertNodes(e,De,{at:Dt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),!r.at){var It;It=De.length>0?je.previous(Dt.current):ve.length>0?je.previous(pt.current):je.previous(Bt.current);var Re=de.end(e,It);Ve.select(e,Re)}Bt.unref(),pt.unref(),Dt.unref()}}})},insertText(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:i=e.selection}=r;if(i){if(je.isPath(i)&&(i=de.range(e,i)),Qe.isRange(i))if(Qe.isCollapsed(i))i=i.anchor;else{var o=Qe.end(i);if(!n&&de.void(e,{at:o}))return;var a=de.pointRef(e,o);Ve.delete(e,{at:i,voids:n}),i=a.unref(),Ve.setSelection(e,{anchor:i,focus:i})}if(n||!de.void(e,{at:i})){var{path:s,offset:l}=i;t.length>0&&e.apply({type:"insert_text",path:s,offset:l,text:t})}}})}};function $L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Iv(e){for(var t=1;t-1&&e%1==0&&e-1&&t%1==0&&t<=9007199254740991}(e.length)&&!iP(e)}function iP(e){var t=oP(e)?_h.call(e):"";return t=="[object Function]"||t=="[object GeneratorFunction]"}function oP(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function aP(e){return!!e&&typeof e=="object"}function YK(e){return e?LK(e,function(t){return ex(t)?VK(t):$K(t)}(e)):[]}var sP=function(e){if(!e)return[];if(ex(e))return function(r){return typeof r=="string"||!nP(r)&&aP(r)&&_h.call(r)=="[object String]"}(e)?MK(e):function(r,n){var i=-1,o=r.length;for(n||(n=Array(o));++i0&&tx(e[r],t[r])})}var uP={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function kh(){var e=typeof document!="undefined"?document:{};return tx(e,uP),e}var ZK={document:uP,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return typeof setTimeout=="undefined"?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){typeof setTimeout!="undefined"&&clearTimeout(e)}};function Ul(){var e=typeof window!="undefined"?window:{};return tx(e,ZK),e}function rx(e){return rx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},rx(e)}function Fv(e,t){return Fv=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},Fv(e,t)}function JK(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function nx(e,t,r){return nx=JK()?Reflect.construct:function(n,i,o){var a=[null];a.push.apply(a,i);var s=new(Function.bind.apply(n,a));return o&&Fv(s,o.prototype),s},nx.apply(null,arguments)}function ix(e){var t=typeof Map=="function"?new Map:void 0;return ix=function(r){if(r===null||!function(i){return Function.toString.call(i).indexOf("[native code]")!==-1}(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return nx(r,arguments,rx(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fv(n,r)},ix(e)}var ls=function(e){var t,r;function n(i){var o,a,s;return o=e.call.apply(e,[this].concat(i))||this,a=function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(o),s=a.__proto__,Object.defineProperty(a,"__proto__",{get:function(){return s},set:function(l){s.__proto__=l}}),o}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(ix(Array));function Nv(e){e===void 0&&(e=[]);var t=[];return e.forEach(function(r){Array.isArray(r)?t.push.apply(t,Nv(r)):t.push(r)}),t}function cP(e,t){return Array.prototype.filter.call(e,t)}function _e(e,t){var r=Ul(),n=kh(),i=[];if(!t&&e instanceof ls)return e;if(!e)return new ls(i);if(typeof e=="string"){var o=e.trim();if(o.indexOf("<")>=0&&o.indexOf(">")>=0){var a="div";o.indexOf("0}).length>0}function no(e,t){if(arguments.length===1&&typeof e=="string")return this[0]?this[0].getAttribute(e):void 0;for(var r=0;r=0&&(r[t=o.name.split("data-")[1],t.toLowerCase().replace(/-(.)/g,function(s,l){return l.toUpperCase()})]=o.value)}for(var a in r)r[a]==="false"?r[a]=!1:r[a]==="true"?r[a]=!0:parseFloat(r[a])===1*r[a]&&(r[a]*=1);return r}}function Yo(e){if(e===void 0){var t=this[0];if(!t)return;if(t.multiple&&t.nodeName.toLowerCase()==="select"){for(var r=[],n=0;n=0;else o.value=e}return this}function Zo(){for(var e=arguments.length,t=new Array(e),r=0;r=0;y-=1){var z=S[y];o&&z.listener===o||o&&z.listener&&z.listener.dom7proxy&&z.listener.dom7proxy===o?(h.removeEventListener(u,z.proxyListener,a),S.splice(y,1)):o||(h.removeEventListener(u,z.proxyListener,a),S.splice(y,1))}}return this}function Uv(){var e=Ul();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Hv(){var e=Ul();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function hP(){if(this.length>0){var e=Ul(),t=kh(),r=this[0],n=r.getBoundingClientRect(),i=t.body,o=r.clientTop||i.clientTop||0,a=r.clientLeft||i.clientLeft||0,s=r===e?e.scrollY:r.scrollTop,l=r===e?e.scrollX:r.scrollLeft;return{top:n.top+s-o,left:n.left+l-a}}return null}function mc(){for(var e=0;e=0;r-=1)this[t].insertBefore(i.childNodes[r],this[t].childNodes[0])}else if(e instanceof ls)for(r=0;r-1&&e%1==0&&e-1&&t%1==0&&t<=9007199254740991}(e.length)&&!function(t){var r=function(n){var i=typeof n;return!!n&&(i=="object"||i=="function")}(t)?yP.call(t):"";return r=="[object Function]"||r==qK}(e)}function u$(e){return ax(e)?i$(e):s$(e)}function c$(e){return e}var sx=function(e,t){return(xP(e)?t$:o$)(e,typeof t=="function"?t:c$)};let SP=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t};var d$=/^\s+|\s+$/g,h$=/^[-+]0x[0-9a-f]+$/i,f$=/^0b[01]+$/i,p$=/^0o[0-7]+$/i,g$=parseInt,v$=typeof re=="object"&&re&&re.Object===Object&&re,m$=typeof self=="object"&&self&&self.Object===Object&&self,y$=v$||m$||Function("return this")(),b$=Object.prototype.toString,E$=Math.max,x$=Math.min,lx=function(){return y$.Date.now()};function S$(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function z(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function F(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=lx();if(F(Q))return j(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?x$(he,o-(te-u)):he}(Q))}function j(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=lx(),te=F(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return z(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=wP(t)||0,Xv(r)&&(c=!!r.leading,o=(h="maxWait"in r)?E$(wP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:j(lx())},D}function Xv(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&b$.call(n)=="[object Symbol]"}(e))return NaN;if(Xv(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xv(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(d$,"");var r=f$.test(e);return r||p$.test(e)?g$(e.slice(2),r?2:8):h$.test(e)?NaN:+e}var Hl=function(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError("Expected a function");return Xv(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),S$(e,t,{leading:n,maxWait:t,trailing:i})};const w$={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,r){return document.createElementNS(e,t,r)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,r){e.insertBefore(t,r)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return e.nodeType===1},isText:function(e){return e.nodeType===3},isComment:function(e){return e.nodeType===8}};function Lh(e,t,r,n,i){return{sel:e,data:t,children:r,text:n,elm:i,key:t===void 0?void 0:t.key}}const ux=Array.isArray;function Yv(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function cx(e){return e===void 0}function Hi(e){return e!==void 0}const CP=Lh("",{},[],void 0,void 0);function Ph(e,t){var r,n;const i=e.key===t.key,o=((r=e.data)===null||r===void 0?void 0:r.is)===((n=t.data)===null||n===void 0?void 0:n.is);return e.sel===t.sel&&i&&o}function C$(e,t,r){var n;const i={};for(let o=t;o<=r;++o){const a=(n=e[o])===null||n===void 0?void 0:n.key;a!==void 0&&(i[a]=o)}return i}const T$=["create","update","remove","destroy","pre","post"];function A$(e,t){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=t!==void 0?t:w$;for(const h of T$)for(const S of e){const y=S[h];y!==void 0&&r[h].push(y)}function i(h){const S=h.id?"#"+h.id:"",y=h.getAttribute("class"),z=y?"."+y.split(" ").join("."):"";return Lh(n.tagName(h).toLowerCase()+S+z,{},[],void 0,h)}function o(h,S){return function(){if(--S==0){const y=n.parentNode(h);n.removeChild(y,h)}}}function a(h,S){var y,z;let F,N=h.data;if(N!==void 0){const Q=(y=N.hook)===null||y===void 0?void 0:y.init;Hi(Q)&&(Q(h),N=h.data)}const j=h.children,D=h.sel;if(D==="!")cx(h.text)&&(h.text=""),h.elm=n.createComment(h.text);else if(D!==void 0){const Q=D.indexOf("#"),te=D.indexOf(".",Q),he=Q>0?Q:D.length,Ee=te>0?te:D.length,ve=Q!==-1||te!==-1?D.slice(0,Math.min(he,Ee)):D,De=h.elm=Hi(N)&&Hi(F=N.ns)?n.createElementNS(F,ve,N):n.createElement(ve,N);for(he0&&De.setAttribute("class",D.slice(Ee+1).replace(/\./g," ")),F=0;FDt?(dt=Pe[It+1]==null?null:Pe[It+1].elm,s(ve,dt,Pe,pt,It,qe)):u(ve,De,ht,Dt))}(te,he,Ee,y):Hi(Ee)?(Hi(h.text)&&n.setTextContent(te,""),s(te,null,Ee,0,Ee.length-1,y)):Hi(he)?u(te,he,0,he.length-1):Hi(h.text)&&n.setTextContent(te,""):h.text!==S.text&&(Hi(he)&&u(te,he,0,he.length-1),n.setTextContent(te,S.text)),(D=Q==null?void 0:Q.postpatch)===null||D===void 0||D.call(Q,h,S)}}return function(h,S){let y,z,F;const N=[];for(y=0;y=n?e:function(i,o,a){var s=-1,l=i.length;o<0&&(o=-o>l?0:l+o),(a=a>l?l:a)<0&&(a+=l),l=o>a?0:a-o>>>0,o>>>=0;for(var u=Array(l);++s1;Q&&(D=D.slice(0,-1));var te=QP(D),he=mx[te];if(D.length>1&&!he&&!ZP[D]&&!yx[te])throw new TypeError('Unknown modifier: "'+D+'"');h!==1&&he||(l?u.key=te:u.which=aX(D)),he&&(u[he]=!Q||null)}}catch(Ee){z=!0,F=Ee}finally{try{!y&&j.return&&j.return()}finally{if(z)throw F}}return u}(o,t)}),i=function(o){return n.some(function(a){return function(s,l){for(var u in s){var c=s[u],h=void 0;if(c!=null&&((h=u==="key"&&l.key!=null?l.key.toLowerCase():u==="which"?c===91&&l.which===93?91:l.which:l[u])!=null||c!==!1)&&h!==c)return!1}return!0}(a,o)})};return r==null?i:i(r)}function aX(e){return e=QP(e),yx[e]||e.toUpperCase().charCodeAt(0)}function QP(e){return e=e.toLowerCase(),e=ZP[e]||e}var sX=JP,bx=function(e,t){return JP(e,{byKey:!0},t)},lX=/^\s+|\s+$/g,uX=/^[-+]0x[0-9a-f]+$/i,cX=/^0b[01]+$/i,dX=/^0o[0-7]+$/i,hX=parseInt,fX=typeof re=="object"&&re&&re.Object===Object&&re,pX=typeof self=="object"&&self&&self.Object===Object&&self,gX=fX||pX||Function("return this")(),vX=Object.prototype.toString,mX=Math.max,yX=Math.min,Ex=function(){return gX.Date.now()};function xx(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&vX.call(n)=="[object Symbol]"}(e))return NaN;if(xx(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xx(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(lX,"");var r=cX.test(e);return r||dX.test(e)?hX(e.slice(2),r?2:8):uX.test(e)?NaN:+e}var Tc,eI=function(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function z(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function F(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=Ex();if(F(Q))return j(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?yX(he,o-(te-u)):he}(Q))}function j(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=Ex(),te=F(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return z(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=qP(t)||0,xx(r)&&(c=!!r.leading,o=(h="maxWait"in r)?mX(qP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:j(Ex())},D},tI=oe(function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",u="[object Map]",c="[object Number]",h="[object Object]",S="[object Promise]",y="[object RegExp]",z="[object Set]",F="[object String]",N="[object Symbol]",j="[object WeakMap]",D="[object ArrayBuffer]",Q="[object DataView]",te="[object Float32Array]",he="[object Float64Array]",Ee="[object Int8Array]",ve="[object Int16Array]",De="[object Int32Array]",Pe="[object Uint8Array]",qe="[object Uint8ClampedArray]",ot="[object Uint16Array]",et="[object Uint32Array]",gt=/\w*$/,dt=/^\[object .+?Constructor\]$/,ht=/^(?:0|[1-9]\d*)$/,pt={};pt[i]=pt["[object Array]"]=pt[D]=pt[Q]=pt[o]=pt[a]=pt[te]=pt[he]=pt[Ee]=pt[ve]=pt[De]=pt[u]=pt[c]=pt[h]=pt[y]=pt[z]=pt[F]=pt[N]=pt[Pe]=pt[qe]=pt[ot]=pt[et]=!0,pt["[object Error]"]=pt[s]=pt[j]=!1;var Dt=typeof re=="object"&&re&&re.Object===Object&&re,Ft=typeof self=="object"&&self&&self.Object===Object&&self,Bt=Dt||Ft||Function("return this")(),It=t&&!t.nodeType&&t,Re=It&&e&&!e.nodeType&&e,Te=Re&&Re.exports===It;function Be(Le,rt){return Le.set(rt[0],rt[1]),Le}function it(Le,rt){return Le.add(rt),Le}function vt(Le,rt,Ct,Mt){var xr=-1,tn=Le?Le.length:0;for(Mt&&tn&&(Ct=Le[++xr]);++xr-1},To.prototype.set=function(Le,rt){var Ct=this.__data__,Mt=qi(Ct,Le);return Mt<0?Ct.push([Le,rt]):Ct[Mt][1]=rt,this},Xa.prototype.clear=function(){this.__data__={hash:new Go,map:new(mi||To),string:new Go}},Xa.prototype.delete=function(Le){return Za(this,Le).delete(Le)},Xa.prototype.get=function(Le){return Za(this,Le).get(Le)},Xa.prototype.has=function(Le){return Za(this,Le).has(Le)},Xa.prototype.set=function(Le,rt){return Za(this,Le).set(Le,rt),this},Vo.prototype.clear=function(){this.__data__=new To},Vo.prototype.delete=function(Le){return this.__data__.delete(Le)},Vo.prototype.get=function(Le){return this.__data__.get(Le)},Vo.prototype.has=function(Le){return this.__data__.has(Le)},Vo.prototype.set=function(Le,rt){var Ct=this.__data__;if(Ct instanceof To){var Mt=Ct.__data__;if(!mi||Mt.length<199)return Mt.push([Le,rt]),this;Ct=this.__data__=new Xa(Mt)}return Ct.set(Le,rt),this};var $g=Yu?Xt(Yu,Object):function(){return[]},Ea=function(Le){return Ar.call(Le)};function Qb(Le,rt){return!!(rt=rt==null?n:rt)&&(typeof Le=="number"||ht.test(Le))&&Le>-1&&Le%1==0&&Le-1&&rt%1==0&&rt<=n}(Le.length)&&!Kt(Le)}var Et=Wo||function(){return!1};function Kt(Le){var rt=zr(Le)?Ar.call(Le):"";return rt==s||rt==l}function zr(Le){var rt=typeof Le;return!!Le&&(rt=="object"||rt=="function")}function mr(Le){return Ze(Le)?El(Le):function(rt){if(!xl(rt))return ya(rt);var Ct=[];for(var Mt in Object(rt))yn.call(rt,Mt)&&Mt!="constructor"&&Ct.push(Mt);return Ct}(Le)}e.exports=function(Le){return Kg(Le,!0,!0)}});function rI(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var bX=0;function EX(e){return"__private_"+bX+++"_"+e}function xX(e,t,r){const n=[];return e.forEach(i=>typeof i!="string"?n.push(i):t[Symbol.split](i).forEach((o,a,s)=>{o!==""&&n.push(o),a2&&arguments[2]!==void 0?arguments[2]:{},n=de.path(e,t,r),i=Ue.parent(n);return de.node(e,i)},path(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:n,edge:i}=r;if(Ue.isPath(t)){if(i==="start"){var[,o]=St.first(e,t);t=o}else if(i==="end"){var[,a]=St.last(e,t);t=a}}return Je.isRange(t)&&(t=i==="start"?Je.start(t):i==="end"?Je.end(t):Ue.common(t.anchor.path,t.focus.path)),cr.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},hasPath:(e,t)=>St.has(e,t),pathRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pathRefs(e).delete(i),i.current=null,o}};return de.pathRefs(e).add(i),i},pathRefs(e){var t=DL.get(e);return t||(t=new Set,DL.set(e,t)),t},point(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:n="start"}=r;if(Ue.isPath(t)){var i;if(n==="end"){var[,o]=St.last(e,t);i=o}else{var[,a]=St.first(e,t);i=a}var s=St.get(e,i);if(!Rt.isText(s))throw new Error("Cannot get the ".concat(n," point in the node at path [").concat(t,"] because it has no ").concat(n," text node."));return{path:i,offset:n==="end"?s.text.length:0}}if(Je.isRange(t)){var[l,u]=Je.edges(t);return n==="start"?l:u}return t},pointRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.pointRefs(e).delete(i),i.current=null,o}};return de.pointRefs(e).add(i),i},pointRefs(e){var t=OL.get(e);return t||(t=new Set,OL.set(e,t)),t},*positions(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=e.selection,unit:n="offset",reverse:i=!1,voids:o=!1}=t;if(r){var a=de.range(e,r),[s,l]=Je.edges(a),u=i?l:s,c=!1,h="",S=0,y=0,W=0;for(var[F,N]of de.nodes(e,{at:r,reverse:i,voids:o})){if(Ut.isElement(F)){if(!o&&e.isVoid(F)){yield de.start(e,N);continue}if(e.isInline(F))continue;if(de.hasInlines(e,F)){var j=Ue.isAncestor(N,l.path)?l:de.end(e,N),D=Ue.isAncestor(N,s.path)?s:de.start(e,N);h=de.string(e,{anchor:D,focus:j},{voids:o}),c=!0}}if(Rt.isText(F)){var Q=Ue.equals(N,u.path);for(Q?(y=i?u.offset:F.text.length-u.offset,W=u.offset):(y=F.text.length,W=i?y:0),(Q||c||n==="offset")&&(yield{path:N,offset:W},c=!1);;){if(S===0){if(h==="")break;S=te(h,n,i),h=zE(h,S,i)[1]}if(W=i?W-S:W+S,(y-=S)<0){S=-y;break}S=0,yield{path:N,offset:W}}}}}function te(he,Ee,ve){return Ee==="character"?HE(he,ve):Ee==="word"?function(De){for(var Pe=arguments.length>1&&arguments[1]!==void 0&&arguments[1],qe=0,ot=!1;De.length>0;){var et=HE(De,Pe),[gt,dt]=zE(De,et,Pe);if(jV(gt,dt,Pe))ot=!0,qe+=et;else{if(ot)break;qe+=et}De=dt}return qe}(he,ve):Ee==="line"||Ee==="block"?he.length:1}},previous(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection}=t;if(o){var a=de.before(e,o,{voids:n});if(a){var[,s]=de.first(e,[]),l=[a.path,s];if(Ue.isPath(o)&&o.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(Ue.isPath(o)){var[u]=de.parent(e,o);i=h=>u.children.includes(h)}else i=()=>!0;var[c]=de.nodes(e,{reverse:!0,at:l,match:i,mode:r,voids:n});return c}}},range:(e,t,r)=>Je.isRange(t)&&!r?t:{anchor:de.start(e,t),focus:de.end(e,r||t)},rangeRef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,i={current:t,affinity:n,unref(){var{current:o}=i;return de.rangeRefs(e).delete(i),i.current=null,o}};return de.rangeRefs(e).add(i),i},rangeRefs(e){var t=_L.get(e);return t||(t=new Set,_L.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){AL.set(e,t)},start:(e,t)=>de.point(e,t,{edge:"start"}),string(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,i=de.range(e,t),[o,a]=Je.edges(i),s="";for(var[l,u]of de.nodes(e,{at:i,match:Rt.isText,voids:n})){var c=l.text;Ue.equals(u,a.path)&&(c=c.slice(0,a.offset)),Ue.equals(u,o.path)&&(c=c.slice(o.offset)),s+=c}return s},unhangRange(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,[i,o]=Je.edges(t);if(i.offset!==0||o.offset!==0||Je.isCollapsed(t))return t;var a=de.above(e,{at:o,match:S=>de.isBlock(e,S)}),s=a?a[1]:[],l={anchor:de.start(e,[]),focus:o},u=!0;for(var[c,h]of de.nodes(e,{at:l,match:Rt.isText,reverse:!0,voids:n}))if(u)u=!1;else if(c.text!==""||Ue.isBefore(h,s)){o={path:h,offset:c.text.length};break}return{anchor:i,focus:o}},void(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return de.above(e,dc(dc({},t),{},{match:r=>de.isVoid(e,r)}))},withoutNormalizing(e,t){var r=de.isNormalizing(e);de.setNormalizing(e,!1);try{t()}finally{de.setNormalizing(e,r)}de.normalize(e)}},Uye={isLocation:e=>Ue.isPath(e)||cr.isPoint(e)||Je.isRange(e)},sK={isSpan:e=>Array.isArray(e)&&e.length===2&&e.every(Ue.isPath)},lK=["children"],uK=["text"],IL=new WeakMap,St={ancestor(e,t){var r=St.get(e,t);if(Rt.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(r));return r},*ancestors(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of Ue.ancestors(t,r)){var i=[St.ancestor(e,n),n];yield i}},child(e,t){if(Rt.isText(e))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(e)));var r=e.children[t];if(r==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(JSON.stringify(e)));return r},*children(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{reverse:n=!1}=r,i=St.ancestor(e,t),{children:o}=i,a=n?o.length-1:0;n?a>=0:a1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))n.length!==0&&(yield[r,n])},*elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Ut.isElement(r)&&(yield[r,n])},extractProps:e=>Ut.isAncestor(e)?Da(e,lK):Da(e,uK),first(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Rt.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(e)));var r=kv({children:e.children},n=>{var[i,o]=Je.edges(t),a=St.nodes(n,{reverse:!0,pass:S=>{var[,y]=S;return!Je.includes(t,y)}});for(var[,s]of a){if(!Je.includes(t,s)){var l=St.parent(n,s),u=s[s.length-1];l.children.splice(u,1)}if(Ue.equals(s,o.path)){var c=St.leaf(n,s);c.text=c.text.slice(0,o.offset)}if(Ue.equals(s,i.path)){var h=St.leaf(n,s);h.text=h.text.slice(i.offset)}}de.isEditor(n)&&(n.selection=null)});return r.children},get(e,t){for(var r=e,n=0;nRt.isText(e)||Ut.isElement(e)||de.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=IL.get(e);if(t!==void 0)return t;var r=e.every(n=>St.isNode(n));return IL.set(e,r),r},last(e,t){for(var r=t.slice(),n=St.get(e,r);n&&!Rt.isText(n)&&n.children.length!==0;){var i=n.children.length-1;n=n.children[i],r.push(i)}return[n,r]},leaf(e,t){var r=St.get(e,t);if(!Rt.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(r));return r},*levels(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var n of Ue.levels(t,r)){var i=St.get(e,n);yield[i,n]}},matches:(e,t)=>Ut.isElement(e)&&Ut.isElementProps(t)&&Ut.matches(e,t)||Rt.isText(e)&&Rt.isTextProps(t)&&Rt.matches(e,t),*nodes(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{pass:r,reverse:n=!1}=t,{from:i=[],to:o}=t,a=new Set,s=[],l=e;!o||!(n?Ue.isBefore(s,o):Ue.isAfter(s,o));)if(a.has(l)||(yield[l,s]),a.has(l)||Rt.isText(l)||l.children.length===0||r!=null&&r([l,s])!==!1){if(s.length===0)break;if(!n){var u=Ue.next(s);if(St.has(e,u)){s=u,l=St.get(e,s);continue}}n&&s[s.length-1]!==0?(s=Ue.previous(s),l=St.get(e,s)):(s=Ue.parent(s),l=St.get(e,s),a.add(l))}else{a.add(l);var c=n?l.children.length-1:0;Ue.isAncestor(s,i)&&(c=i[s.length]),s=s.concat(c),l=St.get(e,s)}},parent(e,t){var r=Ue.parent(t),n=St.get(e,r);if(Rt.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Rt.isText(e)?e.text:e.children.map(St.string).join(""),*texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,n]of St.nodes(e,t))Rt.isText(r)&&(yield[r,n])}};function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;tss.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!ci(e))return!1;switch(e.type){case"insert_node":case"remove_node":return Ue.isPath(e.path)&&St.isNode(e.node);case"insert_text":case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&Ue.isPath(e.path);case"merge_node":return typeof e.position=="number"&&Ue.isPath(e.path)&&ci(e.properties);case"move_node":return Ue.isPath(e.path)&&Ue.isPath(e.newPath);case"set_node":return Ue.isPath(e.path)&&ci(e.properties)&&ci(e.newProperties);case"set_selection":return e.properties===null&&Je.isRange(e.newProperties)||e.newProperties===null&&Je.isRange(e.properties)||ci(e.properties)&&ci(e.newProperties);case"split_node":return Ue.isPath(e.path)&&typeof e.position=="number"&&ci(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(t=>ss.isOperation(t)),isSelectionOperation:e=>ss.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ss.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return _n(_n({},e),{},{type:"remove_node"});case"insert_text":return _n(_n({},e),{},{type:"remove_text"});case"merge_node":return _n(_n({},e),{},{type:"split_node",path:Ue.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(Ue.equals(t,r))return e;if(Ue.isSibling(r,t))return _n(_n({},e),{},{path:t,newPath:r});var n=Ue.transform(r,e),i=Ue.transform(Ue.next(r),e);return _n(_n({},e),{},{path:n,newPath:i});case"remove_node":return _n(_n({},e),{},{type:"insert_node"});case"remove_text":return _n(_n({},e),{},{type:"insert_text"});case"set_node":var{properties:o,newProperties:a}=e;return _n(_n({},e),{},{properties:a,newProperties:o});case"set_selection":var{properties:s,newProperties:l}=e;return _n(_n({},e),{},s==null?{properties:l,newProperties:null}:l==null?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return _n(_n({},e),{},{type:"merge_node",path:Ue.next(e.path)})}}},Ue={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=Ue.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;nt[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return Ue.equals(n,i)&&o>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),i=t.slice(0,r);return Ue.equals(n,i)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),o=e[r],a=t[r];return Ue.equals(n,i)&&oe.length===t.length&&e.every((r,n)=>r===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>Ue.compare(e,t)===1,isAncestor:(e,t)=>e.lengthUe.compare(e,t)===-1,isChild:(e,t)=>e.length===t.length+1&&Ue.compare(e,t)===0,isCommon:(e,t)=>e.length<=t.length&&Ue.compare(e,t)===0,isDescendant:(e,t)=>e.length>t.length&&Ue.compare(e,t)===0,isParent:(e,t)=>e.length+1===t.length&&Ue.compare(e,t)===0,isPath:e=>Array.isArray(e)&&(e.length===0||typeof e[0]=="number"),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&Ue.equals(r,n)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=[],i=0;i<=e.length;i++)n.push(e.slice(0,i));return r&&n.reverse(),n},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!Ue.isAncestor(t,e)&&!Ue.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{var{affinity:i="forward"}=r;if(e&&(e==null?void 0:e.length)!==0){if(n===null)return null;switch(t.type){case"insert_node":var{path:o}=t;(Ue.equals(o,n)||Ue.endsBefore(o,n)||Ue.isAncestor(o,n))&&(n[o.length-1]+=1);break;case"remove_node":var{path:a}=t;if(Ue.equals(a,n)||Ue.isAncestor(a,n))return null;Ue.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;Ue.equals(s,n)||Ue.endsBefore(s,n)?n[s.length-1]-=1:Ue.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:u,position:c}=t;if(Ue.equals(u,n)){if(i==="forward")n[n.length-1]+=1;else if(i!=="backward")return null}else Ue.endsBefore(u,n)?n[u.length-1]+=1:Ue.isAncestor(u,n)&&e[u.length]>=c&&(n[u.length-1]+=1,n[u.length]-=c);break;case"move_node":var{path:h,newPath:S}=t;if(Ue.equals(h,S))return;if(Ue.isAncestor(h,n)||Ue.equals(h,n)){var y=S.slice();return Ue.endsBefore(h,S)&&h.lengtht.offset?1:0:r},isAfter:(e,t)=>cr.compare(e,t)===1,isBefore:(e,t)=>cr.compare(e,t)===-1,equals:(e,t)=>e.offset===t.offset&&Ue.equals(e.path,t.path),isPoint:e=>ci(e)&&typeof e.offset=="number"&&Ue.isPath(e.path),transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var{affinity:i="forward"}=r,{path:o,offset:a}=n;switch(t.type){case"insert_node":case"move_node":n.path=Ue.transform(o,t,r);break;case"insert_text":Ue.equals(t.path,o)&&t.offset<=a&&(n.offset+=t.text.length);break;case"merge_node":Ue.equals(t.path,o)&&(n.offset+=t.position),n.path=Ue.transform(o,t,r);break;case"remove_text":Ue.equals(t.path,o)&&t.offset<=a&&(n.offset-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(Ue.equals(t.path,o)||Ue.isAncestor(t.path,o))return null;n.path=Ue.transform(o,t,r);break;case"split_node":if(Ue.equals(t.path,o)){if(t.position===a&&i==null)return null;(t.position1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:i}=e;return Je.isBackward(e)===r?[n,i]:[i,n]},end(e){var[,t]=Je.edges(e);return t},equals:(e,t)=>cr.equals(e.anchor,t.anchor)&&cr.equals(e.focus,t.focus),includes(e,t){if(Je.isRange(t)){if(Je.includes(e,t.anchor)||Je.includes(e,t.focus))return!0;var[r,n]=Je.edges(e),[i,o]=Je.edges(t);return cr.isBefore(r,i)&&cr.isAfter(n,o)}var[a,s]=Je.edges(e),l=!1,u=!1;return cr.isPoint(t)?(l=cr.compare(t,a)>=0,u=cr.compare(t,s)<=0):(l=Ue.compare(t,a.path)>=0,u=Ue.compare(t,s.path)<=0),l&&u},intersection(e,t){var r=Da(e,hK),[n,i]=Je.edges(e),[o,a]=Je.edges(t),s=cr.isBefore(n,o)?o:n,l=cr.isBefore(i,a)?i:a;return cr.isBefore(l,s)?null:function(u){for(var c=1;c!Je.isCollapsed(e),isForward:e=>!Je.isBackward(e),isRange:e=>ci(e)&&cr.isPoint(e.anchor)&&cr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Je.edges(e);return t},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return kv(e,n=>{if(n===null)return null;var i,o,{affinity:a="inward"}=r;if(a==="inward"){var s=Je.isCollapsed(n);Je.isForward(n)?(i="forward",o=s?i:"backward"):(i="backward",o=s?i:"forward")}else a==="outward"?Je.isForward(n)?(i="backward",o="forward"):(i="forward",o="backward"):(i=a,o=a);var l=cr.transform(n.anchor,t,{affinity:i}),u=cr.transform(n.focus,t,{affinity:o});if(!l||!u)return null;n.anchor=l,n.focus=u})}},fK={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var i=Je.transform(r,t,{affinity:n});e.current=i,i==null&&e.unref()}}},jL=(e,t)=>{for(var r in e){var n=e[r],i=t[r];if(ci(n)&&ci(i)){if(!jL(n,i))return!1}else if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return!1;for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:{},{loose:n=!1}=r;function i(o){return Da(o,pK)}return jL(n?i(e):e,n?i(t):t)},isText:e=>ci(e)&&typeof e.text=="string",isTextList:e=>Array.isArray(e)&&e.every(t=>Rt.isText(t)),isTextProps:e=>e.text!==void 0,matches(e,t){for(var r in t)if(r!=="text"&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Oa({},e)];for(var n of t){var i=Da(n,gK),[o,a]=Je.edges(n),s=[],l=0;for(var u of r){var{length:c}=u.text,h=l;if(l+=c,o.offset<=h&&a.offset>=l)Object.assign(u,i),s.push(u);else if(o.offset!==a.offset&&(o.offset===l||a.offset===h)||o.offset>l||a.offseth){var N=o.offset-h;y=Oa(Oa({},S),{},{text:S.text.slice(0,N)}),S=Oa(Oa({},S),{},{text:S.text.slice(N)})}Object.assign(S,i),y&&s.push(y),s.push(S),W&&s.push(W)}}r=s}return r}};function HL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oh(e){for(var t=1;t{switch(o.type){case"insert_node":var{path:a,node:s}=o,l=St.parent(n,a),u=a[a.length-1];if(u>l.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(a,"] because the destination is past the end of the node."));if(l.children.splice(u,0,s),i)for(var[c,h]of Je.points(i))i[h]=cr.transform(c,o);break;case"insert_text":var{path:S,offset:y,text:W}=o;if(W.length===0)break;var F=St.leaf(n,S),N=F.text.slice(0,y),j=F.text.slice(y);if(F.text=N+W+j,i)for(var[D,Q]of Je.points(i))i[Q]=cr.transform(D,o);break;case"merge_node":var{path:te}=o,he=St.get(n,te),Ee=Ue.previous(te),ve=St.get(n,Ee),De=St.parent(n,te),Pe=te[te.length-1];if(Rt.isText(he)&&Rt.isText(ve))ve.text+=he.text;else{if(Rt.isText(he)||Rt.isText(ve))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(te,"] to nodes of different interfaces: ").concat(he," ").concat(ve));ve.children.push(...he.children)}if(De.children.splice(Pe,1),i)for(var[qe,ot]of Je.points(i))i[ot]=cr.transform(qe,o);break;case"move_node":var{path:et,newPath:gt}=o;if(Ue.isAncestor(et,gt))throw new Error("Cannot move a path [".concat(et,"] to new path [").concat(gt,"] because the destination is inside itself."));var dt=St.get(n,et),ht=St.parent(n,et),pt=et[et.length-1];ht.children.splice(pt,1);var Dt=Ue.transform(et,o),Ft=St.get(n,Ue.parent(Dt)),Bt=Dt[Dt.length-1];if(Ft.children.splice(Bt,0,dt),i)for(var[It,Re]of Je.points(i))i[Re]=cr.transform(It,o);break;case"remove_node":var{path:Te}=o,Be=Te[Te.length-1];if(St.parent(n,Te).children.splice(Be,1),i)for(var[it,vt]of Je.points(i)){var ut=cr.transform(it,o);if(i!=null&&ut!=null)i[vt]=ut;else{var kt=void 0,Xt=void 0;for(var[qt,or]of St.texts(n)){if(Ue.compare(or,Te)!==-1){Xt=[qt,or];break}kt=[qt,or]}var ft=!1;kt&&Xt&&(ft=Ue.equals(Xt[1],Te)?!Ue.hasPrevious(Xt[1]):Ue.common(kt[1],Te).length2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1,mode:o="lowest"}=r,{at:a,match:s,select:l}=r;if(St.isNode(t)&&(t=[t]),t.length!==0){var[u]=t;if(a||(a=e.selection?e.selection:e.children.length>0?de.end(e,[]):[0],l=!0),l==null&&(l=!1),Je.isRange(a))if(n||(a=de.unhangRange(e,a)),Je.isCollapsed(a))a=a.anchor;else{var[,c]=Je.edges(a),h=de.pointRef(e,c);Ve.delete(e,{at:a}),a=h.unref()}if(cr.isPoint(a)){s==null&&(s=Rt.isText(u)?Ee=>Rt.isText(Ee):e.isInline(u)?Ee=>Rt.isText(Ee)||de.isInline(e,Ee):Ee=>de.isBlock(e,Ee));var[S]=de.nodes(e,{at:a.path,match:s,mode:o,voids:i});if(!S)return;var[,y]=S,W=de.pathRef(e,y),F=de.isEnd(e,a,y);Ve.splitNodes(e,{at:a,match:s,mode:o,voids:i});var N=W.unref();a=F?Ue.next(N):N}var j=Ue.parent(a),D=a[a.length-1];if(i||!de.void(e,{at:j})){for(var Q of t){var te=j.concat(D);D++,e.apply({type:"insert_node",path:te,node:Q}),a=Ue.next(a)}if(a=Ue.previous(a),l){var he=de.end(e,a);he&&Ve.select(e,he)}}}})},liftNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{at:r=e.selection,mode:n="lowest",voids:i=!1}=t,{match:o}=t;if(o==null&&(o=Ue.isPath(r)?hc(e,r):Q=>de.isBlock(e,Q)),r){var a=de.nodes(e,{at:r,match:o,mode:n,voids:i}),s=Array.from(a,Q=>{var[,te]=Q;return de.pathRef(e,te)});for(var l of s){var u=l.unref();if(u.length<2)throw new Error("Cannot lift node at a path [".concat(u,"] because it has a depth of less than `2`."));var c=de.node(e,Ue.parent(u)),[h,S]=c,y=u[u.length-1],{length:W}=h.children;if(W===1){var F=Ue.next(S);Ve.moveNodes(e,{at:u,to:F,voids:i}),Ve.removeNodes(e,{at:S,voids:i})}else if(y===0)Ve.moveNodes(e,{at:u,to:S,voids:i});else if(y===W-1){var N=Ue.next(S);Ve.moveNodes(e,{at:u,to:N,voids:i})}else{var j=Ue.next(u),D=Ue.next(S);Ve.splitNodes(e,{at:j,voids:i}),Ve.moveNodes(e,{at:u,to:D,voids:i})}}}})},mergeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{match:r,at:n=e.selection}=t,{hanging:i=!1,voids:o=!1,mode:a="lowest"}=t;if(n){if(r==null)if(Ue.isPath(n)){var[s]=de.parent(e,n);r=Pe=>s.children.includes(Pe)}else r=Pe=>de.isBlock(e,Pe);if(!i&&Je.isRange(n)&&(n=de.unhangRange(e,n)),Je.isRange(n))if(Je.isCollapsed(n))n=n.anchor;else{var[,l]=Je.edges(n),u=de.pointRef(e,l);Ve.delete(e,{at:n}),n=u.unref(),t.at==null&&Ve.select(e,n)}var[c]=de.nodes(e,{at:n,match:r,voids:o,mode:a}),h=de.previous(e,{at:n,match:r,voids:o,mode:a});if(c&&h){var[S,y]=c,[W,F]=h;if(y.length!==0&&F.length!==0){var N,j,D=Ue.next(F),Q=Ue.common(y,F),te=Ue.isSibling(y,F),he=Array.from(de.levels(e,{at:y}),Pe=>{var[qe]=Pe;return qe}).slice(Q.length).slice(0,-1),Ee=de.above(e,{at:y,mode:"highest",match:Pe=>he.includes(Pe)&&GL(e,Pe)}),ve=Ee&&de.pathRef(e,Ee[1]);if(Rt.isText(S)&&Rt.isText(W)){var De=Da(S,mK);j=W.text.length,N=De}else{if(!Ut.isElement(S)||!Ut.isElement(W))throw new Error("Cannot merge the node at path [".concat(y,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(S)," ").concat(JSON.stringify(W)));De=Da(S,yK),j=W.children.length,N=De}te||Ve.moveNodes(e,{at:y,to:D,voids:o}),ve&&Ve.removeNodes(e,{at:ve.current,voids:o}),Ut.isElement(W)&&de.isEmpty(e,W)||Rt.isText(W)&&W.text===""&&F[F.length-1]!==0?Ve.removeNodes(e,{at:F,voids:o}):e.apply({type:"merge_node",path:D,position:j,properties:N}),ve&&ve.unref()}}}})},moveNodes(e,t){de.withoutNormalizing(e,()=>{var{to:r,at:n=e.selection,mode:i="lowest",voids:o=!1}=t,{match:a}=t;if(n){a==null&&(a=Ue.isPath(n)?hc(e,n):y=>de.isBlock(e,y));var s=de.pathRef(e,r),l=de.nodes(e,{at:n,match:a,mode:i,voids:o}),u=Array.from(l,y=>{var[,W]=y;return de.pathRef(e,W)});for(var c of u){var h=c.unref(),S=s.current;h.length!==0&&e.apply({type:"move_node",path:h,newPath:S}),s.current&&Ue.isSibling(S,h)&&Ue.isAfter(S,h)&&(s.current=Ue.next(s.current))}s.unref()}})},removeNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:n=!1,mode:i="lowest"}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=Ue.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),!r&&Je.isRange(o)&&(o=de.unhangRange(e,o));var s=de.nodes(e,{at:o,match:a,mode:i,voids:n}),l=Array.from(s,S=>{var[,y]=S;return de.pathRef(e,y)});for(var u of l){var c=u.unref();if(c){var[h]=de.node(e,c);e.apply({type:"remove_node",path:c,node:h})}}}})},setNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{match:n,at:i=e.selection}=r,{hanging:o=!1,mode:a="lowest",split:s=!1,voids:l=!1}=r;if(i){if(n==null&&(n=Ue.isPath(i)?hc(e,i):he=>de.isBlock(e,he)),!o&&Je.isRange(i)&&(i=de.unhangRange(e,i)),s&&Je.isRange(i)){if(Je.isCollapsed(i)&&de.leaf(e,i.anchor)[0].text.length>0)return;var u=de.rangeRef(e,i,{affinity:"inward"}),[c,h]=Je.edges(i),S=a==="lowest"?"lowest":"highest",y=de.isEnd(e,h,h.path);Ve.splitNodes(e,{at:h,match:n,mode:S,voids:l,always:!y});var W=de.isStart(e,c,c.path);Ve.splitNodes(e,{at:c,match:n,mode:S,voids:l,always:!W}),i=u.unref(),r.at==null&&Ve.select(e,i)}for(var[F,N]of de.nodes(e,{at:i,match:n,mode:a,voids:l})){var j={},D={};if(N.length!==0){var Q=!1;for(var te in t)te!=="children"&&te!=="text"&&t[te]!==F[te]&&(Q=!0,F.hasOwnProperty(te)&&(j[te]=F[te]),t[te]!=null&&(D[te]=t[te]));Q&&e.apply({type:"set_node",path:N,properties:j,newProperties:D})}}}})},splitNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",voids:n=!1}=t,{match:i,at:o=e.selection,height:a=0,always:s=!1}=t;if(i==null&&(i=dt=>de.isBlock(e,dt)),Je.isRange(o)&&(o=EK(e,o)),Ue.isPath(o)){var l=o,u=de.point(e,l),[c]=de.parent(e,l);i=dt=>dt===c,a=u.path.length-l.length+1,o=u,s=!0}if(o){var h=de.pointRef(e,o,{affinity:"backward"}),[S]=de.nodes(e,{at:o,match:i,mode:r,voids:n});if(S){var y=de.void(e,{at:o,mode:"highest"});if(!n&&y){var[W,F]=y;if(Ut.isElement(W)&&e.isInline(W)){var N=de.after(e,F);if(!N){var j=Ue.next(F);Ve.insertNodes(e,{text:""},{at:j,voids:n}),N=de.point(e,j)}o=N,s=!0}a=o.path.length-F.length+1,s=!0}var D=de.pointRef(e,o),Q=o.path.length-a,[,te]=S,he=o.path.slice(0,Q),Ee=a===0?o.offset:o.path[Q]+0;for(var[ve,De]of de.levels(e,{at:he,reverse:!0,voids:n})){var Pe=!1;if(De.length2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var n={};for(var i of t)n[i]=null;Ve.setNodes(e,n,r)},unwrapNodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{mode:r="lowest",split:n=!1,voids:i=!1}=t,{at:o=e.selection,match:a}=t;if(o){a==null&&(a=Ue.isPath(o)?hc(e,o):S=>de.isBlock(e,S)),Ue.isPath(o)&&(o=de.range(e,o));var s=Je.isRange(o)?de.rangeRef(e,o):null,l=de.nodes(e,{at:o,match:a,mode:r,voids:i}),u=Array.from(l,S=>{var[,y]=S;return de.pathRef(e,y)}).reverse(),c=function(S){var y=S.unref(),[W]=de.node(e,y),F=de.range(e,y);n&&s&&(F=Je.intersection(s.current,F)),Ve.liftNodes(e,{at:F,match:N=>Ut.isAncestor(W)&&W.children.includes(N),voids:i})};for(var h of u)c(h);s&&s.unref()}})},wrapNodes(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{mode:n="lowest",split:i=!1,voids:o=!1}=r,{match:a,at:s=e.selection}=r;if(s){if(a==null&&(a=Ue.isPath(s)?hc(e,s):e.isInline(t)?N=>de.isInline(e,N)||Rt.isText(N):N=>de.isBlock(e,N)),i&&Je.isRange(s)){var[l,u]=Je.edges(s),c=de.rangeRef(e,s,{affinity:"inward"});Ve.splitNodes(e,{at:u,match:a,voids:o}),Ve.splitNodes(e,{at:l,match:a,voids:o}),s=c.unref(),r.at==null&&Ve.select(e,s)}var h=Array.from(de.nodes(e,{at:s,match:e.isInline(t)?N=>de.isBlock(e,N):N=>de.isEditor(N),mode:"lowest",voids:o}));for(var[,S]of h){var y=Je.isRange(s)?Je.intersection(s,de.range(e,S)):s;if(y){var W=Array.from(de.nodes(e,{at:y,match:a,mode:n,voids:o}));if(W.length>0){var F=function(){var[N]=W,j=W[W.length-1],[,D]=N,[,Q]=j;if(D.length===0&&Q.length===0)return"continue";var te=Ue.equals(D,Q)?Ue.parent(D):Ue.common(D,Q),he=de.range(e,D,Q),Ee=de.node(e,te),[ve]=Ee,De=te.length+1,Pe=Ue.next(Q.slice(0,De)),qe=WL(WL({},t),{},{children:[]});Ve.insertNodes(e,qe,{at:Pe,voids:o}),Ve.moveNodes(e,{at:he,match:ot=>Ut.isAncestor(ve)&&ve.children.includes(ot),to:Pe.concat(0),voids:o})}();if(F==="continue")continue}}}}})}},GL=(e,t)=>{if(Ut.isElement(t)){var r=t;return!!de.isVoid(e,t)||r.children.length===1&&GL(e,r.children[0])}return!de.isEditor(t)},EK=(e,t)=>{if(Je.isCollapsed(t))return t.anchor;var[,r]=Je.edges(t),n=de.pointRef(e,r);return Ve.delete(e,{at:t}),n.unref()},hc=(e,t)=>{var[r]=de.node(e,t);return n=>n===r};function VL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=t,{selection:n}=e;if(n){if(r==="anchor")Ve.select(e,n.anchor);else if(r==="focus")Ve.select(e,n.focus);else if(r==="start"){var[i]=Je.edges(n);Ve.select(e,i)}else if(r==="end"){var[,o]=Je.edges(n);Ve.select(e,o)}}},deselect(e){var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},move(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e,{distance:n=1,unit:i="character",reverse:o=!1}=t,{edge:a=null}=t;if(r){a==="start"&&(a=Je.isBackward(r)?"focus":"anchor"),a==="end"&&(a=Je.isBackward(r)?"anchor":"focus");var{anchor:s,focus:l}=r,u={distance:n,unit:i},c={};if(a==null||a==="anchor"){var h=o?de.before(e,s,u):de.after(e,s,u);h&&(c.anchor=h)}if(a==null||a==="focus"){var S=o?de.before(e,l,u):de.after(e,l,u);S&&(c.focus=S)}Ve.setSelection(e,c)}},select(e,t){var{selection:r}=e;if(t=de.range(e,t),r)Ve.setSelection(e,t);else{if(!Je.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(t)));e.apply({type:"set_selection",properties:r,newProperties:t})}},setPoint(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n}=e,{edge:i="both"}=r;if(n){i==="start"&&(i=Je.isBackward(n)?"focus":"anchor"),i==="end"&&(i=Je.isBackward(n)?"anchor":"focus");var{anchor:o,focus:a}=n,s=i==="anchor"?o:a;Ve.setSelection(e,{[i==="anchor"?"anchor":"focus"]:KL(KL({},s),t)})}},setSelection(e,t){var{selection:r}=e,n={},i={};if(r){for(var o in t)(o==="anchor"&&t.anchor!=null&&!cr.equals(t.anchor,r.anchor)||o==="focus"&&t.focus!=null&&!cr.equals(t.focus,r.focus)||o!=="anchor"&&o!=="focus"&&t[o]!==r[o])&&(n[o]=r[o],i[o]=t[o]);Object.keys(n).length>0&&e.apply({type:"set_selection",properties:n,newProperties:i})}}},SK={delete(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.withoutNormalizing(e,()=>{var{reverse:r=!1,unit:n="character",distance:i=1,voids:o=!1}=t,{at:a=e.selection,hanging:s=!1}=t;if(a){if(Je.isRange(a)&&Je.isCollapsed(a)&&(a=a.anchor),cr.isPoint(a)){var l=de.void(e,{at:a,mode:"highest"});if(!o&&l){var[,u]=l;a=u}else{var c={unit:n,distance:i};a={anchor:a,focus:r?de.before(e,a,c)||de.start(e,[]):de.after(e,a,c)||de.end(e,[])},s=!0}}if(Ue.isPath(a))Ve.removeNodes(e,{at:a,voids:o});else if(!Je.isCollapsed(a)){if(!s){var[,h]=Je.edges(a),S=de.end(e,[]);cr.equals(h,S)||(a=de.unhangRange(e,a,{voids:o}))}var[y,W]=Je.edges(a),F=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:y,voids:o}),N=de.above(e,{match:Xt=>de.isBlock(e,Xt),at:W,voids:o}),j=F&&N&&!Ue.equals(F[1],N[1]),D=Ue.equals(y.path,W.path),Q=o?null:de.void(e,{at:y,mode:"highest"}),te=o?null:de.void(e,{at:W,mode:"highest"});if(Q){var he=de.before(e,y);he&&F&&Ue.isAncestor(F[1],he.path)&&(y=he)}if(te){var Ee=de.after(e,W);Ee&&N&&Ue.isAncestor(N[1],Ee.path)&&(W=Ee)}var ve,De=[];for(var Pe of de.nodes(e,{at:a,voids:o})){var[qe,ot]=Pe;ve&&Ue.compare(ot,ve)===0||(!o&&de.isVoid(e,qe)||!Ue.isCommon(ot,y.path)&&!Ue.isCommon(ot,W.path))&&(De.push(Pe),ve=ot)}var et=Array.from(De,Xt=>{var[,qt]=Xt;return de.pathRef(e,qt)}),gt=de.pointRef(e,y),dt=de.pointRef(e,W);if(!D&&!Q){var ht=gt.current,[pt]=de.leaf(e,ht),{path:Dt}=ht,{offset:Ft}=y,Bt=pt.text.slice(Ft);Bt.length>0&&e.apply({type:"remove_text",path:Dt,offset:Ft,text:Bt})}for(var It of et){var Re=It.unref();Ve.removeNodes(e,{at:Re,voids:o})}if(!te){var Te=dt.current,[Be]=de.leaf(e,Te),{path:it}=Te,vt=D?y.offset:0,ut=Be.text.slice(vt,W.offset);ut.length>0&&e.apply({type:"remove_text",path:it,offset:vt,text:ut})}!D&&j&&dt.current&>.current&&Ve.mergeNodes(e,{at:dt.current,hanging:!0,voids:o});var kt=r?gt.unref()||dt.unref():dt.unref()||gt.unref();t.at==null&&kt&&Ve.select(e,kt)}}})},insertFragment(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:i=!1}=r,{at:o=e.selection}=r;if(t.length&&o){if(Je.isRange(o))if(n||(o=de.unhangRange(e,o)),Je.isCollapsed(o))o=o.anchor;else{var[,a]=Je.edges(o);if(!i&&de.void(e,{at:a}))return;var s=de.pointRef(e,a);Ve.delete(e,{at:o}),o=s.unref()}else Ue.isPath(o)&&(o=de.start(e,o));if(i||!de.void(e,{at:o})){var l=de.above(e,{at:o,match:Te=>de.isInline(e,Te),mode:"highest",voids:i});if(l){var[,u]=l;de.isEnd(e,o,u)?o=de.after(e,u):de.isStart(e,o,u)&&(o=de.before(e,u))}var c=de.above(e,{match:Te=>de.isBlock(e,Te),at:o,voids:i}),[,h]=c,S=de.isStart(e,o,h),y=de.isEnd(e,o,h),W=S&&y,F=!S||S&&y,N=!y,[,j]=St.first({children:t},[]),[,D]=St.last({children:t},[]),Q=[],te=Te=>{var[Be,it]=Te;return!(it.length===0)&&(!!W||!(F&&Ue.isAncestor(it,j)&&Ut.isElement(Be)&&!e.isVoid(Be)&&!e.isInline(Be))&&!(N&&Ue.isAncestor(it,D)&&Ut.isElement(Be)&&!e.isVoid(Be)&&!e.isInline(Be)))};for(var he of St.nodes({children:t},{pass:te}))te(he)&&Q.push(he);var Ee=[],ve=[],De=[],Pe=!0,qe=!1;for(var[ot]of Q)Ut.isElement(ot)&&!e.isInline(ot)?(Pe=!1,qe=!0,ve.push(ot)):Pe?Ee.push(ot):De.push(ot);var[et]=de.nodes(e,{at:o,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),[,gt]=et,dt=de.isStart(e,o,gt),ht=de.isEnd(e,o,gt),pt=de.pathRef(e,y?Ue.next(h):h),Dt=de.pathRef(e,ht?Ue.next(gt):gt),Ft=de.pathRef(e,h);Ve.splitNodes(e,{at:o,match:Te=>qe?de.isBlock(e,Te):Rt.isText(Te)||de.isInline(e,Te),mode:qe?"lowest":"highest",voids:i});var Bt=de.pathRef(e,!dt||dt&&ht?Ue.next(gt):gt);if(Ve.insertNodes(e,Ee,{at:Bt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),W&&ve.length&&Ve.delete(e,{at:Ft.unref(),voids:i}),Ve.insertNodes(e,ve,{at:pt.current,match:Te=>de.isBlock(e,Te),mode:"lowest",voids:i}),Ve.insertNodes(e,De,{at:Dt.current,match:Te=>Rt.isText(Te)||de.isInline(e,Te),mode:"highest",voids:i}),!r.at){var It;It=De.length>0?Ue.previous(Dt.current):ve.length>0?Ue.previous(pt.current):Ue.previous(Bt.current);var Re=de.end(e,It);Ve.select(e,Re)}Bt.unref(),pt.unref(),Dt.unref()}}})},insertText(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};de.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:i=e.selection}=r;if(i){if(Ue.isPath(i)&&(i=de.range(e,i)),Je.isRange(i))if(Je.isCollapsed(i))i=i.anchor;else{var o=Je.end(i);if(!n&&de.void(e,{at:o}))return;var a=de.pointRef(e,o);Ve.delete(e,{at:i,voids:n}),i=a.unref(),Ve.setSelection(e,{anchor:i,focus:i})}if(n||!de.void(e,{at:i})){var{path:s,offset:l}=i;t.length>0&&e.apply({type:"insert_text",path:s,offset:l,text:t})}}})}};function $L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Iv(e){for(var t=1;t-1&&e%1==0&&e-1&&t%1==0&&t<=9007199254740991}(e.length)&&!iP(e)}function iP(e){var t=oP(e)?_h.call(e):"";return t=="[object Function]"||t=="[object GeneratorFunction]"}function oP(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function aP(e){return!!e&&typeof e=="object"}function YK(e){return e?LK(e,function(t){return ex(t)?VK(t):$K(t)}(e)):[]}var sP=function(e){if(!e)return[];if(ex(e))return function(r){return typeof r=="string"||!nP(r)&&aP(r)&&_h.call(r)=="[object String]"}(e)?MK(e):function(r,n){var i=-1,o=r.length;for(n||(n=Array(o));++i0&&tx(e[r],t[r])})}var uP={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function kh(){var e=typeof document!="undefined"?document:{};return tx(e,uP),e}var ZK={document:uP,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return typeof setTimeout=="undefined"?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){typeof setTimeout!="undefined"&&clearTimeout(e)}};function Ul(){var e=typeof window!="undefined"?window:{};return tx(e,ZK),e}function rx(e){return rx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},rx(e)}function Fv(e,t){return Fv=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},Fv(e,t)}function JK(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function nx(e,t,r){return nx=JK()?Reflect.construct:function(n,i,o){var a=[null];a.push.apply(a,i);var s=new(Function.bind.apply(n,a));return o&&Fv(s,o.prototype),s},nx.apply(null,arguments)}function ix(e){var t=typeof Map=="function"?new Map:void 0;return ix=function(r){if(r===null||!function(i){return Function.toString.call(i).indexOf("[native code]")!==-1}(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return nx(r,arguments,rx(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fv(n,r)},ix(e)}var ls=function(e){var t,r;function n(i){var o,a,s;return o=e.call.apply(e,[this].concat(i))||this,a=function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}(o),s=a.__proto__,Object.defineProperty(a,"__proto__",{get:function(){return s},set:function(l){s.__proto__=l}}),o}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(ix(Array));function Nv(e){e===void 0&&(e=[]);var t=[];return e.forEach(function(r){Array.isArray(r)?t.push.apply(t,Nv(r)):t.push(r)}),t}function cP(e,t){return Array.prototype.filter.call(e,t)}function _e(e,t){var r=Ul(),n=kh(),i=[];if(!t&&e instanceof ls)return e;if(!e)return new ls(i);if(typeof e=="string"){var o=e.trim();if(o.indexOf("<")>=0&&o.indexOf(">")>=0){var a="div";o.indexOf("0}).length>0}function no(e,t){if(arguments.length===1&&typeof e=="string")return this[0]?this[0].getAttribute(e):void 0;for(var r=0;r=0&&(r[t=o.name.split("data-")[1],t.toLowerCase().replace(/-(.)/g,function(s,l){return l.toUpperCase()})]=o.value)}for(var a in r)r[a]==="false"?r[a]=!1:r[a]==="true"?r[a]=!0:parseFloat(r[a])===1*r[a]&&(r[a]*=1);return r}}function Yo(e){if(e===void 0){var t=this[0];if(!t)return;if(t.multiple&&t.nodeName.toLowerCase()==="select"){for(var r=[],n=0;n=0;else o.value=e}return this}function Zo(){for(var e=arguments.length,t=new Array(e),r=0;r=0;y-=1){var W=S[y];o&&W.listener===o||o&&W.listener&&W.listener.dom7proxy&&W.listener.dom7proxy===o?(h.removeEventListener(u,W.proxyListener,a),S.splice(y,1)):o||(h.removeEventListener(u,W.proxyListener,a),S.splice(y,1))}}return this}function Uv(){var e=Ul();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Hv(){var e=Ul();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function hP(){if(this.length>0){var e=Ul(),t=kh(),r=this[0],n=r.getBoundingClientRect(),i=t.body,o=r.clientTop||i.clientTop||0,a=r.clientLeft||i.clientLeft||0,s=r===e?e.scrollY:r.scrollTop,l=r===e?e.scrollX:r.scrollLeft;return{top:n.top+s-o,left:n.left+l-a}}return null}function mc(){for(var e=0;e=0;r-=1)this[t].insertBefore(i.childNodes[r],this[t].childNodes[0])}else if(e instanceof ls)for(r=0;r-1&&e%1==0&&e-1&&t%1==0&&t<=9007199254740991}(e.length)&&!function(t){var r=function(n){var i=typeof n;return!!n&&(i=="object"||i=="function")}(t)?yP.call(t):"";return r=="[object Function]"||r==qK}(e)}function u$(e){return ax(e)?i$(e):s$(e)}function c$(e){return e}var sx=function(e,t){return(xP(e)?t$:o$)(e,typeof t=="function"?t:c$)};let SP=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t};var d$=/^\s+|\s+$/g,h$=/^[-+]0x[0-9a-f]+$/i,f$=/^0b[01]+$/i,p$=/^0o[0-7]+$/i,g$=parseInt,v$=typeof re=="object"&&re&&re.Object===Object&&re,m$=typeof self=="object"&&self&&self.Object===Object&&self,y$=v$||m$||Function("return this")(),b$=Object.prototype.toString,E$=Math.max,x$=Math.min,lx=function(){return y$.Date.now()};function S$(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function W(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function F(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=lx();if(F(Q))return j(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?x$(he,o-(te-u)):he}(Q))}function j(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=lx(),te=F(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return W(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=wP(t)||0,Xv(r)&&(c=!!r.leading,o=(h="maxWait"in r)?E$(wP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:j(lx())},D}function Xv(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&b$.call(n)=="[object Symbol]"}(e))return NaN;if(Xv(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xv(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(d$,"");var r=f$.test(e);return r||p$.test(e)?g$(e.slice(2),r?2:8):h$.test(e)?NaN:+e}var Hl=function(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError("Expected a function");return Xv(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),S$(e,t,{leading:n,maxWait:t,trailing:i})};const w$={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,r){return document.createElementNS(e,t,r)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,r){e.insertBefore(t,r)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return e.nodeType===1},isText:function(e){return e.nodeType===3},isComment:function(e){return e.nodeType===8}};function Lh(e,t,r,n,i){return{sel:e,data:t,children:r,text:n,elm:i,key:t===void 0?void 0:t.key}}const ux=Array.isArray;function Yv(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function cx(e){return e===void 0}function Hi(e){return e!==void 0}const CP=Lh("",{},[],void 0,void 0);function Ph(e,t){var r,n;const i=e.key===t.key,o=((r=e.data)===null||r===void 0?void 0:r.is)===((n=t.data)===null||n===void 0?void 0:n.is);return e.sel===t.sel&&i&&o}function C$(e,t,r){var n;const i={};for(let o=t;o<=r;++o){const a=(n=e[o])===null||n===void 0?void 0:n.key;a!==void 0&&(i[a]=o)}return i}const T$=["create","update","remove","destroy","pre","post"];function A$(e,t){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},n=t!==void 0?t:w$;for(const h of T$)for(const S of e){const y=S[h];y!==void 0&&r[h].push(y)}function i(h){const S=h.id?"#"+h.id:"",y=h.getAttribute("class"),W=y?"."+y.split(" ").join("."):"";return Lh(n.tagName(h).toLowerCase()+S+W,{},[],void 0,h)}function o(h,S){return function(){if(--S==0){const y=n.parentNode(h);n.removeChild(y,h)}}}function a(h,S){var y,W;let F,N=h.data;if(N!==void 0){const Q=(y=N.hook)===null||y===void 0?void 0:y.init;Hi(Q)&&(Q(h),N=h.data)}const j=h.children,D=h.sel;if(D==="!")cx(h.text)&&(h.text=""),h.elm=n.createComment(h.text);else if(D!==void 0){const Q=D.indexOf("#"),te=D.indexOf(".",Q),he=Q>0?Q:D.length,Ee=te>0?te:D.length,ve=Q!==-1||te!==-1?D.slice(0,Math.min(he,Ee)):D,De=h.elm=Hi(N)&&Hi(F=N.ns)?n.createElementNS(F,ve,N):n.createElement(ve,N);for(he0&&De.setAttribute("class",D.slice(Ee+1).replace(/\./g," ")),F=0;FDt?(dt=Pe[It+1]==null?null:Pe[It+1].elm,s(ve,dt,Pe,pt,It,qe)):u(ve,De,ht,Dt))}(te,he,Ee,y):Hi(Ee)?(Hi(h.text)&&n.setTextContent(te,""),s(te,null,Ee,0,Ee.length-1,y)):Hi(he)?u(te,he,0,he.length-1):Hi(h.text)&&n.setTextContent(te,""):h.text!==S.text&&(Hi(he)&&u(te,he,0,he.length-1),n.setTextContent(te,S.text)),(D=Q==null?void 0:Q.postpatch)===null||D===void 0||D.call(Q,h,S)}}return function(h,S){let y,W,F;const N=[];for(y=0;y=n?e:function(i,o,a){var s=-1,l=i.length;o<0&&(o=-o>l?0:l+o),(a=a>l?l:a)<0&&(a+=l),l=o>a?0:a-o>>>0,o>>>=0;for(var u=Array(l);++s1;Q&&(D=D.slice(0,-1));var te=QP(D),he=mx[te];if(D.length>1&&!he&&!ZP[D]&&!yx[te])throw new TypeError('Unknown modifier: "'+D+'"');h!==1&&he||(l?u.key=te:u.which=aX(D)),he&&(u[he]=!Q||null)}}catch(Ee){W=!0,F=Ee}finally{try{!y&&j.return&&j.return()}finally{if(W)throw F}}return u}(o,t)}),i=function(o){return n.some(function(a){return function(s,l){for(var u in s){var c=s[u],h=void 0;if(c!=null&&((h=u==="key"&&l.key!=null?l.key.toLowerCase():u==="which"?c===91&&l.which===93?91:l.which:l[u])!=null||c!==!1)&&h!==c)return!1}return!0}(a,o)})};return r==null?i:i(r)}function aX(e){return e=QP(e),yx[e]||e.toUpperCase().charCodeAt(0)}function QP(e){return e=e.toLowerCase(),e=ZP[e]||e}var sX=JP,bx=function(e,t){return JP(e,{byKey:!0},t)},lX=/^\s+|\s+$/g,uX=/^[-+]0x[0-9a-f]+$/i,cX=/^0b[01]+$/i,dX=/^0o[0-7]+$/i,hX=parseInt,fX=typeof re=="object"&&re&&re.Object===Object&&re,pX=typeof self=="object"&&self&&self.Object===Object&&self,gX=fX||pX||Function("return this")(),vX=Object.prototype.toString,mX=Math.max,yX=Math.min,Ex=function(){return gX.Date.now()};function xx(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qP(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(i){return!!i&&typeof i=="object"}(n)&&vX.call(n)=="[object Symbol]"}(e))return NaN;if(xx(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xx(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(lX,"");var r=cX.test(e);return r||dX.test(e)?hX(e.slice(2),r?2:8):uX.test(e)?NaN:+e}var Tc,eI=function(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,S=!0;if(typeof e!="function")throw new TypeError("Expected a function");function y(Q){var te=n,he=i;return n=i=void 0,u=Q,a=e.apply(he,te)}function W(Q){return u=Q,s=setTimeout(N,t),c?y(Q):a}function F(Q){var te=Q-l;return l===void 0||te>=t||te<0||h&&Q-u>=o}function N(){var Q=Ex();if(F(Q))return j(Q);s=setTimeout(N,function(te){var he=t-(te-l);return h?yX(he,o-(te-u)):he}(Q))}function j(Q){return s=void 0,S&&n?y(Q):(n=i=void 0,a)}function D(){var Q=Ex(),te=F(Q);if(n=arguments,i=this,l=Q,te){if(s===void 0)return W(l);if(h)return s=setTimeout(N,t),y(l)}return s===void 0&&(s=setTimeout(N,t)),a}return t=qP(t)||0,xx(r)&&(c=!!r.leading,o=(h="maxWait"in r)?mX(qP(r.maxWait)||0,t):o,S="trailing"in r?!!r.trailing:S),D.cancel=function(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0},D.flush=function(){return s===void 0?a:j(Ex())},D},tI=oe(function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",u="[object Map]",c="[object Number]",h="[object Object]",S="[object Promise]",y="[object RegExp]",W="[object Set]",F="[object String]",N="[object Symbol]",j="[object WeakMap]",D="[object ArrayBuffer]",Q="[object DataView]",te="[object Float32Array]",he="[object Float64Array]",Ee="[object Int8Array]",ve="[object Int16Array]",De="[object Int32Array]",Pe="[object Uint8Array]",qe="[object Uint8ClampedArray]",ot="[object Uint16Array]",et="[object Uint32Array]",gt=/\w*$/,dt=/^\[object .+?Constructor\]$/,ht=/^(?:0|[1-9]\d*)$/,pt={};pt[i]=pt["[object Array]"]=pt[D]=pt[Q]=pt[o]=pt[a]=pt[te]=pt[he]=pt[Ee]=pt[ve]=pt[De]=pt[u]=pt[c]=pt[h]=pt[y]=pt[W]=pt[F]=pt[N]=pt[Pe]=pt[qe]=pt[ot]=pt[et]=!0,pt["[object Error]"]=pt[s]=pt[j]=!1;var Dt=typeof re=="object"&&re&&re.Object===Object&&re,Ft=typeof self=="object"&&self&&self.Object===Object&&self,Bt=Dt||Ft||Function("return this")(),It=t&&!t.nodeType&&t,Re=It&&e&&!e.nodeType&&e,Te=Re&&Re.exports===It;function Be(Le,rt){return Le.set(rt[0],rt[1]),Le}function it(Le,rt){return Le.add(rt),Le}function vt(Le,rt,Ct,Mt){var xr=-1,tn=Le?Le.length:0;for(Mt&&tn&&(Ct=Le[++xr]);++xr-1},To.prototype.set=function(Le,rt){var Ct=this.__data__,Mt=qi(Ct,Le);return Mt<0?Ct.push([Le,rt]):Ct[Mt][1]=rt,this},Xa.prototype.clear=function(){this.__data__={hash:new Go,map:new(mi||To),string:new Go}},Xa.prototype.delete=function(Le){return Za(this,Le).delete(Le)},Xa.prototype.get=function(Le){return Za(this,Le).get(Le)},Xa.prototype.has=function(Le){return Za(this,Le).has(Le)},Xa.prototype.set=function(Le,rt){return Za(this,Le).set(Le,rt),this},Vo.prototype.clear=function(){this.__data__=new To},Vo.prototype.delete=function(Le){return this.__data__.delete(Le)},Vo.prototype.get=function(Le){return this.__data__.get(Le)},Vo.prototype.has=function(Le){return this.__data__.has(Le)},Vo.prototype.set=function(Le,rt){var Ct=this.__data__;if(Ct instanceof To){var Mt=Ct.__data__;if(!mi||Mt.length<199)return Mt.push([Le,rt]),this;Ct=this.__data__=new Xa(Mt)}return Ct.set(Le,rt),this};var $g=Yu?Xt(Yu,Object):function(){return[]},Ea=function(Le){return Ar.call(Le)};function Qb(Le,rt){return!!(rt=rt==null?n:rt)&&(typeof Le=="number"||ht.test(Le))&&Le>-1&&Le%1==0&&Le-1&&rt%1==0&&rt<=n}(Le.length)&&!Kt(Le)}var Et=Wo||function(){return!1};function Kt(Le){var rt=zr(Le)?Ar.call(Le):"";return rt==s||rt==l}function zr(Le){var rt=typeof Le;return!!Le&&(rt=="object"||rt=="function")}function mr(Le){return Ye(Le)?El(Le):function(rt){if(!xl(rt))return ya(rt);var Ct=[];for(var Mt in Object(rt))yn.call(rt,Mt)&&Mt!="constructor"&&Ct.push(Mt);return Ct}(Le)}e.exports=function(Le){return Kg(Le,!0,!0)}});function rI(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var bX=0;function EX(e){return"__private_"+bX+++"_"+e}function xX(e,t,r){const n=[];return e.forEach(i=>typeof i!="string"?n.push(i):t[Symbol.split](i).forEach((o,a,s)=>{o!==""&&n.push(o),at===1?0:1},Array.isArray(e)?e.forEach(rI(this,Tc)[Tc],this):rI(this,Tc)[Tc](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!function(n,i){return Object.prototype.hasOwnProperty.call(n,i)}(this.locale.strings,e))throw new Error(`missing string: ${e}`);const r=this.locale.strings[e];if(typeof r=="object"){if(t&&t.smart_count!==void 0)return nI(r[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return nI(r,t)}});function SX(e){if(e==null||!e.strings)return;const t=this.locale;this.locale=st(st({},t),{strings:st(st({},t.strings),e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}var oI=function(){var e={},t=e._fns={};return e.emit=function(r,n,i,o,a,s,l){var u=function(c){for(var h=t[c]?t[c]:[],S=c.indexOf(":"),y=S===-1?[c]:[c.substring(0,S),c.substring(S+1)],z=Object.keys(t),F=0,N=z.length;Fcrypto.getRandomValues(new Uint8Array(e)),sI=(e,t,r)=>{let n=(2<{let o="";for(;;){let a=r(i),s=i;for(;s--;)if(o+=e[a[s]&n]||"",o.length===t)return o}}};var TX={nanoid:(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t},customAlphabet:(e,t)=>sI(e,t,aI),customRandom:sI,urlAlphabet:CX,random:aI},Sx=function(e){if(typeof e!="number"||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function lI(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}lI.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if(typeof e=="string"||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t=2}return t?r(t.split(";")[0]):r},OX=0;function _X(e){return"__private_"+OX+++"_"+e}var wx=_X("publish");class uI{constructor(){Object.defineProperty(this,wx,{value:RX}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t=st({},this.state),r=st(st({},this.state),e);this.state=r,function(n,i){if(!Object.prototype.hasOwnProperty.call(n,i))throw new TypeError("attempted to use private field on non-instance");return n}(this,wx)[wx](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function RX(){for(var e=arguments.length,t=new Array(e),r=0;r{n(...t)})}uI.VERSION="2.0.3";var cI=function(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},dI={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function hI(e){let t="";return e.replace(/[^A-Z0-9]/gi,r=>(t+=`-${function(n){return n.charCodeAt(0).toString(32)}(r)}`,"/"))+t}var kX=function(e){if(e==null&&(e=typeof navigator!="undefined"?navigator.userAgent:null),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const r=t[1];let[n,i]=r.split(".");return n=parseInt(n,10),i=parseInt(i,10),n<15||n===15&&i<15063||n>18||n===18&&i>=18218};function Cx(e){return e<10?`0${e}`:e.toString()}var qv=function(){const e=new Date;return`${Cx(e.getHours())}:${Cx(e.getMinutes())}:${Cx(e.getSeconds())}`},fI={justErrorsLogger:{debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),r=0;rr,onBeforeUpload:r=>r,store:new uI,logger:MX,infoTimeout:5e3};if(this.opts=st(st(st({},t),e),{restrictions:st(st({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=BX),this.log(`Using Core v${this.constructor.VERSION}`),this.opts.restrictions.allowedFileTypes&&this.opts.restrictions.allowedFileTypes!==null&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.calculateProgress=Hl(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:kX(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:st({},this.opts.meta),info:[],recoveredState:null}),zt(this,Ih)[Ih]=this.store.subscribe((r,n,i)=>{this.emit("state-update",r,n,i),this.updateAll(n)}),this.opts.debug&&typeof window!="undefined"&&(window[this.opts.id]=this),zt(this,Dx)[Dx]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.setState({files:st(st({},this.getState().files),{[e]:st(st({},this.getState().files[e]),t)})})}i18nInit(){const e=new iI([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts=st(st(st({},this.opts),e),{restrictions:st(st({},this.opts.restrictions),e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=st({},this.getState().files),r={};Object.keys(t).forEach(n=>{const i=st({},t[n]);i.progress=st(st({},i.progress),e),r[n]=i}),this.setState({files:r,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){zt(this,zl)[zl].add(e)}removePreProcessor(e){return zt(this,zl)[zl].delete(e)}addPostProcessor(e){zt(this,Ra)[Ra].add(e)}removePostProcessor(e){return zt(this,Ra)[Ra].delete(e)}addUploader(e){zt(this,Wl)[Wl].add(e)}removeUploader(e){return zt(this,Wl)[Wl].delete(e)}setMeta(e){const t=st(st({},this.getState().meta),e),r=st({},this.getState().files);Object.keys(r).forEach(n=>{r[n]=st(st({},r[n]),{meta:st(st({},r[n].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r=st({},this.getState().files);if(!r[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const n=st(st({},r[e].meta),t);r[e]=st(st({},r[e]),{meta:n}),this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),n=Object.values(e),i=n.filter(y=>{let{progress:z}=y;return!z.uploadComplete&&z.uploadStarted}),o=n.filter(y=>!y.progress.uploadStarted),a=n.filter(y=>y.progress.uploadStarted||y.progress.preprocess||y.progress.postprocess),s=n.filter(y=>y.progress.uploadStarted),l=n.filter(y=>y.isPaused),u=n.filter(y=>y.progress.uploadComplete),c=n.filter(y=>y.error),h=i.filter(y=>!y.isPaused),S=n.filter(y=>y.progress.preprocess||y.progress.postprocess);return{newFiles:o,startedFiles:a,uploadStartedFiles:s,pausedFiles:l,completeFiles:u,erroredFiles:c,inProgressFiles:i,inProgressNotPausedFiles:h,processingFiles:S,isUploadStarted:s.length>0,isAllComplete:t===100&&u.length===n.length&&S.length===0,isAllErrored:!!r&&c.length===n.length,isAllPaused:i.length!==0&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:n.some(y=>y.isGhost)}}validateRestrictions(e,t){try{return zt(this,Mh)[Mh](e,t),{result:!0}}catch(r){return{result:!1,reason:r.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){zt(this,Fh)[Fh](e);const{files:t}=this.getState();let r=zt(this,Nh)[Nh](t,e);return t[r.id]&&t[r.id].isGhost&&(r=st(st({},t[r.id]),{data:e.data,isGhost:!1}),this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`)),this.setState({files:st(st({},t),{[r.id]:r})}),this.emit("file-added",r),this.emit("files-added",[r]),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),zt(this,jh)[jh](),r.id}addFiles(e){zt(this,Fh)[Fh]();const t=st({},this.getState().files),r=[],n=[];for(let i=0;i{this.emit("file-added",i)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.keys(r).forEach(i=>{this.log(`Added file: ${r[i].name} + */function nI(e,t){const r=/\$/g;let n=[e];if(t==null)return n;for(const i of Object.keys(t))if(i!=="_"){let o=t[i];typeof o=="string"&&(o=r[Symbol.replace](o,"$$$$")),n=xX(n,new RegExp(`%\\{${i}\\}`,"g"),o)}return n}var iI=(Tc=EX("apply"),class{constructor(e){Object.defineProperty(this,Tc,{value:SX}),this.locale={strings:{},pluralize:t=>t===1?0:1},Array.isArray(e)?e.forEach(rI(this,Tc)[Tc],this):rI(this,Tc)[Tc](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!function(n,i){return Object.prototype.hasOwnProperty.call(n,i)}(this.locale.strings,e))throw new Error(`missing string: ${e}`);const r=this.locale.strings[e];if(typeof r=="object"){if(t&&t.smart_count!==void 0)return nI(r[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return nI(r,t)}});function SX(e){if(e==null||!e.strings)return;const t=this.locale;this.locale=st(st({},t),{strings:st(st({},t.strings),e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}var oI=function(){var e={},t=e._fns={};return e.emit=function(r,n,i,o,a,s,l){var u=function(c){for(var h=t[c]?t[c]:[],S=c.indexOf(":"),y=S===-1?[c]:[c.substring(0,S),c.substring(S+1)],W=Object.keys(t),F=0,N=W.length;Fcrypto.getRandomValues(new Uint8Array(e)),sI=(e,t,r)=>{let n=(2<{let o="";for(;;){let a=r(i),s=i;for(;s--;)if(o+=e[a[s]&n]||"",o.length===t)return o}}};var TX={nanoid:(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t},customAlphabet:(e,t)=>sI(e,t,aI),customRandom:sI,urlAlphabet:CX,random:aI},Sx=function(e){if(typeof e!="number"||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function lI(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}lI.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if(typeof e=="string"||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t=2}return t?r(t.split(";")[0]):r},OX=0;function _X(e){return"__private_"+OX+++"_"+e}var wx=_X("publish");class uI{constructor(){Object.defineProperty(this,wx,{value:RX}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t=st({},this.state),r=st(st({},this.state),e);this.state=r,function(n,i){if(!Object.prototype.hasOwnProperty.call(n,i))throw new TypeError("attempted to use private field on non-instance");return n}(this,wx)[wx](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function RX(){for(var e=arguments.length,t=new Array(e),r=0;r{n(...t)})}uI.VERSION="2.0.3";var cI=function(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},dI={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function hI(e){let t="";return e.replace(/[^A-Z0-9]/gi,r=>(t+=`-${function(n){return n.charCodeAt(0).toString(32)}(r)}`,"/"))+t}var kX=function(e){if(e==null&&(e=typeof navigator!="undefined"?navigator.userAgent:null),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const r=t[1];let[n,i]=r.split(".");return n=parseInt(n,10),i=parseInt(i,10),n<15||n===15&&i<15063||n>18||n===18&&i>=18218};function Cx(e){return e<10?`0${e}`:e.toString()}var qv=function(){const e=new Date;return`${Cx(e.getHours())}:${Cx(e.getMinutes())}:${Cx(e.getSeconds())}`},fI={justErrorsLogger:{debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),r=0;rr,onBeforeUpload:r=>r,store:new uI,logger:MX,infoTimeout:5e3};if(this.opts=st(st(st({},t),e),{restrictions:st(st({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=BX),this.log(`Using Core v${this.constructor.VERSION}`),this.opts.restrictions.allowedFileTypes&&this.opts.restrictions.allowedFileTypes!==null&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.calculateProgress=Hl(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:kX(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:st({},this.opts.meta),info:[],recoveredState:null}),zt(this,Ih)[Ih]=this.store.subscribe((r,n,i)=>{this.emit("state-update",r,n,i),this.updateAll(n)}),this.opts.debug&&typeof window!="undefined"&&(window[this.opts.id]=this),zt(this,Dx)[Dx]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.setState({files:st(st({},this.getState().files),{[e]:st(st({},this.getState().files[e]),t)})})}i18nInit(){const e=new iI([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts=st(st(st({},this.opts),e),{restrictions:st(st({},this.opts.restrictions),e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=st({},this.getState().files),r={};Object.keys(t).forEach(n=>{const i=st({},t[n]);i.progress=st(st({},i.progress),e),r[n]=i}),this.setState({files:r,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){zt(this,zl)[zl].add(e)}removePreProcessor(e){return zt(this,zl)[zl].delete(e)}addPostProcessor(e){zt(this,Ra)[Ra].add(e)}removePostProcessor(e){return zt(this,Ra)[Ra].delete(e)}addUploader(e){zt(this,Wl)[Wl].add(e)}removeUploader(e){return zt(this,Wl)[Wl].delete(e)}setMeta(e){const t=st(st({},this.getState().meta),e),r=st({},this.getState().files);Object.keys(r).forEach(n=>{r[n]=st(st({},r[n]),{meta:st(st({},r[n].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r=st({},this.getState().files);if(!r[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const n=st(st({},r[e].meta),t);r[e]=st(st({},r[e]),{meta:n}),this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),n=Object.values(e),i=n.filter(y=>{let{progress:W}=y;return!W.uploadComplete&&W.uploadStarted}),o=n.filter(y=>!y.progress.uploadStarted),a=n.filter(y=>y.progress.uploadStarted||y.progress.preprocess||y.progress.postprocess),s=n.filter(y=>y.progress.uploadStarted),l=n.filter(y=>y.isPaused),u=n.filter(y=>y.progress.uploadComplete),c=n.filter(y=>y.error),h=i.filter(y=>!y.isPaused),S=n.filter(y=>y.progress.preprocess||y.progress.postprocess);return{newFiles:o,startedFiles:a,uploadStartedFiles:s,pausedFiles:l,completeFiles:u,erroredFiles:c,inProgressFiles:i,inProgressNotPausedFiles:h,processingFiles:S,isUploadStarted:s.length>0,isAllComplete:t===100&&u.length===n.length&&S.length===0,isAllErrored:!!r&&c.length===n.length,isAllPaused:i.length!==0&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:n.some(y=>y.isGhost)}}validateRestrictions(e,t){try{return zt(this,Mh)[Mh](e,t),{result:!0}}catch(r){return{result:!1,reason:r.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){zt(this,Fh)[Fh](e);const{files:t}=this.getState();let r=zt(this,Nh)[Nh](t,e);return t[r.id]&&t[r.id].isGhost&&(r=st(st({},t[r.id]),{data:e.data,isGhost:!1}),this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`)),this.setState({files:st(st({},t),{[r.id]:r})}),this.emit("file-added",r),this.emit("files-added",[r]),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),zt(this,jh)[jh](),r.id}addFiles(e){zt(this,Fh)[Fh]();const t=st({},this.getState().files),r=[],n=[];for(let i=0;i{this.emit("file-added",i)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.keys(r).forEach(i=>{this.log(`Added file: ${r[i].name} id: ${r[i].id} type: ${r[i].type}`)}),r.length>0&&zt(this,jh)[jh](),n.length>0){let i=`Multiple errors occurred while adding files: `;if(n.forEach(o=>{i+=` * ${o.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:n.length}),details:i},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(n,i);{const o=new Error(i);throw o.errors=n,o}}}removeFiles(e,t){const{files:r,currentUploads:n}=this.getState(),i=st({},r),o=st({},n),a=Object.create(null);function s(c){return a[c]===void 0}e.forEach(c=>{r[c]&&(a[c]=r[c],delete i[c])}),Object.keys(o).forEach(c=>{const h=n[c].fileIDs.filter(s);h.length!==0?o[c]=st(st({},n[c]),{fileIDs:h}):delete o[c]});const l={currentUploads:o,files:i};Object.keys(i).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const u=Object.keys(a);u.forEach(c=>{this.emit("file-removed",a[c],t)}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){t===void 0&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e=st({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const r=st(st({},e[t]),{isPaused:!0});e[t]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e=st({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const r=st(st({},e[t]),{isPaused:!1,error:null});e[t]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e=st({},this.getState().files),t=Object.keys(e).filter(n=>e[n].error);if(t.forEach(n=>{const i=st(st({},e[n]),{isPaused:!1,error:null});e[n]=i}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});const r=zt(this,ka)[ka](t,{forceAllowNewUpload:!0});return zt(this,La)[La](r)}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=zt(this,ka)[ka]([e],{forceAllowNewUpload:!0});return zt(this,La)[La](t)}reset(){this.cancelAll()}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const r=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:st(st({},this.getFile(e.id).progress),{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(e.length===0)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(s=>s.progress.bytesTotal!=null),r=e.filter(s=>s.progress.bytesTotal==null);if(t.length===0){const s=100*e.length,l=r.reduce((c,h)=>c+h.progress.percentage,0),u=Math.round(l/s*100);return void this.setState({totalProgress:u})}let n=t.reduce((s,l)=>s+l.progress.bytesTotal,0);const i=n/t.length;n+=i*r.length;let o=0;t.forEach(s=>{o+=s.progress.bytesUploaded}),r.forEach(s=>{o+=i*(s.progress.percentage||0)/100});let a=n===0?0:Math.round(o/n*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){window.navigator.onLine===void 0||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!="function")throw new TypeError(`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const r=new e(this,t),n=r.id;if(!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const i=this.getPlugin(n);if(i){const o=`Already found a plugin named '${i.id}'. Tried to use: '${n}'. -Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),r.type in zt(this,ni)[ni]?zt(this,ni)[ni][r.type].push(r):zt(this,ni)[ni][r.type]=[r],r.install(),this}getPlugin(e){for(const t of Object.values(zt(this,ni)[ni])){const r=t.find(n=>n.id===e);if(r!=null)return r}}[gI](e){return zt(this,ni)[ni][e]}iteratePlugins(e){Object.values(zt(this,ni)[ni]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=zt(this,ni)[ni][e.type],r=t.findIndex(i=>i.id===e.id);r!==-1&&t.splice(r,1);const n={plugins:st(st({},this.getState().plugins),{[e.id]:void 0})};this.setState(n)}close(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.reset(),zt(this,Ih)[Ih](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window!="undefined"&&window.removeEventListener&&(window.removeEventListener("online",zt(this,_o)[_o]),window.removeEventListener("offline",zt(this,_o)[_o]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);const n=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:n?e.message:e,details:n?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){const{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?zt(this,La)[La](e):(zt(this,Gl)[Gl](e),Promise.reject(new Error("Nonexistent upload")))}[vI](){return zt(this,ka)[ka](...arguments)}addResultData(e,t){if(!zt(this,Ox)[Ox](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:r}=this.getState(),n=st(st({},r[e]),{result:st(st({},r[e].result),t)});this.setState({currentUploads:st(st({},r),{[e]:n})})}upload(){var e;(e=zt(this,ni)[ni].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>{zt(this,Tx)[Tx](t),zt(this,Ax)[Ax](t)}).catch(n=>{zt(this,Un)[Un](n)}).then(()=>{const{currentUploads:n}=this.getState(),i=Object.values(n).flatMap(s=>s.fileIDs),o=[];Object.keys(t).forEach(s=>{const l=this.getFile(s);l.progress.uploadStarted||i.indexOf(s)!==-1||o.push(l.id)});const a=zt(this,ka)[ka](o);return zt(this,La)[La](a)}).catch(n=>{zt(this,Un)[Un](n,{showInformer:!1})}))}}function NX(e,t){t===void 0&&(t=this.getFiles());const{maxFileSize:r,minFileSize:n,maxTotalFileSize:i,maxNumberOfFiles:o,allowedFileTypes:a}=this.opts.restrictions;if(o&&t.length+1>o)throw new Jo(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(a&&!a.some(s=>s.indexOf("/")>-1?!!e.type&&DX(e.type.replace(/;.*?$/,""),s):!(s[0]!=="."||!e.extension)&&e.extension.toLowerCase()===s.substr(1).toLowerCase())){const s=a.join(", ");throw new Jo(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(i&&e.size!=null){let s=0;if(s+=e.size,t.forEach(l=>{s+=l.size}),s>i)throw new Jo(this.i18n("exceedsSize",{size:Sx(i),file:e.name}))}if(r&&e.size!=null&&e.size>r)throw new Jo(this.i18n("exceedsSize",{size:Sx(r),file:e.name}));if(n&&e.size!=null&&e.size{const n=this.getFile(r);return zt(this,Bh)[Bh](n)});if(t.length)throw new FX(t,`${this.i18n("missingRequiredMetaField")}`)}function zX(e,t){let{showInformer:r=!0,file:n=null,throwErr:i=!0}=t===void 0?{}:t;const o=typeof e=="object"?e.message:e,a=typeof e=="object"&&e.details?e.details:"";let s=o;if(a&&(s+=` ${a}`),e.isRestriction?(this.log(s),this.emit("restriction-failed",n,e)):this.log(s,"error"),r&&this.info({message:o,details:a},"error",this.opts.infoTimeout),i)throw typeof e=="object"?e:new Error(e)}function WX(e){const{allowNewUpload:t}=this.getState();t===!1&&zt(this,Un)[Un](new Jo(this.i18n("noMoreFilesAllowed")),{file:e})}function GX(e,t){const r=function(h){var S;if(h.type)return h.type;const y=h.name?(S=cI(h.name).extension)==null?void 0:S.toLowerCase():null;return y&&y in dI?dI[y]:"application/octet-stream"}(t),n=function(h,S){return S.name?S.name:h.split("/")[0]==="image"?`${h.split("/")[0]}.${h.split("/")[1]}`:"noname"}(r,t),i=cI(n).extension,o=Boolean(t.isRemote),a=function(h){let S="uppy";return typeof h.name=="string"&&(S+=`-${hI(h.name.toLowerCase())}`),h.type!==void 0&&(S+=`-${h.type}`),h.meta&&typeof h.meta.relativePath=="string"&&(S+=`-${hI(h.meta.relativePath.toLowerCase())}`),h.data.size!==void 0&&(S+=`-${h.data.size}`),h.data.lastModified!==void 0&&(S+=`-${h.data.lastModified}`),S}(st(st({},t),{type:r}));if(this.checkIfFileAlreadyExists(a)){const h=new Jo(this.i18n("noDuplicates",{fileName:n}));zt(this,Un)[Un](h,{file:t})}const s=t.meta||{};s.name=n,s.type=r;const l=Number.isFinite(t.data.size)?t.data.size:null;let u={source:t.source||"",id:a,name:n,extension:i||"",meta:st(st({},this.getState().meta),s),type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(u,e);c===!1?zt(this,Un)[Un](new Jo("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,fileDescriptor:t}):typeof c=="object"&&c!==null&&(u=c);try{const h=Object.keys(e).map(S=>e[S]);zt(this,Mh)[Mh](u,h)}catch(h){zt(this,Un)[Un](h,{file:u})}return u}function VX(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function KX(){const e=(t,r,n)=>{let i=t.message||"Unknown error";t.details&&(i+=` ${t.details}`),this.setState({error:i}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:i,response:n})};this.on("error",e),this.on("upload-error",(t,r,n)=>{if(e(r,t,n),typeof r=="object"&&r.message){const i=new Error(r.message);i.details=r.message,r.details&&(i.details+=` ${r.details}`),i.message=this.i18n("failedToUpload",{file:t.name}),zt(this,Un)[Un](i,{throwErr:!1})}else zt(this,Un)[Un](r,{throwErr:!1})}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",t=>{this.getFile(t.id)?this.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(t,r)=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const n=this.getFile(t.id).progress;this.setFileState(t.id,{progress:st(st({},n),{postprocess:zt(this,Ra)[Ra].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),t.size==null&&this.setFileState(t.id,{size:r.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(t,r)=>{this.getFile(t.id)?this.setFileState(t.id,{progress:st(st({},this.getFile(t.id).progress),{preprocess:r})}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("preprocess-complete",t=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const r=st({},this.getState().files);r[t.id]=st(st({},r[t.id]),{progress:st({},r[t.id].progress)}),delete r[t.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(t,r)=>{this.getFile(t.id)?this.setFileState(t.id,{progress:st(st({},this.getState().files[t.id].progress),{postprocess:r})}):this.log(`Not setting progress for a file that has been removed: ${t.id}`)}),this.on("postprocess-complete",t=>{if(!this.getFile(t.id))return void this.log(`Not setting progress for a file that has been removed: ${t.id}`);const r=st({},this.getState().files);r[t.id]=st(st({},r[t.id]),{progress:st({},r[t.id].progress)}),delete r[t.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",t=>{t&&zt(this,Bh)[Bh](t)}),typeof window!="undefined"&&window.addEventListener&&(window.addEventListener("online",zt(this,_o)[_o]),window.addEventListener("offline",zt(this,_o)[_o]),setTimeout(zt(this,_o)[_o],3e3))}function $X(e,t){t===void 0&&(t={});const{forceAllowNewUpload:r=!1}=t,{allowNewUpload:n,currentUploads:i}=this.getState();if(!n&&!r)throw new Error("Cannot create a new upload: already uploading.");const o=IX();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:st(st({},i),{[o]:{fileIDs:e,step:0,result:{}}})}),o}function XX(e){const{currentUploads:t}=this.getState();return t[e]}function YX(e){const t=st({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})}function ZX(e){return bR(this,null,function*(){let{currentUploads:t}=this.getState(),r=t[e];const n=r.step||0,i=[...zt(this,zl)[zl],...zt(this,Wl)[Wl],...zt(this,Ra)[Ra]];try{for(let a=n;a{const c=this.getFile(u);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});const a=r.fileIDs.map(u=>this.getFile(u)),s=a.filter(u=>!u.error),l=a.filter(u=>u.error);yield this.addResultData(e,{successful:s,failed:l,uploadID:e}),t=this.getState().currentUploads,r=t[e]}let o;return r&&(o=r.result,this.emit("complete",o),zt(this,Gl)[Gl](e)),o==null&&this.log(`Not setting result for an upload that has been removed: ${e}`),o})}mI.VERSION="2.1.3";var yI=mI,JX=oe(function(e,t){var r,n,i,o,a,s,l,u,c={},h=[],S=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function y(Re,Te){for(var Be in Te)Re[Be]=Te[Be];return Re}function z(Re){var Te=Re.parentNode;Te&&Te.removeChild(Re)}function F(Re,Te,Be){var it,vt,ut,kt={};for(ut in Te)ut=="key"?it=Te[ut]:ut=="ref"?vt=Te[ut]:kt[ut]=Te[ut];if(arguments.length>2&&(kt.children=arguments.length>3?r.call(arguments,2):Be),typeof Re=="function"&&Re.defaultProps!=null)for(ut in Re.defaultProps)kt[ut]===void 0&&(kt[ut]=Re.defaultProps[ut]);return N(Re,kt,it,vt,null)}function N(Re,Te,Be,it,vt){var ut={type:Re,props:Te,key:Be,ref:it,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:vt==null?++i:vt};return vt==null&&n.vnode!=null&&n.vnode(ut),ut}function j(Re){return Re.children}function D(Re,Te){this.props=Re,this.context=Te}function Q(Re,Te){if(Te==null)return Re.__?Q(Re.__,Re.__.__k.indexOf(Re)+1):null;for(var Be;Te0?N(Gt.type,Gt.props,Gt.key,null,Gt.__v):Gt)!=null){if(Gt.__=Be,Gt.__b=Be.__b+1,(lr=Hr[ft])===null||lr&&Gt.key==lr.key&&Gt.type===lr.type)Hr[ft]=void 0;else for(br=0;br2&&(kt.children=arguments.length>3?r.call(arguments,2):Be),N(Re.type,kt,it||Re.key,vt||Re.ref,null)},t.createContext=function(Re,Te){var Be={__c:Te="__cC"+u++,__:Re,Consumer:function(it,vt){return it.children(vt)},Provider:function(it){var vt,ut;return this.getChildContext||(vt=[],(ut={})[Te]=this,this.getChildContext=function(){return ut},this.shouldComponentUpdate=function(kt){this.props.value!==kt.value&&vt.some(he)},this.sub=function(kt){vt.push(kt);var Xt=kt.componentWillUnmount;kt.componentWillUnmount=function(){vt.splice(vt.indexOf(kt),1),Xt&&Xt.call(kt)}}),it.children}};return Be.Provider.__=Be.Consumer.contextType=Be},t.createElement=F,t.createRef=function(){return{current:null}},t.h=F,t.hydrate=function Re(Te,Be){It(Te,Be,Re)},t.isValidElement=o,t.options=n,t.render=It,t.toChildArray=function Re(Te,Be){return Be=Be||[],Te==null||typeof Te=="boolean"||(Array.isArray(Te)?Te.some(function(it){Re(it,Be)}):Be.push(Te)),Be}}),QX=function(e,t){return t===void 0&&(t=document),typeof e=="string"?t.querySelector(e):((r=e)==null?void 0:r.nodeType)===Node.ELEMENT_NODE?e:null;var r},_x=class{constructor(e,t){t===void 0&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:st(st({},t),{[this.id]:st(st({},t[this.id]),e)})})}setOptions(e){this.opts=st(st({},this.opts),e),this.setPluginState(),this.i18nInit()}i18nInit(){const e=new iI([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}};function bI(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var qX=0;function eY(e){return"__private_"+qX+++"_"+e}const{render:EI}=JX;var Uh=eY("updateUI");class xI extends _x{constructor(){super(...arguments),Object.defineProperty(this,Uh,{writable:!0,value:void 0})}mount(e,t){const r=t.id,n=QX(e);if(n){this.isTargetDOMEl=!0;const a=document.createDocumentFragment();return bI(this,Uh)[Uh]=function(s){let l=null,u=null;return function(){for(var c=arguments.length,h=new Array(c),S=0;S(l=null,s(...u)))),l}}(s=>{this.uppy.getPlugin(this.id)&&(EI(this.render(s),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),EI(this.render(this.uppy.getState()),a),this.el=a.firstElementChild,n.appendChild(a),this.onMount(),this.el}let i;if(typeof e=="object"&&e instanceof xI)i=e;else if(typeof e=="function"){const a=e;this.uppy.iteratePlugins(s=>{if(s instanceof a)return i=s,!1})}if(i)return this.uppy.log(`Installing ${r} to ${i.id}`),this.parent=i,this.el=i.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw o+=typeof e=="function"?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the "},mM=function(e){e.write(vM("")),e.close();var t=e.parentWindow.Object;return e=null,t},ym=function(){try{mm=new ActiveXObject("htmlfile")}catch(n){}var e,t;ym=typeof document!="undefined"?document.domain&&mm?mM(mm):((t=Zh("iframe")).style.display="none",lS.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(vM("document.F=Object")),e.close(),e.F):mM(mm);for(var r=vm.length;r--;)delete ym.prototype[vm[r]];return ym()};cm[gM]=!0;var bm=Object.create||function(e,t){var r;return e!==null?(uS.prototype=Sn(e),r=new uS,uS.prototype=null,r[gM]=e):r=ym(),t===void 0?r:zZ(r,t)},cS=an("unscopables"),dS=Array.prototype;dS[cS]==null&&Ro.f(dS,cS,{configurable:!0,value:bm(null)});var af=function(e){dS[cS][e]=!0},WZ=uM.includes;sn({target:"Array",proto:!0},{includes:function(e){return WZ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("includes");var GZ=an("match"),hS=function(e){var t;return Yr(e)&&((t=e[GZ])!==void 0?!!t:Lo(e)=="RegExp")},VZ=yt.TypeError,fS=function(e){if(hS(e))throw VZ("The method doesn't accept regular expressions");return e},KZ=an("match"),pS=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[KZ]=!1,"/./"[e](t)}catch(n){}}return!1},$Z=Wt("".indexOf);sn({target:"String",proto:!0,forced:!pS("includes")},{includes:function(e){return!!~$Z($r(so(this)),$r(fS(e)),arguments.length>1?arguments[1]:void 0)}});var XZ=/"/g,YZ=Wt("".replace);sn({target:"String",proto:!0,forced:Ir(function(){var e="".anchor('"');return e!==e.toLowerCase()||e.split('"').length>3})},{anchor:function(e){return t=e,r=$r(so(this)),n=""+r+"";var t,r,n}});var gS=function(e,t,r){var n,i;Sn(e);try{if(!(n=Jl(e,"return"))){if(t==="throw")throw r;return r}n=Cr(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Sn(n),r},ZZ=function(e,t,r,n){try{return n?t(Sn(r)[0],r[1]):t(r)}catch(i){gS(e,"throw",i)}},Mc={},JZ=an("iterator"),QZ=Array.prototype,yM=function(e){return e!==void 0&&(Mc.Array===e||QZ[JZ]===e)},sf=function(e,t,r){var n=Yx(t);n in e?Ro.f(e,n,am(0,r)):e[n]=r},qZ=an("iterator"),vS=function(e){if(e!=null)return Jl(e,qZ)||Jl(e,"@@iterator")||Mc[dm(e)]},eJ=yt.TypeError,bM=function(e,t){var r=arguments.length<2?vS(e):t;if(ys(r))return Sn(Cr(r,e));throw eJ(om(e)+" is not iterable")},EM=yt.Array,xM=an("iterator"),SM=!1;try{var tJ=0,wM={next:function(){return{done:!!tJ++}},return:function(){SM=!0}};wM[xM]=function(){return this},Array.from(wM,function(){throw 2})}catch(e){}var mS=function(e,t){if(!t&&!SM)return!1;var r=!1;try{var n={};n[xM]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(i){}return r},rJ=!mS(function(e){Array.from(e)});sn({target:"Array",stat:!0,forced:rJ},{from:function(e){var t=ms(e),r=gm(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=i!==void 0;o&&(i=ql(i,n>2?arguments[2]:void 0));var a,s,l,u,c,h,S=vS(t),y=0;if(!S||this==EM&&yM(S))for(a=eu(t),s=r?new this(a):EM(a);a>y;y++)h=o?i(t[y],y):t[y],sf(s,y,h);else for(c=(u=bM(t,S)).next,s=r?new this:[];!(l=Cr(c,u)).done;y++)h=o?ZZ(u,i,[l.value,y],!0):l.value,sf(s,y,h);return s.length=y,s}});var tu,CM,TM,nJ=Wt("".charAt),AM=Wt("".charCodeAt),iJ=Wt("".slice),DM=function(e){return function(t,r){var n,i,o=$r(so(t)),a=qh(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=AM(o,a))<55296||n>56319||a+1===s||(i=AM(o,a+1))<56320||i>57343?e?nJ(o,a):n:e?iJ(o,a,a+2):i-56320+(n-55296<<10)+65536}},OM={codeAt:DM(!1),charAt:DM(!0)},oJ=!Ir(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),_M=Zx("IE_PROTO"),yS=yt.Object,aJ=yS.prototype,Em=oJ?yS.getPrototypeOf:function(e){var t=ms(e);if(xn(t,_M))return t[_M];var r=t.constructor;return jr(r)&&t instanceof r?r.prototype:t instanceof yS?aJ:null},bS=an("iterator"),RM=!1;[].keys&&("next"in(TM=[].keys())?(CM=Em(Em(TM)))!==Object.prototype&&(tu=CM):RM=!0);var sJ=tu==null||Ir(function(){var e={};return tu[bS].call(e)!==e});sJ&&(tu={}),jr(tu[bS])||_i(tu,bS,function(){return this});var ES={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:RM},lJ=Ro.f,kM=an("toStringTag"),xm=function(e,t,r){e&&!xn(e=r?e:e.prototype,kM)&&lJ(e,kM,{configurable:!0,value:t})},uJ=ES.IteratorPrototype,cJ=function(){return this},dJ=yt.String,hJ=yt.TypeError,Bc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Wt(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Sn(n),function(o){if(typeof o=="object"||jr(o))return o;throw hJ("Can't set "+dJ(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),fJ=_c.PROPER,pJ=_c.CONFIGURABLE,LM=ES.IteratorPrototype,Sm=ES.BUGGY_SAFARI_ITERATORS,lf=an("iterator"),gJ=function(){return this},xS=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=bm(uJ,{next:am(1,Q)}),xm(j,he,!1),Mc[he]=cJ}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!Sm&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,z=y[lf]||y["@@iterator"]||i&&y[i],F=!Sm&&z||c(i),N=t=="Array"&&y.entries||z;if(N&&(s=Em(N.call(new e)))!==Object.prototype&&s.next&&(Em(s)!==LM&&(Bc?Bc(s,LM):jr(s[lf])||_i(s,lf,gJ)),xm(s,h,!0)),fJ&&i=="values"&&z&&z.name!=="values"&&(pJ?ko(y,"name","values"):(S=!0,F=function(){return Cr(z,this)})),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(Sm||S||!(u in y))&&_i(y,u,l[u]);else sn({target:t,proto:!0,forced:Sm||S},l);return y[lf]!==F&&_i(y,lf,F,{name:i}),Mc[t]=F,l},vJ=OM.charAt,mJ=hi.set,yJ=hi.getterFor("String Iterator");xS(String,"String",function(e){mJ(this,{type:"String Iterator",string:$r(e),index:0})},function(){var e,t=yJ(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=vJ(r,n),t.index+=e.length,{value:e,done:!1})});var SS,bJ=tf.f,PM=Wt("".endsWith),EJ=Wt("".slice),xJ=Math.min,IM=pS("endsWith"),SJ=!(IM||(SS=bJ(String.prototype,"endsWith"),!SS||SS.writable));sn({target:"String",proto:!0,forced:!SJ&&!IM},{endsWith:function(e){var t=$r(so(this));fS(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=r===void 0?n:xJ(Rc(r),n),o=$r(e);return PM?PM(t,o,i):EJ(t,i-o.length,i)===o}});var wJ=Wt([].join),CJ=fm!=Object,TJ=rM("join",",");sn({target:"Array",proto:!0,forced:CJ||!TJ},{join:function(e){return wJ(Es(this),e===void 0?",":e)}});var AJ=an("species"),wm=function(e){return Xh>=51||!Ir(function(){var t=[];return(t.constructor={})[AJ]=function(){return{foo:1}},t[e](Boolean).foo!==1})},DJ=kc.map,OJ=wm("map");sn({target:"Array",proto:!0,forced:!OJ},{map:function(e){return DJ(this,e,arguments.length>1?arguments[1]:void 0)}});var wS=yt.RegExp,CS=Ir(function(){var e=wS("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),_J=CS||Ir(function(){return!wS("a","y").sticky}),Cm={BROKEN_CARET:CS||Ir(function(){var e=wS("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:_J,UNSUPPORTED_Y:CS},RJ=yt.RegExp,TS=Ir(function(){var e=RJ(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),kJ=yt.RegExp,AS=Ir(function(){var e=kJ("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),LJ=hi.get,PJ=Ux("native-string-replace",String.prototype.replace),Tm=RegExp.prototype.exec,DS=Tm,IJ=Wt("".charAt),MJ=Wt("".indexOf),BJ=Wt("".replace),OS=Wt("".slice),_S=function(){var e=/a/,t=/b*/g;return Cr(Tm,e,"a"),Cr(Tm,t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),MM=Cm.BROKEN_CARET,RS=/()??/.exec("")[1]!==void 0;(_S||RS||MM||TS||AS)&&(DS=function(e){var t,r,n,i,o,a,s,l=this,u=LJ(l),c=$r(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Cr(DS,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=MM&&l.sticky,z=Cr(aS,l),F=l.source,N=0,j=c;if(y&&(z=BJ(z,"y",""),MJ(z,"g")===-1&&(z+="g"),j=OS(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&IJ(c,l.lastIndex-1)!==` -`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",z)),RS&&(r=new RegExp("^"+F+"$(?!\\s)",z)),_S&&(n=l.lastIndex),i=Cr(Tm,y?r:l,j),y?i?(i.input=OS(i.input,N),i[0]=OS(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:_S&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),RS&&i&&i.length>1&&Cr(PJ,i[0],r,function(){for(o=1;o]*>)/g,WJ=/\$([$&'`]|\d{1,2})/g,GJ=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=WJ;return i!==void 0&&(i=ms(i),l=zJ),HJ(o,l,function(u,c){var h;switch(BS(c,0)){case"$":return"$";case"&":return e;case"`":return FS(t,0,r);case"'":return FS(t,a);case"<":h=i[FS(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=UJ(S/10);return y===0?u:y<=s?n[y-1]===void 0?BS(c,1):n[y-1]+BS(c,1):u}h=n[S-1]}return h===void 0?"":h})},VJ=yt.TypeError,cf=function(e,t){var r=e.exec;if(jr(r)){var n=Cr(r,e,t);return n!==null&&Sn(n),n}if(Lo(e)==="RegExp")return Cr(uf,e,t);throw VJ("RegExp#exec called on incompatible receiver")},NS=an("replace"),KJ=Math.max,$J=Math.min,XJ=Wt([].concat),jS=Wt([].push),NM=Wt("".indexOf),jM=Wt("".slice),YJ="a".replace(/./,"$0")==="$0",UM=!!/./[NS]&&/./[NS]("a","$0")==="";IS("replace",function(e,t,r){var n=UM?"$":"$0";return[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,NS);return s?Cr(s,i,a,o):Cr(t,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i);if(typeof o=="string"&&NM(o,n)===-1&&NM(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=jr(o);u||(o=$r(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=cf(a,s);if(y===null)break;if(jS(S,y),!c)break;$r(y[0])===""&&(a.lastIndex=MS(s,Rc(a.lastIndex),h))}for(var z,F="",N=0,j=0;j=N&&(F+=jM(s,N,Q)+De,N=Q+D.length)}return F+jM(s,N)}]},!!Ir(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"})||!YJ||UM);/*! ***************************************************************************** + */function fM(e){return Object.prototype.toString.call(e)==="[object Object]"}sn({target:"Object",stat:!0,forced:MZ},{keys:function(e){return Pc(ms(e))}});var BZ={isHistory(e){return fM(t=e)!==!1&&((r=t.constructor)===void 0||fM(n=r.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||ss.isOperationList(e.redos[0]))&&(e.undos.length===0||ss.isOperationList(e.undos[0]));var t,r,n}},iS=new WeakMap,oS=new WeakMap,Ic={isHistoryEditor:e=>BZ.isHistory(e.history)&&de.isEditor(e),isMerging:e=>oS.get(e),isSaving:e=>iS.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var r=Ic.isMerging(e);oS.set(e,!1),t(),oS.set(e,r)},withoutSaving(e,t){var r=Ic.isSaving(e);iS.set(e,!1),t(),iS.set(e,r)}},FZ=yt.String,$r=function(e){if(dm(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return FZ(e)},aS=function(){var e=Sn(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},NZ=_c.PROPER,sS=RegExp.prototype,pM=sS.toString,jZ=Wt(aS),UZ=Ir(function(){return pM.call({source:"a",flags:"b"})!="/a/b"}),HZ=NZ&&pM.name!="toString";(UZ||HZ)&&_i(RegExp.prototype,"toString",function(){var e=Sn(this),t=$r(e.source),r=e.flags;return"/"+t+"/"+$r(r===void 0&&Zl(sS,e)&&!("flags"in sS)?jZ(e):r)},{unsafe:!0});var mm,zZ=Zn?Object.defineProperties:function(e,t){Sn(e);for(var r,n=Es(t),i=Pc(t),o=i.length,a=0;o>a;)Ro.f(e,r=i[a++],n[r]);return e},lS=Xl("document","documentElement"),gM=Zx("IE_PROTO"),uS=function(){},vM=function(e){return""},mM=function(e){e.write(vM("")),e.close();var t=e.parentWindow.Object;return e=null,t},ym=function(){try{mm=new ActiveXObject("htmlfile")}catch(n){}var e,t;ym=typeof document!="undefined"?document.domain&&mm?mM(mm):((t=Zh("iframe")).style.display="none",lS.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(vM("document.F=Object")),e.close(),e.F):mM(mm);for(var r=vm.length;r--;)delete ym.prototype[vm[r]];return ym()};cm[gM]=!0;var bm=Object.create||function(e,t){var r;return e!==null?(uS.prototype=Sn(e),r=new uS,uS.prototype=null,r[gM]=e):r=ym(),t===void 0?r:zZ(r,t)},cS=an("unscopables"),dS=Array.prototype;dS[cS]==null&&Ro.f(dS,cS,{configurable:!0,value:bm(null)});var af=function(e){dS[cS][e]=!0},WZ=uM.includes;sn({target:"Array",proto:!0},{includes:function(e){return WZ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("includes");var GZ=an("match"),hS=function(e){var t;return Yr(e)&&((t=e[GZ])!==void 0?!!t:Lo(e)=="RegExp")},VZ=yt.TypeError,fS=function(e){if(hS(e))throw VZ("The method doesn't accept regular expressions");return e},KZ=an("match"),pS=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[KZ]=!1,"/./"[e](t)}catch(n){}}return!1},$Z=Wt("".indexOf);sn({target:"String",proto:!0,forced:!pS("includes")},{includes:function(e){return!!~$Z($r(so(this)),$r(fS(e)),arguments.length>1?arguments[1]:void 0)}});var XZ=/"/g,YZ=Wt("".replace);sn({target:"String",proto:!0,forced:Ir(function(){var e="".anchor('"');return e!==e.toLowerCase()||e.split('"').length>3})},{anchor:function(e){return t=e,r=$r(so(this)),n=""+r+"";var t,r,n}});var gS=function(e,t,r){var n,i;Sn(e);try{if(!(n=Jl(e,"return"))){if(t==="throw")throw r;return r}n=Cr(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return Sn(n),r},ZZ=function(e,t,r,n){try{return n?t(Sn(r)[0],r[1]):t(r)}catch(i){gS(e,"throw",i)}},Mc={},JZ=an("iterator"),QZ=Array.prototype,yM=function(e){return e!==void 0&&(Mc.Array===e||QZ[JZ]===e)},sf=function(e,t,r){var n=Yx(t);n in e?Ro.f(e,n,am(0,r)):e[n]=r},qZ=an("iterator"),vS=function(e){if(e!=null)return Jl(e,qZ)||Jl(e,"@@iterator")||Mc[dm(e)]},eJ=yt.TypeError,bM=function(e,t){var r=arguments.length<2?vS(e):t;if(ys(r))return Sn(Cr(r,e));throw eJ(om(e)+" is not iterable")},EM=yt.Array,xM=an("iterator"),SM=!1;try{var tJ=0,wM={next:function(){return{done:!!tJ++}},return:function(){SM=!0}};wM[xM]=function(){return this},Array.from(wM,function(){throw 2})}catch(e){}var mS=function(e,t){if(!t&&!SM)return!1;var r=!1;try{var n={};n[xM]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(i){}return r},rJ=!mS(function(e){Array.from(e)});sn({target:"Array",stat:!0,forced:rJ},{from:function(e){var t=ms(e),r=gm(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=i!==void 0;o&&(i=ql(i,n>2?arguments[2]:void 0));var a,s,l,u,c,h,S=vS(t),y=0;if(!S||this==EM&&yM(S))for(a=eu(t),s=r?new this(a):EM(a);a>y;y++)h=o?i(t[y],y):t[y],sf(s,y,h);else for(c=(u=bM(t,S)).next,s=r?new this:[];!(l=Cr(c,u)).done;y++)h=o?ZZ(u,i,[l.value,y],!0):l.value,sf(s,y,h);return s.length=y,s}});var tu,CM,TM,nJ=Wt("".charAt),AM=Wt("".charCodeAt),iJ=Wt("".slice),DM=function(e){return function(t,r){var n,i,o=$r(so(t)),a=qh(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=AM(o,a))<55296||n>56319||a+1===s||(i=AM(o,a+1))<56320||i>57343?e?nJ(o,a):n:e?iJ(o,a,a+2):i-56320+(n-55296<<10)+65536}},OM={codeAt:DM(!1),charAt:DM(!0)},oJ=!Ir(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),_M=Zx("IE_PROTO"),yS=yt.Object,aJ=yS.prototype,Em=oJ?yS.getPrototypeOf:function(e){var t=ms(e);if(xn(t,_M))return t[_M];var r=t.constructor;return jr(r)&&t instanceof r?r.prototype:t instanceof yS?aJ:null},bS=an("iterator"),RM=!1;[].keys&&("next"in(TM=[].keys())?(CM=Em(Em(TM)))!==Object.prototype&&(tu=CM):RM=!0);var sJ=tu==null||Ir(function(){var e={};return tu[bS].call(e)!==e});sJ&&(tu={}),jr(tu[bS])||_i(tu,bS,function(){return this});var ES={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:RM},lJ=Ro.f,kM=an("toStringTag"),xm=function(e,t,r){e&&!xn(e=r?e:e.prototype,kM)&&lJ(e,kM,{configurable:!0,value:t})},uJ=ES.IteratorPrototype,cJ=function(){return this},dJ=yt.String,hJ=yt.TypeError,Bc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Wt(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(n){}return function(n,i){return Sn(n),function(o){if(typeof o=="object"||jr(o))return o;throw hJ("Can't set "+dJ(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),fJ=_c.PROPER,pJ=_c.CONFIGURABLE,LM=ES.IteratorPrototype,Sm=ES.BUGGY_SAFARI_ITERATORS,lf=an("iterator"),gJ=function(){return this},xS=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=bm(uJ,{next:am(1,Q)}),xm(j,he,!1),Mc[he]=cJ}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!Sm&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[lf]||y["@@iterator"]||i&&y[i],F=!Sm&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=Em(N.call(new e)))!==Object.prototype&&s.next&&(Em(s)!==LM&&(Bc?Bc(s,LM):jr(s[lf])||_i(s,lf,gJ)),xm(s,h,!0)),fJ&&i=="values"&&W&&W.name!=="values"&&(pJ?ko(y,"name","values"):(S=!0,F=function(){return Cr(W,this)})),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(Sm||S||!(u in y))&&_i(y,u,l[u]);else sn({target:t,proto:!0,forced:Sm||S},l);return y[lf]!==F&&_i(y,lf,F,{name:i}),Mc[t]=F,l},vJ=OM.charAt,mJ=hi.set,yJ=hi.getterFor("String Iterator");xS(String,"String",function(e){mJ(this,{type:"String Iterator",string:$r(e),index:0})},function(){var e,t=yJ(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=vJ(r,n),t.index+=e.length,{value:e,done:!1})});var SS,bJ=tf.f,PM=Wt("".endsWith),EJ=Wt("".slice),xJ=Math.min,IM=pS("endsWith"),SJ=!(IM||(SS=bJ(String.prototype,"endsWith"),!SS||SS.writable));sn({target:"String",proto:!0,forced:!SJ&&!IM},{endsWith:function(e){var t=$r(so(this));fS(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=r===void 0?n:xJ(Rc(r),n),o=$r(e);return PM?PM(t,o,i):EJ(t,i-o.length,i)===o}});var wJ=Wt([].join),CJ=fm!=Object,TJ=rM("join",",");sn({target:"Array",proto:!0,forced:CJ||!TJ},{join:function(e){return wJ(Es(this),e===void 0?",":e)}});var AJ=an("species"),wm=function(e){return Xh>=51||!Ir(function(){var t=[];return(t.constructor={})[AJ]=function(){return{foo:1}},t[e](Boolean).foo!==1})},DJ=kc.map,OJ=wm("map");sn({target:"Array",proto:!0,forced:!OJ},{map:function(e){return DJ(this,e,arguments.length>1?arguments[1]:void 0)}});var wS=yt.RegExp,CS=Ir(function(){var e=wS("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),_J=CS||Ir(function(){return!wS("a","y").sticky}),Cm={BROKEN_CARET:CS||Ir(function(){var e=wS("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:_J,UNSUPPORTED_Y:CS},RJ=yt.RegExp,TS=Ir(function(){var e=RJ(".","s");return!(e.dotAll&&e.exec(` +`)&&e.flags==="s")}),kJ=yt.RegExp,AS=Ir(function(){var e=kJ("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),LJ=hi.get,PJ=Ux("native-string-replace",String.prototype.replace),Tm=RegExp.prototype.exec,DS=Tm,IJ=Wt("".charAt),MJ=Wt("".indexOf),BJ=Wt("".replace),OS=Wt("".slice),_S=function(){var e=/a/,t=/b*/g;return Cr(Tm,e,"a"),Cr(Tm,t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),MM=Cm.BROKEN_CARET,RS=/()??/.exec("")[1]!==void 0;(_S||RS||MM||TS||AS)&&(DS=function(e){var t,r,n,i,o,a,s,l=this,u=LJ(l),c=$r(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Cr(DS,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=MM&&l.sticky,W=Cr(aS,l),F=l.source,N=0,j=c;if(y&&(W=BJ(W,"y",""),MJ(W,"g")===-1&&(W+="g"),j=OS(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&IJ(c,l.lastIndex-1)!==` +`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",W)),RS&&(r=new RegExp("^"+F+"$(?!\\s)",W)),_S&&(n=l.lastIndex),i=Cr(Tm,y?r:l,j),y?i?(i.input=OS(i.input,N),i[0]=OS(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:_S&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),RS&&i&&i.length>1&&Cr(PJ,i[0],r,function(){for(o=1;o]*>)/g,WJ=/\$([$&'`]|\d{1,2})/g,GJ=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=WJ;return i!==void 0&&(i=ms(i),l=zJ),HJ(o,l,function(u,c){var h;switch(BS(c,0)){case"$":return"$";case"&":return e;case"`":return FS(t,0,r);case"'":return FS(t,a);case"<":h=i[FS(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=UJ(S/10);return y===0?u:y<=s?n[y-1]===void 0?BS(c,1):n[y-1]+BS(c,1):u}h=n[S-1]}return h===void 0?"":h})},VJ=yt.TypeError,cf=function(e,t){var r=e.exec;if(jr(r)){var n=Cr(r,e,t);return n!==null&&Sn(n),n}if(Lo(e)==="RegExp")return Cr(uf,e,t);throw VJ("RegExp#exec called on incompatible receiver")},NS=an("replace"),KJ=Math.max,$J=Math.min,XJ=Wt([].concat),jS=Wt([].push),NM=Wt("".indexOf),jM=Wt("".slice),YJ="a".replace(/./,"$0")==="$0",UM=!!/./[NS]&&/./[NS]("a","$0")==="";IS("replace",function(e,t,r){var n=UM?"$":"$0";return[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,NS);return s?Cr(s,i,a,o):Cr(t,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i);if(typeof o=="string"&&NM(o,n)===-1&&NM(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=jr(o);u||(o=$r(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=cf(a,s);if(y===null)break;if(jS(S,y),!c)break;$r(y[0])===""&&(a.lastIndex=MS(s,Rc(a.lastIndex),h))}for(var W,F="",N=0,j=0;j=N&&(F+=jM(s,N,Q)+De,N=Q+D.length)}return F+jM(s,N)}]},!!Ir(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"})||!YJ||UM);/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -382,17 +382,17 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var US=function(e,t){return US=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},US(e,t)};function Fc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}US(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var lo=function(){return lo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function HS(e,t){for(var r=0,n=t.length,i=e.length;r=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Mc.Arguments=Mc.Array,af("keys"),af("values"),af("entries");var Nc=function(e,t,r){for(var n in t)_i(e,n,t[n],r);return e},qJ=yt.Array,eQ=Math.max,zS=function(e,t,r){for(var n=eu(e),i=Lc(t,n),o=Lc(r===void 0?n:r,n),a=qJ(eQ(o-i,0)),s=0;io;o++)if((s=N(e[o]))&&Zl(VM,s))return s;return new Om(!1)}n=bM(e,i)}for(l=n.next;!(u=Cr(l,n)).done;){try{s=N(u.value)}catch(j){gS(n,"throw",j)}if(typeof s=="object"&&s&&Zl(VM,s))return s}return new Om(!1)},iQ=yt.TypeError,_m=function(e,t){if(Zl(t,e))return e;throw iQ("Incorrect invocation")},KM=function(e,t,r){var n,i;return Bc&&jr(n=t.constructor)&&n!==r&&Yr(i=n.prototype)&&i!==r.prototype&&Bc(e,i),e},$M=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=yt[e],s=a&&a.prototype,l=a,u={},c=function(N){var j=Wt(s[N]);_i(s,N,N=="add"?function(D){return j(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!Yr(D))&&j(this,D===0?0:D)}:N=="get"?function(D){return i&&!Yr(D)?void 0:j(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!Yr(D))&&j(this,D===0?0:D)}:function(D,Q){return j(this,D===0?0:D,Q),this})};if(of(e,!jr(a)||!(i||s.forEach&&!Ir(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),Dm.enable();else if(of(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=Ir(function(){h.has(1)}),z=mS(function(N){new a(N)}),F=!i&&Ir(function(){for(var N=new a,j=5;j--;)N[o](j,j);return!N.has(-0)});z||((l=t(function(N,j){_m(N,s);var D=KM(new a,N,l);return j!=null&&hf(j,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||F)&&(c("delete"),c("has"),n&&c("get")),(F||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,sn({global:!0,forced:l!=a},u),xm(l,e),i||r.setStrong(l,e,n),l},Rm=Dm.getWeakData,oQ=hi.set,aQ=hi.getterFor,sQ=kc.find,lQ=kc.findIndex,uQ=Wt([].splice),cQ=0,km=function(e){return e.frozen||(e.frozen=new XM)},XM=function(){this.entries=[]},WS=function(e,t){return sQ(e.entries,function(r){return r[0]===t})};XM.prototype={get:function(e){var t=WS(this,e);if(t)return t[1]},has:function(e){return!!WS(this,e)},set:function(e,t){var r=WS(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=lQ(this.entries,function(r){return r[0]===e});return~t&&uQ(this.entries,t,1),!!~t}};var ff,YM={getConstructor:function(e,t,r,n){var i=e(function(l,u){_m(l,o),oQ(l,{type:t,id:cQ++,frozen:void 0}),u!=null&&hf(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=aQ(t),s=function(l,u,c){var h=a(l),S=Rm(Sn(u),!0);return S===!0?km(h).set(u,c):S[h.id]=c,l};return Nc(o,{delete:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).delete(l):c&&xn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).has(l):c&&xn(c,u.id)}}),Nc(o,r?{get:function(l){var u=a(this);if(Yr(l)){var c=Rm(l);return c===!0?km(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},Lm=hi.enforce,dQ=!yt.ActiveXObject&&"ActiveXObject"in yt,ZM=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},hQ=$M("WeakMap",ZM,YM);if(GI&&dQ){ff=YM.getConstructor(ZM,"WeakMap",!0),Dm.enable();var pf=hQ.prototype,JM=Wt(pf.delete),Pm=Wt(pf.has),QM=Wt(pf.get),qM=Wt(pf.set);Nc(pf,{delete:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),JM(this,e)||t.frozen.delete(e)}return JM(this,e)},has:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)||t.frozen.has(e)}return Pm(this,e)},get:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)?QM(this,e):t.frozen.get(e)}return QM(this,e)},set:function(e,t){if(Yr(e)&&!ru(e)){var r=Lm(this);r.frozen||(r.frozen=new ff),Pm(this,e)?qM(this,e,t):r.frozen.set(e,t)}else qM(this,e,t);return this}})}var GS=an("iterator"),e4=an("toStringTag"),VS=df.values,t4=function(e,t){if(e){if(e[GS]!==VS)try{ko(e,GS,VS)}catch(n){e[GS]=VS}if(e[e4]||ko(e,e4,t),hm[t]){for(var r in df)if(e[r]!==df[r])try{ko(e,r,df[r])}catch(n){e[r]=df[r]}}}};for(var KS in hm)t4(yt[KS]&&yt[KS].prototype,KS);t4(YI,"DOMTokenList");var $S=new WeakMap,XS=new WeakMap,YS=new WeakMap,Im=new WeakMap,ZS=new WeakMap,Mm=new WeakMap,JS=new WeakMap,QS=new WeakMap,Bm=new WeakMap,r4=new WeakMap,n4=new WeakMap,i4=new WeakMap,o4=new WeakMap,gf=new WeakMap,jc=new WeakMap,qS=new WeakMap,Fm=new WeakMap,ew=new WeakMap,Nm=new WeakMap,jm=new WeakMap,a4=new WeakMap,nu=new WeakMap,tw=new WeakMap,s4=new WeakMap,rw=new WeakMap,fQ=kc.find,l4=!0;"find"in[]&&Array(1).find(function(){l4=!1}),sn({target:"Array",proto:!0,forced:l4},{find:function(e){return fQ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("find"),sn({global:!0},{globalThis:yt});const pQ=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];Wv&&(_e.fn.css=Wv),io&&(_e.fn.append=io),fc&&(_e.fn.addClass=fc),pc&&(_e.fn.removeClass=pc),gc&&(_e.fn.hasClass=gc),Zo&&(_e.fn.on=Zo),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),jv&&(_e.fn.removeAttr=jv),mc&&(_e.fn.hide=mc),zv&&(_e.fn.show=zv),hP&&(_e.fn.offset=hP),Uv&&(_e.fn.width=Uv),Hv&&(_e.fn.height=Hv),yc&&(_e.fn.parent=yc),Kv&&(_e.fn.parents=Kv),pP&&(_e.fn.is=pP),vc&&(_e.fn.dataset=vc),Yo&&(_e.fn.val=Yo),Vv&&(_e.fn.text=Vv),us&&(_e.fn.html=us),Ec&&(_e.fn.children=Ec),xc&&(_e.fn.remove=xc),bc&&(_e.fn.find=bc),Gv&&(_e.fn.each=Gv),Sc&&(_e.fn.empty=Sc);var ta,fi,nw=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Po=function(e){return iu(e)&&e.nodeType===1},iu=function(e){var t=nw(e);return!!t&&e instanceof t.Node},u4=function(e){var t=e&&e.anchorNode&&nw(e.anchorNode);return!!t&&e instanceof t.Selection},c4=function(e){return iu(e)&&e.nodeType===3},iw=function(e){var t,r,n;return(t=window.document.getElementById(e))!==null&&t!==void 0?t:((n=(r=window.document.activeElement)===null||r===void 0?void 0:r.shadowRoot)===null||n===void 0?void 0:n.getElementById(e))||null},d4=function(e,t,r){for(var n,i=e.childNodes,o=i[t],a=t,s=!1,l=!1;(iu(n=o)&&n.nodeType===8||Po(o)&&o.childNodes.length===0||Po(o)&&o.getAttribute("contenteditable")==="false")&&(!s||!l);)a>=i.length?(s=!0,a=t-1,r="backward"):a<0?(l=!0,a=t+1,r="forward"):(o=i[a],t=a,a+=r==="forward"?1:-1);return[o,t]},gQ=function(e,t,r){return Tr(d4(e,t,r),1)[0]},vQ=function e(t){var r,n,i="";if(c4(t)&&t.nodeValue)return t.nodeValue;if(Po(t)){try{for(var o=uo(Array.from(t.childNodes)),a=o.next();!a.done;a=o.next())i+=e(a.value)}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}var s=getComputedStyle(t).getPropertyValue("display");s!=="block"&&s!=="list"&&s!=="table-row"&&t.tagName!=="BR"||(i+=` -`)}return i};function h4(e,t){if(!(e instanceof HTMLElement&&e.dataset.slateVoid==="true"))for(var r=e.childNodes,n=r.length;n--;){var i=r[n],o=i.nodeType;o==3?t(i,e):o!=1&&o!=9&&o!=11||h4(i,t)}}function f4(e){if(e.length===0)return"";var t=e[0];return t.nodeType!==ta.ELEMENT_NODE?"":t.tagName.toLowerCase()}(fi=ta||(ta={}))[fi.ELEMENT_NODE=1]="ELEMENT_NODE",fi[fi.TEXT_NODE=3]="TEXT_NODE",fi[fi.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",fi[fi.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",fi[fi.COMMENT_NODE=8]="COMMENT_NODE",fi[fi.DOCUMENT_NODE=9]="DOCUMENT_NODE",fi[fi.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",fi[fi.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var ow=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),vf=typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var mf=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),mQ=typeof navigator!="undefined"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yQ=typeof navigator!="undefined"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),aw=typeof navigator!="undefined"&&/Chrome/i.test(navigator.userAgent);typeof navigator!="undefined"&&/.*QQBrowser/.test(navigator.userAgent);var yf=!yQ&&!mQ&&typeof globalThis!="undefined"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Ae={getWindow:function(e){var t=a4.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var r=jm.get(t);return r||(r=new HM,jm.set(t,r)),r},setNewKey:function(e){var t=new HM;jm.set(e,t)},findPath:function(e,t){for(var r=[],n=t;;){var i=jc.get(n);if(i==null){if(de.isEditor(n))return r;break}var o=gf.get(n);if(o==null)break;r.unshift(o),n=i}throw new Error("Unable to find the path for Slate node: "+JSON.stringify(t))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ae.toDOMNode(e,e),r=t.getRootNode();return(r instanceof Document||r instanceof ShadowRoot)&&r.getSelection!=null?r:t.ownerDocument},getParentNode:function(e,t){return jc.get(t)||null},getParentsNodes:function(e,t){for(var r=[],n=t;n!==e&&n!=null;){var i=Ae.getParentNode(e,n);if(i==null)break;r.push(i),n=i}return r},getTopNode:function(e,t){var r=[Ae.findPath(e,t)[0]];return St.get(e,r)},toDOMNode:function(e,t){var r;if(de.isEditor(t))r=qS.get(e);else{var n=Ae.findKey(e,t);r=ew.get(n)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: "+JSON.stringify(t));return r},hasDOMNode:function(e,t,r){r===void 0&&(r={});var n,i=r.editable,o=i!==void 0&&i,a=Ae.toDOMNode(e,e);try{n=Po(t)?t:t.parentElement}catch(s){if(!s.message.includes('Permission denied to access property "nodeType"'))throw s}return!!n&&n.closest("[data-slate-editor]")===a&&(!o||n.isContentEditable||!!n.getAttribute("data-slate-zero-width"))},toDOMRange:function(e,t){var r=t.anchor,n=t.focus,i=Qe.isBackward(t),o=Ae.toDOMPoint(e,r),a=Qe.isCollapsed(t)?o:Ae.toDOMPoint(e,n),s=Ae.getWindow(e).document.createRange(),l=Tr(i?a:o,2),u=l[0],c=l[1],h=Tr(i?o:a,2),S=h[0],y=h[1],z=!!(Po(u)?u:u.parentElement).getAttribute("data-slate-zero-width"),F=!!(Po(S)?S:S.parentElement).getAttribute("data-slate-zero-width");return s.setStart(u,z?1:c),s.setEnd(S,F?1:y),s},toDOMPoint:function(e,t){var r,n,i,o=Tr(de.node(e,t.path),1)[0],a=Ae.toDOMNode(e,o);de.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var u=uo(s),c=u.next();!c.done;c=u.next()){var h=c.value,S=h.childNodes[0];if(S!=null&&S.textContent!=null){var y=S.textContent.length,z=h.getAttribute("data-slate-length"),F=l+(z==null?y:parseInt(z,10));if(t.offset<=F){i=[S,Math.min(y,Math.max(0,t.offset-l))];break}l=F}}}catch(N){r={error:N}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: "+JSON.stringify(t));return i},toSlateNode:function(e,t){var r=Po(t)?t:t.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var n=r?Fm.get(r):null;if(!n)throw new Error("Cannot resolve a Slate node from DOM node: "+r);return n},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var r=t.clientX,n=t.clientY,i=t.target;if(r==null||n==null)throw new Error("Cannot resolve a Slate range from a DOM event: "+t);var o,a=Ae.toSlateNode(e,t.target),s=Ae.findPath(e,a);if(de.isVoid(e,a)){var l=i.getBoundingClientRect(),u=e.isInline(a)?r-l.left0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(t==null)return!1;if(Qe.isExpanded(t))return!1;var r=Ae.getSelectedNodeByType(e,"paragraph");if(r===null)return!1;var n=r.children;return n.length===1&&(n[0].text===""||void 0)},isEmptyPath:function(e,t){var r=de.node(e,t);if(r==null)return!1;var n=Tr(r,1)[0].children;return n.length===1&&n[0].text===""}},bQ=1,p4={},bf={},EQ=kc.filter,xQ=wm("filter");sn({target:"Array",proto:!0,forced:!xQ},{filter:function(e){return EQ(this,e,arguments.length>1?arguments[1]:void 0)}});var sw=` -\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,g4=Wt("".replace),Um="["+sw+"]",SQ=RegExp("^"+Um+Um+"*"),wQ=RegExp(Um+Um+"*$"),lw=function(e){return function(t){var r=$r(so(t));return 1&e&&(r=g4(r,SQ,"")),2&e&&(r=g4(r,wQ,"")),r}},CQ={start:lw(1),end:lw(2),trim:lw(3)},TQ=_c.PROPER,AQ=CQ.trim;sn({target:"String",proto:!0,forced:function(e){return Ir(function(){return!!sw[e]()||"\u200B\x85\u180E"[e]()!=="\u200B\x85\u180E"||TQ&&sw[e].name!==e})}("trim")},{trim:function(){return AQ(this)}});var uw=[],v4={};function DQ(e,t,r){var n=r.isInline(e)?"span":"div";return"<"+n+">"+t+""}var Ef,Uc,m4,cw,Hm=yt.Promise,y4=an("species"),dw=function(e){var t=Xl(e),r=Ro.f;Zn&&t&&!t[y4]&&r(t,y4,{configurable:!0,get:function(){return this}})},OQ=yt.TypeError,_Q=an("species"),b4=function(e,t){var r,n=Sn(e).constructor;return n===void 0||(r=Sn(n)[_Q])==null?t:function(i){if(gm(i))return i;throw OQ(om(i)+" is not a constructor")}(r)},E4=Wt([].slice),x4=/(?:ipad|iphone|ipod).*applewebkit/i.test(Dc),xs=Lo(yt.process)=="process",hw=yt.setImmediate,fw=yt.clearImmediate,RQ=yt.process,pw=yt.Dispatch,kQ=yt.Function,S4=yt.MessageChannel,LQ=yt.String,gw=0,xf={};try{Ef=yt.location}catch(e){}var vw=function(e){if(xn(xf,e)){var t=xf[e];delete xf[e],t()}},mw=function(e){return function(){vw(e)}},w4=function(e){vw(e.data)},C4=function(e){yt.postMessage(LQ(e),Ef.protocol+"//"+Ef.host)};hw&&fw||(hw=function(e){var t=E4(arguments,1);return xf[++gw]=function(){LS(jr(e)?e:kQ(e),void 0,t)},Uc(gw),gw},fw=function(e){delete xf[e]},xs?Uc=function(e){RQ.nextTick(mw(e))}:pw&&pw.now?Uc=function(e){pw.now(mw(e))}:S4&&!x4?(cw=(m4=new S4).port2,m4.port1.onmessage=w4,Uc=ql(cw.postMessage,cw)):yt.addEventListener&&jr(yt.postMessage)&&!yt.importScripts&&Ef&&Ef.protocol!=="file:"&&!Ir(C4)?(Uc=C4,yt.addEventListener("message",w4,!1)):Uc="onreadystatechange"in Zh("script")?function(e){lS.appendChild(Zh("script")).onreadystatechange=function(){lS.removeChild(this),vw(e)}}:function(e){setTimeout(mw(e),0)});var Sf,ou,wf,Hc,yw,bw,Ew,T4,A4={set:hw,clear:fw},PQ=/ipad|iphone|ipod/i.test(Dc)&&yt.Pebble!==void 0,IQ=/web0s(?!.*chrome)/i.test(Dc),MQ=tf.f,xw=A4.set,D4=yt.MutationObserver||yt.WebKitMutationObserver,O4=yt.document,_4=yt.process,zm=yt.Promise,R4=MQ(yt,"queueMicrotask"),k4=R4&&R4.value;k4||(Sf=function(){var e,t;for(xs&&(e=_4.domain)&&e.exit();ou;){t=ou.fn,ou=ou.next;try{t()}catch(r){throw ou?Hc():wf=void 0,r}}wf=void 0,e&&e.enter()},x4||xs||IQ||!D4||!O4?!PQ&&zm&&zm.resolve?((Ew=zm.resolve(void 0)).constructor=zm,T4=ql(Ew.then,Ew),Hc=function(){T4(Sf)}):xs?Hc=function(){_4.nextTick(Sf)}:(xw=ql(xw,yt),Hc=function(){xw(Sf)}):(yw=!0,bw=O4.createTextNode(""),new D4(Sf).observe(bw,{characterData:!0}),Hc=function(){bw.data=yw=!yw}));var Sw,L4,P4,I4,M4=k4||function(e){var t={fn:e,next:void 0};wf&&(wf.next=t),ou||(ou=t,Hc()),wf=t},BQ=function(e){var t,r;this.promise=new e(function(n,i){if(t!==void 0||r!==void 0)throw TypeError("Bad Promise constructor");t=n,r=i}),this.resolve=ys(t),this.reject=ys(r)},ww={f:function(e){return new BQ(e)}},Cw=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},FQ=typeof window=="object",B4=A4.set,NQ=an("species"),ra="Promise",F4=hi.getterFor(ra),jQ=hi.set,UQ=hi.getterFor(ra),au=Hm&&Hm.prototype,na=Hm,Cf=au,N4=yt.TypeError,Tw=yt.document,Aw=yt.process,zc=ww.f,HQ=zc,zQ=!!(Tw&&Tw.createEvent&&yt.dispatchEvent),j4=jr(yt.PromiseRejectionEvent),U4=!1,Tf=of(ra,function(){var e=um(na),t=e!==String(na);if(!t&&Xh===66)return!0;if(Xh>=51&&/native code/.test(e))return!1;var r=new na(function(i){i(1)}),n=function(i){i(function(){},function(){})};return(r.constructor={})[NQ]=n,!(U4=r.then(function(){})instanceof n)||!t&&FQ&&!j4}),WQ=Tf||!mS(function(e){na.all(e).catch(function(){})}),H4=function(e){var t;return!(!Yr(e)||!jr(t=e.then))&&t},Dw=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;M4(function(){for(var n=e.value,i=e.state==1,o=0;r.length>o;){var a,s,l,u=r[o++],c=i?u.ok:u.fail,h=u.resolve,S=u.reject,y=u.domain;try{c?(i||(e.rejection===2&&VQ(e),e.rejection=1),c===!0?a=n:(y&&y.enter(),a=c(n),y&&(y.exit(),l=!0)),a===u.promise?S(N4("Promise-chain cycle")):(s=H4(a))?Cr(s,a,h,S):h(a)):S(n)}catch(z){y&&!l&&y.exit(),S(z)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&GQ(e)})}},z4=function(e,t,r){var n,i;zQ?((n=Tw.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),yt.dispatchEvent(n)):n={promise:t,reason:r},!j4&&(i=yt["on"+e])?i(n):e==="unhandledrejection"&&function(o,a){var s=yt.console;s&&s.error&&(arguments.length==1?s.error(o):s.error(o,a))}("Unhandled promise rejection",r)},GQ=function(e){Cr(B4,yt,function(){var t,r=e.facade,n=e.value;if(W4(e)&&(t=Cw(function(){xs?Aw.emit("unhandledRejection",n,r):z4("unhandledrejection",r,n)}),e.rejection=xs||W4(e)?2:1,t.error))throw t.value})},W4=function(e){return e.rejection!==1&&!e.parent},VQ=function(e){Cr(B4,yt,function(){var t=e.facade;xs?Aw.emit("rejectionHandled",t):z4("rejectionhandled",t,e.value)})},Wc=function(e,t,r){return function(n){e(t,n,r)}},Gc=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Dw(e,!0))},Ow=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw N4("Promise can't be resolved itself");var n=H4(t);n?M4(function(){var i={done:!1};try{Cr(n,t,Wc(Ow,i,e),Wc(Gc,i,e))}catch(o){Gc(i,o,e)}}):(e.value=t,e.state=1,Dw(e,!1))}catch(i){Gc({done:!1},i,e)}}};if(Tf&&(Cf=(na=function(e){_m(this,Cf),ys(e),Cr(Sw,this);var t=F4(this);try{e(Wc(Ow,t),Wc(Gc,t))}catch(r){Gc(t,r)}}).prototype,(Sw=function(e){jQ(this,{type:ra,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Nc(Cf,{then:function(e,t){var r=UQ(this),n=r.reactions,i=zc(b4(this,na));return i.ok=!jr(e)||e,i.fail=jr(t)&&t,i.domain=xs?Aw.domain:void 0,r.parent=!0,n[n.length]=i,r.state!=0&&Dw(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),L4=function(){var e=new Sw,t=F4(e);this.promise=e,this.resolve=Wc(Ow,t),this.reject=Wc(Gc,t)},ww.f=zc=function(e){return e===na||e===P4?new L4(e):HQ(e)},jr(Hm)&&au!==Object.prototype)){I4=au.then,U4||(_i(au,"then",function(e,t){var r=this;return new na(function(n,i){Cr(I4,r,n,i)}).then(e,t)},{unsafe:!0}),_i(au,"catch",Cf.catch,{unsafe:!0}));try{delete au.constructor}catch(e){}Bc&&Bc(au,Cf)}sn({global:!0,wrap:!0,forced:Tf},{Promise:na}),xm(na,ra,!1),dw(ra),P4=Xl(ra),sn({target:ra,stat:!0,forced:Tf},{reject:function(e){var t=zc(this);return Cr(t.reject,void 0,e),t.promise}}),sn({target:ra,stat:!0,forced:Tf},{resolve:function(e){return function(t,r){if(Sn(t),Yr(r)&&r.constructor===t)return r;var n=ww.f(t);return(0,n.resolve)(r),n.promise}(this,e)}}),sn({target:ra,stat:!0,forced:WQ},{all:function(e){var t=this,r=zc(t),n=r.resolve,i=r.reject,o=Cw(function(){var a=ys(t.resolve),s=[],l=0,u=1;hf(e,function(c){var h=l++,S=!1;u++,Cr(a,t,c).then(function(y){S||(S=!0,s[h]=y,--u||n(s))},i)}),--u||n(s)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=zc(t),n=r.reject,i=Cw(function(){var o=ys(t.resolve);hf(e,function(a){Cr(o,t,a).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var Vc=Cm.UNSUPPORTED_Y,KQ=Math.min,G4=[].push,$Q=Wt(/./.exec),Kc=Wt(G4),Af=Wt("".slice);function co(e){Promise.resolve().then(e)}function V4(e,t){return Ut.isElement(e)?function(r,n){var i=r.type,o=i===void 0?"":i,a=r.children,s=a===void 0?[]:a,l=de.isVoid(n,r),u="";l||(u=s.map(function(j){return V4(j,n)}).join(""));var c=function(j){return v4[j]||DQ}(o),h=c(r,u,n),S="";if(S=typeof h=="string"?h:h.html||"",l||uw.forEach(function(j){return S=j(r,S)}),typeof h=="string")return S;var y=h.prefix,z=y===void 0?"":y,F=h.suffix,N=F===void 0?"":F;return z&&(S=z+S),N&&(S+=N),S}(e,t):function(r,n){var i=r.text;if(i==null)throw new Error("Current node is not slate Text "+JSON.stringify(r));var o=i;o=function(l){return l.replace(/ {2}/g,"  ").replace(//g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(o);var a=Ae.getParentsNodes(n,r).some(function(l){return Ae.getNodeType(l)==="pre"});if(a||(o=o.replace(/\r\n|\r|\n/g,"
")),a&&(o=o.replace(/ /g," ")),o===""){var s=Ae.getParentNode(null,r);if(!s||s.children.length!==0)return o;o="
"}return uw.forEach(function(l){return o=l(r,o)}),o}(e,t)}function K4(e){return"w-e-element-"+e}IS("split",function(e,t,r){var n;return n="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(i,o){var a=$r(so(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!hS(i))return Cr(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,z=new RegExp(i.source,S+"g");(l=Cr(uf,z,a))&&!((u=z.lastIndex)>y&&(Kc(h,Af(a,y,l.index)),l.length>1&&l.index=s));)z.lastIndex===l.index&&z.lastIndex++;return y===a.length?!c&&$Q(z,"")||Kc(h,""):Kc(h,Af(a,y)),h.length>s?zS(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:Cr(t,this,i,o)}:t,[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,e);return s?Cr(s,i,a,o):Cr(n,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=b4(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Vc?"g":"y"),S=new u(Vc?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return cf(S,s)===null?[s]:[];for(var z=0,F=0,N=[];F=r},X4=function(e,t,r){var n=Ae.toDOMRange(e,t).getBoundingClientRect(),i=Ae.toDOMRange(e,r).getBoundingClientRect();return $4(n,i)&&$4(i,n)},Y4=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Z4=[],_w=[],Wm={},XQ=Ro.f,YQ=rf.f,ZQ=hi.enforce,JQ=an("match"),Ia=yt.RegExp,$c=Ia.prototype,QQ=yt.SyntaxError,qQ=Wt(aS),eq=Wt($c.exec),Gm=Wt("".charAt),J4=Wt("".replace),Q4=Wt("".indexOf),tq=Wt("".slice),rq=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,su=/a/g,Rw=/a/g,nq=new Ia(su)!==su,q4=Cm.MISSED_STICKY,iq=Cm.UNSUPPORTED_Y,oq=Zn&&(!nq||q4||TS||AS||Ir(function(){return Rw[JQ]=!1,Ia(su)!=su||Ia(Rw)==Rw||Ia(su,"i")!="/a/i"}));if(of("RegExp",oq)){for(var Ss=function(e,t){var r,n,i,o,a,s,l=Zl($c,this),u=hS(e),c=t===void 0,h=[],S=e;if(!l&&u&&c&&e.constructor===Ss)return e;if((u||Zl($c,e))&&(e=e.source,c&&(t="flags"in S?S.flags:qQ(S))),e=e===void 0?"":$r(e),t=t===void 0?"":$r(t),S=e,TS&&"dotAll"in su&&(n=!!t&&Q4(t,"s")>-1)&&(t=J4(t,/s/g,"")),r=t,q4&&"sticky"in su&&(i=!!t&&Q4(t,"y")>-1)&&iq&&(t=J4(t,/y/g,"")),AS&&(o=function(y){for(var z,F=y.length,N=0,j="",D=[],Q={},te=!1,he=!1,Ee=0,ve="";N<=F;N++){if((z=Gm(y,N))==="\\")z+=Gm(y,++N);else if(z==="]")te=!1;else if(!te)switch(!0){case z==="[":te=!0;break;case z==="(":eq(rq,tq(y,N+1))&&(N+=2,he=!0),j+=z,Ee++;continue;case(z===">"&&he):if(ve===""||xn(Q,ve))throw new QQ("Invalid capture group name");Q[ve]=!0,D[D.length]=[ve,Ee],he=!1,ve="";continue}he?ve+=z:j+=z}return[j,D]}(e),e=o[0],h=o[1]),a=KM(Ia(e,t),l?this:$c,Ss),(n||i||h.length)&&(s=ZQ(a),n&&(s.dotAll=!0,s.raw=Ss(function(y){for(var z,F=y.length,N=0,j="",D=!1;N<=F;N++)(z=Gm(y,N))!=="\\"?D||z!=="."?(z==="["?D=!0:z==="]"&&(D=!1),j+=z):j+="[\\s\\S]":j+=z+Gm(y,++N);return j}(e),r)),i&&(s.sticky=!0),h.length&&(s.groups=h)),e!==S)try{ko(a,"source",S===""?"(?:)":S)}catch(y){}return a},aq=function(e){e in Ss||XQ(Ss,e,{configurable:!0,get:function(){return Ia[e]},set:function(t){Ia[e]=t}})},e3=YQ(Ia),t3=0;e3.length>t3;)aq(e3[t3++]);$c.constructor=Ss,Ss.prototype=$c,_i(yt,"RegExp",Ss)}dw("RegExp");var sq=new RegExp(String.fromCharCode(160),"g");function r3(e){return e.replace(sq," ")}function n3(e,t){var r=e.length;if(r){var n=e[r-1];if(Rt.isText(n)){var i=Object.keys(n);if(i.length===1&&i[0]==="text")return n.text=n.text+t,!0}}return!1}function lq(e,t,r){return{type:"paragraph",children:[{text:_e(e).text().replace(/\s+/gm," ")}]}}function kw(e,t){var r=function(o,a){var s=[];if(o.attr("data-w-e-is-void")!=null)return s;var l=o[0].childNodes;return l.length===1&&l[0].nodeName==="BR"?(s.push({text:""}),s):(l.forEach(function(u){if(u.nodeType!==ta.ELEMENT_NODE){if(!(u.nodeType!==ta.TEXT_NODE)){var c=u.textContent||"";if(c.trim()===""&&c.indexOf(` +***************************************************************************** */var US=function(e,t){return US=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},US(e,t)};function Fc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}US(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var lo=function(){return lo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function HS(e,t){for(var r=0,n=t.length,i=e.length;r=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Mc.Arguments=Mc.Array,af("keys"),af("values"),af("entries");var Nc=function(e,t,r){for(var n in t)_i(e,n,t[n],r);return e},qJ=yt.Array,eQ=Math.max,zS=function(e,t,r){for(var n=eu(e),i=Lc(t,n),o=Lc(r===void 0?n:r,n),a=qJ(eQ(o-i,0)),s=0;io;o++)if((s=N(e[o]))&&Zl(VM,s))return s;return new Om(!1)}n=bM(e,i)}for(l=n.next;!(u=Cr(l,n)).done;){try{s=N(u.value)}catch(j){gS(n,"throw",j)}if(typeof s=="object"&&s&&Zl(VM,s))return s}return new Om(!1)},iQ=yt.TypeError,_m=function(e,t){if(Zl(t,e))return e;throw iQ("Incorrect invocation")},KM=function(e,t,r){var n,i;return Bc&&jr(n=t.constructor)&&n!==r&&Yr(i=n.prototype)&&i!==r.prototype&&Bc(e,i),e},$M=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=yt[e],s=a&&a.prototype,l=a,u={},c=function(N){var j=Wt(s[N]);_i(s,N,N=="add"?function(D){return j(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!Yr(D))&&j(this,D===0?0:D)}:N=="get"?function(D){return i&&!Yr(D)?void 0:j(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!Yr(D))&&j(this,D===0?0:D)}:function(D,Q){return j(this,D===0?0:D,Q),this})};if(of(e,!jr(a)||!(i||s.forEach&&!Ir(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),Dm.enable();else if(of(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=Ir(function(){h.has(1)}),W=mS(function(N){new a(N)}),F=!i&&Ir(function(){for(var N=new a,j=5;j--;)N[o](j,j);return!N.has(-0)});W||((l=t(function(N,j){_m(N,s);var D=KM(new a,N,l);return j!=null&&hf(j,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||F)&&(c("delete"),c("has"),n&&c("get")),(F||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,sn({global:!0,forced:l!=a},u),xm(l,e),i||r.setStrong(l,e,n),l},Rm=Dm.getWeakData,oQ=hi.set,aQ=hi.getterFor,sQ=kc.find,lQ=kc.findIndex,uQ=Wt([].splice),cQ=0,km=function(e){return e.frozen||(e.frozen=new XM)},XM=function(){this.entries=[]},WS=function(e,t){return sQ(e.entries,function(r){return r[0]===t})};XM.prototype={get:function(e){var t=WS(this,e);if(t)return t[1]},has:function(e){return!!WS(this,e)},set:function(e,t){var r=WS(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=lQ(this.entries,function(r){return r[0]===e});return~t&&uQ(this.entries,t,1),!!~t}};var ff,YM={getConstructor:function(e,t,r,n){var i=e(function(l,u){_m(l,o),oQ(l,{type:t,id:cQ++,frozen:void 0}),u!=null&&hf(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=aQ(t),s=function(l,u,c){var h=a(l),S=Rm(Sn(u),!0);return S===!0?km(h).set(u,c):S[h.id]=c,l};return Nc(o,{delete:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).delete(l):c&&xn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!Yr(l))return!1;var c=Rm(l);return c===!0?km(u).has(l):c&&xn(c,u.id)}}),Nc(o,r?{get:function(l){var u=a(this);if(Yr(l)){var c=Rm(l);return c===!0?km(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},Lm=hi.enforce,dQ=!yt.ActiveXObject&&"ActiveXObject"in yt,ZM=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},hQ=$M("WeakMap",ZM,YM);if(GI&&dQ){ff=YM.getConstructor(ZM,"WeakMap",!0),Dm.enable();var pf=hQ.prototype,JM=Wt(pf.delete),Pm=Wt(pf.has),QM=Wt(pf.get),qM=Wt(pf.set);Nc(pf,{delete:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),JM(this,e)||t.frozen.delete(e)}return JM(this,e)},has:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)||t.frozen.has(e)}return Pm(this,e)},get:function(e){if(Yr(e)&&!ru(e)){var t=Lm(this);return t.frozen||(t.frozen=new ff),Pm(this,e)?QM(this,e):t.frozen.get(e)}return QM(this,e)},set:function(e,t){if(Yr(e)&&!ru(e)){var r=Lm(this);r.frozen||(r.frozen=new ff),Pm(this,e)?qM(this,e,t):r.frozen.set(e,t)}else qM(this,e,t);return this}})}var GS=an("iterator"),e4=an("toStringTag"),VS=df.values,t4=function(e,t){if(e){if(e[GS]!==VS)try{ko(e,GS,VS)}catch(n){e[GS]=VS}if(e[e4]||ko(e,e4,t),hm[t]){for(var r in df)if(e[r]!==df[r])try{ko(e,r,df[r])}catch(n){e[r]=df[r]}}}};for(var KS in hm)t4(yt[KS]&&yt[KS].prototype,KS);t4(YI,"DOMTokenList");var $S=new WeakMap,XS=new WeakMap,YS=new WeakMap,Im=new WeakMap,ZS=new WeakMap,Mm=new WeakMap,JS=new WeakMap,QS=new WeakMap,Bm=new WeakMap,r4=new WeakMap,n4=new WeakMap,i4=new WeakMap,o4=new WeakMap,gf=new WeakMap,jc=new WeakMap,qS=new WeakMap,Fm=new WeakMap,ew=new WeakMap,Nm=new WeakMap,jm=new WeakMap,a4=new WeakMap,nu=new WeakMap,tw=new WeakMap,s4=new WeakMap,rw=new WeakMap,fQ=kc.find,l4=!0;"find"in[]&&Array(1).find(function(){l4=!1}),sn({target:"Array",proto:!0,forced:l4},{find:function(e){return fQ(this,e,arguments.length>1?arguments[1]:void 0)}}),af("find"),sn({global:!0},{globalThis:yt});const pQ=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];Wv&&(_e.fn.css=Wv),io&&(_e.fn.append=io),fc&&(_e.fn.addClass=fc),pc&&(_e.fn.removeClass=pc),gc&&(_e.fn.hasClass=gc),Zo&&(_e.fn.on=Zo),cs&&(_e.fn.focus=cs),no&&(_e.fn.attr=no),jv&&(_e.fn.removeAttr=jv),mc&&(_e.fn.hide=mc),zv&&(_e.fn.show=zv),hP&&(_e.fn.offset=hP),Uv&&(_e.fn.width=Uv),Hv&&(_e.fn.height=Hv),yc&&(_e.fn.parent=yc),Kv&&(_e.fn.parents=Kv),pP&&(_e.fn.is=pP),vc&&(_e.fn.dataset=vc),Yo&&(_e.fn.val=Yo),Vv&&(_e.fn.text=Vv),us&&(_e.fn.html=us),Ec&&(_e.fn.children=Ec),xc&&(_e.fn.remove=xc),bc&&(_e.fn.find=bc),Gv&&(_e.fn.each=Gv),Sc&&(_e.fn.empty=Sc);var ta,fi,nw=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Po=function(e){return iu(e)&&e.nodeType===1},iu=function(e){var t=nw(e);return!!t&&e instanceof t.Node},u4=function(e){var t=e&&e.anchorNode&&nw(e.anchorNode);return!!t&&e instanceof t.Selection},c4=function(e){return iu(e)&&e.nodeType===3},iw=function(e){var t,r,n;return(t=window.document.getElementById(e))!==null&&t!==void 0?t:((n=(r=window.document.activeElement)===null||r===void 0?void 0:r.shadowRoot)===null||n===void 0?void 0:n.getElementById(e))||null},d4=function(e,t,r){for(var n,i=e.childNodes,o=i[t],a=t,s=!1,l=!1;(iu(n=o)&&n.nodeType===8||Po(o)&&o.childNodes.length===0||Po(o)&&o.getAttribute("contenteditable")==="false")&&(!s||!l);)a>=i.length?(s=!0,a=t-1,r="backward"):a<0?(l=!0,a=t+1,r="forward"):(o=i[a],t=a,a+=r==="forward"?1:-1);return[o,t]},gQ=function(e,t,r){return Tr(d4(e,t,r),1)[0]},vQ=function e(t){var r,n,i="";if(c4(t)&&t.nodeValue)return t.nodeValue;if(Po(t)){try{for(var o=uo(Array.from(t.childNodes)),a=o.next();!a.done;a=o.next())i+=e(a.value)}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}var s=getComputedStyle(t).getPropertyValue("display");s!=="block"&&s!=="list"&&s!=="table-row"&&t.tagName!=="BR"||(i+=` +`)}return i};function h4(e,t){if(!(e instanceof HTMLElement&&e.dataset.slateVoid==="true"))for(var r=e.childNodes,n=r.length;n--;){var i=r[n],o=i.nodeType;o==3?t(i,e):o!=1&&o!=9&&o!=11||h4(i,t)}}function f4(e){if(e.length===0)return"";var t=e[0];return t.nodeType!==ta.ELEMENT_NODE?"":t.tagName.toLowerCase()}(fi=ta||(ta={}))[fi.ELEMENT_NODE=1]="ELEMENT_NODE",fi[fi.TEXT_NODE=3]="TEXT_NODE",fi[fi.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",fi[fi.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",fi[fi.COMMENT_NODE=8]="COMMENT_NODE",fi[fi.DOCUMENT_NODE=9]="DOCUMENT_NODE",fi[fi.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",fi[fi.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var ow=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),vf=typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator!="undefined"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var mf=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),mQ=typeof navigator!="undefined"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yQ=typeof navigator!="undefined"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),aw=typeof navigator!="undefined"&&/Chrome/i.test(navigator.userAgent);typeof navigator!="undefined"&&/.*QQBrowser/.test(navigator.userAgent);var yf=!yQ&&!mQ&&typeof globalThis!="undefined"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",Ae={getWindow:function(e){var t=a4.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var r=jm.get(t);return r||(r=new HM,jm.set(t,r)),r},setNewKey:function(e){var t=new HM;jm.set(e,t)},findPath:function(e,t){for(var r=[],n=t;;){var i=jc.get(n);if(i==null){if(de.isEditor(n))return r;break}var o=gf.get(n);if(o==null)break;r.unshift(o),n=i}throw new Error("Unable to find the path for Slate node: "+JSON.stringify(t))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ae.toDOMNode(e,e),r=t.getRootNode();return(r instanceof Document||r instanceof ShadowRoot)&&r.getSelection!=null?r:t.ownerDocument},getParentNode:function(e,t){return jc.get(t)||null},getParentsNodes:function(e,t){for(var r=[],n=t;n!==e&&n!=null;){var i=Ae.getParentNode(e,n);if(i==null)break;r.push(i),n=i}return r},getTopNode:function(e,t){var r=[Ae.findPath(e,t)[0]];return St.get(e,r)},toDOMNode:function(e,t){var r;if(de.isEditor(t))r=qS.get(e);else{var n=Ae.findKey(e,t);r=ew.get(n)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: "+JSON.stringify(t));return r},hasDOMNode:function(e,t,r){r===void 0&&(r={});var n,i=r.editable,o=i!==void 0&&i,a=Ae.toDOMNode(e,e);try{n=Po(t)?t:t.parentElement}catch(s){if(!s.message.includes('Permission denied to access property "nodeType"'))throw s}return!!n&&n.closest("[data-slate-editor]")===a&&(!o||n.isContentEditable||!!n.getAttribute("data-slate-zero-width"))},toDOMRange:function(e,t){var r=t.anchor,n=t.focus,i=Je.isBackward(t),o=Ae.toDOMPoint(e,r),a=Je.isCollapsed(t)?o:Ae.toDOMPoint(e,n),s=Ae.getWindow(e).document.createRange(),l=Tr(i?a:o,2),u=l[0],c=l[1],h=Tr(i?o:a,2),S=h[0],y=h[1],W=!!(Po(u)?u:u.parentElement).getAttribute("data-slate-zero-width"),F=!!(Po(S)?S:S.parentElement).getAttribute("data-slate-zero-width");return s.setStart(u,W?1:c),s.setEnd(S,F?1:y),s},toDOMPoint:function(e,t){var r,n,i,o=Tr(de.node(e,t.path),1)[0],a=Ae.toDOMNode(e,o);de.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var u=uo(s),c=u.next();!c.done;c=u.next()){var h=c.value,S=h.childNodes[0];if(S!=null&&S.textContent!=null){var y=S.textContent.length,W=h.getAttribute("data-slate-length"),F=l+(W==null?y:parseInt(W,10));if(t.offset<=F){i=[S,Math.min(y,Math.max(0,t.offset-l))];break}l=F}}}catch(N){r={error:N}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: "+JSON.stringify(t));return i},toSlateNode:function(e,t){var r=Po(t)?t:t.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var n=r?Fm.get(r):null;if(!n)throw new Error("Cannot resolve a Slate node from DOM node: "+r);return n},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var r=t.clientX,n=t.clientY,i=t.target;if(r==null||n==null)throw new Error("Cannot resolve a Slate range from a DOM event: "+t);var o,a=Ae.toSlateNode(e,t.target),s=Ae.findPath(e,a);if(de.isVoid(e,a)){var l=i.getBoundingClientRect(),u=e.isInline(a)?r-l.left0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(t==null)return!1;if(Je.isExpanded(t))return!1;var r=Ae.getSelectedNodeByType(e,"paragraph");if(r===null)return!1;var n=r.children;return n.length===1&&(n[0].text===""||void 0)},isEmptyPath:function(e,t){var r=de.node(e,t);if(r==null)return!1;var n=Tr(r,1)[0].children;return n.length===1&&n[0].text===""}},bQ=1,p4={},bf={},EQ=kc.filter,xQ=wm("filter");sn({target:"Array",proto:!0,forced:!xQ},{filter:function(e){return EQ(this,e,arguments.length>1?arguments[1]:void 0)}});var sw=` +\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,g4=Wt("".replace),Um="["+sw+"]",SQ=RegExp("^"+Um+Um+"*"),wQ=RegExp(Um+Um+"*$"),lw=function(e){return function(t){var r=$r(so(t));return 1&e&&(r=g4(r,SQ,"")),2&e&&(r=g4(r,wQ,"")),r}},CQ={start:lw(1),end:lw(2),trim:lw(3)},TQ=_c.PROPER,AQ=CQ.trim;sn({target:"String",proto:!0,forced:function(e){return Ir(function(){return!!sw[e]()||"\u200B\x85\u180E"[e]()!=="\u200B\x85\u180E"||TQ&&sw[e].name!==e})}("trim")},{trim:function(){return AQ(this)}});var uw=[],v4={};function DQ(e,t,r){var n=r.isInline(e)?"span":"div";return"<"+n+">"+t+""}var Ef,Uc,m4,cw,Hm=yt.Promise,y4=an("species"),dw=function(e){var t=Xl(e),r=Ro.f;Zn&&t&&!t[y4]&&r(t,y4,{configurable:!0,get:function(){return this}})},OQ=yt.TypeError,_Q=an("species"),b4=function(e,t){var r,n=Sn(e).constructor;return n===void 0||(r=Sn(n)[_Q])==null?t:function(i){if(gm(i))return i;throw OQ(om(i)+" is not a constructor")}(r)},E4=Wt([].slice),x4=/(?:ipad|iphone|ipod).*applewebkit/i.test(Dc),xs=Lo(yt.process)=="process",hw=yt.setImmediate,fw=yt.clearImmediate,RQ=yt.process,pw=yt.Dispatch,kQ=yt.Function,S4=yt.MessageChannel,LQ=yt.String,gw=0,xf={};try{Ef=yt.location}catch(e){}var vw=function(e){if(xn(xf,e)){var t=xf[e];delete xf[e],t()}},mw=function(e){return function(){vw(e)}},w4=function(e){vw(e.data)},C4=function(e){yt.postMessage(LQ(e),Ef.protocol+"//"+Ef.host)};hw&&fw||(hw=function(e){var t=E4(arguments,1);return xf[++gw]=function(){LS(jr(e)?e:kQ(e),void 0,t)},Uc(gw),gw},fw=function(e){delete xf[e]},xs?Uc=function(e){RQ.nextTick(mw(e))}:pw&&pw.now?Uc=function(e){pw.now(mw(e))}:S4&&!x4?(cw=(m4=new S4).port2,m4.port1.onmessage=w4,Uc=ql(cw.postMessage,cw)):yt.addEventListener&&jr(yt.postMessage)&&!yt.importScripts&&Ef&&Ef.protocol!=="file:"&&!Ir(C4)?(Uc=C4,yt.addEventListener("message",w4,!1)):Uc="onreadystatechange"in Zh("script")?function(e){lS.appendChild(Zh("script")).onreadystatechange=function(){lS.removeChild(this),vw(e)}}:function(e){setTimeout(mw(e),0)});var Sf,ou,wf,Hc,yw,bw,Ew,T4,A4={set:hw,clear:fw},PQ=/ipad|iphone|ipod/i.test(Dc)&&yt.Pebble!==void 0,IQ=/web0s(?!.*chrome)/i.test(Dc),MQ=tf.f,xw=A4.set,D4=yt.MutationObserver||yt.WebKitMutationObserver,O4=yt.document,_4=yt.process,zm=yt.Promise,R4=MQ(yt,"queueMicrotask"),k4=R4&&R4.value;k4||(Sf=function(){var e,t;for(xs&&(e=_4.domain)&&e.exit();ou;){t=ou.fn,ou=ou.next;try{t()}catch(r){throw ou?Hc():wf=void 0,r}}wf=void 0,e&&e.enter()},x4||xs||IQ||!D4||!O4?!PQ&&zm&&zm.resolve?((Ew=zm.resolve(void 0)).constructor=zm,T4=ql(Ew.then,Ew),Hc=function(){T4(Sf)}):xs?Hc=function(){_4.nextTick(Sf)}:(xw=ql(xw,yt),Hc=function(){xw(Sf)}):(yw=!0,bw=O4.createTextNode(""),new D4(Sf).observe(bw,{characterData:!0}),Hc=function(){bw.data=yw=!yw}));var Sw,L4,P4,I4,M4=k4||function(e){var t={fn:e,next:void 0};wf&&(wf.next=t),ou||(ou=t,Hc()),wf=t},BQ=function(e){var t,r;this.promise=new e(function(n,i){if(t!==void 0||r!==void 0)throw TypeError("Bad Promise constructor");t=n,r=i}),this.resolve=ys(t),this.reject=ys(r)},ww={f:function(e){return new BQ(e)}},Cw=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},FQ=typeof window=="object",B4=A4.set,NQ=an("species"),ra="Promise",F4=hi.getterFor(ra),jQ=hi.set,UQ=hi.getterFor(ra),au=Hm&&Hm.prototype,na=Hm,Cf=au,N4=yt.TypeError,Tw=yt.document,Aw=yt.process,zc=ww.f,HQ=zc,zQ=!!(Tw&&Tw.createEvent&&yt.dispatchEvent),j4=jr(yt.PromiseRejectionEvent),U4=!1,Tf=of(ra,function(){var e=um(na),t=e!==String(na);if(!t&&Xh===66)return!0;if(Xh>=51&&/native code/.test(e))return!1;var r=new na(function(i){i(1)}),n=function(i){i(function(){},function(){})};return(r.constructor={})[NQ]=n,!(U4=r.then(function(){})instanceof n)||!t&&FQ&&!j4}),WQ=Tf||!mS(function(e){na.all(e).catch(function(){})}),H4=function(e){var t;return!(!Yr(e)||!jr(t=e.then))&&t},Dw=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;M4(function(){for(var n=e.value,i=e.state==1,o=0;r.length>o;){var a,s,l,u=r[o++],c=i?u.ok:u.fail,h=u.resolve,S=u.reject,y=u.domain;try{c?(i||(e.rejection===2&&VQ(e),e.rejection=1),c===!0?a=n:(y&&y.enter(),a=c(n),y&&(y.exit(),l=!0)),a===u.promise?S(N4("Promise-chain cycle")):(s=H4(a))?Cr(s,a,h,S):h(a)):S(n)}catch(W){y&&!l&&y.exit(),S(W)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&GQ(e)})}},z4=function(e,t,r){var n,i;zQ?((n=Tw.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),yt.dispatchEvent(n)):n={promise:t,reason:r},!j4&&(i=yt["on"+e])?i(n):e==="unhandledrejection"&&function(o,a){var s=yt.console;s&&s.error&&(arguments.length==1?s.error(o):s.error(o,a))}("Unhandled promise rejection",r)},GQ=function(e){Cr(B4,yt,function(){var t,r=e.facade,n=e.value;if(W4(e)&&(t=Cw(function(){xs?Aw.emit("unhandledRejection",n,r):z4("unhandledrejection",r,n)}),e.rejection=xs||W4(e)?2:1,t.error))throw t.value})},W4=function(e){return e.rejection!==1&&!e.parent},VQ=function(e){Cr(B4,yt,function(){var t=e.facade;xs?Aw.emit("rejectionHandled",t):z4("rejectionhandled",t,e.value)})},Wc=function(e,t,r){return function(n){e(t,n,r)}},Gc=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Dw(e,!0))},Ow=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw N4("Promise can't be resolved itself");var n=H4(t);n?M4(function(){var i={done:!1};try{Cr(n,t,Wc(Ow,i,e),Wc(Gc,i,e))}catch(o){Gc(i,o,e)}}):(e.value=t,e.state=1,Dw(e,!1))}catch(i){Gc({done:!1},i,e)}}};if(Tf&&(Cf=(na=function(e){_m(this,Cf),ys(e),Cr(Sw,this);var t=F4(this);try{e(Wc(Ow,t),Wc(Gc,t))}catch(r){Gc(t,r)}}).prototype,(Sw=function(e){jQ(this,{type:ra,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Nc(Cf,{then:function(e,t){var r=UQ(this),n=r.reactions,i=zc(b4(this,na));return i.ok=!jr(e)||e,i.fail=jr(t)&&t,i.domain=xs?Aw.domain:void 0,r.parent=!0,n[n.length]=i,r.state!=0&&Dw(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),L4=function(){var e=new Sw,t=F4(e);this.promise=e,this.resolve=Wc(Ow,t),this.reject=Wc(Gc,t)},ww.f=zc=function(e){return e===na||e===P4?new L4(e):HQ(e)},jr(Hm)&&au!==Object.prototype)){I4=au.then,U4||(_i(au,"then",function(e,t){var r=this;return new na(function(n,i){Cr(I4,r,n,i)}).then(e,t)},{unsafe:!0}),_i(au,"catch",Cf.catch,{unsafe:!0}));try{delete au.constructor}catch(e){}Bc&&Bc(au,Cf)}sn({global:!0,wrap:!0,forced:Tf},{Promise:na}),xm(na,ra,!1),dw(ra),P4=Xl(ra),sn({target:ra,stat:!0,forced:Tf},{reject:function(e){var t=zc(this);return Cr(t.reject,void 0,e),t.promise}}),sn({target:ra,stat:!0,forced:Tf},{resolve:function(e){return function(t,r){if(Sn(t),Yr(r)&&r.constructor===t)return r;var n=ww.f(t);return(0,n.resolve)(r),n.promise}(this,e)}}),sn({target:ra,stat:!0,forced:WQ},{all:function(e){var t=this,r=zc(t),n=r.resolve,i=r.reject,o=Cw(function(){var a=ys(t.resolve),s=[],l=0,u=1;hf(e,function(c){var h=l++,S=!1;u++,Cr(a,t,c).then(function(y){S||(S=!0,s[h]=y,--u||n(s))},i)}),--u||n(s)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=zc(t),n=r.reject,i=Cw(function(){var o=ys(t.resolve);hf(e,function(a){Cr(o,t,a).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var Vc=Cm.UNSUPPORTED_Y,KQ=Math.min,G4=[].push,$Q=Wt(/./.exec),Kc=Wt(G4),Af=Wt("".slice);function co(e){Promise.resolve().then(e)}function V4(e,t){return Ut.isElement(e)?function(r,n){var i=r.type,o=i===void 0?"":i,a=r.children,s=a===void 0?[]:a,l=de.isVoid(n,r),u="";l||(u=s.map(function(j){return V4(j,n)}).join(""));var c=function(j){return v4[j]||DQ}(o),h=c(r,u,n),S="";if(S=typeof h=="string"?h:h.html||"",l||uw.forEach(function(j){return S=j(r,S)}),typeof h=="string")return S;var y=h.prefix,W=y===void 0?"":y,F=h.suffix,N=F===void 0?"":F;return W&&(S=W+S),N&&(S+=N),S}(e,t):function(r,n){var i=r.text;if(i==null)throw new Error("Current node is not slate Text "+JSON.stringify(r));var o=i;o=function(l){return l.replace(/ {2}/g,"  ").replace(//g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(o);var a=Ae.getParentsNodes(n,r).some(function(l){return Ae.getNodeType(l)==="pre"});if(a||(o=o.replace(/\r\n|\r|\n/g,"
")),a&&(o=o.replace(/ /g," ")),o===""){var s=Ae.getParentNode(null,r);if(!s||s.children.length!==0)return o;o="
"}return uw.forEach(function(l){return o=l(r,o)}),o}(e,t)}function K4(e){return"w-e-element-"+e}IS("split",function(e,t,r){var n;return n="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(i,o){var a=$r(so(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!hS(i))return Cr(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,W=new RegExp(i.source,S+"g");(l=Cr(uf,W,a))&&!((u=W.lastIndex)>y&&(Kc(h,Af(a,y,l.index)),l.length>1&&l.index=s));)W.lastIndex===l.index&&W.lastIndex++;return y===a.length?!c&&$Q(W,"")||Kc(h,""):Kc(h,Af(a,y)),h.length>s?zS(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:Cr(t,this,i,o)}:t,[function(i,o){var a=so(this),s=i==null?void 0:Jl(i,e);return s?Cr(s,i,a,o):Cr(n,$r(a),i,o)},function(i,o){var a=Sn(this),s=$r(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=b4(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Vc?"g":"y"),S=new u(Vc?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return cf(S,s)===null?[s]:[];for(var W=0,F=0,N=[];F=r},X4=function(e,t,r){var n=Ae.toDOMRange(e,t).getBoundingClientRect(),i=Ae.toDOMRange(e,r).getBoundingClientRect();return $4(n,i)&&$4(i,n)},Y4=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Z4=[],_w=[],Wm={},XQ=Ro.f,YQ=rf.f,ZQ=hi.enforce,JQ=an("match"),Ia=yt.RegExp,$c=Ia.prototype,QQ=yt.SyntaxError,qQ=Wt(aS),eq=Wt($c.exec),Gm=Wt("".charAt),J4=Wt("".replace),Q4=Wt("".indexOf),tq=Wt("".slice),rq=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,su=/a/g,Rw=/a/g,nq=new Ia(su)!==su,q4=Cm.MISSED_STICKY,iq=Cm.UNSUPPORTED_Y,oq=Zn&&(!nq||q4||TS||AS||Ir(function(){return Rw[JQ]=!1,Ia(su)!=su||Ia(Rw)==Rw||Ia(su,"i")!="/a/i"}));if(of("RegExp",oq)){for(var Ss=function(e,t){var r,n,i,o,a,s,l=Zl($c,this),u=hS(e),c=t===void 0,h=[],S=e;if(!l&&u&&c&&e.constructor===Ss)return e;if((u||Zl($c,e))&&(e=e.source,c&&(t="flags"in S?S.flags:qQ(S))),e=e===void 0?"":$r(e),t=t===void 0?"":$r(t),S=e,TS&&"dotAll"in su&&(n=!!t&&Q4(t,"s")>-1)&&(t=J4(t,/s/g,"")),r=t,q4&&"sticky"in su&&(i=!!t&&Q4(t,"y")>-1)&&iq&&(t=J4(t,/y/g,"")),AS&&(o=function(y){for(var W,F=y.length,N=0,j="",D=[],Q={},te=!1,he=!1,Ee=0,ve="";N<=F;N++){if((W=Gm(y,N))==="\\")W+=Gm(y,++N);else if(W==="]")te=!1;else if(!te)switch(!0){case W==="[":te=!0;break;case W==="(":eq(rq,tq(y,N+1))&&(N+=2,he=!0),j+=W,Ee++;continue;case(W===">"&&he):if(ve===""||xn(Q,ve))throw new QQ("Invalid capture group name");Q[ve]=!0,D[D.length]=[ve,Ee],he=!1,ve="";continue}he?ve+=W:j+=W}return[j,D]}(e),e=o[0],h=o[1]),a=KM(Ia(e,t),l?this:$c,Ss),(n||i||h.length)&&(s=ZQ(a),n&&(s.dotAll=!0,s.raw=Ss(function(y){for(var W,F=y.length,N=0,j="",D=!1;N<=F;N++)(W=Gm(y,N))!=="\\"?D||W!=="."?(W==="["?D=!0:W==="]"&&(D=!1),j+=W):j+="[\\s\\S]":j+=W+Gm(y,++N);return j}(e),r)),i&&(s.sticky=!0),h.length&&(s.groups=h)),e!==S)try{ko(a,"source",S===""?"(?:)":S)}catch(y){}return a},aq=function(e){e in Ss||XQ(Ss,e,{configurable:!0,get:function(){return Ia[e]},set:function(t){Ia[e]=t}})},e3=YQ(Ia),t3=0;e3.length>t3;)aq(e3[t3++]);$c.constructor=Ss,Ss.prototype=$c,_i(yt,"RegExp",Ss)}dw("RegExp");var sq=new RegExp(String.fromCharCode(160),"g");function r3(e){return e.replace(sq," ")}function n3(e,t){var r=e.length;if(r){var n=e[r-1];if(Rt.isText(n)){var i=Object.keys(n);if(i.length===1&&i[0]==="text")return n.text=n.text+t,!0}}return!1}function lq(e,t,r){return{type:"paragraph",children:[{text:_e(e).text().replace(/\s+/gm," ")}]}}function kw(e,t){var r=function(o,a){var s=[];if(o.attr("data-w-e-is-void")!=null)return s;var l=o[0].childNodes;return l.length===1&&l[0].nodeName==="BR"?(s.push({text:""}),s):(l.forEach(function(u){if(u.nodeType!==ta.ELEMENT_NODE){if(!(u.nodeType!==ta.TEXT_NODE)){var c=u.textContent||"";if(c.trim()===""&&c.indexOf(` `)>=0)return;c&&(c=r3(c),n3(s,c)||s.push({text:c}))}}else{if(u.nodeName==="BR")return void(n3(s,` `)||s.push({text:` `}));var h=Pw(_e(u),a);Array.isArray(h)?h.forEach(function(S){return s.push(S)}):s.push(h)}}),s)}(e,t),n=function(o){for(var a in Wm)if(o[0].matches(a))return Wm[a];return lq}(e),i=n(e[0],r,t);return Array.isArray(i)||(i=[i]),i.forEach(function(o){de.isVoid(t,o)||(r.length===0&&(o.children=[{text:e.text().replace(/\s+/gm," ")}]),_w.forEach(function(a){o=a(e[0],o,t)}))}),i}function Lw(e,t){e.parents("pre").length===0&&(e[0].innerHTML=e[0].innerHTML.replace(/\s+/gm," ").replace(/
/g,` -`));var r=e[0].textContent||"";r=function(i){return i.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"\xAE").replace(/©/g,"\xA9").replace(/™/g,"\u2122").replace(/"/g,'"')}(r);var n={text:r=r3(r)};return _w.forEach(function(i){n=i(e[0],n,t)}),n}function Pw(e,t){Z4.forEach(function(n){var i=n.selector,o=n.preParseHtml;e[0].matches(i)&&(e=_e(o(e[0])))});var r=f4(e);return r==="span"?e.attr("data-w-e-type")?kw(e,t):Lw(e,t):r==="code"?f4(e.parent())==="pre"?kw(e,t):Lw(e,t):Y4.includes(r)?Lw(e,t):kw(e,t)}function i3(e,t,r){var n=_e(r);return!!n.attr(t)||(n.attr(t,"true"),e.on("destroyed",function(){n.removeAttr(t)}),!1)}function o3(e,t){t===void 0&&(t="");var r=[];t===""&&(t="


"),t.indexOf("<")!==0&&(t=t.split(/\n/).map(function(i){return"

"+i+"

"}).join(""));var n=_e("
"+t+"
");return Array.from(n.children()).forEach(function(i){var o=Pw(_e(i),e);Array.isArray(o)?o.forEach(function(a){return r.push(a)}):r.push(o)}),r}var uq=Ro.f,a3=Dm.fastKey,s3=hi.set,Iw=hi.getterFor,cq={getConstructor:function(e,t,r,n){var i=e(function(u,c){_m(u,o),s3(u,{type:t,index:bm(null),first:void 0,last:void 0,size:0}),Zn||(u.size=0),c!=null&&hf(c,u[n],{that:u,AS_ENTRIES:r})}),o=i.prototype,a=Iw(t),s=function(u,c,h){var S,y,z=a(u),F=l(u,c);return F?F.value=h:(z.last=F={index:y=a3(c,!0),key:c,value:h,previous:S=z.last,next:void 0,removed:!1},z.first||(z.first=F),S&&(S.next=F),Zn?z.size++:u.size++,y!=="F"&&(z.index[y]=F)),u},l=function(u,c){var h,S=a(u),y=a3(c);if(y!=="F")return S.index[y];for(h=S.first;h;h=h.next)if(h.key==c)return h};return Nc(o,{clear:function(){for(var u=a(this),c=u.index,h=u.first;h;)h.removed=!0,h.previous&&(h.previous=h.previous.next=void 0),delete c[h.index],h=h.next;u.first=u.last=void 0,Zn?u.size=0:this.size=0},delete:function(u){var c=this,h=a(c),S=l(c,u);if(S){var y=S.next,z=S.previous;delete h.index[S.index],S.removed=!0,z&&(z.next=y),y&&(y.previous=z),h.first==S&&(h.first=y),h.last==S&&(h.last=z),Zn?h.size--:c.size--}return!!S},forEach:function(u){for(var c,h=a(this),S=ql(u,arguments.length>1?arguments[1]:void 0);c=c?c.next:h.first;)for(S(c.value,c.key,this);c&&c.removed;)c=c.previous},has:function(u){return!!l(this,u)}}),Nc(o,r?{get:function(u){var c=l(this,u);return c&&c.value},set:function(u,c){return s(this,u===0?0:u,c)}}:{add:function(u){return s(this,u=u===0?0:u,u)}}),Zn&&uq(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Iw(t),o=Iw(n);xS(e,t,function(a,s){s3(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,l=a.last;l&&l.removed;)l=l.previous;return a.target&&(a.last=l=l?l.next:a.state.first)?s=="keys"?{value:l.key,done:!1}:s=="values"?{value:l.value,done:!1}:{value:[l.key,l.value],done:!1}:(a.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),dw(t)}};$M("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},cq);var l3=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function u3(e,t){e.isInline(t)?(e.insertNode(t),t.type==="link"&&e.insertFragment([{text:""}])):Ve.insertNodes(e,t,{mode:"highest"})}var dq=function(e){var t=e,r=t.insertText;return t.insertFragment,t.setFragmentData=function(n){var i=t.selection;if(i){var o=Tr(Qe.edges(i),2),a=o[0],s=o[1],l=de.void(t,{at:a.path}),u=de.void(t,{at:s.path});if(!Qe.isCollapsed(i)||l){var c=Ae.toDOMRange(t,i),h=c.cloneContents(),S=h.childNodes[0];if(h.childNodes.forEach(function(he){he.textContent&&he.textContent.trim()!==""&&(S=he)}),u){var y=Tr(u,1)[0],z=c.cloneRange(),F=Ae.toDOMNode(t,y);z.setEndAfter(F),h=z.cloneContents()}if(l&&(S=h.querySelector("[data-slate-spacer]")),Array.from(h.querySelectorAll("[data-slate-zero-width]")).forEach(function(he){var Ee=he.getAttribute("data-slate-zero-width")==="n";he.textContent=Ee?` -`:""}),c4(S)){var N=S.ownerDocument.createElement("span");N.style.whiteSpace="pre",N.appendChild(S),h.appendChild(N),S=N}var j=t.getFragment(),D=JSON.stringify(j),Q=window.btoa(encodeURIComponent(D));S.setAttribute("data-slate-fragment",Q),n.setData("application/x-slate-fragment",Q);var te=h.ownerDocument.createElement("div");return te.appendChild(h),te.setAttribute("hidden","true"),h.ownerDocument.body.appendChild(te),n.setData("text/html",te.innerHTML),n.setData("text/plain",vQ(te)),h.ownerDocument.body.removeChild(te),n}}},t.insertData=function(n){var i,o,a=n.getData("application/x-slate-fragment");if(a){var s=decodeURIComponent(window.atob(a)),l=JSON.parse(s);t.insertFragment(l)}else{var u=n.getData("text/plain"),c=n.getData("text/html");if(c)t.dangerouslyInsertHtml(c);else if(u){var h=u.split(/\r\n|\r|\n/),S=!1;try{for(var y=uo(h),z=y.next();!z.done;z=y.next()){var F=z.value;S&&Ve.splitNodes(t,{always:!0}),r(F),S=!0}}catch(N){i={error:N}}finally{try{z&&!z.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}}},t},Df=function(e){return e!=null},hq={object:!0,function:!0,undefined:!0},fq=/^\s*class[\s{/}]/,pq=Function.prototype.toString,c3=function(e){return!!function(t){if(typeof t!="function")return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number")return!1;if(typeof t.call!="function")return!1;if(typeof t.apply!="function")return!1}catch(r){return!1}return!function(r){if(!function(n){return!!Df(n)&&hasOwnProperty.call(hq,typeof n)}(r))return!1;try{return!!r.constructor&&r.constructor.prototype===r}catch(n){return!1}}(t)}(e)&&!fq.test(pq.call(e))},Mw=function(e){return e!=null},gq=Object.keys,vq=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return gq(Mw(e)?Object(e):e)},mq=function(e){if(!Mw(e))throw new TypeError("Cannot use null or undefined");return e},yq=Math.max,d3=function(){var e,t=Object.assign;return typeof t=="function"&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var r,n,i,o=yq(arguments.length,2);for(e=Object(mq(e)),i=function(a){try{e[a]=t[a]}catch(s){r||(r=s)}},n=1;n-1},Vm=$h(function(e){var t=e.exports=function(r,n){var i,o,a,s,l;return arguments.length<2||typeof r!="string"?(s=n,n=r,r=null):s=arguments[2],Df(r)?(i=Of.call(r,"c"),o=Of.call(r,"e"),a=Of.call(r,"w")):(i=a=!0,o=!1),l={value:n,configurable:i,enumerable:o,writable:a},s?d3(h3(s),l):l};t.gs=function(r,n,i){var o,a,s,l;return typeof r!="string"?(s=i,i=n,n=r,r=null):s=arguments[3],Df(n)?c3(n)?Df(i)?c3(i)||(s=i,i=void 0):i=void 0:(s=n,n=i=void 0):n=void 0,Df(r)?(o=Of.call(r,"c"),a=Of.call(r,"e")):(o=!0,a=!1),l={get:n,set:i,configurable:o,enumerable:a},s?d3(h3(s),l):l}}),Fw=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},wq=$h(function(e,t){var r,n,i,o,a,s,l,u=Function.prototype.apply,c=Function.prototype.call,h=Object.create,S=Object.defineProperty,y=Object.defineProperties,z=Object.prototype.hasOwnProperty,F={configurable:!0,enumerable:!1,writable:!0};r=function(N,j){var D;return Fw(j),z.call(this,"__ee__")?D=this.__ee__:(D=F.value=h(null),S(this,"__ee__",F),F.value=null),D[N]?typeof D[N]=="object"?D[N].push(j):D[N]=[D[N],j]:D[N]=j,this},n=function(N,j){var D,Q;return Fw(j),Q=this,r.call(this,N,D=function(){i.call(Q,N,D),u.call(j,this,arguments)}),D.__eeOnceListener__=j,this},i=function(N,j){var D,Q,te,he;if(Fw(j),!z.call(this,"__ee__"))return this;if(!(D=this.__ee__)[N])return this;if(typeof(Q=D[N])=="object")for(he=0;te=Q[he];++he)te!==j&&te.__eeOnceListener__!==j||(Q.length===2?D[N]=Q[he?0:1]:Q.splice(he,1));else Q!==j&&Q.__eeOnceListener__!==j||delete D[N];return this},o=function(N){var j,D,Q,te,he;if(z.call(this,"__ee__")&&(te=this.__ee__[N]))if(typeof te=="object"){for(D=arguments.length,he=new Array(D-1),j=1;ja/2){var y=a-S;c.right=y+5+"px"}else c.left=S+5+"px";if(h>s/2){var z=s-h;c.bottom=z+5+"px"}else{var F=h+u;F<0&&(F=0),c.top=F+5+"px"}return c}function Uw(e,t,r){r===void 0&&(r="modal");var n={top:"0",left:"0"};if(e.selection==null)return n;var i=Ut.isElement(t)&&e.isVoid(t),o=Ut.isElement(t)&&e.isInline(t),a=Nm.get(t);if(a==null)return n;var s=a.getBoundingClientRect(),l=s.top,u=s.left,c=s.height,h=s.width;if(i){var S=function(ve){var De=[];De.push(ve);for(var Pe=0;De.length>0;){var qe=De.pop();if(qe==null)break;if(++Pe>1e4)break;var ot=qe.nodeName;if(qe.nodeType===1){var et=ot.toLowerCase();if(pQ.includes(et)||et==="iframe"||et==="video")return qe;var gt=qe.children||[],dt=gt.length;if(dt)for(var ht=dt-1;ht>=0;ht--)De.push(gt[ht])}}return null}(a);if(S!=null){var y=S.getBoundingClientRect();l=y.top,c=y.height}}var z=Nw(e);if(z==null)return n;var F,N=z.top,j=z.left,D=z.width,Q=z.height,te={},he=l-N,Ee=u-j;if(r==="bar")return te.left=Ee+"px",he>40?te.bottom=Q-he+5+"px":te.top=he+c+5+"px",te;if(r==="modal")return i?o?Ee>(D-h)/2?te.right=D-Ee+5+"px":te.left=Ee+h+5+"px":te.left="20px":te.left=Ee+"px",i?((F=he)<0&&(F=0),te.top=F+"px"):he>(Q-c)/2?te.bottom=Q-he+5+"px":((F=he+c)<0&&(F=0),te.top=F+5+"px"),te;throw new Error("type '"+r+"' is invalid")}function Hw(e,t){co(function(){var r=Nw(e);if(r!=null){var n,i=r.top,o=r.left,a=r.width,s=r.height,l=t.offset(),u=l.top,c=l.left,h=t.width(),S=t.height(),y=u-i,z=c-o,F=t.attr("style");if(F.indexOf("top")>=0&&(n=y+S-s)>0){var N=t.css("top"),j=parseInt(N.toString())-n;j<0&&(j=0),t.css("top",j+"px")}if(F.indexOf("bottom")>=0&&u<0){var D=t.css("bottom"),Q=parseInt(D.toString())-Math.abs(u);t.css("bottom",Q+"px")}if(F.indexOf("left")>=0&&(n=z+h-a)>0){var te=t.css("left"),he=parseInt(te.toString())-n;he<0&&(he=0),t.css("left",he+"px")}if(F.indexOf("right")>=0&&c<0){var Ee=t.css("right"),ve=parseInt(Ee.toString())-Math.abs(c);t.css("right",ve+"px")}}})}var Aq=wm("slice"),Dq=an("species"),zw=yt.Array,Oq=Math.max;sn({target:"Array",proto:!0,forced:!Aq},{slice:function(e,t){var r,n,i,o=Es(this),a=eu(o),s=Lc(e,a),l=Lc(t===void 0?a:t,a);if(pm(o)&&(r=o.constructor,(gm(r)&&(r===zw||pm(r.prototype))||Yr(r)&&(r=r[Dq])===null)&&(r=void 0),r===zw||r===void 0))return E4(o,s,l);for(n=new(r===void 0?zw:r)(Oq(l-s,0)),i=0;s1?arguments[1]:void 0,t.length)),n=$r(e);return p3?p3(t,n,r):Rq(t,r,r+n.length)===n}});var Xc=Object.assign,v3=Object.defineProperty,Pq=Wt([].concat),m3=!Xc||Ir(function(){if(Zn&&Xc({b:1},Xc(v3({},"a",{enumerable:!0,get:function(){v3(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(i){t[i]=i}),Xc({},e)[r]!=7||Pc(Xc({},t)).join("")!=n})?function(e,t){for(var r=ms(e),n=arguments.length,i=1,o=hM.f,a=aM.f;n>i;)for(var s,l=fm(arguments[i++]),u=o?Pq(Pc(l),o(l)):Pc(l),c=u.length,h=0;c>h;)s=u[h++],Zn&&!Cr(a,l,s)||(r[s]=l[s]);return r}:Xc;sn({target:"Object",stat:!0,forced:Object.assign!==m3},{assign:m3});var Iq=["props","attrs","style","dataset","on","hook"];function y3(e){var t=e.data,r=t===void 0?{}:t,n=e.children,i=n===void 0?[]:n;Object.keys(r).forEach(function(o){var a,s,l=r[o];if(o!=="key"){if(!Iq.includes(o)){if(o.startsWith("data-")){var u=o.slice(5);return u=iX(u),function(c,h){c.data==null&&(c.data={});var S=c.data;S.dataset==null&&(S.dataset={}),Object.assign(S.dataset,h)}(e,((a={})[u]=l,a)),void delete r[o]}!function(c,h){c.data==null&&(c.data={});var S=c.data;S.props==null&&(S.props={}),Object.assign(S.props,h)}(e,(s={},s[o]=l,s)),delete r[o]}}else e.key=l}),i.length>0&&i.forEach(function(o){typeof o!="string"&&y3(o)})}var Ww=[],b3={};function Mq(e,t,r){return er(r.isInline(e)?"span":"div",null,t)}function E3(e,t){return t===void 0&&(t=!1),er("span",{"data-slate-string":!0},t?e+` -`:e)}function Gw(e,t){return e===void 0&&(e=0),t===void 0&&(t=!1),er("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\uFEFF",t?er("br",null):null)}function Vw(e,t,r,n){return gf.set(e,t),jc.set(e,r),Ut.isElement(e)?function(i,o){var a,s=Ae.findKey(o,i),l=o.isInline(i),u=de.isVoid(o,i),c=K4(s.id),h={id:c,key:s.id,"data-slate-node":"element","data-slate-inline":l},S=i.type,y=i.children,z=y===void 0?[]:y,F=function(he){return b3[he]||Mq}(S);a=u?null:z.map(function(he,Ee){return Vw(he,Ee,i,o)});var N=F(i,a,o);if(u){h["data-slate-void"]=!0;var j=l?"span":"div",D=Tr(St.texts(i),1),Q=Tr(D[0],1)[0],te=er(j,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Vw(Q,0,i,o));N=er(j,{style:{position:"relative"}},N,te),gf.set(Q,0),jc.set(Q,i)}return N.data==null&&(N.data={}),Object.assign(N.data,h),u||l||(N=function(he,Ee){var ve=Ee;return Ww.forEach(function(De){ve=De(he,Ee)}),ve}(i,N)),co(function(){var he=iw(c);he!=null&&(ew.set(s,he),Nm.set(i,he),Fm.set(he,i))}),N}(e,n):function(i,o,a){if(i.text==null)throw new Error("Current node is not slate Text "+JSON.stringify(i));var s=Ae.findKey(a,i),l=a.getConfig().decorate;if(l==null)throw new Error("Can not get config.decorate");var u=Ae.findPath(a,i),c=l([i,u]),h=Rt.decorations(i,c),S=h.map(function(F,N){var j=function(D,Q,te,he,Ee){Q===void 0&&(Q=!1);var ve=D.text,De=Ae.findPath(Ee,te),Pe=je.parent(De);if(de.isEditor(he))throw new Error("Text node "+JSON.stringify(te)+" parent is Editor");return Ee.isVoid(he)?Gw(St.string(he).length):ve!==""||he.children[he.children.length-1]!==te||Ee.isInline(he)||de.string(Ee,Pe)!==""?ve===""?Gw():Q&&ve.slice(-1)===` -`?E3(ve,!0):E3(ve):Gw(0,!0)}(F,N===h.length-1,i,o,a);return j=function(D,Q){var te=Q;return Ww.forEach(function(he){te=he(D,te)}),te}(F,j),er("span",{"data-slate-leaf":!0},j)}),y=function(F){return"w-e-text-"+F}(s.id),z=er("span",{"data-slate-node":"text",id:y,key:s.id},S);return co(function(){var F=iw(y);F!=null&&(ew.set(s,F),Nm.set(i,F),Fm.set(F,i))}),z}(e,r,n)}function Bq(e,t){var r,n=e.$scroll,i=function(F){return"w-e-textarea-"+F}(e.id),o=t.getConfig(),a=o.readOnly,s=o.autoFocus,l=function(F,N){return N===void 0&&(N=!1),wc("div#"+F,{props:{contentEditable:!N}})}(i,a),u=t.children||[];l.children=u.map(function(F,N){var j=Vw(F,N,t,t);return y3(j),j});var c=n4.get(e);if(c==null&&(c=!0),c){var h=function(F,N){return _e(`
").replace(/®/g,"\xAE").replace(/©/g,"\xA9").replace(/™/g,"\u2122").replace(/"/g,'"')}(r);var n={text:r=r3(r)};return _w.forEach(function(i){n=i(e[0],n,t)}),n}function Pw(e,t){Z4.forEach(function(n){var i=n.selector,o=n.preParseHtml;e[0].matches(i)&&(e=_e(o(e[0])))});var r=f4(e);return r==="span"?e.attr("data-w-e-type")?kw(e,t):Lw(e,t):r==="code"?f4(e.parent())==="pre"?kw(e,t):Lw(e,t):Y4.includes(r)?Lw(e,t):kw(e,t)}function i3(e,t,r){var n=_e(r);return!!n.attr(t)||(n.attr(t,"true"),e.on("destroyed",function(){n.removeAttr(t)}),!1)}function o3(e,t){t===void 0&&(t="");var r=[];t===""&&(t="


"),t.indexOf("<")!==0&&(t=t.split(/\n/).map(function(i){return"

"+i+"

"}).join(""));var n=_e("
"+t+"
");return Array.from(n.children()).forEach(function(i){var o=Pw(_e(i),e);Array.isArray(o)?o.forEach(function(a){return r.push(a)}):r.push(o)}),r}var uq=Ro.f,a3=Dm.fastKey,s3=hi.set,Iw=hi.getterFor,cq={getConstructor:function(e,t,r,n){var i=e(function(u,c){_m(u,o),s3(u,{type:t,index:bm(null),first:void 0,last:void 0,size:0}),Zn||(u.size=0),c!=null&&hf(c,u[n],{that:u,AS_ENTRIES:r})}),o=i.prototype,a=Iw(t),s=function(u,c,h){var S,y,W=a(u),F=l(u,c);return F?F.value=h:(W.last=F={index:y=a3(c,!0),key:c,value:h,previous:S=W.last,next:void 0,removed:!1},W.first||(W.first=F),S&&(S.next=F),Zn?W.size++:u.size++,y!=="F"&&(W.index[y]=F)),u},l=function(u,c){var h,S=a(u),y=a3(c);if(y!=="F")return S.index[y];for(h=S.first;h;h=h.next)if(h.key==c)return h};return Nc(o,{clear:function(){for(var u=a(this),c=u.index,h=u.first;h;)h.removed=!0,h.previous&&(h.previous=h.previous.next=void 0),delete c[h.index],h=h.next;u.first=u.last=void 0,Zn?u.size=0:this.size=0},delete:function(u){var c=this,h=a(c),S=l(c,u);if(S){var y=S.next,W=S.previous;delete h.index[S.index],S.removed=!0,W&&(W.next=y),y&&(y.previous=W),h.first==S&&(h.first=y),h.last==S&&(h.last=W),Zn?h.size--:c.size--}return!!S},forEach:function(u){for(var c,h=a(this),S=ql(u,arguments.length>1?arguments[1]:void 0);c=c?c.next:h.first;)for(S(c.value,c.key,this);c&&c.removed;)c=c.previous},has:function(u){return!!l(this,u)}}),Nc(o,r?{get:function(u){var c=l(this,u);return c&&c.value},set:function(u,c){return s(this,u===0?0:u,c)}}:{add:function(u){return s(this,u=u===0?0:u,u)}}),Zn&&uq(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Iw(t),o=Iw(n);xS(e,t,function(a,s){s3(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,l=a.last;l&&l.removed;)l=l.previous;return a.target&&(a.last=l=l?l.next:a.state.first)?s=="keys"?{value:l.key,done:!1}:s=="values"?{value:l.value,done:!1}:{value:[l.key,l.value],done:!1}:(a.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),dw(t)}};$M("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},cq);var l3=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function u3(e,t){e.isInline(t)?(e.insertNode(t),t.type==="link"&&e.insertFragment([{text:""}])):Ve.insertNodes(e,t,{mode:"highest"})}var dq=function(e){var t=e,r=t.insertText;return t.insertFragment,t.setFragmentData=function(n){var i=t.selection;if(i){var o=Tr(Je.edges(i),2),a=o[0],s=o[1],l=de.void(t,{at:a.path}),u=de.void(t,{at:s.path});if(!Je.isCollapsed(i)||l){var c=Ae.toDOMRange(t,i),h=c.cloneContents(),S=h.childNodes[0];if(h.childNodes.forEach(function(he){he.textContent&&he.textContent.trim()!==""&&(S=he)}),u){var y=Tr(u,1)[0],W=c.cloneRange(),F=Ae.toDOMNode(t,y);W.setEndAfter(F),h=W.cloneContents()}if(l&&(S=h.querySelector("[data-slate-spacer]")),Array.from(h.querySelectorAll("[data-slate-zero-width]")).forEach(function(he){var Ee=he.getAttribute("data-slate-zero-width")==="n";he.textContent=Ee?` +`:""}),c4(S)){var N=S.ownerDocument.createElement("span");N.style.whiteSpace="pre",N.appendChild(S),h.appendChild(N),S=N}var j=t.getFragment(),D=JSON.stringify(j),Q=window.btoa(encodeURIComponent(D));S.setAttribute("data-slate-fragment",Q),n.setData("application/x-slate-fragment",Q);var te=h.ownerDocument.createElement("div");return te.appendChild(h),te.setAttribute("hidden","true"),h.ownerDocument.body.appendChild(te),n.setData("text/html",te.innerHTML),n.setData("text/plain",vQ(te)),h.ownerDocument.body.removeChild(te),n}}},t.insertData=function(n){var i,o,a=n.getData("application/x-slate-fragment");if(a){var s=decodeURIComponent(window.atob(a)),l=JSON.parse(s);t.insertFragment(l)}else{var u=n.getData("text/plain"),c=n.getData("text/html");if(c)t.dangerouslyInsertHtml(c);else if(u){var h=u.split(/\r\n|\r|\n/),S=!1;try{for(var y=uo(h),W=y.next();!W.done;W=y.next()){var F=W.value;S&&Ve.splitNodes(t,{always:!0}),r(F),S=!0}}catch(N){i={error:N}}finally{try{W&&!W.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}}},t},Df=function(e){return e!=null},hq={object:!0,function:!0,undefined:!0},fq=/^\s*class[\s{/}]/,pq=Function.prototype.toString,c3=function(e){return!!function(t){if(typeof t!="function")return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number")return!1;if(typeof t.call!="function")return!1;if(typeof t.apply!="function")return!1}catch(r){return!1}return!function(r){if(!function(n){return!!Df(n)&&hasOwnProperty.call(hq,typeof n)}(r))return!1;try{return!!r.constructor&&r.constructor.prototype===r}catch(n){return!1}}(t)}(e)&&!fq.test(pq.call(e))},Mw=function(e){return e!=null},gq=Object.keys,vq=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return gq(Mw(e)?Object(e):e)},mq=function(e){if(!Mw(e))throw new TypeError("Cannot use null or undefined");return e},yq=Math.max,d3=function(){var e,t=Object.assign;return typeof t=="function"&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var r,n,i,o=yq(arguments.length,2);for(e=Object(mq(e)),i=function(a){try{e[a]=t[a]}catch(s){r||(r=s)}},n=1;n-1},Vm=$h(function(e){var t=e.exports=function(r,n){var i,o,a,s,l;return arguments.length<2||typeof r!="string"?(s=n,n=r,r=null):s=arguments[2],Df(r)?(i=Of.call(r,"c"),o=Of.call(r,"e"),a=Of.call(r,"w")):(i=a=!0,o=!1),l={value:n,configurable:i,enumerable:o,writable:a},s?d3(h3(s),l):l};t.gs=function(r,n,i){var o,a,s,l;return typeof r!="string"?(s=i,i=n,n=r,r=null):s=arguments[3],Df(n)?c3(n)?Df(i)?c3(i)||(s=i,i=void 0):i=void 0:(s=n,n=i=void 0):n=void 0,Df(r)?(o=Of.call(r,"c"),a=Of.call(r,"e")):(o=!0,a=!1),l={get:n,set:i,configurable:o,enumerable:a},s?d3(h3(s),l):l}}),Fw=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},wq=$h(function(e,t){var r,n,i,o,a,s,l,u=Function.prototype.apply,c=Function.prototype.call,h=Object.create,S=Object.defineProperty,y=Object.defineProperties,W=Object.prototype.hasOwnProperty,F={configurable:!0,enumerable:!1,writable:!0};r=function(N,j){var D;return Fw(j),W.call(this,"__ee__")?D=this.__ee__:(D=F.value=h(null),S(this,"__ee__",F),F.value=null),D[N]?typeof D[N]=="object"?D[N].push(j):D[N]=[D[N],j]:D[N]=j,this},n=function(N,j){var D,Q;return Fw(j),Q=this,r.call(this,N,D=function(){i.call(Q,N,D),u.call(j,this,arguments)}),D.__eeOnceListener__=j,this},i=function(N,j){var D,Q,te,he;if(Fw(j),!W.call(this,"__ee__"))return this;if(!(D=this.__ee__)[N])return this;if(typeof(Q=D[N])=="object")for(he=0;te=Q[he];++he)te!==j&&te.__eeOnceListener__!==j||(Q.length===2?D[N]=Q[he?0:1]:Q.splice(he,1));else Q!==j&&Q.__eeOnceListener__!==j||delete D[N];return this},o=function(N){var j,D,Q,te,he;if(W.call(this,"__ee__")&&(te=this.__ee__[N]))if(typeof te=="object"){for(D=arguments.length,he=new Array(D-1),j=1;ja/2){var y=a-S;c.right=y+5+"px"}else c.left=S+5+"px";if(h>s/2){var W=s-h;c.bottom=W+5+"px"}else{var F=h+u;F<0&&(F=0),c.top=F+5+"px"}return c}function Uw(e,t,r){r===void 0&&(r="modal");var n={top:"0",left:"0"};if(e.selection==null)return n;var i=Ut.isElement(t)&&e.isVoid(t),o=Ut.isElement(t)&&e.isInline(t),a=Nm.get(t);if(a==null)return n;var s=a.getBoundingClientRect(),l=s.top,u=s.left,c=s.height,h=s.width;if(i){var S=function(ve){var De=[];De.push(ve);for(var Pe=0;De.length>0;){var qe=De.pop();if(qe==null)break;if(++Pe>1e4)break;var ot=qe.nodeName;if(qe.nodeType===1){var et=ot.toLowerCase();if(pQ.includes(et)||et==="iframe"||et==="video")return qe;var gt=qe.children||[],dt=gt.length;if(dt)for(var ht=dt-1;ht>=0;ht--)De.push(gt[ht])}}return null}(a);if(S!=null){var y=S.getBoundingClientRect();l=y.top,c=y.height}}var W=Nw(e);if(W==null)return n;var F,N=W.top,j=W.left,D=W.width,Q=W.height,te={},he=l-N,Ee=u-j;if(r==="bar")return te.left=Ee+"px",he>40?te.bottom=Q-he+5+"px":te.top=he+c+5+"px",te;if(r==="modal")return i?o?Ee>(D-h)/2?te.right=D-Ee+5+"px":te.left=Ee+h+5+"px":te.left="20px":te.left=Ee+"px",i?((F=he)<0&&(F=0),te.top=F+"px"):he>(Q-c)/2?te.bottom=Q-he+5+"px":((F=he+c)<0&&(F=0),te.top=F+5+"px"),te;throw new Error("type '"+r+"' is invalid")}function Hw(e,t){co(function(){var r=Nw(e);if(r!=null){var n,i=r.top,o=r.left,a=r.width,s=r.height,l=t.offset(),u=l.top,c=l.left,h=t.width(),S=t.height(),y=u-i,W=c-o,F=t.attr("style");if(F.indexOf("top")>=0&&(n=y+S-s)>0){var N=t.css("top"),j=parseInt(N.toString())-n;j<0&&(j=0),t.css("top",j+"px")}if(F.indexOf("bottom")>=0&&u<0){var D=t.css("bottom"),Q=parseInt(D.toString())-Math.abs(u);t.css("bottom",Q+"px")}if(F.indexOf("left")>=0&&(n=W+h-a)>0){var te=t.css("left"),he=parseInt(te.toString())-n;he<0&&(he=0),t.css("left",he+"px")}if(F.indexOf("right")>=0&&c<0){var Ee=t.css("right"),ve=parseInt(Ee.toString())-Math.abs(c);t.css("right",ve+"px")}}})}var Aq=wm("slice"),Dq=an("species"),zw=yt.Array,Oq=Math.max;sn({target:"Array",proto:!0,forced:!Aq},{slice:function(e,t){var r,n,i,o=Es(this),a=eu(o),s=Lc(e,a),l=Lc(t===void 0?a:t,a);if(pm(o)&&(r=o.constructor,(gm(r)&&(r===zw||pm(r.prototype))||Yr(r)&&(r=r[Dq])===null)&&(r=void 0),r===zw||r===void 0))return E4(o,s,l);for(n=new(r===void 0?zw:r)(Oq(l-s,0)),i=0;s1?arguments[1]:void 0,t.length)),n=$r(e);return p3?p3(t,n,r):Rq(t,r,r+n.length)===n}});var Xc=Object.assign,v3=Object.defineProperty,Pq=Wt([].concat),m3=!Xc||Ir(function(){if(Zn&&Xc({b:1},Xc(v3({},"a",{enumerable:!0,get:function(){v3(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(i){t[i]=i}),Xc({},e)[r]!=7||Pc(Xc({},t)).join("")!=n})?function(e,t){for(var r=ms(e),n=arguments.length,i=1,o=hM.f,a=aM.f;n>i;)for(var s,l=fm(arguments[i++]),u=o?Pq(Pc(l),o(l)):Pc(l),c=u.length,h=0;c>h;)s=u[h++],Zn&&!Cr(a,l,s)||(r[s]=l[s]);return r}:Xc;sn({target:"Object",stat:!0,forced:Object.assign!==m3},{assign:m3});var Iq=["props","attrs","style","dataset","on","hook"];function y3(e){var t=e.data,r=t===void 0?{}:t,n=e.children,i=n===void 0?[]:n;Object.keys(r).forEach(function(o){var a,s,l=r[o];if(o!=="key"){if(!Iq.includes(o)){if(o.startsWith("data-")){var u=o.slice(5);return u=iX(u),function(c,h){c.data==null&&(c.data={});var S=c.data;S.dataset==null&&(S.dataset={}),Object.assign(S.dataset,h)}(e,((a={})[u]=l,a)),void delete r[o]}!function(c,h){c.data==null&&(c.data={});var S=c.data;S.props==null&&(S.props={}),Object.assign(S.props,h)}(e,(s={},s[o]=l,s)),delete r[o]}}else e.key=l}),i.length>0&&i.forEach(function(o){typeof o!="string"&&y3(o)})}var Ww=[],b3={};function Mq(e,t,r){return er(r.isInline(e)?"span":"div",null,t)}function E3(e,t){return t===void 0&&(t=!1),er("span",{"data-slate-string":!0},t?e+` +`:e)}function Gw(e,t){return e===void 0&&(e=0),t===void 0&&(t=!1),er("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\uFEFF",t?er("br",null):null)}function Vw(e,t,r,n){return gf.set(e,t),jc.set(e,r),Ut.isElement(e)?function(i,o){var a,s=Ae.findKey(o,i),l=o.isInline(i),u=de.isVoid(o,i),c=K4(s.id),h={id:c,key:s.id,"data-slate-node":"element","data-slate-inline":l},S=i.type,y=i.children,W=y===void 0?[]:y,F=function(he){return b3[he]||Mq}(S);a=u?null:W.map(function(he,Ee){return Vw(he,Ee,i,o)});var N=F(i,a,o);if(u){h["data-slate-void"]=!0;var j=l?"span":"div",D=Tr(St.texts(i),1),Q=Tr(D[0],1)[0],te=er(j,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Vw(Q,0,i,o));N=er(j,{style:{position:"relative"}},N,te),gf.set(Q,0),jc.set(Q,i)}return N.data==null&&(N.data={}),Object.assign(N.data,h),u||l||(N=function(he,Ee){var ve=Ee;return Ww.forEach(function(De){ve=De(he,Ee)}),ve}(i,N)),co(function(){var he=iw(c);he!=null&&(ew.set(s,he),Nm.set(i,he),Fm.set(he,i))}),N}(e,n):function(i,o,a){if(i.text==null)throw new Error("Current node is not slate Text "+JSON.stringify(i));var s=Ae.findKey(a,i),l=a.getConfig().decorate;if(l==null)throw new Error("Can not get config.decorate");var u=Ae.findPath(a,i),c=l([i,u]),h=Rt.decorations(i,c),S=h.map(function(F,N){var j=function(D,Q,te,he,Ee){Q===void 0&&(Q=!1);var ve=D.text,De=Ae.findPath(Ee,te),Pe=Ue.parent(De);if(de.isEditor(he))throw new Error("Text node "+JSON.stringify(te)+" parent is Editor");return Ee.isVoid(he)?Gw(St.string(he).length):ve!==""||he.children[he.children.length-1]!==te||Ee.isInline(he)||de.string(Ee,Pe)!==""?ve===""?Gw():Q&&ve.slice(-1)===` +`?E3(ve,!0):E3(ve):Gw(0,!0)}(F,N===h.length-1,i,o,a);return j=function(D,Q){var te=Q;return Ww.forEach(function(he){te=he(D,te)}),te}(F,j),er("span",{"data-slate-leaf":!0},j)}),y=function(F){return"w-e-text-"+F}(s.id),W=er("span",{"data-slate-node":"text",id:y,key:s.id},S);return co(function(){var F=iw(y);F!=null&&(ew.set(s,F),Nm.set(i,F),Fm.set(F,i))}),W}(e,r,n)}function Bq(e,t){var r,n=e.$scroll,i=function(F){return"w-e-textarea-"+F}(e.id),o=t.getConfig(),a=o.readOnly,s=o.autoFocus,l=function(F,N){return N===void 0&&(N=!1),wc("div#"+F,{props:{contentEditable:!N}})}(i,a),u=t.children||[];l.children=u.map(function(F,N){var j=Vw(F,N,t,t);return y3(j),j});var c=n4.get(e);if(c==null&&(c=!0),c){var h=function(F,N){return _e(`
`)}(i);n.append(h),e.$textArea=h,r=h[0],(y=A$([O$,L$,I$,_$,k$,D$]))(r,l),n4.set(e,!1),i4.set(e,y)}else{var S=o4.get(e),y=i4.get(e);if(S==null||y==null)return;r=S.elm,y(S,l)}if(r!=null||(r=iw(i))!=null){if((c?s:t.isFocused())&&r.focus({preventScroll:!0}),c){var z=nw(r);z&&a4.set(t,z)}qS.set(t,r),Nm.set(t,r),Fm.set(r,t),o4.set(e,l)}}function x3(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function S3(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Kw(e,t){if(e.clientHeightt||o>e&&a=t&&s>=r?o-e-n:a>t&&sr?a-t+i:0}function w3(e,t){var r=window,n=t.scrollMode,i=t.block,o=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l=typeof a=="function"?a:function(or){return or!==a};if(!x3(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,c=[],h=e;x3(h)&&l(h);){if((h=h.parentElement)===u){c.push(h);break}h!=null&&h===document.body&&Kw(h)&&!Kw(document.documentElement)||h!=null&&Kw(h,s)&&c.push(h)}for(var S=r.visualViewport?r.visualViewport.width:innerWidth,y=r.visualViewport?r.visualViewport.height:innerHeight,z=window.scrollX||pageXOffset,F=window.scrollY||pageYOffset,N=e.getBoundingClientRect(),j=N.height,D=N.width,Q=N.top,te=N.right,he=N.bottom,Ee=N.left,ve=i==="start"||i==="nearest"?Q:i==="end"?he:Q+j/2,De=o==="center"?Ee+D/2:o==="end"?te:Ee,Pe=[],qe=0;qe=0&&Ee>=0&&he<=y&&te<=S&&Q>=ht&&he<=Dt&&Ee>=Ft&&te<=pt)return Pe;var Bt=getComputedStyle(ot),It=parseInt(Bt.borderLeftWidth,10),Re=parseInt(Bt.borderTopWidth,10),Te=parseInt(Bt.borderRightWidth,10),Be=parseInt(Bt.borderBottomWidth,10),it=0,vt=0,ut="offsetWidth"in ot?ot.offsetWidth-ot.clientWidth-It-Te:0,kt="offsetHeight"in ot?ot.offsetHeight-ot.clientHeight-Re-Be:0;if(u===ot)it=i==="start"?ve:i==="end"?ve-y:i==="nearest"?Xm(F,F+y,y,Re,Be,F+ve,F+ve+j,j):ve-y/2,vt=o==="start"?De:o==="center"?De-S/2:o==="end"?De-S:Xm(z,z+S,S,It,Te,z+De,z+De+D,D),it=Math.max(0,it+F),vt=Math.max(0,vt+z);else{it=i==="start"?ve-ht-Re:i==="end"?ve-Dt+Be+kt:i==="nearest"?Xm(ht,Dt,gt,Re,Be+kt,ve,ve+j,j):ve-(ht+gt/2)+kt/2,vt=o==="start"?De-Ft-It:o==="center"?De-(Ft+dt/2)+ut/2:o==="end"?De-pt+Te+ut:Xm(Ft,pt,dt,It,Te+ut,De,De+D,D);var Xt=ot.scrollLeft,qt=ot.scrollTop;ve+=qt-(it=Math.max(0,Math.min(qt+it,ot.scrollHeight-gt+kt))),De+=Xt-(vt=Math.max(0,Math.min(Xt+vt,ot.scrollWidth-dt+ut)))}Pe.push({el:ot,top:it,left:vt})}return Pe}function C3(e){return e===Object(e)&&Object.keys(e).length!==0}function ho(e,t){return iu(t)&&Ae.hasDOMNode(e,t,{editable:!0})}function T3(e,t){if(e.getConfig().readOnly)return!1;var r=Yc(e,t)&&Ae.toSlateNode(e,t);return de.isVoid(e,r)}function Yc(e,t){return iu(t)&&Ae.hasDOMNode(e,t)}function A3(e,t,r){r===void 0&&(r=!1);var n=t.selection,i=t.getConfig(),o=Ae.findDocumentOrShadowRoot(t).getSelection();if(o&&(!e.isComposing||r)&&t.isFocused()){var a=o.type!=="None";if(n||a){var s=qS.get(t),l=!1;if(s.contains(o.anchorNode)&&s.contains(o.focusNode)&&(l=!0),a&&l&&n){var u=Ae.toSlateRange(t,o,{exactMatch:!0,suppressThrow:!0});if(u&&Qe.equals(u,n)){var c=!0;if(Qe.isCollapsed(n)){var h=o.anchorNode,S=o.anchorOffset;if(h===s){var y=s.childNodes,z=void 0;(z=y[S])&&z.matches("table")&&(c=!1),(z=y[S-1])&&z.matches("table")&&(c=!1)}}if(c)return}}if(!n||Ae.hasRange(t,n)){e.isUpdatingSelection=!0;var F=n&&Ae.toDOMRange(t,n);if(F){Qe.isBackward(n)?o.setBaseAndExtent(F.endContainer,F.endOffset,F.startContainer,F.startOffset):o.setBaseAndExtent(F.startContainer,F.startOffset,F.endContainer,F.endOffset);var N=F.startContainer.parentElement;if(!N.closest("[data-slate-spacer]")){N.getBoundingClientRect=F.getBoundingClientRect.bind(F);var j=document.body;(function(D,Q){var te=!D.ownerDocument.documentElement.contains(D);if(C3(Q)&&typeof Q.behavior=="function")return Q.behavior(te?[]:w3(D,Q));if(!te){var he=function(Ee){return Ee===!1?{block:"end",inline:"nearest"}:C3(Ee)?Ee:{block:"start",inline:"nearest"}}(Q);(function(Ee,ve){ve===void 0&&(ve="auto");var De="scrollBehavior"in document.body.style;Ee.forEach(function(Pe){var qe=Pe.el,ot=Pe.top,et=Pe.left;qe.scroll&&De?qe.scroll({top:ot,left:et,behavior:ve}):(qe.scrollTop=ot,qe.scrollLeft=et)})})(w3(D,he),he.behavior)}})(N,{scrollMode:"if-needed",boundary:i.scroll?s.parentElement:j,block:"end",behavior:"smooth"}),delete N.getBoundingClientRect}}else o.removeAllRanges();setTimeout(function(){F&&vf&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ae.toSlateRange(t,o,{exactMatch:!1,suppressThrow:!1})}}}var $w=new WeakMap,D3=new WeakMap,Fq={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Nq={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},jq={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},rn=function(e){var t=Fq[e],r=Nq[e],n=jq[e],i=t&&bx(t),o=r&&bx(r),a=n&&bx(n);return function(s){return!(!i||!i(s))||!!(ow&&o&&o(s))||!(ow||!a||!a(s))}},ln={isBold:rn("bold"),isCompose:rn("compose"),isMoveBackward:rn("moveBackward"),isMoveForward:rn("moveForward"),isDeleteBackward:rn("deleteBackward"),isDeleteForward:rn("deleteForward"),isDeleteLineBackward:rn("deleteLineBackward"),isDeleteLineForward:rn("deleteLineForward"),isDeleteWordBackward:rn("deleteWordBackward"),isDeleteWordForward:rn("deleteWordForward"),isExtendBackward:rn("extendBackward"),isExtendForward:rn("extendForward"),isExtendLineBackward:rn("extendLineBackward"),isExtendLineForward:rn("extendLineForward"),isItalic:rn("italic"),isMoveLineBackward:rn("moveLineBackward"),isMoveLineForward:rn("moveLineForward"),isMoveWordBackward:rn("moveWordBackward"),isMoveWordForward:rn("moveWordForward"),isRedo:rn("redo"),isSplitBlock:rn("splitBlock"),isTransposeCharacter:rn("transposeCharacter"),isUndo:rn("undo"),isTab:rn("tab"),isSelectAll:rn("selectAll")};function Pn(e){e.preventDefault()}var Uq={beforeinput:function(e,t,r){var n=e,i=r.getConfig().readOnly;if(yf&&!i&&ho(r,n.target)){var o=r.selection,a=n.inputType,s=n.dataTransfer||n.data||void 0;if(a!=="insertCompositionText"&&a!=="deleteCompositionText"){if(n.preventDefault(),!a.startsWith("delete")||a.startsWith("deleteBy")){var l=Tr(n.getTargetRanges(),1)[0];if(l){var u=Ae.toSlateRange(r,l,{exactMatch:!1,suppressThrow:!1});o&&Qe.equals(o,u)||Ve.select(r,u)}}if(o&&Qe.isExpanded(o)&&a.startsWith("delete")){var c=a.endsWith("Backward")?"backward":"forward";de.deleteFragment(r,{direction:c})}else switch(a){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":de.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":de.deleteForward(r);break;case"deleteContentBackward":de.deleteBackward(r);break;case"deleteEntireSoftLine":de.deleteBackward(r,{unit:"line"}),de.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":de.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":de.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":de.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":de.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":de.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":de.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":de.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if(a==="insertFromPaste"&&!rw.get(r))break;s instanceof DataTransfer?r.insertData(s):typeof s=="string"&&de.insertText(r,s)}}}},blur:function(e,t,r){var n=e,i=t.isUpdatingSelection,o=t.latestElement;if(!r.getConfig().readOnly&&!i&&ho(r,n.target)){var a=Ae.findDocumentOrShadowRoot(r);if(o!==a.activeElement){var s=n.relatedTarget;if(!(s===Ae.toDOMNode(r,r)||Po(s)&&s.hasAttribute("data-slate-spacer"))){if(s!=null&&iu(s)&&Ae.hasDOMNode(r,s)){var l=Ae.toSlateNode(r,s);if(Ut.isElement(l)&&!r.isVoid(l))return}if(mf){var u=a.getSelection();u==null||u.removeAllRanges()}nu.delete(r)}}}},focus:function(e,t,r){var n=Ae.toDOMNode(r,r),i=Ae.findDocumentOrShadowRoot(r);t.latestElement=i.activeElement,vf&&e.target!==n?n.focus():nu.set(r,!0)},click:function(e,t,r){if(!r.getConfig().readOnly&&Yc(r,e.target)&&iu(e.target)){var n=Ae.toSlateNode(r,e.target),i=Ae.findPath(r,n);if(de.hasPath(r,i)&&St.get(r,i)===n){var o=de.start(r,i),a=de.end(r,i),s=de.void(r,{at:o}),l=de.void(r,{at:a});if(s&&l&&je.equals(s[1],l[1])){var u=de.range(r,o);Ve.select(r,u)}}}},compositionstart:function(e,t,r){if(ho(r,e.target)){var n=r.selection;if(n&&Qe.isExpanded(n)&&(de.deleteFragment(r),Promise.resolve().then(function(){A3(t,r,!0)})),n&&Qe.isCollapsed(n)){var i=Ae.toDOMRange(r,n).startContainer,o=i.textContent||"";$w.set(r,o),D3.set(r,i)}t.isComposing=!0,function(a,s){var l;s.getConfig().placeholder&&s.isEmpty()&&a.showPlaceholder&&((l=a.$placeholder)===null||l===void 0||l.hide(),a.showPlaceholder=!1)}(t,r)}},compositionend:function(e,t,r){var n=e;if(ho(r,n.target)){t.isComposing=!1;var i=r.selection;if(i!=null){(aw||vf)&&Ae.cleanExposedTexNodeInSelectionBlock(r);for(var o=Qe.isBackward(i)?i.focus:i.anchor,a=Tr(de.node(r,[o.path[0]]),1)[0],s=0;s0&&de.insertText(r,u.slice(0,c)),t.changeViewState()):de.insertText(r,u)}else de.insertText(r,u);mf||setTimeout(function(){var h=r.selection;if(h!=null){var S=D3.get(r);S!=null&&Ae.toDOMRange(r,h).startContainer!==S&&(S.textContent=$w.get(r)||"")}})}}}},compositionupdate:function(e,t,r){ho(r,e.target)&&(t.isComposing=!0)},keydown:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&!t.isComposing&&ho(r,n.target)){if(function(a,s){var l=Im.get(a),u=l&&l.getMenus(),c=Mm.get(a),h=c&&c.getMenus(),S=lo(lo({},u),h);for(var y in S){var z=S[y],F=z.hotkey;if(F&&sX(F,s)&&!z.isDisabled(a)){var N=z.getValue(a);z.exec(a,N)}}}(r,n),ln.isTab(n))return Pn(n),void r.handleTab();if(ln.isRedo(n))return Pn(n),void(typeof r.redo=="function"&&r.redo());if(ln.isUndo(n))return Pn(n),void(typeof r.undo=="function"&&r.undo());if(ln.isMoveLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",reverse:!0});if(ln.isMoveLineForward(n))return Pn(n),void Ve.move(r,{unit:"line"});if(ln.isExtendLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus",reverse:!0});if(ln.isExtendLineForward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus"});if(ln.isMoveBackward(n))return Pn(n),void(i&&Qe.isCollapsed(i)?Ve.move(r,{reverse:!0}):Ve.collapse(r,{edge:"start"}));if(ln.isMoveForward(n))return Pn(n),void(i&&Qe.isCollapsed(i)?Ve.move(r):Ve.collapse(r,{edge:"end"}));if(ln.isMoveWordBackward(n))return Pn(n),i&&Qe.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word",reverse:!0});if(ln.isMoveWordForward(n))return Pn(n),i&&Qe.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word"});if(ln.isSelectAll(n))return Pn(n),void r.selectAll();if(yf){if((aw||mf)&&i&&(ln.isDeleteBackward(n)||ln.isDeleteForward(n))&&Qe.isCollapsed(i)){var o=St.parent(r,i.anchor.path);if(Ut.isElement(o)&&de.isVoid(r,o)&&de.isInline(r,o))return n.preventDefault(),void Ve.delete(r,{unit:"block"})}}else{if(ln.isBold(n)||ln.isItalic(n)||ln.isTransposeCharacter(n))return void Pn(n);if(ln.isSplitBlock(n))return Pn(n),void de.insertBreak(r);if(ln.isDeleteBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r));if(ln.isDeleteForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r));if(ln.isDeleteLineBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"line"}));if(ln.isDeleteLineForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"line"}));if(ln.isDeleteWordBackward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"word"}));if(ln.isDeleteWordForward(n))return Pn(n),void(i&&Qe.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"word"}))}}},keypress:function(e,t,r){if(!yf&&!r.getConfig().readOnly&&ho(r,e.target)){e.preventDefault();var n=e.key;de.insertText(r,n)}},copy:function(e,t,r){var n=e;if(ho(r,n.target)){n.preventDefault();var i=n.clipboardData;i!=null&&r.setFragmentData(i)}},cut:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&ho(r,n.target)){n.preventDefault();var o=n.clipboardData;if(o!=null&&(r.setFragmentData(o),i))if(Qe.isExpanded(i))de.deleteFragment(r);else{var a=St.parent(r,i.anchor.path);de.isVoid(r,a)&&Ve.delete(r)}}},paste:function(e,t,r){rw.set(r,!0);var n=e;if(!r.getConfig().readOnly&&ho(r,n.target)){var i=r.getConfig().customPaste;if(i&&i(r,n)===!1)return void rw.set(r,!1);if(!yf||function(a){return a.clipboardData&&a.clipboardData.getData("text/plain")!==""&&a.clipboardData.types.length===1}(n)){n.preventDefault();var o=n.clipboardData;o!=null&&r.insertData(o)}}},dragover:function(e,t,r){if(Yc(r,e.target)){var n=Ae.toSlateNode(r,e.target);de.isVoid(r,n)&&e.preventDefault()}},dragstart:function(e,t,r){var n=e;if(Yc(r,n.target)&&!r.getConfig().readOnly){var i=Ae.toSlateNode(r,n.target),o=Ae.findPath(r,i);if(de.isVoid(r,i)||de.void(r,{at:o,voids:!0})){var a=de.range(r,o);Ve.select(r,a)}var s=n.dataTransfer;s!=null&&(t.isDraggingInternally=!0,r.setFragmentData(s))}},dragend:function(e,t,r){var n=e;r.getConfig().readOnly||t.isDraggingInternally&&Yc(r,n.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,r){var n=e,i=n.dataTransfer;if(!r.getConfig().readOnly&&Yc(r,n.target)&&i!=null&&!(yf&&mf&&i.files.length>0)){n.preventDefault();var o=r.selection,a=Ae.findEventRange(r,n);Ve.select(r,a),t.isDraggingInternally&&(o&&Ve.delete(r,{at:o}),t.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Hq=1,zq=function(){function e(t){var r=this;this.id=Hq++,this.$textArea=null,this.$progressBar=_e('
'),this.$maxLengthInfo=_e('
'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Hl(function(){var a=r.editorInstance;!function(s,l){var u=s.isComposing,c=s.isUpdatingSelection,h=s.isDraggingInternally;if(!(l.getConfig().readOnly||u||c||h)){var S=Ae.findDocumentOrShadowRoot(l),y=S.activeElement,z=Ae.toDOMNode(l,l),F=S.getSelection();if(y===z?(s.latestElement=y,nu.set(l,!0)):nu.delete(l),!F)return Ve.deselect(l);var N=F.anchorNode,j=F.focusNode,D=ho(l,N)||T3(l,N),Q=ho(l,j)||T3(l,j);if(D&&Q){var te=Ae.toSlateRange(l,F,{exactMatch:!1,suppressThrow:!1});Ve.select(l,te)}else Ve.deselect(l)}}(r,a)},100);var n=_e(t);if(n.length===0)throw new Error("Cannot find textarea DOM by selector '"+t+"'");this.$box=n;var i=_e('
');i.append(this.$progressBar),i.append(this.$maxLengthInfo),n.append(i);var o=_e('
');i.append(o),this.$scroll=o,this.$textAreaContainer=i,co(function(){var a=r.editorInstance,s=Ae.getWindow(a);s.document.addEventListener("selectionchange",r.onDOMSelectionChange),a.on("destroyed",function(){s.document.removeEventListener("selectionchange",r.onDOMSelectionChange)}),i.on("click",function(){return a.hidePanelOrModal()}),a.on("change",r.changeViewState.bind(r));var l=a.getConfig().onChange;l&&a.on("change",function(){return l(a)}),r.onFocusAndOnBlur(),a.on("change",r.changeMaxLengthInfo.bind(r)),r.bindEvent()})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var t=XS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},enumerable:!1,configurable:!0}),e.prototype.bindEvent=function(){var t=this,r=this.$textArea,n=this.$scroll,i=this.editorInstance;r!=null&&(sx(Uq,function(o,a){r.on(a,function(s){o(s,t,i)})}),i.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",Hl(function(){i.emit("scroll")},100))))},e.prototype.onFocusAndOnBlur=function(){var t=this,r=this.editorInstance,n=r.getConfig(),i=n.onBlur,o=n.onFocus;this.latestEditorSelection=r.selection,r.on("change",function(){t.latestEditorSelection==null&&r.selection!=null?setTimeout(function(){return o&&o(r)}):t.latestEditorSelection!=null&&r.selection==null&&setTimeout(function(){return i&&i(r)}),t.latestEditorSelection=r.selection})},e.prototype.changeMaxLengthInfo=function(){var t=this.editorInstance,r=t.getConfig().maxLength;if(r){var n=r-Ae.getLeftLengthOfMaxLength(t);this.$maxLengthInfo[0].innerHTML=n+"/"+r}},e.prototype.changeProgress=function(t){var r=this.$progressBar;r.css("width",t+"%"),t>=100&&setTimeout(function(){r.hide(),r.css("width","0"),r.show()},1e3)},e.prototype.changeViewState=function(){var t=this,r=this.editorInstance;Bq(this,r),function(n,i){var o,a=i.getConfig().placeholder;if(a){var s=i.isEmpty();if(s&&!n.showPlaceholder&&!n.isComposing){if(n.$placeholder==null){var l=_e('
'+a+"
");n.$textAreaContainer.append(l),n.$placeholder=l}return n.$placeholder.show(),void(n.showPlaceholder=!0)}!s&&n.showPlaceholder&&((o=n.$placeholder)===null||o===void 0||o.hide(),n.showPlaceholder=!1)}}(this,r),co(function(){A3(t,r)})},e.prototype.destroy=function(){this.$textAreaContainer.remove()},e}();function Xw(e){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Xw(t)}function Yw(){return _e('')}function O3(){return _e('
')}function _3(e,t,r,n,i){if(i===void 0&&(i=!1),t){if(n){var o=ow?"cmd":"ctrl";n=n.replace("mod",o)}if(i)n&&(e.attr("data-tooltip",n),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=n?r+` -`+n:r;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}IS("match",function(e,t,r){return[function(n){var i=so(this),o=n==null?void 0:Jl(n,e);return o?Cr(o,n,i):new RegExp(n)[e]($r(i))},function(n){var i=Sn(this),o=$r(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return cf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=cf(i,o))!==null;){var h=$r(l[0]);u[c]=h,h===""&&(i.lastIndex=MS(o,Rc(i.lastIndex),s)),c++}return c===0?null:u}]});var Zw=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('
'),this.$button=_e(''),this.disabled=!1,this.menu=r;var o=r.tag,a=r.width;if(o!=="button")throw new Error("Invalid tag '"+o+"', expected 'button'");var s=r.title,l=r.hotkey,u=l===void 0?"":l,c=r.iconSvg,h=c===void 0?"":c,S=this.$button;if(h){var y=_e(h);Xw(y),S.append(y)}else S.text(s);_3(S,h,s,u,n),n&&h&&S.append(_e(''+s+"")),a&&S.css("width",a+"px"),S.attr("data-menu-key",t),this.$elem.append(S),co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.disabled||(t.exec(),t.onButtonClick())})},e.prototype.exec=function(){var t=Gi(this),r=this.menu,n=r.getValue(t);r.exec(t,n)},e.prototype.setActive=function(){var t=Gi(this),r=this.$button,n="active";this.menu.isActive(t)?r.addClass(n):r.removeClass(n)},e.prototype.setDisabled=function(){var t=Gi(this),r=this.$button,n=this.menu.isDisabled(t);(t.selection==null||t.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var i="disabled";n?r.addClass(i):r.removeClass(i),this.disabled=n},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},e}(),Wq=function(e){function t(r,n,i){return i===void 0&&(i=!1),e.call(this,r,n,i)||this}return Fc(t,e),t.prototype.onButtonClick=function(){},t}(Zw),Jw=function(){function e(t){this.isShow=!1,this.showTime=0,this.record(t)}return e.prototype.record=function(t){var r=QS.get(t);r==null&&(r=new Set,QS.set(t,r)),r.add(this),Bm.set(this,t)},e.prototype.renderContent=function(t){var r=this.$elem;r.empty(),r.append(t);var n=this.genSelfElem();n&&r.append(n)},e.prototype.appendTo=function(t){var r=this.$elem;t.append(r)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var t=Bm.get(this);t&&t.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var t=Bm.get(this);t&&t.emit("modalOrPanelHide")}},e}(),Gq=function(e){function t(r){var n=e.call(this,r)||this;return n.type="dropPanel",n.$elem=_e('
'),n}return Fc(t,e),t.prototype.genSelfElem=function(){return null},t}(Jw),Vq=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var a=Yw();o.$button.append(a)}return o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var r=this.menu;if(r.getPanelContentElem!=null){var n=Gi(this);if(this.dropPanel==null){var i=new Gq(n),o=r.getPanelContentElem(n);i.renderContent(o),i.appendTo(this.$elem),i.show(),this.dropPanel=i}else{var a=this.dropPanel;a.isShow?a.hide():(o=r.getPanelContentElem(n),a.renderContent(o),a.show())}var s=this.dropPanel;if(s.isShow){var l=this.$elem,u=l.offset().left,c=l.parents(".w-e-bar");u-c.offset().left>=c.width()/2?s.$elem.css({left:"none",right:"0"}):s.$elem.css({left:"0",right:"none"})}}},t}(Zw),Kq=function(e){function t(r,n){n===void 0&&(n=0);var i=e.call(this,r)||this;i.type="modal",i.$elem=_e('
'),i.width=0,n&&(i.width=n);var o=i.$elem;return o.on("click",function(a){return a.stopPropagation()}),o.on("keyup",function(a){a.code==="Escape"&&(i.hide(),r.restoreSelection())}),i}return Fc(t,e),t.prototype.genSelfElem=function(){var r=this,n=_e(''),i=Bm.get(this);return n.on("click",function(){r.hide(),i==null||i.restoreSelection()}),n},t.prototype.setStyle=function(r){var n=this.width,i=this.$elem;i.attr("style",""),n&&i.css("width",n+"px"),i.css(r)},t}(Jw);function Wi(e,t,r){var n=_e('');n.append(""+e+"");var i=_e('');return n.append(i),[n[0],i[0]]}function Hye(e,t,r){var n=_e('');n.append(""+e+"");var i=_e('');return n.append(i),[n[0],i[0]]}function Zc(e,t){var r=_e('
'),n=_e('");return r.append(n),[r[0],n[0]]}var $q=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;return o.$body=_e("body"),o.modal=null,o.menu=n,o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var r=Gi(this),n=this.menu.getModalPositionNode(r);return Ut.isElement(n)?Uw(r,n,"modal"):jw(r)},t.prototype.handleModal=function(){var r=Gi(this),n=this.menu;if(this.modal==null){var i=new Kq(r,n.modalWidth);this.renderAndShowModal(i,!0),this.modal=i}else(i=this.modal).isShow?i.hide():this.renderAndShowModal(i,!1)},t.prototype.renderAndShowModal=function(r,n){n===void 0&&(n=!1);var i=Gi(this),o=this.menu;if(o.getModalContentElem!=null){var a=Ae.getTextarea(i),s=Ae.getToolbar(i),l=((s==null?void 0:s.getConfig())||{}).modalAppendToBody,u=o.getModalContentElem(i);if(r.renderContent(u),l)r.setStyle({left:"0",right:"0"});else{var c=this.getPosition();r.setStyle(c)}n&&(l?r.appendTo(this.$body):r.appendTo(a.$textAreaContainer)),r.show(),l||Hw(i,r.$elem),setTimeout(function(){i.blur()})}},t}(Zw),Xq=function(e){function t(r,n){var i=e.call(this,r)||this;return i.type="selectList",i.$elem=_e('
'),n&&i.$elem.css("width",n+"px"),i.$elem.on("click",function(o){o.stopPropagation()}),i}return Fc(t,e),t.prototype.renderList=function(r){var n=this.$elem;n.empty();var i=_e("
    ");r.forEach(function(o){var a=o.value,s=o.text,l=o.selected,u=o.styleForRenderMenuList,c=_e('
  • ');if(u&&c.css(u),l){var h=_e('');c.append(h),c.addClass("selected")}c.append(_e(''+s+"")),c.attr("title",s),i.append(c)}),n.append(i)},t.prototype.genSelfElem=function(){return null},t}(Jw),Yq=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('
    '),this.$button=_e(''),this.disabled=!1,this.selectList=null;var o=r.tag,a=r.title,s=r.width,l=r.iconSvg,u=l===void 0?"":l,c=r.hotkey,h=c===void 0?"":c;if(o!=="select")throw new Error("Invalid tag '"+o+"', expected 'select'");var S=this.$button;s&&S.css("width",s+"px"),S.attr("data-menu-key",t),_3(S,u,a,h,n),this.$elem.append(S),this.menu=r,co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setSelectedValue(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.trigger()})},e.prototype.trigger=function(){var t=this,r=Gi(this);if(!r.isDisabled()&&!this.disabled){var n=this.menu;if(this.selectList==null){this.selectList=new Xq(r,n.selectPanelWidth);var i=this.selectList,o=n.getOptions(r);i.renderList(o),i.appendTo(this.$elem),i.show(),i.$elem.on("click","li",function(a){var s=a.target;if(s!=null){a.preventDefault();var l=_e(s).attr("data-value");t.onChange(l)}})}else(i=this.selectList).isShow?i.hide():(o=n.getOptions(r),i.renderList(o),i.show())}},e.prototype.onChange=function(t){var r=Gi(this),n=this.menu;n.exec&&n.exec(r,t)},e.prototype.setSelectedValue=function(){var t=Gi(this),r=this.menu,n=r.getValue(t),i=function(s,l){for(var u=s.length,c="",h=0;h
    '),this.$container=_e('
    '),this.$button=_e('');var r=t.key,n=t.iconSvg,i=t.title,o=this.$elem,a=this.$button;if(n){var s=_e(n);Xw(s),a.append(s)}else a.text(i);a.attr("data-menu-key",r);var l=Yw();a.append(l),o.append(a);var u=this.$container;o.append(u);var c=this.createObserver();this.observe(c)}return e.prototype.appendBarItem=function(t){var r=t.$elem;this.$container.append(r)},e.prototype.observe=function(t){var r=this.$container;t.observe(r[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var t=this,r=this.$container,n=this.$button,i=new MutationObserver(function(){var o=r.find("button"),a=o.length;if(a!==0){var s=0;o.each(function(l){_e(l).hasClass("disabled")&&s++}),i.disconnect(),s===a?n.addClass("disabled"):n.removeClass("disabled"),t.observe(i)}});return i},e}(),k3=new WeakMap;function Gi(e){var t=JS.get(e);if(t==null)throw new Error("Can not get editor instance");return t}function L3(e,t,r){r===void 0&&(r=!1);var n=k3.get(t);if(n)return n;var i=t.tag;if(i==="button"){var o=t.showDropPanel,a=t.showModal;n=o?new Vq(e,t,r):a?new $q(e,t,r):new Wq(e,t,r)}if(i==="select"&&(n=new Yq(e,t,r)),n==null)throw new Error("Invalid tag in menu "+JSON.stringify(t));return k3.set(t,n),n}function Zq(e,t){var r=e.selection;return r!=null&&!Qe.isCollapsed(r)&&!Ae.getSelectedElems(e).some(function(n){if(e.isVoid(n))return!0;var i=n.type;return!!["pre","code","table"].includes(i)||void 0})&&!!Rt.isText(t)}var Jq=function(){function e(){var t=this;this.$elem=_e('
    '),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.changeHoverbarState=eI(function(){var r=t.isShow,n=t.getSelectedNodeAndMenuKeys()||{},i=n.node,o=i===void 0?null:i,a=n.menuKeys,s=a===void 0?[]:a;o!=null&&t.changeItemsState(),o&&Ut.isElement(o)&&r&&t.isSamePath(o,t.prevSelectedNode)||(t.hideAndClean(),o!=null&&(t.registerItems(s),t.setPosition(o),t.show()),t.prevSelectedNode=o)},200),co(function(){var r=t.getEditorInstance(),n=t.$elem;n.on("mousedown",function(o){return o.preventDefault()},{passive:!1}),Ae.getTextarea(r).$textAreaContainer.append(n),r.on("change",t.changeHoverbarState);var i=t.hideAndClean.bind(t);r.on("scroll",i),r.on("fullScreen",i),r.on("unFullScreen",i)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var t=this.$elem;t.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],t.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var t=this.$elem,r=!1,n=window.innerHeight;n&&n>=360&&n-t[0].getBoundingClientRect().bottom<360&&(r=!0),r?t.addClass("w-e-bar-bottom"):t.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var t=this;co(function(){t.hoverbarItems.forEach(function(r){r.changeMenuState()})})},e.prototype.registerItems=function(t){var r=this,n=this.$elem;t.forEach(function(i){if(i!=="|")r.registerSingleItem(i);else{var o=O3();n.append(o)}})},e.prototype.registerSingleItem=function(t){var r=this.getEditorInstance(),n=this.menus,i=n[t];if(i==null){var o=bf[t];if(o==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof o!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");i=o(),n[t]=i}var a=L3(t,i);this.hoverbarItems.push(a),JS.set(a,r),this.$elem.append(a.$elem)},e.prototype.setPosition=function(t){var r=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Ut.isElement(t)){var i=Uw(r,t,"bar");return n.css(i),void Hw(r,n)}if(Rt.isText(t))return i=jw(r),n.css(i),void Hw(r,n);throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(t.selection==null)return null;var r=this.getHoverbarKeysConf(),n=null,i=[],o=function(s){var l=r[s],u=l.match,c=l.menuKeys,h=c===void 0?[]:c,S=u||function(F,N){return Ae.checkNodeType(N,s)},y=Tr(de.nodes(t,{match:function(F){return S(t,F)},universal:!0}),1),z=y[0];if(z!=null)return n=z[0],i=h,"break"};for(var a in r)if(o(a)==="break")break;return n==null||i.length===0?null:{node:n,menuKeys:i}},e.prototype.getEditorInstance=function(){var t=ZS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.getHoverbarKeysConf=function(){var t=this.getEditorInstance().getConfig().hoverbarKeys,r=t===void 0?{}:t,n=r.text;return n&&n.match==null&&(n.match=Zq),r},e.prototype.isSamePath=function(t,r){if(t==null||r==null)return!1;var n=Ae.findPath(null,t),i=Ae.findPath(null,r);return je.equals(n,i)},e.prototype.destroy=function(){this.changeHoverbarState.cancel(),this.$elem.remove(),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}();function P3(e,t,r,n){if(gf.set(e,t),jc.set(e,r),Ut.isElement(e)){var i=e.children;if((i===void 0?[]:i).forEach(function(s,l){return P3(s,l,e,n)}),de.isVoid(n,e)){var o=Tr(St.texts(e),1),a=Tr(o[0],1)[0];gf.set(a,0),jc.set(a,e)}}}function Qq(e){var t=e.selector,r=t===void 0?"":t,n=e.config,i=n===void 0?{}:n,o=e.content,a=e.html,s=e.plugins,l=s===void 0?[]:s,u=(j=>{var D=j,{apply:Q}=D;return D.history={undos:[],redos:[]},D.redo=()=>{var{history:te}=D,{redos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{for(var ve of Ee)D.apply(ve)})}),te.redos.pop(),te.undos.push(Ee)}},D.undo=()=>{var{history:te}=D,{undos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{var ve=Ee.map(ss.inverse).reverse();for(var De of ve)D.apply(De)})}),te.redos.push(Ee),te.undos.pop()}},D.apply=te=>{var{operations:he,history:Ee}=D,{undos:ve}=Ee,De=ve[ve.length-1],Pe=De&&De[De.length-1],qe=((dt,ht)=>!(!ht||dt.type!=="set_selection"||ht.type!=="set_selection"))(te,Pe),ot=Ic.isSaving(D),et=Ic.isMerging(D);if(ot==null&&(ot=((dt,ht)=>dt.type!=="set_selection"||dt.properties!=null&&dt.newProperties!=null)(te)),ot){if(et==null&&(et=De!=null&&(he.length!==0||((dt,ht)=>dt.type==="set_selection"||!(!ht||dt.type!=="insert_text"||ht.type!=="insert_text"||dt.offset!==ht.offset+ht.text.length||!je.equals(dt.path,ht.path))||!(!ht||dt.type!=="remove_text"||ht.type!=="remove_text"||dt.offset+dt.text.length!==ht.offset||!je.equals(dt.path,ht.path)))(te,Pe)||qe)),De&&et)qe&&De.pop(),De.push(te);else{var gt=[te];ve.push(gt)}for(;ve.length>100;)ve.shift();(dt=>dt.type!=="set_selection")(te)&&(Ee.redos=[])}Q(te)},D})(function(j){var D=j,Q=D.insertText,te=D.insertNode,he=D.insertFragment,Ee=D.dangerouslyInsertHtml;return D.insertText=function(ve){if(D.getConfig().maxLength){var De=Ae.getLeftLengthOfMaxLength(D);De<=0||(De0&&te.removeAllRanges(),Q&&Ve.deselect(j)},D.move=function(Q,te){te===void 0&&(te=!1),Q&&(Q<0||Ve.move(j,{distance:Q,unit:"character",reverse:te}))},D.moveReverse=function(Q){D.move(Q,!0)},D.restoreSelection=function(){var Q=tw.get(D);Q!=null&&(D.focus(),Ve.select(D,Q))},D.getSelectionPosition=function(){return jw(D)},D.getNodePosition=function(Q){return Uw(D,Q)},D.isSelectedAll=function(){var Q=D.selection;if(Q==null)return!1;var te=Tr(Qe.edges(Q),2),he=te[0],Ee=te[1],ve=Tr(de.edges(D,[]),2),De=ve[0],Pe=ve[1];return!(!cr.equals(he,De)||!cr.equals(Ee,Pe))},D.selectAll=function(){var Q=de.start(D,[]),te=de.end(D,[]);Ve.select(D,{anchor:Q,focus:te})},D}(function(j){var D=j,Q=D.onChange,te=D.insertText,he=D.apply,Ee=D.deleteBackward;return D.insertText=function(ve){D.getConfig().readOnly||te(ve)},D.apply=function(ve){var De,Pe,qe,ot,et,gt,dt,ht,pt=[];switch(ve.type){case"insert_text":case"remove_text":case"set_node":try{for(var Dt=uo(de.levels(D,{at:ve.path})),Ft=Dt.next();!Ft.done;Ft=Dt.next()){var Bt=Tr(Ft.value,2),It=Bt[0],Re=Bt[1],Te=Ae.findKey(D,It);pt.push([Re,Te])}}catch(br){De={error:br}}finally{try{Ft&&!Ft.done&&(Pe=Dt.return)&&Pe.call(Dt)}finally{if(De)throw De.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var Be=uo(de.levels(D,{at:je.parent(ve.path)})),it=Be.next();!it.done;it=Be.next()){var vt=Tr(it.value,2);It=vt[0],Re=vt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){qe={error:br}}finally{try{it&&!it.done&&(ot=Be.return)&&ot.call(Be)}finally{if(qe)throw qe.error}}break;case"move_node":try{for(var ut=uo(de.levels(D,{at:je.common(je.parent(ve.path),je.parent(ve.newPath))})),kt=ut.next();!kt.done;kt=ut.next()){var Xt=Tr(kt.value,2);It=Xt[0],Re=Xt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){et={error:br}}finally{try{kt&&!kt.done&&(gt=ut.return)&>.call(ut)}finally{if(et)throw et.error}}}he(ve);try{for(var qt=uo(pt),or=qt.next();!or.done;or=qt.next()){var ft=Tr(or.value,2);Re=ft[0],Te=ft[1],It=Tr(de.node(D,Re),1)[0],jm.set(It,Te)}}catch(br){dt={error:br}}finally{try{or&&!or.done&&(ht=qt.return)&&ht.call(qt)}finally{if(dt)throw dt.error}}},D.deleteBackward=function(ve){if(ve!=="line")return Ee(ve);if(j.selection&&Qe.isCollapsed(j.selection)){var De=de.above(j,{match:function(et){return de.isBlock(j,et)},at:j.selection});if(De){var Pe=Tr(De,2)[1],qe=de.range(j,Pe,j.selection.anchor),ot=function(et,gt){var dt=de.range(et,Qe.end(gt)),ht=Array.from(de.positions(et,{at:gt})),pt=0,Dt=ht.length,Ft=Math.floor(Dt/2);if(X4(et,de.range(et,ht[pt]),dt))return de.range(et,ht[pt],dt);if(ht.length<2)return de.range(et,ht[ht.length-1],dt);for(;Ft!==ht.length&&Ft!==pt;)X4(et,de.range(et,ht[Ft]),dt)?Dt=Ft:pt=Ft,Ft=Math.floor((pt+Dt)/2);return de.range(et,ht[Dt],dt)}(D,qe);Qe.isCollapsed(ot)||Ve.delete(j,{at:ot})}}},D.onChange=function(){var ve=D.selection;ve!=null&&tw.set(D,ve),D.emit("change"),Q()},D.handleTab=function(){D.insertText(" ")},D.getHtml=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return V4(De,D)}).join("")},D.getText=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return St.string(De)}).join(` + >`)}(i);n.append(h),e.$textArea=h,r=h[0],(y=A$([O$,L$,I$,_$,k$,D$]))(r,l),n4.set(e,!1),i4.set(e,y)}else{var S=o4.get(e),y=i4.get(e);if(S==null||y==null)return;r=S.elm,y(S,l)}if(r!=null||(r=iw(i))!=null){if((c?s:t.isFocused())&&r.focus({preventScroll:!0}),c){var W=nw(r);W&&a4.set(t,W)}qS.set(t,r),Nm.set(t,r),Fm.set(r,t),o4.set(e,l)}}function x3(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function S3(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Kw(e,t){if(e.clientHeightt||o>e&&a=t&&s>=r?o-e-n:a>t&&sr?a-t+i:0}function w3(e,t){var r=window,n=t.scrollMode,i=t.block,o=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l=typeof a=="function"?a:function(or){return or!==a};if(!x3(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,c=[],h=e;x3(h)&&l(h);){if((h=h.parentElement)===u){c.push(h);break}h!=null&&h===document.body&&Kw(h)&&!Kw(document.documentElement)||h!=null&&Kw(h,s)&&c.push(h)}for(var S=r.visualViewport?r.visualViewport.width:innerWidth,y=r.visualViewport?r.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,F=window.scrollY||pageYOffset,N=e.getBoundingClientRect(),j=N.height,D=N.width,Q=N.top,te=N.right,he=N.bottom,Ee=N.left,ve=i==="start"||i==="nearest"?Q:i==="end"?he:Q+j/2,De=o==="center"?Ee+D/2:o==="end"?te:Ee,Pe=[],qe=0;qe=0&&Ee>=0&&he<=y&&te<=S&&Q>=ht&&he<=Dt&&Ee>=Ft&&te<=pt)return Pe;var Bt=getComputedStyle(ot),It=parseInt(Bt.borderLeftWidth,10),Re=parseInt(Bt.borderTopWidth,10),Te=parseInt(Bt.borderRightWidth,10),Be=parseInt(Bt.borderBottomWidth,10),it=0,vt=0,ut="offsetWidth"in ot?ot.offsetWidth-ot.clientWidth-It-Te:0,kt="offsetHeight"in ot?ot.offsetHeight-ot.clientHeight-Re-Be:0;if(u===ot)it=i==="start"?ve:i==="end"?ve-y:i==="nearest"?Xm(F,F+y,y,Re,Be,F+ve,F+ve+j,j):ve-y/2,vt=o==="start"?De:o==="center"?De-S/2:o==="end"?De-S:Xm(W,W+S,S,It,Te,W+De,W+De+D,D),it=Math.max(0,it+F),vt=Math.max(0,vt+W);else{it=i==="start"?ve-ht-Re:i==="end"?ve-Dt+Be+kt:i==="nearest"?Xm(ht,Dt,gt,Re,Be+kt,ve,ve+j,j):ve-(ht+gt/2)+kt/2,vt=o==="start"?De-Ft-It:o==="center"?De-(Ft+dt/2)+ut/2:o==="end"?De-pt+Te+ut:Xm(Ft,pt,dt,It,Te+ut,De,De+D,D);var Xt=ot.scrollLeft,qt=ot.scrollTop;ve+=qt-(it=Math.max(0,Math.min(qt+it,ot.scrollHeight-gt+kt))),De+=Xt-(vt=Math.max(0,Math.min(Xt+vt,ot.scrollWidth-dt+ut)))}Pe.push({el:ot,top:it,left:vt})}return Pe}function C3(e){return e===Object(e)&&Object.keys(e).length!==0}function ho(e,t){return iu(t)&&Ae.hasDOMNode(e,t,{editable:!0})}function T3(e,t){if(e.getConfig().readOnly)return!1;var r=Yc(e,t)&&Ae.toSlateNode(e,t);return de.isVoid(e,r)}function Yc(e,t){return iu(t)&&Ae.hasDOMNode(e,t)}function A3(e,t,r){r===void 0&&(r=!1);var n=t.selection,i=t.getConfig(),o=Ae.findDocumentOrShadowRoot(t).getSelection();if(o&&(!e.isComposing||r)&&t.isFocused()){var a=o.type!=="None";if(n||a){var s=qS.get(t),l=!1;if(s.contains(o.anchorNode)&&s.contains(o.focusNode)&&(l=!0),a&&l&&n){var u=Ae.toSlateRange(t,o,{exactMatch:!0,suppressThrow:!0});if(u&&Je.equals(u,n)){var c=!0;if(Je.isCollapsed(n)){var h=o.anchorNode,S=o.anchorOffset;if(h===s){var y=s.childNodes,W=void 0;(W=y[S])&&W.matches("table")&&(c=!1),(W=y[S-1])&&W.matches("table")&&(c=!1)}}if(c)return}}if(!n||Ae.hasRange(t,n)){e.isUpdatingSelection=!0;var F=n&&Ae.toDOMRange(t,n);if(F){Je.isBackward(n)?o.setBaseAndExtent(F.endContainer,F.endOffset,F.startContainer,F.startOffset):o.setBaseAndExtent(F.startContainer,F.startOffset,F.endContainer,F.endOffset);var N=F.startContainer.parentElement;if(!N.closest("[data-slate-spacer]")){N.getBoundingClientRect=F.getBoundingClientRect.bind(F);var j=document.body;(function(D,Q){var te=!D.ownerDocument.documentElement.contains(D);if(C3(Q)&&typeof Q.behavior=="function")return Q.behavior(te?[]:w3(D,Q));if(!te){var he=function(Ee){return Ee===!1?{block:"end",inline:"nearest"}:C3(Ee)?Ee:{block:"start",inline:"nearest"}}(Q);(function(Ee,ve){ve===void 0&&(ve="auto");var De="scrollBehavior"in document.body.style;Ee.forEach(function(Pe){var qe=Pe.el,ot=Pe.top,et=Pe.left;qe.scroll&&De?qe.scroll({top:ot,left:et,behavior:ve}):(qe.scrollTop=ot,qe.scrollLeft=et)})})(w3(D,he),he.behavior)}})(N,{scrollMode:"if-needed",boundary:i.scroll?s.parentElement:j,block:"end",behavior:"smooth"}),delete N.getBoundingClientRect}}else o.removeAllRanges();setTimeout(function(){F&&vf&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ae.toSlateRange(t,o,{exactMatch:!1,suppressThrow:!1})}}}var $w=new WeakMap,D3=new WeakMap,Fq={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Nq={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},jq={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},rn=function(e){var t=Fq[e],r=Nq[e],n=jq[e],i=t&&bx(t),o=r&&bx(r),a=n&&bx(n);return function(s){return!(!i||!i(s))||!!(ow&&o&&o(s))||!(ow||!a||!a(s))}},ln={isBold:rn("bold"),isCompose:rn("compose"),isMoveBackward:rn("moveBackward"),isMoveForward:rn("moveForward"),isDeleteBackward:rn("deleteBackward"),isDeleteForward:rn("deleteForward"),isDeleteLineBackward:rn("deleteLineBackward"),isDeleteLineForward:rn("deleteLineForward"),isDeleteWordBackward:rn("deleteWordBackward"),isDeleteWordForward:rn("deleteWordForward"),isExtendBackward:rn("extendBackward"),isExtendForward:rn("extendForward"),isExtendLineBackward:rn("extendLineBackward"),isExtendLineForward:rn("extendLineForward"),isItalic:rn("italic"),isMoveLineBackward:rn("moveLineBackward"),isMoveLineForward:rn("moveLineForward"),isMoveWordBackward:rn("moveWordBackward"),isMoveWordForward:rn("moveWordForward"),isRedo:rn("redo"),isSplitBlock:rn("splitBlock"),isTransposeCharacter:rn("transposeCharacter"),isUndo:rn("undo"),isTab:rn("tab"),isSelectAll:rn("selectAll")};function Pn(e){e.preventDefault()}var Uq={beforeinput:function(e,t,r){var n=e,i=r.getConfig().readOnly;if(yf&&!i&&ho(r,n.target)){var o=r.selection,a=n.inputType,s=n.dataTransfer||n.data||void 0;if(a!=="insertCompositionText"&&a!=="deleteCompositionText"){if(n.preventDefault(),!a.startsWith("delete")||a.startsWith("deleteBy")){var l=Tr(n.getTargetRanges(),1)[0];if(l){var u=Ae.toSlateRange(r,l,{exactMatch:!1,suppressThrow:!1});o&&Je.equals(o,u)||Ve.select(r,u)}}if(o&&Je.isExpanded(o)&&a.startsWith("delete")){var c=a.endsWith("Backward")?"backward":"forward";de.deleteFragment(r,{direction:c})}else switch(a){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":de.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":de.deleteForward(r);break;case"deleteContentBackward":de.deleteBackward(r);break;case"deleteEntireSoftLine":de.deleteBackward(r,{unit:"line"}),de.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":de.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":de.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":de.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":de.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":de.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":de.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":de.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if(a==="insertFromPaste"&&!rw.get(r))break;s instanceof DataTransfer?r.insertData(s):typeof s=="string"&&de.insertText(r,s)}}}},blur:function(e,t,r){var n=e,i=t.isUpdatingSelection,o=t.latestElement;if(!r.getConfig().readOnly&&!i&&ho(r,n.target)){var a=Ae.findDocumentOrShadowRoot(r);if(o!==a.activeElement){var s=n.relatedTarget;if(!(s===Ae.toDOMNode(r,r)||Po(s)&&s.hasAttribute("data-slate-spacer"))){if(s!=null&&iu(s)&&Ae.hasDOMNode(r,s)){var l=Ae.toSlateNode(r,s);if(Ut.isElement(l)&&!r.isVoid(l))return}if(mf){var u=a.getSelection();u==null||u.removeAllRanges()}nu.delete(r)}}}},focus:function(e,t,r){var n=Ae.toDOMNode(r,r),i=Ae.findDocumentOrShadowRoot(r);t.latestElement=i.activeElement,vf&&e.target!==n?n.focus():nu.set(r,!0)},click:function(e,t,r){if(!r.getConfig().readOnly&&Yc(r,e.target)&&iu(e.target)){var n=Ae.toSlateNode(r,e.target),i=Ae.findPath(r,n);if(de.hasPath(r,i)&&St.get(r,i)===n){var o=de.start(r,i),a=de.end(r,i),s=de.void(r,{at:o}),l=de.void(r,{at:a});if(s&&l&&Ue.equals(s[1],l[1])){var u=de.range(r,o);Ve.select(r,u)}}}},compositionstart:function(e,t,r){if(ho(r,e.target)){var n=r.selection;if(n&&Je.isExpanded(n)&&(de.deleteFragment(r),Promise.resolve().then(function(){A3(t,r,!0)})),n&&Je.isCollapsed(n)){var i=Ae.toDOMRange(r,n).startContainer,o=i.textContent||"";$w.set(r,o),D3.set(r,i)}t.isComposing=!0,function(a,s){var l;s.getConfig().placeholder&&s.isEmpty()&&a.showPlaceholder&&((l=a.$placeholder)===null||l===void 0||l.hide(),a.showPlaceholder=!1)}(t,r)}},compositionend:function(e,t,r){var n=e;if(ho(r,n.target)){t.isComposing=!1;var i=r.selection;if(i!=null){(aw||vf)&&Ae.cleanExposedTexNodeInSelectionBlock(r);for(var o=Je.isBackward(i)?i.focus:i.anchor,a=Tr(de.node(r,[o.path[0]]),1)[0],s=0;s0&&de.insertText(r,u.slice(0,c)),t.changeViewState()):de.insertText(r,u)}else de.insertText(r,u);mf||setTimeout(function(){var h=r.selection;if(h!=null){var S=D3.get(r);S!=null&&Ae.toDOMRange(r,h).startContainer!==S&&(S.textContent=$w.get(r)||"")}})}}}},compositionupdate:function(e,t,r){ho(r,e.target)&&(t.isComposing=!0)},keydown:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&!t.isComposing&&ho(r,n.target)){if(function(a,s){var l=Im.get(a),u=l&&l.getMenus(),c=Mm.get(a),h=c&&c.getMenus(),S=lo(lo({},u),h);for(var y in S){var W=S[y],F=W.hotkey;if(F&&sX(F,s)&&!W.isDisabled(a)){var N=W.getValue(a);W.exec(a,N)}}}(r,n),ln.isTab(n))return Pn(n),void r.handleTab();if(ln.isRedo(n))return Pn(n),void(typeof r.redo=="function"&&r.redo());if(ln.isUndo(n))return Pn(n),void(typeof r.undo=="function"&&r.undo());if(ln.isMoveLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",reverse:!0});if(ln.isMoveLineForward(n))return Pn(n),void Ve.move(r,{unit:"line"});if(ln.isExtendLineBackward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus",reverse:!0});if(ln.isExtendLineForward(n))return Pn(n),void Ve.move(r,{unit:"line",edge:"focus"});if(ln.isMoveBackward(n))return Pn(n),void(i&&Je.isCollapsed(i)?Ve.move(r,{reverse:!0}):Ve.collapse(r,{edge:"start"}));if(ln.isMoveForward(n))return Pn(n),void(i&&Je.isCollapsed(i)?Ve.move(r):Ve.collapse(r,{edge:"end"}));if(ln.isMoveWordBackward(n))return Pn(n),i&&Je.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word",reverse:!0});if(ln.isMoveWordForward(n))return Pn(n),i&&Je.isExpanded(i)&&Ve.collapse(r,{edge:"focus"}),void Ve.move(r,{unit:"word"});if(ln.isSelectAll(n))return Pn(n),void r.selectAll();if(yf){if((aw||mf)&&i&&(ln.isDeleteBackward(n)||ln.isDeleteForward(n))&&Je.isCollapsed(i)){var o=St.parent(r,i.anchor.path);if(Ut.isElement(o)&&de.isVoid(r,o)&&de.isInline(r,o))return n.preventDefault(),void Ve.delete(r,{unit:"block"})}}else{if(ln.isBold(n)||ln.isItalic(n)||ln.isTransposeCharacter(n))return void Pn(n);if(ln.isSplitBlock(n))return Pn(n),void de.insertBreak(r);if(ln.isDeleteBackward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r));if(ln.isDeleteForward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r));if(ln.isDeleteLineBackward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"line"}));if(ln.isDeleteLineForward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"line"}));if(ln.isDeleteWordBackward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"backward"}):de.deleteBackward(r,{unit:"word"}));if(ln.isDeleteWordForward(n))return Pn(n),void(i&&Je.isExpanded(i)?de.deleteFragment(r,{direction:"forward"}):de.deleteForward(r,{unit:"word"}))}}},keypress:function(e,t,r){if(!yf&&!r.getConfig().readOnly&&ho(r,e.target)){e.preventDefault();var n=e.key;de.insertText(r,n)}},copy:function(e,t,r){var n=e;if(ho(r,n.target)){n.preventDefault();var i=n.clipboardData;i!=null&&r.setFragmentData(i)}},cut:function(e,t,r){var n=e,i=r.selection;if(!r.getConfig().readOnly&&ho(r,n.target)){n.preventDefault();var o=n.clipboardData;if(o!=null&&(r.setFragmentData(o),i))if(Je.isExpanded(i))de.deleteFragment(r);else{var a=St.parent(r,i.anchor.path);de.isVoid(r,a)&&Ve.delete(r)}}},paste:function(e,t,r){rw.set(r,!0);var n=e;if(!r.getConfig().readOnly&&ho(r,n.target)){var i=r.getConfig().customPaste;if(i&&i(r,n)===!1)return void rw.set(r,!1);if(!yf||function(a){return a.clipboardData&&a.clipboardData.getData("text/plain")!==""&&a.clipboardData.types.length===1}(n)){n.preventDefault();var o=n.clipboardData;o!=null&&r.insertData(o)}}},dragover:function(e,t,r){if(Yc(r,e.target)){var n=Ae.toSlateNode(r,e.target);de.isVoid(r,n)&&e.preventDefault()}},dragstart:function(e,t,r){var n=e;if(Yc(r,n.target)&&!r.getConfig().readOnly){var i=Ae.toSlateNode(r,n.target),o=Ae.findPath(r,i);if(de.isVoid(r,i)||de.void(r,{at:o,voids:!0})){var a=de.range(r,o);Ve.select(r,a)}var s=n.dataTransfer;s!=null&&(t.isDraggingInternally=!0,r.setFragmentData(s))}},dragend:function(e,t,r){var n=e;r.getConfig().readOnly||t.isDraggingInternally&&Yc(r,n.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,r){var n=e,i=n.dataTransfer;if(!r.getConfig().readOnly&&Yc(r,n.target)&&i!=null&&!(yf&&mf&&i.files.length>0)){n.preventDefault();var o=r.selection,a=Ae.findEventRange(r,n);Ve.select(r,a),t.isDraggingInternally&&(o&&Ve.delete(r,{at:o}),t.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Hq=1,zq=function(){function e(t){var r=this;this.id=Hq++,this.$textArea=null,this.$progressBar=_e('
    '),this.$maxLengthInfo=_e('
    '),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Hl(function(){var a=r.editorInstance;!function(s,l){var u=s.isComposing,c=s.isUpdatingSelection,h=s.isDraggingInternally;if(!(l.getConfig().readOnly||u||c||h)){var S=Ae.findDocumentOrShadowRoot(l),y=S.activeElement,W=Ae.toDOMNode(l,l),F=S.getSelection();if(y===W?(s.latestElement=y,nu.set(l,!0)):nu.delete(l),!F)return Ve.deselect(l);var N=F.anchorNode,j=F.focusNode,D=ho(l,N)||T3(l,N),Q=ho(l,j)||T3(l,j);if(D&&Q){var te=Ae.toSlateRange(l,F,{exactMatch:!1,suppressThrow:!1});Ve.select(l,te)}else Ve.deselect(l)}}(r,a)},100);var n=_e(t);if(n.length===0)throw new Error("Cannot find textarea DOM by selector '"+t+"'");this.$box=n;var i=_e('
    ');i.append(this.$progressBar),i.append(this.$maxLengthInfo),n.append(i);var o=_e('
    ');i.append(o),this.$scroll=o,this.$textAreaContainer=i,co(function(){var a=r.editorInstance,s=Ae.getWindow(a);s.document.addEventListener("selectionchange",r.onDOMSelectionChange),a.on("destroyed",function(){s.document.removeEventListener("selectionchange",r.onDOMSelectionChange)}),i.on("click",function(){return a.hidePanelOrModal()}),a.on("change",r.changeViewState.bind(r));var l=a.getConfig().onChange;l&&a.on("change",function(){return l(a)}),r.onFocusAndOnBlur(),a.on("change",r.changeMaxLengthInfo.bind(r)),r.bindEvent()})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var t=XS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},enumerable:!1,configurable:!0}),e.prototype.bindEvent=function(){var t=this,r=this.$textArea,n=this.$scroll,i=this.editorInstance;r!=null&&(sx(Uq,function(o,a){r.on(a,function(s){o(s,t,i)})}),i.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",Hl(function(){i.emit("scroll")},100))))},e.prototype.onFocusAndOnBlur=function(){var t=this,r=this.editorInstance,n=r.getConfig(),i=n.onBlur,o=n.onFocus;this.latestEditorSelection=r.selection,r.on("change",function(){t.latestEditorSelection==null&&r.selection!=null?setTimeout(function(){return o&&o(r)}):t.latestEditorSelection!=null&&r.selection==null&&setTimeout(function(){return i&&i(r)}),t.latestEditorSelection=r.selection})},e.prototype.changeMaxLengthInfo=function(){var t=this.editorInstance,r=t.getConfig().maxLength;if(r){var n=r-Ae.getLeftLengthOfMaxLength(t);this.$maxLengthInfo[0].innerHTML=n+"/"+r}},e.prototype.changeProgress=function(t){var r=this.$progressBar;r.css("width",t+"%"),t>=100&&setTimeout(function(){r.hide(),r.css("width","0"),r.show()},1e3)},e.prototype.changeViewState=function(){var t=this,r=this.editorInstance;Bq(this,r),function(n,i){var o,a=i.getConfig().placeholder;if(a){var s=i.isEmpty();if(s&&!n.showPlaceholder&&!n.isComposing){if(n.$placeholder==null){var l=_e('
    '+a+"
    ");n.$textAreaContainer.append(l),n.$placeholder=l}return n.$placeholder.show(),void(n.showPlaceholder=!0)}!s&&n.showPlaceholder&&((o=n.$placeholder)===null||o===void 0||o.hide(),n.showPlaceholder=!1)}}(this,r),co(function(){A3(t,r)})},e.prototype.destroy=function(){this.$textAreaContainer.remove()},e}();function Xw(e){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Xw(t)}function Yw(){return _e('')}function O3(){return _e('
    ')}function _3(e,t,r,n,i){if(i===void 0&&(i=!1),t){if(n){var o=ow?"cmd":"ctrl";n=n.replace("mod",o)}if(i)n&&(e.attr("data-tooltip",n),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=n?r+` +`+n:r;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}IS("match",function(e,t,r){return[function(n){var i=so(this),o=n==null?void 0:Jl(n,e);return o?Cr(o,n,i):new RegExp(n)[e]($r(i))},function(n){var i=Sn(this),o=$r(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return cf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=cf(i,o))!==null;){var h=$r(l[0]);u[c]=h,h===""&&(i.lastIndex=MS(o,Rc(i.lastIndex),s)),c++}return c===0?null:u}]});var Zw=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('
    '),this.$button=_e(''),this.disabled=!1,this.menu=r;var o=r.tag,a=r.width;if(o!=="button")throw new Error("Invalid tag '"+o+"', expected 'button'");var s=r.title,l=r.hotkey,u=l===void 0?"":l,c=r.iconSvg,h=c===void 0?"":c,S=this.$button;if(h){var y=_e(h);Xw(y),S.append(y)}else S.text(s);_3(S,h,s,u,n),n&&h&&S.append(_e(''+s+"")),a&&S.css("width",a+"px"),S.attr("data-menu-key",t),this.$elem.append(S),co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.disabled||(t.exec(),t.onButtonClick())})},e.prototype.exec=function(){var t=Gi(this),r=this.menu,n=r.getValue(t);r.exec(t,n)},e.prototype.setActive=function(){var t=Gi(this),r=this.$button,n="active";this.menu.isActive(t)?r.addClass(n):r.removeClass(n)},e.prototype.setDisabled=function(){var t=Gi(this),r=this.$button,n=this.menu.isDisabled(t);(t.selection==null||t.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var i="disabled";n?r.addClass(i):r.removeClass(i),this.disabled=n},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},e}(),Wq=function(e){function t(r,n,i){return i===void 0&&(i=!1),e.call(this,r,n,i)||this}return Fc(t,e),t.prototype.onButtonClick=function(){},t}(Zw),Jw=function(){function e(t){this.isShow=!1,this.showTime=0,this.record(t)}return e.prototype.record=function(t){var r=QS.get(t);r==null&&(r=new Set,QS.set(t,r)),r.add(this),Bm.set(this,t)},e.prototype.renderContent=function(t){var r=this.$elem;r.empty(),r.append(t);var n=this.genSelfElem();n&&r.append(n)},e.prototype.appendTo=function(t){var r=this.$elem;t.append(r)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var t=Bm.get(this);t&&t.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var t=Bm.get(this);t&&t.emit("modalOrPanelHide")}},e}(),Gq=function(e){function t(r){var n=e.call(this,r)||this;return n.type="dropPanel",n.$elem=_e('
    '),n}return Fc(t,e),t.prototype.genSelfElem=function(){return null},t}(Jw),Vq=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var a=Yw();o.$button.append(a)}return o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var r=this.menu;if(r.getPanelContentElem!=null){var n=Gi(this);if(this.dropPanel==null){var i=new Gq(n),o=r.getPanelContentElem(n);i.renderContent(o),i.appendTo(this.$elem),i.show(),this.dropPanel=i}else{var a=this.dropPanel;a.isShow?a.hide():(o=r.getPanelContentElem(n),a.renderContent(o),a.show())}var s=this.dropPanel;if(s.isShow){var l=this.$elem,u=l.offset().left,c=l.parents(".w-e-bar");u-c.offset().left>=c.width()/2?s.$elem.css({left:"none",right:"0"}):s.$elem.css({left:"0",right:"none"})}}},t}(Zw),Kq=function(e){function t(r,n){n===void 0&&(n=0);var i=e.call(this,r)||this;i.type="modal",i.$elem=_e('
    '),i.width=0,n&&(i.width=n);var o=i.$elem;return o.on("click",function(a){return a.stopPropagation()}),o.on("keyup",function(a){a.code==="Escape"&&(i.hide(),r.restoreSelection())}),i}return Fc(t,e),t.prototype.genSelfElem=function(){var r=this,n=_e(''),i=Bm.get(this);return n.on("click",function(){r.hide(),i==null||i.restoreSelection()}),n},t.prototype.setStyle=function(r){var n=this.width,i=this.$elem;i.attr("style",""),n&&i.css("width",n+"px"),i.css(r)},t}(Jw);function Wi(e,t,r){var n=_e('');n.append(""+e+"");var i=_e('');return n.append(i),[n[0],i[0]]}function Hye(e,t,r){var n=_e('');n.append(""+e+"");var i=_e('');return n.append(i),[n[0],i[0]]}function Zc(e,t){var r=_e('
    '),n=_e('");return r.append(n),[r[0],n[0]]}var $q=function(e){function t(r,n,i){i===void 0&&(i=!1);var o=e.call(this,r,n,i)||this;return o.$body=_e("body"),o.modal=null,o.menu=n,o}return Fc(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var r=Gi(this),n=this.menu.getModalPositionNode(r);return Ut.isElement(n)?Uw(r,n,"modal"):jw(r)},t.prototype.handleModal=function(){var r=Gi(this),n=this.menu;if(this.modal==null){var i=new Kq(r,n.modalWidth);this.renderAndShowModal(i,!0),this.modal=i}else(i=this.modal).isShow?i.hide():this.renderAndShowModal(i,!1)},t.prototype.renderAndShowModal=function(r,n){n===void 0&&(n=!1);var i=Gi(this),o=this.menu;if(o.getModalContentElem!=null){var a=Ae.getTextarea(i),s=Ae.getToolbar(i),l=((s==null?void 0:s.getConfig())||{}).modalAppendToBody,u=o.getModalContentElem(i);if(r.renderContent(u),l)r.setStyle({left:"0",right:"0"});else{var c=this.getPosition();r.setStyle(c)}n&&(l?r.appendTo(this.$body):r.appendTo(a.$textAreaContainer)),r.show(),l||Hw(i,r.$elem),setTimeout(function(){i.blur()})}},t}(Zw),Xq=function(e){function t(r,n){var i=e.call(this,r)||this;return i.type="selectList",i.$elem=_e('
    '),n&&i.$elem.css("width",n+"px"),i.$elem.on("click",function(o){o.stopPropagation()}),i}return Fc(t,e),t.prototype.renderList=function(r){var n=this.$elem;n.empty();var i=_e("
      ");r.forEach(function(o){var a=o.value,s=o.text,l=o.selected,u=o.styleForRenderMenuList,c=_e('
    • ');if(u&&c.css(u),l){var h=_e('');c.append(h),c.addClass("selected")}c.append(_e(''+s+"")),c.attr("title",s),i.append(c)}),n.append(i)},t.prototype.genSelfElem=function(){return null},t}(Jw),Yq=function(){function e(t,r,n){var i=this;n===void 0&&(n=!1),this.$elem=_e('
      '),this.$button=_e(''),this.disabled=!1,this.selectList=null;var o=r.tag,a=r.title,s=r.width,l=r.iconSvg,u=l===void 0?"":l,c=r.hotkey,h=c===void 0?"":c;if(o!=="select")throw new Error("Invalid tag '"+o+"', expected 'select'");var S=this.$button;s&&S.css("width",s+"px"),S.attr("data-menu-key",t),_3(S,u,a,h,n),this.$elem.append(S),this.menu=r,co(function(){return i.init()})}return e.prototype.init=function(){var t=this;this.setSelectedValue(),this.$button.on("click",function(r){r.preventDefault(),Gi(t).hidePanelOrModal(),t.trigger()})},e.prototype.trigger=function(){var t=this,r=Gi(this);if(!r.isDisabled()&&!this.disabled){var n=this.menu;if(this.selectList==null){this.selectList=new Xq(r,n.selectPanelWidth);var i=this.selectList,o=n.getOptions(r);i.renderList(o),i.appendTo(this.$elem),i.show(),i.$elem.on("click","li",function(a){var s=a.target;if(s!=null){a.preventDefault();var l=_e(s).attr("data-value");t.onChange(l)}})}else(i=this.selectList).isShow?i.hide():(o=n.getOptions(r),i.renderList(o),i.show())}},e.prototype.onChange=function(t){var r=Gi(this),n=this.menu;n.exec&&n.exec(r,t)},e.prototype.setSelectedValue=function(){var t=Gi(this),r=this.menu,n=r.getValue(t),i=function(s,l){for(var u=s.length,c="",h=0;h'),this.$container=_e('
      '),this.$button=_e('');var r=t.key,n=t.iconSvg,i=t.title,o=this.$elem,a=this.$button;if(n){var s=_e(n);Xw(s),a.append(s)}else a.text(i);a.attr("data-menu-key",r);var l=Yw();a.append(l),o.append(a);var u=this.$container;o.append(u);var c=this.createObserver();this.observe(c)}return e.prototype.appendBarItem=function(t){var r=t.$elem;this.$container.append(r)},e.prototype.observe=function(t){var r=this.$container;t.observe(r[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var t=this,r=this.$container,n=this.$button,i=new MutationObserver(function(){var o=r.find("button"),a=o.length;if(a!==0){var s=0;o.each(function(l){_e(l).hasClass("disabled")&&s++}),i.disconnect(),s===a?n.addClass("disabled"):n.removeClass("disabled"),t.observe(i)}});return i},e}(),k3=new WeakMap;function Gi(e){var t=JS.get(e);if(t==null)throw new Error("Can not get editor instance");return t}function L3(e,t,r){r===void 0&&(r=!1);var n=k3.get(t);if(n)return n;var i=t.tag;if(i==="button"){var o=t.showDropPanel,a=t.showModal;n=o?new Vq(e,t,r):a?new $q(e,t,r):new Wq(e,t,r)}if(i==="select"&&(n=new Yq(e,t,r)),n==null)throw new Error("Invalid tag in menu "+JSON.stringify(t));return k3.set(t,n),n}function Zq(e,t){var r=e.selection;return r!=null&&!Je.isCollapsed(r)&&!Ae.getSelectedElems(e).some(function(n){if(e.isVoid(n))return!0;var i=n.type;return!!["pre","code","table"].includes(i)||void 0})&&!!Rt.isText(t)}var Jq=function(){function e(){var t=this;this.$elem=_e('
      '),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.changeHoverbarState=eI(function(){var r=t.isShow,n=t.getSelectedNodeAndMenuKeys()||{},i=n.node,o=i===void 0?null:i,a=n.menuKeys,s=a===void 0?[]:a;o!=null&&t.changeItemsState(),o&&Ut.isElement(o)&&r&&t.isSamePath(o,t.prevSelectedNode)||(t.hideAndClean(),o!=null&&(t.registerItems(s),t.setPosition(o),t.show()),t.prevSelectedNode=o)},200),co(function(){var r=t.getEditorInstance(),n=t.$elem;n.on("mousedown",function(o){return o.preventDefault()},{passive:!1}),Ae.getTextarea(r).$textAreaContainer.append(n),r.on("change",t.changeHoverbarState);var i=t.hideAndClean.bind(t);r.on("scroll",i),r.on("fullScreen",i),r.on("unFullScreen",i)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var t=this.$elem;t.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],t.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var t=this.$elem,r=!1,n=window.innerHeight;n&&n>=360&&n-t[0].getBoundingClientRect().bottom<360&&(r=!0),r?t.addClass("w-e-bar-bottom"):t.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var t=this;co(function(){t.hoverbarItems.forEach(function(r){r.changeMenuState()})})},e.prototype.registerItems=function(t){var r=this,n=this.$elem;t.forEach(function(i){if(i!=="|")r.registerSingleItem(i);else{var o=O3();n.append(o)}})},e.prototype.registerSingleItem=function(t){var r=this.getEditorInstance(),n=this.menus,i=n[t];if(i==null){var o=bf[t];if(o==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof o!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");i=o(),n[t]=i}var a=L3(t,i);this.hoverbarItems.push(a),JS.set(a,r),this.$elem.append(a.$elem)},e.prototype.setPosition=function(t){var r=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Ut.isElement(t)){var i=Uw(r,t,"bar");return n.css(i),void Hw(r,n)}if(Rt.isText(t))return i=jw(r),n.css(i),void Hw(r,n);throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(t.selection==null)return null;var r=this.getHoverbarKeysConf(),n=null,i=[],o=function(s){var l=r[s],u=l.match,c=l.menuKeys,h=c===void 0?[]:c,S=u||function(F,N){return Ae.checkNodeType(N,s)},y=Tr(de.nodes(t,{match:function(F){return S(t,F)},universal:!0}),1),W=y[0];if(W!=null)return n=W[0],i=h,"break"};for(var a in r)if(o(a)==="break")break;return n==null||i.length===0?null:{node:n,menuKeys:i}},e.prototype.getEditorInstance=function(){var t=ZS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.getHoverbarKeysConf=function(){var t=this.getEditorInstance().getConfig().hoverbarKeys,r=t===void 0?{}:t,n=r.text;return n&&n.match==null&&(n.match=Zq),r},e.prototype.isSamePath=function(t,r){if(t==null||r==null)return!1;var n=Ae.findPath(null,t),i=Ae.findPath(null,r);return Ue.equals(n,i)},e.prototype.destroy=function(){this.changeHoverbarState.cancel(),this.$elem.remove(),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}();function P3(e,t,r,n){if(gf.set(e,t),jc.set(e,r),Ut.isElement(e)){var i=e.children;if((i===void 0?[]:i).forEach(function(s,l){return P3(s,l,e,n)}),de.isVoid(n,e)){var o=Tr(St.texts(e),1),a=Tr(o[0],1)[0];gf.set(a,0),jc.set(a,e)}}}function Qq(e){var t=e.selector,r=t===void 0?"":t,n=e.config,i=n===void 0?{}:n,o=e.content,a=e.html,s=e.plugins,l=s===void 0?[]:s,u=(j=>{var D=j,{apply:Q}=D;return D.history={undos:[],redos:[]},D.redo=()=>{var{history:te}=D,{redos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{for(var ve of Ee)D.apply(ve)})}),te.redos.pop(),te.undos.push(Ee)}},D.undo=()=>{var{history:te}=D,{undos:he}=te;if(he.length>0){var Ee=he[he.length-1];Ic.withoutSaving(D,()=>{de.withoutNormalizing(D,()=>{var ve=Ee.map(ss.inverse).reverse();for(var De of ve)D.apply(De)})}),te.redos.push(Ee),te.undos.pop()}},D.apply=te=>{var{operations:he,history:Ee}=D,{undos:ve}=Ee,De=ve[ve.length-1],Pe=De&&De[De.length-1],qe=((dt,ht)=>!(!ht||dt.type!=="set_selection"||ht.type!=="set_selection"))(te,Pe),ot=Ic.isSaving(D),et=Ic.isMerging(D);if(ot==null&&(ot=((dt,ht)=>dt.type!=="set_selection"||dt.properties!=null&&dt.newProperties!=null)(te)),ot){if(et==null&&(et=De!=null&&(he.length!==0||((dt,ht)=>dt.type==="set_selection"||!(!ht||dt.type!=="insert_text"||ht.type!=="insert_text"||dt.offset!==ht.offset+ht.text.length||!Ue.equals(dt.path,ht.path))||!(!ht||dt.type!=="remove_text"||ht.type!=="remove_text"||dt.offset+dt.text.length!==ht.offset||!Ue.equals(dt.path,ht.path)))(te,Pe)||qe)),De&&et)qe&&De.pop(),De.push(te);else{var gt=[te];ve.push(gt)}for(;ve.length>100;)ve.shift();(dt=>dt.type!=="set_selection")(te)&&(Ee.redos=[])}Q(te)},D})(function(j){var D=j,Q=D.insertText,te=D.insertNode,he=D.insertFragment,Ee=D.dangerouslyInsertHtml;return D.insertText=function(ve){if(D.getConfig().maxLength){var De=Ae.getLeftLengthOfMaxLength(D);De<=0||(De0&&te.removeAllRanges(),Q&&Ve.deselect(j)},D.move=function(Q,te){te===void 0&&(te=!1),Q&&(Q<0||Ve.move(j,{distance:Q,unit:"character",reverse:te}))},D.moveReverse=function(Q){D.move(Q,!0)},D.restoreSelection=function(){var Q=tw.get(D);Q!=null&&(D.focus(),Ve.select(D,Q))},D.getSelectionPosition=function(){return jw(D)},D.getNodePosition=function(Q){return Uw(D,Q)},D.isSelectedAll=function(){var Q=D.selection;if(Q==null)return!1;var te=Tr(Je.edges(Q),2),he=te[0],Ee=te[1],ve=Tr(de.edges(D,[]),2),De=ve[0],Pe=ve[1];return!(!cr.equals(he,De)||!cr.equals(Ee,Pe))},D.selectAll=function(){var Q=de.start(D,[]),te=de.end(D,[]);Ve.select(D,{anchor:Q,focus:te})},D}(function(j){var D=j,Q=D.onChange,te=D.insertText,he=D.apply,Ee=D.deleteBackward;return D.insertText=function(ve){D.getConfig().readOnly||te(ve)},D.apply=function(ve){var De,Pe,qe,ot,et,gt,dt,ht,pt=[];switch(ve.type){case"insert_text":case"remove_text":case"set_node":try{for(var Dt=uo(de.levels(D,{at:ve.path})),Ft=Dt.next();!Ft.done;Ft=Dt.next()){var Bt=Tr(Ft.value,2),It=Bt[0],Re=Bt[1],Te=Ae.findKey(D,It);pt.push([Re,Te])}}catch(br){De={error:br}}finally{try{Ft&&!Ft.done&&(Pe=Dt.return)&&Pe.call(Dt)}finally{if(De)throw De.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var Be=uo(de.levels(D,{at:Ue.parent(ve.path)})),it=Be.next();!it.done;it=Be.next()){var vt=Tr(it.value,2);It=vt[0],Re=vt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){qe={error:br}}finally{try{it&&!it.done&&(ot=Be.return)&&ot.call(Be)}finally{if(qe)throw qe.error}}break;case"move_node":try{for(var ut=uo(de.levels(D,{at:Ue.common(Ue.parent(ve.path),Ue.parent(ve.newPath))})),kt=ut.next();!kt.done;kt=ut.next()){var Xt=Tr(kt.value,2);It=Xt[0],Re=Xt[1],Te=Ae.findKey(D,It),pt.push([Re,Te])}}catch(br){et={error:br}}finally{try{kt&&!kt.done&&(gt=ut.return)&>.call(ut)}finally{if(et)throw et.error}}}he(ve);try{for(var qt=uo(pt),or=qt.next();!or.done;or=qt.next()){var ft=Tr(or.value,2);Re=ft[0],Te=ft[1],It=Tr(de.node(D,Re),1)[0],jm.set(It,Te)}}catch(br){dt={error:br}}finally{try{or&&!or.done&&(ht=qt.return)&&ht.call(qt)}finally{if(dt)throw dt.error}}},D.deleteBackward=function(ve){if(ve!=="line")return Ee(ve);if(j.selection&&Je.isCollapsed(j.selection)){var De=de.above(j,{match:function(et){return de.isBlock(j,et)},at:j.selection});if(De){var Pe=Tr(De,2)[1],qe=de.range(j,Pe,j.selection.anchor),ot=function(et,gt){var dt=de.range(et,Je.end(gt)),ht=Array.from(de.positions(et,{at:gt})),pt=0,Dt=ht.length,Ft=Math.floor(Dt/2);if(X4(et,de.range(et,ht[pt]),dt))return de.range(et,ht[pt],dt);if(ht.length<2)return de.range(et,ht[ht.length-1],dt);for(;Ft!==ht.length&&Ft!==pt;)X4(et,de.range(et,ht[Ft]),dt)?Dt=Ft:pt=Ft,Ft=Math.floor((pt+Dt)/2);return de.range(et,ht[Dt],dt)}(D,qe);Je.isCollapsed(ot)||Ve.delete(j,{at:ot})}}},D.onChange=function(){var ve=D.selection;ve!=null&&tw.set(D,ve),D.emit("change"),Q()},D.handleTab=function(){D.insertText(" ")},D.getHtml=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return V4(De,D)}).join("")},D.getText=function(){var ve=D.children;return(ve===void 0?[]:ve).map(function(De){return St.string(De)}).join(` `)},D.getSelectionText=function(){var ve=D.selection;return ve==null?"":de.string(j,ve)},D.getElemsByType=function(ve,De){var Pe,qe;De===void 0&&(De=!1);var ot=[],et=de.nodes(D,{at:[],universal:!0});try{for(var gt=uo(et),dt=gt.next();!dt.done;dt=gt.next()){var ht=Tr(dt.value,1)[0];if(Ut.isElement(ht)&&(De?ht.type.indexOf(ve)>=0:ht.type===ve)){var pt=K4(Ae.findKey(D,ht).id);ot.push(lo(lo({},ht),{id:pt}))}}}catch(Dt){Pe={error:Dt}}finally{try{dt&&!dt.done&&(qe=gt.return)&&qe.call(gt)}finally{if(Pe)throw Pe.error}}return ot},D.getElemsByTypePrefix=function(ve){return D.getElemsByType(ve,!0)},D.isEmpty=function(){var ve=D.children,De=ve===void 0?[]:ve;if(De.length>1)return!1;var Pe=De[0];if(Pe==null)return!0;if(Ut.isElement(Pe)&&Pe.type==="paragraph"){var qe=Pe.children,ot=qe===void 0?[]:qe;if(ot.length>1)return!1;var et=ot[0];if(et==null)return!0;if(Rt.isText(et)&&et.text==="")return!0}return!1},D.clear=function(){Ve.delete(D,{at:{anchor:de.start(D,[]),focus:de.end(D,[])}}),D.children.length===0&&Ve.insertNodes(D,[{type:"paragraph",children:[{text:""}]}])},D.getParentNode=function(ve){return Ae.getParentNode(D,ve)},D.dangerouslyInsertHtml=function(ve,De){if(ve===void 0&&(ve=""),De===void 0&&(De=!1),ve){var Pe=document.createElement("div");Pe.innerHTML=ve;var qe=Array.from(Pe.childNodes);if(qe=qe.filter(function(dt){var ht=dt.nodeType,pt=dt.nodeName;return ht===ta.TEXT_NODE||ht===ta.ELEMENT_NODE&&!l3.has(pt.toLowerCase())}),qe.length!==0){var ot=D.selection;if(ot!=null){var et=null;Ae.isSelectedEmptyParagraph(D)&&!De&&(et=[ot.focus.path[0]]),Pe.setAttribute("hidden","true"),document.body.appendChild(Pe);var gt=0;qe.forEach(function(dt){var ht=dt.nodeType,pt=dt.nodeName,Dt=dt.textContent,Ft=Dt===void 0?"":Dt;if(ht!==ta.TEXT_NODE)if(pt!=="BR"){var Bt=dt,It=!1;if(Y4.includes(pt.toLowerCase()))It=!0;else for(var Re in Wm)if(Bt.matches(Re)){It=!0;break}if(It){var Te=Pw(_e(Bt),D);return Array.isArray(Te)?(Te.forEach(function(it){return u3(D,it)}),gt++):(u3(D,Te),gt++),void(Ae.isSelectedVoidNode(D)&&D.move(1))}var Be=window.getComputedStyle(Bt).display;Ae.isSelectedEmptyParagraph(D)||Be.indexOf("inline")<0&&D.insertBreak(),D.dangerouslyInsertHtml(Bt.innerHTML,!0)}else D.insertText(` `);else{if(!Ft||!Ft.trim())return;D.insertNode({text:Ft})}}),gt&&et&&Ae.isEmptyPath(D,et)&&Ve.removeNodes(D,{at:et}),Pe.remove()}}}},D.setHtml=function(ve){ve===void 0&&(ve="");var De=D.isDisabled(),Pe=D.isFocused(),qe=JSON.stringify(D.selection);D.enable(),D.focus(),D.clear();var ot=o3(D,ve);if(Ve.insertFragment(D,ot),Pe||(D.deselect(),D.blur()),De&&(D.deselect(),D.disable()),D.isFocused())try{D.select(JSON.parse(qe))}catch(et){D.select(de.start(D,[]))}},D}(function(j){var D=j;return D.getAllMenuKeys=function(){var Q=[];for(var te in bf)Q.push(te);return Q},D.getConfig=function(){var Q=r4.get(D);if(Q==null)throw new Error("Can not get editor config");return Q},D.getMenuConfig=function(Q){var te=D.getConfig().MENU_CONF;return(te===void 0?{}:te)[Q]||{}},D.alert=function(Q,te){te===void 0&&(te="info");var he=D.getConfig().customAlert;he&&he(Q,te)},D}(function(j){var D=dq(IV());return D.id="wangEditor-"+bQ++,D.isDestroyed=!1,D.isFullScreen=!1,D.focus=function(Q){if(Ae.toDOMNode(D,D).focus({preventScroll:!0}),nu.set(D,!0),Q){var te=de.end(D,[]);Ve.select(D,te)}else{var he=tw.get(D);he?Ve.select(D,he):Ve.select(D,de.start(D,[]))}},D.isFocused=function(){return!!nu.get(D)},D.blur=function(){Ae.toDOMNode(D,D).blur(),Ve.deselect(D),nu.set(D,!1)},D.updateView=function(){Ae.getTextarea(D).changeViewState();var Q=Ae.getToolbar(D);Q&&Q.changeToolbarState();var te=Ae.getHoverbar(D);te&&te.changeHoverbarState()},D.destroy=function(){if(!D.isDestroyed){var Q=Ae.getTextarea(D);Q.destroy(),$S.delete(D),XS.delete(Q);var te=Ae.getToolbar(D);te&&(te.destroy(),Im.delete(D),YS.delete(te));var he=Ae.getHoverbar(D);he&&(he.destroy(),Mm.delete(D),ZS.delete(he)),D.isDestroyed=!0,D.emit("destroyed")}},D.scrollToElem=function(Q){if(!D.getConfig().scroll){var te="\u7F16\u8F91\u5668\u7981\u7528\u4E86 scroll \uFF0C\u7F16\u8F91\u5668\u5185\u5BB9\u65E0\u6CD5\u6EDA\u52A8\uFF0C\u8BF7\u81EA\u884C\u5B9E\u73B0\u8BE5\u529F\u80FD";return te+=` You has disabled editor scroll, please do this yourself`,void console.warn(te)}var he=_e("#"+Q);if(he.length!==0){var Ee=he[0];if(!Ae.hasDOMNode(D,Ee))return te="Element (found by id is '"+Q+"') is not in editor DOM",te+=` \u901A\u8FC7 id '`+Q+"' \u627E\u5230\u7684 element \u4E0D\u5728 editor DOM \u4E4B\u5185",void console.error(te,Ee);var ve=Ae.getTextarea(D),De=ve.$textAreaContainer,Pe=ve.$scroll,qe=he.offset().top,ot=De.offset().top;Pe[0].scrollBy({top:qe-ot,behavior:"smooth"})}},D.showProgressBar=function(Q){Q<1||Ae.getTextarea(D).changeProgress(Q)},D.hidePanelOrModal=function(){var Q=QS.get(D);Q!=null&&Q.forEach(function(te){return te.hide()})},D.enable=function(){D.getConfig().readOnly=!1,D.updateView()},D.disable=function(){D.getConfig().readOnly=!0,D.updateView()},D.isDisabled=function(){return D.getConfig().readOnly},D.toDOMNode=function(Q){return Ae.toDOMNode(D,Q)},D.fullScreen=function(){if(!D.isFullScreen){var Q=null,te=Ae.getToolbar(D);te&&(Q=te.$box);var he=Ae.getTextarea(D).$box.parent();if(Q&&Q.parent()[0]!==he[0])throw new Error(`Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent \u4E0D\u80FD\u8BBE\u7F6E\u5168\u5C4F\uFF0C\u56E0\u4E3A toolbar DOM \u7236\u8282\u70B9\u548C textarea DOM \u7236\u8282\u70B9\u4E0D\u4E00\u81F4`);he.addClass("w-e-full-screen-container");var Ee=he.css("z-index");he.attr("data-z-index",Ee.toString()),D.isFullScreen=!0,D.emit("fullScreen")}},D.unFullScreen=function(){if(D.isFullScreen){var Q=Ae.getTextarea(D).$box.parent();setTimeout(function(){Q.removeClass("w-e-full-screen-container"),D.isFullScreen=!1,D.emit("unFullScreen")},200)}},D.getEditableContainer=function(){return Ae.getTextarea(D).$textAreaContainer[0]},D}()))))));if(r&&function(j,D){return i3(j,"data-w-e-textarea",D)}(u,r))throw new Error("Repeated create editor by selector '"+r+"'");var c=function(j){j===void 0&&(j={});var D=tI(p4),Q={},te=j.MENU_CONF,he=te===void 0?{}:te;return sx(D,function(Ee,ve){Q[ve]=lo(lo({},Ee),he[ve]||{})}),delete j.MENU_CONF,lo({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:Q,hoverbarKeys:{},customAlert:function(Ee,ve){window.alert(ve+`: `+Ee)}},j)}(i);r4.set(u,c);var h=c.hoverbarKeys,S=h===void 0?{}:h;if(l.forEach(function(j){u=j(u)}),a!=null&&(u.children=o3(u,a)),o&&o.length&&(u.children=o),u.children.length===0&&(u.children=[{type:"paragraph",children:[{text:""}]}]),Ae.normalizeContent(u),r){var y=new zq(r);$S.set(u,y),XS.set(y,u),y.changeViewState(),co(function(){var j=y.$scroll;j!=null&&j.height()<300&&console.warn(`\u7F16\u8F91\u533A\u57DF\u9AD8\u5EA6 < 300px \u8FD9\u53EF\u80FD\u4F1A\u5BFC\u81F4 modal hoverbar \u5B9A\u4F4D\u5F02\u5E38 -Textarea height < 300px . This may be cause modal and hoverbar position error`,j)});var z=void 0;Object.keys(S).length>0&&(z=new Jq,ZS.set(z,u),Mm.set(u,z)),u.on("change",function(){u.hidePanelOrModal()}),u.on("scroll",function(){u.hidePanelOrModal()})}else u.children.forEach(function(j,D){return P3(j,D,u,u)});var F=c.onCreated,N=c.onDestroyed;return F&&u.on("created",function(){return F(u)}),N&&u.on("destroyed",function(){return N(u)}),co(function(){return u.emit("created")}),u}var qq=wm("splice"),eee=yt.TypeError,tee=Math.max,ree=Math.min;sn({target:"Array",proto:!0,forced:!qq},{splice:function(e,t){var r,n,i,o,a,s,l=ms(this),u=eu(l),c=Lc(e,u),h=arguments.length;if(h===0?r=n=0:h===1?(r=0,n=u-c):(r=h-2,n=ree(tee(qh(t),0),u-c)),u+r-n>9007199254740991)throw eee("Maximum allowed length exceeded");for(i=eM(l,n),o=0;ou-n+r;o--)delete l[o-1]}else if(r>n)for(o=u-n;o>c;o--)s=o+r-1,(a=o+n-1)in l?l[s]=l[a]:delete l[s];for(o=0;o'),this.menus={},this.toolbarItems=[],this.config={},this.changeToolbarState=eI(function(){n.toolbarItems.forEach(function(a){a.changeMenuState()})},200),this.config=r;var i=_e(t);if(i.length===0)throw new Error("Cannot find toolbar DOM by selector '"+t+"'");this.$box=i;var o=this.$toolbar;o.on("mousedown",function(a){return a.preventDefault()},{passive:!1}),i.append(o),co(function(){n.registerItems(),n.changeToolbarState(),n.getEditorInstance().on("change",n.changeToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.registerItems=function(){var t=this,r="",n=this.$toolbar,i=this.config,o=i.toolbarKeys,a=o===void 0?[]:o,s=i.insertKeys,l=s===void 0?{index:0,keys:[]}:s,u=i.excludeKeys,c=u===void 0?[]:u,h=tI(a);l.keys.length>0&&(typeof l.keys=="string"&&(l.keys=[l.keys]),l.keys.forEach(function(z,F){h.splice(l.index+F,0,z)}));var S=h.filter(function(z){if(typeof z=="string"){if(c.includes(z))return!1}else if(c.includes(z.key))return!1;return!0}),y=S.length;S.forEach(function(z,F){if(z==="|"){if(F===0)return;if(F+1===y)return;if(r==="|")return;var N=O3();return n.append(N),void(r=z)}if(typeof z=="string")return t.registerSingleItem(z,t),void(r=z);t.registerGroup(z),r="group"})},e.prototype.registerGroup=function(t){var r=this,n=this.$toolbar,i=function(u){return new R3(u)}(t),o=t.menuKeys,a=o===void 0?[]:o,s=this.config.excludeKeys,l=s===void 0?[]:s;a.forEach(function(u){l.includes(u)||r.registerSingleItem(u,i)}),n.append(i.$elem)},e.prototype.registerSingleItem=function(t,r){var n=this.getEditorInstance(),i=r instanceof R3,o=this.menus,a=o[t];if(a==null){var s=bf[t];if(s==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof s!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");a=s(),o[t]=a}else console.warn("Duplicated toolbar menu key '"+t+`' -\u91CD\u590D\u6CE8\u518C\u4E86\u83DC\u5355\u680F menu '`+t+"'");var l=L3(t,a,i);this.toolbarItems.push(l),JS.set(l,n),i?r.appendBarItem(l):r.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var t=YS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.destroy=function(){this.$toolbar.remove(),this.menus={},this.toolbarItems=[]},e}(),iee=_c.EXISTS,oee=Ro.f,I3=Function.prototype,aee=Wt(I3.toString),M3=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,see=Wt(M3.exec);function B3(e){var t=e.server,r=t===void 0?"":t,n=e.fieldName,i=n===void 0?"":n,o=e.maxFileSize,a=o===void 0?10485760:o,s=e.maxNumberOfFiles,l=s===void 0?100:s,u=e.meta,c=u===void 0?{}:u,h=e.metaWithUrl,S=h!==void 0&&h,y=e.headers,z=y===void 0?{}:y,F=e.withCredentials,N=F!==void 0&&F,j=e.timeout,D=j===void 0?1e4:j,Q=e.onBeforeUpload,te=Q===void 0?function(gt){return gt}:Q,he=e.onSuccess,Ee=he===void 0?function(gt,dt){}:he,ve=e.onError,De=ve===void 0?function(gt,dt,ht){console.error(gt.name+" upload error",dt,ht)}:ve,Pe=e.onProgress,qe=Pe===void 0?function(gt){}:Pe;if(!r)throw new Error(`Cannot get upload server address +Textarea height < 300px . This may be cause modal and hoverbar position error`,j)});var W=void 0;Object.keys(S).length>0&&(W=new Jq,ZS.set(W,u),Mm.set(u,W)),u.on("change",function(){u.hidePanelOrModal()}),u.on("scroll",function(){u.hidePanelOrModal()})}else u.children.forEach(function(j,D){return P3(j,D,u,u)});var F=c.onCreated,N=c.onDestroyed;return F&&u.on("created",function(){return F(u)}),N&&u.on("destroyed",function(){return N(u)}),co(function(){return u.emit("created")}),u}var qq=wm("splice"),eee=yt.TypeError,tee=Math.max,ree=Math.min;sn({target:"Array",proto:!0,forced:!qq},{splice:function(e,t){var r,n,i,o,a,s,l=ms(this),u=eu(l),c=Lc(e,u),h=arguments.length;if(h===0?r=n=0:h===1?(r=0,n=u-c):(r=h-2,n=ree(tee(qh(t),0),u-c)),u+r-n>9007199254740991)throw eee("Maximum allowed length exceeded");for(i=eM(l,n),o=0;ou-n+r;o--)delete l[o-1]}else if(r>n)for(o=u-n;o>c;o--)s=o+r-1,(a=o+n-1)in l?l[s]=l[a]:delete l[s];for(o=0;o'),this.menus={},this.toolbarItems=[],this.config={},this.changeToolbarState=eI(function(){n.toolbarItems.forEach(function(a){a.changeMenuState()})},200),this.config=r;var i=_e(t);if(i.length===0)throw new Error("Cannot find toolbar DOM by selector '"+t+"'");this.$box=i;var o=this.$toolbar;o.on("mousedown",function(a){return a.preventDefault()},{passive:!1}),i.append(o),co(function(){n.registerItems(),n.changeToolbarState(),n.getEditorInstance().on("change",n.changeToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.registerItems=function(){var t=this,r="",n=this.$toolbar,i=this.config,o=i.toolbarKeys,a=o===void 0?[]:o,s=i.insertKeys,l=s===void 0?{index:0,keys:[]}:s,u=i.excludeKeys,c=u===void 0?[]:u,h=tI(a);l.keys.length>0&&(typeof l.keys=="string"&&(l.keys=[l.keys]),l.keys.forEach(function(W,F){h.splice(l.index+F,0,W)}));var S=h.filter(function(W){if(typeof W=="string"){if(c.includes(W))return!1}else if(c.includes(W.key))return!1;return!0}),y=S.length;S.forEach(function(W,F){if(W==="|"){if(F===0)return;if(F+1===y)return;if(r==="|")return;var N=O3();return n.append(N),void(r=W)}if(typeof W=="string")return t.registerSingleItem(W,t),void(r=W);t.registerGroup(W),r="group"})},e.prototype.registerGroup=function(t){var r=this,n=this.$toolbar,i=function(u){return new R3(u)}(t),o=t.menuKeys,a=o===void 0?[]:o,s=this.config.excludeKeys,l=s===void 0?[]:s;a.forEach(function(u){l.includes(u)||r.registerSingleItem(u,i)}),n.append(i.$elem)},e.prototype.registerSingleItem=function(t,r){var n=this.getEditorInstance(),i=r instanceof R3,o=this.menus,a=o[t];if(a==null){var s=bf[t];if(s==null)throw new Error("Not found menu item factory by key '"+t+"'");if(typeof s!="function")throw new Error("Menu item factory (key='"+t+"') is not a function");a=s(),o[t]=a}else console.warn("Duplicated toolbar menu key '"+t+`' +\u91CD\u590D\u6CE8\u518C\u4E86\u83DC\u5355\u680F menu '`+t+"'");var l=L3(t,a,i);this.toolbarItems.push(l),JS.set(l,n),i?r.appendBarItem(l):r.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var t=YS.get(this);if(t==null)throw new Error("Can not get editor instance");return t},e.prototype.destroy=function(){this.$toolbar.remove(),this.menus={},this.toolbarItems=[]},e}(),iee=_c.EXISTS,oee=Ro.f,I3=Function.prototype,aee=Wt(I3.toString),M3=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,see=Wt(M3.exec);function B3(e){var t=e.server,r=t===void 0?"":t,n=e.fieldName,i=n===void 0?"":n,o=e.maxFileSize,a=o===void 0?10485760:o,s=e.maxNumberOfFiles,l=s===void 0?100:s,u=e.meta,c=u===void 0?{}:u,h=e.metaWithUrl,S=h!==void 0&&h,y=e.headers,W=y===void 0?{}:y,F=e.withCredentials,N=F!==void 0&&F,j=e.timeout,D=j===void 0?1e4:j,Q=e.onBeforeUpload,te=Q===void 0?function(gt){return gt}:Q,he=e.onSuccess,Ee=he===void 0?function(gt,dt){}:he,ve=e.onError,De=ve===void 0?function(gt,dt,ht){console.error(gt.name+" upload error",dt,ht)}:ve,Pe=e.onProgress,qe=Pe===void 0?function(gt){}:Pe;if(!r)throw new Error(`Cannot get upload server address \u6CA1\u6709\u914D\u7F6E\u4E0A\u4F20\u5730\u5740`);if(!i)throw new Error(`Cannot get fieldName -\u6CA1\u6709\u914D\u7F6E fieldName`);var ot=r;S&&(ot=function(gt,dt){var ht=Tr(gt.split("#"),2),pt=ht[0],Dt=ht[1],Ft=[];sx(dt,function(It,Re){Ft.push(Re+"="+It)});var Bt=Ft.join("&");return pt=pt.indexOf("?")>0?pt+"&"+Bt:pt+"?"+Bt,Dt?pt+"#"+Dt:pt}(ot,c));var et=new Hh({onBeforeUpload:te,restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:c}).use(IY,{endpoint:ot,headers:z,formData:!0,fieldName:i,bundle:!0,withCredentials:N,timeout:D});return et.on("upload-success",function(gt,dt){var ht=dt.body,pt=ht===void 0?{}:ht;try{Ee(gt,pt)}catch(Dt){console.error("wangEditor upload file - onSuccess error",Dt)}et.removeFile(gt.id)}),et.on("progress",function(gt){gt<1||qe(gt)}),et.on("upload-error",function(gt,dt,ht){try{De(gt,dt,ht)}catch(pt){console.error("wangEditor upload file - onError error",pt)}et.removeFile(gt.id)}),et.on("restriction-failed",function(gt,dt){try{De(gt,dt)}catch(ht){console.error("wangEditor upload file - onError error",ht)}et.removeFile(gt.id)}),et}function ws(e){return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(e)}function lee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function In(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.init(t,r)}return Ba(e,[{key:"init",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||uee,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n1?r-1:0),i=1;i-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function j3(e,t,r){var n=qw(e,t,Object);n.obj[n.k]=r}function Zm(e,t){var r=qw(e,t),n=r.obj,i=r.k;if(n)return n[i]}function U3(e,t,r){var n=Zm(e,r);return n!==void 0?n:Zm(t,r)}function H3(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):H3(e[n],t[n],r):e[n]=t[n]);return e}function Qc(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dee={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hee(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return dee[t]}):e}var Jm=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function z3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;oo+a;)a++,l=i[s=n.slice(o,o+a).join(r)];if(l===void 0)return;if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s];var u=n.slice(o+a).join(r);return u?z3(l,u,r):void 0}i=i[n[o]]}return i}}var fee=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),n.data=r||{},n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return Ym(t,Cs),Ba(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var n=this.options.ns.indexOf(r);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,l=[r,n];i&&typeof i!="string"&&(l=l.concat(i)),i&&typeof i=="string"&&(l=l.concat(a?i.split(a):i)),r.indexOf(".")>-1&&(l=r.split("."));var u=Zm(this.data,l);return u||!s||typeof i!="string"?u:z3(this.data&&this.data[r]&&this.data[r][n],i,a)}},{key:"addResource",value:function(r,n,i,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},s=this.options.keySeparator;s===void 0&&(s=".");var l=[r,n];i&&(l=l.concat(s?i.split(s):i)),r.indexOf(".")>-1&&(o=n,n=(l=r.split("."))[1]),this.addNamespaces(n),j3(this.data,l,o),a.silent||this.emit("added",r,n,i,o)}},{key:"addResources",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in i)typeof i[a]!="string"&&Object.prototype.toString.apply(i[a])!=="[object Array]"||this.addResource(r,n,a,i[a],{silent:!0});o.silent||this.emit("added",r,n,i)}},{key:"addResourceBundle",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[r,n];r.indexOf(".")>-1&&(o=i,i=n,n=(l=r.split("."))[1]),this.addNamespaces(n);var u=Zm(this.data,l)||{};o?H3(u,i,a):u=In({},u,i),j3(this.data,l,u),s.silent||this.emit("added",r,n,i)}},{key:"removeResourceBundle",value:function(r,n){this.hasResourceBundle(r,n)&&delete this.data[r][n],this.removeNamespaces(n),this.emit("removed",r,n)}},{key:"hasResourceBundle",value:function(r,n){return this.getResource(r,n)!==void 0}},{key:"getResourceBundle",value:function(r,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?In({},{},this.getResource(r,n)):this.getResource(r,n)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"toJSON",value:function(){return this.data}}]),t}(),W3={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach(function(a){o.processors[a]&&(t=o.processors[a].process(t,r,n,i))}),t}},G3={},V3=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),cee(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,lu(n)),n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=Fa.create("translator"),n}return Ym(t,Cs),Ba(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var i=this.resolve(r,n);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(r,n){var i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS;if(i&&r.indexOf(i)>-1){var s=r.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:r,namespaces:a};var l=r.split(i);(i!==o||i===o&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),r=l.join(o)}return typeof a=="string"&&(a=[a]),{key:r,namespaces:a}}},{key:"translate",value:function(r,n,i){var o=this;if(ws(n)!=="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(r[r.length-1],n),l=s.key,u=s.namespaces,c=u[u.length-1],h=n.lng||this.language,S=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(S){var y=n.nsSeparator||this.options.nsSeparator;return c+y+l}return l}var z=this.resolve(r,n),F=z&&z.res,N=z&&z.usedKey||l,j=z&&z.exactUsedKey||l,D=Object.prototype.toString.apply(F),Q=["[object Number]","[object Function]","[object RegExp]"],te=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,he=!this.i18nFormat||this.i18nFormat.handleAsObject,Ee=typeof F!="string"&&typeof F!="boolean"&&typeof F!="number";if(he&&F&&Ee&&Q.indexOf(D)<0&&(typeof te!="string"||D!=="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,F,In({},n,{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(a){var ve=D==="[object Array]",De=ve?[]:{},Pe=ve?j:N;for(var qe in F)if(Object.prototype.hasOwnProperty.call(F,qe)){var ot="".concat(Pe).concat(a).concat(qe);De[qe]=this.translate(ot,In({},n,{joinArrays:!1,ns:u})),De[qe]===ot&&(De[qe]=F[qe])}F=De}}else if(he&&typeof te=="string"&&D==="[object Array]")(F=F.join(te))&&(F=this.extendTranslation(F,r,n,i));else{var et=!1,gt=!1,dt=n.count!==void 0&&typeof n.count!="string",ht=t.hasDefaultValue(n),pt=dt?this.pluralResolver.getSuffix(h,n.count):"",Dt=n["defaultValue".concat(pt)]||n.defaultValue;!this.isValidLookup(F)&&ht&&(et=!0,F=Dt),this.isValidLookup(F)||(gt=!0,F=l);var Ft=n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Bt=Ft&>?void 0:F,It=ht&&Dt!==F&&this.options.updateMissing;if(gt||et||It){if(this.logger.log(It?"updateKey":"missingKey",h,c,l,It?Dt:F),a){var Re=this.resolve(l,In({},n,{keySeparator:!1}));Re&&Re.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Te=[],Be=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Be&&Be[0])for(var it=0;it1&&arguments[1]!==void 0?arguments[1]:{};return typeof r=="string"&&(r=[r]),r.forEach(function(c){if(!l.isValidLookup(n)){var h=l.extractFromKey(c,u),S=h.key;i=S;var y=h.namespaces;l.options.fallbackNS&&(y=y.concat(l.options.fallbackNS));var z=u.count!==void 0&&typeof u.count!="string",F=u.context!==void 0&&(typeof u.context=="string"||typeof u.context=="number")&&u.context!=="",N=u.lngs?u.lngs:l.languageUtils.toResolveHierarchy(u.lng||l.language,u.fallbackLng);y.forEach(function(j){l.isValidLookup(n)||(s=j,!G3["".concat(N[0],"-").concat(j)]&&l.utils&&l.utils.hasLoadedNamespace&&!l.utils.hasLoadedNamespace(s)&&(G3["".concat(N[0],"-").concat(j)]=!0,l.logger.warn('key "'.concat(i,'" for languages "').concat(N.join(", "),`" won't get resolved as namespace "`).concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(function(D){if(!l.isValidLookup(n)){a=D;var Q,te,he=S,Ee=[he];for(l.i18nFormat&&l.i18nFormat.addLookupKeys?l.i18nFormat.addLookupKeys(Ee,S,D,j,u):(z&&(Q=l.pluralResolver.getSuffix(D,u.count)),z&&F&&Ee.push(he+Q),F&&Ee.push(he+="".concat(l.options.contextSeparator).concat(u.context)),z&&Ee.push(he+=Q));te=Ee.pop();)l.isValidLookup(n)||(o=te,n=l.getResource(D,j,te,u))}}))})}}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}},{key:"isValidLookup",value:function(r){return!(r===void 0||!this.options.returnNull&&r===null||!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,n,i,o):this.resourceStore.getResource(r,n,i,o)}}],[{key:"hasDefaultValue",value:function(r){var n="defaultValue";for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n===i.substring(0,n.length)&&r[i]!==void 0)return!0;return!1}}]),t}();function eC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pee=function(){function e(t){Ma(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fa.create("languageUtils")}return Ba(e,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");return r.length===2?null:(r.pop(),r[r.length-1].toLowerCase()==="x"?null:this.formatLanguageCode(r.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(i){return i.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=eC(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var r,n=this;return t?(t.forEach(function(i){if(!r){var o=n.formatLanguageCode(i);n.options.supportedLngs&&!n.isSupportedCode(o)||(r=o)}}),!r&&this.options.supportedLngs&&t.forEach(function(i){if(!r){var o=n.getLanguagePartFromCode(i);if(n.isSupportedCode(o))return r=o;r=n.options.supportedLngs.find(function(a){if(a.indexOf(o)===0)return a})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];var n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,r){var n=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],t),o=[],a=function(s){s&&(n.isSupportedCode(s)?o.push(s):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(s)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),i.forEach(function(s){o.indexOf(s)<0&&a(n.formatLanguageCode(s))}),o}}]),e}(),gee=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],vee={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}};function mee(){var e={};return gee.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:vee[t.fc]}})}),e}var yee=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.languageUtils=t,this.options=r,this.logger=Fa.create("pluralResolver"),this.rules=mee()}return Ba(e,[{key:"addRule",value:function(t,r){this.rules[t]=r}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var r=this.getRule(t);return r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,r){return this.getSuffixes(t).map(function(n){return r+n})}},{key:"getSuffixes",value:function(t){var r=this,n=this.getRule(t);return n?n.numbers.map(function(i){return r.getSuffix(t,i)}):[]}},{key:"getSuffix",value:function(t,r){var n=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(r):i.plurals(Math.abs(r)),a=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),e}(),bee=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(this,e),this.logger=Fa.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ba(e,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var r=t.interpolation;this.escape=r.escape!==void 0?r.escape:hee,this.escapeValue=r.escapeValue===void 0||r.escapeValue,this.useRawValueToEscape=r.useRawValueToEscape!==void 0&&r.useRawValueToEscape,this.prefix=r.prefix?Qc(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Qc(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Qc(r.nestingPrefix):r.nestingPrefixEscaped||Qc("$t("),this.nestingSuffix=r.nestingSuffix?Qc(r.nestingSuffix):r.nestingSuffixEscaped||Qc(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0&&r.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,r,n,i){var o,a,s,l=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(F){return F.replace(/\$/g,"$$$$")}var h=function(F){if(F.indexOf(l.formatSeparator)<0){var N=U3(r,u,F);return l.alwaysFormat?l.format(N,void 0,n,In({},i,r,{interpolationkey:F})):N}var j=F.split(l.formatSeparator),D=j.shift().trim(),Q=j.join(l.formatSeparator).trim();return l.format(U3(r,u,D),Q,n,In({},i,r,{interpolationkey:D}))};this.resetRegExp();var S=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,z=[{regex:this.regexpUnescape,safeValue:function(F){return c(F)}},{regex:this.regexp,safeValue:function(F){return l.escapeValue?c(l.escape(F)):c(F)}}];return z.forEach(function(F){for(s=0;o=F.regex.exec(t);){if((a=h(o[1].trim()))===void 0)if(typeof S=="function"){var N=S(t,o,i);a=typeof N=="string"?N:""}else{if(y){a=o[0];continue}l.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(t)),a=""}else typeof a=="string"||l.useRawValueToEscape||(a=N3(a));var j=F.safeValue(a);if(t=t.replace(o[0],j),y?(F.regex.lastIndex+=j.length,F.regex.lastIndex-=o[0].length):F.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,r){var n,i,o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=In({},a);function l(S,y){var z=this.nestingOptionsSeparator;if(S.indexOf(z)<0)return S;var F=S.split(new RegExp("".concat(z,"[ ]*{"))),N="{".concat(F[1]);S=F[0],N=(N=this.interpolate(N,s)).replace(/'/g,'"');try{s=JSON.parse(N),y&&(s=In({},y,s))}catch(j){return this.logger.warn("failed parsing options string in nesting for key ".concat(S),j),"".concat(S).concat(z).concat(N)}return delete s.defaultValue,S}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(t);){var u=[],c=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map(function(S){return S.trim()});n[1]=h.shift(),u=h,c=!0}if((i=r(l.call(this,n[1].trim(),s),s))&&n[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=N3(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),i=""),c&&(i=u.reduce(function(S,y){return o.format(S,y,a.lng,In({},a,{interpolationkey:n[1].trim()}))},i.trim())),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}]),e}(),Eee=function(e){function t(r,n,i){var o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ma(this,t),o=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(o)),o.backend=r,o.store=n,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=Fa.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return Ym(t,Cs),Ba(t,[{key:"queueLoad",value:function(r,n,i,o){var a=this,s=[],l=[],u=[],c=[];return r.forEach(function(h){var S=!0;n.forEach(function(y){var z="".concat(h,"|").concat(y);!i.reload&&a.store.hasResourceBundle(h,y)?a.state[z]=2:a.state[z]<0||(a.state[z]===1?l.indexOf(z)<0&&l.push(z):(a.state[z]=1,S=!1,l.indexOf(z)<0&&l.push(z),s.indexOf(z)<0&&s.push(z),c.indexOf(y)<0&&c.push(y)))}),S||u.push(h)}),(s.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:o}),{toLoad:s,pending:l,toLoadLanguages:u,toLoadNamespaces:c}}},{key:"loaded",value:function(r,n,i){var o=r.split("|"),a=o[0],s=o[1];n&&this.emit("failedLoading",a,s,n),i&&this.store.addResourceBundle(a,s,i),this.state[r]=n?-1:2;var l={};this.queue.forEach(function(u){!function(c,h,S,y){var z=qw(c,h,Object),F=z.obj,N=z.k;F[N]=F[N]||[],F[N].push(S)}(u.loaded,[a],s),function(c,h){for(var S=c.indexOf(h);S!==-1;)c.splice(S,1),S=c.indexOf(h)}(u.pending,r),n&&u.errors.push(n),u.pending.length!==0||u.done||(Object.keys(u.loaded).forEach(function(c){l[c]||(l[c]=[]),u.loaded[c].length&&u.loaded[c].forEach(function(h){l[c].indexOf(h)<0&&l[c].push(h)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(function(u){return!u.done})}},{key:"read",value:function(r,n,i){var o=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,l=arguments.length>5?arguments[5]:void 0;return r.length?this.backend[i](r,n,function(u,c){u&&c&&a<5?setTimeout(function(){o.read.call(o,r,n,i,a+1,2*s,l)},s):l(u,c)}):l(null,{})}},{key:"prepareLoading",value:function(r,n){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof n=="string"&&(n=[n]);var s=this.queueLoad(r,n,o,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(function(l){i.loadOne(l)})}},{key:"load",value:function(r,n,i){this.prepareLoading(r,n,{},i)}},{key:"reload",value:function(r,n,i){this.prepareLoading(r,n,{reload:!0},i)}},{key:"loadOne",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=r.split("|"),a=o[0],s=o[1];this.read(a,s,"read",void 0,void 0,function(l,u){l&&n.logger.warn("".concat(i,"loading namespace ").concat(s," for language ").concat(a," failed"),l),!l&&u&&n.logger.log("".concat(i,"loaded namespace ").concat(s," for language ").concat(a),u),n.loaded(r,l,u)})}},{key:"saveMissing",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):i!=null&&i!==""&&(this.backend&&this.backend.create&&this.backend.create(r,n,i,o,null,In({},s,{isUpdate:a})),r&&r[0]&&this.store.addResource(r[0],n,i,o))}}]),t}();function xee(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(ws(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),ws(e[2])==="object"||ws(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(n){t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function K3(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qm(){}var See=function(e){function t(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Ma(this,t),r=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(r)),r.options=K3(n),r.services={},r.logger=Fa,r.modules={external:[]},i&&!r.isInitialized&&!n.isClone){if(!r.options.initImmediate)return r.init(n,i),_f(r,lu(r));setTimeout(function(){r.init(n,i)},0)}return r}return Ym(t,Cs),Ba(t,[{key:"init",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function o(y){return y?typeof y=="function"?new y:y:null}if(typeof n=="function"&&(i=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=In({},xee(),this.options,K3(n)),this.format=this.options.interpolation.format,i||(i=Qm),!this.options.isClone){this.modules.logger?Fa.init(o(this.modules.logger),this.options):Fa.init(null,this.options);var a=new pee(this.options);this.store=new fee(this.options.resources,this.options);var s=this.services;s.logger=Fa,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new yee(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new bee(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Eee(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(y){for(var z=arguments.length,F=new Array(z>1?z-1:0),N=1;N1?z-1:0),N=1;N0&&l[0]!=="dev"&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach(function(y){r[y]=function(){var z;return(z=r.store)[y].apply(z,arguments)}});var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach(function(y){r[y]=function(){var z;return(z=r.store)[y].apply(z,arguments),r}});var h=Rf(),S=function(){var y=function(z,F){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),h.resolve(F),i(z,F)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return y(null,r.t.bind(r));r.changeLanguage(r.options.lng,y)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),h}},{key:"loadResources",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=i,a=typeof r=="string"?r:this.language;if(typeof r=="function"&&(o=r),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return o();var s=[],l=function(c){c&&n.services.languageUtils.toResolveHierarchy(c).forEach(function(h){s.indexOf(h)<0&&s.push(h)})};if(a)l(a);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach(function(c){return l(c)})}this.options.preload&&this.options.preload.forEach(function(c){return l(c)}),this.services.backendConnector.load(s,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(r,n,i){var o=Rf();return r||(r=this.languages),n||(n=this.options.ns),i||(i=Qm),this.services.backendConnector.reload(r,n,function(a){o.resolve(),i(a)}),o}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&W3.addPostProcessor(r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"changeLanguage",value:function(r,n){var i=this;this.isLanguageChangingTo=r;var o=Rf();this.emit("languageChanging",r);var a=function(s){r||s||!i.services.languageDetector||(s=[]);var l=typeof s=="string"?s:i.services.languageUtils.getBestMatchFromCodes(s);l&&(i.language||(i.language=l,i.languages=i.services.languageUtils.toResolveHierarchy(l)),i.translator.language||i.translator.changeLanguage(l),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(l)),i.loadResources(l,function(u){!function(c,h){h?(i.language=h,i.languages=i.services.languageUtils.toResolveHierarchy(h),i.translator.changeLanguage(h),i.isLanguageChangingTo=void 0,i.emit("languageChanged",h),i.logger.log("languageChanged",h)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),n&&n(c,function(){return i.t.apply(i,arguments)})}(u,l)})};return r||!this.services.languageDetector||this.services.languageDetector.async?!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(r):a(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(r,n,i){var o=this,a=function s(l,u){var c;if(ws(u)!=="object"){for(var h=arguments.length,S=new Array(h>2?h-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],a=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var l=function(c,h){var S=n.services.backendConnector.state["".concat(c,"|").concat(h)];return S===-1||S===2};if(i.precheck){var u=i.precheck(this,l);if(u!==void 0)return u}return!!this.hasResourceBundle(o,r)||!this.services.backendConnector.backend||!(!l(o,r)||a&&!l(s,r))}},{key:"loadNamespaces",value:function(r,n){var i=this,o=Rf();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(a){i.options.ns.indexOf(a)<0&&i.options.ns.push(a)}),this.loadResources(function(a){o.resolve(),n&&n(a)}),o):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(r,n){var i=Rf();typeof r=="string"&&(r=[r]);var o=this.options.preload||[],a=r.filter(function(s){return o.indexOf(s)<0});return a.length?(this.options.preload=o.concat(a),this.loadResources(function(s){i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(r){return r||(r=this.languages&&this.languages.length>0?this.languages[0]:this.language),r?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(r))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(r,n)}},{key:"cloneInstance",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=In({},this.options,n,{isClone:!0}),a=new t(o),s=["store","services","language"];return s.forEach(function(l){a[l]=r[l]}),a.services=In({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new V3(a.services,a.options),a.translator.on("*",function(l){for(var u=arguments.length,c=new Array(u>1?u-1:0),h=1;hD;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:J3(te,S)}else switch(e){case 4:return!1;case 7:J3(te,S)}return o?-1:n||i?i:te}},Ree={forEach:Ts(0),map:Ts(1),filter:Ts(2),some:Ts(3),every:Ts(4),find:Ts(5),findIndex:Ts(6),filterReject:Ts(7)}.forEach,kee=function(e,t){var r=[][e];return!!r&&Xn(function(){r.call(null,t||function(){throw 1},1)})}("forEach"),rC=kee?[].forEach:function(e){return Ree(this,e,arguments.length>1?arguments[1]:void 0)},Q3=function(e){if(e&&e.forEach!==rC)try{Si(e,"forEach",rC)}catch(t){e.forEach=rC}};for(var nC in xv)xv[nC]&&Q3(nr[nC]&&nr[nC].prototype);Q3(Uk),Ri("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"}}),Ri("zh-CN",{common:{ok:"\u786E\u5B9A",delete:"\u5220\u9664",enter:"\u56DE\u8F66"},blockQuote:{title:"\u5F15\u7528"},codeBlock:{title:"\u4EE3\u7801\u5757"},color:{color:"\u6587\u5B57\u989C\u8272",bgColor:"\u80CC\u666F\u8272",default:"\u9ED8\u8BA4\u989C\u8272",clear:"\u6E05\u9664\u80CC\u666F\u8272"},divider:{title:"\u5206\u5272\u7EBF"},emotion:{title:"\u8868\u60C5"},fontSize:{title:"\u5B57\u53F7",default:"\u9ED8\u8BA4\u5B57\u53F7"},fontFamily:{title:"\u5B57\u4F53",default:"\u9ED8\u8BA4\u5B57\u4F53"},fullScreen:{title:"\u5168\u5C4F"},header:{title:"\u6807\u9898",text:"\u6B63\u6587"},image:{netImage:"\u7F51\u7EDC\u56FE\u7247",delete:"\u5220\u9664\u56FE\u7247",edit:"\u7F16\u8F91\u56FE\u7247",viewLink:"\u67E5\u770B\u94FE\u63A5",src:"\u56FE\u7247\u5730\u5740",desc:"\u56FE\u7247\u63CF\u8FF0",link:"\u56FE\u7247\u94FE\u63A5"},indent:{decrease:"\u51CF\u5C11\u7F29\u8FDB",increase:"\u589E\u52A0\u7F29\u8FDB"},justify:{left:"\u5DE6\u5BF9\u9F50",right:"\u53F3\u5BF9\u9F50",center:"\u5C45\u4E2D\u5BF9\u9F50",justify:"\u4E24\u7AEF\u5BF9\u9F50"},lineHeight:{title:"\u884C\u9AD8",default:"\u9ED8\u8BA4\u884C\u9AD8"},link:{insert:"\u63D2\u5165\u94FE\u63A5",text:"\u94FE\u63A5\u6587\u672C",url:"\u94FE\u63A5\u5730\u5740",unLink:"\u53D6\u6D88\u94FE\u63A5",edit:"\u4FEE\u6539\u94FE\u63A5",view:"\u67E5\u770B\u94FE\u63A5"},textStyle:{bold:"\u7C97\u4F53",clear:"\u6E05\u9664\u683C\u5F0F",code:"\u884C\u5185\u4EE3\u7801",italic:"\u659C\u4F53",sub:"\u4E0B\u6807",sup:"\u4E0A\u6807",through:"\u5220\u9664\u7EBF",underline:"\u4E0B\u5212\u7EBF"},undo:{undo:"\u64A4\u9500",redo:"\u91CD\u505A"},todo:{todo:"\u5F85\u529E"}});var Lee={type:"paragraph",renderElem:function(e,t,r){return er("p",null,t)}},qm=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function e0(e){var t={exports:{}};return e(t,t.exports),t.exports}var As,t0,r0=function(e){return e&&e.Math==Math&&e},sr=r0(typeof globalThis=="object"&&globalThis)||r0(typeof window=="object"&&window)||r0(typeof self=="object"&&self)||r0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),un=function(e){try{return!!e()}catch(t){return!0}},Io=!un(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Lf=Function.prototype.call,vn=Lf.bind?Lf.bind(Lf):function(){return Lf.apply(Lf,arguments)},q3={}.propertyIsEnumerable,eB=Object.getOwnPropertyDescriptor,Pee=eB&&!q3.call({1:2},1)?function(e){var t=eB(this,e);return!!t&&t.enumerable}:q3,tB={f:Pee},iC=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},rB=Function.prototype,oC=rB.bind,aC=rB.call,Iee=oC&&oC.bind(aC),Qt=oC?function(e){return e&&Iee(aC,e)}:function(e){return e&&function(){return aC.apply(e,arguments)}},Mee=Qt({}.toString),Bee=Qt("".slice),Ds=function(e){return Bee(Mee(e),8,-1)},sC=sr.Object,Fee=Qt("".split),n0=un(function(){return!sC("z").propertyIsEnumerable(0)})?function(e){return Ds(e)=="String"?Fee(e,""):sC(e)}:sC,Nee=sr.TypeError,fo=function(e){if(e==null)throw Nee("Can't call method on "+e);return e},ed=function(e){return n0(fo(e))},ii=function(e){return typeof e=="function"},po=function(e){return typeof e=="object"?e!==null:ii(e)},jee=function(e){return ii(e)?e:void 0},Pf=function(e,t){return arguments.length<2?jee(sr[e]):sr[e]&&sr[e][t]},nB=Qt({}.isPrototypeOf),lC=Pf("navigator","userAgent")||"",iB=sr.process,oB=sr.Deno,aB=iB&&iB.versions||oB&&oB.version,sB=aB&&aB.v8;sB&&(t0=(As=sB.split("."))[0]>0&&As[0]<4?1:+(As[0]+As[1])),!t0&&lC&&(!(As=lC.match(/Edge\/(\d+)/))||As[1]>=74)&&(As=lC.match(/Chrome\/(\d+)/))&&(t0=+As[1]);var uC=t0,cC=!!Object.getOwnPropertySymbols&&!un(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&uC&&uC<41}),dC=cC&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Uee=sr.Object,hC=dC?function(e){return typeof e=="symbol"}:function(e){var t=Pf("Symbol");return ii(t)&&nB(t.prototype,Uee(e))},Hee=sr.String,lB=function(e){try{return Hee(e)}catch(t){return"Object"}},zee=sr.TypeError,uB=function(e){if(ii(e))return e;throw zee(lB(e)+" is not a function")},i0=function(e,t){var r=e[t];return r==null?void 0:uB(r)},Wee=sr.TypeError,Gee=Object.defineProperty,fC=function(e,t){try{Gee(sr,e,{value:t,configurable:!0,writable:!0})}catch(r){sr[e]=t}return t},Os=sr["__core-js_shared__"]||fC("__core-js_shared__",{}),pC=e0(function(e){(e.exports=function(t,r){return Os[t]||(Os[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Vee=sr.Object,If=function(e){return Vee(fo(e))},Kee=Qt({}.hasOwnProperty),go=Object.hasOwn||function(e,t){return Kee(If(e),t)},$ee=0,Xee=Math.random(),Yee=Qt(1 .toString),cB=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Yee(++$ee+Xee,36)},Mf=pC("wks"),uu=sr.Symbol,dB=uu&&uu.for,Zee=dC?uu:uu&&uu.withoutSetter||cB,Vi=function(e){if(!go(Mf,e)||!cC&&typeof Mf[e]!="string"){var t="Symbol."+e;cC&&go(uu,e)?Mf[e]=uu[e]:Mf[e]=dC&&dB?dB(t):Zee(t)}return Mf[e]},Jee=sr.TypeError,Qee=Vi("toPrimitive"),gC=function(e){var t=function(r,n){if(!po(r)||hC(r))return r;var i,o=i0(r,Qee);if(o){if(n===void 0&&(n="default"),i=vn(o,r,n),!po(i)||hC(i))return i;throw Jee("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;if(ii(l=a.valueOf)&&!po(u=vn(l,a)))return u;if(s!=="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;throw Wee("Can't convert object to primitive value")}(r,n)}(e,"string");return hC(t)?t:t+""},vC=sr.document,qee=po(vC)&&po(vC.createElement),mC=function(e){return qee?vC.createElement(e):{}},hB=!Io&&!un(function(){return Object.defineProperty(mC("div"),"a",{get:function(){return 7}}).a!=7}),fB=Object.getOwnPropertyDescriptor,yC={f:Io?fB:function(e,t){if(e=ed(e),t=gC(t),hB)try{return fB(e,t)}catch(r){}if(go(e,t))return iC(!vn(tB.f,e,t),e[t])}},ete=sr.String,tte=sr.TypeError,Ki=function(e){if(po(e))return e;throw tte(ete(e)+" is not an object")},rte=sr.TypeError,pB=Object.defineProperty,td={f:Io?pB:function(e,t,r){if(Ki(e),t=gC(t),Ki(r),hB)try{return pB(e,t,r)}catch(n){}if("get"in r||"set"in r)throw rte("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},rd=Io?function(e,t,r){return td.f(e,t,iC(1,r))}:function(e,t,r){return e[t]=r,e},nte=Qt(Function.toString);ii(Os.inspectSource)||(Os.inspectSource=function(e){return nte(e)});var o0,Bf,a0,bC=Os.inspectSource,gB=sr.WeakMap,ite=ii(gB)&&/native code/.test(bC(gB)),vB=pC("keys"),mB=function(e){return vB[e]||(vB[e]=cB(e))},EC={},xC=sr.TypeError,ote=sr.WeakMap;if(ite||Os.state){var cu=Os.state||(Os.state=new ote),ate=Qt(cu.get),yB=Qt(cu.has),ste=Qt(cu.set);o0=function(e,t){if(yB(cu,e))throw new xC("Object already initialized");return t.facade=e,ste(cu,e,t),t},Bf=function(e){return ate(cu,e)||{}},a0=function(e){return yB(cu,e)}}else{var nd=mB("state");EC[nd]=!0,o0=function(e,t){if(go(e,nd))throw new xC("Object already initialized");return t.facade=e,rd(e,nd,t),t},Bf=function(e){return go(e,nd)?e[nd]:{}},a0=function(e){return go(e,nd)}}var SC={set:o0,get:Bf,has:a0,enforce:function(e){return a0(e)?Bf(e):o0(e,{})},getterFor:function(e){return function(t){var r;if(!po(t)||(r=Bf(t)).type!==e)throw xC("Incompatible receiver, "+e+" required");return r}}},bB=Function.prototype,lte=Io&&Object.getOwnPropertyDescriptor,wC=go(bB,"name"),s0={EXISTS:wC,PROPER:wC&&function(){}.name==="something",CONFIGURABLE:wC&&(!Io||Io&<e(bB,"name").configurable)},Ff=e0(function(e){var t=s0.CONFIGURABLE,r=SC.get,n=SC.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;ii(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!go(s,"name")||t&&s.name!==y)&&rd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==sr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:rd(o,a,s)):h?o[a]=s:fC(a,s)})(Function.prototype,"toString",function(){return ii(this)&&r(this).source||bC(this)})}),ute=Math.ceil,cte=Math.floor,id=function(e){var t=+e;return t!=t||t===0?0:(t>0?cte:ute)(t)},dte=Math.max,hte=Math.min,Nf=function(e,t){var r=id(e);return r<0?dte(r+t,0):hte(r,t)},fte=Math.min,jf=function(e){return e>0?fte(id(e),9007199254740991):0},l0=function(e){return jf(e.length)},EB=function(e){return function(t,r,n){var i,o=ed(t),a=l0(o),s=Nf(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xB={includes:EB(!0),indexOf:EB(!1)},pte=xB.indexOf,SB=Qt([].push),wB=function(e,t){var r,n=ed(e),i=0,o=[];for(r in n)!go(EC,r)&&go(n,r)&&SB(o,r);for(;t.length>i;)go(n,r=t[i++])&&(~pte(o,r)||SB(o,r));return o},u0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gte=u0.concat("length","prototype"),vte={f:Object.getOwnPropertyNames||function(e){return wB(e,gte)}},CB={f:Object.getOwnPropertySymbols},mte=Qt([].concat),yte=Pf("Reflect","ownKeys")||function(e){var t=vte.f(Ki(e)),r=CB.f;return r?mte(t,r(e)):t},bte=function(e,t){for(var r=yte(t),n=td.f,i=yC.f,o=0;oD;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:RB(te,S)}else switch(e){case 4:return!1;case 7:RB(te,S)}return o?-1:n||i?i:te}},d0={forEach:_s(0),map:_s(1),filter:_s(2),some:_s(3),every:_s(4),find:_s(5),findIndex:_s(6),filterReject:_s(7)},Mte=Vi("species"),OC=function(e){return uC>=51||!un(function(){var t=[];return(t.constructor={})[Mte]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Bte=d0.filter;Hn({target:"Array",proto:!0,forced:!OC("filter")},{filter:function(e){return Bte(this,e,arguments.length>1?arguments[1]:void 0)}});var Fte=CC?{}.toString:function(){return"[object "+TC(this)+"]"};CC||Ff(Object.prototype,"toString",Fte,{unsafe:!0});var h0,Nte=sr.String,cn=function(e){if(TC(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Nte(e)},kB=function(){var e=Ki(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},_C=sr.RegExp,RC=un(function(){var e=_C("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),jte=RC||un(function(){return!_C("a","y").sticky}),LB={BROKEN_CARET:RC||un(function(){var e=_C("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:jte,UNSUPPORTED_Y:RC},od=Object.keys||function(e){return wB(e,u0)},Ute=Io?Object.defineProperties:function(e,t){Ki(e);for(var r,n=ed(t),i=od(t),o=i.length,a=0;o>a;)td.f(e,r=i[a++],n[r]);return e},Hte=Pf("document","documentElement"),PB=mB("IE_PROTO"),kC=function(){},IB=function(e){return""},MB=function(e){e.write(IB("")),e.close();var t=e.parentWindow.Object;return e=null,t},f0=function(){try{h0=new ActiveXObject("htmlfile")}catch(n){}var e,t;f0=typeof document!="undefined"?document.domain&&h0?MB(h0):((t=mC("iframe")).style.display="none",Hte.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(IB("document.F=Object")),e.close(),e.F):MB(h0);for(var r=u0.length;r--;)delete f0.prototype[u0[r]];return f0()};EC[PB]=!0;var BB,LC,FB=Object.create||function(e,t){var r;return e!==null?(kC.prototype=Ki(e),r=new kC,kC.prototype=null,r[PB]=e):r=f0(),t===void 0?r:Ute(r,t)},zte=sr.RegExp,Wte=un(function(){var e=zte(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),Gte=sr.RegExp,Vte=un(function(){var e=Gte("(?
      b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),Kte=SC.get,$te=pC("native-string-replace",String.prototype.replace),p0=RegExp.prototype.exec,PC=p0,Xte=Qt("".charAt),Yte=Qt("".indexOf),Zte=Qt("".replace),IC=Qt("".slice),MC=(LC=/b*/g,vn(p0,BB=/a/,"a"),vn(p0,LC,"a"),BB.lastIndex!==0||LC.lastIndex!==0),NB=LB.BROKEN_CARET,BC=/()??/.exec("")[1]!==void 0;(MC||BC||NB||Wte||Vte)&&(PC=function(e){var t,r,n,i,o,a,s,l=this,u=Kte(l),c=cn(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=vn(PC,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=NB&&l.sticky,z=vn(kB,l),F=l.source,N=0,j=c;if(y&&(z=Zte(z,"y",""),Yte(z,"g")===-1&&(z+="g"),j=IC(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Xte(c,l.lastIndex-1)!==` -`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",z)),BC&&(r=new RegExp("^"+F+"$(?!\\s)",z)),MC&&(n=l.lastIndex),i=vn(p0,y?r:l,j),y?i?(i.input=IC(i.input,N),i[0]=IC(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:MC&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),BC&&i&&i.length>1&&vn($te,i[0],r,function(){for(o=1;o=s?e?"":void 0:(n=zB(o,a))<55296||n>56319||a+1===s||(i=zB(o,a+1))<56320||i>57343?e?qte(o,a):n:e?ere(o,a,a+2):i-56320+(n-55296<<10)+65536}},tre=(WB(!1),WB(!0)),UC=function(e,t,r){return t+(r?tre(e,t).length:1)},rre=Math.floor,HC=Qt("".charAt),nre=Qt("".replace),zC=Qt("".slice),ire=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ore=/\$([$&'`]|\d{1,2})/g,are=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=ore;return i!==void 0&&(i=If(i),l=ire),nre(o,l,function(u,c){var h;switch(HC(c,0)){case"$":return"$";case"&":return e;case"`":return zC(t,0,r);case"'":return zC(t,a);case"<":h=i[zC(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=rre(S/10);return y===0?u:y<=s?n[y-1]===void 0?HC(c,1):n[y-1]+HC(c,1):u}h=n[S-1]}return h===void 0?"":h})},sre=sr.TypeError,Wf=function(e,t){var r=e.exec;if(ii(r)){var n=vn(r,e,t);return n!==null&&Ki(n),n}if(Ds(e)==="RegExp")return vn(zf,e,t);throw sre("RegExp#exec called on incompatible receiver")},WC=Vi("replace"),lre=Math.max,ure=Math.min,cre=Qt([].concat),GC=Qt([].push),GB=Qt("".indexOf),VB=Qt("".slice),dre="a".replace(/./,"$0")==="$0",KB=!!/./[WC]&&/./[WC]("a","$0")==="";jC("replace",function(e,t,r){var n=KB?"$":"$0";return[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,WC);return s?vn(s,i,a,o):vn(t,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i);if(typeof o=="string"&&GB(o,n)===-1&&GB(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=ii(o);u||(o=cn(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=Wf(a,s);if(y===null)break;if(GC(S,y),!c)break;cn(y[0])===""&&(a.lastIndex=UC(s,jf(a.lastIndex),h))}for(var z,F="",N=0,j=0;j=N&&(F+=VB(s,N,Q)+De,N=Q+D.length)}return F+VB(s,N)}]},!!un(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"})||!dre||KB);var VC=Vi("unscopables"),KC=Array.prototype;KC[VC]==null&&td.f(KC,VC,{configurable:!0,value:FB(null)});var $B=function(e){KC[VC][e]=!0},hre=d0.find,XB=!0;"find"in[]&&Array(1).find(function(){XB=!1}),Hn({target:"Array",proto:!0,forced:XB},{find:function(e){return hre(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("find");var fre=Vi("match"),YB=function(e){var t;return po(e)&&((t=e[fre])!==void 0?!!t:Ds(e)=="RegExp")},pre=sr.TypeError,gre=Vi("species"),ZB=function(e,t,r){var n=gC(t);n in e?td.f(e,n,iC(0,r)):e[n]=r},vre=sr.Array,mre=Math.max,JB=function(e,t,r){for(var n=l0(e),i=Nf(t,n),o=Nf(r===void 0?n:r,n),a=vre(mre(o-i,0)),s=0;i1||"".split(/.?/).length?function(i,o){var a=cn(fo(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!YB(i))return vn(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,z=new RegExp(i.source,S+"g");(l=vn(zf,z,a))&&!((u=z.lastIndex)>y&&(sd(h,Gf(a,y,l.index)),l.length>1&&l.index=s));)z.lastIndex===l.index&&z.lastIndex++;return y===a.length?!c&&bre(z,"")||sd(h,""):sd(h,Gf(a,y)),h.length>s?JB(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:vn(t,this,i,o)}:t,[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,e);return s?vn(s,i,a,o):vn(n,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=function(te,he){var Ee,ve=Ki(te).constructor;return ve===void 0||(Ee=Ki(ve)[gre])==null?he:function(De){if(DC(De))return De;throw pre(lB(De)+" is not a constructor")}(Ee)}(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ad?"g":"y"),S=new u(ad?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return Wf(S,s)===null?[s]:[];for(var z=0,F=0,N=[];F0?pt+"&"+Bt:pt+"?"+Bt,Dt?pt+"#"+Dt:pt}(ot,c));var et=new Hh({onBeforeUpload:te,restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:c}).use(IY,{endpoint:ot,headers:W,formData:!0,fieldName:i,bundle:!0,withCredentials:N,timeout:D});return et.on("upload-success",function(gt,dt){var ht=dt.body,pt=ht===void 0?{}:ht;try{Ee(gt,pt)}catch(Dt){console.error("wangEditor upload file - onSuccess error",Dt)}et.removeFile(gt.id)}),et.on("progress",function(gt){gt<1||qe(gt)}),et.on("upload-error",function(gt,dt,ht){try{De(gt,dt,ht)}catch(pt){console.error("wangEditor upload file - onError error",pt)}et.removeFile(gt.id)}),et.on("restriction-failed",function(gt,dt){try{De(gt,dt)}catch(ht){console.error("wangEditor upload file - onError error",ht)}et.removeFile(gt.id)}),et}function ws(e){return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ws(e)}function lee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function In(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.init(t,r)}return Ba(e,[{key:"init",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||uee,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n1?r-1:0),i=1;i-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function j3(e,t,r){var n=qw(e,t,Object);n.obj[n.k]=r}function Zm(e,t){var r=qw(e,t),n=r.obj,i=r.k;if(n)return n[i]}function U3(e,t,r){var n=Zm(e,r);return n!==void 0?n:Zm(t,r)}function H3(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):H3(e[n],t[n],r):e[n]=t[n]);return e}function Qc(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dee={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hee(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return dee[t]}):e}var Jm=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function z3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;oo+a;)a++,l=i[s=n.slice(o,o+a).join(r)];if(l===void 0)return;if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s];var u=n.slice(o+a).join(r);return u?z3(l,u,r):void 0}i=i[n[o]]}return i}}var fee=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),n.data=r||{},n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return Ym(t,Cs),Ba(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var n=this.options.ns.indexOf(r);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,l=[r,n];i&&typeof i!="string"&&(l=l.concat(i)),i&&typeof i=="string"&&(l=l.concat(a?i.split(a):i)),r.indexOf(".")>-1&&(l=r.split("."));var u=Zm(this.data,l);return u||!s||typeof i!="string"?u:z3(this.data&&this.data[r]&&this.data[r][n],i,a)}},{key:"addResource",value:function(r,n,i,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},s=this.options.keySeparator;s===void 0&&(s=".");var l=[r,n];i&&(l=l.concat(s?i.split(s):i)),r.indexOf(".")>-1&&(o=n,n=(l=r.split("."))[1]),this.addNamespaces(n),j3(this.data,l,o),a.silent||this.emit("added",r,n,i,o)}},{key:"addResources",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in i)typeof i[a]!="string"&&Object.prototype.toString.apply(i[a])!=="[object Array]"||this.addResource(r,n,a,i[a],{silent:!0});o.silent||this.emit("added",r,n,i)}},{key:"addResourceBundle",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[r,n];r.indexOf(".")>-1&&(o=i,i=n,n=(l=r.split("."))[1]),this.addNamespaces(n);var u=Zm(this.data,l)||{};o?H3(u,i,a):u=In({},u,i),j3(this.data,l,u),s.silent||this.emit("added",r,n,i)}},{key:"removeResourceBundle",value:function(r,n){this.hasResourceBundle(r,n)&&delete this.data[r][n],this.removeNamespaces(n),this.emit("removed",r,n)}},{key:"hasResourceBundle",value:function(r,n){return this.getResource(r,n)!==void 0}},{key:"getResourceBundle",value:function(r,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?In({},{},this.getResource(r,n)):this.getResource(r,n)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"toJSON",value:function(){return this.data}}]),t}(),W3={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach(function(a){o.processors[a]&&(t=o.processors[a].process(t,r,n,i))}),t}},G3={},V3=function(e){function t(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ma(this,t),n=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(n)),cee(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,lu(n)),n.options=i,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=Fa.create("translator"),n}return Ym(t,Cs),Ba(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var i=this.resolve(r,n);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(r,n){var i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ns||this.options.defaultNS;if(i&&r.indexOf(i)>-1){var s=r.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:r,namespaces:a};var l=r.split(i);(i!==o||i===o&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),r=l.join(o)}return typeof a=="string"&&(a=[a]),{key:r,namespaces:a}}},{key:"translate",value:function(r,n,i){var o=this;if(ws(n)!=="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(r[r.length-1],n),l=s.key,u=s.namespaces,c=u[u.length-1],h=n.lng||this.language,S=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(S){var y=n.nsSeparator||this.options.nsSeparator;return c+y+l}return l}var W=this.resolve(r,n),F=W&&W.res,N=W&&W.usedKey||l,j=W&&W.exactUsedKey||l,D=Object.prototype.toString.apply(F),Q=["[object Number]","[object Function]","[object RegExp]"],te=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,he=!this.i18nFormat||this.i18nFormat.handleAsObject,Ee=typeof F!="string"&&typeof F!="boolean"&&typeof F!="number";if(he&&F&&Ee&&Q.indexOf(D)<0&&(typeof te!="string"||D!=="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,F,In({},n,{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(a){var ve=D==="[object Array]",De=ve?[]:{},Pe=ve?j:N;for(var qe in F)if(Object.prototype.hasOwnProperty.call(F,qe)){var ot="".concat(Pe).concat(a).concat(qe);De[qe]=this.translate(ot,In({},n,{joinArrays:!1,ns:u})),De[qe]===ot&&(De[qe]=F[qe])}F=De}}else if(he&&typeof te=="string"&&D==="[object Array]")(F=F.join(te))&&(F=this.extendTranslation(F,r,n,i));else{var et=!1,gt=!1,dt=n.count!==void 0&&typeof n.count!="string",ht=t.hasDefaultValue(n),pt=dt?this.pluralResolver.getSuffix(h,n.count):"",Dt=n["defaultValue".concat(pt)]||n.defaultValue;!this.isValidLookup(F)&&ht&&(et=!0,F=Dt),this.isValidLookup(F)||(gt=!0,F=l);var Ft=n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Bt=Ft&>?void 0:F,It=ht&&Dt!==F&&this.options.updateMissing;if(gt||et||It){if(this.logger.log(It?"updateKey":"missingKey",h,c,l,It?Dt:F),a){var Re=this.resolve(l,In({},n,{keySeparator:!1}));Re&&Re.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Te=[],Be=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Be&&Be[0])for(var it=0;it1&&arguments[1]!==void 0?arguments[1]:{};return typeof r=="string"&&(r=[r]),r.forEach(function(c){if(!l.isValidLookup(n)){var h=l.extractFromKey(c,u),S=h.key;i=S;var y=h.namespaces;l.options.fallbackNS&&(y=y.concat(l.options.fallbackNS));var W=u.count!==void 0&&typeof u.count!="string",F=u.context!==void 0&&(typeof u.context=="string"||typeof u.context=="number")&&u.context!=="",N=u.lngs?u.lngs:l.languageUtils.toResolveHierarchy(u.lng||l.language,u.fallbackLng);y.forEach(function(j){l.isValidLookup(n)||(s=j,!G3["".concat(N[0],"-").concat(j)]&&l.utils&&l.utils.hasLoadedNamespace&&!l.utils.hasLoadedNamespace(s)&&(G3["".concat(N[0],"-").concat(j)]=!0,l.logger.warn('key "'.concat(i,'" for languages "').concat(N.join(", "),`" won't get resolved as namespace "`).concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(function(D){if(!l.isValidLookup(n)){a=D;var Q,te,he=S,Ee=[he];for(l.i18nFormat&&l.i18nFormat.addLookupKeys?l.i18nFormat.addLookupKeys(Ee,S,D,j,u):(W&&(Q=l.pluralResolver.getSuffix(D,u.count)),W&&F&&Ee.push(he+Q),F&&Ee.push(he+="".concat(l.options.contextSeparator).concat(u.context)),W&&Ee.push(he+=Q));te=Ee.pop();)l.isValidLookup(n)||(o=te,n=l.getResource(D,j,te,u))}}))})}}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}},{key:"isValidLookup",value:function(r){return!(r===void 0||!this.options.returnNull&&r===null||!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,n,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,n,i,o):this.resourceStore.getResource(r,n,i,o)}}],[{key:"hasDefaultValue",value:function(r){var n="defaultValue";for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n===i.substring(0,n.length)&&r[i]!==void 0)return!0;return!1}}]),t}();function eC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pee=function(){function e(t){Ma(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fa.create("languageUtils")}return Ba(e,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");return r.length===2?null:(r.pop(),r[r.length-1].toLowerCase()==="x"?null:this.formatLanguageCode(r.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(i){return i.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=eC(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=eC(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var r,n=this;return t?(t.forEach(function(i){if(!r){var o=n.formatLanguageCode(i);n.options.supportedLngs&&!n.isSupportedCode(o)||(r=o)}}),!r&&this.options.supportedLngs&&t.forEach(function(i){if(!r){var o=n.getLanguagePartFromCode(i);if(n.isSupportedCode(o))return r=o;r=n.options.supportedLngs.find(function(a){if(a.indexOf(o)===0)return a})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];var n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,r){var n=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],t),o=[],a=function(s){s&&(n.isSupportedCode(s)?o.push(s):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(s)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),i.forEach(function(s){o.indexOf(s)<0&&a(n.formatLanguageCode(s))}),o}}]),e}(),gee=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],vee={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}};function mee(){var e={};return gee.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:vee[t.fc]}})}),e}var yee=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ma(this,e),this.languageUtils=t,this.options=r,this.logger=Fa.create("pluralResolver"),this.rules=mee()}return Ba(e,[{key:"addRule",value:function(t,r){this.rules[t]=r}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var r=this.getRule(t);return r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,r){return this.getSuffixes(t).map(function(n){return r+n})}},{key:"getSuffixes",value:function(t){var r=this,n=this.getRule(t);return n?n.numbers.map(function(i){return r.getSuffix(t,i)}):[]}},{key:"getSuffix",value:function(t,r){var n=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(r):i.plurals(Math.abs(r)),a=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),e}(),bee=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(this,e),this.logger=Fa.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ba(e,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var r=t.interpolation;this.escape=r.escape!==void 0?r.escape:hee,this.escapeValue=r.escapeValue===void 0||r.escapeValue,this.useRawValueToEscape=r.useRawValueToEscape!==void 0&&r.useRawValueToEscape,this.prefix=r.prefix?Qc(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Qc(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Qc(r.nestingPrefix):r.nestingPrefixEscaped||Qc("$t("),this.nestingSuffix=r.nestingSuffix?Qc(r.nestingSuffix):r.nestingSuffixEscaped||Qc(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0&&r.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,r,n,i){var o,a,s,l=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(F){return F.replace(/\$/g,"$$$$")}var h=function(F){if(F.indexOf(l.formatSeparator)<0){var N=U3(r,u,F);return l.alwaysFormat?l.format(N,void 0,n,In({},i,r,{interpolationkey:F})):N}var j=F.split(l.formatSeparator),D=j.shift().trim(),Q=j.join(l.formatSeparator).trim();return l.format(U3(r,u,D),Q,n,In({},i,r,{interpolationkey:D}))};this.resetRegExp();var S=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,W=[{regex:this.regexpUnescape,safeValue:function(F){return c(F)}},{regex:this.regexp,safeValue:function(F){return l.escapeValue?c(l.escape(F)):c(F)}}];return W.forEach(function(F){for(s=0;o=F.regex.exec(t);){if((a=h(o[1].trim()))===void 0)if(typeof S=="function"){var N=S(t,o,i);a=typeof N=="string"?N:""}else{if(y){a=o[0];continue}l.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(t)),a=""}else typeof a=="string"||l.useRawValueToEscape||(a=N3(a));var j=F.safeValue(a);if(t=t.replace(o[0],j),y?(F.regex.lastIndex+=j.length,F.regex.lastIndex-=o[0].length):F.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,r){var n,i,o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=In({},a);function l(S,y){var W=this.nestingOptionsSeparator;if(S.indexOf(W)<0)return S;var F=S.split(new RegExp("".concat(W,"[ ]*{"))),N="{".concat(F[1]);S=F[0],N=(N=this.interpolate(N,s)).replace(/'/g,'"');try{s=JSON.parse(N),y&&(s=In({},y,s))}catch(j){return this.logger.warn("failed parsing options string in nesting for key ".concat(S),j),"".concat(S).concat(W).concat(N)}return delete s.defaultValue,S}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(t);){var u=[],c=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map(function(S){return S.trim()});n[1]=h.shift(),u=h,c=!0}if((i=r(l.call(this,n[1].trim(),s),s))&&n[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=N3(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),i=""),c&&(i=u.reduce(function(S,y){return o.format(S,y,a.lng,In({},a,{interpolationkey:n[1].trim()}))},i.trim())),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}]),e}(),Eee=function(e){function t(r,n,i){var o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ma(this,t),o=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(o)),o.backend=r,o.store=n,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=Fa.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return Ym(t,Cs),Ba(t,[{key:"queueLoad",value:function(r,n,i,o){var a=this,s=[],l=[],u=[],c=[];return r.forEach(function(h){var S=!0;n.forEach(function(y){var W="".concat(h,"|").concat(y);!i.reload&&a.store.hasResourceBundle(h,y)?a.state[W]=2:a.state[W]<0||(a.state[W]===1?l.indexOf(W)<0&&l.push(W):(a.state[W]=1,S=!1,l.indexOf(W)<0&&l.push(W),s.indexOf(W)<0&&s.push(W),c.indexOf(y)<0&&c.push(y)))}),S||u.push(h)}),(s.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:o}),{toLoad:s,pending:l,toLoadLanguages:u,toLoadNamespaces:c}}},{key:"loaded",value:function(r,n,i){var o=r.split("|"),a=o[0],s=o[1];n&&this.emit("failedLoading",a,s,n),i&&this.store.addResourceBundle(a,s,i),this.state[r]=n?-1:2;var l={};this.queue.forEach(function(u){!function(c,h,S,y){var W=qw(c,h,Object),F=W.obj,N=W.k;F[N]=F[N]||[],F[N].push(S)}(u.loaded,[a],s),function(c,h){for(var S=c.indexOf(h);S!==-1;)c.splice(S,1),S=c.indexOf(h)}(u.pending,r),n&&u.errors.push(n),u.pending.length!==0||u.done||(Object.keys(u.loaded).forEach(function(c){l[c]||(l[c]=[]),u.loaded[c].length&&u.loaded[c].forEach(function(h){l[c].indexOf(h)<0&&l[c].push(h)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(function(u){return!u.done})}},{key:"read",value:function(r,n,i){var o=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,l=arguments.length>5?arguments[5]:void 0;return r.length?this.backend[i](r,n,function(u,c){u&&c&&a<5?setTimeout(function(){o.read.call(o,r,n,i,a+1,2*s,l)},s):l(u,c)}):l(null,{})}},{key:"prepareLoading",value:function(r,n){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof n=="string"&&(n=[n]);var s=this.queueLoad(r,n,o,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(function(l){i.loadOne(l)})}},{key:"load",value:function(r,n,i){this.prepareLoading(r,n,{},i)}},{key:"reload",value:function(r,n,i){this.prepareLoading(r,n,{reload:!0},i)}},{key:"loadOne",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=r.split("|"),a=o[0],s=o[1];this.read(a,s,"read",void 0,void 0,function(l,u){l&&n.logger.warn("".concat(i,"loading namespace ").concat(s," for language ").concat(a," failed"),l),!l&&u&&n.logger.log("".concat(i,"loaded namespace ").concat(s," for language ").concat(a),u),n.loaded(r,l,u)})}},{key:"saveMissing",value:function(r,n,i,o,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):i!=null&&i!==""&&(this.backend&&this.backend.create&&this.backend.create(r,n,i,o,null,In({},s,{isUpdate:a})),r&&r[0]&&this.store.addResource(r[0],n,i,o))}}]),t}();function xee(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(ws(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),ws(e[2])==="object"||ws(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(n){t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function K3(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qm(){}var See=function(e){function t(){var r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Ma(this,t),r=_f(this,Jc(t).call(this)),Jm&&Cs.call(lu(r)),r.options=K3(n),r.services={},r.logger=Fa,r.modules={external:[]},i&&!r.isInitialized&&!n.isClone){if(!r.options.initImmediate)return r.init(n,i),_f(r,lu(r));setTimeout(function(){r.init(n,i)},0)}return r}return Ym(t,Cs),Ba(t,[{key:"init",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function o(y){return y?typeof y=="function"?new y:y:null}if(typeof n=="function"&&(i=n,n={}),n.whitelist&&!n.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),n.nonExplicitWhitelist&&!n.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=In({},xee(),this.options,K3(n)),this.format=this.options.interpolation.format,i||(i=Qm),!this.options.isClone){this.modules.logger?Fa.init(o(this.modules.logger),this.options):Fa.init(null,this.options);var a=new pee(this.options);this.store=new fee(this.options.resources,this.options);var s=this.services;s.logger=Fa,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new yee(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new bee(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Eee(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(y){for(var W=arguments.length,F=new Array(W>1?W-1:0),N=1;N1?W-1:0),N=1;N0&&l[0]!=="dev"&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach(function(y){r[y]=function(){var W;return(W=r.store)[y].apply(W,arguments)}});var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach(function(y){r[y]=function(){var W;return(W=r.store)[y].apply(W,arguments),r}});var h=Rf(),S=function(){var y=function(W,F){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),h.resolve(F),i(W,F)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return y(null,r.t.bind(r));r.changeLanguage(r.options.lng,y)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),h}},{key:"loadResources",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=i,a=typeof r=="string"?r:this.language;if(typeof r=="function"&&(o=r),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return o();var s=[],l=function(c){c&&n.services.languageUtils.toResolveHierarchy(c).forEach(function(h){s.indexOf(h)<0&&s.push(h)})};if(a)l(a);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach(function(c){return l(c)})}this.options.preload&&this.options.preload.forEach(function(c){return l(c)}),this.services.backendConnector.load(s,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(r,n,i){var o=Rf();return r||(r=this.languages),n||(n=this.options.ns),i||(i=Qm),this.services.backendConnector.reload(r,n,function(a){o.resolve(),i(a)}),o}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&W3.addPostProcessor(r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"changeLanguage",value:function(r,n){var i=this;this.isLanguageChangingTo=r;var o=Rf();this.emit("languageChanging",r);var a=function(s){r||s||!i.services.languageDetector||(s=[]);var l=typeof s=="string"?s:i.services.languageUtils.getBestMatchFromCodes(s);l&&(i.language||(i.language=l,i.languages=i.services.languageUtils.toResolveHierarchy(l)),i.translator.language||i.translator.changeLanguage(l),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(l)),i.loadResources(l,function(u){!function(c,h){h?(i.language=h,i.languages=i.services.languageUtils.toResolveHierarchy(h),i.translator.changeLanguage(h),i.isLanguageChangingTo=void 0,i.emit("languageChanged",h),i.logger.log("languageChanged",h)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),n&&n(c,function(){return i.t.apply(i,arguments)})}(u,l)})};return r||!this.services.languageDetector||this.services.languageDetector.async?!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(r):a(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(r,n,i){var o=this,a=function s(l,u){var c;if(ws(u)!=="object"){for(var h=arguments.length,S=new Array(h>2?h-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],a=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var l=function(c,h){var S=n.services.backendConnector.state["".concat(c,"|").concat(h)];return S===-1||S===2};if(i.precheck){var u=i.precheck(this,l);if(u!==void 0)return u}return!!this.hasResourceBundle(o,r)||!this.services.backendConnector.backend||!(!l(o,r)||a&&!l(s,r))}},{key:"loadNamespaces",value:function(r,n){var i=this,o=Rf();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(a){i.options.ns.indexOf(a)<0&&i.options.ns.push(a)}),this.loadResources(function(a){o.resolve(),n&&n(a)}),o):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(r,n){var i=Rf();typeof r=="string"&&(r=[r]);var o=this.options.preload||[],a=r.filter(function(s){return o.indexOf(s)<0});return a.length?(this.options.preload=o.concat(a),this.loadResources(function(s){i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(r){return r||(r=this.languages&&this.languages.length>0?this.languages[0]:this.language),r?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(r))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(r,n)}},{key:"cloneInstance",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qm,o=In({},this.options,n,{isClone:!0}),a=new t(o),s=["store","services","language"];return s.forEach(function(l){a[l]=r[l]}),a.services=In({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new V3(a.services,a.options),a.translator.on("*",function(l){for(var u=arguments.length,c=new Array(u>1?u-1:0),h=1;hD;D++)if((s||D in F)&&(y=N(S=F[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:J3(te,S)}else switch(e){case 4:return!1;case 7:J3(te,S)}return o?-1:n||i?i:te}},Ree={forEach:Ts(0),map:Ts(1),filter:Ts(2),some:Ts(3),every:Ts(4),find:Ts(5),findIndex:Ts(6),filterReject:Ts(7)}.forEach,kee=function(e,t){var r=[][e];return!!r&&Xn(function(){r.call(null,t||function(){throw 1},1)})}("forEach"),rC=kee?[].forEach:function(e){return Ree(this,e,arguments.length>1?arguments[1]:void 0)},Q3=function(e){if(e&&e.forEach!==rC)try{Si(e,"forEach",rC)}catch(t){e.forEach=rC}};for(var nC in xv)xv[nC]&&Q3(nr[nC]&&nr[nC].prototype);Q3(Uk),Ri("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"}}),Ri("zh-CN",{common:{ok:"\u786E\u5B9A",delete:"\u5220\u9664",enter:"\u56DE\u8F66"},blockQuote:{title:"\u5F15\u7528"},codeBlock:{title:"\u4EE3\u7801\u5757"},color:{color:"\u6587\u5B57\u989C\u8272",bgColor:"\u80CC\u666F\u8272",default:"\u9ED8\u8BA4\u989C\u8272",clear:"\u6E05\u9664\u80CC\u666F\u8272"},divider:{title:"\u5206\u5272\u7EBF"},emotion:{title:"\u8868\u60C5"},fontSize:{title:"\u5B57\u53F7",default:"\u9ED8\u8BA4\u5B57\u53F7"},fontFamily:{title:"\u5B57\u4F53",default:"\u9ED8\u8BA4\u5B57\u4F53"},fullScreen:{title:"\u5168\u5C4F"},header:{title:"\u6807\u9898",text:"\u6B63\u6587"},image:{netImage:"\u7F51\u7EDC\u56FE\u7247",delete:"\u5220\u9664\u56FE\u7247",edit:"\u7F16\u8F91\u56FE\u7247",viewLink:"\u67E5\u770B\u94FE\u63A5",src:"\u56FE\u7247\u5730\u5740",desc:"\u56FE\u7247\u63CF\u8FF0",link:"\u56FE\u7247\u94FE\u63A5"},indent:{decrease:"\u51CF\u5C11\u7F29\u8FDB",increase:"\u589E\u52A0\u7F29\u8FDB"},justify:{left:"\u5DE6\u5BF9\u9F50",right:"\u53F3\u5BF9\u9F50",center:"\u5C45\u4E2D\u5BF9\u9F50",justify:"\u4E24\u7AEF\u5BF9\u9F50"},lineHeight:{title:"\u884C\u9AD8",default:"\u9ED8\u8BA4\u884C\u9AD8"},link:{insert:"\u63D2\u5165\u94FE\u63A5",text:"\u94FE\u63A5\u6587\u672C",url:"\u94FE\u63A5\u5730\u5740",unLink:"\u53D6\u6D88\u94FE\u63A5",edit:"\u4FEE\u6539\u94FE\u63A5",view:"\u67E5\u770B\u94FE\u63A5"},textStyle:{bold:"\u7C97\u4F53",clear:"\u6E05\u9664\u683C\u5F0F",code:"\u884C\u5185\u4EE3\u7801",italic:"\u659C\u4F53",sub:"\u4E0B\u6807",sup:"\u4E0A\u6807",through:"\u5220\u9664\u7EBF",underline:"\u4E0B\u5212\u7EBF"},undo:{undo:"\u64A4\u9500",redo:"\u91CD\u505A"},todo:{todo:"\u5F85\u529E"}});var Lee={type:"paragraph",renderElem:function(e,t,r){return er("p",null,t)}},qm=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function e0(e){var t={exports:{}};return e(t,t.exports),t.exports}var As,t0,r0=function(e){return e&&e.Math==Math&&e},sr=r0(typeof globalThis=="object"&&globalThis)||r0(typeof window=="object"&&window)||r0(typeof self=="object"&&self)||r0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),un=function(e){try{return!!e()}catch(t){return!0}},Io=!un(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Lf=Function.prototype.call,vn=Lf.bind?Lf.bind(Lf):function(){return Lf.apply(Lf,arguments)},q3={}.propertyIsEnumerable,eB=Object.getOwnPropertyDescriptor,Pee=eB&&!q3.call({1:2},1)?function(e){var t=eB(this,e);return!!t&&t.enumerable}:q3,tB={f:Pee},iC=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},rB=Function.prototype,oC=rB.bind,aC=rB.call,Iee=oC&&oC.bind(aC),Qt=oC?function(e){return e&&Iee(aC,e)}:function(e){return e&&function(){return aC.apply(e,arguments)}},Mee=Qt({}.toString),Bee=Qt("".slice),Ds=function(e){return Bee(Mee(e),8,-1)},sC=sr.Object,Fee=Qt("".split),n0=un(function(){return!sC("z").propertyIsEnumerable(0)})?function(e){return Ds(e)=="String"?Fee(e,""):sC(e)}:sC,Nee=sr.TypeError,fo=function(e){if(e==null)throw Nee("Can't call method on "+e);return e},ed=function(e){return n0(fo(e))},ii=function(e){return typeof e=="function"},po=function(e){return typeof e=="object"?e!==null:ii(e)},jee=function(e){return ii(e)?e:void 0},Pf=function(e,t){return arguments.length<2?jee(sr[e]):sr[e]&&sr[e][t]},nB=Qt({}.isPrototypeOf),lC=Pf("navigator","userAgent")||"",iB=sr.process,oB=sr.Deno,aB=iB&&iB.versions||oB&&oB.version,sB=aB&&aB.v8;sB&&(t0=(As=sB.split("."))[0]>0&&As[0]<4?1:+(As[0]+As[1])),!t0&&lC&&(!(As=lC.match(/Edge\/(\d+)/))||As[1]>=74)&&(As=lC.match(/Chrome\/(\d+)/))&&(t0=+As[1]);var uC=t0,cC=!!Object.getOwnPropertySymbols&&!un(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&uC&&uC<41}),dC=cC&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Uee=sr.Object,hC=dC?function(e){return typeof e=="symbol"}:function(e){var t=Pf("Symbol");return ii(t)&&nB(t.prototype,Uee(e))},Hee=sr.String,lB=function(e){try{return Hee(e)}catch(t){return"Object"}},zee=sr.TypeError,uB=function(e){if(ii(e))return e;throw zee(lB(e)+" is not a function")},i0=function(e,t){var r=e[t];return r==null?void 0:uB(r)},Wee=sr.TypeError,Gee=Object.defineProperty,fC=function(e,t){try{Gee(sr,e,{value:t,configurable:!0,writable:!0})}catch(r){sr[e]=t}return t},Os=sr["__core-js_shared__"]||fC("__core-js_shared__",{}),pC=e0(function(e){(e.exports=function(t,r){return Os[t]||(Os[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Vee=sr.Object,If=function(e){return Vee(fo(e))},Kee=Qt({}.hasOwnProperty),go=Object.hasOwn||function(e,t){return Kee(If(e),t)},$ee=0,Xee=Math.random(),Yee=Qt(1 .toString),cB=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Yee(++$ee+Xee,36)},Mf=pC("wks"),uu=sr.Symbol,dB=uu&&uu.for,Zee=dC?uu:uu&&uu.withoutSetter||cB,Vi=function(e){if(!go(Mf,e)||!cC&&typeof Mf[e]!="string"){var t="Symbol."+e;cC&&go(uu,e)?Mf[e]=uu[e]:Mf[e]=dC&&dB?dB(t):Zee(t)}return Mf[e]},Jee=sr.TypeError,Qee=Vi("toPrimitive"),gC=function(e){var t=function(r,n){if(!po(r)||hC(r))return r;var i,o=i0(r,Qee);if(o){if(n===void 0&&(n="default"),i=vn(o,r,n),!po(i)||hC(i))return i;throw Jee("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;if(ii(l=a.valueOf)&&!po(u=vn(l,a)))return u;if(s!=="string"&&ii(l=a.toString)&&!po(u=vn(l,a)))return u;throw Wee("Can't convert object to primitive value")}(r,n)}(e,"string");return hC(t)?t:t+""},vC=sr.document,qee=po(vC)&&po(vC.createElement),mC=function(e){return qee?vC.createElement(e):{}},hB=!Io&&!un(function(){return Object.defineProperty(mC("div"),"a",{get:function(){return 7}}).a!=7}),fB=Object.getOwnPropertyDescriptor,yC={f:Io?fB:function(e,t){if(e=ed(e),t=gC(t),hB)try{return fB(e,t)}catch(r){}if(go(e,t))return iC(!vn(tB.f,e,t),e[t])}},ete=sr.String,tte=sr.TypeError,Ki=function(e){if(po(e))return e;throw tte(ete(e)+" is not an object")},rte=sr.TypeError,pB=Object.defineProperty,td={f:Io?pB:function(e,t,r){if(Ki(e),t=gC(t),Ki(r),hB)try{return pB(e,t,r)}catch(n){}if("get"in r||"set"in r)throw rte("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},rd=Io?function(e,t,r){return td.f(e,t,iC(1,r))}:function(e,t,r){return e[t]=r,e},nte=Qt(Function.toString);ii(Os.inspectSource)||(Os.inspectSource=function(e){return nte(e)});var o0,Bf,a0,bC=Os.inspectSource,gB=sr.WeakMap,ite=ii(gB)&&/native code/.test(bC(gB)),vB=pC("keys"),mB=function(e){return vB[e]||(vB[e]=cB(e))},EC={},xC=sr.TypeError,ote=sr.WeakMap;if(ite||Os.state){var cu=Os.state||(Os.state=new ote),ate=Qt(cu.get),yB=Qt(cu.has),ste=Qt(cu.set);o0=function(e,t){if(yB(cu,e))throw new xC("Object already initialized");return t.facade=e,ste(cu,e,t),t},Bf=function(e){return ate(cu,e)||{}},a0=function(e){return yB(cu,e)}}else{var nd=mB("state");EC[nd]=!0,o0=function(e,t){if(go(e,nd))throw new xC("Object already initialized");return t.facade=e,rd(e,nd,t),t},Bf=function(e){return go(e,nd)?e[nd]:{}},a0=function(e){return go(e,nd)}}var SC={set:o0,get:Bf,has:a0,enforce:function(e){return a0(e)?Bf(e):o0(e,{})},getterFor:function(e){return function(t){var r;if(!po(t)||(r=Bf(t)).type!==e)throw xC("Incompatible receiver, "+e+" required");return r}}},bB=Function.prototype,lte=Io&&Object.getOwnPropertyDescriptor,wC=go(bB,"name"),s0={EXISTS:wC,PROPER:wC&&function(){}.name==="something",CONFIGURABLE:wC&&(!Io||Io&<e(bB,"name").configurable)},Ff=e0(function(e){var t=s0.CONFIGURABLE,r=SC.get,n=SC.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;ii(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!go(s,"name")||t&&s.name!==y)&&rd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==sr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:rd(o,a,s)):h?o[a]=s:fC(a,s)})(Function.prototype,"toString",function(){return ii(this)&&r(this).source||bC(this)})}),ute=Math.ceil,cte=Math.floor,id=function(e){var t=+e;return t!=t||t===0?0:(t>0?cte:ute)(t)},dte=Math.max,hte=Math.min,Nf=function(e,t){var r=id(e);return r<0?dte(r+t,0):hte(r,t)},fte=Math.min,jf=function(e){return e>0?fte(id(e),9007199254740991):0},l0=function(e){return jf(e.length)},EB=function(e){return function(t,r,n){var i,o=ed(t),a=l0(o),s=Nf(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xB={includes:EB(!0),indexOf:EB(!1)},pte=xB.indexOf,SB=Qt([].push),wB=function(e,t){var r,n=ed(e),i=0,o=[];for(r in n)!go(EC,r)&&go(n,r)&&SB(o,r);for(;t.length>i;)go(n,r=t[i++])&&(~pte(o,r)||SB(o,r));return o},u0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gte=u0.concat("length","prototype"),vte={f:Object.getOwnPropertyNames||function(e){return wB(e,gte)}},CB={f:Object.getOwnPropertySymbols},mte=Qt([].concat),yte=Pf("Reflect","ownKeys")||function(e){var t=vte.f(Ki(e)),r=CB.f;return r?mte(t,r(e)):t},bte=function(e,t){for(var r=yte(t),n=td.f,i=yC.f,o=0;oD;D++)if((s||D in F)&&(y=N(S=F[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:RB(te,S)}else switch(e){case 4:return!1;case 7:RB(te,S)}return o?-1:n||i?i:te}},d0={forEach:_s(0),map:_s(1),filter:_s(2),some:_s(3),every:_s(4),find:_s(5),findIndex:_s(6),filterReject:_s(7)},Mte=Vi("species"),OC=function(e){return uC>=51||!un(function(){var t=[];return(t.constructor={})[Mte]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Bte=d0.filter;Hn({target:"Array",proto:!0,forced:!OC("filter")},{filter:function(e){return Bte(this,e,arguments.length>1?arguments[1]:void 0)}});var Fte=CC?{}.toString:function(){return"[object "+TC(this)+"]"};CC||Ff(Object.prototype,"toString",Fte,{unsafe:!0});var h0,Nte=sr.String,cn=function(e){if(TC(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Nte(e)},kB=function(){var e=Ki(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},_C=sr.RegExp,RC=un(function(){var e=_C("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),jte=RC||un(function(){return!_C("a","y").sticky}),LB={BROKEN_CARET:RC||un(function(){var e=_C("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:jte,UNSUPPORTED_Y:RC},od=Object.keys||function(e){return wB(e,u0)},Ute=Io?Object.defineProperties:function(e,t){Ki(e);for(var r,n=ed(t),i=od(t),o=i.length,a=0;o>a;)td.f(e,r=i[a++],n[r]);return e},Hte=Pf("document","documentElement"),PB=mB("IE_PROTO"),kC=function(){},IB=function(e){return""},MB=function(e){e.write(IB("")),e.close();var t=e.parentWindow.Object;return e=null,t},f0=function(){try{h0=new ActiveXObject("htmlfile")}catch(n){}var e,t;f0=typeof document!="undefined"?document.domain&&h0?MB(h0):((t=mC("iframe")).style.display="none",Hte.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(IB("document.F=Object")),e.close(),e.F):MB(h0);for(var r=u0.length;r--;)delete f0.prototype[u0[r]];return f0()};EC[PB]=!0;var BB,LC,FB=Object.create||function(e,t){var r;return e!==null?(kC.prototype=Ki(e),r=new kC,kC.prototype=null,r[PB]=e):r=f0(),t===void 0?r:Ute(r,t)},zte=sr.RegExp,Wte=un(function(){var e=zte(".","s");return!(e.dotAll&&e.exec(` +`)&&e.flags==="s")}),Gte=sr.RegExp,Vte=un(function(){var e=Gte("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),Kte=SC.get,$te=pC("native-string-replace",String.prototype.replace),p0=RegExp.prototype.exec,PC=p0,Xte=Qt("".charAt),Yte=Qt("".indexOf),Zte=Qt("".replace),IC=Qt("".slice),MC=(LC=/b*/g,vn(p0,BB=/a/,"a"),vn(p0,LC,"a"),BB.lastIndex!==0||LC.lastIndex!==0),NB=LB.BROKEN_CARET,BC=/()??/.exec("")[1]!==void 0;(MC||BC||NB||Wte||Vte)&&(PC=function(e){var t,r,n,i,o,a,s,l=this,u=Kte(l),c=cn(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=vn(PC,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=NB&&l.sticky,W=vn(kB,l),F=l.source,N=0,j=c;if(y&&(W=Zte(W,"y",""),Yte(W,"g")===-1&&(W+="g"),j=IC(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Xte(c,l.lastIndex-1)!==` +`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",W)),BC&&(r=new RegExp("^"+F+"$(?!\\s)",W)),MC&&(n=l.lastIndex),i=vn(p0,y?r:l,j),y?i?(i.input=IC(i.input,N),i[0]=IC(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:MC&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),BC&&i&&i.length>1&&vn($te,i[0],r,function(){for(o=1;o=s?e?"":void 0:(n=zB(o,a))<55296||n>56319||a+1===s||(i=zB(o,a+1))<56320||i>57343?e?qte(o,a):n:e?ere(o,a,a+2):i-56320+(n-55296<<10)+65536}},tre=(WB(!1),WB(!0)),UC=function(e,t,r){return t+(r?tre(e,t).length:1)},rre=Math.floor,HC=Qt("".charAt),nre=Qt("".replace),zC=Qt("".slice),ire=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ore=/\$([$&'`]|\d{1,2})/g,are=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=ore;return i!==void 0&&(i=If(i),l=ire),nre(o,l,function(u,c){var h;switch(HC(c,0)){case"$":return"$";case"&":return e;case"`":return zC(t,0,r);case"'":return zC(t,a);case"<":h=i[zC(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=rre(S/10);return y===0?u:y<=s?n[y-1]===void 0?HC(c,1):n[y-1]+HC(c,1):u}h=n[S-1]}return h===void 0?"":h})},sre=sr.TypeError,Wf=function(e,t){var r=e.exec;if(ii(r)){var n=vn(r,e,t);return n!==null&&Ki(n),n}if(Ds(e)==="RegExp")return vn(zf,e,t);throw sre("RegExp#exec called on incompatible receiver")},WC=Vi("replace"),lre=Math.max,ure=Math.min,cre=Qt([].concat),GC=Qt([].push),GB=Qt("".indexOf),VB=Qt("".slice),dre="a".replace(/./,"$0")==="$0",KB=!!/./[WC]&&/./[WC]("a","$0")==="";jC("replace",function(e,t,r){var n=KB?"$":"$0";return[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,WC);return s?vn(s,i,a,o):vn(t,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i);if(typeof o=="string"&&GB(o,n)===-1&&GB(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=ii(o);u||(o=cn(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=Wf(a,s);if(y===null)break;if(GC(S,y),!c)break;cn(y[0])===""&&(a.lastIndex=UC(s,jf(a.lastIndex),h))}for(var W,F="",N=0,j=0;j=N&&(F+=VB(s,N,Q)+De,N=Q+D.length)}return F+VB(s,N)}]},!!un(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"})||!dre||KB);var VC=Vi("unscopables"),KC=Array.prototype;KC[VC]==null&&td.f(KC,VC,{configurable:!0,value:FB(null)});var $B=function(e){KC[VC][e]=!0},hre=d0.find,XB=!0;"find"in[]&&Array(1).find(function(){XB=!1}),Hn({target:"Array",proto:!0,forced:XB},{find:function(e){return hre(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("find");var fre=Vi("match"),YB=function(e){var t;return po(e)&&((t=e[fre])!==void 0?!!t:Ds(e)=="RegExp")},pre=sr.TypeError,gre=Vi("species"),ZB=function(e,t,r){var n=gC(t);n in e?td.f(e,n,iC(0,r)):e[n]=r},vre=sr.Array,mre=Math.max,JB=function(e,t,r){for(var n=l0(e),i=Nf(t,n),o=Nf(r===void 0?n:r,n),a=vre(mre(o-i,0)),s=0;i1||"".split(/.?/).length?function(i,o){var a=cn(fo(this)),s=o===void 0?4294967295:o>>>0;if(s===0)return[];if(i===void 0)return[a];if(!YB(i))return vn(t,a,i,s);for(var l,u,c,h=[],S=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),y=0,W=new RegExp(i.source,S+"g");(l=vn(zf,W,a))&&!((u=W.lastIndex)>y&&(sd(h,Gf(a,y,l.index)),l.length>1&&l.index=s));)W.lastIndex===l.index&&W.lastIndex++;return y===a.length?!c&&bre(W,"")||sd(h,""):sd(h,Gf(a,y)),h.length>s?JB(h,0,s):h}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:vn(t,this,i,o)}:t,[function(i,o){var a=fo(this),s=i==null?void 0:i0(i,e);return s?vn(s,i,a,o):vn(n,cn(a),i,o)},function(i,o){var a=Ki(this),s=cn(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=function(te,he){var Ee,ve=Ki(te).constructor;return ve===void 0||(Ee=Ki(ve)[gre])==null?he:function(De){if(DC(De))return De;throw pre(lB(De)+" is not a constructor")}(Ee)}(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ad?"g":"y"),S=new u(ad?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return Wf(S,s)===null?[s]:[];for(var W=0,F=0,N=[];F"+e+"").children().filter(function(t){return t.tagName!=="BR"}).length===0}function ld(e){return e.length===0?"":e[0].outerHTML}function ud(e){return e.length?e[0].tagName.toLowerCase():""}function Mo(e,t){for(var r="",n=(e.attr("style")||"").split(";"),i=n.length,o=0;o `+s+` - `);return i.prepend(l),i[0]},e}(),Pne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.color"),r.iconSvg=Fre,r.mark="color",r}return nn(t,e),t}(b5),Ine=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.bgColor"),r.iconSvg=Nre,r.mark="bgColor",r}return nn(t,e),t}(b5),E5=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"],Mne={renderStyle:function(e,t){var r=e,n=r.color,i=r.bgColor,o=t;return n&&fu(o,{color:n}),i&&fu(o,{backgroundColor:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.color,o=n.bgColor;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e(""+t+"")),i&&r.css("color",i),o&&r.css("background-color",o),ld(r)):t},preParseHtml:[Lne],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=Mo(n,"color");o&&(i.color=o);var a=Mo(n,"background-color");return a||(a=Mo(n,"background")),a&&(i.bgColor=a),i},menus:[{key:"color",factory:function(){return new Pne},config:{colors:E5}},{key:"bgColor",factory:function(){return new Ine},config:{colors:E5}}]},Bne=/^(?:\w+:)?\/\/(\S+)$/,Fne=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Nne=/^[^\s\.]+\.\S{2,}$/,jne=xB.includes;function v0(e){return e===void 0&&(e="r"),e+"-"+SP()}function nT(e){return e.replace(//g,">")}function x5(e,t,r,n){return ks(this,void 0,void 0,function(){var i,o;return Ls(this,function(a){switch(a.label){case 0:return(i=t.getMenuConfig(e).checkLink)?[4,i(r,n)]:[3,2];case 1:if(typeof(o=a.sent())=="string")return t.alert(o,"error"),[2,!1];if(o==null)return[2,!1];a.label=2;case 2:return[2,!0]}})})}function S5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseLinkUrl)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function iT(e){return e.selection==null||!!Ae.getSelectedElems(e).some(function(t){var r=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(r)||void 0})}function oT(e,t){return{type:"link",url:nT(e),children:t?[{text:t}]:[]}}function w5(e,t,r){return ks(this,void 0,void 0,function(){var n,i,o;return Ls(this,function(a){switch(a.label){case 0:return r?(t||(t=r),e.restoreSelection(),iT(e)?[2]:[4,x5("insertLink",e,t,r)]):[2];case 1:return a.sent()?[4,S5("insertLink",e,r)]:[2];case 2:return n=a.sent(),(i=e.selection)==null||(Qe.isCollapsed(i)?(e.insertText(" "),o=oT(n,t),Ve.insertNodes(e,o),e.insertFragment([{text:" "}])):de.string(e,i)!==t?(e.deleteFragment(),o=oT(n,t),Ve.insertNodes(e,o)):(o=oT(n),Ve.wrapNodes(e,o,{split:!0}),Ve.collapse(e,{edge:"end"}))),[2]}})})}Hn({target:"Array",proto:!0},{includes:function(e){return jne(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("includes");var Une={type:"link",renderElem:function(e,t,r){var n=e,i=n.url,o=n.target;return er("a",{href:i,target:o===void 0?"_blank":o},t)}},Hne={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"link",url:n.attr("href")||"",target:n.attr("target")||"",children:t}}};function aT(){return v0("w-e-insert-link")}var zne=function(){function e(){this.title=wt("link.insert"),this.iconSvg='',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=aT(),this.urlInputId=aT(),this.buttonId=aT()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return iT(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=t.selection,n=this,i=n.textInputId,o=n.urlInputId,a=n.buttonId,s=Dr(Wi(wt("link.text"),i),2),l=s[0],u=_e(s[1]),c=Dr(Wi(wt("link.url"),o),2),h=c[0],S=_e(c[1]),y=Dr(Zc(a,wt("common.ok")),1)[0];if(this.$content==null){var z=_e("
      ");z.on("click","#"+a,function(j){j.preventDefault();var D=z.find("#"+i).val(),Q=z.find("#"+o).val();w5(t,D,Q),t.hidePanelOrModal()}),this.$content=z}var F=this.$content;if(F.empty(),F.append(l),F.append(h),F.append(y),r==null||Qe.isCollapsed(r))u.val("");else{var N=de.string(t,r);u.val(N)}return S.val(""),setTimeout(function(){u.focus()}),F[0]},e}();function C5(){return v0("w-e-update-link")}var Wne=function(){function e(){this.title=wt("link.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=C5(),this.buttonId=C5()}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.getModalPositionNode=function(t){return Ae.getSelectedNodeByType(t,"link")},e.prototype.getModalContentElem=function(t){var r=this.urlInputId,n=this.buttonId,i=Dr(Wi(wt("link.url"),r),2),o=i[0],a=_e(i[1]),s=Dr(Zc(n,wt("common.ok")),1)[0];if(this.$content==null){var l=_e("
      ");l.on("click","button",function(h){h.preventDefault(),t.restoreSelection();var S=Ae.getSelectedNodeByType(t,"link"),y=S?St.string(S):"",z=l.find("#"+r).val();!function(F,N,j){ks(this,void 0,void 0,function(){var D,Q;return Ls(this,function(te){switch(te.label){case 0:return j?[4,x5("editLink",F,N,j)]:[2];case 1:return te.sent()?[4,S5("editLink",F,j)]:[2];case 2:return D=te.sent(),Q={url:nT(D)},Ve.setNodes(F,Q,{match:function(he){return Ae.checkNodeType(he,"link")}}),[2]}})})}(t,y,z),t.hidePanelOrModal()}),this.$content=l}var u=this.$content;u.empty(),u.append(o),u.append(s);var c=this.getValue(t);return a.val(c),setTimeout(function(){a.focus()}),u[0]},e}(),Gne=function(){function e(){this.title=wt("link.unLink"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"link")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.unwrapNodes(t,{match:function(n){return Ae.checkNodeType(n,"link")}})},e}(),Vne=function(){function e(){this.title=wt("link.view"),this.iconSvg=l5,this.tag="button"}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View link failed, link url is '"+r+"'");window.open(r,"_blank")}},e}(),T5={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Kne={renderElems:[Une],elemsToHtml:[{type:"link",elemToHtml:function(e,t){var r=e,n=r.url,i=r.target;return'
      '+t+""}}],parseElemsHtml:[Hne],menus:[{key:"insertLink",factory:function(){return new zne},config:T5},{key:"editLink",factory:function(){return new Wne},config:T5},{key:"unLink",factory:function(){return new Gne}},{key:"viewLink",factory:function(){return new Vne}}],editorPlugin:function(e){var t=e.isInline,r=e.insertData,n=e.normalizeNode;e.insertNode,e.insertText;var i=e;return i.isInline=function(o){return o.type==="link"||t(o)},i.insertData=function(o){var a=o.getData("text/plain");if(function(u){if(typeof u!="string")return!1;var c=u.match(Bne);if(!c)return!1;var h=c[1];return!(!h||!Fne.test(h)&&!Nne.test(h))}(a)){if(!iT(i)){var s=i.selection;if(s!=null){var l=de.string(i,s);w5(i,l,a)}}}else r(o)},i.normalizeNode=function(o){var a=Dr(o,2),s=a[0],l=a[1];return Ae.getNodeType(s)!=="link"?n([s,l]):St.string(s)===""?Ve.removeNodes(i,{at:l}):n([s,l])},i}},$ne=Qt(1 .valueOf),Xne=sr.RangeError,Yne=sr.RangeError,A5=sr.String,D5=Math.floor,sT=Qt(function(e){var t=cn(fo(this)),r="",n=id(e);if(n<0||n==1/0)throw Xne("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r}),O5=Qt("".slice),Jf=Qt(1 .toFixed),dd=function(e,t,r){return t===0?r:t%2==1?dd(e,t-1,r*e):dd(e*e,t/2,r)},hd=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=D5(i/1e7)},lT=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=D5(n/t),n=n%t*1e7},_5=function(e){for(var t=6,r="";--t>=0;)if(r!==""||t===0||e[t]!==0){var n=A5(e[t]);r=r===""?n:r+sT("0",7-n.length)+n}return r};function R5(e,t){return"w-e-image-container-"+Ae.findKey(e,t).id}Hn({target:"Number",proto:!0,forced:un(function(){return Jf(8e-5,3)!=="0.000"||Jf(.9,0)!=="1"||Jf(1.255,2)!=="1.25"||Jf(1000000000000000100,0)!=="1000000000000000128"})||!un(function(){Jf({})})},{toFixed:function(e){var t,r,n,i,o=$ne(this),a=id(e),s=[0,0,0,0,0,0],l="",u="0";if(a<0||a>20)throw Yne("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return A5(o);if(o<0&&(l="-",o=-o),o>1e-21)if(r=(t=function(c){for(var h=0,S=c;S>=4096;)h+=12,S/=4096;for(;S>=2;)h+=1,S/=2;return h}(o*dd(2,69,1))-69)<0?o*dd(2,-t,1):o/dd(2,t,1),r*=4503599627370496,(t=52-t)>0){for(hd(s,0,r),n=a;n>=7;)hd(s,1e7,0),n-=7;for(hd(s,dd(10,n,1),0),n=t-1;n>=23;)lT(s,1<<23),n-=23;lT(s,1<0?l+((i=u.length)<=a?"0."+sT("0",a-i)+u:O5(u,0,i-a)+"."+O5(u,i-a)):l+u}});var Zne={type:"image",renderElem:function(e,t,r){var n=e,i=n.src,o=n.alt,a=o===void 0?"":o,s=n.href,l=s===void 0?"":s,u=n.style,c=u===void 0?{}:u,h=c.width,S=h===void 0?"":h,y=c.height,z=y===void 0?"":y,F=Ae.isNodeSelected(r,e),N={};S&&(N.width="100%"),z&&(N.height="100%");var j=er("img",{style:N,src:i,alt:a,"data-href":l}),D=r.isDisabled();return F&&!D?function(Q,te,he,Ee){var ve=_e("body"),De=R5(Q,te),Pe=Ee.width,qe=Ee.height,ot=0,et=0,gt=0,dt=!1,ht=null;function pt(It){ht=function(){var Be=_e("#"+De);if(Be.length===0)throw new Error("Cannot find image container elem");return Be}(),ot=It;var Re=ht.find("img");if(Re.length===0)throw new Error("Cannot find image elem");et=Re.width(),gt=Re.height(),ve.on("mousemove",Dt),ve.on("mouseup",Ft);var Te=Ae.getHoverbar(Q);Te&&Te.hideAndClean()}var Dt=Hl(function(It){It.preventDefault();var Re=It.clientX,Te=et+(dt?ot-Re:Re-ot),Be=gt*(Te/et);ht!=null&&(Te<=15||Be<=15||(ht.css("width",Te+"px"),ht.css("height",Be+"px")))},100);function Ft(It){if(ve.off("mousemove",Dt),ht!=null){var Re=ht.width().toFixed(2),Te=ht.height().toFixed(2),Be={style:Rs(Rs({},te.style),{width:Re+"px",height:Te+"px"})};Ve.setNodes(Q,Be,{at:Ae.findPath(Q,te)}),ve.off("mouseup",Ft)}}var Bt={};return Pe&&(Bt.width=Pe),qe&&(Bt.height=qe),er("div",{id:De,style:Bt,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(It){var Re=_e(It.target);Re.hasClass("w-e-image-dragger")&&(It.preventDefault(),(Re.hasClass("left-top")||Re.hasClass("left-bottom"))&&(dt=!0),pt(It.clientX))}}},he,er("div",{className:"w-e-image-dragger left-top"}),er("div",{className:"w-e-image-dragger right-top"}),er("div",{className:"w-e-image-dragger left-bottom"}),er("div",{className:"w-e-image-dragger right-bottom"}))}(r,e,j,{width:S,height:z}):function(Q,te,he,Ee){var ve=Ee.width,De=Ee.height,Pe={};return ve&&(Pe.width=ve),De&&(Pe.height=De),er("div",{id:R5(Q,te),style:Pe,className:"w-e-image-container"},he)}(r,e,j,{width:S,height:z})}},Jne={selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e),i=n.attr("data-href")||"";return i=decodeURIComponent(i),{type:"image",src:n.attr("src")||"",alt:n.attr("alt")||"",href:i,style:{width:Mo(n,"width"),height:Mo(n,"height")},children:[{text:""}]}}};function k5(e,t,r,n,i){return n===void 0&&(n=""),i===void 0&&(i=""),ks(this,void 0,void 0,function(){var o,a;return Ls(this,function(s){switch(s.label){case 0:return(o=t.getMenuConfig(e).checkImage)?[4,o(r,n,i)]:[3,2];case 1:if(typeof(a=s.sent())=="string")return t.alert(a,"error"),[2,!1];if(a==null)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function L5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseImageSrc)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function pu(e,t,r,n){return r===void 0&&(r=""),n===void 0&&(n=""),ks(this,void 0,void 0,function(){var i,o,a;return Ls(this,function(s){switch(s.label){case 0:return[4,k5("insertImage",e,t,r,n)];case 1:return s.sent()?[4,L5("insertImage",e,t)]:[2];case 2:return i=s.sent(),o={type:"image",src:nT(i),href:n,alt:r,style:{},children:[{text:""}]},e.selection===null&&e.restoreSelection(),Ae.getSelectedNodeByType(e,"image")&&e.move(1),m0(e)||(Ve.insertNodes(e,o),(a=e.getMenuConfig("insertImage").onInsertedImage)&&a(o)),[2]}})})}function m0(e){var t=e.selection;return t==null||!Qe.isCollapsed(t)||!!Dr(de.nodes(e,{match:function(r){var n=Ae.getNodeType(r);return n==="code"||n==="pre"||n==="link"||n==="list-item"||!!n.startsWith("header")||n==="blockquote"||!!de.isVoid(e,r)},universal:!0}),1)[0]}function y0(){return v0("w-e-insert-image")}var Qne=function(){function e(){this.title=wt("image.netImage"),this.iconSvg='',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=y0(),this.altInputId=y0(),this.hrefInputId=y0(),this.buttonId=y0()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return m0(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=Dr(Wi(wt("image.src"),i),2),u=l[0],c=_e(l[1]),h=Dr(Wi(wt("image.desc"),o),2),S=h[0],y=_e(h[1]),z=Dr(Wi(wt("image.link"),a),2),F=z[0],N=_e(z[1]),j=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var D=_e("
      ");D.on("click","#"+s,function(te){te.preventDefault();var he=D.find("#"+i).val().trim(),Ee=D.find("#"+o).val().trim(),ve=D.find("#"+a).val().trim();r.insertImage(t,he,Ee,ve),t.hidePanelOrModal()}),this.$content=D}var Q=this.$content;return Q.empty(),Q.append(u),Q.append(S),Q.append(F),Q.append(j),c.val(""),y.val(""),N.val(""),setTimeout(function(){c.focus()}),Q[0]},e.prototype.insertImage=function(t,r,n,i){n===void 0&&(n=""),i===void 0&&(i=""),r&&(t.restoreSelection(),this.isDisabled(t)||pu(t,r,n,i))},e}(),qne=function(){function e(){this.title=wt("image.delete"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.removeNodes(t,{match:function(n){return Ae.checkNodeType(n,"image")}})},e}();function b0(){return v0("w-e-edit-image")}var eie=function(){function e(){this.title=wt("image.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=b0(),this.altInputId=b0(),this.hrefInputId=b0(),this.buttonId=b0()}return e.prototype.getValue=function(t){return""},e.prototype.getImageNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.getModalPositionNode=function(t){return this.getImageNode(t)},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=this.getImageNode(t);if(l==null)throw new Error("Not found selected image node");var u=Dr(Wi(wt("image.src"),i),2),c=u[0],h=_e(u[1]),S=Dr(Wi(wt("image.desc"),o),2),y=S[0],z=_e(S[1]),F=Dr(Wi(wt("image.link"),a),2),N=F[0],j=_e(F[1]),D=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var Q=_e("
      ");Q.on("click","#"+s,function(ot){ot.preventDefault();var et=Q.find("#"+i).val(),gt=Q.find("#"+o).val(),dt=Q.find("#"+a).val();r.updateImage(t,et,gt,dt),t.hidePanelOrModal()}),this.$content=Q}var te=this.$content;te.empty(),te.append(c),te.append(y),te.append(N),te.append(D);var he=l,Ee=he.src,ve=he.alt,De=ve===void 0?"":ve,Pe=he.href,qe=Pe===void 0?"":Pe;return h.val(Ee),z.val(De),j.val(qe),setTimeout(function(){h.focus()}),te[0]},e.prototype.updateImage=function(t,r,n,i,o){n===void 0&&(n=""),i===void 0&&(i=""),o===void 0&&(o={}),r&&(t.restoreSelection(),this.isDisabled(t)||function(a,s,l,u,c){l===void 0&&(l=""),u===void 0&&(u=""),c===void 0&&(c={}),ks(this,void 0,void 0,function(){var h,S,y,z,F,N;return Ls(this,function(j){switch(j.label){case 0:return[4,k5("editImage",a,s,l,u)];case 1:return j.sent()?[4,L5("editImage",a,s)]:[2];case 2:return h=j.sent(),(S=Ae.getSelectedNodeByType(a,"image"))==null||(y=S.style,z={src:h,alt:l,href:u,style:Rs(Rs({},y===void 0?{}:y),c)},Ve.setNodes(a,z,{match:function(D){return Ae.checkNodeType(D,"image")}}),F=Ae.getSelectedNodeByType(a,"image"),(N=a.getMenuConfig("editImage").onUpdatedImage)&&N(F)),[2]}})})}(t,r,n,i,o))},e}(),tie=function(){function e(){this.title=wt("image.viewLink"),this.iconSvg=l5,this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"image");return r&&r.href||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!this.getValue(t)},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View image link failed, image.href is '"+r+"'");window.open(r,"_blank")}},e}(),uT=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getSelectedNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedNode(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.getSelectedNode(t);if(n!=null){var i=Ae.getHoverbar(t);i&&i.hideAndClean();var o=n.style,a={style:Rs(Rs({},o===void 0?{}:o),{width:this.value,height:""})};Ve.setNodes(t,a,{match:function(s){return Ae.checkNodeType(s,"image")}})}}},e}(),rie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="30%",r.value="30%",r}return nn(t,e),t}(uT),nie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="50%",r.value="50%",r}return nn(t,e),t}(uT),iie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="100%",r.value="100%",r}return nn(t,e),t}(uT),P5={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,r){return!0},parseImageSrc:function(e){return e}},oie={renderElems:[Zne],elemsToHtml:[{type:"image",elemToHtml:function(e,t){var r=e,n=r.src,i=r.alt,o=i===void 0?"":i,a=r.href,s=a===void 0?"":a,l=r.style,u=l===void 0?{}:l,c=u.width,h=c===void 0?"":c,S=u.height,y=S===void 0?"":S,z="";return h&&(z+="width: "+h+";"),y&&(z+="height: "+y+";"),''+o+''}}],parseElemsHtml:[Jne],menus:[{key:"insertImage",factory:function(){return new Qne},config:P5},{key:"deleteImage",factory:function(){return new qne}},{key:"editImage",factory:function(){return new eie},config:P5},{key:"viewImageLink",factory:function(){return new tie}},{key:"imageWidth30",factory:function(){return new rie}},{key:"imageWidth50",factory:function(){return new nie}},{key:"imageWidth100",factory:function(){return new iie}}],editorPlugin:function(e){var t=e.isInline,r=e.isVoid;e.insertNode;var n=e;return n.isInline=function(i){return i.type==="image"||t(i)},n.isVoid=function(i){return i.type==="image"||r(i)},n}},aie={type:"todo",renderElem:function(e,t,r){var n=!1;r.isDisabled()&&(n=!0);var i=er("div",{style:{margin:"5px 0"}},er("span",{contentEditable:!1,style:{marginRight:"0.5em"}},er("input",{type:"checkbox",checked:e.checked,disabled:n,on:{change:function(o){var a=Ae.findPath(r,e),s={checked:o.target.checked};Ve.setNodes(r,s,{at:a})}}})),er("span",null,t));return i}},sie=function(){function e(){this.title=wt("todo.todo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"todo")},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","table","list-item"].includes(n)||void 0})},e.prototype.exec=function(t,r){var n=this.isActive(t);Ve.setNodes(t,{type:n?"paragraph":"todo"})},e}(),lie={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(o){return!!Rt.isText(o)||!!r.isInline(o)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=!1;return n.find('input[type="checkbox"]').attr("checked")!=null&&(i=!0),{type:"todo",checked:i,children:t}}},uie={renderElems:[aie],elemsToHtml:[{type:"todo",elemToHtml:function(e,t){return'
      "+t+"
      "}}],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=_e(e).find("li"),r=_e('
      '),n=t.find("input[type]");return r.append(n),t.children()[0].remove(),r[0].innerHTML=r[0].innerHTML+t[0].innerHTML,r[0]}}],parseElemsHtml:[lie],menus:[{key:"todo",factory:function(){return new sie}}],editorPlugin:function(e){var t=e.deleteBackward,r=e;return r.deleteBackward=function(n){var i=e.selection;if(i&&Qe.isCollapsed(i)){var o=Ae.getSelectedNodeByType(e,"todo");if(o&&St.string(o).length===0)return void Ve.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},r}},cie={type:"blockquote",renderElem:function(e,t,r){return er("blockquote",null,t)}},die={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}},hie=function(){function e(){this.title=wt("blockQuote.title"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"blockquote")},e.prototype.isDisabled=function(t){return t.selection==null||!Dr(de.nodes(t,{match:function(r){var n=Ae.getNodeType(r);return n==="paragraph"||n==="blockquote"},universal:!0,mode:"highest"}),1)[0]},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.isActive(t)?"paragraph":"blockquote";Ve.setNodes(t,{type:n},{mode:"highest"})}},e}(),fie={key:"blockquote",factory:function(){return new hie}},pie=Qt([].slice),gie=OC("slice"),vie=Vi("species"),cT=sr.Array,mie=Math.max;Hn({target:"Array",proto:!0,forced:!gie},{slice:function(e,t){var r,n,i,o=ed(this),a=l0(o),s=Nf(e,a),l=Nf(t===void 0?a:t,a);if(c0(o)&&(r=o.constructor,(DC(r)&&(r===cT||c0(r.prototype))||po(r)&&(r=r[vie])===null)&&(r=void 0),r===cT||r===void 0))return pie(o,s,l);for(n=new(r===void 0?cT:r)(mie(l-s,0)),i=0;s"+t+""}}],parseElemsHtml:[die],menus:[fie],editorPlugin:function(e){var t=e.insertBreak,r=e.insertText,n=e;return n.insertBreak=function(){var i=n.selection;if(i==null)return t();var o=Dr(de.nodes(e,{match:function(c){return Ae.checkNodeType(c,"blockquote")},universal:!0}),1)[0];if(!o)return t();var a=o[0],s=Ae.findPath(e,a),l=de.end(e,s);if(cr.equals(l,i.focus)){var u=St.string(a);if(u&&u.slice(-1)===` + `);return i.prepend(l),i[0]},e}(),Pne=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.color"),r.iconSvg=Fre,r.mark="color",r}return nn(t,e),t}(b5),Ine=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("color.bgColor"),r.iconSvg=Nre,r.mark="bgColor",r}return nn(t,e),t}(b5),E5=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"],Mne={renderStyle:function(e,t){var r=e,n=r.color,i=r.bgColor,o=t;return n&&fu(o,{color:n}),i&&fu(o,{backgroundColor:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.color,o=n.bgColor;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e(""+t+"")),i&&r.css("color",i),o&&r.css("background-color",o),ld(r)):t},preParseHtml:[Lne],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=Mo(n,"color");o&&(i.color=o);var a=Mo(n,"background-color");return a||(a=Mo(n,"background")),a&&(i.bgColor=a),i},menus:[{key:"color",factory:function(){return new Pne},config:{colors:E5}},{key:"bgColor",factory:function(){return new Ine},config:{colors:E5}}]},Bne=/^(?:\w+:)?\/\/(\S+)$/,Fne=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Nne=/^[^\s\.]+\.\S{2,}$/,jne=xB.includes;function v0(e){return e===void 0&&(e="r"),e+"-"+SP()}function nT(e){return e.replace(//g,">")}function x5(e,t,r,n){return ks(this,void 0,void 0,function(){var i,o;return Ls(this,function(a){switch(a.label){case 0:return(i=t.getMenuConfig(e).checkLink)?[4,i(r,n)]:[3,2];case 1:if(typeof(o=a.sent())=="string")return t.alert(o,"error"),[2,!1];if(o==null)return[2,!1];a.label=2;case 2:return[2,!0]}})})}function S5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseLinkUrl)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function iT(e){return e.selection==null||!!Ae.getSelectedElems(e).some(function(t){var r=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(r)||void 0})}function oT(e,t){return{type:"link",url:nT(e),children:t?[{text:t}]:[]}}function w5(e,t,r){return ks(this,void 0,void 0,function(){var n,i,o;return Ls(this,function(a){switch(a.label){case 0:return r?(t||(t=r),e.restoreSelection(),iT(e)?[2]:[4,x5("insertLink",e,t,r)]):[2];case 1:return a.sent()?[4,S5("insertLink",e,r)]:[2];case 2:return n=a.sent(),(i=e.selection)==null||(Je.isCollapsed(i)?(e.insertText(" "),o=oT(n,t),Ve.insertNodes(e,o),e.insertFragment([{text:" "}])):de.string(e,i)!==t?(e.deleteFragment(),o=oT(n,t),Ve.insertNodes(e,o)):(o=oT(n),Ve.wrapNodes(e,o,{split:!0}),Ve.collapse(e,{edge:"end"}))),[2]}})})}Hn({target:"Array",proto:!0},{includes:function(e){return jne(this,e,arguments.length>1?arguments[1]:void 0)}}),$B("includes");var Une={type:"link",renderElem:function(e,t,r){var n=e,i=n.url,o=n.target;return er("a",{href:i,target:o===void 0?"_blank":o},t)}},Hne={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"link",url:n.attr("href")||"",target:n.attr("target")||"",children:t}}};function aT(){return v0("w-e-insert-link")}var zne=function(){function e(){this.title=wt("link.insert"),this.iconSvg='',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=aT(),this.urlInputId=aT(),this.buttonId=aT()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return iT(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=t.selection,n=this,i=n.textInputId,o=n.urlInputId,a=n.buttonId,s=Dr(Wi(wt("link.text"),i),2),l=s[0],u=_e(s[1]),c=Dr(Wi(wt("link.url"),o),2),h=c[0],S=_e(c[1]),y=Dr(Zc(a,wt("common.ok")),1)[0];if(this.$content==null){var W=_e("
      ");W.on("click","#"+a,function(j){j.preventDefault();var D=W.find("#"+i).val(),Q=W.find("#"+o).val();w5(t,D,Q),t.hidePanelOrModal()}),this.$content=W}var F=this.$content;if(F.empty(),F.append(l),F.append(h),F.append(y),r==null||Je.isCollapsed(r))u.val("");else{var N=de.string(t,r);u.val(N)}return S.val(""),setTimeout(function(){u.focus()}),F[0]},e}();function C5(){return v0("w-e-update-link")}var Wne=function(){function e(){this.title=wt("link.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=C5(),this.buttonId=C5()}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.getModalPositionNode=function(t){return Ae.getSelectedNodeByType(t,"link")},e.prototype.getModalContentElem=function(t){var r=this.urlInputId,n=this.buttonId,i=Dr(Wi(wt("link.url"),r),2),o=i[0],a=_e(i[1]),s=Dr(Zc(n,wt("common.ok")),1)[0];if(this.$content==null){var l=_e("
      ");l.on("click","button",function(h){h.preventDefault(),t.restoreSelection();var S=Ae.getSelectedNodeByType(t,"link"),y=S?St.string(S):"",W=l.find("#"+r).val();!function(F,N,j){ks(this,void 0,void 0,function(){var D,Q;return Ls(this,function(te){switch(te.label){case 0:return j?[4,x5("editLink",F,N,j)]:[2];case 1:return te.sent()?[4,S5("editLink",F,j)]:[2];case 2:return D=te.sent(),Q={url:nT(D)},Ve.setNodes(F,Q,{match:function(he){return Ae.checkNodeType(he,"link")}}),[2]}})})}(t,y,W),t.hidePanelOrModal()}),this.$content=l}var u=this.$content;u.empty(),u.append(o),u.append(s);var c=this.getValue(t);return a.val(c),setTimeout(function(){a.focus()}),u[0]},e}(),Gne=function(){function e(){this.title=wt("link.unLink"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"link")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.unwrapNodes(t,{match:function(n){return Ae.checkNodeType(n,"link")}})},e}(),Vne=function(){function e(){this.title=wt("link.view"),this.iconSvg=l5,this.tag="button"}return e.prototype.getSelectedLinkElem=function(t){var r=Ae.getSelectedNodeByType(t,"link");return r==null?null:r},e.prototype.getValue=function(t){var r=this.getSelectedLinkElem(t);return r&&r.url||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedLinkElem(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View link failed, link url is '"+r+"'");window.open(r,"_blank")}},e}(),T5={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Kne={renderElems:[Une],elemsToHtml:[{type:"link",elemToHtml:function(e,t){var r=e,n=r.url,i=r.target;return''+t+""}}],parseElemsHtml:[Hne],menus:[{key:"insertLink",factory:function(){return new zne},config:T5},{key:"editLink",factory:function(){return new Wne},config:T5},{key:"unLink",factory:function(){return new Gne}},{key:"viewLink",factory:function(){return new Vne}}],editorPlugin:function(e){var t=e.isInline,r=e.insertData,n=e.normalizeNode;e.insertNode,e.insertText;var i=e;return i.isInline=function(o){return o.type==="link"||t(o)},i.insertData=function(o){var a=o.getData("text/plain");if(function(u){if(typeof u!="string")return!1;var c=u.match(Bne);if(!c)return!1;var h=c[1];return!(!h||!Fne.test(h)&&!Nne.test(h))}(a)){if(!iT(i)){var s=i.selection;if(s!=null){var l=de.string(i,s);w5(i,l,a)}}}else r(o)},i.normalizeNode=function(o){var a=Dr(o,2),s=a[0],l=a[1];return Ae.getNodeType(s)!=="link"?n([s,l]):St.string(s)===""?Ve.removeNodes(i,{at:l}):n([s,l])},i}},$ne=Qt(1 .valueOf),Xne=sr.RangeError,Yne=sr.RangeError,A5=sr.String,D5=Math.floor,sT=Qt(function(e){var t=cn(fo(this)),r="",n=id(e);if(n<0||n==1/0)throw Xne("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r}),O5=Qt("".slice),Jf=Qt(1 .toFixed),dd=function(e,t,r){return t===0?r:t%2==1?dd(e,t-1,r*e):dd(e*e,t/2,r)},hd=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=D5(i/1e7)},lT=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=D5(n/t),n=n%t*1e7},_5=function(e){for(var t=6,r="";--t>=0;)if(r!==""||t===0||e[t]!==0){var n=A5(e[t]);r=r===""?n:r+sT("0",7-n.length)+n}return r};function R5(e,t){return"w-e-image-container-"+Ae.findKey(e,t).id}Hn({target:"Number",proto:!0,forced:un(function(){return Jf(8e-5,3)!=="0.000"||Jf(.9,0)!=="1"||Jf(1.255,2)!=="1.25"||Jf(1000000000000000100,0)!=="1000000000000000128"})||!un(function(){Jf({})})},{toFixed:function(e){var t,r,n,i,o=$ne(this),a=id(e),s=[0,0,0,0,0,0],l="",u="0";if(a<0||a>20)throw Yne("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return A5(o);if(o<0&&(l="-",o=-o),o>1e-21)if(r=(t=function(c){for(var h=0,S=c;S>=4096;)h+=12,S/=4096;for(;S>=2;)h+=1,S/=2;return h}(o*dd(2,69,1))-69)<0?o*dd(2,-t,1):o/dd(2,t,1),r*=4503599627370496,(t=52-t)>0){for(hd(s,0,r),n=a;n>=7;)hd(s,1e7,0),n-=7;for(hd(s,dd(10,n,1),0),n=t-1;n>=23;)lT(s,1<<23),n-=23;lT(s,1<0?l+((i=u.length)<=a?"0."+sT("0",a-i)+u:O5(u,0,i-a)+"."+O5(u,i-a)):l+u}});var Zne={type:"image",renderElem:function(e,t,r){var n=e,i=n.src,o=n.alt,a=o===void 0?"":o,s=n.href,l=s===void 0?"":s,u=n.style,c=u===void 0?{}:u,h=c.width,S=h===void 0?"":h,y=c.height,W=y===void 0?"":y,F=Ae.isNodeSelected(r,e),N={};S&&(N.width="100%"),W&&(N.height="100%");var j=er("img",{style:N,src:i,alt:a,"data-href":l}),D=r.isDisabled();return F&&!D?function(Q,te,he,Ee){var ve=_e("body"),De=R5(Q,te),Pe=Ee.width,qe=Ee.height,ot=0,et=0,gt=0,dt=!1,ht=null;function pt(It){ht=function(){var Be=_e("#"+De);if(Be.length===0)throw new Error("Cannot find image container elem");return Be}(),ot=It;var Re=ht.find("img");if(Re.length===0)throw new Error("Cannot find image elem");et=Re.width(),gt=Re.height(),ve.on("mousemove",Dt),ve.on("mouseup",Ft);var Te=Ae.getHoverbar(Q);Te&&Te.hideAndClean()}var Dt=Hl(function(It){It.preventDefault();var Re=It.clientX,Te=et+(dt?ot-Re:Re-ot),Be=gt*(Te/et);ht!=null&&(Te<=15||Be<=15||(ht.css("width",Te+"px"),ht.css("height",Be+"px")))},100);function Ft(It){if(ve.off("mousemove",Dt),ht!=null){var Re=ht.width().toFixed(2),Te=ht.height().toFixed(2),Be={style:Rs(Rs({},te.style),{width:Re+"px",height:Te+"px"})};Ve.setNodes(Q,Be,{at:Ae.findPath(Q,te)}),ve.off("mouseup",Ft)}}var Bt={};return Pe&&(Bt.width=Pe),qe&&(Bt.height=qe),er("div",{id:De,style:Bt,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(It){var Re=_e(It.target);Re.hasClass("w-e-image-dragger")&&(It.preventDefault(),(Re.hasClass("left-top")||Re.hasClass("left-bottom"))&&(dt=!0),pt(It.clientX))}}},he,er("div",{className:"w-e-image-dragger left-top"}),er("div",{className:"w-e-image-dragger right-top"}),er("div",{className:"w-e-image-dragger left-bottom"}),er("div",{className:"w-e-image-dragger right-bottom"}))}(r,e,j,{width:S,height:W}):function(Q,te,he,Ee){var ve=Ee.width,De=Ee.height,Pe={};return ve&&(Pe.width=ve),De&&(Pe.height=De),er("div",{id:R5(Q,te),style:Pe,className:"w-e-image-container"},he)}(r,e,j,{width:S,height:W})}},Jne={selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e),i=n.attr("data-href")||"";return i=decodeURIComponent(i),{type:"image",src:n.attr("src")||"",alt:n.attr("alt")||"",href:i,style:{width:Mo(n,"width"),height:Mo(n,"height")},children:[{text:""}]}}};function k5(e,t,r,n,i){return n===void 0&&(n=""),i===void 0&&(i=""),ks(this,void 0,void 0,function(){var o,a;return Ls(this,function(s){switch(s.label){case 0:return(o=t.getMenuConfig(e).checkImage)?[4,o(r,n,i)]:[3,2];case 1:if(typeof(a=s.sent())=="string")return t.alert(a,"error"),[2,!1];if(a==null)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function L5(e,t,r){return ks(this,void 0,void 0,function(){var n;return Ls(this,function(i){switch(i.label){case 0:return(n=t.getMenuConfig(e).parseImageSrc)?[4,n(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}})})}function pu(e,t,r,n){return r===void 0&&(r=""),n===void 0&&(n=""),ks(this,void 0,void 0,function(){var i,o,a;return Ls(this,function(s){switch(s.label){case 0:return[4,k5("insertImage",e,t,r,n)];case 1:return s.sent()?[4,L5("insertImage",e,t)]:[2];case 2:return i=s.sent(),o={type:"image",src:nT(i),href:n,alt:r,style:{},children:[{text:""}]},e.selection===null&&e.restoreSelection(),Ae.getSelectedNodeByType(e,"image")&&e.move(1),m0(e)||(Ve.insertNodes(e,o),(a=e.getMenuConfig("insertImage").onInsertedImage)&&a(o)),[2]}})})}function m0(e){var t=e.selection;return t==null||!Je.isCollapsed(t)||!!Dr(de.nodes(e,{match:function(r){var n=Ae.getNodeType(r);return n==="code"||n==="pre"||n==="link"||n==="list-item"||!!n.startsWith("header")||n==="blockquote"||!!de.isVoid(e,r)},universal:!0}),1)[0]}function y0(){return v0("w-e-insert-image")}var Qne=function(){function e(){this.title=wt("image.netImage"),this.iconSvg='',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=y0(),this.altInputId=y0(),this.hrefInputId=y0(),this.buttonId=y0()}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){return m0(t)},e.prototype.getModalPositionNode=function(t){return null},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=Dr(Wi(wt("image.src"),i),2),u=l[0],c=_e(l[1]),h=Dr(Wi(wt("image.desc"),o),2),S=h[0],y=_e(h[1]),W=Dr(Wi(wt("image.link"),a),2),F=W[0],N=_e(W[1]),j=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var D=_e("
      ");D.on("click","#"+s,function(te){te.preventDefault();var he=D.find("#"+i).val().trim(),Ee=D.find("#"+o).val().trim(),ve=D.find("#"+a).val().trim();r.insertImage(t,he,Ee,ve),t.hidePanelOrModal()}),this.$content=D}var Q=this.$content;return Q.empty(),Q.append(u),Q.append(S),Q.append(F),Q.append(j),c.val(""),y.val(""),N.val(""),setTimeout(function(){c.focus()}),Q[0]},e.prototype.insertImage=function(t,r,n,i){n===void 0&&(n=""),i===void 0&&(i=""),r&&(t.restoreSelection(),this.isDisabled(t)||pu(t,r,n,i))},e}(),qne=function(){function e(){this.title=wt("image.delete"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.removeNodes(t,{match:function(n){return Ae.checkNodeType(n,"image")}})},e}();function b0(){return v0("w-e-edit-image")}var eie=function(){function e(){this.title=wt("image.edit"),this.iconSvg=s5,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=b0(),this.altInputId=b0(),this.hrefInputId=b0(),this.buttonId=b0()}return e.prototype.getValue=function(t){return""},e.prototype.getImageNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Je.isCollapsed(r)||Ae.getSelectedNodeByType(t,"image")==null},e.prototype.getModalPositionNode=function(t){return this.getImageNode(t)},e.prototype.getModalContentElem=function(t){var r=this,n=this,i=n.srcInputId,o=n.altInputId,a=n.hrefInputId,s=n.buttonId,l=this.getImageNode(t);if(l==null)throw new Error("Not found selected image node");var u=Dr(Wi(wt("image.src"),i),2),c=u[0],h=_e(u[1]),S=Dr(Wi(wt("image.desc"),o),2),y=S[0],W=_e(S[1]),F=Dr(Wi(wt("image.link"),a),2),N=F[0],j=_e(F[1]),D=Dr(Zc(s,wt("common.ok")),1)[0];if(this.$content==null){var Q=_e("
      ");Q.on("click","#"+s,function(ot){ot.preventDefault();var et=Q.find("#"+i).val(),gt=Q.find("#"+o).val(),dt=Q.find("#"+a).val();r.updateImage(t,et,gt,dt),t.hidePanelOrModal()}),this.$content=Q}var te=this.$content;te.empty(),te.append(c),te.append(y),te.append(N),te.append(D);var he=l,Ee=he.src,ve=he.alt,De=ve===void 0?"":ve,Pe=he.href,qe=Pe===void 0?"":Pe;return h.val(Ee),W.val(De),j.val(qe),setTimeout(function(){h.focus()}),te[0]},e.prototype.updateImage=function(t,r,n,i,o){n===void 0&&(n=""),i===void 0&&(i=""),o===void 0&&(o={}),r&&(t.restoreSelection(),this.isDisabled(t)||function(a,s,l,u,c){l===void 0&&(l=""),u===void 0&&(u=""),c===void 0&&(c={}),ks(this,void 0,void 0,function(){var h,S,y,W,F,N;return Ls(this,function(j){switch(j.label){case 0:return[4,k5("editImage",a,s,l,u)];case 1:return j.sent()?[4,L5("editImage",a,s)]:[2];case 2:return h=j.sent(),(S=Ae.getSelectedNodeByType(a,"image"))==null||(y=S.style,W={src:h,alt:l,href:u,style:Rs(Rs({},y===void 0?{}:y),c)},Ve.setNodes(a,W,{match:function(D){return Ae.checkNodeType(D,"image")}}),F=Ae.getSelectedNodeByType(a,"image"),(N=a.getMenuConfig("editImage").onUpdatedImage)&&N(F)),[2]}})})}(t,r,n,i,o))},e}(),tie=function(){function e(){this.title=wt("image.viewLink"),this.iconSvg=l5,this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"image");return r&&r.href||""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!this.getValue(t)},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){if(!r||typeof r!="string")throw new Error("View image link failed, image.href is '"+r+"'");window.open(r,"_blank")}},e}(),uT=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getSelectedNode=function(t){return Ae.getSelectedNodeByType(t,"image")},e.prototype.isDisabled=function(t){return t.selection==null||this.getSelectedNode(t)==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.getSelectedNode(t);if(n!=null){var i=Ae.getHoverbar(t);i&&i.hideAndClean();var o=n.style,a={style:Rs(Rs({},o===void 0?{}:o),{width:this.value,height:""})};Ve.setNodes(t,a,{match:function(s){return Ae.checkNodeType(s,"image")}})}}},e}(),rie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="30%",r.value="30%",r}return nn(t,e),t}(uT),nie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="50%",r.value="50%",r}return nn(t,e),t}(uT),iie=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title="100%",r.value="100%",r}return nn(t,e),t}(uT),P5={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,r){return!0},parseImageSrc:function(e){return e}},oie={renderElems:[Zne],elemsToHtml:[{type:"image",elemToHtml:function(e,t){var r=e,n=r.src,i=r.alt,o=i===void 0?"":i,a=r.href,s=a===void 0?"":a,l=r.style,u=l===void 0?{}:l,c=u.width,h=c===void 0?"":c,S=u.height,y=S===void 0?"":S,W="";return h&&(W+="width: "+h+";"),y&&(W+="height: "+y+";"),''+o+''}}],parseElemsHtml:[Jne],menus:[{key:"insertImage",factory:function(){return new Qne},config:P5},{key:"deleteImage",factory:function(){return new qne}},{key:"editImage",factory:function(){return new eie},config:P5},{key:"viewImageLink",factory:function(){return new tie}},{key:"imageWidth30",factory:function(){return new rie}},{key:"imageWidth50",factory:function(){return new nie}},{key:"imageWidth100",factory:function(){return new iie}}],editorPlugin:function(e){var t=e.isInline,r=e.isVoid;e.insertNode;var n=e;return n.isInline=function(i){return i.type==="image"||t(i)},n.isVoid=function(i){return i.type==="image"||r(i)},n}},aie={type:"todo",renderElem:function(e,t,r){var n=!1;r.isDisabled()&&(n=!0);var i=er("div",{style:{margin:"5px 0"}},er("span",{contentEditable:!1,style:{marginRight:"0.5em"}},er("input",{type:"checkbox",checked:e.checked,disabled:n,on:{change:function(o){var a=Ae.findPath(r,e),s={checked:o.target.checked};Ve.setNodes(r,s,{at:a})}}})),er("span",null,t));return i}},sie=function(){function e(){this.title=wt("todo.todo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"todo")},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","table","list-item"].includes(n)||void 0})},e.prototype.exec=function(t,r){var n=this.isActive(t);Ve.setNodes(t,{type:n?"paragraph":"todo"})},e}(),lie={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(o){return!!Rt.isText(o)||!!r.isInline(o)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=!1;return n.find('input[type="checkbox"]').attr("checked")!=null&&(i=!0),{type:"todo",checked:i,children:t}}},uie={renderElems:[aie],elemsToHtml:[{type:"todo",elemToHtml:function(e,t){return'
      "+t+"
      "}}],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=_e(e).find("li"),r=_e('
      '),n=t.find("input[type]");return r.append(n),t.children()[0].remove(),r[0].innerHTML=r[0].innerHTML+t[0].innerHTML,r[0]}}],parseElemsHtml:[lie],menus:[{key:"todo",factory:function(){return new sie}}],editorPlugin:function(e){var t=e.deleteBackward,r=e;return r.deleteBackward=function(n){var i=e.selection;if(i&&Je.isCollapsed(i)){var o=Ae.getSelectedNodeByType(e,"todo");if(o&&St.string(o).length===0)return void Ve.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},r}},cie={type:"blockquote",renderElem:function(e,t,r){return er("blockquote",null,t)}},die={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return!!Rt.isText(i)||!!r.isInline(i)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}},hie=function(){function e(){this.title=wt("blockQuote.title"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!!Ae.getSelectedNodeByType(t,"blockquote")},e.prototype.isDisabled=function(t){return t.selection==null||!Dr(de.nodes(t,{match:function(r){var n=Ae.getNodeType(r);return n==="paragraph"||n==="blockquote"},universal:!0,mode:"highest"}),1)[0]},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=this.isActive(t)?"paragraph":"blockquote";Ve.setNodes(t,{type:n},{mode:"highest"})}},e}(),fie={key:"blockquote",factory:function(){return new hie}},pie=Qt([].slice),gie=OC("slice"),vie=Vi("species"),cT=sr.Array,mie=Math.max;Hn({target:"Array",proto:!0,forced:!gie},{slice:function(e,t){var r,n,i,o=ed(this),a=l0(o),s=Nf(e,a),l=Nf(t===void 0?a:t,a);if(c0(o)&&(r=o.constructor,(DC(r)&&(r===cT||c0(r.prototype))||po(r)&&(r=r[vie])===null)&&(r=void 0),r===cT||r===void 0))return pie(o,s,l);for(n=new(r===void 0?cT:r)(mie(l-s,0)),i=0;s"+t+""}}],parseElemsHtml:[die],menus:[fie],editorPlugin:function(e){var t=e.insertBreak,r=e.insertText,n=e;return n.insertBreak=function(){var i=n.selection;if(i==null)return t();var o=Dr(de.nodes(e,{match:function(c){return Ae.checkNodeType(c,"blockquote")},universal:!0}),1)[0];if(!o)return t();var a=o[0],s=Ae.findPath(e,a),l=de.end(e,s);if(cr.equals(l,i.focus)){var u=St.string(a);if(u&&u.slice(-1)===` `)return e.deleteBackward("character"),void Ve.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}r(` -`)},n}},bie=function(){function e(){this.title=wt("emotion.title"),this.iconSvg='',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(t,r){},e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0]},e.prototype.getPanelContentElem=function(t){if(this.$content==null){var r=_e('
        ');r.on("click","li",function(o){var a=o.target;if(a!=null){o.preventDefault();var s=_e(a).text();t.insertText(s)}}),this.$content=r}var n=this.$content;if(n==null)return document.createElement("ul");n.empty();var i=t.getMenuConfig("emotion").emotions;return(i===void 0?[]:i).forEach(function(o){var a=_e("
      • "+o+"
      • ");n.append(a)}),n[0]},e}(),Eie={menus:[{key:"emotion",factory:function(){return new bie},config:{emotions:"\u{1F600} \u{1F603} \u{1F604} \u{1F601} \u{1F606} \u{1F605} \u{1F602} \u{1F923} \u{1F60A} \u{1F607} \u{1F642} \u{1F643} \u{1F609} \u{1F60C} \u{1F60D} \u{1F618} \u{1F617} \u{1F619} \u{1F61A} \u{1F60B} \u{1F61B} \u{1F61D} \u{1F61C} \u{1F913} \u{1F60E} \u{1F60F} \u{1F612} \u{1F61E} \u{1F614} \u{1F61F} \u{1F615} \u{1F641} \u{1F623} \u{1F616} \u{1F62B} \u{1F629} \u{1F622} \u{1F62D} \u{1F624} \u{1F620} \u{1F621} \u{1F633} \u{1F631} \u{1F628} \u{1F917} \u{1F914} \u{1F636} \u{1F611} \u{1F62C} \u{1F644} \u{1F62F} \u{1F634} \u{1F637} \u{1F911} \u{1F608} \u{1F921} \u{1F4A9} \u{1F47B} \u{1F480} \u{1F440} \u{1F463} \u{1F450} \u{1F64C} \u{1F44F} \u{1F91D} \u{1F44D} \u{1F44E} \u{1F44A} \u270A \u{1F91B} \u{1F91C} \u{1F91E} \u270C\uFE0F \u{1F918} \u{1F44C} \u{1F448} \u{1F449} \u{1F446} \u{1F447} \u261D\uFE0F \u270B \u{1F91A} \u{1F590} \u{1F596} \u{1F44B} \u{1F919} \u{1F4AA} \u{1F595} \u270D\uFE0F \u{1F64F}".split(" ")}}]},xie={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"},Sie={selector:"font",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="font")return e;var r=t.attr("size")||"";r&&(t.removeAttr("size"),t.css("font-size",xie[r]));var n=t.attr("face")||"";return n&&(t.removeAttr("face"),t.css("font-family",n)),t[0]}},wie=Qt("".indexOf);Hn({target:"String",proto:!0,forced:!d5("includes")},{includes:function(e){return!!~wie(cn(fo(this)),cn(c5(e)),arguments.length>1?arguments[1]:void 0)}});var Ps,E0,x0=function(e){return e&&e.Math==Math&&e},hr=x0(typeof globalThis=="object"&&globalThis)||x0(typeof window=="object"&&window)||x0(typeof self=="object"&&self)||x0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),dT=Function.prototype,I5=dT.apply,Cie=dT.bind,M5=dT.call,B5=typeof Reflect=="object"&&Reflect.apply||(Cie?M5.bind(I5):function(){return M5.apply(I5,arguments)}),F5=Function.prototype,hT=F5.bind,fT=F5.call,Tie=hT&&hT.bind(fT),mn=hT?function(e){return e&&Tie(fT,e)}:function(e){return e&&function(){return fT.apply(e,arguments)}},oi=function(e){return typeof e=="function"},$i=function(e){try{return!!e()}catch(t){return!0}},ki=!$i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Qf=Function.prototype.call,Bo=Qf.bind?Qf.bind(Qf):function(){return Qf.apply(Qf,arguments)},N5={}.propertyIsEnumerable,j5=Object.getOwnPropertyDescriptor,Aie=j5&&!N5.call({1:2},1)?function(e){var t=j5(this,e);return!!t&&t.enumerable}:N5,pT={f:Aie},gu=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Die=mn({}.toString),Oie=mn("".slice),vu=function(e){return Oie(Die(e),8,-1)},gT=hr.Object,_ie=mn("".split),U5=$i(function(){return!gT("z").propertyIsEnumerable(0)})?function(e){return vu(e)=="String"?_ie(e,""):gT(e)}:gT,Rie=hr.TypeError,vT=function(e){if(e==null)throw Rie("Can't call method on "+e);return e},ia=function(e){return U5(vT(e))},vo=function(e){return typeof e=="object"?e!==null:oi(e)},mo={},H5=function(e){return oi(e)?e:void 0},qf=function(e,t){return arguments.length<2?H5(mo[e])||H5(hr[e]):mo[e]&&mo[e][t]||hr[e]&&hr[e][t]},z5=mn({}.isPrototypeOf),mT=qf("navigator","userAgent")||"",W5=hr.process,G5=hr.Deno,V5=W5&&W5.versions||G5&&G5.version,K5=V5&&V5.v8;K5&&(E0=(Ps=K5.split("."))[0]>0&&Ps[0]<4?1:+(Ps[0]+Ps[1])),!E0&&mT&&(!(Ps=mT.match(/Edge\/(\d+)/))||Ps[1]>=74)&&(Ps=mT.match(/Chrome\/(\d+)/))&&(E0=+Ps[1]);var S0=E0,oa=!!Object.getOwnPropertySymbols&&!$i(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&S0&&S0<41}),yT=oa&&!Symbol.sham&&typeof Symbol.iterator=="symbol",kie=hr.Object,fd=yT?function(e){return typeof e=="symbol"}:function(e){var t=qf("Symbol");return oi(t)&&z5(t.prototype,kie(e))},Lie=hr.String,Pie=hr.TypeError,$5=function(e){if(oi(e))return e;throw Pie(function(t){try{return Lie(t)}catch(r){return"Object"}}(e)+" is not a function")},Iie=hr.TypeError,Mie=Object.defineProperty,Is=hr["__core-js_shared__"]||function(e,t){try{Mie(hr,e,{value:t,configurable:!0,writable:!0})}catch(r){hr[e]=t}return t}("__core-js_shared__",{}),mu=e0(function(e){(e.exports=function(t,r){return Is[t]||(Is[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Bie=hr.Object,ep=function(e){return Bie(vT(e))},Fie=mn({}.hasOwnProperty),Or=Object.hasOwn||function(e,t){return Fie(ep(e),t)},Nie=0,jie=Math.random(),Uie=mn(1 .toString),w0=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Uie(++Nie+jie,36)},tp=mu("wks"),yu=hr.Symbol,X5=yu&&yu.for,Hie=yT?yu:yu&&yu.withoutSetter||w0,Xi=function(e){if(!Or(tp,e)||!oa&&typeof tp[e]!="string"){var t="Symbol."+e;oa&&Or(yu,e)?tp[e]=yu[e]:tp[e]=yT&&X5?X5(t):Hie(t)}return tp[e]},zie=hr.TypeError,Wie=Xi("toPrimitive"),pd=function(e){var t=function(r,n){if(!vo(r)||fd(r))return r;var i,o,a=(i=r[Wie])==null?void 0:$5(i);if(a){if(n===void 0&&(n="default"),o=Bo(a,r,n),!vo(o)||fd(o))return o;throw zie("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(s,l){var u,c;if(l==="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;if(oi(u=s.valueOf)&&!vo(c=Bo(u,s)))return c;if(l!=="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;throw Iie("Can't convert object to primitive value")}(r,n)}(e,"string");return fd(t)?t:t+""},bT=hr.document,Gie=vo(bT)&&vo(bT.createElement),Y5=function(e){return Gie?bT.createElement(e):{}},Z5=!ki&&!$i(function(){return Object.defineProperty(Y5("div"),"a",{get:function(){return 7}}).a!=7}),J5=Object.getOwnPropertyDescriptor,ET={f:ki?J5:function(e,t){if(e=ia(e),t=pd(t),Z5)try{return J5(e,t)}catch(r){}if(Or(e,t))return gu(!Bo(pT.f,e,t),e[t])}},Vie=/#|\.prototype\./,rp=function(e,t){var r=$ie[Kie(e)];return r==Yie||r!=Xie&&(oi(t)?$i(t):!!t)},Kie=rp.normalize=function(e){return String(e).replace(Vie,".").toLowerCase()},$ie=rp.data={},Xie=rp.NATIVE="N",Yie=rp.POLYFILL="P",Zie=rp,Q5=mn(mn.bind),q5=function(e,t){return $5(e),t===void 0?e:Q5?Q5(e,t):function(){return e.apply(t,arguments)}},Jie=hr.String,Qie=hr.TypeError,bu=function(e){if(vo(e))return e;throw Qie(Jie(e)+" is not an object")},qie=hr.TypeError,eF=Object.defineProperty,Eu={f:ki?eF:function(e,t,r){if(bu(e),t=pd(t),bu(r),Z5)try{return eF(e,t,r)}catch(n){}if("get"in r||"set"in r)throw qie("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},aa=ki?function(e,t,r){return Eu.f(e,t,gu(1,r))}:function(e,t,r){return e[t]=r,e},eoe=ET.f,toe=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return B5(e,this,arguments)};return t.prototype=e.prototype,t},Ms=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,z=h?hr:S?hr[c]:(hr[c]||{}).prototype,F=h?mo:mo[c]||aa(mo,c,{})[c],N=F.prototype;for(i in t)r=!Zie(h?i:c+(S?".":"#")+i,e.forced)&&z&&Or(z,i),a=F[i],r&&(s=e.noTargetGet?(u=eoe(z,i))&&u.value:z[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?q5(o,hr):e.wrap&&r?toe(o):y&&oi(o)?mn(o):o,(e.sham||o&&o.sham||a&&a.sham)&&aa(l,"sham",!0),aa(F,i,l),y&&(Or(mo,n=c+"Prototype")||aa(mo,n,{}),aa(mo[n],i,o),e.real&&N&&!N[i]&&aa(N,i,o)))},C0=Array.isArray||function(e){return vu(e)=="Array"},roe=Math.ceil,noe=Math.floor,xT=function(e){var t=+e;return t!=t||t===0?0:(t>0?noe:roe)(t)},ioe=Math.min,T0=function(e){return(t=e.length)>0?ioe(xT(t),9007199254740991):0;var t},ST=function(e,t,r){var n=pd(t);n in e?Eu.f(e,n,gu(0,r)):e[n]=r},tF={};tF[Xi("toStringTag")]="z";var wT=String(tF)==="[object z]",ooe=Xi("toStringTag"),aoe=hr.Object,soe=vu(function(){return arguments}())=="Arguments",A0=wT?vu:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=aoe(e),ooe))=="string"?r:soe?vu(t):(n=vu(t))=="Object"&&oi(t.callee)?"Arguments":n},loe=mn(Function.toString);oi(Is.inspectSource)||(Is.inspectSource=function(e){return loe(e)});var rF=Is.inspectSource,nF=function(){},uoe=[],iF=qf("Reflect","construct"),CT=/^\s*(?:class|function)\b/,coe=mn(CT.exec),doe=!CT.exec(nF),np=function(e){if(!oi(e))return!1;try{return iF(nF,uoe,e),!0}catch(t){return!1}},hoe=!iF||$i(function(){var e;return np(np.call)||!np(Object)||!np(function(){e=!0})||e})?function(e){if(!oi(e))return!1;switch(A0(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return doe||!!coe(CT,rF(e))}:np,foe=Xi("species"),oF=hr.Array,aF=function(e,t){return new(function(r){var n;return C0(r)&&(n=r.constructor,(hoe(n)&&(n===oF||C0(n.prototype))||vo(n)&&(n=n[foe])===null)&&(n=void 0)),n===void 0?oF:n}(e))(t===0?0:t)},poe=Xi("species"),sF=Xi("isConcatSpreadable"),lF=hr.TypeError,goe=S0>=51||!$i(function(){var e=[];return e[sF]=!1,e.concat()[0]!==e}),voe=S0>=51||!$i(function(){var e=[];return(e.constructor={})[poe]=function(){return{foo:1}},e.concat(Boolean).foo!==1}),moe=function(e){if(!vo(e))return!1;var t=e[sF];return t!==void 0?!!t:C0(e)};Ms({target:"Array",proto:!0,forced:!goe||!voe},{concat:function(e){var t,r,n,i,o,a=ep(this),s=aF(a,0),l=0;for(t=-1,n=arguments.length;t9007199254740991)throw lF("Maximum allowed index exceeded");for(r=0;r=9007199254740991)throw lF("Maximum allowed index exceeded");ST(s,l++,o)}return s.length=l,s}});var D0,yoe=hr.String,O0=function(e){if(A0(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return yoe(e)},boe=Math.max,Eoe=Math.min,TT=function(e,t){var r=xT(e);return r<0?boe(r+t,0):Eoe(r,t)},uF=function(e){return function(t,r,n){var i,o=ia(t),a=T0(o),s=TT(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xoe={includes:uF(!0),indexOf:uF(!1)},ip={},Soe=xoe.indexOf,cF=mn([].push),dF=function(e,t){var r,n=ia(e),i=0,o=[];for(r in n)!Or(ip,r)&&Or(n,r)&&cF(o,r);for(;t.length>i;)Or(n,r=t[i++])&&(~Soe(o,r)||cF(o,r));return o},_0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],AT=Object.keys||function(e){return dF(e,_0)},woe=ki?Object.defineProperties:function(e,t){bu(e);for(var r,n=ia(t),i=AT(t),o=i.length,a=0;o>a;)Eu.f(e,r=i[a++],n[r]);return e},Coe=qf("document","documentElement"),hF=mu("keys"),R0=function(e){return hF[e]||(hF[e]=w0(e))},fF=R0("IE_PROTO"),DT=function(){},pF=function(e){return""},gF=function(e){e.write(pF("")),e.close();var t=e.parentWindow.Object;return e=null,t},k0=function(){try{D0=new ActiveXObject("htmlfile")}catch(n){}var e,t;k0=typeof document!="undefined"?document.domain&&D0?gF(D0):((t=Y5("iframe")).style.display="none",Coe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(pF("document.F=Object")),e.close(),e.F):gF(D0);for(var r=_0.length;r--;)delete k0.prototype[_0[r]];return k0()};ip[fF]=!0;var L0,op,P0,xu=Object.create||function(e,t){var r;return e!==null?(DT.prototype=bu(e),r=new DT,DT.prototype=null,r[fF]=e):r=k0(),t===void 0?r:woe(r,t)},Toe=_0.concat("length","prototype"),vF={f:Object.getOwnPropertyNames||function(e){return dF(e,Toe)}},Aoe=hr.Array,Doe=Math.max,mF=vF.f,yF=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],bF={f:function(e){return yF&&vu(e)=="Window"?function(t){try{return mF(t)}catch(r){return function(n,i,o){for(var a=T0(n),s=TT(void 0,a),l=TT(a,a),u=Aoe(Doe(l-s,0)),c=0;sD;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:wF(te,S)}else switch(e){case 4:return!1;case 7:wF(te,S)}return o?-1:n||i?i:te}},M0=[Bs(0),Bs(1),Bs(2),Bs(3),Bs(4),Bs(5),Bs(6),Bs(7)][0],Li=R0("hidden"),CF=Xi("toPrimitive"),Boe=md.set,TF=md.getterFor("Symbol"),Fo=Object.prototype,Fs=hr.Symbol,Ns=Fs&&Fs.prototype,AF=hr.TypeError,kT=hr.QObject,ap=qf("JSON","stringify"),DF=ET.f,js=Eu.f,OF=bF.f,Foe=pT.f,_F=mn([].push),Na=mu("symbols"),sp=mu("op-symbols"),LT=mu("string-to-symbol-registry"),PT=mu("symbol-to-string-registry"),Noe=mu("wks"),IT=!kT||!kT.prototype||!kT.prototype.findChild,MT=ki&&$i(function(){return xu(js({},"a",{get:function(){return js(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=DF(Fo,t);n&&delete Fo[t],js(e,t,r),n&&e!==Fo&&js(Fo,t,n)}:js,BT=function(e,t){var r=Na[e]=xu(Ns);return Boe(r,{type:"Symbol",tag:e,description:t}),ki||(r.description=t),r},B0=function(e,t,r){e===Fo&&B0(sp,t,r),bu(e);var n=pd(t);return bu(r),Or(Na,n)?(r.enumerable?(Or(e,Li)&&e[Li][n]&&(e[Li][n]=!1),r=xu(r,{enumerable:gu(0,!1)})):(Or(e,Li)||js(e,Li,gu(1,{})),e[Li][n]=!0),MT(e,n,r)):js(e,n,r)},RF=function(e,t){bu(e);var r=ia(t),n=AT(r).concat(FT(r));return M0(n,function(i){ki&&!Bo(kF,r,i)||B0(e,i,r[i])}),e},kF=function(e){var t=pd(e),r=Bo(Foe,this,t);return!(this===Fo&&Or(Na,t)&&!Or(sp,t))&&(!(r||!Or(this,t)||!Or(Na,t)||Or(this,Li)&&this[Li][t])||r)},LF=function(e,t){var r=ia(e),n=pd(t);if(r!==Fo||!Or(Na,n)||Or(sp,n)){var i=DF(r,n);return!i||!Or(Na,n)||Or(r,Li)&&r[Li][n]||(i.enumerable=!0),i}},PF=function(e){var t=OF(ia(e)),r=[];return M0(t,function(n){Or(Na,n)||Or(ip,n)||_F(r,n)}),r},FT=function(e){var t=e===Fo,r=OF(t?sp:ia(e)),n=[];return M0(r,function(i){!Or(Na,i)||t&&!Or(Fo,i)||_F(n,Na[i])}),n};if(oa||(Ns=(Fs=function(){if(z5(Ns,this))throw AF("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?O0(arguments[0]):void 0,t=w0(e),r=function(n){this===Fo&&Bo(r,sp,n),Or(this,Li)&&Or(this[Li],t)&&(this[Li][t]=!1),MT(this,t,gu(1,n))};return ki&&IT&&MT(Fo,t,{configurable:!0,set:r}),BT(t,e)}).prototype,gd(Ns,"toString",function(){return TF(this).tag}),gd(Fs,"withoutSetter",function(e){return BT(w0(e),e)}),pT.f=kF,Eu.f=B0,ET.f=LF,vF.f=bF.f=PF,OT.f=FT,_T.f=function(e){return BT(Xi(e),e)},ki&&js(Ns,"description",{configurable:!0,get:function(){return TF(this).description}})),Ms({global:!0,wrap:!0,forced:!oa,sham:!oa},{Symbol:Fs}),M0(AT(Noe),function(e){wn(e)}),Ms({target:"Symbol",stat:!0,forced:!oa},{for:function(e){var t=O0(e);if(Or(LT,t))return LT[t];var r=Fs(t);return LT[t]=r,PT[r]=t,r},keyFor:function(e){if(!fd(e))throw AF(e+" is not a symbol");if(Or(PT,e))return PT[e]},useSetter:function(){IT=!0},useSimple:function(){IT=!1}}),Ms({target:"Object",stat:!0,forced:!oa,sham:!ki},{create:function(e,t){return t===void 0?xu(e):RF(xu(e),t)},defineProperty:B0,defineProperties:RF,getOwnPropertyDescriptor:LF}),Ms({target:"Object",stat:!0,forced:!oa},{getOwnPropertyNames:PF,getOwnPropertySymbols:FT}),Ms({target:"Object",stat:!0,forced:$i(function(){OT.f(1)})},{getOwnPropertySymbols:function(e){return OT.f(ep(e))}}),ap){var joe=!oa||$i(function(){var e=Fs();return ap([e])!="[null]"||ap({a:e})!="{}"||ap(Object(e))!="{}"});Ms({target:"JSON",stat:!0,forced:joe},{stringify:function(e,t,r){var n=Ooe(arguments),i=t;if((vo(t)||e!==void 0)&&!fd(e))return C0(t)||(t=function(o,a){if(oi(i)&&(a=Bo(i,this,o,a)),!fd(a))return a}),n[1]=t,B5(ap,null,n)}})}if(!Ns[CF]){var Uoe=Ns.valueOf;gd(Ns,CF,function(e){return Bo(Uoe,this)})}I0(Fs,"Symbol"),ip[Li]=!0,wn("asyncIterator"),wn("hasInstance"),wn("isConcatSpreadable"),wn("iterator"),wn("match"),wn("matchAll"),wn("replace"),wn("search"),wn("species"),wn("split"),wn("toPrimitive"),wn("toStringTag"),wn("unscopables"),I0(hr.JSON,"JSON",!0);var Us,IF,MF,Hoe=mo.Symbol,wu={},BF=Function.prototype,zoe=ki&&Object.getOwnPropertyDescriptor,NT=Or(BF,"name"),Woe={EXISTS:NT,PROPER:NT&&function(){}.name==="something",CONFIGURABLE:NT&&(!ki||ki&&zoe(BF,"name").configurable)},Goe=!$i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),FF=R0("IE_PROTO"),jT=hr.Object,Voe=jT.prototype,UT=Goe?jT.getPrototypeOf:function(e){var t=ep(e);if(Or(t,FF))return t[FF];var r=t.constructor;return oi(r)&&t instanceof r?r.prototype:t instanceof jT?Voe:null},HT=Xi("iterator"),NF=!1;[].keys&&("next"in(MF=[].keys())?(IF=UT(UT(MF)))!==Object.prototype&&(Us=IF):NF=!0);var Koe=Us==null||$i(function(){var e={};return Us[HT].call(e)!==e});Us=Koe?{}:xu(Us),oi(Us[HT])||gd(Us,HT,function(){return this});var jF={IteratorPrototype:Us,BUGGY_SAFARI_ITERATORS:NF},$oe=jF.IteratorPrototype,Xoe=function(){return this};hr.String,hr.TypeError,Object.setPrototypeOf||"__proto__"in{}&&function(){var e={};try{mn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set)(e,[]),e instanceof Array}catch(t){}}();var Yoe=Woe.PROPER,F0=jF.BUGGY_SAFARI_ITERATORS,zT=Xi("iterator"),Zoe=function(){return this},UF=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=xu($oe,{next:gu(1,Q)}),I0(j,he,!1,!0),wu[he]=Xoe}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!F0&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,z=y[zT]||y["@@iterator"]||i&&y[i],F=!F0&&z||c(i),N=t=="Array"&&y.entries||z;if(N&&(s=UT(N.call(new e)))!==Object.prototype&&s.next&&(I0(s,h,!0,!0),wu[h]=Zoe),Yoe&&i=="values"&&z&&z.name!=="values"&&(S=!0,F=function(){return Bo(z,this)}),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(F0||S||!(u in y))&&gd(y,u,l[u]);else Ms({target:t,proto:!0,forced:F0||S},l);return a&&y[zT]!==F&&gd(y,zT,F,{name:i}),wu[t]=F,l},Joe=md.set,Qoe=md.getterFor("Array Iterator");UF(Array,"Array",function(e,t){Joe(this,{type:"Array Iterator",target:ia(e),index:0,kind:t})},function(){var e=Qoe(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),wu.Arguments=wu.Array;var HF=Xi("toStringTag");for(var WT in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var zF=hr[WT],GT=zF&&zF.prototype;GT&&A0(GT)!==HF&&aa(GT,HF,WT),wu[WT]=wu.Array}var qoe=Hoe;wn("asyncDispose"),wn("dispose"),wn("matcher"),wn("metadata"),wn("observable"),wn("patternMatch"),wn("replaceAll");var N0=qoe,eae=mn("".charAt),WF=mn("".charCodeAt),tae=mn("".slice),GF=function(e){return function(t,r){var n,i,o=O0(vT(t)),a=xT(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=WF(o,a))<55296||n>56319||a+1===s||(i=WF(o,a+1))<56320||i>57343?e?eae(o,a):n:e?tae(o,a,a+2):i-56320+(n-55296<<10)+65536}},rae=(GF(!1),GF(!0)),nae=md.set,iae=md.getterFor("String Iterator");UF(String,"String",function(e){nae(this,{type:"String Iterator",string:O0(e),index:0})},function(){var e,t=iae(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=rae(r,n),t.index+=e.length,{value:e,done:!1})});var oae=_T.f("iterator"),aae=e0(function(e){function t(r){return typeof N0=="function"&&typeof oae=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof N0=="function"&&n.constructor===N0&&n!==N0.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),VF=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(aae),sae=s0.EXISTS,lae=td.f,KF=Function.prototype,uae=Qt(KF.toString),$F=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,cae=Qt($F.exec);Io&&!sae&&lae(KF,"name",{configurable:!0,get:function(){try{return cae($F,uae(this))[1]}catch(e){return""}}});var XF=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.mark,n=de.marks(t);return n&&n[r]?n[r]:""},e.prototype.isDisabled=function(t){return t.selection==null||(this.mark,!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0])},e.prototype.exec=function(t,r){var n=this.mark;r?t.addMark(n,r):t.removeMark(n)},e}(),dae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontSize.title"),r.iconSvg=jre,r.mark="fontSize",r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontSizeList,o=i===void 0?[]:i;n.push({text:wt("fontSize.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),hae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontFamily.title"),r.iconSvg=Ure,r.mark="fontFamily",r.selectPanelWidth=150,r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontFamilyList,o=i===void 0?[]:i;n.push({text:wt("fontFamily.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s,styleForRenderMenuList:{"font-family":s}});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u,styleForRenderMenuList:{"font-family":u}})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),fae={renderStyle:function(e,t){var r=e,n=r.fontSize,i=r.fontFamily,o=t;return n&&fu(o,{fontSize:n}),i&&fu(o,{fontFamily:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.fontSize,o=n.fontFamily;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e(""+t+"")),i&&r.css("font-size",i),o&&r.css("font-family",o),ld(r)):t},preParseHtml:[Sie],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=r.getMenuConfig("fontSize").fontSizeList,a=o===void 0?[]:o,s=Mo(n,"font-size"),l=a.find(function(y){return y.value&&y.value===s})||a.includes(s);s&&l&&(i.fontSize=s);var u=r.getMenuConfig("fontFamily").fontFamilyList,c=u===void 0?[]:u,h=Mo(n,"font-family").replace(/"/g,""),S=c.find(function(y){return y.value&&y.value===h})||c.includes(h);return h&&S&&(i.fontFamily=h),i},menus:[{key:"fontSize",factory:function(){return new dae},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new hae},config:{fontFamilyList:["\u9ED1\u4F53",{name:"\u4EFF\u5B8B",value:"\u4EFF\u5B8B"},"\u6977\u4F53","\u6807\u6977\u4F53","\u534E\u6587\u4EFF\u5B8B","\u534E\u6587\u6977\u4F53",{name:"\u5B8B\u4F53",value:"\u5B8B\u4F53"},"\u5FAE\u8F6F\u96C5\u9ED1","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]},pae={selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=_e(e),r=Mo(t,"padding-left");return/\dem/.test(r)&&t.css("text-indent","2em"),/\dpx/.test(r)&&parseInt(r,10)%32==0&&t.css("text-indent","2em"),t[0]}},YF=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){var r=Dr(de.nodes(t,{match:function(i){return!!i.indent},universal:!0}),1),n=r[0];return n==null?"":Dr(n,1)[0].indent||""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e}(),gae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.decrease"),r.iconSvg=Hre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:null},{match:function(i){return Ut.isElement(i)}})},t}(YF),vae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.increase"),r.iconSvg=zre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:"2em"},{match:function(i){return Ut.isElement(i)},mode:"highest"})},t}(YF),mae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent,n=t;return r&&fu(n,{textIndent:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent;if(!r)return t;var n=_e(t);return n.css("text-indent",r),ld(n)},preParseHtml:[pae],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-indent"),a=parseInt(o,10);return o&&a>0&&(i.indent=o),i},menus:[{key:"indent",factory:function(){return new vae}},{key:"delIndent",factory:function(){return new gae}}]},j0=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||i==="blockquote"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","code"].includes(n)||void 0})},e}(),yae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.left"),r.iconSvg=Wre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"left"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),bae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.right"),r.iconSvg=Gre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"right"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Eae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.center"),r.iconSvg=Vre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"center"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),xae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.justify"),r.iconSvg=Kre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"justify"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Sae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign,n=t;return r&&fu(n,{textAlign:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign;if(!r)return t;var n=_e(t);return n.css("text-align",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-align");return o&&(i.textAlign=o),i},menus:[{key:"justifyLeft",factory:function(){return new yae}},{key:"justifyRight",factory:function(){return new bae}},{key:"justifyCenter",factory:function(){return new Eae}},{key:"justifyJustify",factory:function(){return new xae}}]},wae=function(){function e(){this.title=wt("lineHeight.title"),this.iconSvg='',this.tag="select",this.width=80}return e.prototype.getOptions=function(t){var r=[],n=t.getMenuConfig("lineHeight").lineHeightList,i=n===void 0?[]:n;r.push({text:wt("lineHeight.default"),value:""}),i.forEach(function(a){r.push({text:a,value:a})});var o=this.getValue(t);return r.forEach(function(a){a.value===o?a.selected=!0:delete a.selected}),r},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return!!i.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(i)},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.getMatchNode(t);return r==null?"":Ut.isElement(r)&&r.lineHeight||""},e.prototype.isDisabled=function(t){return t.selection==null||this.getMatchNode(t)==null},e.prototype.exec=function(t,r){Ve.setNodes(t,{lineHeight:r.toString()},{mode:"highest"})},e}(),Cae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight,n=t;return r&&fu(n,{lineHeight:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var n=_e(t);return n.css("line-height",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=r.getMenuConfig("lineHeight").lineHeightList,a=o===void 0?[]:o,s=Mo(n,"line-height");return s&&a.includes(s)&&(i.lineHeight=s),i},menus:[{key:"lineHeight",factory:function(){return new wae},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]},Tae=function(){function e(){this.title=wt("undo.redo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.redo=="function"&&t.redo()},e}(),Aae=function(){function e(){this.title=wt("undo.undo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.undo=="function"&&t.undo()},e}(),Dae={menus:[{key:"redo",factory:function(){return new Tae}},{key:"undo",factory:function(){return new Aae}}]},Oae={type:"divider",renderElem:function(e,t,r){return wc("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ae.isNodeSelected(r,e)?"true":""},style:{},on:{mousedown:function(n){return n.preventDefault()}}},[wc("hr")])}},_ae=function(){function e(){this.title=wt("divider.title"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(t.isVoid(r))return!0;var n=Ae.getNodeType(r);return n==="table"||n==="pre"||void 0})},e.prototype.exec=function(t,r){Ve.insertNodes(t,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}(),Rae={renderElems:[Oae],elemsToHtml:[{type:"divider",elemToHtml:function(e,t){return"
        "}}],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,r){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new _ae}}],editorPlugin:function(e){var t=e.isVoid,r=e.normalizeNode,n=e;return n.isVoid=function(i){return i.type==="divider"||t(i)},n.normalizeNode=function(i){var o=Dr(i,2),a=o[0],s=o[1];if(Ae.getNodeType(a)!=="divider")return r([a,s]);Ae.isLastNode(n,a)&&Ve.insertNodes(n,Ae.genEmptyParagraph(),{at:[s[0]+1]})},n}},kae=d0.map;Hn({target:"Array",proto:!0,forced:!OC("map")},{map:function(e){return kae(this,e,arguments.length>1?arguments[1]:void 0)}});var Lae=Qt([].join),Pae=n0!=Object,Iae=i5("join",",");Hn({target:"Array",proto:!0,forced:Pae||!Iae},{join:function(e){return Lae(ed(this),e===void 0?",":e)}});var Mae=function(){function e(){this.title=wt("codeBlock.title"),this.iconSvg='',this.tag="button"}return e.prototype.getSelectCodeElem=function(t){var r=Ae.getSelectedNodeByType(t,"code");if(r==null)return null;var n=Ae.getParentNode(t,r);return n==null||Ae.getNodeType(n)!=="pre"?null:r},e.prototype.getValue=function(t){var r=this.getSelectCodeElem(t);return r==null?"":r.language||""},e.prototype.isActive=function(t){return!!this.getSelectCodeElem(t)},e.prototype.isDisabled=function(t){if(t.selection==null)return!0;var r=Ae.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!r.some(function(n){var i=Ae.getNodeType(n);if(i==="pre"||i==="paragraph")return!0})},e.prototype.exec=function(t,r){this.isActive(t)?this.changeToPlainText(t):this.changeToCodeBlock(t,r.toString())},e.prototype.changeToPlainText=function(t){var r=this.getSelectCodeElem(t);if(r!=null){var n=St.string(r);Ve.removeNodes(t,{mode:"highest"});var i=n.split(` +`)},n}},bie=function(){function e(){this.title=wt("emotion.title"),this.iconSvg='',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(t,r){},e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0]},e.prototype.getPanelContentElem=function(t){if(this.$content==null){var r=_e('
          ');r.on("click","li",function(o){var a=o.target;if(a!=null){o.preventDefault();var s=_e(a).text();t.insertText(s)}}),this.$content=r}var n=this.$content;if(n==null)return document.createElement("ul");n.empty();var i=t.getMenuConfig("emotion").emotions;return(i===void 0?[]:i).forEach(function(o){var a=_e("
        • "+o+"
        • ");n.append(a)}),n[0]},e}(),Eie={menus:[{key:"emotion",factory:function(){return new bie},config:{emotions:"\u{1F600} \u{1F603} \u{1F604} \u{1F601} \u{1F606} \u{1F605} \u{1F602} \u{1F923} \u{1F60A} \u{1F607} \u{1F642} \u{1F643} \u{1F609} \u{1F60C} \u{1F60D} \u{1F618} \u{1F617} \u{1F619} \u{1F61A} \u{1F60B} \u{1F61B} \u{1F61D} \u{1F61C} \u{1F913} \u{1F60E} \u{1F60F} \u{1F612} \u{1F61E} \u{1F614} \u{1F61F} \u{1F615} \u{1F641} \u{1F623} \u{1F616} \u{1F62B} \u{1F629} \u{1F622} \u{1F62D} \u{1F624} \u{1F620} \u{1F621} \u{1F633} \u{1F631} \u{1F628} \u{1F917} \u{1F914} \u{1F636} \u{1F611} \u{1F62C} \u{1F644} \u{1F62F} \u{1F634} \u{1F637} \u{1F911} \u{1F608} \u{1F921} \u{1F4A9} \u{1F47B} \u{1F480} \u{1F440} \u{1F463} \u{1F450} \u{1F64C} \u{1F44F} \u{1F91D} \u{1F44D} \u{1F44E} \u{1F44A} \u270A \u{1F91B} \u{1F91C} \u{1F91E} \u270C\uFE0F \u{1F918} \u{1F44C} \u{1F448} \u{1F449} \u{1F446} \u{1F447} \u261D\uFE0F \u270B \u{1F91A} \u{1F590} \u{1F596} \u{1F44B} \u{1F919} \u{1F4AA} \u{1F595} \u270D\uFE0F \u{1F64F}".split(" ")}}]},xie={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"},Sie={selector:"font",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="font")return e;var r=t.attr("size")||"";r&&(t.removeAttr("size"),t.css("font-size",xie[r]));var n=t.attr("face")||"";return n&&(t.removeAttr("face"),t.css("font-family",n)),t[0]}},wie=Qt("".indexOf);Hn({target:"String",proto:!0,forced:!d5("includes")},{includes:function(e){return!!~wie(cn(fo(this)),cn(c5(e)),arguments.length>1?arguments[1]:void 0)}});var Ps,E0,x0=function(e){return e&&e.Math==Math&&e},hr=x0(typeof globalThis=="object"&&globalThis)||x0(typeof window=="object"&&window)||x0(typeof self=="object"&&self)||x0(typeof qm=="object"&&qm)||function(){return this}()||Function("return this")(),dT=Function.prototype,I5=dT.apply,Cie=dT.bind,M5=dT.call,B5=typeof Reflect=="object"&&Reflect.apply||(Cie?M5.bind(I5):function(){return M5.apply(I5,arguments)}),F5=Function.prototype,hT=F5.bind,fT=F5.call,Tie=hT&&hT.bind(fT),mn=hT?function(e){return e&&Tie(fT,e)}:function(e){return e&&function(){return fT.apply(e,arguments)}},oi=function(e){return typeof e=="function"},$i=function(e){try{return!!e()}catch(t){return!0}},ki=!$i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Qf=Function.prototype.call,Bo=Qf.bind?Qf.bind(Qf):function(){return Qf.apply(Qf,arguments)},N5={}.propertyIsEnumerable,j5=Object.getOwnPropertyDescriptor,Aie=j5&&!N5.call({1:2},1)?function(e){var t=j5(this,e);return!!t&&t.enumerable}:N5,pT={f:Aie},gu=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Die=mn({}.toString),Oie=mn("".slice),vu=function(e){return Oie(Die(e),8,-1)},gT=hr.Object,_ie=mn("".split),U5=$i(function(){return!gT("z").propertyIsEnumerable(0)})?function(e){return vu(e)=="String"?_ie(e,""):gT(e)}:gT,Rie=hr.TypeError,vT=function(e){if(e==null)throw Rie("Can't call method on "+e);return e},ia=function(e){return U5(vT(e))},vo=function(e){return typeof e=="object"?e!==null:oi(e)},mo={},H5=function(e){return oi(e)?e:void 0},qf=function(e,t){return arguments.length<2?H5(mo[e])||H5(hr[e]):mo[e]&&mo[e][t]||hr[e]&&hr[e][t]},z5=mn({}.isPrototypeOf),mT=qf("navigator","userAgent")||"",W5=hr.process,G5=hr.Deno,V5=W5&&W5.versions||G5&&G5.version,K5=V5&&V5.v8;K5&&(E0=(Ps=K5.split("."))[0]>0&&Ps[0]<4?1:+(Ps[0]+Ps[1])),!E0&&mT&&(!(Ps=mT.match(/Edge\/(\d+)/))||Ps[1]>=74)&&(Ps=mT.match(/Chrome\/(\d+)/))&&(E0=+Ps[1]);var S0=E0,oa=!!Object.getOwnPropertySymbols&&!$i(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&S0&&S0<41}),yT=oa&&!Symbol.sham&&typeof Symbol.iterator=="symbol",kie=hr.Object,fd=yT?function(e){return typeof e=="symbol"}:function(e){var t=qf("Symbol");return oi(t)&&z5(t.prototype,kie(e))},Lie=hr.String,Pie=hr.TypeError,$5=function(e){if(oi(e))return e;throw Pie(function(t){try{return Lie(t)}catch(r){return"Object"}}(e)+" is not a function")},Iie=hr.TypeError,Mie=Object.defineProperty,Is=hr["__core-js_shared__"]||function(e,t){try{Mie(hr,e,{value:t,configurable:!0,writable:!0})}catch(r){hr[e]=t}return t}("__core-js_shared__",{}),mu=e0(function(e){(e.exports=function(t,r){return Is[t]||(Is[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"pure",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Bie=hr.Object,ep=function(e){return Bie(vT(e))},Fie=mn({}.hasOwnProperty),Or=Object.hasOwn||function(e,t){return Fie(ep(e),t)},Nie=0,jie=Math.random(),Uie=mn(1 .toString),w0=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Uie(++Nie+jie,36)},tp=mu("wks"),yu=hr.Symbol,X5=yu&&yu.for,Hie=yT?yu:yu&&yu.withoutSetter||w0,Xi=function(e){if(!Or(tp,e)||!oa&&typeof tp[e]!="string"){var t="Symbol."+e;oa&&Or(yu,e)?tp[e]=yu[e]:tp[e]=yT&&X5?X5(t):Hie(t)}return tp[e]},zie=hr.TypeError,Wie=Xi("toPrimitive"),pd=function(e){var t=function(r,n){if(!vo(r)||fd(r))return r;var i,o,a=(i=r[Wie])==null?void 0:$5(i);if(a){if(n===void 0&&(n="default"),o=Bo(a,r,n),!vo(o)||fd(o))return o;throw zie("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(s,l){var u,c;if(l==="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;if(oi(u=s.valueOf)&&!vo(c=Bo(u,s)))return c;if(l!=="string"&&oi(u=s.toString)&&!vo(c=Bo(u,s)))return c;throw Iie("Can't convert object to primitive value")}(r,n)}(e,"string");return fd(t)?t:t+""},bT=hr.document,Gie=vo(bT)&&vo(bT.createElement),Y5=function(e){return Gie?bT.createElement(e):{}},Z5=!ki&&!$i(function(){return Object.defineProperty(Y5("div"),"a",{get:function(){return 7}}).a!=7}),J5=Object.getOwnPropertyDescriptor,ET={f:ki?J5:function(e,t){if(e=ia(e),t=pd(t),Z5)try{return J5(e,t)}catch(r){}if(Or(e,t))return gu(!Bo(pT.f,e,t),e[t])}},Vie=/#|\.prototype\./,rp=function(e,t){var r=$ie[Kie(e)];return r==Yie||r!=Xie&&(oi(t)?$i(t):!!t)},Kie=rp.normalize=function(e){return String(e).replace(Vie,".").toLowerCase()},$ie=rp.data={},Xie=rp.NATIVE="N",Yie=rp.POLYFILL="P",Zie=rp,Q5=mn(mn.bind),q5=function(e,t){return $5(e),t===void 0?e:Q5?Q5(e,t):function(){return e.apply(t,arguments)}},Jie=hr.String,Qie=hr.TypeError,bu=function(e){if(vo(e))return e;throw Qie(Jie(e)+" is not an object")},qie=hr.TypeError,eF=Object.defineProperty,Eu={f:ki?eF:function(e,t,r){if(bu(e),t=pd(t),bu(r),Z5)try{return eF(e,t,r)}catch(n){}if("get"in r||"set"in r)throw qie("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},aa=ki?function(e,t,r){return Eu.f(e,t,gu(1,r))}:function(e,t,r){return e[t]=r,e},eoe=ET.f,toe=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return B5(e,this,arguments)};return t.prototype=e.prototype,t},Ms=function(e,t){var r,n,i,o,a,s,l,u,c=e.target,h=e.global,S=e.stat,y=e.proto,W=h?hr:S?hr[c]:(hr[c]||{}).prototype,F=h?mo:mo[c]||aa(mo,c,{})[c],N=F.prototype;for(i in t)r=!Zie(h?i:c+(S?".":"#")+i,e.forced)&&W&&Or(W,i),a=F[i],r&&(s=e.noTargetGet?(u=eoe(W,i))&&u.value:W[i]),o=r&&s?s:t[i],r&&typeof a==typeof o||(l=e.bind&&r?q5(o,hr):e.wrap&&r?toe(o):y&&oi(o)?mn(o):o,(e.sham||o&&o.sham||a&&a.sham)&&aa(l,"sham",!0),aa(F,i,l),y&&(Or(mo,n=c+"Prototype")||aa(mo,n,{}),aa(mo[n],i,o),e.real&&N&&!N[i]&&aa(N,i,o)))},C0=Array.isArray||function(e){return vu(e)=="Array"},roe=Math.ceil,noe=Math.floor,xT=function(e){var t=+e;return t!=t||t===0?0:(t>0?noe:roe)(t)},ioe=Math.min,T0=function(e){return(t=e.length)>0?ioe(xT(t),9007199254740991):0;var t},ST=function(e,t,r){var n=pd(t);n in e?Eu.f(e,n,gu(0,r)):e[n]=r},tF={};tF[Xi("toStringTag")]="z";var wT=String(tF)==="[object z]",ooe=Xi("toStringTag"),aoe=hr.Object,soe=vu(function(){return arguments}())=="Arguments",A0=wT?vu:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=aoe(e),ooe))=="string"?r:soe?vu(t):(n=vu(t))=="Object"&&oi(t.callee)?"Arguments":n},loe=mn(Function.toString);oi(Is.inspectSource)||(Is.inspectSource=function(e){return loe(e)});var rF=Is.inspectSource,nF=function(){},uoe=[],iF=qf("Reflect","construct"),CT=/^\s*(?:class|function)\b/,coe=mn(CT.exec),doe=!CT.exec(nF),np=function(e){if(!oi(e))return!1;try{return iF(nF,uoe,e),!0}catch(t){return!1}},hoe=!iF||$i(function(){var e;return np(np.call)||!np(Object)||!np(function(){e=!0})||e})?function(e){if(!oi(e))return!1;switch(A0(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return doe||!!coe(CT,rF(e))}:np,foe=Xi("species"),oF=hr.Array,aF=function(e,t){return new(function(r){var n;return C0(r)&&(n=r.constructor,(hoe(n)&&(n===oF||C0(n.prototype))||vo(n)&&(n=n[foe])===null)&&(n=void 0)),n===void 0?oF:n}(e))(t===0?0:t)},poe=Xi("species"),sF=Xi("isConcatSpreadable"),lF=hr.TypeError,goe=S0>=51||!$i(function(){var e=[];return e[sF]=!1,e.concat()[0]!==e}),voe=S0>=51||!$i(function(){var e=[];return(e.constructor={})[poe]=function(){return{foo:1}},e.concat(Boolean).foo!==1}),moe=function(e){if(!vo(e))return!1;var t=e[sF];return t!==void 0?!!t:C0(e)};Ms({target:"Array",proto:!0,forced:!goe||!voe},{concat:function(e){var t,r,n,i,o,a=ep(this),s=aF(a,0),l=0;for(t=-1,n=arguments.length;t9007199254740991)throw lF("Maximum allowed index exceeded");for(r=0;r=9007199254740991)throw lF("Maximum allowed index exceeded");ST(s,l++,o)}return s.length=l,s}});var D0,yoe=hr.String,O0=function(e){if(A0(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return yoe(e)},boe=Math.max,Eoe=Math.min,TT=function(e,t){var r=xT(e);return r<0?boe(r+t,0):Eoe(r,t)},uF=function(e){return function(t,r,n){var i,o=ia(t),a=T0(o),s=TT(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},xoe={includes:uF(!0),indexOf:uF(!1)},ip={},Soe=xoe.indexOf,cF=mn([].push),dF=function(e,t){var r,n=ia(e),i=0,o=[];for(r in n)!Or(ip,r)&&Or(n,r)&&cF(o,r);for(;t.length>i;)Or(n,r=t[i++])&&(~Soe(o,r)||cF(o,r));return o},_0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],AT=Object.keys||function(e){return dF(e,_0)},woe=ki?Object.defineProperties:function(e,t){bu(e);for(var r,n=ia(t),i=AT(t),o=i.length,a=0;o>a;)Eu.f(e,r=i[a++],n[r]);return e},Coe=qf("document","documentElement"),hF=mu("keys"),R0=function(e){return hF[e]||(hF[e]=w0(e))},fF=R0("IE_PROTO"),DT=function(){},pF=function(e){return""},gF=function(e){e.write(pF("")),e.close();var t=e.parentWindow.Object;return e=null,t},k0=function(){try{D0=new ActiveXObject("htmlfile")}catch(n){}var e,t;k0=typeof document!="undefined"?document.domain&&D0?gF(D0):((t=Y5("iframe")).style.display="none",Coe.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(pF("document.F=Object")),e.close(),e.F):gF(D0);for(var r=_0.length;r--;)delete k0.prototype[_0[r]];return k0()};ip[fF]=!0;var L0,op,P0,xu=Object.create||function(e,t){var r;return e!==null?(DT.prototype=bu(e),r=new DT,DT.prototype=null,r[fF]=e):r=k0(),t===void 0?r:woe(r,t)},Toe=_0.concat("length","prototype"),vF={f:Object.getOwnPropertyNames||function(e){return dF(e,Toe)}},Aoe=hr.Array,Doe=Math.max,mF=vF.f,yF=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],bF={f:function(e){return yF&&vu(e)=="Window"?function(t){try{return mF(t)}catch(r){return function(n,i,o){for(var a=T0(n),s=TT(void 0,a),l=TT(a,a),u=Aoe(Doe(l-s,0)),c=0;sD;D++)if((s||D in F)&&(y=N(S=F[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:wF(te,S)}else switch(e){case 4:return!1;case 7:wF(te,S)}return o?-1:n||i?i:te}},M0=[Bs(0),Bs(1),Bs(2),Bs(3),Bs(4),Bs(5),Bs(6),Bs(7)][0],Li=R0("hidden"),CF=Xi("toPrimitive"),Boe=md.set,TF=md.getterFor("Symbol"),Fo=Object.prototype,Fs=hr.Symbol,Ns=Fs&&Fs.prototype,AF=hr.TypeError,kT=hr.QObject,ap=qf("JSON","stringify"),DF=ET.f,js=Eu.f,OF=bF.f,Foe=pT.f,_F=mn([].push),Na=mu("symbols"),sp=mu("op-symbols"),LT=mu("string-to-symbol-registry"),PT=mu("symbol-to-string-registry"),Noe=mu("wks"),IT=!kT||!kT.prototype||!kT.prototype.findChild,MT=ki&&$i(function(){return xu(js({},"a",{get:function(){return js(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=DF(Fo,t);n&&delete Fo[t],js(e,t,r),n&&e!==Fo&&js(Fo,t,n)}:js,BT=function(e,t){var r=Na[e]=xu(Ns);return Boe(r,{type:"Symbol",tag:e,description:t}),ki||(r.description=t),r},B0=function(e,t,r){e===Fo&&B0(sp,t,r),bu(e);var n=pd(t);return bu(r),Or(Na,n)?(r.enumerable?(Or(e,Li)&&e[Li][n]&&(e[Li][n]=!1),r=xu(r,{enumerable:gu(0,!1)})):(Or(e,Li)||js(e,Li,gu(1,{})),e[Li][n]=!0),MT(e,n,r)):js(e,n,r)},RF=function(e,t){bu(e);var r=ia(t),n=AT(r).concat(FT(r));return M0(n,function(i){ki&&!Bo(kF,r,i)||B0(e,i,r[i])}),e},kF=function(e){var t=pd(e),r=Bo(Foe,this,t);return!(this===Fo&&Or(Na,t)&&!Or(sp,t))&&(!(r||!Or(this,t)||!Or(Na,t)||Or(this,Li)&&this[Li][t])||r)},LF=function(e,t){var r=ia(e),n=pd(t);if(r!==Fo||!Or(Na,n)||Or(sp,n)){var i=DF(r,n);return!i||!Or(Na,n)||Or(r,Li)&&r[Li][n]||(i.enumerable=!0),i}},PF=function(e){var t=OF(ia(e)),r=[];return M0(t,function(n){Or(Na,n)||Or(ip,n)||_F(r,n)}),r},FT=function(e){var t=e===Fo,r=OF(t?sp:ia(e)),n=[];return M0(r,function(i){!Or(Na,i)||t&&!Or(Fo,i)||_F(n,Na[i])}),n};if(oa||(Ns=(Fs=function(){if(z5(Ns,this))throw AF("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?O0(arguments[0]):void 0,t=w0(e),r=function(n){this===Fo&&Bo(r,sp,n),Or(this,Li)&&Or(this[Li],t)&&(this[Li][t]=!1),MT(this,t,gu(1,n))};return ki&&IT&&MT(Fo,t,{configurable:!0,set:r}),BT(t,e)}).prototype,gd(Ns,"toString",function(){return TF(this).tag}),gd(Fs,"withoutSetter",function(e){return BT(w0(e),e)}),pT.f=kF,Eu.f=B0,ET.f=LF,vF.f=bF.f=PF,OT.f=FT,_T.f=function(e){return BT(Xi(e),e)},ki&&js(Ns,"description",{configurable:!0,get:function(){return TF(this).description}})),Ms({global:!0,wrap:!0,forced:!oa,sham:!oa},{Symbol:Fs}),M0(AT(Noe),function(e){wn(e)}),Ms({target:"Symbol",stat:!0,forced:!oa},{for:function(e){var t=O0(e);if(Or(LT,t))return LT[t];var r=Fs(t);return LT[t]=r,PT[r]=t,r},keyFor:function(e){if(!fd(e))throw AF(e+" is not a symbol");if(Or(PT,e))return PT[e]},useSetter:function(){IT=!0},useSimple:function(){IT=!1}}),Ms({target:"Object",stat:!0,forced:!oa,sham:!ki},{create:function(e,t){return t===void 0?xu(e):RF(xu(e),t)},defineProperty:B0,defineProperties:RF,getOwnPropertyDescriptor:LF}),Ms({target:"Object",stat:!0,forced:!oa},{getOwnPropertyNames:PF,getOwnPropertySymbols:FT}),Ms({target:"Object",stat:!0,forced:$i(function(){OT.f(1)})},{getOwnPropertySymbols:function(e){return OT.f(ep(e))}}),ap){var joe=!oa||$i(function(){var e=Fs();return ap([e])!="[null]"||ap({a:e})!="{}"||ap(Object(e))!="{}"});Ms({target:"JSON",stat:!0,forced:joe},{stringify:function(e,t,r){var n=Ooe(arguments),i=t;if((vo(t)||e!==void 0)&&!fd(e))return C0(t)||(t=function(o,a){if(oi(i)&&(a=Bo(i,this,o,a)),!fd(a))return a}),n[1]=t,B5(ap,null,n)}})}if(!Ns[CF]){var Uoe=Ns.valueOf;gd(Ns,CF,function(e){return Bo(Uoe,this)})}I0(Fs,"Symbol"),ip[Li]=!0,wn("asyncIterator"),wn("hasInstance"),wn("isConcatSpreadable"),wn("iterator"),wn("match"),wn("matchAll"),wn("replace"),wn("search"),wn("species"),wn("split"),wn("toPrimitive"),wn("toStringTag"),wn("unscopables"),I0(hr.JSON,"JSON",!0);var Us,IF,MF,Hoe=mo.Symbol,wu={},BF=Function.prototype,zoe=ki&&Object.getOwnPropertyDescriptor,NT=Or(BF,"name"),Woe={EXISTS:NT,PROPER:NT&&function(){}.name==="something",CONFIGURABLE:NT&&(!ki||ki&&zoe(BF,"name").configurable)},Goe=!$i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),FF=R0("IE_PROTO"),jT=hr.Object,Voe=jT.prototype,UT=Goe?jT.getPrototypeOf:function(e){var t=ep(e);if(Or(t,FF))return t[FF];var r=t.constructor;return oi(r)&&t instanceof r?r.prototype:t instanceof jT?Voe:null},HT=Xi("iterator"),NF=!1;[].keys&&("next"in(MF=[].keys())?(IF=UT(UT(MF)))!==Object.prototype&&(Us=IF):NF=!0);var Koe=Us==null||$i(function(){var e={};return Us[HT].call(e)!==e});Us=Koe?{}:xu(Us),oi(Us[HT])||gd(Us,HT,function(){return this});var jF={IteratorPrototype:Us,BUGGY_SAFARI_ITERATORS:NF},$oe=jF.IteratorPrototype,Xoe=function(){return this};hr.String,hr.TypeError,Object.setPrototypeOf||"__proto__"in{}&&function(){var e={};try{mn(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set)(e,[]),e instanceof Array}catch(t){}}();var Yoe=Woe.PROPER,F0=jF.BUGGY_SAFARI_ITERATORS,zT=Xi("iterator"),Zoe=function(){return this},UF=function(e,t,r,n,i,o,a){!function(j,D,Q,te){var he=D+" Iterator";j.prototype=xu($oe,{next:gu(1,Q)}),I0(j,he,!1,!0),wu[he]=Xoe}(r,t,n);var s,l,u,c=function(j){if(j===i&&F)return F;if(!F0&&j in y)return y[j];switch(j){case"keys":case"values":case"entries":return function(){return new r(this,j)}}return function(){return new r(this)}},h=t+" Iterator",S=!1,y=e.prototype,W=y[zT]||y["@@iterator"]||i&&y[i],F=!F0&&W||c(i),N=t=="Array"&&y.entries||W;if(N&&(s=UT(N.call(new e)))!==Object.prototype&&s.next&&(I0(s,h,!0,!0),wu[h]=Zoe),Yoe&&i=="values"&&W&&W.name!=="values"&&(S=!0,F=function(){return Bo(W,this)}),i)if(l={values:c("values"),keys:o?F:c("keys"),entries:c("entries")},a)for(u in l)(F0||S||!(u in y))&&gd(y,u,l[u]);else Ms({target:t,proto:!0,forced:F0||S},l);return a&&y[zT]!==F&&gd(y,zT,F,{name:i}),wu[t]=F,l},Joe=md.set,Qoe=md.getterFor("Array Iterator");UF(Array,"Array",function(e,t){Joe(this,{type:"Array Iterator",target:ia(e),index:0,kind:t})},function(){var e=Qoe(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),wu.Arguments=wu.Array;var HF=Xi("toStringTag");for(var WT in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var zF=hr[WT],GT=zF&&zF.prototype;GT&&A0(GT)!==HF&&aa(GT,HF,WT),wu[WT]=wu.Array}var qoe=Hoe;wn("asyncDispose"),wn("dispose"),wn("matcher"),wn("metadata"),wn("observable"),wn("patternMatch"),wn("replaceAll");var N0=qoe,eae=mn("".charAt),WF=mn("".charCodeAt),tae=mn("".slice),GF=function(e){return function(t,r){var n,i,o=O0(vT(t)),a=xT(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=WF(o,a))<55296||n>56319||a+1===s||(i=WF(o,a+1))<56320||i>57343?e?eae(o,a):n:e?tae(o,a,a+2):i-56320+(n-55296<<10)+65536}},rae=(GF(!1),GF(!0)),nae=md.set,iae=md.getterFor("String Iterator");UF(String,"String",function(e){nae(this,{type:"String Iterator",string:O0(e),index:0})},function(){var e,t=iae(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=rae(r,n),t.index+=e.length,{value:e,done:!1})});var oae=_T.f("iterator"),aae=e0(function(e){function t(r){return typeof N0=="function"&&typeof oae=="symbol"?(e.exports=t=function(n){return typeof n},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(n){return n&&typeof N0=="function"&&n.constructor===N0&&n!==N0.prototype?"symbol":typeof n},e.exports.default=e.exports,e.exports.__esModule=!0),t(r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),VF=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(aae),sae=s0.EXISTS,lae=td.f,KF=Function.prototype,uae=Qt(KF.toString),$F=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,cae=Qt($F.exec);Io&&!sae&&lae(KF,"name",{configurable:!0,get:function(){try{return cae($F,uae(this))[1]}catch(e){return""}}});var XF=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.mark,n=de.marks(t);return n&&n[r]?n[r]:""},e.prototype.isDisabled=function(t){return t.selection==null||(this.mark,!!Dr(de.nodes(t,{match:function(r){return Ae.getNodeType(r)==="pre"||!!de.isVoid(t,r)},universal:!0}),1)[0])},e.prototype.exec=function(t,r){var n=this.mark;r?t.addMark(n,r):t.removeMark(n)},e}(),dae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontSize.title"),r.iconSvg=jre,r.mark="fontSize",r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontSizeList,o=i===void 0?[]:i;n.push({text:wt("fontSize.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),hae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("fontFamily.title"),r.iconSvg=Ure,r.mark="fontFamily",r.selectPanelWidth=150,r}return nn(t,e),t.prototype.getOptions=function(r){var n=[],i=r.getMenuConfig(this.mark).fontFamilyList,o=i===void 0?[]:i;n.push({text:wt("fontFamily.default"),value:""}),o.forEach(function(s){if(typeof s=="string")n.push({text:s,value:s,styleForRenderMenuList:{"font-family":s}});else if(VF(s)==="object"){var l=s.name,u=s.value;n.push({text:l,value:u,styleForRenderMenuList:{"font-family":u}})}});var a=this.getValue(r);return n.forEach(function(s){s.value===a?s.selected=!0:delete s.selected}),n},t}(XF),fae={renderStyle:function(e,t){var r=e,n=r.fontSize,i=r.fontFamily,o=t;return n&&fu(o,{fontSize:n}),i&&fu(o,{fontFamily:i}),o},styleToHtml:function(e,t){if(!Rt.isText(e))return t;var r,n=e,i=n.fontSize,o=n.fontFamily;return i||o?((YC(t)||ud(r=_e(t))!=="span")&&(r=_e(""+t+"")),i&&r.css("font-size",i),o&&r.css("font-family",o),ld(r)):t},preParseHtml:[Sie],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Rt.isText(t))return t;var i=t,o=r.getMenuConfig("fontSize").fontSizeList,a=o===void 0?[]:o,s=Mo(n,"font-size"),l=a.find(function(y){return y.value&&y.value===s})||a.includes(s);s&&l&&(i.fontSize=s);var u=r.getMenuConfig("fontFamily").fontFamilyList,c=u===void 0?[]:u,h=Mo(n,"font-family").replace(/"/g,""),S=c.find(function(y){return y.value&&y.value===h})||c.includes(h);return h&&S&&(i.fontFamily=h),i},menus:[{key:"fontSize",factory:function(){return new dae},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new hae},config:{fontFamilyList:["\u9ED1\u4F53",{name:"\u4EFF\u5B8B",value:"\u4EFF\u5B8B"},"\u6977\u4F53","\u6807\u6977\u4F53","\u534E\u6587\u4EFF\u5B8B","\u534E\u6587\u6977\u4F53",{name:"\u5B8B\u4F53",value:"\u5B8B\u4F53"},"\u5FAE\u8F6F\u96C5\u9ED1","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]},pae={selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=_e(e),r=Mo(t,"padding-left");return/\dem/.test(r)&&t.css("text-indent","2em"),/\dpx/.test(r)&&parseInt(r,10)%32==0&&t.css("text-indent","2em"),t[0]}},YF=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){var r=Dr(de.nodes(t,{match:function(i){return!!i.indent},universal:!0}),1),n=r[0];return n==null?"":Dr(n,1)[0].indent||""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e}(),gae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.decrease"),r.iconSvg=Hre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:null},{match:function(i){return Ut.isElement(i)}})},t}(YF),vae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("indent.increase"),r.iconSvg=zre,r}return nn(t,e),t.prototype.isDisabled=function(r){var n=this.getMatchNode(r);return n==null||!!n.indent},t.prototype.exec=function(r,n){Ve.setNodes(r,{indent:"2em"},{match:function(i){return Ut.isElement(i)},mode:"highest"})},t}(YF),mae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent,n=t;return r&&fu(n,{textIndent:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.indent;if(!r)return t;var n=_e(t);return n.css("text-indent",r),ld(n)},preParseHtml:[pae],parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-indent"),a=parseInt(o,10);return o&&a>0&&(i.indent=o),i},menus:[{key:"indent",factory:function(){return new vae}},{key:"delIndent",factory:function(){return new gae}}]},j0=function(){function e(){this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return i==="paragraph"||i==="blockquote"||!!i.startsWith("header")},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(de.isVoid(t,r)&&de.isBlock(t,r))return!0;var n=r.type;return!!["pre","code"].includes(n)||void 0})},e}(),yae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.left"),r.iconSvg=Wre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"left"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),bae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.right"),r.iconSvg=Gre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"right"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Eae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.center"),r.iconSvg=Vre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"center"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),xae=function(e){function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.title=wt("justify.justify"),r.iconSvg=Kre,r}return nn(t,e),t.prototype.exec=function(r,n){Ve.setNodes(r,{textAlign:"justify"},{match:function(i){return Ut.isElement(i)&&!r.isInline(i)}})},t}(j0),Sae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign,n=t;return r&&fu(n,{textAlign:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.textAlign;if(!r)return t;var n=_e(t);return n.css("text-align",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=Mo(n,"text-align");return o&&(i.textAlign=o),i},menus:[{key:"justifyLeft",factory:function(){return new yae}},{key:"justifyRight",factory:function(){return new bae}},{key:"justifyCenter",factory:function(){return new Eae}},{key:"justifyJustify",factory:function(){return new xae}}]},wae=function(){function e(){this.title=wt("lineHeight.title"),this.iconSvg='',this.tag="select",this.width=80}return e.prototype.getOptions=function(t){var r=[],n=t.getMenuConfig("lineHeight").lineHeightList,i=n===void 0?[]:n;r.push({text:wt("lineHeight.default"),value:""}),i.forEach(function(a){r.push({text:a,value:a})});var o=this.getValue(t);return r.forEach(function(a){a.value===o?a.selected=!0:delete a.selected}),r},e.prototype.getMatchNode=function(t){var r=Dr(de.nodes(t,{match:function(n){var i=Ae.getNodeType(n);return!!i.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(i)},universal:!0,mode:"highest"}),1)[0];return r==null?null:r[0]},e.prototype.isActive=function(t){return!1},e.prototype.getValue=function(t){var r=this.getMatchNode(t);return r==null?"":Ut.isElement(r)&&r.lineHeight||""},e.prototype.isDisabled=function(t){return t.selection==null||this.getMatchNode(t)==null},e.prototype.exec=function(t,r){Ve.setNodes(t,{lineHeight:r.toString()},{mode:"highest"})},e}(),Cae={renderStyle:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight,n=t;return r&&fu(n,{lineHeight:r}),n},styleToHtml:function(e,t){if(!Ut.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var n=_e(t);return n.css("line-height",r),ld(n)},parseStyleHtml:function(e,t,r){var n=_e(e);if(!Ut.isElement(t))return t;var i=t,o=r.getMenuConfig("lineHeight").lineHeightList,a=o===void 0?[]:o,s=Mo(n,"line-height");return s&&a.includes(s)&&(i.lineHeight=s),i},menus:[{key:"lineHeight",factory:function(){return new wae},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]},Tae=function(){function e(){this.title=wt("undo.redo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.redo=="function"&&t.redo()},e}(),Aae=function(){function e(){this.title=wt("undo.undo"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null},e.prototype.exec=function(t,r){typeof t.undo=="function"&&t.undo()},e}(),Dae={menus:[{key:"redo",factory:function(){return new Tae}},{key:"undo",factory:function(){return new Aae}}]},Oae={type:"divider",renderElem:function(e,t,r){return wc("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ae.isNodeSelected(r,e)?"true":""},style:{},on:{mousedown:function(n){return n.preventDefault()}}},[wc("hr")])}},_ae=function(){function e(){this.title=wt("divider.title"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||!!Ae.getSelectedElems(t).some(function(r){if(t.isVoid(r))return!0;var n=Ae.getNodeType(r);return n==="table"||n==="pre"||void 0})},e.prototype.exec=function(t,r){Ve.insertNodes(t,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}(),Rae={renderElems:[Oae],elemsToHtml:[{type:"divider",elemToHtml:function(e,t){return"
          "}}],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,r){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new _ae}}],editorPlugin:function(e){var t=e.isVoid,r=e.normalizeNode,n=e;return n.isVoid=function(i){return i.type==="divider"||t(i)},n.normalizeNode=function(i){var o=Dr(i,2),a=o[0],s=o[1];if(Ae.getNodeType(a)!=="divider")return r([a,s]);Ae.isLastNode(n,a)&&Ve.insertNodes(n,Ae.genEmptyParagraph(),{at:[s[0]+1]})},n}},kae=d0.map;Hn({target:"Array",proto:!0,forced:!OC("map")},{map:function(e){return kae(this,e,arguments.length>1?arguments[1]:void 0)}});var Lae=Qt([].join),Pae=n0!=Object,Iae=i5("join",",");Hn({target:"Array",proto:!0,forced:Pae||!Iae},{join:function(e){return Lae(ed(this),e===void 0?",":e)}});var Mae=function(){function e(){this.title=wt("codeBlock.title"),this.iconSvg='',this.tag="button"}return e.prototype.getSelectCodeElem=function(t){var r=Ae.getSelectedNodeByType(t,"code");if(r==null)return null;var n=Ae.getParentNode(t,r);return n==null||Ae.getNodeType(n)!=="pre"?null:r},e.prototype.getValue=function(t){var r=this.getSelectCodeElem(t);return r==null?"":r.language||""},e.prototype.isActive=function(t){return!!this.getSelectCodeElem(t)},e.prototype.isDisabled=function(t){if(t.selection==null)return!0;var r=Ae.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!r.some(function(n){var i=Ae.getNodeType(n);if(i==="pre"||i==="paragraph")return!0})},e.prototype.exec=function(t,r){this.isActive(t)?this.changeToPlainText(t):this.changeToCodeBlock(t,r.toString())},e.prototype.changeToPlainText=function(t){var r=this.getSelectCodeElem(t);if(r!=null){var n=St.string(r);Ve.removeNodes(t,{mode:"highest"});var i=n.split(` `).map(function(o){return{type:"paragraph",children:[{text:o}]}});Ve.insertNodes(t,i,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(t,r){var n,i,o=[],a=de.nodes(t,{match:function(h){return t.children.includes(h)},universal:!0});try{for(var s=e5(a),l=s.next();!l.done;l=s.next()){var u=Dr(l.value,1)[0];u&&o.push(St.string(u))}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}Ve.removeNodes(t,{mode:"highest"});var c={type:"pre",children:[{type:"code",language:r,children:[{text:o.join(` -`)}]}]};Ve.insertNodes(t,c,{mode:"highest"})},e}(),Bae={key:"codeBlock",factory:function(){return new Mae}};Hn({target:"String",proto:!0,forced:Kf("anchor")},{anchor:function(e){return Vf(this,"a","name",e)}}),jC("match",function(e,t,r){return[function(n){var i=fo(this),o=n==null?void 0:i0(n,e);return o?vn(o,n,i):new RegExp(n)[e](cn(i))},function(n){var i=Ki(this),o=cn(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Wf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Wf(i,o))!==null;){var h=cn(l[0]);u[c]=h,h===""&&(i.lastIndex=UC(o,jf(i.lastIndex),s)),c++}return c===0?null:u}]});var Fae={type:"pre",renderElem:function(e,t,r){return er("pre",null,t)}},Nae={type:"code",renderElem:function(e,t,r){return er("code",null,t)}},jae={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return Ae.getNodeType(i)==="code"})).length===0&&(t=[{type:"code",language:"",children:[{text:n[0].textContent||""}]}]),{type:"pre",children:t.filter(function(i){return Ae.getNodeType(i)==="code"})}}},Uae={menus:[Bae],editorPlugin:function(e){var t=e.insertBreak,r=e.normalizeNode,n=e.insertData;e.insertNode;var i=e;return i.insertBreak=function(){var o=Ae.getSelectedNodeByType(i,"code");if(o!=null){var a=function(u,c){var h=c.selection;if(h==null)return"";var S=St.string(u),y=h.anchor.offset,z=S.slice(0,y).split(` -`),F=z.length;return F===0?"":z[F-1]}(o,i);if(a){var s=a.match(/^\s+/);if(s!=null&&s[0]!=null){var l=s[0];return void i.insertText(` +`)}]}]};Ve.insertNodes(t,c,{mode:"highest"})},e}(),Bae={key:"codeBlock",factory:function(){return new Mae}};Hn({target:"String",proto:!0,forced:Kf("anchor")},{anchor:function(e){return Vf(this,"a","name",e)}}),jC("match",function(e,t,r){return[function(n){var i=fo(this),o=n==null?void 0:i0(n,e);return o?vn(o,n,i):new RegExp(n)[e](cn(i))},function(n){var i=Ki(this),o=cn(n),a=r(t,i,o);if(a.done)return a.value;if(!i.global)return Wf(i,o);var s=i.unicode;i.lastIndex=0;for(var l,u=[],c=0;(l=Wf(i,o))!==null;){var h=cn(l[0]);u[c]=h,h===""&&(i.lastIndex=UC(o,jf(i.lastIndex),s)),c++}return c===0?null:u}]});var Fae={type:"pre",renderElem:function(e,t,r){return er("pre",null,t)}},Nae={type:"code",renderElem:function(e,t,r){return er("code",null,t)}},jae={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);return(t=t.filter(function(i){return Ae.getNodeType(i)==="code"})).length===0&&(t=[{type:"code",language:"",children:[{text:n[0].textContent||""}]}]),{type:"pre",children:t.filter(function(i){return Ae.getNodeType(i)==="code"})}}},Uae={menus:[Bae],editorPlugin:function(e){var t=e.insertBreak,r=e.normalizeNode,n=e.insertData;e.insertNode;var i=e;return i.insertBreak=function(){var o=Ae.getSelectedNodeByType(i,"code");if(o!=null){var a=function(u,c){var h=c.selection;if(h==null)return"";var S=St.string(u),y=h.anchor.offset,W=S.slice(0,y).split(` +`),F=W.length;return F===0?"":W[F-1]}(o,i);if(a){var s=a.match(/^\s+/);if(s!=null&&s[0]!=null){var l=s[0];return void i.insertText(` `+l)}}i.insertText(` -`)}else t()},i.normalizeNode=function(o){var a=Dr(o,2),s=a[0],l=a[1],u=Ae.getNodeType(s);return u==="code"&&l.length<=1&&Ve.setNodes(i,{type:"paragraph"},{at:l}),u==="pre"&&(Ae.isLastNode(i,s)&&Ve.insertNodes(i,Ae.genEmptyParagraph(),{at:[l[0]+1]}),Ae.getNodeType(s.children[0])!=="code"&&(Ve.unwrapNodes(i),Ve.setNodes(i,{type:"paragraph"},{mode:"highest"}))),r([s,l])},i.insertData=function(o){if(Ae.getSelectedNodeByType(i,"code")!=null){var a=o.getData("text/plain");de.insertText(i,a)}else n(o)},i},renderElems:[Fae,Nae],elemsToHtml:[{type:"code",elemToHtml:function(e,t){return""+t+""}},{type:"pre",elemToHtml:function(e,t){return"
          "+t+"
          "}}],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="code")return e;var r=t.find("xmp");if(r.length===0)return e;var n=r.text();return r.remove(),t.text(n),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,r){return{type:"code",language:"",children:[{text:_e(e)[0].textContent||""}]}}},jae]},Hae=function(){function e(){this.title=wt("fullScreen.title"),this.iconSvg='',this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return t.isFullScreen},e.prototype.isDisabled=function(t){return!1},e.prototype.exec=function(t,r){t.isFullScreen?t.unFullScreen():t.fullScreen()},e}(),zae={menus:[{key:"fullScreen",factory:function(){return new Hae}}]},Wae=function(){function e(){this.title=wt("common.enter"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!!Qe.isExpanded(r)},e.prototype.exec=function(t,r){var n=t.selection;if(n!=null){var i=[n.anchor.path[0]];Ve.insertNodes(t,{type:"paragraph",children:[{text:""}]},{at:i}),t.select(de.start(t,i))}},e}(),Gae=[nne,Mne,fae,mae,Sae,Cae,oie,Rae,Eie,Kne,Uae,yie,Rne,Are,uie,Dae,zae,{menus:[{key:"enter",factory:function(){return new Wae}}]}];Ri("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),Ri("zh-CN",{listModule:{unOrderedList:"\u65E0\u5E8F\u5217\u8868",orderedList:"\u6709\u5E8F\u5217\u8868"}});var ZF=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function VT(e){var t={exports:{}};return e(t,t.exports),t.exports}var Hs,U0,H0=function(e){return e&&e.Math==Math&&e},tr=H0(typeof globalThis=="object"&&globalThis)||H0(typeof window=="object"&&window)||H0(typeof self=="object"&&self)||H0(typeof ZF=="object"&&ZF)||function(){return this}()||Function("return this")(),JF=Function.prototype,KT=JF.bind,$T=JF.call,Vae=KT&&KT.bind($T),gr=KT?function(e){return e&&Vae($T,e)}:function(e){return e&&function(){return $T.apply(e,arguments)}},hn=function(e){try{return!!e()}catch(t){return!0}},Kae=gr({}.toString),$ae=gr("".slice),ja=function(e){return $ae(Kae(e),8,-1)},XT=tr.Object,Xae=gr("".split),QF=hn(function(){return!XT("z").propertyIsEnumerable(0)})?function(e){return ja(e)=="String"?Xae(e,""):XT(e)}:XT,Yae=tr.TypeError,z0=function(e){if(e==null)throw Yae("Can't call method on "+e);return e},yd=function(e){return QF(z0(e))},Zae=Object.defineProperty,YT=function(e,t){try{Zae(tr,e,{value:t,configurable:!0,writable:!0})}catch(r){tr[e]=t}return t},zs=tr["__core-js_shared__"]||YT("__core-js_shared__",{}),ZT=VT(function(e){(e.exports=function(t,r){return zs[t]||(zs[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Jae=tr.Object,lp=function(e){return Jae(z0(e))},Qae=gr({}.hasOwnProperty),zn=Object.hasOwn||function(e,t){return Qae(lp(e),t)},qae=0,ese=Math.random(),tse=gr(1 .toString),JT=function(e){return"Symbol("+(e===void 0?"":e)+")_"+tse(++qae+ese,36)},fn=function(e){return typeof e=="function"},rse=function(e){return fn(e)?e:void 0},up=function(e,t){return arguments.length<2?rse(tr[e]):tr[e]&&tr[e][t]},QT=up("navigator","userAgent")||"",qF=tr.process,e8=tr.Deno,t8=qF&&qF.versions||e8&&e8.version,r8=t8&&t8.v8;r8&&(U0=(Hs=r8.split("."))[0]>0&&Hs[0]<4?1:+(Hs[0]+Hs[1])),!U0&&QT&&(!(Hs=QT.match(/Edge\/(\d+)/))||Hs[1]>=74)&&(Hs=QT.match(/Chrome\/(\d+)/))&&(U0=+Hs[1]);var W0,qT=U0,eA=!!Object.getOwnPropertySymbols&&!hn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qT&&qT<41}),tA=eA&&!Symbol.sham&&typeof Symbol.iterator=="symbol",cp=ZT("wks"),Cu=tr.Symbol,n8=Cu&&Cu.for,nse=tA?Cu:Cu&&Cu.withoutSetter||JT,ai=function(e){if(!zn(cp,e)||!eA&&typeof cp[e]!="string"){var t="Symbol."+e;eA&&zn(Cu,e)?cp[e]=Cu[e]:cp[e]=tA&&n8?n8(t):nse(t)}return cp[e]},pn=function(e){return typeof e=="object"?e!==null:fn(e)},ise=tr.String,ose=tr.TypeError,Pi=function(e){if(pn(e))return e;throw ose(ise(e)+" is not an object")},Ws=!hn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),rA=tr.document,ase=pn(rA)&&pn(rA.createElement),nA=function(e){return ase?rA.createElement(e):{}},i8=!Ws&&!hn(function(){return Object.defineProperty(nA("div"),"a",{get:function(){return 7}}).a!=7}),dp=Function.prototype.call,Wn=dp.bind?dp.bind(dp):function(){return dp.apply(dp,arguments)},G0=gr({}.isPrototypeOf),sse=tr.Object,iA=tA?function(e){return typeof e=="symbol"}:function(e){var t=up("Symbol");return fn(t)&&G0(t.prototype,sse(e))},lse=tr.String,oA=function(e){try{return lse(e)}catch(t){return"Object"}},use=tr.TypeError,aA=function(e){if(fn(e))return e;throw use(oA(e)+" is not a function")},hp=function(e,t){var r=e[t];return r==null?void 0:aA(r)},cse=tr.TypeError,dse=tr.TypeError,hse=ai("toPrimitive"),sA=function(e){var t=function(r,n){if(!pn(r)||iA(r))return r;var i,o=hp(r,hse);if(o){if(n===void 0&&(n="default"),i=Wn(o,r,n),!pn(i)||iA(i))return i;throw dse("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;if(fn(l=a.valueOf)&&!pn(u=Wn(l,a)))return u;if(s!=="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;throw cse("Can't convert object to primitive value")}(r,n)}(e,"string");return iA(t)?t:t+""},fse=tr.TypeError,o8=Object.defineProperty,Tu={f:Ws?o8:function(e,t,r){if(Pi(e),t=sA(t),Pi(r),i8)try{return o8(e,t,r)}catch(n){}if("get"in r||"set"in r)throw fse("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},pse=Math.ceil,gse=Math.floor,fp=function(e){var t=+e;return t!=t||t===0?0:(t>0?gse:pse)(t)},vse=Math.max,mse=Math.min,lA=function(e,t){var r=fp(e);return r<0?vse(r+t,0):mse(r,t)},yse=Math.min,a8=function(e){return e>0?yse(fp(e),9007199254740991):0},bd=function(e){return a8(e.length)},s8=function(e){return function(t,r,n){var i,o=yd(t),a=bd(o),s=lA(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},l8={includes:s8(!0),indexOf:s8(!1)},V0={},bse=l8.indexOf,u8=gr([].push),c8=function(e,t){var r,n=yd(e),i=0,o=[];for(r in n)!zn(V0,r)&&zn(n,r)&&u8(o,r);for(;t.length>i;)zn(n,r=t[i++])&&(~bse(o,r)||u8(o,r));return o},K0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ese=Object.keys||function(e){return c8(e,K0)},xse=Ws?Object.defineProperties:function(e,t){Pi(e);for(var r,n=yd(t),i=Ese(t),o=i.length,a=0;o>a;)Tu.f(e,r=i[a++],n[r]);return e},Sse=up("document","documentElement"),d8=ZT("keys"),uA=function(e){return d8[e]||(d8[e]=JT(e))},h8=uA("IE_PROTO"),cA=function(){},f8=function(e){return""},p8=function(e){e.write(f8("")),e.close();var t=e.parentWindow.Object;return e=null,t},$0=function(){try{W0=new ActiveXObject("htmlfile")}catch(n){}var e,t;$0=typeof document!="undefined"?document.domain&&W0?p8(W0):((t=nA("iframe")).style.display="none",Sse.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f8("document.F=Object")),e.close(),e.F):p8(W0);for(var r=K0.length;r--;)delete $0.prototype[K0[r]];return $0()};V0[h8]=!0;var dA=Object.create||function(e,t){var r;return e!==null?(cA.prototype=Pi(e),r=new cA,cA.prototype=null,r[h8]=e):r=$0(),t===void 0?r:xse(r,t)},hA=ai("unscopables"),fA=Array.prototype;fA[hA]==null&&Tu.f(fA,hA,{configurable:!0,value:dA(null)});var pp=function(e){fA[hA][e]=!0},Ed={},wse=gr(Function.toString);fn(zs.inspectSource)||(zs.inspectSource=function(e){return wse(e)});var X0,gp,Y0,pA=zs.inspectSource,g8=tr.WeakMap,v8=fn(g8)&&/native code/.test(pA(g8)),Z0=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Gs=Ws?function(e,t,r){return Tu.f(e,t,Z0(1,r))}:function(e,t,r){return e[t]=r,e},gA=tr.TypeError,Cse=tr.WeakMap;if(v8||zs.state){var Au=zs.state||(zs.state=new Cse),Tse=gr(Au.get),m8=gr(Au.has),Ase=gr(Au.set);X0=function(e,t){if(m8(Au,e))throw new gA("Object already initialized");return t.facade=e,Ase(Au,e,t),t},gp=function(e){return Tse(Au,e)||{}},Y0=function(e){return m8(Au,e)}}else{var xd=uA("state");V0[xd]=!0,X0=function(e,t){if(zn(e,xd))throw new gA("Object already initialized");return t.facade=e,Gs(e,xd,t),t},gp=function(e){return zn(e,xd)?e[xd]:{}},Y0=function(e){return zn(e,xd)}}var Du,y8,b8,sa={set:X0,get:gp,has:Y0,enforce:function(e){return Y0(e)?gp(e):X0(e,{})},getterFor:function(e){return function(t){var r;if(!pn(t)||(r=gp(t)).type!==e)throw gA("Incompatible receiver, "+e+" required");return r}}},E8={}.propertyIsEnumerable,x8=Object.getOwnPropertyDescriptor,Dse={f:x8&&!E8.call({1:2},1)?function(e){var t=x8(this,e);return!!t&&t.enumerable}:E8},S8=Object.getOwnPropertyDescriptor,w8={f:Ws?S8:function(e,t){if(e=yd(e),t=sA(t),i8)try{return S8(e,t)}catch(r){}if(zn(e,t))return Z0(!Wn(Dse.f,e,t),e[t])}},C8=Function.prototype,Ose=Ws&&Object.getOwnPropertyDescriptor,vA=zn(C8,"name"),mA={EXISTS:vA,PROPER:vA&&function(){}.name==="something",CONFIGURABLE:vA&&(!Ws||Ws&&Ose(C8,"name").configurable)},la=VT(function(e){var t=mA.CONFIGURABLE,r=sa.get,n=sa.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;fn(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!zn(s,"name")||t&&s.name!==y)&&Gs(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==tr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Gs(o,a,s)):h?o[a]=s:YT(a,s)})(Function.prototype,"toString",function(){return fn(this)&&r(this).source||pA(this)})}),_se=K0.concat("length","prototype"),J0={f:Object.getOwnPropertyNames||function(e){return c8(e,_se)}},Rse={f:Object.getOwnPropertySymbols},kse=gr([].concat),Lse=up("Reflect","ownKeys")||function(e){var t=J0.f(Pi(e)),r=Rse.f;return r?kse(t,r(e)):t},Pse=function(e,t){for(var r=Lse(t),n=Tu.f,i=w8.f,o=0;o=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Ed.Arguments=Ed.Array,pp("keys"),pp("values"),pp("entries");var R8={};R8[ai("toStringTag")]="z";var wA=String(R8)==="[object z]",qse=ai("toStringTag"),ele=tr.Object,tle=ja(function(){return arguments}())=="Arguments",ty=wA?ja:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=ele(e),qse))=="string"?r:tle?ja(t):(n=ja(t))=="Object"&&fn(t.callee)?"Arguments":n},rle=wA?{}.toString:function(){return"[object "+ty(this)+"]"};wA||la(Object.prototype,"toString",rle,{unsafe:!0});var nle=tr.String,Ua=function(e){if(ty(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return nle(e)},ile=gr("".charAt),k8=gr("".charCodeAt),ole=gr("".slice),L8=function(e){return function(t,r){var n,i,o=Ua(z0(t)),a=fp(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=k8(o,a))<55296||n>56319||a+1===s||(i=k8(o,a+1))<56320||i>57343?e?ile(o,a):n:e?ole(o,a,a+2):i-56320+(n-55296<<10)+65536}},P8={codeAt:L8(!1),charAt:L8(!0)},ale=P8.charAt,sle=sa.set,lle=sa.getterFor("String Iterator");_8(String,"String",function(e){sle(this,{type:"String Iterator",string:Ua(e),index:0})},function(){var e,t=lle(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=ale(r,n),t.index+=e.length,{value:e,done:!1})});var CA=function(e,t,r){for(var n in t)la(e,n,t[n],r);return e},ule=tr.Array,cle=Math.max,I8=J0.f,M8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],dle={f:function(e){return M8&&ja(e)=="Window"?function(t){try{return I8(t)}catch(r){return function(n,i,o){for(var a,s,l,u,c=bd(n),h=lA(void 0,c),S=lA(c,c),y=ule(cle(S-h,0)),z=0;ho;o++)if((s=j(e[o]))&&G0(U8,s))return s;return new ny(!1)}n=function(D,Q){var te=arguments.length<2?N8(D):Q;if(aA(te))return Pi(Wn(te,D));throw vle(oA(D)+" is not iterable")}(e,i)}for(l=n.next;!(u=Wn(l,n)).done;){try{s=j(u.value)}catch(D){j8(n,"throw",D)}if(typeof s=="object"&&s&&G0(U8,s))return s}return new ny(!1)},yle=tr.TypeError,z8=function(e,t){if(G0(t,e))return e;throw yle("Incorrect invocation")},W8=ai("iterator"),G8=!1;try{var ble=0,V8={next:function(){return{done:!!ble++}},return:function(){G8=!0}};V8[W8]=function(){return this},Array.from(V8,function(){throw 2})}catch(e){}var DA=Array.isArray||function(e){return ja(e)=="Array"},K8=function(){},Ele=[],$8=up("Reflect","construct"),OA=/^\s*(?:class|function)\b/,xle=gr(OA.exec),Sle=!OA.exec(K8),bp=function(e){if(!fn(e))return!1;try{return $8(K8,Ele,e),!0}catch(t){return!1}},wle=!$8||hn(function(){var e;return bp(bp.call)||!bp(Object)||!bp(function(){e=!0})||e})?function(e){if(!fn(e))return!1;switch(ty(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Sle||!!xle(OA,pA(e))}:bp,Cle=ai("species"),X8=tr.Array,Y8=function(e,t){return new(function(r){var n;return DA(r)&&(n=r.constructor,(wle(n)&&(n===X8||DA(n.prototype))||pn(n)&&(n=n[Cle])===null)&&(n=void 0)),n===void 0?X8:n}(e))(t===0?0:t)},Z8=gr([].push),Ks=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,z=lp(l),F=QF(z),N=AA(u,c),j=bd(F),D=0,Q=h||Y8,te=t?Q(l,j):r||a?Q(l,0):void 0;j>D;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:Z8(te,S)}else switch(e){case 4:return!1;case 7:Z8(te,S)}return o?-1:n||i?i:te}},_A={forEach:Ks(0),map:Ks(1),filter:Ks(2),some:Ks(3),every:Ks(4),find:Ks(5),findIndex:Ks(6),filterReject:Ks(7)},iy=TA.getWeakData,Tle=sa.set,Ale=sa.getterFor,Dle=_A.find,Ole=_A.findIndex,_le=gr([].splice),Rle=0,oy=function(e){return e.frozen||(e.frozen=new J8)},J8=function(){this.entries=[]},RA=function(e,t){return Dle(e.entries,function(r){return r[0]===t})};J8.prototype={get:function(e){var t=RA(this,e);if(t)return t[1]},has:function(e){return!!RA(this,e)},set:function(e,t){var r=RA(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ole(this.entries,function(r){return r[0]===e});return~t&&_le(this.entries,t,1),!!~t}};var Ep,Q8={getConstructor:function(e,t,r,n){var i=e(function(l,u){z8(l,o),Tle(l,{type:t,id:Rle++,frozen:void 0}),u!=null&&H8(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=Ale(t),s=function(l,u,c){var h=a(l),S=iy(Pi(u),!0);return S===!0?oy(h).set(u,c):S[h.id]=c,l};return CA(o,{delete:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).delete(l):c&&zn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).has(l):c&&zn(c,u.id)}}),CA(o,r?{get:function(l){var u=a(this);if(pn(l)){var c=iy(l);return c===!0?oy(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},ay=sa.enforce,kle=!tr.ActiveXObject&&"ActiveXObject"in tr,q8=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Lle=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=tr[e],s=a&&a.prototype,l=a,u={},c=function(N){var j=gr(s[N]);la(s,N,N=="add"?function(D){return j(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!pn(D))&&j(this,D===0?0:D)}:N=="get"?function(D){return i&&!pn(D)?void 0:j(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!pn(D))&&j(this,D===0?0:D)}:function(D,Q){return j(this,D===0?0:D,Q),this})};if(yA(e,!fn(a)||!(i||s.forEach&&!hn(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),TA.enable();else if(yA(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=hn(function(){h.has(1)}),z=function(N,j){if(!G8)return!1;var D=!1;try{var Q={};Q[W8]=function(){return{next:function(){return{done:D=!0}}}},function(te){new a(te)}(Q)}catch(te){}return D}(),F=!i&&hn(function(){for(var N=new a,j=5;j--;)N[o](j,j);return!N.has(-0)});z||((l=t(function(N,j){z8(N,s);var D=function(Q,te,he){var Ee,ve;return q0&&fn(Ee=te.constructor)&&Ee!==he&&pn(ve=Ee.prototype)&&ve!==he.prototype&&q0(Q,ve),Q}(new a,N,l);return j!=null&&H8(j,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||F)&&(c("delete"),c("has"),n&&c("get")),(F||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,Vs({global:!0,forced:l!=a},u),SA(l,e),i||r.setStrong(l,e,n),l}("WeakMap",q8,Q8);if(v8&&kle){Ep=Q8.getConstructor(q8,"WeakMap",!0),TA.enable();var xp=Lle.prototype,e6=gr(xp.delete),sy=gr(xp.has),t6=gr(xp.get),r6=gr(xp.set);CA(xp,{delete:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),e6(this,e)||t.frozen.delete(e)}return e6(this,e)},has:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)||t.frozen.has(e)}return sy(this,e)},get:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)?t6(this,e):t.frozen.get(e)}return t6(this,e)},set:function(e,t){if(pn(e)&&!Ou(e)){var r=ay(this);r.frozen||(r.frozen=new Ep),sy(this,e)?r6(this,e,t):r.frozen.set(e,t)}else r6(this,e,t);return this}})}var n6={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kA=nA("span").classList,i6=kA&&kA.constructor&&kA.constructor.prototype,Ple=i6===Object.prototype?void 0:i6,LA=ai("iterator"),o6=ai("toStringTag"),PA=yp.values,a6=function(e,t){if(e){if(e[LA]!==PA)try{Gs(e,LA,PA)}catch(n){e[LA]=PA}if(e[o6]||Gs(e,o6,t),n6[t]){for(var r in yp)if(e[r]!==yp[r])try{Gs(e,r,yp[r])}catch(n){e[r]=yp[r]}}}};for(var IA in n6)a6(tr[IA]&&tr[IA].prototype,IA);a6(Ple,"DOMTokenList");var MA=new WeakMap,Ile={type:"list-item",renderElem:function(e,t,r){MA.set(e,r);var n=e,i=n.level,o=i===void 0?0:i,a=n.ordered,s={margin:"5px 0 5px "+20*o+"px"},l="";if(a!==void 0&&a){var u=function(h,S){var y=S,z=y.type,F=y.level,N=F===void 0?0:F,j=y.ordered,D=j!==void 0&&j;if(!D)return-1;var Q=1,te=S,he=Ae.findPath(h,te);if(he[0]===0)return 1;for(;he[0]>0;){var Ee=je.previous(he),ve=de.node(h,Ee);if(ve==null)break;var De=ve[0],Pe=De.level,qe=Pe===void 0?0:Pe,ot=De.type,et=De.ordered;if(ot!==z)break;if(qe"+t+""}},{type:"pre",elemToHtml:function(e,t){return"
          "+t+"
          "}}],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=_e(e);if(ud(t)!=="code")return e;var r=t.find("xmp");if(r.length===0)return e;var n=r.text();return r.remove(),t.text(n),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,r){return{type:"code",language:"",children:[{text:_e(e)[0].textContent||""}]}}},jae]},Hae=function(){function e(){this.title=wt("fullScreen.title"),this.iconSvg='',this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return t.isFullScreen},e.prototype.isDisabled=function(t){return!1},e.prototype.exec=function(t,r){t.isFullScreen?t.unFullScreen():t.fullScreen()},e}(),zae={menus:[{key:"fullScreen",factory:function(){return new Hae}}]},Wae=function(){function e(){this.title=wt("common.enter"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!!Je.isExpanded(r)},e.prototype.exec=function(t,r){var n=t.selection;if(n!=null){var i=[n.anchor.path[0]];Ve.insertNodes(t,{type:"paragraph",children:[{text:""}]},{at:i}),t.select(de.start(t,i))}},e}(),Gae=[nne,Mne,fae,mae,Sae,Cae,oie,Rae,Eie,Kne,Uae,yie,Rne,Are,uie,Dae,zae,{menus:[{key:"enter",factory:function(){return new Wae}}]}];Ri("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),Ri("zh-CN",{listModule:{unOrderedList:"\u65E0\u5E8F\u5217\u8868",orderedList:"\u6709\u5E8F\u5217\u8868"}});var ZF=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function VT(e){var t={exports:{}};return e(t,t.exports),t.exports}var Hs,U0,H0=function(e){return e&&e.Math==Math&&e},tr=H0(typeof globalThis=="object"&&globalThis)||H0(typeof window=="object"&&window)||H0(typeof self=="object"&&self)||H0(typeof ZF=="object"&&ZF)||function(){return this}()||Function("return this")(),JF=Function.prototype,KT=JF.bind,$T=JF.call,Vae=KT&&KT.bind($T),gr=KT?function(e){return e&&Vae($T,e)}:function(e){return e&&function(){return $T.apply(e,arguments)}},hn=function(e){try{return!!e()}catch(t){return!0}},Kae=gr({}.toString),$ae=gr("".slice),ja=function(e){return $ae(Kae(e),8,-1)},XT=tr.Object,Xae=gr("".split),QF=hn(function(){return!XT("z").propertyIsEnumerable(0)})?function(e){return ja(e)=="String"?Xae(e,""):XT(e)}:XT,Yae=tr.TypeError,z0=function(e){if(e==null)throw Yae("Can't call method on "+e);return e},yd=function(e){return QF(z0(e))},Zae=Object.defineProperty,YT=function(e,t){try{Zae(tr,e,{value:t,configurable:!0,writable:!0})}catch(r){tr[e]=t}return t},zs=tr["__core-js_shared__"]||YT("__core-js_shared__",{}),ZT=VT(function(e){(e.exports=function(t,r){return zs[t]||(zs[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Jae=tr.Object,lp=function(e){return Jae(z0(e))},Qae=gr({}.hasOwnProperty),zn=Object.hasOwn||function(e,t){return Qae(lp(e),t)},qae=0,ese=Math.random(),tse=gr(1 .toString),JT=function(e){return"Symbol("+(e===void 0?"":e)+")_"+tse(++qae+ese,36)},fn=function(e){return typeof e=="function"},rse=function(e){return fn(e)?e:void 0},up=function(e,t){return arguments.length<2?rse(tr[e]):tr[e]&&tr[e][t]},QT=up("navigator","userAgent")||"",qF=tr.process,e8=tr.Deno,t8=qF&&qF.versions||e8&&e8.version,r8=t8&&t8.v8;r8&&(U0=(Hs=r8.split("."))[0]>0&&Hs[0]<4?1:+(Hs[0]+Hs[1])),!U0&&QT&&(!(Hs=QT.match(/Edge\/(\d+)/))||Hs[1]>=74)&&(Hs=QT.match(/Chrome\/(\d+)/))&&(U0=+Hs[1]);var W0,qT=U0,eA=!!Object.getOwnPropertySymbols&&!hn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qT&&qT<41}),tA=eA&&!Symbol.sham&&typeof Symbol.iterator=="symbol",cp=ZT("wks"),Cu=tr.Symbol,n8=Cu&&Cu.for,nse=tA?Cu:Cu&&Cu.withoutSetter||JT,ai=function(e){if(!zn(cp,e)||!eA&&typeof cp[e]!="string"){var t="Symbol."+e;eA&&zn(Cu,e)?cp[e]=Cu[e]:cp[e]=tA&&n8?n8(t):nse(t)}return cp[e]},pn=function(e){return typeof e=="object"?e!==null:fn(e)},ise=tr.String,ose=tr.TypeError,Pi=function(e){if(pn(e))return e;throw ose(ise(e)+" is not an object")},Ws=!hn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),rA=tr.document,ase=pn(rA)&&pn(rA.createElement),nA=function(e){return ase?rA.createElement(e):{}},i8=!Ws&&!hn(function(){return Object.defineProperty(nA("div"),"a",{get:function(){return 7}}).a!=7}),dp=Function.prototype.call,Wn=dp.bind?dp.bind(dp):function(){return dp.apply(dp,arguments)},G0=gr({}.isPrototypeOf),sse=tr.Object,iA=tA?function(e){return typeof e=="symbol"}:function(e){var t=up("Symbol");return fn(t)&&G0(t.prototype,sse(e))},lse=tr.String,oA=function(e){try{return lse(e)}catch(t){return"Object"}},use=tr.TypeError,aA=function(e){if(fn(e))return e;throw use(oA(e)+" is not a function")},hp=function(e,t){var r=e[t];return r==null?void 0:aA(r)},cse=tr.TypeError,dse=tr.TypeError,hse=ai("toPrimitive"),sA=function(e){var t=function(r,n){if(!pn(r)||iA(r))return r;var i,o=hp(r,hse);if(o){if(n===void 0&&(n="default"),i=Wn(o,r,n),!pn(i)||iA(i))return i;throw dse("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;if(fn(l=a.valueOf)&&!pn(u=Wn(l,a)))return u;if(s!=="string"&&fn(l=a.toString)&&!pn(u=Wn(l,a)))return u;throw cse("Can't convert object to primitive value")}(r,n)}(e,"string");return iA(t)?t:t+""},fse=tr.TypeError,o8=Object.defineProperty,Tu={f:Ws?o8:function(e,t,r){if(Pi(e),t=sA(t),Pi(r),i8)try{return o8(e,t,r)}catch(n){}if("get"in r||"set"in r)throw fse("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},pse=Math.ceil,gse=Math.floor,fp=function(e){var t=+e;return t!=t||t===0?0:(t>0?gse:pse)(t)},vse=Math.max,mse=Math.min,lA=function(e,t){var r=fp(e);return r<0?vse(r+t,0):mse(r,t)},yse=Math.min,a8=function(e){return e>0?yse(fp(e),9007199254740991):0},bd=function(e){return a8(e.length)},s8=function(e){return function(t,r,n){var i,o=yd(t),a=bd(o),s=lA(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},l8={includes:s8(!0),indexOf:s8(!1)},V0={},bse=l8.indexOf,u8=gr([].push),c8=function(e,t){var r,n=yd(e),i=0,o=[];for(r in n)!zn(V0,r)&&zn(n,r)&&u8(o,r);for(;t.length>i;)zn(n,r=t[i++])&&(~bse(o,r)||u8(o,r));return o},K0=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ese=Object.keys||function(e){return c8(e,K0)},xse=Ws?Object.defineProperties:function(e,t){Pi(e);for(var r,n=yd(t),i=Ese(t),o=i.length,a=0;o>a;)Tu.f(e,r=i[a++],n[r]);return e},Sse=up("document","documentElement"),d8=ZT("keys"),uA=function(e){return d8[e]||(d8[e]=JT(e))},h8=uA("IE_PROTO"),cA=function(){},f8=function(e){return""},p8=function(e){e.write(f8("")),e.close();var t=e.parentWindow.Object;return e=null,t},$0=function(){try{W0=new ActiveXObject("htmlfile")}catch(n){}var e,t;$0=typeof document!="undefined"?document.domain&&W0?p8(W0):((t=nA("iframe")).style.display="none",Sse.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f8("document.F=Object")),e.close(),e.F):p8(W0);for(var r=K0.length;r--;)delete $0.prototype[K0[r]];return $0()};V0[h8]=!0;var dA=Object.create||function(e,t){var r;return e!==null?(cA.prototype=Pi(e),r=new cA,cA.prototype=null,r[h8]=e):r=$0(),t===void 0?r:xse(r,t)},hA=ai("unscopables"),fA=Array.prototype;fA[hA]==null&&Tu.f(fA,hA,{configurable:!0,value:dA(null)});var pp=function(e){fA[hA][e]=!0},Ed={},wse=gr(Function.toString);fn(zs.inspectSource)||(zs.inspectSource=function(e){return wse(e)});var X0,gp,Y0,pA=zs.inspectSource,g8=tr.WeakMap,v8=fn(g8)&&/native code/.test(pA(g8)),Z0=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Gs=Ws?function(e,t,r){return Tu.f(e,t,Z0(1,r))}:function(e,t,r){return e[t]=r,e},gA=tr.TypeError,Cse=tr.WeakMap;if(v8||zs.state){var Au=zs.state||(zs.state=new Cse),Tse=gr(Au.get),m8=gr(Au.has),Ase=gr(Au.set);X0=function(e,t){if(m8(Au,e))throw new gA("Object already initialized");return t.facade=e,Ase(Au,e,t),t},gp=function(e){return Tse(Au,e)||{}},Y0=function(e){return m8(Au,e)}}else{var xd=uA("state");V0[xd]=!0,X0=function(e,t){if(zn(e,xd))throw new gA("Object already initialized");return t.facade=e,Gs(e,xd,t),t},gp=function(e){return zn(e,xd)?e[xd]:{}},Y0=function(e){return zn(e,xd)}}var Du,y8,b8,sa={set:X0,get:gp,has:Y0,enforce:function(e){return Y0(e)?gp(e):X0(e,{})},getterFor:function(e){return function(t){var r;if(!pn(t)||(r=gp(t)).type!==e)throw gA("Incompatible receiver, "+e+" required");return r}}},E8={}.propertyIsEnumerable,x8=Object.getOwnPropertyDescriptor,Dse={f:x8&&!E8.call({1:2},1)?function(e){var t=x8(this,e);return!!t&&t.enumerable}:E8},S8=Object.getOwnPropertyDescriptor,w8={f:Ws?S8:function(e,t){if(e=yd(e),t=sA(t),i8)try{return S8(e,t)}catch(r){}if(zn(e,t))return Z0(!Wn(Dse.f,e,t),e[t])}},C8=Function.prototype,Ose=Ws&&Object.getOwnPropertyDescriptor,vA=zn(C8,"name"),mA={EXISTS:vA,PROPER:vA&&function(){}.name==="something",CONFIGURABLE:vA&&(!Ws||Ws&&Ose(C8,"name").configurable)},la=VT(function(e){var t=mA.CONFIGURABLE,r=sa.get,n=sa.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;fn(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!zn(s,"name")||t&&s.name!==y)&&Gs(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==tr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Gs(o,a,s)):h?o[a]=s:YT(a,s)})(Function.prototype,"toString",function(){return fn(this)&&r(this).source||pA(this)})}),_se=K0.concat("length","prototype"),J0={f:Object.getOwnPropertyNames||function(e){return c8(e,_se)}},Rse={f:Object.getOwnPropertySymbols},kse=gr([].concat),Lse=up("Reflect","ownKeys")||function(e){var t=J0.f(Pi(e)),r=Rse.f;return r?kse(t,r(e)):t},Pse=function(e,t){for(var r=Lse(t),n=Tu.f,i=w8.f,o=0;o=t.length?(e.target=void 0,{value:void 0,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");Ed.Arguments=Ed.Array,pp("keys"),pp("values"),pp("entries");var R8={};R8[ai("toStringTag")]="z";var wA=String(R8)==="[object z]",qse=ai("toStringTag"),ele=tr.Object,tle=ja(function(){return arguments}())=="Arguments",ty=wA?ja:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch(a){}}(t=ele(e),qse))=="string"?r:tle?ja(t):(n=ja(t))=="Object"&&fn(t.callee)?"Arguments":n},rle=wA?{}.toString:function(){return"[object "+ty(this)+"]"};wA||la(Object.prototype,"toString",rle,{unsafe:!0});var nle=tr.String,Ua=function(e){if(ty(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return nle(e)},ile=gr("".charAt),k8=gr("".charCodeAt),ole=gr("".slice),L8=function(e){return function(t,r){var n,i,o=Ua(z0(t)),a=fp(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=k8(o,a))<55296||n>56319||a+1===s||(i=k8(o,a+1))<56320||i>57343?e?ile(o,a):n:e?ole(o,a,a+2):i-56320+(n-55296<<10)+65536}},P8={codeAt:L8(!1),charAt:L8(!0)},ale=P8.charAt,sle=sa.set,lle=sa.getterFor("String Iterator");_8(String,"String",function(e){sle(this,{type:"String Iterator",string:Ua(e),index:0})},function(){var e,t=lle(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=ale(r,n),t.index+=e.length,{value:e,done:!1})});var CA=function(e,t,r){for(var n in t)la(e,n,t[n],r);return e},ule=tr.Array,cle=Math.max,I8=J0.f,M8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],dle={f:function(e){return M8&&ja(e)=="Window"?function(t){try{return I8(t)}catch(r){return function(n,i,o){for(var a,s,l,u,c=bd(n),h=lA(void 0,c),S=lA(c,c),y=ule(cle(S-h,0)),W=0;ho;o++)if((s=j(e[o]))&&G0(U8,s))return s;return new ny(!1)}n=function(D,Q){var te=arguments.length<2?N8(D):Q;if(aA(te))return Pi(Wn(te,D));throw vle(oA(D)+" is not iterable")}(e,i)}for(l=n.next;!(u=Wn(l,n)).done;){try{s=j(u.value)}catch(D){j8(n,"throw",D)}if(typeof s=="object"&&s&&G0(U8,s))return s}return new ny(!1)},yle=tr.TypeError,z8=function(e,t){if(G0(t,e))return e;throw yle("Incorrect invocation")},W8=ai("iterator"),G8=!1;try{var ble=0,V8={next:function(){return{done:!!ble++}},return:function(){G8=!0}};V8[W8]=function(){return this},Array.from(V8,function(){throw 2})}catch(e){}var DA=Array.isArray||function(e){return ja(e)=="Array"},K8=function(){},Ele=[],$8=up("Reflect","construct"),OA=/^\s*(?:class|function)\b/,xle=gr(OA.exec),Sle=!OA.exec(K8),bp=function(e){if(!fn(e))return!1;try{return $8(K8,Ele,e),!0}catch(t){return!1}},wle=!$8||hn(function(){var e;return bp(bp.call)||!bp(Object)||!bp(function(){e=!0})||e})?function(e){if(!fn(e))return!1;switch(ty(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Sle||!!xle(OA,pA(e))}:bp,Cle=ai("species"),X8=tr.Array,Y8=function(e,t){return new(function(r){var n;return DA(r)&&(n=r.constructor,(wle(n)&&(n===X8||DA(n.prototype))||pn(n)&&(n=n[Cle])===null)&&(n=void 0)),n===void 0?X8:n}(e))(t===0?0:t)},Z8=gr([].push),Ks=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(l,u,c,h){for(var S,y,W=lp(l),F=QF(W),N=AA(u,c),j=bd(F),D=0,Q=h||Y8,te=t?Q(l,j):r||a?Q(l,0):void 0;j>D;D++)if((s||D in F)&&(y=N(S=F[D],D,W),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:Z8(te,S)}else switch(e){case 4:return!1;case 7:Z8(te,S)}return o?-1:n||i?i:te}},_A={forEach:Ks(0),map:Ks(1),filter:Ks(2),some:Ks(3),every:Ks(4),find:Ks(5),findIndex:Ks(6),filterReject:Ks(7)},iy=TA.getWeakData,Tle=sa.set,Ale=sa.getterFor,Dle=_A.find,Ole=_A.findIndex,_le=gr([].splice),Rle=0,oy=function(e){return e.frozen||(e.frozen=new J8)},J8=function(){this.entries=[]},RA=function(e,t){return Dle(e.entries,function(r){return r[0]===t})};J8.prototype={get:function(e){var t=RA(this,e);if(t)return t[1]},has:function(e){return!!RA(this,e)},set:function(e,t){var r=RA(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ole(this.entries,function(r){return r[0]===e});return~t&&_le(this.entries,t,1),!!~t}};var Ep,Q8={getConstructor:function(e,t,r,n){var i=e(function(l,u){z8(l,o),Tle(l,{type:t,id:Rle++,frozen:void 0}),u!=null&&H8(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=Ale(t),s=function(l,u,c){var h=a(l),S=iy(Pi(u),!0);return S===!0?oy(h).set(u,c):S[h.id]=c,l};return CA(o,{delete:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).delete(l):c&&zn(c,u.id)&&delete c[u.id]},has:function(l){var u=a(this);if(!pn(l))return!1;var c=iy(l);return c===!0?oy(u).has(l):c&&zn(c,u.id)}}),CA(o,r?{get:function(l){var u=a(this);if(pn(l)){var c=iy(l);return c===!0?oy(u).get(l):c?c[u.id]:void 0}},set:function(l,u){return s(this,l,u)}}:{add:function(l){return s(this,l,!0)}}),i}},ay=sa.enforce,kle=!tr.ActiveXObject&&"ActiveXObject"in tr,q8=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Lle=function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=tr[e],s=a&&a.prototype,l=a,u={},c=function(N){var j=gr(s[N]);la(s,N,N=="add"?function(D){return j(this,D===0?0:D),this}:N=="delete"?function(D){return!(i&&!pn(D))&&j(this,D===0?0:D)}:N=="get"?function(D){return i&&!pn(D)?void 0:j(this,D===0?0:D)}:N=="has"?function(D){return!(i&&!pn(D))&&j(this,D===0?0:D)}:function(D,Q){return j(this,D===0?0:D,Q),this})};if(yA(e,!fn(a)||!(i||s.forEach&&!hn(function(){new a().entries().next()}))))l=r.getConstructor(t,e,n,o),TA.enable();else if(yA(e,!0)){var h=new l,S=h[o](i?{}:-0,1)!=h,y=hn(function(){h.has(1)}),W=function(N,j){if(!G8)return!1;var D=!1;try{var Q={};Q[W8]=function(){return{next:function(){return{done:D=!0}}}},function(te){new a(te)}(Q)}catch(te){}return D}(),F=!i&&hn(function(){for(var N=new a,j=5;j--;)N[o](j,j);return!N.has(-0)});W||((l=t(function(N,j){z8(N,s);var D=function(Q,te,he){var Ee,ve;return q0&&fn(Ee=te.constructor)&&Ee!==he&&pn(ve=Ee.prototype)&&ve!==he.prototype&&q0(Q,ve),Q}(new a,N,l);return j!=null&&H8(j,D[o],{that:D,AS_ENTRIES:n}),D})).prototype=s,s.constructor=l),(y||F)&&(c("delete"),c("has"),n&&c("get")),(F||S)&&c(o),i&&s.clear&&delete s.clear}return u[e]=l,Vs({global:!0,forced:l!=a},u),SA(l,e),i||r.setStrong(l,e,n),l}("WeakMap",q8,Q8);if(v8&&kle){Ep=Q8.getConstructor(q8,"WeakMap",!0),TA.enable();var xp=Lle.prototype,e6=gr(xp.delete),sy=gr(xp.has),t6=gr(xp.get),r6=gr(xp.set);CA(xp,{delete:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),e6(this,e)||t.frozen.delete(e)}return e6(this,e)},has:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)||t.frozen.has(e)}return sy(this,e)},get:function(e){if(pn(e)&&!Ou(e)){var t=ay(this);return t.frozen||(t.frozen=new Ep),sy(this,e)?t6(this,e):t.frozen.get(e)}return t6(this,e)},set:function(e,t){if(pn(e)&&!Ou(e)){var r=ay(this);r.frozen||(r.frozen=new Ep),sy(this,e)?r6(this,e,t):r.frozen.set(e,t)}else r6(this,e,t);return this}})}var n6={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kA=nA("span").classList,i6=kA&&kA.constructor&&kA.constructor.prototype,Ple=i6===Object.prototype?void 0:i6,LA=ai("iterator"),o6=ai("toStringTag"),PA=yp.values,a6=function(e,t){if(e){if(e[LA]!==PA)try{Gs(e,LA,PA)}catch(n){e[LA]=PA}if(e[o6]||Gs(e,o6,t),n6[t]){for(var r in yp)if(e[r]!==yp[r])try{Gs(e,r,yp[r])}catch(n){e[r]=yp[r]}}}};for(var IA in n6)a6(tr[IA]&&tr[IA].prototype,IA);a6(Ple,"DOMTokenList");var MA=new WeakMap,Ile={type:"list-item",renderElem:function(e,t,r){MA.set(e,r);var n=e,i=n.level,o=i===void 0?0:i,a=n.ordered,s={margin:"5px 0 5px "+20*o+"px"},l="";if(a!==void 0&&a){var u=function(h,S){var y=S,W=y.type,F=y.level,N=F===void 0?0:F,j=y.ordered,D=j!==void 0&&j;if(!D)return-1;var Q=1,te=S,he=Ae.findPath(h,te);if(he[0]===0)return 1;for(;he[0]>0;){var Ee=Ue.previous(he),ve=de.node(h,Ee);if(ve==null)break;var De=ve[0],Pe=De.level,qe=Pe===void 0?0:Pe,ot=De.type,et=De.ordered;if(ot!==W)break;if(qe=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sp(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function u6(e){return de.nodes(e,{at:e.selection||void 0,match:function(t){return Ae.findPath(e,t).length===1}})}var Mle=l8.includes;Vs({target:"Array",proto:!0},{includes:function(e){return Mle(this,e,arguments.length>1?arguments[1]:void 0)}}),pp("includes");var c6,FA,Ble=function(){var e=Pi(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},NA=tr.RegExp,jA=hn(function(){var e=NA("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),Fle=jA||hn(function(){return!NA("a","y").sticky}),Nle={BROKEN_CARET:jA||hn(function(){var e=NA("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:Fle,UNSUPPORTED_Y:jA},jle=tr.RegExp,Ule=hn(function(){var e=jle(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),Hle=tr.RegExp,zle=hn(function(){var e=Hle("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),Wle=sa.get,Gle=ZT("native-string-replace",String.prototype.replace),ly=RegExp.prototype.exec,UA=ly,Vle=gr("".charAt),Kle=gr("".indexOf),$le=gr("".replace),HA=gr("".slice),zA=(FA=/b*/g,Wn(ly,c6=/a/,"a"),Wn(ly,FA,"a"),c6.lastIndex!==0||FA.lastIndex!==0),d6=Nle.BROKEN_CARET,WA=/()??/.exec("")[1]!==void 0;(zA||WA||d6||Ule||zle)&&(UA=function(e){var t,r,n,i,o,a,s,l=this,u=Wle(l),c=Ua(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Wn(UA,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=d6&&l.sticky,z=Wn(Ble,l),F=l.source,N=0,j=c;if(y&&(z=$le(z,"y",""),Kle(z,"g")===-1&&(z+="g"),j=HA(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Vle(c,l.lastIndex-1)!==` -`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",z)),WA&&(r=new RegExp("^"+F+"$(?!\\s)",z)),zA&&(n=l.lastIndex),i=Wn(ly,y?r:l,j),y?i?(i.input=HA(i.input,N),i[0]=HA(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:zA&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),WA&&i&&i.length>1&&Wn(Gle,i[0],r,function(){for(o=1;oN?0:Pe===N?ve===z?0:1:0}(e);if(a>0)for(var s=0;s",f6.push(o);var l=function(u){var c=MA.get(u);if(c==null)return 0;var h=u,S=h.type,y=h.ordered,z=y!==void 0&&y,F=h.level,N=F===void 0?0:F,j=Ae.findPath(c,u);if(j[0]===c.children.length-1)return N+1;var D=je.next(j),Q=de.node(c,D);if(!Q)return 0;var te=Sp(Q,1)[0];if(Ae.getNodeType(te)!==S)return N+1;var he=te,Ee=he.ordered,ve=Ee!==void 0&&Ee,De=he.level,Pe=De===void 0?0:De;return PeN?0:Pe===N?ve===z?0:1:0}(e);if(l>0)for(s=0;s";return{html:"
        • "+t+"
        • ",prefix:r,suffix:n}}},tue=ai("species"),rue=_A.filter,nue=qT>=51||!hn(function(){var e=[];return(e.constructor={})[tue]=function(){return{foo:1}},e.filter(Boolean).foo!==1});Vs({target:"Array",proto:!0,forced:!nue},{filter:function(e){return rue(this,e,arguments.length>1?arguments[1]:void 0)}});var GA=Function.prototype,p6=GA.apply,iue=GA.bind,g6=GA.call,oue=typeof Reflect=="object"&&Reflect.apply||(iue?g6.bind(p6):function(){return g6.apply(p6,arguments)}),v6=(ai("species"),RegExp.prototype),aue=P8.charAt,sue=function(e,t,r){return t+(r?aue(e,t).length:1)},lue=Math.floor,VA=gr("".charAt),uue=gr("".replace),KA=gr("".slice),cue=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,due=/\$([$&'`]|\d{1,2})/g,hue=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=due;return i!==void 0&&(i=lp(i),l=cue),uue(o,l,function(u,c){var h;switch(VA(c,0)){case"$":return"$";case"&":return e;case"`":return KA(t,0,r);case"'":return KA(t,a);case"<":h=i[KA(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=lue(S/10);return y===0?u:y<=s?n[y-1]===void 0?VA(c,1):n[y-1]+VA(c,1):u}h=n[S-1]}return h===void 0?"":h})},fue=tr.TypeError,pue=function(e,t){var r=e.exec;if(fn(r)){var n=Wn(r,e,t);return n!==null&&Pi(n),n}if(ja(e)==="RegExp")return Wn(uy,e,t);throw fue("RegExp#exec called on incompatible receiver")},$A=ai("replace"),gue=Math.max,vue=Math.min,mue=gr([].concat),XA=gr([].push),m6=gr("".indexOf),y6=gr("".slice),yue="a".replace(/./,"$0")==="$0",b6=!!/./[$A]&&/./[$A]("a","$0")==="";!function(e,t,r,n){var i=ai(e),o=!hn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!hn(function(){var u=!1,c=/a/;return c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=gr(/./[i]),l=function(u,c,h){var S=b6?"$":"$0";return[function(y,z){var F=z0(this),N=y==null?void 0:hp(y,$A);return N?Wn(N,y,F,z):Wn(c,Ua(F),y,z)},function(y,z){var F=Pi(this),N=Ua(y);if(typeof z=="string"&&m6(z,S)===-1&&m6(z,"$<")===-1){var j=h(c,F,N,z);if(j.done)return j.value}var D=fn(z);D||(z=Ua(z));var Q=F.global;if(Q){var te=F.unicode;F.lastIndex=0}for(var he=[];;){var Ee=pue(F,N);if(Ee===null)break;if(XA(he,Ee),!Q)break;Ua(Ee[0])===""&&(F.lastIndex=sue(N,a8(F.lastIndex),te))}for(var ve,De="",Pe=0,qe=0;qe=Pe&&(De+=y6(N,Pe,et)+Dt,Pe=et+ot.length)}return De+y6(N,Pe)}]}(0,""[e],function(u,c,h,S,y){var z=gr(u),F=c.exec;return F===uy||F===v6.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:z(h,c,S)}:{done:!1}});la(String.prototype,e,l[0]),la(v6,i,l[1])}}("replace",0,!!hn(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$
          ")!=="7"})||!yue||b6);var bue=tr.TypeError,E6=function(e,t,r,n,i,o,a,s){for(var l,u,c=i,h=0,S=!!a&&AA(a,s);h0&&DA(l))u=bd(l),c=E6(e,t,l,u,c,o-1)-1;else{if(c>=9007199254740991)throw bue("Exceed the acceptable array length");e[c]=l}c++}h++}return c},Eue=E6;function YA(e){return e.length?e[0].tagName.toLowerCase():""}Vs({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=lp(this),r=bd(t),n=Y8(t,0);return n.length=Eue(n,t,t,r,0,e===void 0?1:fp(e)),n}}),pp("flat"),Vs({global:!0},{globalThis:tr}),io&&(_e.fn.append=io),no&&(_e.fn.attr=no),yc&&(_e.fn.parent=yc);var xue={renderElems:[Ile],editorPlugin:function(e){var t=e.deleteBackward,r=e.handleTab,n=e.normalizeNode,i=e;return i.deleteBackward=function(o){var a=i.selection;if(a!=null)if(Qe.isExpanded(a))t(o);else{var s=Ae.getSelectedNodeByType(i,"list-item");if(s!=null)if(a.focus.offset!==0)t(o);else{var l=s.level,u=l===void 0?0:l;u>0?Ve.setNodes(i,{level:u-1}):Ve.setNodes(i,{type:"paragraph",ordered:void 0,level:void 0})}else t(o)}else t(o)},i.handleTab=function(){var o,a,s,l,u=i.selection;if(u!=null){if(Qe.isCollapsed(u)){var c=Ae.getSelectedNodeByType(i,"list-item");if(c==null)return void r();if(u.focus.offset===0){var h=c.level,S=h===void 0?0:h;return void Ve.setNodes(i,{level:S+1})}}if(Qe.isExpanded(u)){var y=0,z=!1;try{for(var F=l6(u6(i)),N=F.next();!N.done;N=F.next()){var j=Sp(N.value,1)[0];Ae.getNodeType(j)==="list-item"?y++:z=!0}}catch(ve){o={error:ve}}finally{try{N&&!N.done&&(a=F.return)&&a.call(F)}finally{if(o)throw o.error}}if(z||y<=1)return void r();try{for(var D=l6(u6(i)),Q=D.next();!Q.done;Q=D.next()){var te=Sp(Q.value,2),he=(j=te[0],te[1]),Ee=j.level;S=Ee===void 0?0:Ee,Ve.setNodes(i,{level:S+1},{at:he})}}catch(ve){s={error:ve}}finally{try{Q&&!Q.done&&(l=D.return)&&l.call(D)}finally{if(s)throw s.error}}}else r()}else r()},i.normalizeNode=function(o){var a=Sp(o,2),s=a[0],l=a[1],u=Ae.getNodeType(s);return u!=="bulleted-list"&&u!=="numbered-list"||Ve.unwrapNodes(i,{at:l}),n([s,l])},i},menus:[Qle,qle],elemsToHtml:[eue],parseElemsHtml:[{selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(e,t,r){return t.flat(1/0)}},{selector:"li:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(a){return!!Rt.isText(a)||!!r.isInline(a)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=function(a){return YA(a.parent())==="ol"}(n),o=function(a){for(var s=0,l=a.parent(),u=YA(l);u==="ul"||u==="ol";)u=YA(l=l.parent()),s++;return s-1}(n);return{type:"list-item",ordered:i,level:o,children:t}}}]},x6=oe(function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",s="[object Date]",l="[object Error]",u="[object Function]",c="[object Map]",h="[object Number]",S="[object Object]",y="[object Promise]",z="[object RegExp]",F="[object Set]",N="[object String]",j="[object Symbol]",D="[object WeakMap]",Q="[object ArrayBuffer]",te="[object DataView]",he=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve[i]=ve[o]=ve[Q]=ve[a]=ve[te]=ve[s]=ve[l]=ve[u]=ve[c]=ve[h]=ve[S]=ve[z]=ve[F]=ve[N]=ve[D]=!1;var De=typeof re=="object"&&re&&re.Object===Object&&re,Pe=typeof self=="object"&&self&&self.Object===Object&&self,qe=De||Pe||Function("return this")(),ot=t&&!t.nodeType&&t,et=ot&&e&&!e.nodeType&&e,gt=et&&et.exports===ot,dt=gt&&De.process,ht=function(){try{return dt&&dt.binding&&dt.binding("util")}catch(Me){}}(),pt=ht&&ht.isTypedArray;function Dt(Me,Ze){for(var Et=-1,Kt=Me==null?0:Me.length;++Etrt))return!1;var Mt=mr.get(Me);if(Mt&&mr.get(Ze))return Mt==Ze;var xr=-1,tn=!0,Wr=2&Et?new ti:void 0;for(mr.set(Me,Ze),mr.set(Ze,Me);++xr-1},bi.prototype.set=function(Me,Ze){var Et=this.__data__,Kt=bl(Et,Me);return Kt<0?(++this.size,Et.push([Me,Ze])):Et[Kt][1]=Ze,this},Ci.prototype.clear=function(){this.size=0,this.__data__={hash:new yi,map:new(on||bi),string:new yi}},Ci.prototype.delete=function(Me){var Ze=Vo(this,Me).delete(Me);return this.size-=Ze?1:0,Ze},Ci.prototype.get=function(Me){return Vo(this,Me).get(Me)},Ci.prototype.has=function(Me){return Vo(this,Me).has(Me)},Ci.prototype.set=function(Me,Ze){var Et=Vo(this,Me),Kt=Et.size;return Et.set(Me,Ze),this.size+=Et.size==Kt?0:1,this},ti.prototype.add=ti.prototype.push=function(Me){return this.__data__.set(Me,r),this},ti.prototype.has=function(Me){return this.__data__.has(Me)},Co.prototype.clear=function(){this.__data__=new bi,this.size=0},Co.prototype.delete=function(Me){var Ze=this.__data__,Et=Ze.delete(Me);return this.size=Ze.size,Et},Co.prototype.get=function(Me){return this.__data__.get(Me)},Co.prototype.has=function(Me){return this.__data__.has(Me)},Co.prototype.set=function(Me,Ze){var Et=this.__data__;if(Et instanceof bi){var Kt=Et.__data__;if(!on||Kt.length<199)return Kt.push([Me,Ze]),this.size=++Et.size,this;Et=this.__data__=new Ci(Kt)}return Et.set(Me,Ze),this.size=Et.size,this};var Zb=ur?function(Me){return Me==null?[]:(Me=Object(Me),function(Ze,Et){for(var Kt=-1,zr=Ze==null?0:Ze.length,mr=0,Le=[];++Kt-1&&Me%1==0&&Me-1&&Me%1==0&&Me<=n}function Qb(Me){var Ze=typeof Me;return Me!=null&&(Ze=="object"||Ze=="function")}function xl(Me){return Me!=null&&typeof Me=="object"}var xa=pt?function(Me){return function(Ze){return Me(Ze)}}(pt):function(Me){return xl(Me)&&Ea(Me.length)&&!!ve[$a(Me)]};function qb(Me){return(Ze=Me)!=null&&Ea(Ze.length)&&!$g(Ze)?Vg(Me):Go(Me);var Ze}e.exports=function(Me,Ze){return Zu(Me,Ze)}});Ri("en",{tableModule:{deleteCol:"Delete column",deleteRow:"Delete row",deleteTable:"Delete table",widthAuto:"Width auto",insertCol:"Insert column",insertRow:"Insert row",insertTable:"Insert table",header:"Header"}}),Ri("zh-CN",{tableModule:{deleteCol:"\u5220\u9664\u5217",deleteRow:"\u5220\u9664\u884C",deleteTable:"\u5220\u9664\u8868\u683C",widthAuto:"\u5BBD\u5EA6\u81EA\u9002\u5E94",insertCol:"\u63D2\u5165\u5217",insertRow:"\u63D2\u5165\u884C",insertTable:"\u63D2\u5165\u8868\u683C",header:"\u8868\u5934"}});var S6=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof ze!="undefined"?ze:typeof self!="undefined"?self:{};function w6(e){var t={exports:{}};return e(t,t.exports),t.exports}var $s,cy,dy=function(e){return e&&e.Math==Math&&e},fr=dy(typeof globalThis=="object"&&globalThis)||dy(typeof window=="object"&&window)||dy(typeof self=="object"&&self)||dy(typeof S6=="object"&&S6)||function(){return this}()||Function("return this")(),Mn=function(e){try{return!!e()}catch(t){return!0}},Xs=!Mn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),wp=Function.prototype.call,Bn=wp.bind?wp.bind(wp):function(){return wp.apply(wp,arguments)},C6={}.propertyIsEnumerable,T6=Object.getOwnPropertyDescriptor,Sue={f:T6&&!C6.call({1:2},1)?function(e){var t=T6(this,e);return!!t&&t.enumerable}:C6},ZA=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},A6=Function.prototype,JA=A6.bind,QA=A6.call,wue=JA&&JA.bind(QA),yr=JA?function(e){return e&&wue(QA,e)}:function(e){return e&&function(){return QA.apply(e,arguments)}},Cue=yr({}.toString),Tue=yr("".slice),Ys=function(e){return Tue(Cue(e),8,-1)},qA=fr.Object,Aue=yr("".split),D6=Mn(function(){return!qA("z").propertyIsEnumerable(0)})?function(e){return Ys(e)=="String"?Aue(e,""):qA(e)}:qA,Due=fr.TypeError,Zs=function(e){if(e==null)throw Due("Can't call method on "+e);return e},Cp=function(e){return D6(Zs(e))},si=function(e){return typeof e=="function"},yo=function(e){return typeof e=="object"?e!==null:si(e)},Oue=function(e){return si(e)?e:void 0},Tp=function(e,t){return arguments.length<2?Oue(fr[e]):fr[e]&&fr[e][t]},O6=yr({}.isPrototypeOf),e2=Tp("navigator","userAgent")||"",_6=fr.process,R6=fr.Deno,k6=_6&&_6.versions||R6&&R6.version,L6=k6&&k6.v8;L6&&(cy=($s=L6.split("."))[0]>0&&$s[0]<4?1:+($s[0]+$s[1])),!cy&&e2&&(!($s=e2.match(/Edge\/(\d+)/))||$s[1]>=74)&&($s=e2.match(/Chrome\/(\d+)/))&&(cy=+$s[1]);var t2=cy,r2=!!Object.getOwnPropertySymbols&&!Mn(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t2&&t2<41}),n2=r2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",_ue=fr.Object,i2=n2?function(e){return typeof e=="symbol"}:function(e){var t=Tp("Symbol");return si(t)&&O6(t.prototype,_ue(e))},Rue=fr.String,P6=function(e){try{return Rue(e)}catch(t){return"Object"}},kue=fr.TypeError,I6=function(e){if(si(e))return e;throw kue(P6(e)+" is not a function")},o2=function(e,t){var r=e[t];return r==null?void 0:I6(r)},Lue=fr.TypeError,Pue=Object.defineProperty,a2=function(e,t){try{Pue(fr,e,{value:t,configurable:!0,writable:!0})}catch(r){fr[e]=t}return t},Js=fr["__core-js_shared__"]||a2("__core-js_shared__",{}),s2=w6(function(e){(e.exports=function(t,r){return Js[t]||(Js[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})}),Iue=fr.Object,l2=function(e){return Iue(Zs(e))},Mue=yr({}.hasOwnProperty),bo=Object.hasOwn||function(e,t){return Mue(l2(e),t)},Bue=0,Fue=Math.random(),Nue=yr(1 .toString),M6=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Nue(++Bue+Fue,36)},Ap=s2("wks"),_u=fr.Symbol,B6=_u&&_u.for,jue=n2?_u:_u&&_u.withoutSetter||M6,Eo=function(e){if(!bo(Ap,e)||!r2&&typeof Ap[e]!="string"){var t="Symbol."+e;r2&&bo(_u,e)?Ap[e]=_u[e]:Ap[e]=n2&&B6?B6(t):jue(t)}return Ap[e]},Uue=fr.TypeError,Hue=Eo("toPrimitive"),u2=function(e){var t=function(r,n){if(!yo(r)||i2(r))return r;var i,o=o2(r,Hue);if(o){if(n===void 0&&(n="default"),i=Bn(o,r,n),!yo(i)||i2(i))return i;throw Uue("Can't convert object to primitive value")}return n===void 0&&(n="number"),function(a,s){var l,u;if(s==="string"&&si(l=a.toString)&&!yo(u=Bn(l,a)))return u;if(si(l=a.valueOf)&&!yo(u=Bn(l,a)))return u;if(s!=="string"&&si(l=a.toString)&&!yo(u=Bn(l,a)))return u;throw Lue("Can't convert object to primitive value")}(r,n)}(e,"string");return i2(t)?t:t+""},c2=fr.document,zue=yo(c2)&&yo(c2.createElement),d2=function(e){return zue?c2.createElement(e):{}},F6=!Xs&&!Mn(function(){return Object.defineProperty(d2("div"),"a",{get:function(){return 7}}).a!=7}),N6=Object.getOwnPropertyDescriptor,j6={f:Xs?N6:function(e,t){if(e=Cp(e),t=u2(t),F6)try{return N6(e,t)}catch(r){}if(bo(e,t))return ZA(!Bn(Sue.f,e,t),e[t])}},Wue=fr.String,Gue=fr.TypeError,xo=function(e){if(yo(e))return e;throw Gue(Wue(e)+" is not an object")},Vue=fr.TypeError,U6=Object.defineProperty,Dp={f:Xs?U6:function(e,t,r){if(xo(e),t=u2(t),xo(r),F6)try{return U6(e,t,r)}catch(n){}if("get"in r||"set"in r)throw Vue("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Sd=Xs?function(e,t,r){return Dp.f(e,t,ZA(1,r))}:function(e,t,r){return e[t]=r,e},Kue=yr(Function.toString);si(Js.inspectSource)||(Js.inspectSource=function(e){return Kue(e)});var hy,Op,fy,h2=Js.inspectSource,H6=fr.WeakMap,$ue=si(H6)&&/native code/.test(h2(H6)),z6=s2("keys"),W6=function(e){return z6[e]||(z6[e]=M6(e))},f2={},p2=fr.TypeError,Xue=fr.WeakMap;if($ue||Js.state){var Ru=Js.state||(Js.state=new Xue),Yue=yr(Ru.get),G6=yr(Ru.has),Zue=yr(Ru.set);hy=function(e,t){if(G6(Ru,e))throw new p2("Object already initialized");return t.facade=e,Zue(Ru,e,t),t},Op=function(e){return Yue(Ru,e)||{}},fy=function(e){return G6(Ru,e)}}else{var wd=W6("state");f2[wd]=!0,hy=function(e,t){if(bo(e,wd))throw new p2("Object already initialized");return t.facade=e,Sd(e,wd,t),t},Op=function(e){return bo(e,wd)?e[wd]:{}},fy=function(e){return bo(e,wd)}}var g2={set:hy,get:Op,has:fy,enforce:function(e){return fy(e)?Op(e):hy(e,{})},getterFor:function(e){return function(t){var r;if(!yo(t)||(r=Op(t)).type!==e)throw p2("Incompatible receiver, "+e+" required");return r}}},V6=Function.prototype,Jue=Xs&&Object.getOwnPropertyDescriptor,v2=bo(V6,"name"),m2={EXISTS:v2,PROPER:v2&&function(){}.name==="something",CONFIGURABLE:v2&&(!Xs||Xs&&Jue(V6,"name").configurable)},_p=w6(function(e){var t=m2.CONFIGURABLE,r=g2.get,n=g2.enforce,i=String(String).split("String");(e.exports=function(o,a,s,l){var u,c=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,S=!!l&&!!l.noTargetGet,y=l&&l.name!==void 0?l.name:a;si(s)&&(String(y).slice(0,7)==="Symbol("&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!bo(s,"name")||t&&s.name!==y)&&Sd(s,"name",y),(u=n(s)).source||(u.source=i.join(typeof y=="string"?y:""))),o!==fr?(c?!S&&o[a]&&(h=!0):delete o[a],h?o[a]=s:Sd(o,a,s)):h?o[a]=s:a2(a,s)})(Function.prototype,"toString",function(){return si(this)&&r(this).source||h2(this)})}),Que=Math.ceil,que=Math.floor,py=function(e){var t=+e;return t!=t||t===0?0:(t>0?que:Que)(t)},ece=Math.max,tce=Math.min,Rp=function(e,t){var r=py(e);return r<0?ece(r+t,0):tce(r,t)},rce=Math.min,y2=function(e){return e>0?rce(py(e),9007199254740991):0},gy=function(e){return y2(e.length)},K6=function(e){return function(t,r,n){var i,o=Cp(t),a=gy(o),s=Rp(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},nce=(K6(!0),K6(!1)),$6=yr([].push),X6=function(e,t){var r,n=Cp(e),i=0,o=[];for(r in n)!bo(f2,r)&&bo(n,r)&&$6(o,r);for(;t.length>i;)bo(n,r=t[i++])&&(~nce(o,r)||$6(o,r));return o},vy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ice=vy.concat("length","prototype"),oce={f:Object.getOwnPropertyNames||function(e){return X6(e,ice)}},ace={f:Object.getOwnPropertySymbols},sce=yr([].concat),lce=Tp("Reflect","ownKeys")||function(e){var t=oce.f(xo(e)),r=ace.f;return r?sce(t,r(e)):t},uce=function(e,t){for(var r=lce(t),n=Dp.f,i=j6.f,o=0;o3})},{anchor:function(e){return t=e,r=pi(Zs(this)),n=""+r+"";var t,r,n}});var my,Z6=function(){var e=xo(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},x2=fr.RegExp,S2=Mn(function(){var e=x2("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),wce=S2||Mn(function(){return!x2("a","y").sticky}),J6={BROKEN_CARET:S2||Mn(function(){var e=x2("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MISSED_STICKY:wce,UNSUPPORTED_Y:S2},Cce=Object.keys||function(e){return X6(e,vy)},Tce=Xs?Object.defineProperties:function(e,t){xo(e);for(var r,n=Cp(t),i=Cce(t),o=i.length,a=0;o>a;)Dp.f(e,r=i[a++],n[r]);return e},Ace=Tp("document","documentElement"),Q6=W6("IE_PROTO"),w2=function(){},q6=function(e){return""},eN=function(e){e.write(q6("")),e.close();var t=e.parentWindow.Object;return e=null,t},yy=function(){try{my=new ActiveXObject("htmlfile")}catch(n){}var e,t;yy=typeof document!="undefined"?document.domain&&my?eN(my):((t=d2("iframe")).style.display="none",Ace.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(q6("document.F=Object")),e.close(),e.F):eN(my);for(var r=vy.length;r--;)delete yy.prototype[vy[r]];return yy()};f2[Q6]=!0;var tN,C2,rN=Object.create||function(e,t){var r;return e!==null?(w2.prototype=xo(e),r=new w2,w2.prototype=null,r[Q6]=e):r=yy(),t===void 0?r:Tce(r,t)},Dce=fr.RegExp,Oce=Mn(function(){var e=Dce(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),_ce=fr.RegExp,Rce=Mn(function(){var e=_ce("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),kce=g2.get,Lce=s2("native-string-replace",String.prototype.replace),by=RegExp.prototype.exec,T2=by,Pce=yr("".charAt),Ice=yr("".indexOf),Mce=yr("".replace),A2=yr("".slice),D2=(C2=/b*/g,Bn(by,tN=/a/,"a"),Bn(by,C2,"a"),tN.lastIndex!==0||C2.lastIndex!==0),nN=J6.BROKEN_CARET,O2=/()??/.exec("")[1]!==void 0;(D2||O2||nN||Oce||Rce)&&(T2=function(e){var t,r,n,i,o,a,s,l=this,u=kce(l),c=pi(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=Bn(T2,h,c),l.lastIndex=h.lastIndex,t;var S=u.groups,y=nN&&l.sticky,z=Bn(Z6,l),F=l.source,N=0,j=c;if(y&&(z=Mce(z,"y",""),Ice(z,"g")===-1&&(z+="g"),j=A2(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&Pce(c,l.lastIndex-1)!==` -`)&&(F="(?: "+F+")",j=" "+j,N++),r=new RegExp("^(?:"+F+")",z)),O2&&(r=new RegExp("^"+F+"$(?!\\s)",z)),D2&&(n=l.lastIndex),i=Bn(by,y?r:l,j),y?i?(i.input=A2(i.input,N),i[0]=A2(i[0],N),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:D2&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),O2&&i&&i.length>1&&Bn(Lce,i[0],r,function(){for(o=1;o=51||!Mn(function(){var t=[];return(t.constructor={})[jce]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Uce=yr([].slice),Hce=k2("slice"),zce=Eo("species"),L2=fr.Array,Wce=Math.max;function No(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function sN(e){var t=e.selection;if(t==null)return!1;var r=No(de.nodes(e,{match:function(o){return Ae.checkNodeType(o,"table-cell")}}),1)[0];if(r){var n=No(r,2)[1],i=de.start(e,n);if(cr.equals(t.anchor,i))return!0}return!1}function lN(e,t){var r,n,i=de.nodes(e,{at:t,match:function(l){return Ae.getNodeType(l)==="table"}}),o=!1;try{for(var a=function(l){var u=typeof Symbol=="function"&&Symbol.iterator,c=u&&l[u],h=0;if(c)return c.call(l);if(l&&typeof l.length=="number")return{next:function(){return l&&h>=l.length&&(l=void 0),{value:l&&l[h++],done:!l}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}(i),s=a.next();!s.done;s=a.next())s.value,o=!0}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}Qs({target:"Array",proto:!0,forced:!Hce},{slice:function(e,t){var r,n,i,o=Cp(this),a=gy(o),s=Rp(e,a),l=Rp(t===void 0?a:t,a);if(Ey(o)&&(r=o.constructor,(R2(r)&&(r===L2||Ey(r.prototype))||yo(r)&&(r=r[zce])===null)&&(r=void 0),r===L2||r===void 0))return Uce(o,s,l);for(n=new(r===void 0?L2:r)(Wce(l-s,0)),i=0;sD;D++)if((s||D in F)&&(y=N(S=F[D],D,z),e))if(t)te[D]=y;else if(y)switch(e){case 3:return!0;case 5:return S;case 6:return D;case 2:dN(te,S)}else switch(e){case 4:return!1;case 7:dN(te,S)}return o?-1:n||i?i:te}},xy={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Kce=xy.map;Qs({target:"Array",proto:!0,forced:!k2("map")},{map:function(e){return Kce(this,e,arguments.length>1?arguments[1]:void 0)}});var $ce=b2?{}.toString:function(){return"[object "+E2(this)+"]"};function Sy(e){var t=e.children||[];return t.length===0?[]:(t[0]||{}).children||[]}function hN(e){return Sy(e).every(function(t){return!!t.isHeader})}b2||_p(Object.prototype,"toString",$ce,{unsafe:!0});var Xce=m2.PROPER,P2=RegExp.prototype,fN=P2.toString,Yce=yr(Z6),Zce=Mn(function(){return fN.call({source:"a",flags:"b"})!="/a/b"}),Jce=Xce&&fN.name!="toString";(Zce||Jce)&&_p(RegExp.prototype,"toString",function(){var e=xo(this),t=pi(e.source),r=e.flags;return"/"+t+"/"+pi(r===void 0&&O6(P2,e)&&!("flags"in P2)?Yce(e):r)},{unsafe:!0});var I2=Eo("unscopables"),M2=Array.prototype;M2[I2]==null&&Dp.f(M2,I2,{configurable:!0,value:rN(null)});var Qce=xy.find,pN=!0;"find"in[]&&Array(1).find(function(){pN=!1}),Qs({target:"Array",proto:!0,forced:pN},{find:function(e){return Qce(this,e,arguments.length>1?arguments[1]:void 0)}}),M2[I2].find=!0;var B2=Function.prototype,gN=B2.apply,qce=B2.bind,vN=B2.call,mN=typeof Reflect=="object"&&Reflect.apply||(qce?vN.bind(gN):function(){return vN.apply(gN,arguments)}),ede=Eo("species"),F2=RegExp.prototype,yN=function(e,t,r,n){var i=Eo(e),o=!Mn(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),a=o&&!Mn(function(){var u=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[ede]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return u=!0,null},c[i](""),!u});if(!o||!a||r){var s=yr(/./[i]),l=t(i,""[e],function(u,c,h,S,y){var z=yr(u),F=c.exec;return F===Lp||F===F2.exec?o&&!y?{done:!0,value:s(c,h,S)}:{done:!0,value:z(h,c,S)}:{done:!1}});_p(String.prototype,e,l[0]),_p(F2,i,l[1])}n&&Sd(F2[i],"sham",!0)},tde=Eo("match"),rde=fr.TypeError,nde=Eo("species"),ide=yr("".charAt),bN=yr("".charCodeAt),ode=yr("".slice),EN=function(e){return function(t,r){var n,i,o=pi(Zs(t)),a=py(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=bN(o,a))<55296||n>56319||a+1===s||(i=bN(o,a+1))<56320||i>57343?e?ide(o,a):n:e?ode(o,a,a+2):i-56320+(n-55296<<10)+65536}},ade=(EN(!1),EN(!0)),xN=function(e,t,r){return t+(r?ade(e,t).length:1)},sde=fr.Array,lde=Math.max,SN=function(e,t,r){for(var n=gy(e),i=Rp(t,n),o=Rp(r===void 0?n:r,n),a=sde(lde(o-i,0)),s=0;i1||"".split(/.?/).length?function(i,o){var a,s,l=pi(Zs(this)),u=o===void 0?4294967295:o>>>0;if(u===0)return[];if(i===void 0)return[l];if(!yo(a=i)||!((s=a[tde])!==void 0?s:Ys(a)=="RegExp"))return Bn(t,l,i,u);for(var c,h,S,y=[],z=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),F=0,N=new RegExp(i.source,z+"g");(c=Bn(Lp,N,l))&&!((h=N.lastIndex)>F&&(Td(y,Ip(l,F,c.index)),c.length>1&&c.index=u));)N.lastIndex===c.index&&N.lastIndex++;return F===l.length?!S&&dde(N,"")||Td(y,""):Td(y,Ip(l,F)),y.length>u?SN(y,0,u):y}:"0".split(void 0,0).length?function(i,o){return i===void 0&&o===0?[]:Bn(t,this,i,o)}:t,[function(i,o){var a=Zs(this),s=i==null?void 0:o2(i,e);return s?Bn(s,i,a,o):Bn(n,pi(a),i,o)},function(i,o){var a=xo(this),s=pi(i),l=r(n,a,s,o,n!==t);if(l.done)return l.value;var u=function(te,he){var Ee,ve=xo(te).constructor;return ve===void 0||(Ee=xo(ve)[nde])==null?he:function(De){if(R2(De))return De;throw rde(P6(De)+" is not a constructor")}(Ee)}(a,RegExp),c=a.unicode,h=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Cd?"g":"y"),S=new u(Cd?"^(?:"+a.source+")":a,h),y=o===void 0?4294967295:o>>>0;if(y===0)return[];if(s.length===0)return N2(S,s)===null?[s]:[];for(var z=0,F=0,N=[];F=0,N=cr.compare(h,z)<=0&&cr.compare(h,y)>=0;return!!(F&&N&&je.equals(c.path.slice(0,3),h.path.slice(0,3)))}(r,e),i=e.width,o=i===void 0?"auto":i,a=er("div",{className:"table-container","data-selected":Ae.isNodeSelected(r,e),on:{mousedown:function(s){if(s.target.tagName==="DIV"&&s.preventDefault(),!r.isDisabled()){var l=Ae.findPath(r,e),u=de.start(r,l),c=r.selection;c!=null?c.anchor.path[0]!==l[0]&&r.select(u):r.select(u)}}}},er("table",{width:o,contentEditable:n},er("colgroup",null,Sy(e).map(function(s){var l=s.width;return er("col",{width:l===void 0?"auto":l})})),er("tbody",null,t)));return a}},yde={type:"table-row",renderElem:function(e,t,r){return er("tr",null,t)}},bde={type:"table-cell",renderElem:function(e,t,r){var n=function(S,y){var z=Ae.getParentNode(S,y);if(z==null)return!1;var F=Ae.getParentNode(S,z);return F!=null&&Sy(F).some(function(N){return N===y})}(r,e),i=e,o=i.colSpan,a=o===void 0?1:o,s=i.rowSpan,l=s===void 0?1:s,u=i.isHeader,c=u!==void 0&&u;if(!n)return er("td",{colSpan:a,rowSpan:l},t);var h=er(c?"th":"td",{colSpan:a,rowSpan:l,style:{borderRightWidth:"3px"},on:{mousemove:Hl(function(S){var y=this.elm;if(y!=null){var z=y.getBoundingClientRect(),F=z.left,N=z.width,j=z.top,D=z.height,Q=S.clientX,te=S.clientY;Mp||(Q>F+N-5&&Qj&&te1?arguments[1]:void 0)}});var Sde=Math.floor,H2=yr("".charAt),wde=yr("".replace),z2=yr("".slice),Cde=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tde=/\$([$&'`]|\d{1,2})/g,Ade=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,l=Tde;return i!==void 0&&(i=l2(i),l=Cde),wde(o,l,function(u,c){var h;switch(H2(c,0)){case"$":return"$";case"&":return e;case"`":return z2(t,0,r);case"'":return z2(t,a);case"<":h=i[z2(c,1,-1)];break;default:var S=+c;if(S===0)return u;if(S>s){var y=Sde(S/10);return y===0?u:y<=s?n[y-1]===void 0?H2(c,1):n[y-1]+H2(c,1):u}h=n[S-1]}return h===void 0?"":h})},W2=Eo("replace"),Dde=Math.max,Ode=Math.min,_de=yr([].concat),G2=yr([].push),RN=yr("".indexOf),kN=yr("".slice),Rde="a".replace(/./,"$0")==="$0",LN=!!/./[W2]&&/./[W2]("a","$0")==="";yN("replace",function(e,t,r){var n=LN?"$":"$0";return[function(i,o){var a=Zs(this),s=i==null?void 0:o2(i,W2);return s?Bn(s,i,a,o):Bn(t,pi(a),i,o)},function(i,o){var a=xo(this),s=pi(i);if(typeof o=="string"&&RN(o,n)===-1&&RN(o,"$<")===-1){var l=r(t,a,s,o);if(l.done)return l.value}var u=si(o);u||(o=pi(o));var c=a.global;if(c){var h=a.unicode;a.lastIndex=0}for(var S=[];;){var y=N2(a,s);if(y===null)break;if(G2(S,y),!c)break;pi(y[0])===""&&(a.lastIndex=xN(s,y2(a.lastIndex),h))}for(var z,F="",N=0,j=0;j=N&&(F+=kN(s,N,Q)+De,N=Q+D.length)}return F+kN(s,N)}]},!!Mn(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"})||!Rde||LN);var kde={selector:"td:not([data-w-e-type]),th:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e);(t=t.filter(function(s){return!!Rt.isText(s)||!!r.isInline(s)})).length===0&&(t=[{text:n.text().replace(/\s+/gm," ")}]);var i=parseInt(n.attr("colSpan")||"1"),o=parseInt(n.attr("rowSpan")||"1"),a=n.attr("width")||"auto";return{type:"table-cell",isHeader:TN(n)==="th",colSpan:i,rowSpan:o,width:a,children:t}}},Lde={selector:"tr:not([data-w-e-type])",parseElemHtml:function(e,t,r){return{type:"table-row",children:t.filter(function(n){return Ae.getNodeType(n)==="table-cell"})}}},Pde={selector:"table:not([data-w-e-type])",parseElemHtml:function(e,t,r){var n=_e(e),i="auto";return function(o,a){for(var s="",l=(o.attr("style")||"").split(";"),u=l.length,c=0;c',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.exec=function(t,r){},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||!!Ae.getSelectedElems(t).some(function(n){var i=Ae.getNodeType(n);return i==="pre"||i==="table"||i==="list-item"||!!t.isVoid(n)})},e.prototype.getPanelContentElem=function(t){var r=this;if(this.$content)return this.$content[0];for(var n=_e('
          '),i=_e("0 × 0"),o=_e("
          "),a=0;a<10;a++){for(var s=_e(""),l=0;l<10;l++){var u=_e("");u.attr("data-x",l.toString()),u.attr("data-y",a.toString()),s.append(u),u.on("mouseenter",function(c){var h=c.target;if(h!=null){var S=_e(h).dataset(),y=S.x,z=S.y;i[0].innerHTML=y+1+" × "+(z+1),o.children().each(function(F){_e(F).children().each(function(N){var j=_e(N),D=j.dataset(),Q=D.x,te=D.y;Q<=y&&te<=z?j.addClass("active"):j.removeClass("active")})})}}),u.on("click",function(c){c.preventDefault();var h=c.target;if(h!=null){var S=_e(h).dataset(),y=S.x,z=S.y;r.insertTable(t,z+1,y+1)}})}o.append(s)}return n.append(o),n.append(i),this.$content=n,n[0]},e.prototype.insertTable=function(t,r,n){var i=parseInt(r,10),o=parseInt(n,10);if(i&&o&&!(i<=0||o<=0)){Ae.isSelectedEmptyParagraph(t)&&Ve.removeNodes(t,{mode:"highest"});var a=function(s,l){for(var u=[],c=0;c',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){return t.selection==null||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){this.isDisabled(t)||Ve.removeNodes(t,{mode:"highest"})},e}(),Bde=function(){function e(){this.title=wt("tableModule.insertRow"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(y){return Ae.checkNodeType(y,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o),l=(s==null?void 0:s.children.length)||0;if(l!==0){for(var u={type:"table-row",children:[]},c=0;c',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table-row")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(l){return Ae.checkNodeType(l,"table-row")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o);((s==null?void 0:s.children.length)||0)<=1?Ve.removeNodes(t,{mode:"highest"}):Ve.removeNodes(t,{at:a})}},e}(),PN={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},V2=d2("span").classList,IN=V2&&V2.constructor&&V2.constructor.prototype,Nde=IN===Object.prototype?void 0:IN,jde=xy.forEach,Ude=function(e,t){var r=[].forEach;return!!r&&Mn(function(){r.call(null,function(){throw 1},1)})}(),K2=Ude?[].forEach:function(e){return jde(this,e,arguments.length>1?arguments[1]:void 0)},MN=function(e){if(e&&e.forEach!==K2)try{Sd(e,"forEach",K2)}catch(t){e.forEach=K2}};for(var $2 in PN)PN[$2]&&MN(fr[$2]&&fr[$2].prototype);MN(Nde);var Hde=function(){function e(){this.title=wt("tableModule.insertCol"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(u){return Ae.checkNodeType(u,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o);if(s!=null){var l=Ae.getParentNode(t,s);l!=null&&(l.children||[]).forEach(function(u,c){Ut.isElement(u)&&(u.children||[]).forEach(function(h){var S=Ae.findPath(t,h);if(S.length===a.length&&x6(S.slice(-1),a.slice(-1))){var y={type:"table-cell",children:[{text:""}]};c===0&&hN(l)&&(y.isHeader=!0),Ve.insertNodes(t,y,{at:S})}})})}}},e}(),zde=function(){function e(){this.title=wt("tableModule.deleteCol"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){return""},e.prototype.isActive=function(t){return!1},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table-cell")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=No(de.nodes(t,{match:function(c){return Ae.checkNodeType(c,"table-cell")},universal:!0}),1),i=No(n[0],2),o=i[0],a=i[1],s=Ae.getParentNode(t,o),l=(s==null?void 0:s.children.length)||0;if(!s||l<=1)Ve.removeNodes(t,{mode:"highest"});else{var u=Ae.getParentNode(t,s);u!=null&&(u.children||[]).forEach(function(c){Ut.isElement(c)&&(c.children||[]).forEach(function(h){var S=Ae.findPath(t,h);S.length===a.length&&x6(S.slice(-1),a.slice(-1))&&Ve.removeNodes(t,{at:S})})})}}},e}(),Wde=function(){function e(){this.title=wt("tableModule.header"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"table");return r!=null&&hN(r)},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n=!r,i=Ae.getSelectedNodeByType(t,"table");i!=null&&Sy(i).forEach(function(o){return Ve.setNodes(t,{isHeader:n},{at:Ae.findPath(t,o)})})}},e}(),Gde=function(){function e(){this.title=wt("tableModule.widthAuto"),this.iconSvg='',this.tag="button"}return e.prototype.getValue=function(t){var r=Ae.getSelectedNodeByType(t,"table");return r!=null&&r.width==="100%"},e.prototype.isActive=function(t){return!!this.getValue(t)},e.prototype.isDisabled=function(t){var r=t.selection;return r==null||!Qe.isCollapsed(r)||Ae.getSelectedNodeByType(t,"table")==null},e.prototype.exec=function(t,r){if(!this.isDisabled(t)){var n={width:r?"auto":"100%"};Ve.setNodes(t,n,{mode:"highest"})}},e}(),Vde={renderElems:[mde,yde,bde],elemsToHtml:[{type:"table",elemToHtml:function(e,t){var r=e.width;return''+t+"
          "}},{type:"table-row",elemToHtml:function(e,t){return""+t+""}},{type:"table-cell",elemToHtml:function(e,t){var r=e,n=r.colSpan,i=n===void 0?1:n,o=r.rowSpan,a=o===void 0?1:o,s=r.isHeader,l=s!==void 0&&s,u=r.width,c=l?"th":"td";return"<"+c+' colSpan="'+i+'" rowSpan="'+a+'" width="'+(u===void 0?"auto":u)+'">'+t+""}}],preParseHtml:[Ede],parseElemsHtml:[kde,Lde,Pde],menus:[{key:"insertTable",factory:function(){return new Ide}},{key:"deleteTable",factory:function(){return new Mde}},{key:"insertTableRow",factory:function(){return new Bde}},{key:"deleteTableRow",factory:function(){return new Fde}},{key:"insertTableCol",factory:function(){return new Hde}},{key:"deleteTableCol",factory:function(){return new zde}},{key:"tableHeader",factory:function(){return new Wde}},{key:"tableFullWidth",factory:function(){return new Gde}}],editorPlugin:function(e){var t=e.insertBreak,r=e.deleteBackward,n=e.deleteForward,i=e.normalizeNode,o=e.insertData,a=e.handleTab,s=e.selectAll,l=e;return l.insertBreak=function(){Ae.getSelectedNodeByType(l,"table")==null?t():l.insertText(` -`)},l.deleteBackward=function(u){if(!sN(l)){var c=l.selection;if(c){var h=de.before(l,c);if(h){var S=lN(l,h),y=lN(l,c);if(S&&!y)return}}r(u)}},l.handleTab=function(){var u;if(Ae.getSelectedNodeByType(l,"table")){var c=de.above(e);Ae.checkNodeType(c[0],"table-cell")&&Ve.select(e,c[1]);var h=de.next(e);if(h)h[0]&&h[0].text&&(h=(u=de.above(e,{at:h[1]}))!==null&&u!==void 0?u:h),Ve.select(e,h[1]);else{var S=l.children||[],y=S.length;if(Ae.checkNodeType(S[y-1],"table")){var z=Ae.genEmptyParagraph();Ve.insertNodes(l,z,{at:[y]}),l.handleTab()}}}else a()},l.deleteForward=function(u){sN(l)||n(u)},l.normalizeNode=function(u){var c=No(u,2),h=c[0],S=c[1];if(Ae.getNodeType(h)!=="table")return i([h,S]);if(Ae.isLastNode(l,h)){var y=Ae.genEmptyParagraph();Ve.insertNodes(l,y,{at:[S[0]+1]})}},l.insertData=function(u){if(Ae.getSelectedNodeByType(l,"table")!=null){var c=u.getData("text/plain");c===` -`||/]+>/.test(u.getData("text/html"))?o(u):de.insertText(l,c)}else o(u)},l.selectAll=function(){var u=l.selection;if(u!=null){var c=Ae.getSelectedNodeByType(l,"table-cell");if(c!=null){var h=u.anchor,S=u.focus;if(je.equals(h.path.slice(0,3),S.path.slice(0,3)))if(St.string(c).length!==0){var y=Ae.findPath(l,c),z={anchor:de.start(l,y),focus:de.end(l,y)};l.select(z)}else s();else s()}else s()}else s()},l}};Ri("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party