From cabd95fbc3c44412898089c37bacd21ba8d88df9 Mon Sep 17 00:00:00 2001 From: mgesing Date: Tue, 3 Dec 2024 11:20:49 +0100 Subject: [PATCH 01/31] Considers grid sorting when editing a sibling attribute combination --- .../ProductController.Attributes.cs | 95 ++++++++++--------- ...ProductVariantAttributeCombinationModel.cs | 7 +- .../AttributeCombinationEditPopup.cshtml | 10 +- .../Grids/_Grid.AttributeCombinations.cshtml | 10 +- 4 files changed, 68 insertions(+), 54 deletions(-) diff --git a/src/Smartstore.Web/Areas/Admin/Controllers/ProductController.Attributes.cs b/src/Smartstore.Web/Areas/Admin/Controllers/ProductController.Attributes.cs index e50bcad517..33ec131ce0 100644 --- a/src/Smartstore.Web/Areas/Admin/Controllers/ProductController.Attributes.cs +++ b/src/Smartstore.Web/Areas/Admin/Controllers/ProductController.Attributes.cs @@ -727,6 +727,7 @@ public async Task ProductVariantAttributeCombinationList(GridComm var customer = _workContext.CurrentCustomer; var product = await _db.Products.FindByIdAsync(productId, false); var productSlug = await product.GetActiveSlugAsync(); + var index = Math.Max((command.Page - 1) * command.PageSize, 0); var allCombinations = await _db.ProductVariantAttributeCombinations .AsNoTracking() @@ -744,6 +745,7 @@ public async Task ProductVariantAttributeCombinationList(GridComm var pvacModel = await mapper.MapAsync(x); pvacModel.ProductId = product.Id; pvacModel.ProductUrl = await _productUrlHelper.Value.GetProductPathAsync(product.Id, productSlug, x.AttributeSelection); + pvacModel.EntityIndex = index++; pvacModel.AttributesXml = await _productAttributeFormatter.Value.FormatAttributesAsync( x.AttributeSelection, product, @@ -788,7 +790,7 @@ public async Task AttributeCombinationCreatePopup(string btnId, s } var model = new ProductVariantAttributeCombinationModel(); - await PrepareProductAttributeCombinationModelAsync(model, null, product); + await PrepareProductAttributeCombinationModel(model, null, product); PrepareViewBag(btnId, formId, false, false); return View(model); @@ -835,7 +837,7 @@ public async Task AttributeCombinationCreatePopup( await _db.SaveChangesAsync(); } - await PrepareProductAttributeCombinationModelAsync(model, null, product); + await PrepareProductAttributeCombinationModel(model, null, product); PrepareViewBag(btnId, formId, warnings.Count == 0, false); if (warnings.Count > 0) @@ -847,14 +849,20 @@ public async Task AttributeCombinationCreatePopup( } [Permission(Permissions.Catalog.Product.Read)] - public async Task AttributeCombinationEditPopup(int id, string btnId, string formId) + public async Task AttributeCombinationEditPopup( + int id, + string btnId, + string formId, + int entityIndex) { - var model = await PrepareProductAttributeCombinationModelAsync(id); + var model = await PrepareProductAttributeCombinationModel(id); if (model == null) { return NotFound(); } - + + model.EntityIndex = entityIndex; + PrepareViewBag(btnId, formId); return View(model); @@ -878,53 +886,51 @@ public async Task AttributeCombinationEditPopup(string btnId, str } // AJAX. + [HttpPost] [Permission(Permissions.Catalog.Product.Read)] - public async Task EditSiblingAttributeCombination(int currentId, int productId, bool next) + public async Task EditSiblingAttributeCombination( + GridCommand command, + int productId, + int entityIndex, + int totalRecords, + bool next) { - var siblingCombinationId = await GetSiblingQuery(true).FirstOrDefaultAsync(); - if (siblingCombinationId == 0) + // Update "entityIndex" to index of sibling. + entityIndex += next ? 1 : -1; + if (entityIndex < 0) { - siblingCombinationId = await GetSiblingQuery(false).FirstOrDefaultAsync(); + entityIndex = totalRecords - 1; + } + else if (entityIndex >= totalRecords) + { + entityIndex = 0; } - var model = await PrepareProductAttributeCombinationModelAsync(siblingCombinationId); - ViewBag.IsEdit = true; - - var partial = model != null - ? await InvokePartialViewAsync("_CreateOrUpdateAttributeCombinationPopup", model) - : null; - - return new JsonResult(new { partial }); + // Same query as in ProductVariantAttributeCombinationList. + var query = _db.ProductVariantAttributeCombinations + .Where(x => x.ProductId == productId) + .OrderBy(x => x.Id) + .ApplyGridCommand(command, false) + .Select(x => x.Id); - IQueryable GetSiblingQuery(bool applyIdClause) + if (entityIndex > 0) { - var query = _db.ProductVariantAttributeCombinations - .Where(x => x.ProductId == productId); + query = query.Skip(entityIndex); + } - // TODO: (mg) consider grid sorting somehow. Requires different approach. Filtering by ID would not work anymore. - if (applyIdClause) - { - if (next) - { - query = query.Where(x => x.Id > currentId); - } - else - { - query = query.Where(x => x.Id < currentId); - } - } + var siblingId = await query.Take(1).FirstOrDefaultAsync(); + //$"- next:{next} id:{currentId} siblingId:{siblingId} skip:{entityIndex}".Dump(); - if (next) - { - query = query.OrderBy(x => x.Id); - } - else - { - query = query.OrderByDescending(x => x.Id); - } + ViewBag.IsEdit = true; - return query.Select(x => x.Id); + var partial = string.Empty; + var model = await PrepareProductAttributeCombinationModel(siblingId); + if (model != null) + { + partial = await InvokePartialViewAsync("_CreateOrUpdateAttributeCombinationPopup", model); } + + return new JsonResult(new { entityIndex, partial }); } // AJAX. @@ -1030,7 +1036,7 @@ public async Task CombinationExistenceNote(int productId, Product }); } - private async Task PrepareProductAttributeCombinationModelAsync(int id) + private async Task PrepareProductAttributeCombinationModel(int id) { var combination = await _db.ProductVariantAttributeCombinations.FindByIdAsync(id, false); if (combination != null) @@ -1039,8 +1045,7 @@ private async Task PrepareProductAttrib if (product != null) { var model = await MapperFactory.MapAsync(combination); - await PrepareProductAttributeCombinationModelAsync(model, combination, product, true); - + await PrepareProductAttributeCombinationModel(model, combination, product, true); return model; } } @@ -1048,7 +1053,7 @@ private async Task PrepareProductAttrib return null; } - private async Task PrepareProductAttributeCombinationModelAsync( + private async Task PrepareProductAttributeCombinationModel( ProductVariantAttributeCombinationModel model, ProductVariantAttributeCombination entity, Product product, diff --git a/src/Smartstore.Web/Areas/Admin/Models/Catalog/ProductVariantAttributeCombinationModel.cs b/src/Smartstore.Web/Areas/Admin/Models/Catalog/ProductVariantAttributeCombinationModel.cs index 05df1296fa..a68c6c946a 100644 --- a/src/Smartstore.Web/Areas/Admin/Models/Catalog/ProductVariantAttributeCombinationModel.cs +++ b/src/Smartstore.Web/Areas/Admin/Models/Catalog/ProductVariantAttributeCombinationModel.cs @@ -36,7 +36,7 @@ public class ProductVariantAttributeCombinationModel : EntityModelBase [LocalizedDisplay("*Pictures")] public int[] AssignedPictureIds { get; set; } = Array.Empty(); - public List AssignablePictures { get; set; } = new(); + public List AssignablePictures { get; set; } = []; [LocalizedDisplay("Admin.Catalog.Products.Fields.Length")] public decimal? Length { get; set; } @@ -56,7 +56,7 @@ public class ProductVariantAttributeCombinationModel : EntityModelBase [LocalizedDisplay("Common.IsActive")] public bool IsActive { get; set; } - public List ProductVariantAttributes { get; set; } = new(); + public List ProductVariantAttributes { get; set; } = []; [LocalizedDisplay("*Attributes")] public string AttributesXml { get; set; } @@ -64,9 +64,10 @@ public class ProductVariantAttributeCombinationModel : EntityModelBase [LocalizedDisplay("Common.Product")] public string ProductUrl { get; set; } - public List Warnings { get; set; } = new(); + public List Warnings { get; set; } = []; public int ProductId { get; set; } + public int EntityIndex { get; set; } public string PrimaryStoreCurrencyCode { get; set; } public string BaseDimensionIn { get; set; } diff --git a/src/Smartstore.Web/Areas/Admin/Views/Product/AttributeCombinationEditPopup.cshtml b/src/Smartstore.Web/Areas/Admin/Views/Product/AttributeCombinationEditPopup.cshtml index f98da7a5bf..29a09cbbd4 100644 --- a/src/Smartstore.Web/Areas/Admin/Views/Product/AttributeCombinationEditPopup.cshtml +++ b/src/Smartstore.Web/Areas/Admin/Views/Product/AttributeCombinationEditPopup.cshtml @@ -46,18 +46,22 @@ @* Find summernote localization file *@ - + From 001f22e3946881a748fb85ebf8519cb33ca3f85d Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 3 Dec 2024 20:44:10 +0100 Subject: [PATCH 07/31] Relocated some resources --- .../Migrations/SmartDbContextDataSeeder.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Smartstore.Core/Migrations/SmartDbContextDataSeeder.cs b/src/Smartstore.Core/Migrations/SmartDbContextDataSeeder.cs index 62ed750f73..186c032ed7 100644 --- a/src/Smartstore.Core/Migrations/SmartDbContextDataSeeder.cs +++ b/src/Smartstore.Core/Migrations/SmartDbContextDataSeeder.cs @@ -543,6 +543,18 @@ public void MigrateLocaleResources(LocaleResourcesBuilder builder) builder.AddOrUpdate("Admin.DataExchange.Import.DefaultNewsletterSubscriptionProfileName", "My newsletter subscription import {0}", "Mein Import von Newsletter-Abonnements {0}"); builder.AddOrUpdate("Admin.DataExchange.Import.DefaultManufacturerProfileName", "My manufacturer import {0}", "Mein Herstellerimport {0}"); + builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterLink", + "X link", + "X Link"); + + builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterSite", + "X Username", + "Benutzername auf X"); + + builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterSite.Hint", + "X username that gets displayed on X cards when a product, category and manufacturer page is shared on X. Starts with a '@'.", + "Benutzername auf X, der auf Karten von X angezeigt wird, wenn ein Produkt, eine Kategorie oder eine Herstellerseite auf X geteilt wird. Beginnt mit einem '@'."); + AddAIResources(builder); } @@ -715,18 +727,6 @@ private static void AddAIResources(LocaleResourcesBuilder builder) builder.AddOrUpdate("Smartstore.AI.Prompts.ProcessHtmlElementsIndividually", "Process each HTML element individually.", "Betrachte dabei jedes HTML-Element einzeln."); - - builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterLink", - "X link", - "X Link"); - - builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterSite", - "X Username", - "Benutzername auf X"); - - builder.AddOrUpdate("Admin.Configuration.Settings.GeneralCommon.SocialSettings.TwitterSite.Hint", - "X username that gets displayed on X cards when a product, category and manufacturer page is shared on X. Starts with a '@'.", - "Benutzername auf X, der auf Karten von X angezeigt wird, wenn ein Produkt, eine Kategorie oder eine Herstellerseite auf X geteilt wird. Beginnt mit einem '@'."); } } } \ No newline at end of file From 17cdffc1867e55c6cc9a255e41c35f89ebeab98b Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 3 Dec 2024 21:01:14 +0100 Subject: [PATCH 08/31] Added utility method for detecting html tags in a string --- src/Smartstore/Utilities/Html/HtmlUtility.cs | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/Smartstore/Utilities/Html/HtmlUtility.cs b/src/Smartstore/Utilities/Html/HtmlUtility.cs index 3430b8cd83..14642d6546 100644 --- a/src/Smartstore/Utilities/Html/HtmlUtility.cs +++ b/src/Smartstore/Utilities/Html/HtmlUtility.cs @@ -417,5 +417,38 @@ public static string RelativizeFontSizes(string html, int baseFontSizePx = 16) return doc.Body?.InnerHtml ?? string.Empty; } + + /// + /// Very fast and simple check for html tags. + /// + public static bool ContainsHtmlTags(string input) + { + if (string.IsNullOrEmpty(input)) + return false; + + int index = 0; + while ((index = input.IndexOf('<', index)) != -1) + { + // Ensure there is a '>' after the '<' + int closeBracketIndex = input.IndexOf('>', index + 1); + if (closeBracketIndex == -1) + { + // No closing '>' found, invalid tag structure + break; + } + + // Check if a closing tag '' to continue searching + index = closeBracketIndex + 1; + } + + return false; + } } } From 21ae59f38eba4399bd0b7813bb9e991191bfcf65 Mon Sep 17 00:00:00 2001 From: mgesing Date: Tue, 3 Dec 2024 21:10:05 +0100 Subject: [PATCH 09/31] Fixes broken setting override checkbox --- .../TagHelpers/Admin/SettingEditorTagHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs b/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs index 80aa970e8e..a43a1ee22a 100644 --- a/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs +++ b/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs @@ -91,7 +91,7 @@ protected override async Task ProcessCoreAsync(TagHelperContext context, TagHelp settingColDiv.Attributes["class"] = "col multi-store-setting-control"; output.PreContent.AppendHtml(overrideColDiv); - output.WrapContentWith(settingColDiv); + output.WrapContentInsideWith(settingColDiv); } } From b37287d2776f048e55e02da6f258f3a7e066e721 Mon Sep 17 00:00:00 2001 From: mgesing Date: Tue, 3 Dec 2024 21:26:11 +0100 Subject: [PATCH 10/31] Reverted last commit (select boxes are disappearing) --- .../TagHelpers/Admin/SettingEditorTagHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs b/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs index a43a1ee22a..80aa970e8e 100644 --- a/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs +++ b/src/Smartstore.Web.Common/TagHelpers/Admin/SettingEditorTagHelper.cs @@ -91,7 +91,7 @@ protected override async Task ProcessCoreAsync(TagHelperContext context, TagHelp settingColDiv.Attributes["class"] = "col multi-store-setting-control"; output.PreContent.AppendHtml(overrideColDiv); - output.WrapContentInsideWith(settingColDiv); + output.WrapContentWith(settingColDiv); } } From bc763992056c41a7d030101dde6ea73bf56e4b89 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Wed, 4 Dec 2024 01:14:41 +0100 Subject: [PATCH 11/31] Bumped custom summernote --- .../Views/Shared/EditorTemplates/Html.cshtml | 2 +- .../lib/editors/summernote2/globalinit.js | 2 +- .../summernote2/lang/summernote-az-AZ.js | 167 ++++++++ .../summernote2/lang/summernote-bn-BD.js | 159 ++++++++ .../summernote2/lang/summernote-de-CH.js | 156 ++++++++ .../summernote2/lang/summernote-de-DE.js | 34 +- .../summernote2/lang/summernote-es-ES.js | 18 +- .../summernote2/lang/summernote-fr-FR.js | 16 + .../summernote2/lang/summernote-it-IT.js | 16 + .../summernote2/lang/summernote-pt-BR.js | 16 + .../summernote2/lang/summernote-ru-RU.js | 16 + .../summernote2/lang/summernote-tr-TR.js | 16 + .../summernote2/lang/summernote-zh-TW.js | 16 + .../editors/summernote2/plugins/lang/de-DE.js | 34 -- .../editors/summernote2/plugins/lang/es-ES.js | 15 - .../editors/summernote2/plugins/lang/fr-FR.js | 15 - .../editors/summernote2/plugins/lang/it-IT.js | 15 - .../editors/summernote2/plugins/lang/pt-BR.js | 15 - .../editors/summernote2/plugins/lang/ru-RU.js | 15 - .../editors/summernote2/plugins/lang/tr-TR.js | 15 - .../editors/summernote2/plugins/lang/zh-TW.js | 15 - .../plugins/smartstore.cssclass.js | 357 ------------------ .../plugins/smartstore.tableStyles.js | 190 ---------- .../editors/summernote2/scss/summernote.scss | 105 +++--- .../lib/editors/summernote2/summernote-sm.css | 3 - .../editors/summernote2/summernote-sm.css.map | 1 - .../lib/editors/summernote2/summernote-sm.js | 15 +- .../editors/summernote2/summernote-sm.js.map | 2 +- 28 files changed, 694 insertions(+), 752 deletions(-) create mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-az-AZ.js create mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-bn-BD.js create mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-CH.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/de-DE.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/es-ES.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/fr-FR.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/it-IT.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/pt-BR.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/ru-RU.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/tr-TR.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/zh-TW.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.cssclass.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.tableStyles.js delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css delete mode 100644 src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css.map diff --git a/src/Smartstore.Web/Views/Shared/EditorTemplates/Html.cshtml b/src/Smartstore.Web/Views/Shared/EditorTemplates/Html.cshtml index fd5930bd1b..32076634fc 100644 --- a/src/Smartstore.Web/Views/Shared/EditorTemplates/Html.cshtml +++ b/src/Smartstore.Web/Views/Shared/EditorTemplates/Html.cshtml @@ -27,7 +27,7 @@ @* Find summernote localization file *@ - + @* *@ diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/globalinit.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/globalinit.js index e287d50eb4..5ff478ac09 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/globalinit.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/globalinit.js @@ -98,7 +98,7 @@ let summernote_image_upload_url; table: [ ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']], ['delete', ['deleteRow', 'deleteCol', 'deleteTable']], - //['custom', ['tableStyles']] + ['custom', ['tableStyles']] ], air: [ ['color', ['color']], diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-az-AZ.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-az-AZ.js new file mode 100644 index 0000000000..ac9e6d242a --- /dev/null +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-az-AZ.js @@ -0,0 +1,167 @@ +//Summernote WYSIWYG editor ucun Azerbaycan dili fayli +//Tercume etdi: RAMIL ALIYEV +//Tarix: 20.07.2019 +//Baki Azerbaycan +//Website: https://ramilaliyev.com + +//Azerbaijan language for Summernote WYSIWYG +//Translated by: RAMIL ALIYEV +//Date: 20.07.2019 +//Baku Azerbaijan +//Website: https://ramilaliyev.com + +(function($) { + $.extend(true, $.summernote.lang, { + 'az-AZ': { + font: { + bold: 'Qalın', + italic: 'Əyri', + underline: 'Altı xətli', + clear: 'Təmizlə', + height: 'Sətir hündürlüyü', + name: 'Yazı Tipi', + strikethrough: 'Üstü xətli', + subscript: 'Alt simvol', + superscript: 'Üst simvol', + size: 'Yazı ölçüsü', + }, + image: { + image: 'Şəkil', + insert: 'Şəkil əlavə et', + resizeFull: 'Original ölçü', + resizeHalf: '1/2 ölçü', + resizeQuarter: '1/4 ölçü', + floatLeft: 'Sola çək', + floatRight: 'Sağa çək', + floatNone: 'Sola-sağa çəkilməni ləğv et', + shapeRounded: 'Şəkil: yuvarlaq künç', + shapeCircle: 'Şəkil: Dairə', + shapeThumbnail: 'Şəkil: Thumbnail', + shapeNone: 'Şəkil: Yox', + dragImageHere: 'Bura sürüşdür', + dropImage: 'Şəkil və ya mətni buraxın', + selectFromFiles: 'Sənəd seçin', + maximumFileSize: 'Maksimum sənəd ölçüsü', + maximumFileSizeError: 'Maksimum sənəd ölçüsünü keçdiniz.', + url: 'Şəkil linki', + remove: 'Şəkli sil', + original: 'Original', + }, + video: { + video: 'Video', + videoLink: 'Video linki', + insert: 'Video əlavə et', + url: 'Video linki?', + providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion və ya Youku)', + }, + link: { + link: 'Link', + insert: 'Link əlavə et', + unlink: 'Linki sil', + edit: 'Linkə düzəliş et', + textToDisplay: 'Ekranda göstəriləcək link adı', + url: 'Link ünvanı?', + openInNewWindow: 'Yeni pəncərədə aç', + }, + table: { + table: 'Cədvəl', + addRowAbove: 'Yuxarı sətir əlavə et', + addRowBelow: 'Aşağı sətir əlavə et', + addColLeft: 'Sola sütun əlavə et', + addColRight: 'Sağa sütun əlavə et', + delRow: 'Sətiri sil', + delCol: 'Sütunu sil', + delTable: 'Cədvəli sil', + }, + hr: { + insert: 'Üfuqi xətt əlavə et', + }, + style: { + style: 'Stil', + p: 'p', + blockquote: 'İstinad', + pre: 'Ön baxış', + h1: 'Başlıq 1', + h2: 'Başlıq 2', + h3: 'Başlıq 3', + h4: 'Başlıq 4', + h5: 'Başlıq 5', + h6: 'Başlıq 6', + }, + lists: { + unordered: 'Nizamsız sıra', + ordered: 'Nizamlı sıra', + }, + options: { + help: 'Kömək', + fullscreen: 'Tam ekran', + codeview: 'HTML Kodu', + }, + paragraph: { + paragraph: 'Paraqraf', + outdent: 'Girintini artır', + indent: 'Girintini azalt', + left: 'Sola çək', + center: 'Ortaya çək', + right: 'Sağa çək', + justify: 'Sola və sağa çək', + }, + color: { + recent: 'Son rənk', + more: 'Daha çox rənk', + background: 'Arxa fon rəngi', + foreground: 'Yazı rıngi', + transparent: 'Şəffaflıq', + setTransparent: 'Şəffaflığı nizamla', + reset: 'Sıfırla', + resetToDefault: 'Susyama görə sıfırla', + }, + shortcut: { + shortcuts: 'Qısayollar', + close: 'Bağla', + textFormatting: 'Yazı formatlandırmaq', + action: 'Hadisə', + paragraphFormatting: 'Paraqraf formatlandırmaq', + documentStyle: 'Sənəd stili', + extraKeys: 'Əlavə', + }, + help: { + 'insertParagraph': 'Paraqraf əlavə etmək', + 'undo': 'Son əmri geri alır', + 'redo': 'Son əmri irəli alır', + 'tab': 'Girintini artırır', + 'untab': 'Girintini azaltır', + 'bold': 'Qalın yazma stilini nizamlayır', + 'italic': 'İtalik yazma stilini nizamlayır', + 'underline': 'Altı xətli yazma stilini nizamlayır', + 'strikethrough': 'Üstü xətli yazma stilini nizamlayır', + 'removeFormat': 'Formatlandırmanı ləğv edir', + 'justifyLeft': 'Yazını sola çəkir', + 'justifyCenter': 'Yazını ortaya çəkir', + 'justifyRight': 'Yazını sağa çəkir', + 'justifyFull': 'Yazını hər iki tərəfə yazır', + 'insertUnorderedList': 'Nizamsız sıra əlavə edir', + 'insertOrderedList': 'Nizamlı sıra əlavə edir', + 'outdent': 'Aktiv paraqrafın girintisini azaltır', + 'indent': 'Aktiv paragrafın girintisini artırır', + 'formatPara': 'Aktiv bloqun formatını paraqraf (p) olaraq dəyişdirir', + 'formatH1': 'Aktiv bloqun formatını başlıq 1 (h1) olaraq dəyişdirir', + 'formatH2': 'Aktiv bloqun formatını başlıq 2 (h2) olaraq dəyişdirir', + 'formatH3': 'Aktiv bloqun formatını başlıq 3 (h3) olaraq dəyişdirir', + 'formatH4': 'Aktiv bloqun formatını başlıq 4 (h4) olaraq dəyişdirir', + 'formatH5': 'Aktiv bloqun formatını başlıq 5 (h5) olaraq dəyişdirir', + 'formatH6': 'Aktiv bloqun formatını başlıq 6 (h6) olaraq dəyişdirir', + 'insertHorizontalRule': 'Üfuqi xətt əlavə edir', + 'linkDialog.show': 'Link parametrləri qutusunu göstərir', + }, + history: { + undo: 'Əvvəlki vəziyyət', + redo: 'Sonrakı vəziyyət', + }, + specialChar: { + specialChar: 'Xüsusi simvollar', + select: 'Xüsusi simvolları seçin', + }, + }, + }); +})(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-bn-BD.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-bn-BD.js new file mode 100644 index 0000000000..b944f6c38e --- /dev/null +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-bn-BD.js @@ -0,0 +1,159 @@ +(function($) { + $.extend(true, $.summernote.lang, { + 'bn-BD': { + font: { + bold: 'গাঢ়', + italic: 'তির্যক', + underline: 'নিন্মরেখা', + clear: 'ফন্টের শৈলী সরান', + height: 'লাইনের উচ্চতা', + name: 'ফন্ট পরিবার', + strikethrough: 'অবচ্ছেদন', + subscript: 'নিম্নলিপি', + superscript: 'উর্ধ্বলিপি', + size: 'ফন্টের আকার', + sizeunit: 'ফন্টের আকারের একক', + }, + image: { + image: 'ছবি', + insert: 'ছবি যোগ করুন', + resizeFull: 'পূর্ণ আকারে নিন', + resizeHalf: 'অর্ধ আকারে নিন', + resizeQuarter: 'চতুর্থাংশ আকারে নিন', + resizeNone: 'আসল আকার', + floatLeft: 'বামে নিন', + floatRight: 'ডানে নিন', + floatNone: 'দিক সরান', + shapeRounded: 'আকৃতি: গোলাকার', + shapeCircle: 'আকৃতি: বৃত্ত', + shapeThumbnail: 'আকৃতি: থাম্বনেইল', + shapeNone: 'আকৃতি: কিছু নয়', + dragImageHere: 'এখানে ছবি বা লেখা টেনে আনুন', + dropImage: 'ছবি বা লেখা ছাড়ুন', + selectFromFiles: 'ফাইল থেকে নির্বাচন করুন', + maximumFileSize: 'সর্বোচ্চ ফাইলের আকার', + maximumFileSizeError: 'সর্বোচ্চ ফাইলের আকার অতিক্রম করেছে।', + url: 'ছবির URL', + remove: 'ছবি সরান', + original: 'আসল', + }, + video: { + video: 'ভিডিও', + videoLink: 'ভিডিওর লিঙ্ক', + insert: 'ভিডিও সন্নিবেশ করুন', + url: 'ভিডিওর URL', + providers: '(ইউটিউব, গুগল ড্রাইভ, ভিমিও, ভিন, ইনস্টাগ্রাম, ডেইলিমোশন বা ইউকু)', + }, + link: { + link: 'লিঙ্ক', + insert: 'লিঙ্ক সন্নিবেশ করুন', + unlink: 'লিঙ্কমুক্ত করুন', + edit: 'সম্পাদনা করুন', + textToDisplay: 'দেখানোর জন্য লেখা', + url: 'এই লিঙ্কটি কোন URL-এ যাবে?', + openInNewWindow: 'নতুন উইন্ডোতে খুলুন', + }, + table: { + table: 'ছক', + addRowAbove: 'উপরে সারি যোগ করুন', + addRowBelow: 'নিচে সারি যোগ করুন', + addColLeft: 'বামে কলাম যোগ করুন', + addColRight: 'ডানে কলাম যোগ করুন', + delRow: 'সারি মুছুন', + delCol: 'কলাম মুছুন', + delTable: 'ছক মুছুন', + }, + hr: { + insert: 'বিভাজক রেখা সন্নিবেশ করুন', + }, + style: { + style: 'শৈলী', + p: 'সাধারণ', + blockquote: 'উক্তি', + pre: 'কোড', + h1: 'শীর্ষক ১', + h2: 'শীর্ষক ২', + h3: 'শীর্ষক ৩', + h4: 'শীর্ষক ৪', + h5: 'শীর্ষক ৫', + h6: 'শীর্ষক ৬', + }, + lists: { + unordered: 'অবিন্যস্ত তালিকা', + ordered: 'বিন্যস্ত তালিকা', + }, + options: { + help: 'সাহায্য', + fullscreen: 'পূর্ণ পর্দা', + codeview: 'কোড দৃশ্য', + }, + paragraph: { + paragraph: 'অনুচ্ছেদ', + outdent: 'ঋণাত্মক প্রান্তিককরণ', + indent: 'প্রান্তিককরণ', + left: 'বামে সারিবদ্ধ করুন', + center: 'কেন্দ্রে সারিবদ্ধ করুন', + right: 'ডানে সারিবদ্ধ করুন', + justify: 'যথাযথ ফাঁক দিয়ে সাজান', + }, + color: { + recent: 'সাম্প্রতিক রং', + more: 'আরও রং', + background: 'পটভূমির রং', + foreground: 'লেখার রং', + transparent: 'স্বচ্ছ', + setTransparent: 'স্বচ্ছ নির্ধারণ করুন', + reset: 'পুনঃস্থাপন করুন', + resetToDefault: 'পূর্বনির্ধারিত ফিরিয়ে আনুন', + cpSelect: 'নির্বাচন করুন', + }, + shortcut: { + shortcuts: 'কীবোর্ড শর্টকাট', + close: 'বন্ধ করুন', + textFormatting: 'লেখার বিন্যাসন', + action: 'কার্য', + paragraphFormatting: 'অনুচ্ছেদের বিন্যাসন', + documentStyle: 'নথির শৈলী', + extraKeys: 'অতিরিক্ত কীগুলি', + }, + help: { + 'escape': 'এস্কেপ', + 'insertParagraph': 'অনুচ্ছেদ সন্নিবেশ', + 'undo': 'শেষ কমান্ড পূর্বাবস্থায় ফেরত', + 'redo': 'শেষ কমান্ড পুনরায় করা', + 'tab': 'ট্যাব', + 'untab': 'অ-ট্যাব', + 'bold': 'গাঢ় শৈলী নির্ধারণ', + 'italic': 'তির্যক শৈলী নির্ধারণ', + 'underline': 'নিম্নরেখার শৈলী নির্ধারণ', + 'strikethrough': 'অবচ্ছেদনের শৈলী নির্ধারণ', + 'removeFormat': 'শৈলী পরিষ্কার', + 'justifyLeft': 'বামের সারিবন্ধন নির্ধারণ', + 'justifyCenter': 'কেন্দ্রের সারিবন্ধন নির্ধারণ', + 'justifyRight': 'ডানের সারিবন্ধন নির্ধারণ', + 'justifyFull': 'পূর্ণ সারিবন্ধন নির্ধারণ', + 'insertUnorderedList': 'অবিন্যস্ত তালিকা টগল', + 'insertOrderedList': 'বিন্যস্ত তালিকা টগল', + 'outdent': 'বর্তমান অনুচ্ছেদে ঋণাত্মক প্রান্তিককরণ', + 'indent': 'বর্তমান অনুচ্ছেদে প্রান্তিককরণ', + 'formatPara': 'বর্তমান ব্লকের বিন্যাসটি অনুচ্ছেদ হিসেবে পরিবর্তন (P ট্যাগ)', + 'formatH1': 'বর্তমান ব্লকের বিন্যাসটি H1 হিসেবে পরিবর্তন', + 'formatH2': 'বর্তমান ব্লকের বিন্যাসটি H2 হিসেবে পরিবর্তন', + 'formatH3': 'বর্তমান ব্লকের বিন্যাসটি H3 হিসেবে পরিবর্তন', + 'formatH4': 'বর্তমান ব্লকের বিন্যাসটি H4 হিসেবে পরিবর্তন', + 'formatH5': 'বর্তমান ব্লকের বিন্যাসটি H5 হিসেবে পরিবর্তন', + 'formatH6': 'বর্তমান ব্লকের বিন্যাসটি H6 হিসেবে পরিবর্তন', + 'insertHorizontalRule': 'বিভাজক রেখা সন্নিবেশ', + 'linkDialog.show': 'লিংক ডায়ালগ প্রদর্শন', + }, + history: { + undo: 'পূর্বাবস্থায় আনুন', + redo: 'পুনঃকরুন', + }, + specialChar: { + specialChar: 'বিশেষ অক্ষর', + select: 'বিশেষ অক্ষর নির্বাচন করুন', + }, + }, + }); +})(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-CH.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-CH.js new file mode 100644 index 0000000000..40ffac1321 --- /dev/null +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-CH.js @@ -0,0 +1,156 @@ +(function($) { + $.extend(true, $.summernote.lang, { + 'de-CH': { + font: { + bold: 'Fett', + italic: 'Kursiv', + underline: 'Unterstrichen', + clear: 'Zurücksetzen', + height: 'Zeilenhöhe', + name: 'Schriftart', + strikethrough: 'Durchgestrichen', + subscript: 'Tiefgestellt', + superscript: 'Hochgestellt', + size: 'Schriftgrösse', + }, + image: { + image: 'Bild', + insert: 'Bild einfügen', + resizeFull: 'Originalgrösse', + resizeHalf: '1/2 Grösse', + resizeQuarter: '1/4 Grösse', + floatLeft: 'Linksbündig', + floatRight: 'Rechtsbündig', + floatNone: 'Kein Textfluss', + shapeRounded: 'Abgerundete Ecken', + shapeCircle: 'Kreisförmig', + shapeThumbnail: '"Vorschaubild"', + shapeNone: 'Kein Rahmen', + dragImageHere: 'Bild hierher ziehen', + dropImage: 'Bild oder Text nehmen', + selectFromFiles: 'Datei auswählen', + maximumFileSize: 'Maximale Dateigrösse', + maximumFileSizeError: 'Maximale Dateigrösse überschritten', + url: 'Bild URL', + remove: 'Bild entfernen', + original: 'Original', + }, + video: { + video: 'Video', + videoLink: 'Videolink', + insert: 'Video einfügen', + url: 'Video URL', + providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion oder Youku)', + }, + link: { + link: 'Link', + insert: 'Link einfügen', + unlink: 'Link entfernen', + edit: 'Bearbeiten', + textToDisplay: 'Anzeigetext', + url: 'Link URL', + openInNewWindow: 'In neuem Fenster öffnen', + }, + table: { + table: 'Tabelle', + addRowAbove: '+ Zeile oberhalb', + addRowBelow: '+ Zeile unterhalb', + addColLeft: '+ Spalte links', + addColRight: '+ Spalte rechts', + delRow: 'Zeile löschen', + delCol: 'Spalte löschen', + delTable: 'Tabelle löschen', + }, + hr: { + insert: 'Horizontale Linie einfügen', + }, + style: { + style: 'Stil', + normal: 'Normal', + p: 'Normal', + blockquote: 'Zitat', + pre: 'Quellcode', + h1: 'Überschrift 1', + h2: 'Überschrift 2', + h3: 'Überschrift 3', + h4: 'Überschrift 4', + h5: 'Überschrift 5', + h6: 'Überschrift 6', + }, + lists: { + unordered: 'Aufzählung', + ordered: 'Nummerierung', + }, + options: { + help: 'Hilfe', + fullscreen: 'Vollbild', + codeview: 'Quellcode anzeigen', + }, + paragraph: { + paragraph: 'Absatz', + outdent: 'Einzug verkleinern', + indent: 'Einzug vergrössern', + left: 'Links ausrichten', + center: 'Zentriert ausrichten', + right: 'Rechts ausrichten', + justify: 'Blocksatz', + }, + color: { + recent: 'Letzte Farbe', + more: 'Weitere Farben', + background: 'Hintergrundfarbe', + foreground: 'Schriftfarbe', + transparent: 'Transparenz', + setTransparent: 'Transparenz setzen', + reset: 'Zurücksetzen', + resetToDefault: 'Auf Standard zurücksetzen', + }, + shortcut: { + shortcuts: 'Tastenkürzel', + close: 'Schliessen', + textFormatting: 'Textformatierung', + action: 'Aktion', + paragraphFormatting: 'Absatzformatierung', + documentStyle: 'Dokumentenstil', + extraKeys: 'Weitere Tasten', + }, + help: { + insertParagraph: 'Absatz einfügen', + undo: 'Letzte Anweisung rückgängig', + redo: 'Letzte Anweisung wiederholen', + tab: 'Einzug hinzufügen', + untab: 'Einzug entfernen', + bold: 'Schrift Fett', + italic: 'Schrift Kursiv', + underline: 'Unterstreichen', + strikethrough: 'Durchstreichen', + removeFormat: 'Entfernt Format', + justifyLeft: 'Linksbündig', + justifyCenter: 'Mittig', + justifyRight: 'Rechtsbündig', + justifyFull: 'Blocksatz', + insertUnorderedList: 'Unnummerierte Liste', + insertOrderedList: 'Nummerierte Liste', + outdent: 'Aktuellen Absatz ausrücken', + indent: 'Aktuellen Absatz einrücken', + formatPara: 'Formatiert aktuellen Block als Absatz (P-Tag)', + formatH1: 'Formatiert aktuellen Block als H1', + formatH2: 'Formatiert aktuellen Block als H2', + formatH3: 'Formatiert aktuellen Block als H3', + formatH4: 'Formatiert aktuellen Block als H4', + formatH5: 'Formatiert aktuellen Block als H5', + formatH6: 'Formatiert aktuellen Block als H6', + insertHorizontalRule: 'Fügt eine horizontale Linie ein', + 'linkDialog.show': 'Zeigt den Linkdialog', + }, + history: { + undo: 'Rückgängig', + redo: 'Wiederholen', + }, + specialChar: { + specialChar: 'Sonderzeichen', + select: 'Zeichen auswählen', + }, + }, + }); +})(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-DE.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-DE.js index 1313f0b0f7..a641a1cd66 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-DE.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-de-DE.js @@ -1,4 +1,4 @@ -(function($) { +(function ($) { $.extend(true, $.summernote.lang, { 'de-DE': { font: { @@ -153,4 +153,36 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'de-DE': { /* German */ + common: { + ok: 'OK', + cancel: 'Abbrechen' + }, + font: { + code: 'Code' + }, + attrs: { + cssClass: 'CSS Klasse', + cssStyle: 'CSS Stil', + rel: 'Rel', + }, + link: { + browse: 'Durchsuchen' + }, + image: { + imageProps: 'Bild Eigenschaften' + }, + tableStyles: { + tooltip: "Tabellenstil", + stylesExclusive: ["Standard", "Eingerahmt"], + stylesInclusive: ["Streifen", "Kompakt", "Hover Effekt"] + }, + imageShapes: { + tooltip: 'Stil', + tooltipShapeOptions: ['Responsiv', 'Rahmen', 'Abgerundet', 'Kreis', 'Thumbnail', 'Schatten (klein)', 'Schatten (mittel)', 'Schatten (groß)'] + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-es-ES.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-es-ES.js index 4cb4b3378a..b9c543a944 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-es-ES.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-es-ES.js @@ -1,4 +1,4 @@ -(function($) { +(function ($) { $.extend(true, $.summernote.lang, { 'es-ES': { font: { @@ -158,4 +158,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'en-ES': { /* Spanish */ + attrs: { + cssClass: 'CSS Clases', + cssStyle: 'CSS Estilo', + rel: 'Rel', + }, + link: { + browse: 'Buscar' + }, + image: { + imageProps: 'Propiedades de la Imagen' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-fr-FR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-fr-FR.js index dafeca088c..dab2293ea6 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-fr-FR.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-fr-FR.js @@ -152,4 +152,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'fr-FR': { /* French */ + attrs: { + cssClass: 'CSS Class', + cssStyle: 'CSS Style', + rel: 'Rel', + }, + link: { + browse: 'Parcourir' + }, + image: { + imageProps: 'Attributs de l\'image' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-it-IT.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-it-IT.js index f3012ed204..4543eb96b1 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-it-IT.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-it-IT.js @@ -152,4 +152,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'it-IT': { /* Italian */ + attrs: { + cssClass: 'CSS Classe', + cssStyle: 'CSS Stile', + rel: 'Rel', + }, + link: { + browse: 'Sfoglia' + }, + image: { + imageProps: 'Attributi Immagine' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-pt-BR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-pt-BR.js index b1bbe2b2eb..bada89c095 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-pt-BR.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-pt-BR.js @@ -154,4 +154,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'pt-BR': { /* Portuguese */ + attrs: { + cssClass: 'CSS Classes', + cssStyle: 'CSS Estilo', + rel: 'Rel', + }, + link: { + browse: 'Procurar' + }, + image: { + imageProps: 'Atributos da Imagem' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-ru-RU.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-ru-RU.js index cf1155bc7f..7929eadfce 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-ru-RU.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-ru-RU.js @@ -152,4 +152,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'ru-RU': { /* Russian */ + attrs: { + cssClass: 'CSS класс', + cssStyle: 'CSS Стиль', + rel: 'Тип (rel)', + }, + link: { + browse: 'просматривать' + }, + image: { + imageProps: 'Свойства изображения' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-tr-TR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-tr-TR.js index a468f924b5..be70d997aa 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-tr-TR.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-tr-TR.js @@ -153,4 +153,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'tr-TR': { /* Turkish */ + attrs: { + cssClass: 'Sınıf (CSS)', + cssStyle: 'Stil (CSS)', + rel: 'Rel', + }, + link: { + browse: 'Seç' + }, + image: { + imageProps: 'Resim Özellikleri' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-zh-TW.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-zh-TW.js index fcb1661bd8..8031049d9a 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-zh-TW.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/lang/summernote-zh-TW.js @@ -152,4 +152,20 @@ }, }, }); + + $.extend(true, $.summernote.lang, { + 'zh-TW': { /* Chinese Traditional */ + attrs: { + cssClass: '类', + cssStyle: '样式', + rel: '相對', + }, + link: { + browse: '瀏覽' + }, + image: { + imageProps: '圖片提示' + } + } + }); })(jQuery); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/de-DE.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/de-DE.js deleted file mode 100644 index 61ba7e8e62..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/de-DE.js +++ /dev/null @@ -1,34 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'de-DE': { /* German */ - common: { - ok: 'OK', - cancel: 'Abbrechen' - }, - font: { - code: 'Code' - }, - attrs: { - cssClass: 'CSS Klasse', - cssStyle: 'CSS Stil', - rel: 'Rel', - }, - link: { - browse: 'Durchsuchen' - }, - image: { - imageProps: 'Bild Eigenschaften' - }, - tableStyles: { - tooltip: "Tabellenstil", - stylesExclusive: ["Standard", "Eingerahmt"], - stylesInclusive: ["Streifen", "Kompakt", "Hover Effekt"] - }, - imageShapes: { - tooltip: 'Stil', - tooltipShapeOptions: ['Responsiv', 'Rahmen', 'Abgerundet', 'Kreis', 'Thumbnail', 'Schatten (klein)', 'Schatten (mittel)', 'Schatten (groß)'] - }, - ai: { - tooltip: "Mit KI bearbeiten" - } - } -}); \ No newline at end of file diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/es-ES.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/es-ES.js deleted file mode 100644 index b7c92d866d..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/es-ES.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'en-ES': { /* Spanish */ - attrs: { - cssClass: 'CSS Clases', - cssStyle: 'CSS Estilo', - rel: 'Rel', - }, - link: { - browse: 'Buscar' - }, - image: { - imageProps: 'Propiedades de la Imagen' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/fr-FR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/fr-FR.js deleted file mode 100644 index 215bf0b0d9..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/fr-FR.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'fr-FR': { /* French */ - attrs: { - cssClass: 'CSS Class', - cssStyle: 'CSS Style', - rel: 'Rel', - }, - link: { - browse: 'Parcourir' - }, - image: { - imageProps: 'Attributs de l\'image' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/it-IT.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/it-IT.js deleted file mode 100644 index 06cd50db55..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/it-IT.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'it-IT': { /* Italian */ - attrs: { - cssClass: 'CSS Classe', - cssStyle: 'CSS Stile', - rel: 'Rel', - }, - link: { - browse: 'Sfoglia' - }, - image: { - imageProps: 'Attributi Immagine' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/pt-BR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/pt-BR.js deleted file mode 100644 index 9b71197ad1..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/pt-BR.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'pt-BR': { /* Portuguese */ - attrs: { - cssClass: 'CSS Classes', - cssStyle: 'CSS Estilo', - rel: 'Rel', - }, - link: { - browse: 'Procurar' - }, - image: { - imageProps: 'Atributos da Imagem' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/ru-RU.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/ru-RU.js deleted file mode 100644 index dad857420d..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/ru-RU.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'ru-RU': { /* Russian */ - attrs: { - cssClass: 'CSS класс', - cssStyle: 'CSS Стиль', - rel: 'Тип (rel)', - }, - link: { - browse: 'просматривать' - }, - image: { - imageProps: 'Свойства изображения' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/tr-TR.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/tr-TR.js deleted file mode 100644 index 57ea435a8e..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/tr-TR.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'tr-TR': { /* Turkish */ - attrs: { - cssClass: 'Sınıf (CSS)', - cssStyle: 'Stil (CSS)', - rel: 'Rel', - }, - link: { - browse: 'Seç' - }, - image: { - imageProps: 'Resim Özellikleri' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/zh-TW.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/zh-TW.js deleted file mode 100644 index 3255449c0e..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/lang/zh-TW.js +++ /dev/null @@ -1,15 +0,0 @@ -$.extend(true, $.summernote.lang, { - 'zh-TW': { /* Chinese Traditional */ - attrs: { - cssClass: '类', - cssStyle: '样式', - rel: '相對', - }, - link: { - browse: '瀏覽' - }, - image: { - imageProps: '圖片提示' - } - } -}); diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.cssclass.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.cssclass.js deleted file mode 100644 index ae8c6bbd61..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.cssclass.js +++ /dev/null @@ -1,357 +0,0 @@ -/** - * - * copyright 2016 creativeprogramming.it di Stefano Gargiulo - * email: info@creativeprogramming.it - * accepting tips at https://www.paypal.me/creativedotit - * license: MIT - * - */ -(function (factory) { - /* global define */ - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof module === 'object' && module.exports) { - // Node/CommonJS - module.exports = factory(require('jquery')); - } else { - // Browser globals - factory(window.jQuery); - } -}(function ($) { - var inlineTags = 'b big i small tt abbr acronym caption cite code col dfn em kbd strong samp var a bdo br img map object q script span sub sup button input label select textarea'.split(' '); - - function isInlineElement(el) { - return _.contains(inlineTags, el.tagName.toLowerCase()); - } - - // Extends plugins for adding hello. - // - plugin is external module for customizing. - $.extend($.summernote.plugins, { - 'cssclass': function (context) { - var self = this, - ui = $.summernote.ui, - $body = $(document.body), - $editor = context.layoutInfo.editor, - options = context.options, - lang = options.langInfo, - buttons = context.modules.buttons, - editor = context.modules.editor; - - if (typeof options.cssclass === 'undefined') { - options.cssclass = {}; - } - - if (typeof options.cssclass.classes === 'undefined') { - var rgAlert = /^alert(-.+)?$/; - var rgBtn = /^btn(-.+)?$/; - var rgBg = /^bg-.+$/; - var rgTextColor = /^text-(muted|primary|success|danger|warning|info|dark|white)$/; - var rgTextAlign = /^text-(start|center|end)$/; - var rgDisplay = /^display-[1-4]$/; - var rgWidth = /^w-(25|50|75|100)$/; - var rgRounded = /^rounded(-.+)?$/; - - options.cssclass.classes = { - "alert alert-primary": { toggle: rgAlert }, - "alert alert-secondary": { toggle: rgAlert }, - "alert alert-success": { toggle: rgAlert }, - "alert alert-danger": { toggle: rgAlert }, - "alert alert-warning": { toggle: rgAlert }, - "alert alert-info": { toggle: rgAlert }, - "alert alert-light": { toggle: rgAlert }, - "alert alert-dark": { toggle: rgAlert }, - "bg-primary": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-secondary": { displayClass: "px-2 py-1", inline: true, toggle: rgBg }, - "bg-success": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-danger": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-warning": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-info": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-light": { displayClass: "px-2 py-1", inline: true, toggle: rgBg }, - "bg-dark": { displayClass: "px-2 py-1 text-white", inline: true, toggle: rgBg }, - "bg-white": { displayClass: "px-2 py-1 border", inline: true, toggle: rgBg }, - "rtl": { displayClass: "text-uppercase", inline: true, toggle: /^ltr$/ }, - "ltr": { displayClass: "text-uppercase", inline: true, toggle: /^rtl$/ }, - "text-muted": { inline: true, toggle: rgTextColor }, - "text-primary": {inline: true, toggle: rgTextColor }, - "text-success": {inline: true, toggle: rgTextColor }, - "text-danger": { inline: true, toggle: rgTextColor }, - "text-warning": { inline: true, toggle: rgTextColor }, - "text-info": { inline: true, toggle: rgTextColor }, - "text-dark": { inline: true, toggle: rgTextColor }, - "text-white": { displayClass: "bg-gray", inline: true, toggle: rgTextColor }, - "font-weight-medium": { inline: true }, - "w-25": { displayClass: "px-2 py-1 bg-light border", toggle: rgWidth }, - "w-50": { displayClass: "px-2 py-1 bg-light border", toggle: rgWidth }, - "w-75": { displayClass: "px-2 py-1 bg-light border", toggle: rgWidth }, - "w-100": { displayClass: "px-2 py-1 bg-light border", toggle: rgWidth }, - "btn btn-primary": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-secondary": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-success": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-danger": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-warning": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-info": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-light": { inline: true, toggle: rgBtn, predicate: "a" }, - "btn btn-dark": { inline: true, toggle: rgBtn, predicate: "a" }, - "rounded-0": { displayClass: "px-2 py-1 bg-light border", toggle: rgRounded }, - "rounded-1": { displayClass: "px-2 py-1 bg-light border rounded-1", toggle: rgRounded }, - "rounded-2": { displayClass: "px-2 py-1 bg-light border rounded-2", toggle: rgRounded }, - "rounded-3": { displayClass: "px-2 py-1 bg-light border rounded-3", toggle: rgRounded }, - "rounded-4": { displayClass: "px-2 py-2 bg-light border rounded-4", toggle: rgRounded }, - "rounded-5": { displayClass: "px-2 py-2 bg-light border rounded-5", toggle: rgRounded }, - "rounded-pill": { displayClass: "px-2 py-1 bg-light border rounded-pill", toggle: rgRounded }, - "list-unstyled": { }, - "display-1": { displayClass: "fs-h1", toggle: rgDisplay }, - "display-2": { displayClass: "fs-h2", toggle: rgDisplay }, - "display-3": { displayClass: "fs-h3", toggle: rgDisplay }, - "display-4": { displayClass: "fs-h4", toggle: rgDisplay }, - "lead": { } - }; - } - - if (typeof options.cssclass.imageShapes === 'undefined') { - options.cssclass.imageShapes = { - "img-fluid": { inline: true }, - "border": { inline: true }, - "rounded": { toggle: /^(rounded(-.+)?)|img-thumbnail$/, inline: true }, - "rounded-circle": { toggle: /^(rounded(-.+)?)|img-thumbnail$/, inline: true }, - "img-thumbnail": { toggle: /^rounded(-.+)?$/, inline: true }, - "shadow-sm": { toggle: /^(shadow(-.+)?)$/, inline: true }, - "shadow": { toggle: /^(shadow(-.+)?)$/, inline: true }, - "shadow-lg": { toggle: /^(shadow(-.+)?)$/, inline: true } - }; - } - - context.memo('button.cssclass', function () { - return ui.buttonGroup({ - className: 'btn-group-cssclass', - children: [ - ui.button({ - className: 'dropdown-toggle', - contents: ui.icon("fab fa-css3"), - callback: function (btn) { - btn.data("placement", "bottom") - .data("trigger", 'hover') - .attr("title", lang.attrs.cssClass) - .tooltip(); - }, - data: { - toggle: 'dropdown' - } - }), - ui.dropdown({ - className: 'dropdown-cssclass scrollable-menu', - items: _.keys(options.cssclass.classes), - template: function (item) { - var obj = options.cssclass.classes[item] || {}; - - var cssClass = item; - if (obj.displayClass) { - cssClass += " " + obj.displayClass; - } - if (!obj.inline) { - cssClass += " d-block"; - } - - var cssStyle = obj.style ? ' style="{0}"'.format(obj.style) : ''; - return '{3}'.format(cssClass, item, cssStyle, item); - }, - click: function (e, namespace, value) { - e.preventDefault(); - - var ddi = $(e.target).closest('[data-value]'); - value = value || ddi.data('value'); - var obj = options.cssclass.classes[value] || {}; - - self.applyClassToSelection(value, obj); - } - }) - ] - }).render(); - }); - - // Image shape stuff - context.memo('button.imageShapes', function () { - var imageShapes = _.keys(options.cssclass.imageShapes); - var button = ui.buttonGroup({ - className: 'btn-group-imageshape', - children: [ - ui.button({ - className: 'dropdown-toggle', - contents: ui.icon("fab fa-css3"), - callback: function (btn) { - btn.data("placement", "bottom"); - btn.data("trigger", "hover"); - btn.attr("title", lang.imageShapes.tooltip); - btn.tooltip(); - - btn.on('click', function () { - self.refreshDropdown($(this).next(), $(context.layoutInfo.editable.data('target')), true); - }); - }, - data: { - toggle: 'dropdown' - } - }), - ui.dropdownCheck({ - className: 'dropdown-shape', - checkClassName: options.icons.menuCheck, - items: imageShapes, - template: function (item) { - var index = $.inArray(item, imageShapes); - return lang.imageShapes.tooltipShapeOptions[index]; - }, - click: function (e) { - e.preventDefault(); - - var ddi = $(e.target).closest('[data-value]'); - var value = ddi.data('value'); - var obj = options.cssclass.imageShapes[value] || {}; - - self.applyClassToSelection(value, obj); - } - }) - ] - }); - - return button.render(); - }); - - this.applyClassToSelection = function (value, obj) { - var controlNode = $(context.invoke("restoreTarget")); - var sel = window.getSelection(); - var node = $(sel.focusNode.parentElement, ".note-editable"); - var currentNodeIsInline = isInlineElement(node[0]); - var caret = sel.type === 'None' || sel.type === 'Caret'; - - function apply(el) { - if (el.is('.' + value.replace(' ', '.'))) { - // "btn btn-info" > ".btn.btn-info" - // Just remove the same style - el.removeClass(value); - if (!el.attr('class')) { - el.removeAttr('class'); - } - - if (isInlineElement(el[0]) && !el[0].attributes.length) { - // Unwrap the node when it is inline and no attribute are present - el.replaceWith(el.html()); - } - } - else { - if (obj.toggle) { - // Remove equivalent classes first - var classNames = (el.attr('class') || '').split(' '); - _.each(classNames, function (name) { - if (name && name !== value && obj.toggle.test(name)) { - el.removeClass(name); - } - }); - } - - el.toggleClass(value); - } - } - - context.invoke("beforeCommand"); - - if (controlNode.length) { - // Most likely IMG is selected - if (obj.inline) { - apply(controlNode); - } - } - else { - if (!obj.inline) { - // Apply a block-style only to a block-level element - if (currentNodeIsInline) { - // Traverse parents until a block-level element is found - while (node.length && isInlineElement(node[0])) { - node = node.parent(); - } - } - - if (node.length && !node.is('.note-editable')) { - apply(node); - } - } - else if (obj.inline && caret) { - apply(node); - } - else if (sel.rangeCount) { - var range = sel.getRangeAt(0).cloneRange(); - var span = $(''); - range.surroundContents(span[0]); - sel.removeAllRanges(); - sel.addRange(range); - } - } - - context.invoke("afterCommand"); - }; - - this.refreshDropdown = function (drop, node /* selectedNode */, noBubble) { - node = node || $(window.getSelection().focusNode, ".note-editable"); - - drop.find('> .dropdown-item').each(function () { - var ddi = $(this), - curNode = node, - value = ddi.data('value'), - //obj = options.cssclass.classes[value] || {}, - expr = '.' + value.replace(' ', '.'), - match = false; - - while (curNode.length) { - if (curNode.is(expr)) { - match = true; - break; - } - - if (noBubble) { - break; - } - - if (curNode.is('.note-editable')) { - break; - } - - curNode = curNode.parent(); - } - - ddi.toggleClass('checked', match); - }); - }; - - // This events will be attached when editor is initialized. - this.events = { - // This will be called after modules are initialized. - 'summernote.init': function (we, e) { - //console.log('summernote initialized', we, e); - }, - // This will be called when user releases a key on editable. - 'summernote.keyup': function (we, e) { - // console.log('summernote keyup', we, e); - } - }; - - this.initialize = function () { - $('.note-toolbar', $editor).on('click', '.btn-group-cssclass .dropdown-item', function (e) { - // Prevent dropdown close - e.preventDefault(); - e.stopPropagation(); - - self.refreshDropdown($(this).parent()); - }); - - $('.note-toolbar', $editor).on('mousedown', '.btn-group-cssclass > .btn', function (e) { - self.refreshDropdown($(this).next()); - }); - }; - - this.destroy = function () { - /* this.$panel.remove(); - this.$panel = null; */ - }; - } - }); -})); \ No newline at end of file diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.tableStyles.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.tableStyles.js deleted file mode 100644 index bddaa54ceb..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/plugins/smartstore.tableStyles.js +++ /dev/null @@ -1,190 +0,0 @@ -/* https://github.com/tylerecouture/summernote-lists */ - -(function (factory) { - /* global define */ - if (typeof define === "function" && define.amd) { - // AMD. Register as an anonymous module. - define(["jquery"], factory); - } else if (typeof module === "object" && module.exports) { - // Node/CommonJS - module.exports = factory(require("jquery")); - } else { - // Browser globals - factory(window.jQuery); - } -})(function ($) { - $.extend(true, $.summernote.lang, { - "en-US": { - tableStyles: { - tooltip: "Table style", - stylesExclusive: ["Basic", "Bordered"], - stylesInclusive: ["Striped", "Condensed", "Hoverable"] - } - } - }); - $.extend($.summernote.options, { - tableStyles: { - // Must keep the same order as in lang.tableStyles.styles* - stylesExclusive: ["", "table-bordered"], - stylesInclusive: ["table-striped", "table-sm", "table-hover"] - } - }); - - // Extends plugins for emoji plugin. - $.extend($.summernote.plugins, { - tableStyles: function (context) { - var self = this, - ui = $.summernote.ui, - options = context.options, - lang = options.langInfo, - $editor = context.layoutInfo.editor, - $editable = context.layoutInfo.editable, - editable = $editable[0]; - - // Fix blur event - let module = context.modules.tablePopover; - module.events['summernote.disable summernote.blur'] = function (we, e) { - const evt = e.originalEvent; - if (evt.type === 'blur' && !$(evt.relatedTarget).closest('.note-custom').length) { - module.hide(); - } - }; - - context.memo("button.tableStyles", function () { - var button = ui.buttonGroup([ - ui.button({ - className: "dropdown-toggle", - contents: ui.dropdownButtonContents(ui.icon(options.icons.magic), options), - callback: function (btn) { - btn.data("placement", "bottom"); - btn.data("trigger", "hover"); - btn.attr("title", lang.tableStyles.tooltip); - btn.attr("tabindex", "-1"); - btn.tooltip(); - - btn.on('click', function (e) { - self.updateTableMenuState(btn); - }); - }, - data: { - toggle: "dropdown" - } - }), - ui.dropdownCheck({ - className: "dropdown-table-style", - checkClassName: options.icons.menuCheck, - items: self.generateListItems( - options.tableStyles.stylesExclusive, - lang.tableStyles.stylesExclusive, - options.tableStyles.stylesInclusive, - lang.tableStyles.stylesInclusive - ), - callback: function ($dropdown) { - $dropdown.find("a").each(function () { - $(this).click(function () { - self.updateTableStyles(this); - }); - }); - } - }) - ]); - return button.render(); - }); - - self.updateTableStyles = function (chosenItem) { - var rng = context.invoke("createRange", $editable); - var dom = $.summernote.dom; - if (rng.isCollapsed() && rng.isOnCell()) { - context.invoke("beforeCommand"); - var table = dom.ancestor(rng.commonAncestor(), dom.isTable); - self.updateStyles($(table), chosenItem, options.tableStyles.stylesExclusive); - } - }; - - /* Makes sure the check marks are on the currently applied styles */ - self.updateTableMenuState = function ($dropdownButton) { - var rng = context.invoke("createRange", $editable); - var dom = $.summernote.dom; - if (rng.isCollapsed() && rng.isOnCell()) { - var $table = $(dom.ancestor(rng.commonAncestor(), dom.isTable)); - var $listItems = $dropdownButton.next().find("a"); - self.updateMenuState($table, $listItems, options.tableStyles.stylesExclusive); - } - }; - - /* The following functions might be turnkey in other menu lists - with exclusive and inclusive items that toggle CSS classes. */ - - self.updateMenuState = function ($node, $listItems, exclusiveStyles) { - var hasAnExclusiveStyle = false; - $listItems.each(function () { - var cssClass = $(this).data("value"); - if ($node.hasClass(cssClass)) { - $(this).addClass("checked"); - if ($.inArray(cssClass, exclusiveStyles) !== -1) { - hasAnExclusiveStyle = true; - } - } else { - $(this).removeClass("checked"); - } - }); - - // if none of the exclusive styles are checked, then check a blank - if (!hasAnExclusiveStyle) { - $listItems.filter('[data-value=""]').addClass("checked"); - } - }; - - self.updateStyles = function ($node, chosenItem, exclusiveStyles) { - var cssClass = $(chosenItem).data("value"); - context.invoke("beforeCommand"); - // Exclusive class: only one can be applied at a time - if ($.inArray(cssClass, exclusiveStyles) !== -1) { - $node.removeClass(exclusiveStyles.join(" ")); - $node.addClass(cssClass); - } else { - // Inclusive classes: multiple are ok - $node.toggleClass(cssClass); - } - context.invoke("afterCommand"); - }; - - self.generateListItems = function ( - exclusiveStyles, - exclusiveLabels, - inclusiveStyles, - inclusiveLabels - ) { - var index = 0; - var list = ""; - - _.each(exclusiveStyles, function (style, i) { - list += self.getListItem(style, exclusiveLabels[i], true); - }); - - list += ''; - - _.each(inclusiveStyles, function (style, i) { - list += self.getListItem(style, inclusiveLabels[i], false); - }); - - return list; - }; - - self.getListItem = function (value, label, isExclusive) { - var item = - '' + - ' ' + - " " + - label + - ""; - return item; - }; - } - }); -}); \ No newline at end of file diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/scss/summernote.scss b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/scss/summernote.scss index 652b853c82..7b8a96f158 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/scss/summernote.scss +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/scss/summernote.scss @@ -274,7 +274,6 @@ $img-margin-right: 10px; flex-direction: column; row-gap: 8px; margin: 0; - //width: 160px; } .note-palette-title { @@ -557,6 +556,8 @@ $img-margin-right: 10px; .note-toolbar { $btn-height: calc((#{$btn-line-height-sm} * 1em) + (#{$btn-padding-y-sm} * 2) + (#{$btn-border-width} * 2)); $btn-height: 32.56px; + + --note-btn-active-border-color: rgba(var(--primary-rgb), 0.3); --note-toolbar-gap: 5px; --note-toolbar-rowheight: calc(#{$btn-height} + (var(--note-toolbar-gap) * 2)); @@ -576,6 +577,10 @@ $img-margin-right: 10px; background-image: linear-gradient(rgba(0,0,0, 0.1) 1px, transparent 1px); background-size: 100% var(--note-toolbar-rowheight); background-position: 0 -1px; + + > .note-toolgroup:last-of-type { + margin-inline-start: auto; + } } &:not(.dropdown-menu) { @@ -585,16 +590,41 @@ $img-margin-right: 10px; &.dropdown-menu.show { display: flex; } + + .scrollable-menu { + --scrollbar-track-color: #fff; + --scrollbar-track-hover-color: #fff; + height: auto; + max-height: 340px; + min-width: 280px; + overflow-x: hidden; + } +} + +.note-toolgroup { + display: inline-flex; + position: relative; + column-gap: 2px; + border: 0 solid rgba($black, 0.12); + border-inline-end-width: 1px; + padding-inline-end: 5px; + + &:last-of-type { + border-inline-end-width: 0; + padding-inline-end: 0; + } } .note-btn { - --btn-padding-x: 6px; + @include button-flat(); min-width: 32px; - //&:not(.dropdown-toggle) { - // Emulate .btn-icon - //width: var(--btn-height); - //} + // Change color hover/active/pressed styling + --btn-padding-x: 6px; + --btn-active-bg: rgba(var(--primary-bg-subtle-rgb), 0.75); + --btn-active-color: var(--primary-text-emphasis); + --btn-active-border-color: transparent; + --btn-active-shadow: none; >i, >svg { @@ -605,57 +635,28 @@ $img-margin-right: 10px; >svg { height: 16px; } -} -.note-toolbar { - > .note-btn-group { - column-gap: 2px; - border: 0 solid rgba($black, 0.12); - border-inline-end-width: 1px; - padding-inline-end: 5px; - - &:last-of-type { - border-inline-end-width: 0; - padding-inline-end: 0; - } - - >.note-btn, - >.note-btn-group>.note-btn { - @include button-flat(); - // INFO: Must have high specificty, .btn-group will kill radius otherwise. - border-radius: var(--btn-border-radius) !important; - margin-inline-start: 0; - - &:not(:hover) { - transition: none !important; - } - - // Change color hover/active/pressed styling - --btn-active-bg: rgba(var(--primary-bg-subtle-rgb), 0.75); - --btn-active-color: var(--primary-text-emphasis); - --btn-active-border-color: transparent; - --btn-active-shadow: none; - } - - .note-btn:active, - .note-btn-group.show>.note-btn { - --btn-active-bg: var(--primary-bg-subtle) !important; - --btn-active-border-color: rgba(var(--primary-rgb), 0.3) !important; - } - } + // &:not(:hover) { + // //transition: none !important; + // } - .scrollable-menu { - --scrollbar-track-color: #fff; - --scrollbar-track-hover-color: #fff; - height: auto; - max-height: 340px; - min-width: 280px; - overflow-x: hidden; + &:active, + .note-btn-group.show > & { + --btn-active-bg: var(--primary-bg-subtle) !important; + --btn-active-border-color: var(--note-btn-active-border-color) !important; } } -.note-toolbar-main > .note-btn-group:last-of-type { - margin-inline-start: auto; +.btn-group-split { + // Split dropdown buttons, e.g. "Color" + outline: 1px solid transparent; + outline-offset: -1px; + border-radius: $btn-border-radius-sm; + + &:hover, + &.show { + outline-color: var(--note-btn-active-border-color); + } } diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css deleted file mode 100644 index dbad373af5..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css +++ /dev/null @@ -1,3 +0,0 @@ -.note-editor-preview{border:1px solid #dee2e6;min-height:100px;max-height:350px;overflow-x:hidden;overflow-y:auto;padding:.5rem .75rem;border-radius:.375rem;cursor:default}.note-editor-preview.empty{min-height:initial}.note-dropzone{position:absolute;display:none;z-index:100;color:#87cefa;background-color:#fff;opacity:.95;border-radius:.375rem}.note-dropzone .note-dropzone-message{display:table-cell;vertical-align:middle;text-align:center;font-size:28px;font-weight:600}.note-dropzone.hover{color:var(--primary)}.note-editor.dragover .note-dropzone{display:table}.note-editor{position:relative;border:1px solid #dee2e6;border-start-start-radius:.375rem;border-start-end-radius:.375rem;border-end-end-radius:.375rem;border-end-start-radius:.375rem}.note-editor:focus-within,.note-editor:focus,.note-editor.focus{z-index:1019;border-color:#689de8}.note-editor .note-placeholder{padding:10px}.note-editor.note-airframe{border-width:0}.note-editing-area{position:relative;overflow:hidden}.note-editable{outline:none;padding:10px;overflow:auto;word-wrap:break-word;font-weight:400;font-style:normal;text-decoration:none}.note-editable a{text-decoration:underline}.note-airframe .note-editable{padding:0}.note-editable[contenteditable=false]{background-color:#8080801d}.note-editable sup{vertical-align:super}.note-editable sub{vertical-align:sub}.note-editable img.note-float-left{margin-right:10px}.note-editable img.note-float-right{margin-left:10px}.note-editable ul li,.note-editable ol li{list-style-position:inside}.note-editable table:not(.table-bordered):not([border]),.note-editable table:not(.table-bordered)[border="0"]{border-collapse:collapse}.note-editable table:not(.table-bordered):not([border]) td,.note-editable table:not(.table-bordered):not([border]) th,.note-editable table:not(.table-bordered)[border="0"] td,.note-editable table:not(.table-bordered)[border="0"] th{border:1px dashed #bbb}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-codable{display:none;width:100%;padding:10px;border:none;box-shadow:none;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;resize:none;outline:none;box-sizing:border-box;border-radius:0;margin-bottom:0}.note-editor.fullscreen{position:fixed;top:0;left:0;width:100%!important;border-radius:0!important;border-color:#dee2e6!important;z-index:1070!important}.note-editor.fullscreen .note-resizebar{display:none}.note-fullscreen-body{overflow:hidden!important}.note-status-output{display:block;width:100%;font-size:13px;line-height:1.2;border:0;border-top:1px solid #dee2e6;padding:4px 8px;font-weight:600}.note-status-output:empty{height:0;padding:0;border-top-width:0}.note-statusbar{background-color:#8080801d;border-top:1px solid rgba(0,0,0,.15)}.note-statusbar .note-resizebar{padding-top:1px;height:9px;width:100%;cursor:ns-resize}.note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid rgba(0,0,0,.2)}.note-statusbar.locked .note-resizebar{cursor:default}.note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-palette{display:flex;flex-direction:column;row-gap:8px;margin:0;width:160px}.note-palette-title{font-size:13px;text-align:center;font-weight:600}.note-color-reset,.note-color-select{font-size:11px;width:100%}.note-color-row{height:20px}.note-color-select-btn{display:none}.note-holder-custom .note-color-btn{border:1px solid var(--gray-200)!important}.note-color-palette{line-height:1}.note-color-palette .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:0;border-radius:0}.note-color-palette .note-color-btn:hover{transform:scale(1.2);transition:all .2s}.note-placeholder{position:absolute;display:none;color:var(--gray-600)}.note-modal .form-group{margin-inline:0;margin-bottom:.5rem}.note-modal .form-group:last-child{margin-bottom:0}.note-modal .note-form-label{margin-bottom:.25rem}.note-modal .note-modal-form{margin:0}.note-modal .modal-footer>.note-btn-primary{min-width:80px}.note-control-selection{position:absolute;display:none;border:1px solid #000}.note-control-selection>div{position:absolute}.note-control-selection-bg{width:100%;height:100%;background-color:#000;opacity:.3}.note-control-handle,.note-control-sizing,.note-control-holder{width:7px;height:7px;border:1px solid #000}.note-control-sizing{background-color:#000}.note-control-nw{top:-5px;left:-5px;border-right:none;border-bottom:none}.note-control-ne{top:-5px;right:-5px;border-bottom:none;border-left:none}.note-control-sw{bottom:-5px;left:-5px;border-top:none;border-right:none}.note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-control-se.note-control-holder{cursor:default;border-top:none;border-left:none}.note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;color:#fff;background-color:#000;font-size:12px;opacity:.7;border-radius:5px}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{padding:3px;max-height:150px;overflow:auto}.note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-group .note-hint-item.active,.note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;white-space:nowrap;text-decoration:none;background-color:#428bca;outline:0;cursor:pointer}.note-dropdown-menu>.dropdown-item>*{margin-bottom:0}.note-dropdown-menu.right{right:0;left:auto}.note-dropdown-menu.right:before{right:9px;left:auto!important}.note-dropdown-menu.right:after{right:10px;left:auto!important}.note-dropdown-menu.note-check{min-width:initial}.note-dropdown-menu.note-check>.dropdown-item{justify-content:space-between}.note-dropdown-menu.note-check>.dropdown-item>i{color:var(--warning);visibility:hidden;order:2;margin-inline:10px -4px!important}.note-dropdown-menu.note-check>.dropdown-item.checked{font-weight:600}.note-dropdown-menu.note-check>.dropdown-item.checked>i{visibility:visible}.note-toolbar-wrapper{position:relative}.note-popover.popover{display:none;max-width:none;border-color:var(--gray-300);z-index:1071}.note-popover.popover .arrow:before{border-bottom-color:var(--gray-300)}.note-toolbar{--note-toolbar-gap: 5px;--note-toolbar-rowheight: calc( calc(1.429em + .75rem + 2px) + (var(--note-toolbar-gap) * 2) - 1px);margin:0;flex-direction:row;flex-wrap:nowrap;align-items:center;padding:var(--note-toolbar-gap);column-gap:var(--note-toolbar-gap);row-gap:calc(var(--note-toolbar-gap) * 2)}.note-toolbar.note-toolbar-main{position:relative;flex-wrap:wrap;border-bottom-width:0;background-image:linear-gradient(rgba(0,0,0,.1) 1px,transparent 1px);background-size:100% var(--note-toolbar-rowheight);background-position:0 -1px}.note-toolbar:not(.dropdown-menu){display:flex}.note-toolbar.dropdown-menu.show{display:flex}.note-btn{--btn-padding-x: 6px;min-width:32px}.note-btn>i,.note-btn>svg{font-size:16px!important;fill:currentColor}.note-btn>svg{height:16px}.note-toolbar>.note-btn-group{column-gap:2px;border:0 solid rgba(0,0,0,.12);border-inline-end-width:1px;padding-inline-end:5px}.note-toolbar>.note-btn-group:last-of-type{border-inline-end-width:0;padding-inline-end:0}.note-toolbar>.note-btn-group>.note-btn,.note-toolbar>.note-btn-group>.note-btn-group>.note-btn{--btn-color: #393f46;--btn-bg: transparent;--btn-border-color: transparent;--btn-box-shadow: none;--btn-disabled-color: var(--btn-color);--btn-disabled-bg: var(--btn-bg);--btn-disabled-border-color: var(--btn-border-color);border-radius:var(--btn-border-radius);background-image:none;border-radius:var(--btn-border-radius)!important;margin-inline-start:0;--btn-active-bg: rgba(var(--primary-bg-subtle-rgb), .75);--btn-active-color: var(--primary-text-emphasis);--btn-active-border-color: transparent;--btn-active-shadow: none}.note-toolbar>.note-btn-group>.note-btn:not(:hover),.note-toolbar>.note-btn-group>.note-btn-group>.note-btn:not(:hover){transition:none!important}.note-toolbar>.note-btn-group>.note-btn:active,.note-toolbar>.note-btn-group>.note-btn-group>.note-btn:active{--btn-active-bg: var(--primary-bg-subtle);--btn-active-border-color: rgba(var(--primary-rgb), .3)}.note-toolbar .scrollable-menu{--scrollbar-track-color: #fff;--scrollbar-track-hover-color: #fff;height:auto;max-height:340px;min-width:280px;overflow-x:hidden}.note-toolbar-main>.note-btn-group:last-of-type{margin-inline-start:auto}.dropdown-style.dropdown-menu blockquote,.dropdown-style.dropdown-menu pre{margin:0}.dropdown-style.dropdown-menu pre{padding-block:5px;width:100%}.dropdown-style.dropdown-menu h1,.dropdown-style.dropdown-menu h2,.dropdown-style.dropdown-menu h3,.dropdown-style.dropdown-menu h4,.dropdown-style.dropdown-menu h5,.dropdown-style.dropdown-menu h6,.dropdown-style.dropdown-menu p{margin:0;padding:0}.note-color>.dropdown-toggle{padding-inline:6px}.note-color-all>.note-dropdown-menu{min-width:auto;padding:12px;column-gap:8px}.note-color-all>.note-dropdown-menu.show{display:flex}.note-table.dropdown-menu{min-width:0;padding:5px}.note-dimension-picker{font-size:18px}.note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-recent-color{display:inline-block;border:1px solid rgba(0,0,0,.12);padding-inline:2px;border-radius:3px}.note-fontsize-10{font-size:10px}.note-current-fontsize{display:inline-block;width:16px}.note-para>.btn-group:last-child .dropdown-menu.show{display:flex!important}.note-font>.btn-group:first-child>.btn{padding-inline:.5rem;width:112px;max-width:112px;justify-content:space-between;font-weight:400}.note-font>.btn-group:first-child>.btn>.note-current-fontname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.note-dropdown-menu.dropdown-fontsize{min-width:92px}.note-dropdown-menu.dropdown-cssclass>.dropdown-item{position:relative}.note-dropdown-menu.dropdown-cssclass>.dropdown-item>.d-block{width:100%}.note-dropdown-menu.dropdown-cssclass>.dropdown-item.checked{order:-1}.note-dropdown-menu.dropdown-cssclass>.dropdown-item.checked:before{position:absolute;content:"";inset-inline-start:0;top:0;bottom:0;width:3px;background-color:var(--warning)} - -/*# sourceMappingURL=summernote-sm.css.map */ \ No newline at end of file diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css.map b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css.map deleted file mode 100644 index c5884a17d7..0000000000 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["summernote-sm.css"],"names":[],"mappings":"AAAA,qBAAqB,wBAAwB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,eAAe,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,cAAc,CAAC,2BAA2B,kBAAkB,CAAC,eAAe,iBAAiB,CAAC,YAAY,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,WAAW,CAAC,qBAAqB,CAAC,sCAAsC,kBAAkB,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,cAAc,CAAC,eAAe,CAAC,qBAAqB,oBAAoB,CAAC,qCAAqC,aAAa,CAAC,aAAa,iBAAiB,CAAC,wBAAwB,CAAC,iCAAiC,CAAC,+BAA+B,CAAC,6BAA6B,CAAC,+BAA+B,CAAC,gEAAgE,YAAY,CAAC,oBAAoB,CAAC,+BAA+B,YAAY,CAAC,2BAA2B,cAAc,CAAC,mBAAmB,iBAAiB,CAAC,eAAe,CAAC,eAAe,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,iBAAiB,yBAAyB,CAAC,8BAA8B,SAAS,CAAC,sCAAsC,0BAA0B,CAAC,mBAAmB,oBAAoB,CAAC,mBAAmB,kBAAkB,CAAC,mCAAmC,iBAAiB,CAAC,oCAAoC,gBAAgB,CAAC,0CAA0C,0BAA0B,CAAC,8GAA8G,wBAAwB,CAAC,wOAAwO,sBAAsB,CAAC,qCAAqC,YAAY,CAAC,oCAAoC,aAAa,CAAC,cAAc,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,6CAA6C,CAAC,cAAc,CAAC,UAAU,CAAC,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC,qBAAqB,CAAC,eAAe,CAAC,eAAe,CAAC,wBAAwB,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,8BAA8B,CAAC,sBAAsB,CAAC,wCAAwC,YAAY,CAAC,sBAAsB,yBAAyB,CAAC,oBAAoB,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,4BAA4B,CAAC,eAAe,CAAC,eAAe,CAAC,0BAA0B,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,0BAA0B,CAAC,oCAAoC,CAAC,gCAAgC,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC,+CAA+C,UAAU,CAAC,eAAe,CAAC,mCAAmC,CAAC,uCAAuC,cAAc,CAAC,sDAAsD,YAAY,CAAC,cAAc,YAAY,CAAC,qBAAqB,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,oBAAoB,cAAc,CAAC,iBAAiB,CAAC,eAAe,CAAC,qCAAqC,cAAc,CAAC,UAAU,CAAC,gBAAgB,WAAW,CAAC,uBAAuB,YAAY,CAAC,oCAAoC,0CAA0C,CAAC,oBAAoB,aAAa,CAAC,oCAAoC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,0CAA0C,oBAAoB,CAAC,kBAAkB,CAAC,kBAAkB,iBAAiB,CAAC,YAAY,CAAC,qBAAqB,CAAC,wBAAwB,eAAe,CAAC,mBAAmB,CAAC,mCAAmC,eAAe,CAAC,6BAA6B,oBAAoB,CAAC,6BAA6B,QAAQ,CAAC,4CAA4C,cAAc,CAAC,wBAAwB,iBAAiB,CAAC,YAAY,CAAC,qBAAqB,CAAC,4BAA4B,iBAAiB,CAAC,2BAA2B,UAAU,CAAC,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,+DAA+D,SAAS,CAAC,UAAU,CAAC,qBAAqB,CAAC,qBAAqB,qBAAqB,CAAC,iBAAiB,QAAQ,CAAC,SAAS,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,iBAAiB,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,iBAAiB,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,iBAAiB,CAAC,iBAAiB,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,qCAAqC,cAAc,CAAC,eAAe,CAAC,gBAAgB,CAAC,6BAA6B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,cAAc,CAAC,UAAU,CAAC,iBAAiB,CAAC,mBAAmB,eAAe,CAAC,WAAW,CAAC,oCAAoC,WAAW,CAAC,gBAAgB,CAAC,aAAa,CAAC,iCAAiC,uBAAuB,CAAC,WAAW,CAAC,+EAA+E,aAAa,CAAC,UAAU,CAAC,eAAe,CAAC,eAAe,CAAC,UAAU,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,SAAS,CAAC,cAAc,CAAC,qCAAqC,eAAe,CAAC,0BAA0B,OAAO,CAAC,SAAS,CAAC,iCAAiC,SAAS,CAAC,mBAAmB,CAAC,gCAAgC,UAAU,CAAC,mBAAmB,CAAC,+BAA+B,iBAAiB,CAAC,8CAA8C,6BAA6B,CAAC,gDAAgD,oBAAoB,CAAC,iBAAiB,CAAC,OAAO,CAAC,iCAAiC,CAAC,sDAAsD,eAAe,CAAC,wDAAwD,kBAAkB,CAAC,sBAAsB,iBAAiB,CAAC,sBAAsB,YAAY,CAAC,cAAc,CAAC,4BAA4B,CAAC,YAAY,CAAC,oCAAoC,mCAAmC,CAAC,cAAc,uBAAuB,CAAC,mGAAmG,CAAC,QAAQ,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,+BAA+B,CAAC,kCAAkC,CAAC,yCAAyC,CAAC,gCAAgC,iBAAiB,CAAC,cAAc,CAAC,qBAAqB,CAAC,oEAAoE,CAAC,kDAAkD,CAAC,0BAA0B,CAAC,kCAAkC,YAAY,CAAC,iCAAiC,YAAY,CAAC,UAAU,oBAAoB,CAAC,cAAc,CAAC,0BAA0B,wBAAwB,CAAC,iBAAiB,CAAC,cAAc,WAAW,CAAC,8BAA8B,cAAc,CAAC,8BAA8B,CAAC,2BAA2B,CAAC,sBAAsB,CAAC,2CAA2C,yBAAyB,CAAC,oBAAoB,CAAC,gGAAgG,oBAAoB,CAAC,qBAAqB,CAAC,+BAA+B,CAAC,sBAAsB,CAAC,sCAAsC,CAAC,gCAAgC,CAAC,oDAAoD,CAAC,sCAAsC,CAAC,qBAAqB,CAAC,gDAAgD,CAAC,qBAAqB,CAAC,wDAAwD,CAAC,gDAAgD,CAAC,sCAAsC,CAAC,yBAAyB,CAAC,wHAAwH,yBAAyB,CAAC,8GAA8G,yCAAyC,CAAC,uDAAuD,CAAC,+BAA+B,6BAA6B,CAAC,mCAAmC,CAAC,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,iBAAiB,CAAC,gDAAgD,wBAAwB,CAAC,2EAA2E,QAAQ,CAAC,kCAAkC,iBAAiB,CAAC,UAAU,CAAC,sOAAsO,QAAQ,CAAC,SAAS,CAAC,6BAA6B,kBAAkB,CAAC,oCAAoC,cAAc,CAAC,YAAY,CAAC,cAAc,CAAC,yCAAyC,YAAY,CAAC,0BAA0B,WAAW,CAAC,WAAW,CAAC,uBAAuB,cAAc,CAAC,oCAAoC,2BAA2B,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,qCAAqC,2BAA2B,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,iRAAiR,CAAC,mCAAmC,2BAA2B,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,iRAAiR,CAAC,mBAAmB,oBAAoB,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,kBAAkB,cAAc,CAAC,uBAAuB,oBAAoB,CAAC,UAAU,CAAC,qDAAqD,sBAAsB,CAAC,uCAAuC,oBAAoB,CAAC,WAAW,CAAC,eAAe,CAAC,6BAA6B,CAAC,eAAe,CAAC,8DAA8D,eAAe,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,sCAAsC,cAAc,CAAC,qDAAqD,iBAAiB,CAAC,8DAA8D,UAAU,CAAC,6DAA6D,QAAQ,CAAC,oEAAoE,iBAAiB,CAAC,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,+BAA+B","file":"summernote-sm.css","sourcesContent":[".note-editor-preview{border:1px solid #dee2e6;min-height:100px;max-height:350px;overflow-x:hidden;overflow-y:auto;padding:.5rem .75rem;border-radius:.375rem;cursor:default}.note-editor-preview.empty{min-height:initial}.note-dropzone{position:absolute;display:none;z-index:100;color:#87cefa;background-color:#fff;opacity:.95;border-radius:.375rem}.note-dropzone .note-dropzone-message{display:table-cell;vertical-align:middle;text-align:center;font-size:28px;font-weight:600}.note-dropzone.hover{color:var(--primary)}.note-editor.dragover .note-dropzone{display:table}.note-editor{position:relative;border:1px solid #dee2e6;border-start-start-radius:.375rem;border-start-end-radius:.375rem;border-end-end-radius:.375rem;border-end-start-radius:.375rem}.note-editor:focus-within,.note-editor:focus,.note-editor.focus{z-index:1019;border-color:#689de8}.note-editor .note-placeholder{padding:10px}.note-editor.note-airframe{border-width:0}.note-editing-area{position:relative;overflow:hidden}.note-editable{outline:none;padding:10px;overflow:auto;word-wrap:break-word;font-weight:400;font-style:normal;text-decoration:none}.note-editable a{text-decoration:underline}.note-airframe .note-editable{padding:0}.note-editable[contenteditable=false]{background-color:#8080801d}.note-editable sup{vertical-align:super}.note-editable sub{vertical-align:sub}.note-editable img.note-float-left{margin-right:10px}.note-editable img.note-float-right{margin-left:10px}.note-editable ul li,.note-editable ol li{list-style-position:inside}.note-editable table:not(.table-bordered):not([border]),.note-editable table:not(.table-bordered)[border=\"0\"]{border-collapse:collapse}.note-editable table:not(.table-bordered):not([border]) td,.note-editable table:not(.table-bordered):not([border]) th,.note-editable table:not(.table-bordered)[border=\"0\"] td,.note-editable table:not(.table-bordered)[border=\"0\"] th{border:1px dashed #bbb}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-codable{display:none;width:100%;padding:10px;border:none;box-shadow:none;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;resize:none;outline:none;box-sizing:border-box;border-radius:0;margin-bottom:0}.note-editor.fullscreen{position:fixed;top:0;left:0;width:100%!important;border-radius:0!important;border-color:#dee2e6!important;z-index:1070!important}.note-editor.fullscreen .note-resizebar{display:none}.note-fullscreen-body{overflow:hidden!important}.note-status-output{display:block;width:100%;font-size:13px;line-height:1.2;border:0;border-top:1px solid #dee2e6;padding:4px 8px;font-weight:600}.note-status-output:empty{height:0;padding:0;border-top-width:0}.note-statusbar{background-color:#8080801d;border-top:1px solid rgba(0,0,0,.15)}.note-statusbar .note-resizebar{padding-top:1px;height:9px;width:100%;cursor:ns-resize}.note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid rgba(0,0,0,.2)}.note-statusbar.locked .note-resizebar{cursor:default}.note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-palette{display:flex;flex-direction:column;row-gap:8px;margin:0;width:160px}.note-palette-title{font-size:13px;text-align:center;font-weight:600}.note-color-reset,.note-color-select{font-size:11px;width:100%}.note-color-row{height:20px}.note-color-select-btn{display:none}.note-holder-custom .note-color-btn{border:1px solid var(--gray-200)!important}.note-color-palette{line-height:1}.note-color-palette .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:0;border-radius:0}.note-color-palette .note-color-btn:hover{transform:scale(1.2);transition:all .2s}.note-placeholder{position:absolute;display:none;color:var(--gray-600)}.note-modal .form-group{margin-inline:0;margin-bottom:.5rem}.note-modal .form-group:last-child{margin-bottom:0}.note-modal .note-form-label{margin-bottom:.25rem}.note-modal .note-modal-form{margin:0}.note-modal .modal-footer>.note-btn-primary{min-width:80px}.note-control-selection{position:absolute;display:none;border:1px solid #000}.note-control-selection>div{position:absolute}.note-control-selection-bg{width:100%;height:100%;background-color:#000;opacity:.3}.note-control-handle,.note-control-sizing,.note-control-holder{width:7px;height:7px;border:1px solid #000}.note-control-sizing{background-color:#000}.note-control-nw{top:-5px;left:-5px;border-right:none;border-bottom:none}.note-control-ne{top:-5px;right:-5px;border-bottom:none;border-left:none}.note-control-sw{bottom:-5px;left:-5px;border-top:none;border-right:none}.note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-control-se.note-control-holder{cursor:default;border-top:none;border-left:none}.note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;color:#fff;background-color:#000;font-size:12px;opacity:.7;border-radius:5px}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{padding:3px;max-height:150px;overflow:auto}.note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-group .note-hint-item.active,.note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;white-space:nowrap;text-decoration:none;background-color:#428bca;outline:0;cursor:pointer}.note-dropdown-menu>.dropdown-item>*{margin-bottom:0}.note-dropdown-menu.right{right:0;left:auto}.note-dropdown-menu.right:before{right:9px;left:auto!important}.note-dropdown-menu.right:after{right:10px;left:auto!important}.note-dropdown-menu.note-check{min-width:initial}.note-dropdown-menu.note-check>.dropdown-item{justify-content:space-between}.note-dropdown-menu.note-check>.dropdown-item>i{color:var(--warning);visibility:hidden;order:2;margin-inline:10px -4px!important}.note-dropdown-menu.note-check>.dropdown-item.checked{font-weight:600}.note-dropdown-menu.note-check>.dropdown-item.checked>i{visibility:visible}.note-toolbar-wrapper{position:relative}.note-popover.popover{display:none;max-width:none;border-color:var(--gray-300);z-index:1071}.note-popover.popover .arrow:before{border-bottom-color:var(--gray-300)}.note-toolbar{--note-toolbar-gap: 5px;--note-toolbar-rowheight: calc( calc(1.429em + .75rem + 2px) + (var(--note-toolbar-gap) * 2) - 1px);margin:0;flex-direction:row;flex-wrap:nowrap;align-items:center;padding:var(--note-toolbar-gap);column-gap:var(--note-toolbar-gap);row-gap:calc(var(--note-toolbar-gap) * 2)}.note-toolbar.note-toolbar-main{position:relative;flex-wrap:wrap;border-bottom-width:0;background-image:linear-gradient(rgba(0,0,0,.1) 1px,transparent 1px);background-size:100% var(--note-toolbar-rowheight);background-position:0 -1px}.note-toolbar:not(.dropdown-menu){display:flex}.note-toolbar.dropdown-menu.show{display:flex}.note-btn{--btn-padding-x: 6px;min-width:32px}.note-btn>i,.note-btn>svg{font-size:16px!important;fill:currentColor}.note-btn>svg{height:16px}.note-toolbar>.note-btn-group{column-gap:2px;border:0 solid rgba(0,0,0,.12);border-inline-end-width:1px;padding-inline-end:5px}.note-toolbar>.note-btn-group:last-of-type{border-inline-end-width:0;padding-inline-end:0}.note-toolbar>.note-btn-group>.note-btn,.note-toolbar>.note-btn-group>.note-btn-group>.note-btn{--btn-color: #393f46;--btn-bg: transparent;--btn-border-color: transparent;--btn-box-shadow: none;--btn-disabled-color: var(--btn-color);--btn-disabled-bg: var(--btn-bg);--btn-disabled-border-color: var(--btn-border-color);border-radius:var(--btn-border-radius);background-image:none;border-radius:var(--btn-border-radius)!important;margin-inline-start:0;--btn-active-bg: rgba(var(--primary-bg-subtle-rgb), .75);--btn-active-color: var(--primary-text-emphasis);--btn-active-border-color: transparent;--btn-active-shadow: none}.note-toolbar>.note-btn-group>.note-btn:not(:hover),.note-toolbar>.note-btn-group>.note-btn-group>.note-btn:not(:hover){transition:none!important}.note-toolbar>.note-btn-group>.note-btn:active,.note-toolbar>.note-btn-group>.note-btn-group>.note-btn:active{--btn-active-bg: var(--primary-bg-subtle);--btn-active-border-color: rgba(var(--primary-rgb), .3)}.note-toolbar .scrollable-menu{--scrollbar-track-color: #fff;--scrollbar-track-hover-color: #fff;height:auto;max-height:340px;min-width:280px;overflow-x:hidden}.note-toolbar-main>.note-btn-group:last-of-type{margin-inline-start:auto}.dropdown-style.dropdown-menu blockquote,.dropdown-style.dropdown-menu pre{margin:0}.dropdown-style.dropdown-menu pre{padding-block:5px;width:100%}.dropdown-style.dropdown-menu h1,.dropdown-style.dropdown-menu h2,.dropdown-style.dropdown-menu h3,.dropdown-style.dropdown-menu h4,.dropdown-style.dropdown-menu h5,.dropdown-style.dropdown-menu h6,.dropdown-style.dropdown-menu p{margin:0;padding:0}.note-color>.dropdown-toggle{padding-inline:6px}.note-color-all>.note-dropdown-menu{min-width:auto;padding:12px;column-gap:8px}.note-color-all>.note-dropdown-menu.show{display:flex}.note-table.dropdown-menu{min-width:0;padding:5px}.note-dimension-picker{font-size:18px}.note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC) repeat}.note-recent-color{display:inline-block;border:1px solid rgba(0,0,0,.12);padding-inline:2px;border-radius:3px}.note-fontsize-10{font-size:10px}.note-current-fontsize{display:inline-block;width:16px}.note-para>.btn-group:last-child .dropdown-menu.show{display:flex!important}.note-font>.btn-group:first-child>.btn{padding-inline:.5rem;width:112px;max-width:112px;justify-content:space-between;font-weight:400}.note-font>.btn-group:first-child>.btn>.note-current-fontname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.note-dropdown-menu.dropdown-fontsize{min-width:92px}.note-dropdown-menu.dropdown-cssclass>.dropdown-item{position:relative}.note-dropdown-menu.dropdown-cssclass>.dropdown-item>.d-block{width:100%}.note-dropdown-menu.dropdown-cssclass>.dropdown-item.checked{order:-1}.note-dropdown-menu.dropdown-cssclass>.dropdown-item.checked:before{position:absolute;content:\"\";inset-inline-start:0;top:0;bottom:0;width:3px;background-color:var(--warning)}\n"]} \ No newline at end of file diff --git a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.js b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.js index f0a4a4db46..71fee5be22 100644 --- a/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.js +++ b/src/Smartstore.Web/wwwroot/lib/editors/summernote2/summernote-sm.js @@ -5,11 +5,16 @@ https://summernote.org Copyright 2013- Hackerwins and contributors Summernote may be freely distributed under the MIT license. -Date: 2024-11-30T03:26Z +Date: 2024-12-04T00:04Z */ -(function(){"use strict";$.summernote=$.summernote||{lang:{}},$.extend(!0,$.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Google Drive, Vimeo, Vine, Instagram, DailyMotion, Youku, Peertube)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{escape:"Escape",insertParagraph:"Insert Paragraph",undo:"Undo the last command",redo:"Redo the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select special characters"},output:{noSelection:"No selection made!"}}}),$.extend(!0,$.summernote.lang,{"en-US":{common:{ok:"OK",cancel:"Cancel"},font:{code:"Code"},attrs:{cssClass:"CSS Class",cssStyle:"CSS Style",rel:"Rel"},link:{browse:"Browse"},image:{imageProps:"Image Attributes"},imageShapes:{tooltip:"Shape",tooltipShapeOptions:["Responsive","Border","Rounded","Circle","Thumbnail","Shadow (small)","Shadow (medium)","Shadow (large)"]},tableStyles:{tooltip:"Table style",stylesExclusive:["Basic","Bordered"],stylesInclusive:["Striped","Condensed","Hoverable"]}}});const ie=["sans-serif","serif","monospace","cursive","fantasy"];function ne(s){return $.inArray(s.toLowerCase(),ie)===-1?`'${s}'`:s}function Eo(){const s="mw",t="20px";var n=document.createElement("canvas"),r=n.getContext("2d",{willReadFrequently:!0});n.width=40,n.height=20,r.textAlign="center",r.fillStyle="black",r.textBaseline="middle";function a(c,d){r.clearRect(0,0,40,20),r.font=t+" "+ne(c)+', "'+d+'"',r.fillText(s,40/2,20/2);var h=r.getImageData(0,0,40,20).data;return h.join("")}return c=>{const d=c==="Comic Sans MS"?"Courier New":"Comic Sans MS";let h=a(d,d),u=a(c,d);return h!==u}}const Z=navigator.userAgent,Et=/MSIE|Trident/i.test(Z);let Tt;if(Et){let s=/MSIE (\d+[.]\d+)/.exec(Z);s&&(Tt=parseFloat(s[1])),s=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(Z),s&&(Tt=parseFloat(s[1]))}const nt=/Edge\/\d+/.test(Z),To="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,Ho=Et?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",L={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:Et,isEdge:nt,isFF:!nt&&/firefox/i.test(Z),isPhantom:/PhantomJS/i.test(Z),isWebkit:!nt&&/webkit/i.test(Z),isChrome:!nt&&/chrome/i.test(Z),isSafari:!nt&&/safari/i.test(Z)&&!/chrome/i.test(Z),browserVersion:Tt,isSupportTouch:To,isFontInstalled:Eo(),isW3CRangeSupport:!!document.createRange,inputEventName:Ho,genericFontFamilies:ie,validFontName:ne},E={isArguments:s=>_.isArguments(s),isArray:s=>_.isArray(s),isArrayBuffer:s=>_.isArrayBuffer(s),isBoolean:s=>_.isBoolean(s),isDataView:s=>_.isDataView(s),isDate:s=>_.isDate(s),isNode:s=>s instanceof Node,isElement:s=>_.isElement(s),isError:s=>_.isError(s),isFunction:s=>_.isFunction(s),isFinite:s=>_.isFinite(s),isNaN:s=>_.isNaN(s),isNull:s=>s===null,isNullOrUndefined:s=>s==null,isAssigned:s=>s!=null&&s!=null,isNumber:s=>_.isNumber(s),isObject:s=>_.isObject(s),isPlainObject:s=>$.isPlainObject(s),isRegExp:s=>_.isRegExp(s),isString:s=>_.isString(s),isSymbol:s=>_.isSymbol(s),isTypedArray:s=>_.isTypedArray(s),isUndefined:s=>_.isUndefined(s),isJquery:s=>s instanceof $},Ro=s=>function(t){return s===t},Lo=(s,t)=>s===t,Ao=s=>function(t,e){return t[s]===e[s]},zo=()=>!0,Po=()=>!1,Mo=s=>s;function Bo(s){return function(){return!s.apply(s,arguments)}}function Io(...s){const t=s,e=t.length;return e===0?!1:function(i){for(var n=0;n_.debounce(s,t,e),_o=(s,t,e)=>_.delay(s,t,e),jo=(s,t)=>_.defer(s,t),qo=(s,t,e)=>_.throttle(s,t,e);function Wo(s,t,e){return Math.min(Math.max(s,t),e)}function Ko(s){return()=>s}const k={eq:Ro,eq2:Lo,peq2:Ao,ok:zo,fail:Po,self:Mo,not:Bo,and:Io,or:Do,invoke:Oo,resetUniqueId:Fo,uniqueId:Uo,debounce:Vo,delay:_o,defer:jo,throttle:qo,clamp:Wo,constant:Ko},Go=s=>s.length!==void 0,ae=s=>_.first(s),Ht=s=>_.last(s),Qo=s=>_.initial(s),le=s=>_.rest(s),Zo=(s,t,e)=>_.findIndex(s,t,e)>-1,Yo=(s,t,e)=>_.findIndex(s,t,e),Jo=(s,t,e)=>_.find(s,t,e),Xo=(s,t,e)=>_.every(s,t,e),ts=(s,t,e)=>_.some(s,t,e),es=(s,t)=>s!=null&&s.contains?s.contains(t):_.contains(s,t),os=(s,t,e)=>(t=t||k.self,_.reduce(s,function(i,n){return i+t(n)},0,e)),ss=(s,t,e)=>_.isFunction(Array.from)?t?Array.from(s,t,e):Array.from(s):t?_.map(s,t,e):_.toArray(s),is=s=>_.isEmpty(s),ns=(s,t)=>{if(!s.length)return[];const e=le(s),i=E.isFunction(t)?t:k.peq2(t);return e.reduce(function(n,r){const a=Ht(n);return i(Ht(a),r)?a[a.length]=r:n[n.length]=[r],n},[[ae(s)]])},rs=(s,t,e)=>_.groupBy(s,t,e),as=s=>_.compact(s),ls=(s,t,e)=>_.uniq(s,t,null,e),cs=(s,t)=>{if(s!=null&&s.length&&t){const e=s.indexOf(t);return e===-1||e===s.length-1?null:s[e+1]}return null},ds=(s,t)=>{if(s!=null&&s.length&&t){const e=s.indexOf(t);return e<=0?null:s[e-1]}return null},hs=(s,t,e=null)=>_.each(s,t,e),us=(s,t,e,i)=>_.foldl(s,t,e,i),ps=(s,t,e,i)=>_.foldr(s,t,e,i),fs=(s,t,e)=>_.filter(s,t,e),gs=(s,t,e)=>_.reject(s,t,e),ms=(s,t,e=null)=>_.map(s,t,e);function bs(s,t=null,e=null){const i=E.isString(s)?s.split(t||","):s||[];e=e||{};let n=i.length;for(;n--;)e[i[n]]={};return e}const ce=(s,t,e,i)=>{i=i||s,s&&(e&&(s=o[e]),_.each(s,(n,r)=>t.call(i,n,r,e)===!1?!1:(ce(n,t,e,i),!0)))},p={head:ae,last:Ht,initial:Qo,tail:le,prev:ds,next:cs,exists:Zo,find:Jo,findIndex:Yo,contains:es,all:Xo,any:ts,sum:os,from:ss,isEmpty:is,clusterBy:ns,groupBy:rs,compact:as,unique:ls,each:hs,foldl:us,foldr:ps,filter:fs,reject:gs,map:ms,makeMap:bs,isArrayLike:Go,walk:ce},vs=/^[ \t\r\n]*$/,Cs=/\s/,ys=/^(?!-)([a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,6}$/,ws=/^(([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))\.){3}([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))$/,de=/^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/,ks=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,xs=/^(\+?\d{1,3}[\s-]?)?(\d{1,4})[\s-]?(\d{1,4})[\s-]?(\d{1,4})$/,he=(s,t,e)=>t===""||s.length>=t.length&&s.substr(e,e+t.length)===t,$s=(s,t)=>he(s,t,0),Ss=(s,t)=>he(s,t,s.length-t.length),Ns=s=>_.escape(s),Es=s=>_.unescape(s),Ts=s=>Cs.test(s),Hs=s=>vs.test(s),Rs=(s,t,e=0,i)=>{const n=s.indexOf(t,e);return n!==-1?E.isUndefined(i)?!0:n+t.length<=i:!1},Ls=(s,t)=>E.isRegExp(s)?s.test(t):s==t,As=(s,t)=>(t=t||"",t+s.split(".").map(e=>e.substring(0,1).toUpperCase()+e.substring(1)).join("")),zs=s=>s.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),ue=s=>s&&(ys.test(s)||ws.test(s)),Ps=s=>s&&ks.test(s),Ms=s=>s&&xs.test(s),Bs=s=>s&&de.test(s),Is=s=>s&&(de.test(s)||ue(s)),Ds=(s,t=null)=>Array.isArray(s)?s:s===""?[]:s.split(t||",").map(e=>e.trim()),pe=(s,t,e)=>e<0?-1:s.lastIndexOf(t,e),q={startsWith:$s,endsWith:Ss,contains:Rs,hasWhiteSpace:Ts,isAllWhitespace:Hs,escape:Ns,unescape:Es,matches:Ls,namespaceToCamel:As,camelCaseToHyphens:zs,isValidHost:ue,isValidEmail:Ps,isValidTel:Ms,startsWithUrlScheme:Bs,isValidUrl:Is,explode:Ds,findPosition:(s,t)=>{const e=s.indexOf(t);if(e>0){const i=pe(s,` +(function(){"use strict";$.summernote=$.summernote||{lang:{}},$.extend(!0,$.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Google Drive, Vimeo, Vine, Instagram, DailyMotion, Youku, Peertube)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{escape:"Escape",insertParagraph:"Insert Paragraph",undo:"Undo the last command",redo:"Redo the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select special characters"},output:{noSelection:"No selection made!"}}}),$.extend(!0,$.summernote.lang,{"en-US":{common:{ok:"OK",cancel:"Cancel"},font:{code:"Code"},attrs:{cssClass:"CSS Class",cssStyle:"CSS Style",rel:"Rel"},link:{browse:"Browse"},image:{imageProps:"Image Attributes"},imageShapes:{tooltip:"Shape",tooltipShapeOptions:["Responsive","Border","Rounded","Circle","Thumbnail","Shadow (small)","Shadow (medium)","Shadow (large)"]},tableStyles:{tooltip:"Table style",stylesExclusive:["Basic","Bordered"],stylesInclusive:["Striped","Condensed","Hoverable"]}}});const ie=["sans-serif","serif","monospace","cursive","fantasy"];function ne(s){return $.inArray(s.toLowerCase(),ie)===-1?`'${s}'`:s}function Eo(){const s="mw",t="20px";var n=document.createElement("canvas"),r=n.getContext("2d",{willReadFrequently:!0});n.width=40,n.height=20,r.textAlign="center",r.fillStyle="black",r.textBaseline="middle";function a(c,d){r.clearRect(0,0,40,20),r.font=t+" "+ne(c)+', "'+d+'"',r.fillText(s,40/2,20/2);var h=r.getImageData(0,0,40,20).data;return h.join("")}return c=>{const d=c==="Comic Sans MS"?"Courier New":"Comic Sans MS";let h=a(d,d),u=a(c,d);return h!==u}}const Z=navigator.userAgent,Et=/MSIE|Trident/i.test(Z);let Tt;if(Et){let s=/MSIE (\d+[.]\d+)/.exec(Z);s&&(Tt=parseFloat(s[1])),s=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(Z),s&&(Tt=parseFloat(s[1]))}const nt=/Edge\/\d+/.test(Z),To="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,Ho=Et?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",L={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:Et,isEdge:nt,isFF:!nt&&/firefox/i.test(Z),isPhantom:/PhantomJS/i.test(Z),isWebkit:!nt&&/webkit/i.test(Z),isChrome:!nt&&/chrome/i.test(Z),isSafari:!nt&&/safari/i.test(Z)&&!/chrome/i.test(Z),browserVersion:Tt,isSupportTouch:To,isFontInstalled:Eo(),isW3CRangeSupport:!!document.createRange,inputEventName:Ho,genericFontFamilies:ie,validFontName:ne},E={isArguments:s=>_.isArguments(s),isArray:s=>_.isArray(s),isArrayBuffer:s=>_.isArrayBuffer(s),isBoolean:s=>_.isBoolean(s),isDataView:s=>_.isDataView(s),isDate:s=>_.isDate(s),isNode:s=>s instanceof Node,isElement:s=>_.isElement(s),isError:s=>_.isError(s),isFunction:s=>_.isFunction(s),isFinite:s=>_.isFinite(s),isNaN:s=>_.isNaN(s),isNull:s=>s===null,isNullOrUndefined:s=>s==null,isAssigned:s=>s!=null&&s!=null,isNumber:s=>_.isNumber(s),isObject:s=>_.isObject(s),isPlainObject:s=>$.isPlainObject(s),isRegExp:s=>_.isRegExp(s),isString:s=>_.isString(s),isSymbol:s=>_.isSymbol(s),isTypedArray:s=>_.isTypedArray(s),isUndefined:s=>_.isUndefined(s),isJquery:s=>s instanceof $},Ro=s=>function(t){return s===t},Lo=(s,t)=>s===t,Ao=s=>function(t,e){return t[s]===e[s]},zo=()=>!0,Po=()=>!1,Mo=s=>s;function Bo(s){return function(){return!s.apply(s,arguments)}}function Io(...s){const t=s,e=t.length;return e===0?!1:function(i){for(var n=0;n_.debounce(s,t,e),_o=(s,t,e)=>_.delay(s,t,e),jo=(s,t)=>_.defer(s,t),qo=(s,t,e)=>_.throttle(s,t,e);function Wo(s,t,e){return Math.min(Math.max(s,t),e)}function Ko(s){return()=>s}const k={eq:Ro,eq2:Lo,peq2:Ao,ok:zo,fail:Po,self:Mo,not:Bo,and:Io,or:Oo,invoke:Do,resetUniqueId:Fo,uniqueId:Uo,debounce:Vo,delay:_o,defer:jo,throttle:qo,clamp:Wo,constant:Ko},Go=s=>s.length!==void 0,ae=s=>_.first(s),Ht=s=>_.last(s),Qo=s=>_.initial(s),le=s=>_.rest(s),Zo=(s,t,e)=>_.findIndex(s,t,e)>-1,Yo=(s,t,e)=>_.findIndex(s,t,e),Jo=(s,t,e)=>_.find(s,t,e),Xo=(s,t,e)=>_.every(s,t,e),ts=(s,t,e)=>_.some(s,t,e),es=(s,t)=>s!=null&&s.contains?s.contains(t):_.contains(s,t),os=(s,t,e)=>(t=t||k.self,_.reduce(s,function(i,n){return i+t(n)},0,e)),ss=(s,t,e)=>_.isFunction(Array.from)?t?Array.from(s,t,e):Array.from(s):t?_.map(s,t,e):_.toArray(s),is=s=>_.isEmpty(s),ns=(s,t)=>{if(!s.length)return[];const e=le(s),i=E.isFunction(t)?t:k.peq2(t);return e.reduce(function(n,r){const a=Ht(n);return i(Ht(a),r)?a[a.length]=r:n[n.length]=[r],n},[[ae(s)]])},rs=(s,t,e)=>_.groupBy(s,t,e),as=s=>_.compact(s),ls=(s,t,e)=>_.uniq(s,t,null,e),cs=(s,t)=>{if(s!=null&&s.length&&t){const e=s.indexOf(t);return e===-1||e===s.length-1?null:s[e+1]}return null},ds=(s,t)=>{if(s!=null&&s.length&&t){const e=s.indexOf(t);return e<=0?null:s[e-1]}return null},hs=(s,t,e=null)=>_.each(s,t,e),us=(s,t,e,i)=>_.foldl(s,t,e,i),ps=(s,t,e,i)=>_.foldr(s,t,e,i),fs=(s,t,e)=>_.filter(s,t,e),gs=(s,t,e)=>_.reject(s,t,e),ms=(s,t,e=null)=>_.map(s,t,e);function bs(s,t=null,e=null){const i=E.isString(s)?s.split(t||","):s||[];e=e||{};let n=i.length;for(;n--;)e[i[n]]={};return e}const ce=(s,t,e,i)=>{i=i||s,s&&(e&&(s=o[e]),_.each(s,(n,r)=>t.call(i,n,r,e)===!1?!1:(ce(n,t,e,i),!0)))},p={head:ae,last:Ht,initial:Qo,tail:le,prev:ds,next:cs,exists:Zo,find:Jo,findIndex:Yo,contains:es,all:Xo,any:ts,sum:os,from:ss,isEmpty:is,clusterBy:ns,groupBy:rs,compact:as,unique:ls,each:hs,foldl:us,foldr:ps,filter:fs,reject:gs,map:ms,makeMap:bs,isArrayLike:Go,walk:ce},vs=/^[ \t\r\n]*$/,Cs=/\s/,ys=/^(?!-)([a-zA-Z0-9-]{1,63}\.)+[a-zA-Z]{2,6}$/,ws=/^(([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))\.){3}([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))$/,de=/^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/,ks=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,xs=/^(\+?\d{1,3}[\s-]?)?(\d{1,4})[\s-]?(\d{1,4})[\s-]?(\d{1,4})$/,he=(s,t,e)=>t===""||s.length>=t.length&&s.substr(e,e+t.length)===t,$s=(s,t)=>he(s,t,0),Ss=(s,t)=>he(s,t,s.length-t.length),Ns=s=>_.escape(s),Es=s=>_.unescape(s),Ts=s=>Cs.test(s),Hs=s=>vs.test(s),Rs=(s,t,e=0,i)=>{const n=s.indexOf(t,e);return n!==-1?E.isUndefined(i)?!0:n+t.length<=i:!1},Ls=(s,t)=>E.isRegExp(s)?s.test(t):s==t,As=(s,t)=>(t=t||"",t+s.split(".").map(e=>e.substring(0,1).toUpperCase()+e.substring(1)).join("")),zs=s=>s.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),ue=s=>s&&(ys.test(s)||ws.test(s)),Ps=s=>s&&ks.test(s),Ms=s=>s&&xs.test(s),Bs=s=>s&&de.test(s),Is=s=>s&&(de.test(s)||ue(s)),Os=(s,t=null)=>Array.isArray(s)?s:s===""?[]:s.split(t||",").map(e=>e.trim()),pe=(s,t,e)=>e<0?-1:s.lastIndexOf(t,e),q={startsWith:$s,endsWith:Ss,contains:Rs,hasWhiteSpace:Ts,isAllWhitespace:Hs,escape:Ns,unescape:Es,matches:Ls,namespaceToCamel:As,camelCaseToHyphens:zs,isValidHost:ue,isValidEmail:Ps,isValidTel:Ms,startsWithUrlScheme:Bs,isValidUrl:Is,explode:Os,findPosition:(s,t)=>{const e=s.indexOf(t);if(e>0){const i=pe(s,` `,e-1),n=e-i-1;let r=0;for(let a=i;a>=0;a=pe(s,` -`,a-1))r++;return{line:r,column:n}}return null}},W={has:(s,t)=>s&&s.hasOwnProperty(t),get:(s,t,e)=>_.get(s,t,e),valueOrDefault:(s,t)=>E.isNullOrUndefined(s)?t:s,isEqual:(s,t)=>_.isEqual(s,t),isMatch:(s,t)=>_.isMatch(s,t),extend:(s,t)=>_.extendOwn(s,t),invert:s=>_.invert(s)},fe={},ge=p.makeMap,pt=p.each,me={},Os=()=>{const t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul center dir isindex noframes article aside details dialog figure main header footer hgroup section nav "+"a ins del canvas map",e="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen svg acronym applet basefont big font strike tt textarea u var #text #comment",i=[t,e].join(" "),n={},r=(c,d)=>{n[c]={children:p.makeMap(d)}},a=(c,d="")=>{d=d==null?void 0:d.trim();const h=d?d.trim().split(" "):[],u=c.trim().split(" ");let f=u.length;for(;f--;)r(u[f],h)};return a("html","head body"),a("head","base command link meta noscript script style title"),a("body",i),a("dd div address dt caption",i),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn",e),a("ol li","li"),a("li blockquote",i),a("dl","dt dd"),a("a ins del iframe",i),a("object",[i,"param"].join(" ")),a("map",[i,"area"].join(" ")),a("table","caption colgroup thead tfoot tbody tr"),a("colgroup","col"),a("tbody thead tfoot","tr"),a("tr","td th"),a("td th",i),a("form",i),a("fieldset",[i,"legend"].join(" ")),a("label button q",e),a("select","option optgroup"),a("optgroup","option"),a("menu",[i,"li"].join(" ")),a("noscript",i),a("wbr"),a("ruby",[e,"rt rp"].join(" ")),a("figcaption",i),a("mark rt rp bdi",e),a("summary",[e,"h1 h2 h3 h4 h5 h6"].join(" ")),a("canvas",i),a("video",[i,"track source"].join(" ")),a("audio",[i,"track source"].join(" ")),a("picture","img source"),a("datalist",[e,"option"].join(" ")),a("article section nav aside main header footer",i),a("hgroup","h1 h2 h3 h4 h5 h6"),a("figure",[i,"figcaption"].join(" ")),a("time output progress meter",e),a("dialog",i),a("details",[i,"summary"].join(" ")),pt([n.video,n.audio],c=>{delete c.children.audio,delete c.children.video}),pt("a form meter progress dfn".split(" "),c=>{n[c]&&delete n[c].children[c]}),delete n.caption.children.table,delete n.script,n},Fs=(s,t)=>{let e=ge(s," ",ge(s.toUpperCase()," "));return $.extend(e,t)},O=(s,t,e)=>{let i=fe[s];return i||(i=Fs(t,e),fe[s]=i),i},Us=Os(),be={};pt(Us,(s,t)=>{be[t]=s.children});const Vs=O("whitespace_elements","pre script noscript style textarea video audio iframe object code"),_s=O("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),ft=O("void_elements","area audio base basefont br col frame hr iframe img input isindex link meta param embed source video wbr track"),js=O("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),ve="td th iframe video audio object script code",qs=O("non_empty_elements",ve+" pre svg",ft),Ws=O("move_caret_before_on_enter_elements",ve+" table",ft),Rt="h1 h2 h3 h4 h5 h6",Ks=O("heading_elements",Rt),Lt=O("text_block_elements",Rt+" p div li address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),At=O("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",Lt),Gs=O("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),Qs=O("text_root_block_elements","td th li dt dd figcaption caption details summary",Lt),Zs=O("transparent_elements","a ins del canvas map"),Ce=O("wrap_block_elements","pre "+Rt);pt("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),s=>{me[s]=new RegExp("]*>","gi")});const Ys=k.constant(Ks),Js=k.constant(At),Xs=k.constant(js),ti=k.constant(Lt),ei=k.constant(Qs),oi=k.constant(Gs),si=k.constant(Object.seal(ft)),ii=k.constant(_s),ni=k.constant(qs),ri=k.constant(Ws),ai=k.constant(Vs),ye=k.constant(Zs),li=k.constant(Ce),ci=k.constant(Object.seal(me)),di=(s,t)=>{const e=be[s.toLowerCase()];return!!(!e||e[t.toLowerCase()])},hi=s=>W.has(At,s),we=s=>!q.startsWith(s,"#")&&!W.has(At,s),ui=s=>W.has(Ce,s)||we(s),pi=s=>W.has(ft,s),ke=s=>W.has(ye(),s),rt={getHeadingElements:Ys,getBlockElements:Js,getVoidElements:si,getTextBlockElements:ti,getTextInlineElements:oi,getTextRootBlockElements:ei,getBoolAttrs:Xs,getSelfClosingElements:ii,getNonEmptyElements:ni,getMoveCaretBeforeOnEnterElements:ri,getWhitespaceElements:ai,getTransparentElements:ye,getWrapBlockElements:li,getSpecialElements:ci,isValidChild:di,isBlock:hi,isInline:we,isWrapper:ui,isVoid:pi,isTransparentElementName:ke,isTransparentElement:s=>dom.isElement(s)&&ke(s.nodeName)},D=s=>E.isJquery(s)?s.get(0):s,xe=s=>{const t=s==null?void 0:s.charCodeAt(0);return t>=65&&t<=90},$e=(s,t)=>{if(K(s)){const e=s.ownerDocument.defaultView;if(e){const i=e.getComputedStyle(s,null);return i?i.getPropertyValue(t):null}}return null},R=s=>{const t=s.toUpperCase();return e=>E.isAssigned(e)&&(xe(e.nodeName)?e.nodeName:e.nodeName.toUpperCase())===t},et=s=>{if(E.isString(s)&&(s=q.explode(s," ")),s.length===0||s==="*")return k.ok;if(s.length==1)return R(s[0]);const t=s.map(e=>e.toUpperCase());return e=>{if(e&&e.nodeName){const i=xe(e.nodeName)?e.nodeName:e.nodeName.toUpperCase();return p.contains(t,i)}return!1}},fi=s=>t=>t&&W.has(s,t.nodeName),gi=(s,t)=>{const e=t.toLowerCase().split(" ");return i=>{const n=$e(i,s);return n&&p.contains(e,n)}},mi=s=>t=>t&&$(t).hasClass(s),bi=s=>t=>K(t)&&t.hasAttribute(s),vi=(s,t)=>e=>K(e)&&e.getAttribute(s)===t,Ci=s=>t=>!!(zt(t)&&(t.contentEditable===s||t.getAttribute("data-note-contenteditable")===s)),F=(s,t)=>E.isFunction(s)?s:Se(s)?k.eq(s):E.isString(s)&&s.length?e=>e.matches&&e.matches(s):t,ot=s=>t=>!!t&&t.nodeType===s,Se=s=>E.isNumber(s==null?void 0:s.nodeType),K=ot(1),z=ot(3),yi=ot(4),wi=ot(7),ki=ot(8),xi=ot(9),$i=ot(11),Ne=s=>K(s)&&s.namespaceURI==="http://www.w3.org/2000/svg",zt=k.and(K,k.not(Ne)),Si=s=>!!s&&!Object.getPrototypeOf(s),Ni=R("BODY"),Ei=R("PRE"),Pt=R("LI"),Ti=R("TABLE"),Hi=R("DATA"),Ri=R("HR"),Li=R("LI"),Ai=R("DETAILS"),zi=R("SUMMARY"),Mt=R("BLOCKQUOTE"),Ee=R("A"),Pi=R("DIV"),Mi=R("SPAN"),Bi=R("B"),Ii=R("U"),Di=R("BR"),Oi=R("IMG"),Fi=R("FIGURE"),Te=R("TEXTAREA"),Ui=et(["TEXTAREA","INPUT","SELECT"]),He=et(["UL","OL"]),Re=et(["TD","TH"]),Vi=et(["TR","TD","TH"]),_i=et(["TD","TH","CAPTION"]),ji=et(["VIDEO","AUDIO","OBJECT","EMBED"]),qi=fi(rt.getHeadingElements()),at=s=>W.has(rt.getTextBlockElements(),s.nodeName)&&!Y(s),gt=s=>at(s)&&!Mt(s),Wi=s=>gt(s)&&!Pt(s),it=s=>rt.isInline(s.nodeName),Ki=s=>rt.isBlock(s.nodeName),Gi=s=>(z(s)||it(s))&&!!J(s,at),Qi=s=>(z(s)||it(s))&&!!J(s,gt),Zi=s=>(z(s)||it(s))&&!J(s,at),Yi=s=>(z(s)||it(s))&&!J(s,gt),Ji=s=>Re(s)||Mt(s)||Y(s),Le=k.and(R("SPAN"),vi("data-note-type","bookmark")),Xi=s=>s&&rt.isVoid(s.nodeName),tn=s=>Ee(s)&&It(s),en=(s,t)=>F(t)(s),on=s=>(s==null?void 0:s.classList)&&s.nodeName==="DIV"&&s.classList.contains("note-control-sizing"),sn=(s,t)=>et(t)(s),nn=(s,t=!1)=>{if(z(s)){const e=t?s.data.replace(/ /g," "):s.data;return q.isAllWhitespace(e)}return!1},Ae=s=>$(s).closest(".note-editable")[0],Y=s=>(s==null?void 0:s.classList)&&s.nodeName==="DIV"&&s.classList.contains("note-editable"),rn=s=>{if(s){const t=K(s)?s:s.parentElement;return!!t&&t.isContentEditable}return!1},ze=s=>{if(s&&zt(s)){const t=s.getAttribute("data-note-contenteditable");return t&&t!=="inherit"?t:s.contentEditable!=="inherit"?s.contentEditable:null}else return null},an=s=>{const t=Ae(s);let e=null;for(let i=s;i&&i!==t&&(e=ze(i),e===null);i=i.parentNode);return e},Bt=L.isMSIE&&L.browserVersion<11?" ":"
",ln=s=>document.createTextNode(s),lt=(s,t=null,e=null)=>{const i=document.createElement(s);return E.isObject(t)&&p.each(t,(n,r)=>{Pe(i,r,n)}),e&&(!E.isString(e)&&e.nodeType?i.appendChild(e):E.isString(e)&&e.length&&(i.innerHTML=e)),i},cn=(s=null)=>{const t=document.createElement("div"),e=document.createDocumentFragment();e.appendChild(t),s&&(t.innerHTML=s);let i;for(;i=t.firstChild;)e.appendChild(i);return e.removeChild(t),e},dn=(s,t)=>(s=D(s),s?s.getAttribute(t):null),Pe=(s,t,e)=>{s=D(s),s&&(e?s.setAttribute(t,e):s.removeAttribute(t))},hn=(s,t)=>{s=D(s),s&&t.hasOwnProperty()&&Object.keys(t).forEach(e=>{const i=t[e];E.isNullOrUndefined(i)?s.removeAttribute(e):s.setAttribute(e,i)})},un=s=>{const t=s.attributes;for(let e=t.length-1;e>=0;e--)s.removeAttributeNode(t.item(e))},pn=(s,t,e=!1)=>e?$e(D(s),q.camelCaseToHyphens(t)):$(s).css(t),fn=(s,t,e)=>{$(s).css(t,e)},gn=(s,t)=>{$(s).css(t)},mn=(s,t)=>$(s).hasClass(t),bn=(s,t)=>{$(s).addClass(t)},vn=(s,t)=>{$(s).removeClass(t),Me(s)},Cn=(s,t,e)=>{$(s).toggleClass(t,e),Me(s)},Me=s=>{s.classList&&s.classList.length===0&&s.removeAttribute("class")},yn=s=>{var e;const t={};for(let i=0,n=(e=s==null?void 0:s.style)==null?void 0:e.length;iz(s)?s.nodeValue.length:s?s.childNodes.length:0,It=s=>{const t=mt(s);return t===0||!z(s)&&t===1&&s.innerHTML.trim()===Bt||z(s)&&s.textContent.trim()===""?!0:!!(p.all(s.childNodes,z)&&s.innerHTML==="")},wn=s=>{do if(s.firstElementChild===null||s.firstElementChild.innerHTML==="")break;while(s=s.firstElementChild);return It(s)},kn=(s,t)=>s.nextSibling===t||s.previousSibling===t,xn=(s,t,e,i)=>{const n=F(t);if(n(s))return!i;if(e){for(let r=s.parentNode;r;r=r.parentNode)if(n(r))return!0}else return n(s.parentNode);return!1},$n=(s,t)=>{for(;s&&s!==t;){if(bt(s)!==0)return!1;s=s.parentNode}return!0},Sn=(s,t)=>{if(!t)return!1;for(;s&&s!==t;){if(bt(s)!==mt(s.parentNode)-1)return!1;s=s.parentNode}return!0},bt=(s,t)=>{let e=0;if(s)for(let i=s.nodeType,n=s.previousSibling;n;n=n.previousSibling){const r=n.nodeType;t&&z(n)&&(r===i||!n.data.length)||(e++,i=r)}return e},Nn=s=>!!(s&&s.childNodes&&s.childNodes.length),En=(s,t)=>{if(K(s)&&s.hasChildNodes()){const e=s.childNodes,i=k.clamp(t,0,e.length-1);return e[i]}else return s},Tn=(s,t)=>{const e=s;for(;s&&z(s)&&s.length===0;)s=t?s.nextSibling:s.previousSibling;return s||e},Hn=(s,t)=>{const e=Te(D(s))?$(s).val():$(s).html();return t?e.replace(/[\n\r]/g,""):e},Rn=s=>{if(E.isNode(s)){if(K(s))return s.outerHTML;{const t=lt("div");return Ct(t,s.cloneNode(!0)),t.innerHTML}}else return""},Ln=s=>{const t=$(s),e=t.offset(),i=t.outerHeight(!0);return{left:e.left,top:e.top+i}},An=(s,t)=>{Object.keys(t).forEach(function(e){s.on(e,t[e])})},zn=(s,t)=>{Object.keys(t).forEach(function(e){s.off(e,t[e])})},Pn=s=>s&&!z(s)&&p.contains(s.classList,"note-styletag"),Mn=(s,t)=>{const e=D(s);return e?e.querySelectorAll?p.from(e.querySelectorAll(t)):[]:[]},J=(s,t,e=!0)=>{if(s=D(e?s:s.parentNode),s){const i=F(t);for(;s;){if(i(s))return s;if(Y(s))break;s=s.parentNode}}return null};function Bn(s,t){var e;if(s=(e=D(s))==null?void 0:e.parentNode,s){const i=F(t);for(;s&&mt(s)===1;){if(i(s))return s;if(Y(s))break;s=s.parentNode}}return null}const vt=(s,t,e=!0)=>{const i=F(t,k.fail),n=[];return J(s,r=>(Y(r)||n.push(r),i(r)),e),n},In=(s,t=null,e=null)=>{const i=F(t,k.ok),n=F(e,Y),r=[];return J(s,a=>n(a)?!1:(i(a)&&r.push(a),!0)),r},Dn=(s,t)=>{const e=F(t),i=vt(s);return p.last(i.filter(e))},On=(s,t)=>{if(E.isNullOrUndefined(s)||E.isNullOrUndefined(t))return null;if(s=D(s),t=D(t),E.isNode(s)&&s===t)return s;let e=[],i;for(i=s;i&&(e.push(i),!Y(i));i=i.parentNode);for(i=t;i;i=i.parentNode)if(e.indexOf(i)>-1)return i;return null},Fn=(s,t)=>{const e=F(t,k.ok),i=[];return s=D(s),s&&(s.previousSibling&&e(s.previousSibling)&&i.push(s.previousSibling),i.push(s),s.nextSibling&&e(s.nextSibling)&&i.push(s.nextSibling)),i},Be=(s,t,e)=>{const i=F(t,k.fail),n=[];if(s=D(s),s)for(;s&&!i(s);)n.push(s),s=e?s.nextSibling:s.previousSibling;return n},Un=(s,t)=>Be(s,t,!1),Vn=(s,t)=>Be(s,t,!0),_n=(s,t,e=!0)=>{const i=F(t,k.ok),n=[];return s=D(s),s&&function r(a,c){if(s!==a&&i(a)&&n.push(a),c)for(let d=0,h=a.childNodes.length;d{if(s=D(s),!!(s!=null&&s.nextSibling)&&s.parent===s.nextSibling.parent&&!(Le(s)&&(s=s.nextSibling,!s)))return z(s.nextSibling)?s.nextSibling:Ie(s.nextSibling)},jn=(s,t)=>vt(t,s).map(bt).reverse();function qn(s,t){let e=s;for(let i=0,n=t.length;iJ(s,at),Kn=(s,t)=>{const e=s.parentNode,i=lt(t);return e.insertBefore(i,s),i.appendChild(s),i},Gn=s=>{const t=s.parentNode,e=t.childNodes;return t.replaceWith(...e),e.length==1?e.item(0):s},Ct=(s,t)=>s.appendChild(t),Qn=(s,t)=>{const e=s.firstChild;return e==null?Ct(s,t):s.insertBefore(t,e)},De=(s,t)=>s.parentNode.insertBefore(t,s),Zn=(s,t)=>{const e=s.nextSibling;return s.parentNode?e?De(e,t):Ct(s.parentNode,t):null},Yn=(s,t,e)=>(p.each(t,i=>{K(s)&&(!e&&Pt(s)&&s.firstChild===null&&He(i)&&s.appendChild(lt("br")),s.appendChild(i))}),s),Oe=(s,t)=>{if(!s||!s.parentNode)return;const e=s.parentNode;if(!t){const i=[];for(let n=0,r=s.childNodes.length;n{const e=F(t);for(;s&&!(Y(s)||!e(s));){const i=s.parentNode;Oe(s),s=i}},Fe=(s,t,e)=>{var i;if(e)for(;t.firstChild;)s.appendChild(t.firstChild);return(i=t.parentNode)==null||i.replaceChild(s,t),s},Xn=(s,t)=>s.cloneNode(t),tr=(s,t)=>{if(!K(s)||s.nodeName.toUpperCase()===t.toUpperCase())return s;const e=lt(t);return[...s.attributes].map(({name:i,value:n})=>{e.setAttribute(i,n)}),Fe(e,s,!0)},l={blank:Bt,emptyPara:`

${Bt}

`,matchSelector:F,matchNodeNames:et,matchClass:mi,matchStyleValues:gi,matchAttribute:bi,matchContentEditableState:Ci,matches:en,getEditableRoot:Ae,isEditableRoot:Y,isContentEditable:rn,getContentEditable:ze,getContentEditableParent:an,isControlSizing:on,isNode:Se,isText:z,isElement:K,isBookmarkNode:Le,isCData:yi,isPi:wi,isComment:ki,isDocument:xi,isDocumentFragment:$i,isSVGElement:Ne,isHTMLElement:zt,isRestrictedNode:Si,isVoid:Xi,isTag:sn,isPara:at,isWhiteSpace:nn,findPara:Wn,isPurePara:Wi,isParaNoBlockquote:gt,isHeading:qi,isInline:it,isInlineOrText:k.or(it,z),isBlock:Ki,isBodyInline:Zi,isBodyInlineNoBlockQuote:Yi,isBody:Ni,isParaInline:Gi,isParaInlineNoBlockQuote:Qi,isPre:Ei,isList:He,isTable:Ti,isData:Hi,isHr:Ri,isListItem:Li,isDetails:Ai,isSummary:zi,isCell:Re,isCellOrRow:Vi,isCellOrCaption:_i,isMedia:ji,isBlockquote:Mt,isBodyContainer:Ji,isAnchor:Ee,isDiv:Pi,isLi:Pt,isBR:Di,isSpan:Mi,isB:Bi,isU:Ii,isImg:Oi,isFigure:Fi,isTextarea:Te,isTextareaOrInput:Ui,isEmpty:It,isEmptyAnchor:tn,isClosestSibling:kn,deepestChildIsEmpty:wn,withClosestSiblings:Fn,nodeLength:mt,isLeftEdgeOf:$n,isRightEdgeOf:Sn,select:Mn,closest:J,ancestor:J,closestSingleParent:Bn,parents:vt,ancestors:vt,parentsWhile:In,farthestParent:Dn,commonParent:On,prevSiblings:Un,nextSiblings:Vn,children:_n,isChildOf:xn,wrap:Kn,unwrap:Gn,insertAfter:Zn,insertBefore:De,append:Ct,prepend:Qn,appendChildNodes:Yn,position:bt,hasChildren:Nn,skipEmptyTextNodes:Tn,makeOffsetPath:jn,fromOffsetPath:qn,getRangeNode:En,getNextTextNode:Ie,create:lt,createText:ln,createFragment:cn,remove:Oe,removeWhile:Jn,clone:Xn,rename:tr,replace:Fe,value:Hn,outerHtml:Rn,posFromPlaceholder:Ln,attachEvents:An,detachEvents:zn,isCustomStyleTag:Pn,setAttr:Pe,setAttrs:hn,removeAllAttrs:un,getAttr:dn,getStyle:pn,setStyle:fn,setStyles:gn,hasClass:mn,addClass:bn,removeClass:vn,toggleClass:Cn,parseStyle:yn};class er{constructor(t,e){this.$note=t,this.memos={},this.modules={},this.layoutInfo={},this.options=$.extend(!0,{},e),$.summernote.ui=$.summernote.ui_template(this.options),this.ui=$.summernote.ui,this.initialize()}initialize(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}destroy(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}reset(){const t=this.isDisabled();this.code(l.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}_initialize(){this.options.id=k.uniqueId($.now()),this.options.container=this.options.container||this.layoutInfo.editor;const t=$.extend({},this.options.buttons);Object.keys(t).forEach(i=>{this.memo("button."+i,t[i])});const e=$.extend({},this.options.modules,$.summernote.plugins||{});Object.keys(e).forEach(i=>{this.module(i,e[i],!0)}),Object.keys(this.modules).forEach(i=>{this.initializeModule(i)})}_destroy(){Object.keys(this.modules).reverse().forEach(t=>{this.removeModule(t)}),Object.keys(this.memos).forEach(t=>{this.removeMemo(t)}),this.triggerEvent("destroy",this)}code(t){const e=this.invoke("codeview.isActivated");if(t===void 0)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.invoke("codeview.sync",t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",this.layoutInfo.editable)}isDisabled(){return this.layoutInfo.editable.attr("contenteditable")==="false"}enable(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}disable(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}triggerEvent(){const t=p.head(arguments),e=p.tail(p.from(arguments)),i=this.options.callbacks[q.namespaceToCamel(t,"on")];i&&i.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}initializeModule(t){const e=this.modules[t];e.shouldInitialize=e.shouldInitialize||k.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&l.attachEvents(this.$note,e.events))}module(t,e,i){if(arguments.length===1)return this.modules[t];this.modules[t]=new e(this),i||this.initializeModule(t)}removeModule(t){const e=this.modules[t];e.shouldInitialize()&&(e.events&&l.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}memo(t,e){if(arguments.length===1)return this.memos[t];this.memos[t]=e}removeMemo(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}createInvokeHandlerAndUpdateState(t,e){return i=>{this.createInvokeHandler(t,e)(i),this.invoke("buttons.updateCurrentStyle")}}createInvokeHandler(t,e){return i=>{i.preventDefault();const n=$(i.target);this.invoke(t,e||n.closest("[data-value]").data("value"),n)}}invoke(){const t=p.head(arguments),e=p.tail(p.from(arguments)),i=t.split("."),n=i.length>1&&i[0],r=i.length>2?i[1]:null,a=i.length>1?p.last(i):i[0];let c=this.modules[n||"editor"];if(!n&&this[a])return this[a].apply(this,e);if(c&&c[r||a]&&c.shouldInitialize())return r&&(c=E.isFunction(c[r])?c[r].apply(c):c[r]),c[a].apply(c,e)}}$.fn.extend({summernote:function(){const s=p.head(arguments),t=E.isNullOrUndefined()||E.isPlainObject(s);let e;t&&(e=$.extend({},$.summernote.options,s||{}),e.langInfo=$.extend(!0,{},$.summernote.lang["en-US"],$.summernote.lang[e.lang]),e.icons=$.extend(!0,{},$.summernote.options.icons,e.icons),e.tooltip=e.tooltip==="auto"?!L.isSupportTouch:e.tooltip),e&&this.each((n,r)=>{let a=$(r),c=a.data("summernote");c||(c=new er(a,e),a.data("summernote",c),c.triggerEvent("init",c.layoutInfo))});const i=this.first();if(i.length){const n=i.data("summernote");if(n){if(E.isString(s))return n.invoke.apply(n,p.from(arguments));e.focus&&n.invoke("editor.focus")}}return this}});const Ue='',Ve='',or={align:Ue,alignCenter:'',alignJustify:'',alignLeft:Ue,alignRight:'',floatLeft:'',floatRight:'',floatNone:Ve,flipV:'',flipH:'',rowBelow:'',colBefore:'',colAfter:'',rowAbove:'',rowRemove:'',colRemove:'',indent:'',outdent:'',arrowsAlt:'',bold:'',caret:"fa fa-caret-down",circle:'',close:'',code:'',inlineCode:'',eraser:'',paintbrush:"fa fa-paintbrush",font:'',frame:'',italic:'',link:'',unlink:'',magic:'',paragraph:'',menuCheck:"fa fa-check",minus:'',orderedlist:'',pencil:'',picture:'',question:'',redo:'',square:"far fa-square",strikethrough:'',subscript:'',superscript:'',table:'',textHeight:'',trash:'',underline:'',undo:'',rollback:Ve,unorderedlist:'',video:'',css:'',ellipsis:'',spellCheck:'',gear:'',fill:'',face:'',omega:'',layout:''},_e=" ",je="\uFEFF",sr="­",X={UNKNOWN:-1,SPACE:0,PUNC:1,CHAR:2},qe=s=>{!l.isVoid(s)&&!l.nodeLength(s)&&(s.innerHTML=l.blank)},yt=s=>s.offset===0,ct=s=>s.offset===l.nodeLength(s.node),We=s=>yt(s)||ct(s),Ke=(s,t)=>yt(s)&&l.isLeftEdgeOf(s.node,t),Ge=(s,t)=>ct(s)&&l.isRightEdgeOf(s.node,t),ir=s=>({node:s.parentNode,offset:l.position(s)}),nr=s=>({node:s.parentNode,offset:l.position(s)+1}),Dt=(s,t)=>{let e,i;if(s.offset===0){if(l.isEditableRoot(s.node))return null;e=s.node.parentNode,i=l.position(s.node)}else l.hasChildren(s.node)?(e=s.node.childNodes[s.offset-1],i=l.nodeLength(e)):(e=s.node,i=t?0:s.offset-1);return{node:e,offset:i}},Ot=(s,t)=>{let e,i;if(s.offset===l.nodeLength(s.node)){if(l.isEditableRoot(s.node))return null;let n=l.getNextTextNode(s.node);n?(e=n,i=0):(e=s.node.parentNode,i=l.position(s.node)+1)}else l.hasChildren(s.node)?(e=s.node.childNodes[s.offset],i=0):(e=s.node,i=t?l.nodeLength(s.node):s.offset+1);return{node:e,offset:i}},Qe=(s,t)=>{let e,i=0;if(s.offset===l.nodeLength(s.node)){if(l.isEditableRoot(s.node))return null;e=s.node.parentNode,i=l.position(s.node)+1,l.isEditableRoot(e)&&(e=s.node.nextSibling,i=0)}else l.hasChildren(s.node)?(e=s.node.childNodes[s.offset],i=0):(e=s.node,i=t?l.nodeLength(s.node):s.offset+1);return{node:e,offset:i}},Ze=(s,t,e)=>{for(;s;){if(t(s))return s;s=e?Ot(s):Dt(s)}return null},Ye=(s,t,e)=>{let i=s;for(;s;){if(!t(s))return i;i=s,s=e?Ot(s):Dt(s)}return null},rr=(s,t)=>Ze(s,t,!1),ar=(s,t)=>Ze(s,t,!0),lr=(s,t)=>Ye(s,t,!1),cr=(s,t)=>Ye(s,t,!0),dr=(s,t,e,i)=>{let n=s;for(;n&&n.node&&(e(n),!Xe(n,t));){const r=i&&s.node!==n.node&&t.node!==n.node;n=Qe(n,r)}},hr=(s,t)=>{const e=s.node,i=s.offset,n=t.node,r=t.offset;let a,c,d,h,u;if(e==n)return i===r?0:i{let e=t&&t.skipPaddingBlankHTML;const i=t&&t.skipEdgePoint,n=t&&t.discardEmptySplits;if(n&&(e=!0),We(s)&&(l.isText(s.node)||i)){if(yt(s))return s.node;if(ct(s))return s.node.nextSibling}if(l.isText(s.node))return s.node.splitText(s.offset);{const r=s.node.childNodes[s.offset];let a=l.nextSiblings(r);const c=l.insertAfter(s.node,s.node.cloneNode(!1));return l.appendChildNodes(c,a),e||(qe(s.node),qe(c)),n&&(l.isEmpty(s.node)&&l.remove(s.node),l.isEmpty(c))?(l.remove(c),s.node.nextSibling):c}},Je=(s,t,e)=>{const i=l.matchSelector(s);let n=l.parents(t.node,i);if(n.length){if(n.length===1)return Ft(t,e)}else return null;if(n.length>2){let a=n.slice(0,n.length-1).find(c=>c.nextSibling);if(a&&t.offset!=0&&ct(t)){let c=a.nextSibling,d;l.isElement(c)?(d=c.childNodes[0],n=l.parents(d,i),t={node:d,offset:0}):l.isText(c)&&!c.data.match(/[\n\r]/g)&&(d=c,n=l.parents(d,i),t={node:d,offset:0})}}return n.reduce((r,a)=>(r===t.node&&(r=Ft(t,e)),Ft({node:a,offset:r?l.position(r):l.nodeLength(a)},e)))},ur=(s,t)=>{const e=t?l.isPara:l.isBodyContainer,i=l.parents(s.node,e),n=p.last(i)||s.node;let r,a;e(n)?(r=i[i.length-2],a=n):(r=n,a=r.parentNode);let c=r&&Je(r,s,{skipPaddingBlankHTML:t,skipEdgePoint:t});return!c&&a===s.node&&(c=s.node.childNodes[s.offset]),{rightNode:c,container:a}},Xe=(s,t)=>s.node===t.node&&s.offset===t.offset,pr=s=>{if(l.isText(s.node)||!l.hasChildren(s.node)||l.isEmpty(s.node))return!0;const t=s.node.childNodes[s.offset-1],e=s.node.childNodes[s.offset];return!!((!t||l.isVoid(t))&&(!e||l.isVoid(e))||l.isTable(e))},Ut=s=>{if(!l.isText(s.node))return X.UNKNOWN;const t=s.node.nodeValue.charAt(s.offset-1);return t?t===_e||` \f -\r \v`.indexOf(t)!==-1?X.SPACE:t==="_"?X.CHAR:new RegExp("^\\p{P}$","u").test(t)?X.PUNC:X.CHAR:X.UNKNOWN},to=s=>Ut(s)==X.CHAR,eo=s=>Ut(s)==X.SPACE,v={NBSP_CHAR:_e,ZERO_WIDTH_NBSP_CHAR:je,SOFT_HYPHEN:sr,CharTypes:X,isLeftEdgePoint:yt,isRightEdgePoint:ct,isEdgePoint:We,isLeftEdgePointOf:Ke,isRightEdgePointOf:Ge,isLeftEdgePointOf:Ke,isRightEdgePointOf:Ge,prevPoint:Dt,nextPoint:Ot,pointBeforeNode:ir,pointAfterNode:nr,nextPointWithEmptyNode:Qe,comparePoints:hr,equals:Xe,isVisiblePoint:pr,prevPointUntil:rr,nextPointUntil:ar,prevPointWhile:lr,nextPointWhile:cr,isCharPoint:to,isSpacePoint:eo,walkPoint:dr,splitTree:Je,splitPoint:ur,getCharType:Ut,isCharPoint:to,isSpacePoint:eo,isZwsp:s=>s===je,removeZwsp:s=>s.replace(/\uFEFF/g,"")},dt=(s,t)=>{const e=l.matchSelector(s);return function(){const i=l.closest(this.sc,e,!0,t);return!!i&&i===l.closest(this.ec,e,!0,t)}},oo=s=>s===!0?t=>[-1,0,1].indexOf(v.getCharType(t))>-1:t=>[-1,0].indexOf(v.getCharType(t))>-1,fr=s=>{try{s.detach()}catch{}},G=(s,t)=>{let e=!1;s.isWrapper&&(s=Vt(s),e=!0);const i=t(s);return e&&fr(s),i},Vt=s=>{if(s.isWrapper){const{sc:t,so:e,ec:i,eo:n}=s;s=document.createRange(),s.setStart(t,e),s.setEnd(i,n)}return s},gr=s=>s.isWrapper?s:_t(s),mr=(s,t)=>l.isChildOf(s.startContainer,t,!0)&&(s.endContainer==s.startContainer||l.isChildOf(s.endContainer,t,!0)),br=dt(l.isEditableRoot,"div.note-editing-area"),vr=dt(l.isList),Cr=dt(l.isAnchor),yr=dt(l.isCell),wr=dt(l.isData),_t=s=>{const t=s;return new P(t.startContainer,t.startOffset,t.endContainer,t.endOffset)};function jt(s,t,e,i){const n=arguments.length;if(n===2||n===4)return n===2&&(e=s,i=t),new P(s,t,e,i);let r=so();if(!r&&n===1){let a=arguments[0];return l.isEditableRoot(s)&&(a=a.lastChild),io(a,l.emptyPara===arguments[0].innerHTML)}return r}const qt=(s,t)=>t?new P(s.node,s.offset,t.node,t.offset):new P(s.node,s.offset),so=()=>{const s=window.getSelection?window.getSelection():window.document.selection;return!s||s.rangeCount===0||l.isBody(s.anchorNode)?null:_t(s.getRangeAt(0))},io=(s,t=!1)=>{var e=wt(s);return e.collapse(t)},wt=s=>{let t=s,e=0,i=s,n=l.nodeLength(i);return l.isVoid(t)&&(e=l.prevSiblings(t).length-1,t=t.parentNode),l.isBR(i)?(n=l.prevSiblings(i).length-1,i=i.parentNode):l.isVoid(i)&&(n=l.prevSiblings(i).length,i=i.parentNode),new P(t,e,i,n)},no=s=>wt(s).collapse(!0),ro=s=>wt(s).collapse(!1),kr=s=>{const e=no(p.head(s)).getStartPoint(),n=ro(p.last(s)).getEndPoint();return jt(e.node,e.offset,n.node,n.offset)},xr=(s,t)=>{const e=l.fromOffsetPath(s,t.s.path),i=t.s.offset,n=l.fromOffsetPath(s,t.e.path),r=t.e.offset;return new P(e,i,n,r)},$r=(s,t)=>{const e=s.s.offset,i=s.e.offset,n=l.fromOffsetPath(p.head(t),s.s.path),r=l.fromOffsetPath(p.last(t),s.e.path);return new P(n,e,r,i)};class P{constructor(t,e,i,n){this.isWrapper=!0,this.startContainer=t,this.startOffset=e,this.endContainer=i,this.endOffset=n,this.collapsed=t===i&&e===n,this.isOnEditable=br,this.isOnList=vr,this.isOnAnchor=Cr,this.isOnCell=yr,this.isOnData=wr}updateStart(t,e){t!=this.startContainer&&(this._commonParent=void 0),this.startContainer=t,this.startOffset=e,this.collapsed=t===this.endContainer&&e===this.endOffset}updateEnd(t,e){t!=this.endContainer&&(this._commonParent=void 0),this.endContainer=t,this.endOffset=e,this.collapsed=t===this.startContainer&&e===this.startOffset}getNativeRange(){return Vt(this)}equals(t){if(t==this)return!0;if(t instanceof P||t instanceof Range){const{startContainer:e,startOffset:i,endContainer:n,endOffset:r}=t;return this.startContainer===e&&this.startOffset===i&&this.endContainer===n&&this.endOffset===r}return!1}startEquals(t){return t==this?!0:t instanceof P||t instanceof Range?this.startContainer===t.startContainer&&this.startOffset===t.startOffset:!1}endEquals(t){return t==this?!0:t instanceof P||t instanceof Range?this.endContainer===t.endContainer&&this.endOffset===t.endOffset:!1}get sc(){return this.startContainer}get so(){return this.startOffset}set so(t){return this.updateStart(this.startContainer,t)}get ec(){return this.endContainer}get eo(){return this.endOffset}set eo(t){return this.updateEnd(this.endContainer,t)}isCollapsed(){return this.collapsed}get commonAncestorContainer(){return this._commonParent||(this._commonParent=this.collapsed?this.startContainer:l.commonParent(this.startContainer,this.endContainer)),this._commonParent}cloneContents(){return G(this,t=>t.cloneContents())}cloneRange(){return new P(this.startContainer,this.startOffset,this.endContainer,this.endOffset)}collapse(t){const e=t?this.startContainer:this.endContainer,i=t?this.startOffset:this.endOffset;return this.updateStart(e,i),this.updateEnd(e,i),this}compareBoundaryPoints(t,e){var i,n,r,a,c=t==Range.END_TO_START||t==Range.START_TO_START?"start":"end",d=t==Range.START_TO_END||t==Range.START_TO_START?"start":"end";return i=this[c+"Container"],n=this[c+"Offset"],r=e[d+"Container"],a=e[d+"Offset"],v.comparePoints({node:i,offset:n},{node:r,offset:a})}compareNode(t){return G(this,e=>e.compareNode(t))}comparePoint(t,e){return G(this,i=>i.comparePoint(t,e))}createContextualFragment(t){return G(this,e=>e.createContextualFragment(t))}deleteContents(){if(this.collapsed)return this;const t=this.splitText(),e=t.nodes(null,{fullyContains:!0}),i=v.prevPointUntil(t.getStartPoint(),r=>!p.contains(e,r.node)),n=[];return p.each(e,r=>{const a=r.parentNode;i.node!==a&&l.nodeLength(a)===1&&n.push(a),l.remove(r,!1)}),p.each(n,r=>{l.remove(r,!1)}),new P(i.node,i.offset,i.node,i.offset).normalize()}detach(){return this}extractContents(){return G(this,t=>t.extractContents())}getBoundingClientRect(){return G(this,t=>t.getBoundingClientRect())}getClientRects(){return G(this,t=>t.getClientRects())}insertNode(t,e=!1){let i=this;l.isInlineOrText(t)&&(i=this.wrapBodyInlineWithPara().deleteContents());const n=v.splitPoint(i.getStartPoint(),!l.isBlock(t));return n.rightNode?(n.rightNode.parentNode.insertBefore(t,n.rightNode),l.isEmpty(n.rightNode)&&(e||l.isPara(t))&&n.rightNode.parentNode.removeChild(n.rightNode)):n.container&&n.container.appendChild(t),t}intersectsNode(t){return G(this,e=>e.intersectsNode(t))}isPointInRange(t,e){return G(this,i=>i.isPointInRange(t,e))}selectNode(t){const e=v.pointBeforeNode(t),i=v.pointAfterNode(t);return this.updateStart(e.node,e.offset),this.updateEnd(i.node,i.offset),this}selectNodeContents(t){return this.updateStart(t,0),this.updateEnd(t,l.nodeLength(t)),this}setEnd(t,e){return this.updateEnd(t,e),this}setEndAfter(t){const e=v.pointAfterNode(t);return this.updateEnd(e.node,e.offset),this}setEndBefore(t){const e=v.pointBeforeNode(t);return this.updateEnd(e.node,e.offset),this}setStart(t,e){return this.updateStart(t,e),this}setStartAfter(t){const e=v.pointAfterNode(t);return this.updateStart(e.node,e.offset),this}setStartBefore(t){const e=v.pointBeforeNode(t);return this.updateStart(e.node,e.offset),this}surroundContents(t){return G(this,e=>{e.surroundContents(t),this.updateStart(e.startContainer,e.startOffset),this.updateEnd(e.endContainer,e.endOffset)}),this}toString(){return G(this,t=>t.toString())}getPoints(){return{sc:this.startContainer,so:this.startOffset,ec:this.endContainer,eo:this.endOffset}}getStartPoint(){return{node:this.startContainer,offset:this.startOffset}}getEndPoint(){return{node:this.endContainer,offset:this.endOffset}}walk(t,e){const i=this.startOffset,n=e?l.getRangeNode(this.startContainer,i):this.startContainer,r=this.endOffset,a=e?l.getRangeNode(this.endContainer,r-1):this.endContainer,c=w=>{let m=w[0];l.isText(m)&&m===n&&i>=m.data.length&&w.splice(0,1);let b=w[w.length-1];return r===0&&w.length>0&&b===a&&l.isText(b)&&w.splice(w.length-1,1),w=p.reject(w,S=>l.isWhiteSpace(S)&&(l.isElement(S.previousSibling)||l.isElement(S.nextSibling))),w},d=(w,m="nextSibling"|"previousSibling",b)=>{const S=[];for(;w&&w!==b;w=w[m])S.push(w);return S},h=(w,m)=>l.closest(w,b=>b.parentNode===m),u=w=>{w&&w.length&&t(w)},f=(w,m,b)=>{const S=b?"nextSibling":"previousSibling";for(let N=w,j=N.parentNode;N&&N!==m;N=j){j=N.parentNode;const I=d(N===w?N:N[S],S);I.length&&(b||I.reverse(),u(c(I)))}};if(n===a)return u(c([n]));const g=l.commonParent(n,a)||l.getEditableRoot(n);if(l.isChildOf(n,a))return f(n,g,!0);if(l.isChildOf(a,n))return f(a,g);const C=h(n,g)||n,H=h(a,g)||a;f(n,C,!0);const B=d(C===n?C:C.nextSibling,"nextSibling",H===a?H.nextSibling:H);B.length&&u(c(B)),f(a,H)}scrollIntoView(t){const e=$(t).height();return t.scrollTop+e{if(l.isEditableRoot(u.node))return;let f;r?(v.isLeftEdgePoint(u)&&h.push(u.node),v.isRightEdgePoint(u)&&p.contains(h,u.node)&&(f=u.node)):n?f=l.closest(u.node,i):f=u.node,f&&i(f)&&d.push(f)},!0),p.unique(d)}expand(t){const e=l.matchSelector(t),i=l.closest(this.startContainer,e),n=l.closest(this.endContainer,e);if(!i&&!n)return this;const r=this.getPoints();return i&&(r.sc=i,r.so=0),n&&(r.ec=n,r.eo=l.nodeLength(n)),this.setStart(r.sc,r.so),this.setEnd(r.ec,r.eo),this}splitText(){const t=this.sc===this.ec,e=this.getPoints();return l.isText(this.ec)&&!v.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),l.isText(this.sc)&&!v.isEdgePoint(this.getStartPoint())&&(e.sc=this.sc.splitText(this.so),e.so=0,t&&(e.ec=e.sc,e.eo=this.eo-this.so)),this.setStart(e.sc,e.so),this.setEnd(e.ec,e.eo),this}isLeftEdgeOf(t){if(!v.isLeftEdgePoint(this.getStartPoint()))return!1;const e=l.closest(this.sc,t);return e&&l.isLeftEdgeOf(this.sc,e)}isSingleContainer(){return this.startContainer===this.endContainer}wrapBodyInlineWithPara(){if(l.isBodyContainer(this.sc)&&l.isEmpty(this.sc))return this.sc.innerHTML=l.emptyPara,jt(this.sc.firstChild,0,this.sc.firstChild,0);const t=this.normalize();if(l.isParaInlineNoBlockQuote(this.sc)||l.isParaNoBlockquote(this.sc))return t;let e;if(l.isBlock(t.sc))e=t.sc.childNodes[t.so>0?t.so-1:0];else{const i=l.parents(t.sc,l.isBlock);e=p.last(i),l.isBlock(e)&&(e=i[i.length-2]||t.sc.childNodes[t.so])}if(e){let i=l.prevSiblings(e,l.isParaInlineNoBlockQuote).reverse();if(i=i.concat(l.nextSiblings(e.nextSibling,l.isParaInlineNoBlockQuote)),i.length){const n=l.wrap(p.head(i),"p");l.appendChildNodes(n,p.tail(i))}}return this.normalize()}pasteHTML(t){t=((t||"")+"").trim(t);const e=l.create("div",null,t);let i=p.from(e.childNodes);const n=this;let r=!1;return n.so>=0&&(i=i.reverse(),r=!0),i=i.map(function(a){return n.insertNode(a,!l.isInline(a))}),r&&(i=i.reverse()),i}findWordEndpoint(t,e,i){const n=t?this.getStartPoint():this.getEndPoint(),r=oo(e);if(r(n))return n;let a=t?v.prevPointUntil(n,r):v.nextPointUntil(n,r);if(!t&&i&&!v.equals(n,a)){const c=v.getCharType(a);(c<1||!e||c===1)&&(a=v.prevPoint(a))}return a}getWordRange(t){const e=E.isBoolean(t)?t:(t==null?void 0:t.forward)===!0,i=(t==null?void 0:t.trim)===!0,n=(t==null?void 0:t.stopAtPunc)===!0,r=oo(n);let a=this.getEndPoint();if(r(a))return this;const c=this.findWordEndpoint(!0,n,i);return e&&(a=this.findWordEndpoint(!1,n,i)),new P(c.node,c.offset,a.node,a.offset)}getWordsRange(t){var e=this.getEndPoint();const i=r=>v.getCharType(r)===-1;if(i(e))return this;const n=v.prevPointUntil(e,i);return t&&(e=v.nextPointUntil(e,i)),new P(n.node,n.offset,e.node,e.offset)}getWordsMatchRange(t){const e=this.getEndPoint(),i=v.prevPointUntil(e,c=>{if(v.getCharType(c)===-1)return!0;const d=qt(c,e),h=t.exec(d.toString());return h&&h.index===0}),n=qt(i,e),r=n.toString(),a=t.exec(r);return a&&a[0].length===r.length?n:null}createBookmark(t){return{s:{path:l.makeOffsetPath(t,this.sc),offset:this.so},e:{path:l.makeOffsetPath(t,this.ec),offset:this.eo}}}createParaBookmark(t){return{s:{path:p.tail(l.makeOffsetPath(p.head(t),this.sc)),offset:this.so},e:{path:p.tail(l.makeOffsetPath(p.last(t),this.ec)),offset:this.eo}}}}const x={create:jt,createFromBodyElement:io,createFromSelection:so,createFromNode:wt,createFromNodeBefore:no,createFromNodeAfter:ro,createFromNodes:kr,createFromBookmark:xr,createFromParaBookmark:$r,createFromNativeRange:_t,createFromPoints:qt,getWrappedRange:gr,getNativeRange:Vt,isFullyContainedInNode:mr},A={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},T={isEdit:s=>p.contains([A.BACKSPACE,A.TAB,A.ENTER,A.SPACE,A.DELETE],s),isRemove:s=>p.contains([A.BACKSPACE,A.DELETE],s),isMove:s=>p.contains([A.LEFT,A.UP,A.RIGHT,A.DOWN],s),isNavigation:s=>p.contains([A.HOME,A.END,A.PAGEUP,A.PAGEDOWN],s),nameFromCode:W.invert(A),code:A};function Sr(s){return $.Deferred(t=>{$.extend(new FileReader,{onload:e=>{const i=e.target.result;t.resolve(i)},onerror:e=>{t.reject(e)}}).readAsDataURL(s)}).promise()}function Nr(s){return $.Deferred(t=>{const e=$("");e.one("load",()=>{e.off("error abort"),t.resolve(e)}).one("error abort",()=>{e.off("load").detach(),t.reject(e)}).css({display:"none"}).appendTo(document.body).attr("src",s)}).promise()}class Er{constructor(t){this.stack=[],this.stackOffset=-1,this.context=t,this.$editable=t.layoutInfo.editable,this.editable=this.$editable[0]}get editor(){return this.context.modules.editor}makeSnapshot(){const t=x.create(this.editable),e={s:{path:[],offset:0},e:{path:[],offset:0}};return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.createBookmark(this.editable):e}}applySnapshot(t){t.contents!==null&&this.$editable.html(t.contents),t.bookmark!==null&&this.editor.selection.moveToBookmark(t.bookmark)}rewind(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}commit(){this.stack=[],this.stackOffset=-1,this.recordUndo()}reset(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}canUndo(){return this.stackOffset>0}undo(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset>0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}canRedo(){return this.stack.length-1>this.stackOffset}redo(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}recordUndo(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}class Tr{jQueryCSS(t,e){const i={};return $.each(e,(n,r)=>{i[r]=t.css(r)}),i}fromNode(t){const e=["font-family","font-size","text-align","list-style-type","line-height"],i=this.jQueryCSS(t,e)||{},n=t[0].style.fontSize||i["font-size"];return i["font-size"]=parseInt(n,10),i["font-size-unit"]=n.match(/[a-z%]+$/),i}stylePara(t,e){p.each(t.nodes(l.isPara,{includeAncestor:!0}),i=>{$(i).css(e)})}styleNodes(t,e){t=t.splitText();const i=e&&e.nodeName||"SPAN",n=!!(e&&e.expandClosestSibling),r=!!(e&&e.onlyPartialContains);if(t.collapsed)return[t.insertNode(l.create(i))];let a=l.matchNodeNames(i);const c=t.nodes(l.isText,{fullyContains:!0}).map(d=>l.closestSingleParent(d,a)||l.wrap(d,i));if(n){if(r){const d=t.nodes();a=k.and(a,h=>p.contains(d,h))}return c.map(d=>{const h=l.withClosestSiblings(d,a),u=p.head(h),f=p.tail(h);return $.each(f,(g,C)=>{l.appendChildNodes(u,C.childNodes),l.remove(C)}),p.head(h)})}else return c}current(t){const e=$(l.isElement(t.sc)?t.sc:t.sc.parentNode);let i=this.fromNode(e);try{i=$.extend(i,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||i["font-family"]})}catch{}if(!t.isOnList())i["list-style"]="none";else{const a=["circle","disc","disc-leading-zero","square"].indexOf(i["list-style-type"])>-1;i["list-style"]=a?"unordered":"ordered"}const n=l.ancestor(t.sc,l.isPara);if(n&&n.style["line-height"])i["line-height"]=n.style.lineHeight;else{const r=parseInt(i["line-height"],10)/parseInt(i["font-size"],10);i["line-height"]=r.toFixed(1)}return i.anchor=t.isOnAnchor()&&l.ancestor(t.sc,l.isAnchor),i.ancestors=l.parents(t.sc),i.range=t,i}}class ao{constructor(t){this.context=t}get selection(){return this.context.modules.editor.selection}insertOrderedList(t){this.toggleList("OL",t)}insertUnorderedList(t){this.toggleList("UL",t)}indent(t){t=t||this.selection.getRange(),t=t.wrapBodyInlineWithPara();const e=t.nodes(l.isParaNoBlockquote,{includeAncestor:!0}),i=p.clusterBy(e,"parentNode");p.each(i,n=>{const r=p.head(n);if(l.isLi(r)){const a=this.findList(r.previousSibling);a?n.map(c=>a.appendChild(c)):(this.wrapList(n,r.parentNode.nodeName),n.map(c=>c.parentNode).map(c=>this.appendToPrevious(c)))}else p.each(n,a=>{$(a).css("marginLeft",(c,d)=>(parseInt(d,10)||0)+25)})}),this.selection.setRange(t)}outdent(t){t=t||this.selection.getRange(),t=t.wrapBodyInlineWithPara();const e=t.nodes(l.isParaNoBlockquote,{includeAncestor:!0}),i=p.clusterBy(e,"parentNode");p.each(i,n=>{const r=p.head(n);l.isLi(r)?this.releaseList([n]):p.each(n,a=>{$(a).css("marginLeft",(c,d)=>(d=parseInt(d,10)||0,d>25?d-25:""))})}),this.selection.setRange(t)}toggleList(t,e){e=e||this.selection.getRange(),e=e.wrapBodyInlineWithPara();let i=e.nodes(l.isParaNoBlockquote,{includeAncestor:!0});const n=e.createParaBookmark(i),r=p.clusterBy(i,"parentNode");if(p.find(i,l.isPurePara)){let a=[];p.each(r,c=>{a=a.concat(this.wrapList(c,t))}),i=a}else{const a=e.nodes(l.isList,{includeAncestor:!0}).filter(c=>!$.nodeName(c,t));a.length?p.each(a,c=>{l.rename(c,t)}):i=this.releaseList(r,!0)}e=x.createFromParaBookmark(n,i),this.selection.setRange(e)}wrapList(t,e){const i=p.head(t),n=p.last(t),r=l.isList(i.previousSibling)&&i.previousSibling,a=l.isList(n.nextSibling)&&n.nextSibling,c=r||l.insertAfter(n,l.create(e||"UL"));return t=t.map(d=>l.isPurePara(d)?l.rename(d,"LI"):d),l.appendChildNodes(c,t,!0),a&&(l.appendChildNodes(c,p.from(a.childNodes),!0),l.remove(a)),t}releaseList(t,e){let i=[];return p.each(t,n=>{const r=p.head(n),a=p.last(n),c=e?l.farthestParent(r,l.isList):r.parentNode,d=c.parentNode;if(c.parentNode.nodeName==="LI")n.map(h=>{const u=this.findNextSiblings(h);d.nextSibling?d.parentNode.insertBefore(h,d.nextSibling):d.parentNode.appendChild(h),u.length&&(this.wrapList(u,c.nodeName),h.appendChild(u[0].parentNode))}),c.children.length===0&&d.removeChild(c),d.childNodes.length===0&&d.parentNode.removeChild(d);else{const h=c.childNodes.length>1?v.splitTree(c,{node:a.parentNode,offset:l.position(a)+1},{skipPaddingBlankHTML:!0}):null,u=v.splitTree(c,{node:r.parentNode,offset:l.position(r)},{skipPaddingBlankHTML:!0});n=e?l.children(u,l.isLi):p.from(u.childNodes).filter(l.isLi),(e||!l.isList(c.parentNode))&&(n=n.map(g=>l.rename(g,"P"))),p.each(p.from(n).reverse(),g=>{l.insertAfter(c,g)});const f=p.compact([c,u,h]);p.each(f,g=>{const C=[g].concat(l.children(g,l.isList));p.each(C.reverse(),H=>{l.nodeLength(H)||l.remove(H,!0)})})}i=i.concat(n)}),i}appendToPrevious(t){return t.previousSibling?l.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}findList(t){return t?p.find(t.children,e=>["OL","UL"].indexOf(e.nodeName)>-1):null}findNextSiblings(t){const e=[];for(;t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}class Hr{constructor(t){this.context=t,this.options=t.options,this.bullet=new ao(t)}get selection(){return this.context.modules.editor.selection}insertTab(t,e){const i=l.createText(new Array(e+1).join(v.NBSP_CHAR));t=t.deleteContents(),t.insertNode(i,!0),t=x.create(i,e),this.selection.setRange(t)}insertParagraph(t){t=t||this.selection.getRange(),t=t.deleteContents(),t=t.wrapBodyInlineWithPara();const e=l.closest(t.sc,l.isParaNoBlockquote);let i;if(e)if(l.isLi(e)&&(l.isEmpty(e)||l.deepestChildIsEmpty(e))){this.bullet.toggleList(e.parentNode.nodeName);return}else{let n=null;if(this.options.blockquoteBreakingLevel===1?n=l.closest(e,l.isBlockquote):this.options.blockquoteBreakingLevel===2&&(n=l.farthestParent(e,l.isBlockquote)),n){i=$(l.emptyPara)[0],v.isRightEdgePoint(t.getStartPoint())&&l.isBR(t.sc.nextSibling)&&$(t.sc.nextSibling).remove();const r=v.splitTree(n,t.getStartPoint(),{discardEmptySplits:!0});r?r.parentNode.insertBefore(i,r):l.insertAfter(n,i)}else{i=v.splitTree(e,t.getStartPoint());let r=l.children(e,l.isEmptyAnchor);r=r.concat(l.children(i,l.isEmptyAnchor)),p.each(r,a=>{l.remove(a)}),(l.isHeading(i)||l.isPre(i)||l.isCustomStyleTag(i))&&l.isEmpty(i)&&(i=l.rename(i,"p"))}}else{const n=t.sc.childNodes[t.so];i=$(l.emptyPara)[0],n?t.sc.insertBefore(i,n):t.sc.appendChild(i)}this.selection.setRange(x.create(i,0).normalize()).scrollIntoView()}}const y=function(s,t,e,i){const n={colPos:0,rowPos:0},r=[],a=[];function c(){!s||!s.tagName||s.tagName.toLowerCase()!=="td"&&s.tagName.toLowerCase()!=="th"||(n.colPos=s.cellIndex,!(!s.parentElement||!s.parentElement.tagName||s.parentElement.tagName.toLowerCase()!=="tr")&&(n.rowPos=s.parentElement.rowIndex))}function d(m,b,S,N,j,I,tt){const Q={baseRow:S,baseCell:N,isRowSpan:j,isColSpan:I,isVirtual:tt};r[m]||(r[m]=[]),r[m][b]=Q}function h(m,b,S,N){return{baseCell:m.baseCell,action:b,virtualTable:{rowIndex:S,cellIndex:N}}}function u(m,b){if(!r[m]||!r[m][b])return b;let S=b;for(;r[m][S];)if(S++,!r[m][S])return S}function f(m,b){const S=u(m.rowIndex,b.cellIndex),N=b.colSpan>1,j=b.rowSpan>1,I=m.rowIndex===n.rowPos&&b.cellIndex===n.colPos;d(m.rowIndex,S,m,b,j,N,!1);const tt=b.attributes.rowSpan?parseInt(b.attributes.rowSpan.value,10):0;if(tt>1)for(let U=1;U1)for(let U=1;U=S.cellIndex&&S.cellIndex<=b&&!N&&n.colPos++}function C(){const m=i.rows;for(let b=0;b=0?m:S,I=b>=0?b:S,tt=r[j];if(!tt)return N=!1,a;const Q=tt[I];if(!Q)return N=!1,a;let U=y.resultAction.Ignore;switch(e){case y.requestAction.Add:U=B(Q);break;case y.requestAction.Delete:U=H(Q);break}a.push(h(Q,U,j,I)),S++}return a},w()};y.where={Row:0,Column:1},y.requestAction={Add:0,Delete:1},y.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};class Rr{constructor(t){this.context=t}get selection(){return this.context.modules.editor.selection}tab(t,e){const i=l.closest(t.commonAncestorContainer,l.isCell),n=l.closest(i,l.isTable),r=l.children(n,l.isCell),a=p[e?"prev":"next"](r,i);a&&this.selection.setRange(x.create(a,0))}addRow(t,e){const i=l.ancestor(t.commonAncestorContainer,l.isCell),n=$(i).closest("tr"),r=this.recoverAttributes(n),a=$(""),d=new y(i,y.where.Row,y.requestAction.Add,$(n).closest("table")[0]).getActionList();for(let h=0;h"+l.blank+"");break;case y.resultAction.SumSpanCount:{if(e==="top"&&(u.baseCell.parent?u.baseCell.closest("tr").rowIndex:0)<=n[0].rowIndex){const B=$("
").append($(""+l.blank+"").removeAttr("rowspan")).html();a.append(B);break}let g=parseInt(u.baseCell.rowSpan,10);g++,u.baseCell.setAttribute("rowSpan",g)}break}}if(e==="top")n.before(a);else{if(i.rowSpan>1){const u=n[0].rowIndex+(i.rowSpan-2);$($(n).parent().find("tr")[u]).after($(a));return}n.after(a)}}addCol(t,e){const i=l.ancestor(t.commonAncestorContainer,l.isCell),n=$(i).closest("tr");$(n).siblings().push(n);const c=new y(i,y.where.Column,y.requestAction.Add,$(n).closest("table")[0]).getActionList();for(let d=0;d"+l.blank+""):$(h.baseCell).before(""+l.blank+"");break;case y.resultAction.SumSpanCount:if(e==="right"){let f=parseInt(h.baseCell.colSpan,10);f++,h.baseCell.setAttribute("colSpan",f)}else $(h.baseCell).before(""+l.blank+"");break}}}recoverAttributes(t){let e="";if(!t)return e;const i=t.attributes||[];for(let n=0;n1;let g=f?parseInt(h.rowSpan,10):0;switch(c[d].action){case y.resultAction.Ignore:continue;case y.resultAction.AddCell:{const C=i.next("tr")[0];if(!C)continue;const H=i[0].cells[n];f&&(g>2?(g--,C.insertBefore(H,C.cells[n]),C.cells[n].setAttribute("rowSpan",g),C.cells[n].innerHTML=""):g===2&&(C.insertBefore(H,C.cells[n]),C.cells[n].removeAttribute("rowSpan"),C.cells[n].innerHTML=""))}continue;case y.resultAction.SubtractSpanCount:f&&(g>2?(g--,h.setAttribute("rowSpan",g),u.rowIndex!==r&&h.cellIndex===n&&(h.innerHTML="")):g===2&&(h.removeAttribute("rowSpan"),u.rowIndex!==r&&h.cellIndex===n&&(h.innerHTML="")));continue;case y.resultAction.RemoveCell:continue}}i.remove()}deleteCol(t){const e=l.ancestor(t.commonAncestorContainer,l.isCell),i=$(e).closest("tr"),n=i.children("td, th").index($(e)),a=new y(e,y.where.Column,y.requestAction.Delete,$(i).closest("table")[0]).getActionList();for(let c=0;c1){let u=d.colSpan?parseInt(d.colSpan,10):0;u>2?(u--,d.setAttribute("colSpan",u),d.cellIndex===n&&(d.innerHTML="")):u===2&&(d.removeAttribute("colSpan"),d.cellIndex===n&&(d.innerHTML=""))}}continue;case y.resultAction.RemoveCell:l.remove(a[c].baseCell,!0);continue}}createTable(t,e,i){const n=[];let r;for(let h=0;h"+l.blank+"");r=n.join("");const a=[];let c;for(let h=0;h"+r+"");c=a.join("");const d=$(""+c+"
");return i&&i.tableClassName&&d.addClass(i.tableClassName),d[0]}deleteTable(t){const e=l.ancestor(t.commonAncestorContainer,l.isCell);$(e).closest("table").remove()}}const Wt=s=>l.isText(s)&&s.data.length>0,lo=(s,t)=>{const e={"data-note-type":"bookmark",id:s,style:"overflow:hidden;line-height:0px"};return t?l.create("span",e,""):l.create("span",e)},Lr=(s,t,e)=>{let i=0;return p.each(l.select(s,t),n=>{if(n.getAttribute("data-note-bogus")!=="all"){if(n===e)return!1;i++;return}}),i},Kt=(s,t)=>{let e=t?s.startContainer:s.endContainer,i=t?s.startOffset:s.endOffset;if(l.isElement(e)&&e.nodeName==="TR"){const n=e.childNodes;e=n[Math.min(t?i:i-1,n.length-1)],e&&(i=t?0:e.childNodes.length,t?s.setStart(e,i):s.setEnd(e,i))}},co=s=>(Kt(s,!0),Kt(s,!1),s),ho=s=>(l.isElement(s)&&l.isBlock(s)&&!s.innerHTML&&(s.innerHTML='
'),s),uo=(s,t)=>{const e=document.getElementById(t.id+"_"+s),i=e==null?void 0:e.parentNode,n=t.keep;if(e&&i){let r,a;if(s==="start"?n?e.hasChildNodes()?(r=e.firstChild,a=1):Wt(e.nextSibling)?(r=e.nextSibling,a=0):Wt(e.previousSibling)?(r=e.previousSibling,a=e.previousSibling.data.length):(r=i,a=l.position(e)+1):(r=i,a=l.position(e)):n?e.hasChildNodes()?(r=e.firstChild,a=1):Wt(e.previousSibling)?(r=e.previousSibling,a=e.previousSibling.data.length):(r=i,a=l.position(e)):(r=i,a=l.position(e)),!n){const c=e.previousSibling,d=e.nextSibling;p.each(e.childNodes,u=>{l.isText(u)&&(u.data=u.data.replace(/\uFEFF/g,""))});let h;for(;h=document.getElementById(t.id+"_"+s);)l.remove(h,!1);if(l.isText(d)&&l.isText(c)){const u=c.data.length;c.appendData(d.data),l.remove(d,!0),r=c,a=u}}return{node:r,offset:a}}else return null},kt=s=>{l.isText(s)&&s.data.length===0&&l.remove(s,!0)},Ar=(s,t)=>{x.getNativeRange(s).insertNode(t),kt(t.previousSibling),kt(t.nextSibling)},zr=(s,t)=>{const e=t.firstChild,i=t.lastChild;x.getNativeRange(s).insertNode(t),kt(e==null?void 0:e.previousSibling),kt(i==null?void 0:i.nextSibling)},po=(s,t)=>{l.isDocumentFragment(t)?zr(s,t):Ar(s,t)},Gt={moveEndPoint:Kt,getPersistentBookmark:(s,t)=>{let e=s.getRange();const i=k.uniqueId("note_"),n=e.collapsed,r=s.getNode(),a=r.nodeName,c=s.isForward();if(a==="IMG")return{name:a,index:Lr(s.editor.editable,a,r)};const d=co(e.cloneRange());if(!n){d.collapse(!1);const u=lo(i+"_end",t);po(d,u)}e=co(e),e.collapse(!0);const h=lo(i+"_start",t);return po(e,h),s.moveToBookmark({id:i,keep:!0,forward:c}),{id:i,forward:c}},resolvePersistentBookmark:s=>{const t=uo("start",s),e=uo("end",s)||t;return t&&e?{range:x.create(ho(t.node),t.offset,ho(e.node),e.offset),forward:s.forward===!0}:null}};let xt=window;const $t=s=>{let t=x.create(s.editable);return $(t.sc).closest(".note-editable").length===0&&(t=x.createFromBodyElement(s.editable)),t},fo=(s,t,e,i,n)=>{let r=e?t.startContainer:t.endContainer,a=e?t.startOffset:t.endOffset;return r&&(!i||!t.collapsed)&&(r=r.childNodes[n(r,a)]||r,!l.isElement(r)&&l.isElement(r.parentNode)&&(r=r.parentNode)),r||s};class Pr{constructor(t){this.context=t,this.selectedControl=null,this.explicitRange=null,this.selectedRange=null,this.bookmark=null}initialize(t){this.hasFocus=t.hasFocus();const e=()=>{const a=this.nativeSelection;let c;return a.rangeCount>0?c=x.createFromNativeRange(a.getRangeAt(0)):c=$t(this.editor),c},i=k.throttle(a=>{a.type==="blur"&&(this.hasFocus=!1),a.type==="focus"?(this.hasFocus=!0,this.bookmark=e()):a.type!=="summernote"&&(this.bookmark=e())},200),n=["keydown","keyup","mouseup","paste","focus","blur"].map(a=>a+".selection").join(" ");t.$editable.on(n,i),this.context.layoutInfo.note.on("summernote.change.selection",i)}destroy(){this.editor.$editable.off("selection"),this.context.layoutInfo.note.off("selection"),this.context=null,this.selectedRange=null,this.explicitRange=null,this.bookmark=null,xt=null}get editor(){return this.context.modules.editor}get nativeSelection(){return xt.getSelection?xt.getSelection():xt.document.selection}isValidRange(t){if(!(t&&(t.isWrapper||t instanceof Range)))return!1;const i=this.editor.editable;return x.isFullyContainedInNode(t,i)}collapse(t){const e=this.getRange();e.collapse(!!t),this.setRange(e)}getRange(){let t;const e=(n,r,a)=>{try{return r.compareBoundaryPoints(n,a)}catch{return-1}},i=this.editor;if(E.isAssigned(this.bookmark)&&!this.hasFocus)return this.bookmark;if(!t&&this.hasFocus)try{const n=this.nativeSelection;n&&n.rangeCount>0&&!l.isRestrictedNode(n.anchorNode)&&(t=x.createFromNativeRange(n.getRangeAt(0)))}catch{}return t||(t=$t(i)),this.selectedRange&&this.explicitRange&&(e(t.START_TO_START,t,this.selectedRange)===0&&e(t.END_TO_END,t,this.selectedRange)===0?t=this.explicitRange:(this.selectedRange=null,this.explicitRange=null,this.bookmark=null)),t}setRange(t,e){if(!this.isValidRange(t))return this;const i=this.nativeSelection;if(i){t||(t=$t(this.editor)),t.isWrapper||(t=x.getWrappedRange(t)),this.explicitRange=t,this.bookmark=t;try{i.removeAllRanges(),i.addRange(x.getNativeRange(t))}catch{}e===!1&&i.extend&&(i.collapse(t.endContainer,t.endOffset),i.extend(t.startContainer,t.startOffset)),this.selectedRange=i.rangeCount>0?t:null}if(!t.collapsed&&t.startContainer===t.endContainer&&(i!=null&&i.setBaseAndExtent)&&t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()){const n=t.startContainer.childNodes[t.startOffset];n&&n.nodeName==="IMG"&&(i.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),(i.anchorNode!==t.startContainer||i.focusNode!==t.endContainer)&&i.setBaseAndExtent(n,0,n,1))}return this}setNode(t){return t}getNode(){const t=this.getRange(),e=this.editor.$editable;if(!t)return e;const i=t.startOffset,n=t.endOffset;let r=t.startContainer,a=t.endContainer,c=t.commonAncestorContainer;t.collapsed||(r===a&&n-i<2&&r.hasChildNodes()&&(c=r.childNodes[i]),l.isText(r)&&l.isText(a)&&(r.length===i?r=l.skipEmptyTextNodes(r.nextSibling,!0):r=r.parentNode,n===0?a=l.skipEmptyTextNodes(a.previousSibling,!1):a=a.parentNode,r&&r===a&&(c=r)));const d=l.isText(c)?c.parentNode:c;return l.isHTMLElement(d)?d:e}getTextContent(){let t=this.getRange();return t.isOnAnchor()&&(t=x.createFromNode(l.closest(t.startContainer,l.isAnchor))),t.toString()}getHtmlContent(){let t=this.getRange();var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}pasteContent(t){if(!t||this.editor.isLimited(t.length))return;t=this.context.invoke("codeview.purify",t.trim());const e=this.getRange(),i=l.create("div",null,t);let n=p.from(i.childNodes),r=!1;return e.so>=0&&(n=n.reverse(),r=!0),n=n.map(a=>e.insertNode(a,l.isBlock(a)||l.isData(a))),r&&(n=n.reverse()),this.setRange(x.createFromNodeAfter(p.last(n))),n}getStart(t,e=null){return fo(this.editor.editable,e||this.getRange(),!0,t,(i,n)=>Math.min(i.childNodes.length,n))}getEnd(t,e=null){return fo(this.editor.editable,e||this.getRange(),!1,t,(i,n)=>n>0?n-1:n)}createBookmark(t){return t?Gt.getPersistentBookmark(this):this.getRange().createBookmark(this.editor.editable)}createParaBookmark(t){return this.getRange().createParaBookmark(t)}moveToBookmark(t){let e,i=!0;if(this.isValidRange(t))e=t;else if(t.s&&t.e)e=x.createFromBookmark(this.editor.editable,t),this.isValidRange(e)||(e=null);else if(t.id){const n=Gt.resolvePersistentBookmark(t);e=n==null?void 0:n.range,i=n==null?void 0:n.forward}e&&(this.setRange(e,i),e.scrollIntoView(this.editor.editable))}setBookmark(t){this.isValidRange(t)?(t=x.getWrappedRange(t),this.bookmark=t):this.bookmark=$t(this.editor)}restoreBookmark(){this.bookmark&&(this.setRange(this.bookmark),this.editor.focus())}select(t){if(l.isChildOf(t,this.editor.editable,!0)){const e=x.createFromNode(t);this.setRange(e)}return t}setNode(t){const e=l.outerHtml(t);return this.pasteContent(e),t}isCollapsed(){const t=this.getRange();return t?t.collapsed:!1}isEditable(){const t=this.getRange();return t.collapsed?l.isContentEditable(t.startContainer):l.isContentEditable(t.startContainer)&&l.isContentEditable(t.endContainer)}scrollIntoView(){this.getRange().scrollIntoView(this.editor.editable)}setCursorLocation(t,e){const i=document.createRange();E.isAssigned(t)&&E.isAssigned(e)?(i.setStart(t,e),i.setEnd(t,e),this.setRange(i),this.collapse(!1)):(Gt.moveEndPoint(i,!0),this.setRange(i))}isForward(){const t=this.nativeSelection,e=t==null?void 0:t.anchorNode,i=t==null?void 0:t.focusNode;if(!t||!e||!i||l.isRestrictedNode(e)||l.isRestrictedNode(i))return!0;const n=document.createRange(),r=document.createRange();try{n.setStart(e,t.anchorOffset),n.collapse(!0),r.setStart(i,t.focusOffset),r.collapse(!0)}catch{return!0}return n.compareBoundaryPoints(n.START_TO_START,r)<=0}normalize(){const t=this.getRange();if(this.nativeSelection.rangeCount>0){const i=t.normalize();return this.setRange(i,this.isForward()),i}return t}}const Mr=s=>{const t=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;return s=s.replace(t,function(e,i,n){n=n.toUpperCase();const r=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!i,a=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return e+(r||a?` -`:"")}),s.trim()},Br={sanitizeHtml:(s,t)=>{const e=s.options.callbacks.onSanitizeHtml;return E.isFunction(e)?(t=e.call(s,t,{sanitize:!0,prettify:!0}),t):Mr(t)}},Ir="bogus";class Dr{constructor(t){this.context=t,this.$note=t.layoutInfo.note,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.snapshot=null,this.table=new Rr(t),this.bullet=new ao(t),this.typing=new Hr(t,this.bullet),this.history=new Er(t),this.style=new Tr(t),this.selection=new Pr(t),this.context.memo("help.escape",this.lang.help.escape),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);const e=["bold","italic","underline","strikethrough","superscript","subscript","code","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"];for(let i=0,n=e.length;ia=>{this.beforeCommand(),document.execCommand(r,!1,a),this.afterCommand(!0)})(e[i]),this.context.memo("help."+e[i],this.lang.help[e[i]]);this.fontName=this.wrapCommand(i=>this.fontStyling("font-family",L.validFontName(i))),this.fontSize=this.wrapCommand(i=>{const n=this.currentStyle()["font-size-unit"];return this.fontStyling("font-size",i+n)}),this.fontSizeUnit=this.wrapCommand(i=>{const n=this.currentStyle()["font-size"];return this.fontStyling("font-size",n+i)});for(let i=1;i<=6;i++)this["formatH"+i]=(n=>()=>{this.formatBlock("H"+n)})(i),this.context.memo("help.formatH"+i,this.lang.help["formatH"+i]);this.insertParagraph=this.wrapCommand(i=>{this.typing.insertParagraph(i)}),this.insertOrderedList=this.wrapCommand(i=>{this.bullet.insertOrderedList(i)}),this.insertUnorderedList=this.wrapCommand(i=>{this.bullet.insertUnorderedList(i)}),this.indent=this.wrapCommand(i=>{this.bullet.indent(i)}),this.outdent=this.wrapCommand(i=>{this.bullet.outdent(i)}),this.insertNode=this.wrapCommand(i=>{if(this.isLimited($(i).text().length))return;this.selection.getRange().insertNode(i),this.selection.setRange(x.createFromNodeAfter(i))}),this.insertText=this.wrapCommand(i=>{if(this.isLimited(i.length))return;const r=this.selection.getRange().insertNode(l.createText(i));this.selection.setRange(x.create(r,l.nodeLength(r)))}),this.pasteHTML=this.wrapCommand(i=>{this.selection.pasteContent(i)}),this.formatBlock=this.wrapCommand((i,n)=>{const r=this.options.callbacks.onApplyCustomStyle;r?r.call(this,n,this.context,this.onFormatBlock):this.onFormatBlock(i,n)}),this.insertHorizontalRule=this.wrapCommand(()=>{const i=this.selection.getRange().insertNode(l.create("HR"));i.nextSibling&&this.selection.setRange(x.create(i.nextSibling,0).normalize())}),this.lineHeight=this.wrapCommand(i=>{this.style.stylePara(this.selection.getRange(),{lineHeight:i})}),this.createLink=this.wrapCommand(i=>{let n=[],r=i.url;const a=i.text,c=i.isNewWindow;typeof r=="string"&&(r=r.trim()),this.options.onCreateLink?r=this.options.onCreateLink(r):r=this.checkLinkUrl(r)||r;let d=[];if(i.img&&!i.a)$(i.img).wrap(''),i.a=i.img.parentElement,d.push(i.a);else if(i.img&&i.a)d.push(i.a);else{let h=i.range||this.selection.getRange();const u=a.length-h.toString().length;if(u>0&&this.isLimited(u))return;if(h.toString()!==a){h=h.deleteContents();const g=h.insertNode($("").text(a)[0]);d.push(g)}else d=this.style.styleNodes(h,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0})}$.each(d,(h,u)=>{u.setAttribute("href",r),i.rel&&(u.rel=i.rel),i.cssClasss&&(u.className=i.cssClasss),i.cssStyle&&(u.style.cssText=i.cssStyle),c?(u.target="_blank",i.rel||(this.options.linkAddNoReferrer&&n.push("noreferrer"),this.options.linkAddNoOpener&&n.push("noopener"),n.length&&(u.rel=n.join(" ")))):u.removeAttribute("target")}),this.selection.setRange(x.createFromNodes(d))}),this.color=this.wrapCommand(i=>{const n=i.foreColor,r=i.backColor;n&&document.execCommand("foreColor",!1,n),r&&document.execCommand("backColor",!1,r)}),this.foreColor=this.wrapCommand(i=>{document.execCommand("foreColor",!1,i)}),this.insertTable=this.wrapCommand(i=>{const n=i.split("x");this.selection.getRange().deleteContents().insertNode(this.table.createTable(n[0],n[1],this.options))}),this.removeMedia=this.wrapCommand(()=>{let i=$(this.restoreTarget()).parent();i.closest("figure").length?i.closest("figure").remove():i=$(this.restoreTarget()).detach(),this.selection.setRange(x.createFromSelection(i)),this.context.triggerEvent("media.delete",i,this.$editable)}),this.floatMe=this.wrapCommand(i=>{const n=$(this.restoreTarget());n.removeClass("float-right float-left"),(i=="left"||i=="right")&&n.addClass("float-"+i)}),this.resize=this.wrapCommand(i=>{const n=$(this.restoreTarget());n.css("width","").css("height","").removeClass("w-100 w-50 w-25"),i=parseFloat(i),i>0&&(i===.25?n.addClass("w-25"):i===.5?n.addClass("w-50"):i===1?n.addClass("w-100"):n.css({width:i*100+"%"})),this.cleanEmptyStyling(n)})}cleanEmptyStyling(t){$(t).each((e,i)=>{i.className||i.removeAttribute("class"),i.style.cssText||i.removeAttribute("style")})}initialize(){this.selection.initialize(this),this.$editable.on("keydown",t=>{if(t.keyCode===T.code.ENTER&&this.context.triggerEvent("enter",t),this.context.triggerEvent("keydown",t),this.snapshot=this.history.makeSnapshot(),this.hasKeyShortCut=!1,t.isDefaultPrevented()||(this.options.shortcuts?this.hasKeyShortCut=this.handleKeyMap(t):this.preventDefaultEditableShortCuts(t)),this.isLimited(1,t)){const e=this.selection.getRange();if(e.eo-e.so===0)return!1}this.options.recordEveryKeystroke&&this.hasKeyShortCut===!1&&this.history.recordUndo()}).on("keyup mousedown mouseup copy paste copy focus blur scroll",t=>{this.context.triggerEvent(t.type,t)}).on("input",()=>{this.isLimited(0)&&this.snapshot&&this.history.applySnapshot(this.snapshot)}),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(l.value(this.$note)||l.emptyPara),this.$editable.on(L.inputEventName,k.debounce(()=>{this.context.triggerEvent("change",this.$editable)},10)),this.$editable.on("focusin",t=>{this.context.triggerEvent("focusin",t)}).on("focusout",t=>{this.context.triggerEvent("focusout",t)}),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",t=>(this.context.triggerEvent("contextmenu",t),!1)):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo()}destroy(){this.selection.destroy(),this.$editable.off()}handleKeyMap(t){const e=this.options.keyMap[L.isMac?"mac":"pc"],i=[];t.metaKey&&i.push("CMD"),t.ctrlKey&&!t.altKey&&i.push("CTRL"),t.shiftKey&&i.push("SHIFT");const n=T.nameFromCode[t.keyCode];n&&i.push(n);const r=e[i.join("+")];if(n==="TAB"&&this.options.tabDisable)this.afterCommand();else if(r){if(this.context.invoke(r)!==!1)return t.preventDefault(),!0}else T.isEdit(t.keyCode)&&(T.isRemove(t.keyCode)&&this.context.invoke("removed"),this.afterCommand());return!1}preventDefaultEditableShortCuts(t){(t.ctrlKey||t.metaKey)&&p.contains([66,73,85],t.keyCode)&&t.preventDefault()}isLimited(t,e){return t=t||0,typeof e<"u"&&(T.isMove(e.keyCode)||T.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||p.contains([T.code.BACKSPACE,T.code.DELETE],e.keyCode))?!1:this.options.maxTextLength>0&&this.$editable.text().length+t>this.options.maxTextLength}checkLinkUrl(t){if(t=t==null?void 0:t.trim(),t){if(q.isValidEmail(t))return"mailto://"+t;if(q.isValidTel(t))return"tel://"+t;if(!q.startsWithUrlScheme(t)){let i=t,n=i.indexOf("/");if(n>1&&(i=i.substring(0,n)),q.isValidHost(i))return"https://"+t;var e=t[0];if(e==="/"||e==="~"||e==="\\"||e==="."||e==="#")return t}}return""}createRange(){return this.focus(),this.selection.getRange()}setLastRange(t){this.selection.setBookmark(t)}getLastRange(){return this.selection.bookmark||this.selection.setBookmark(),this.selection.bookmark}get lastRange(){return this.getLastRange()}saveRange(t){t&&this.selection.collapse()}restoreRange(){this.selection.restoreBookmark()}html(t){let e=this.$editable.html();const i=W.valueOrDefault(this.options.sanitizeHtml,this.options.prettifyHtml);return W.valueOrDefault(t,i)&&(e=Br.sanitizeHtml(this.context,e)),e}saveTarget(t){this.selection.selectedControl=t}clearTarget(){this.selection.selectedControl=null}restoreTarget(){return this.selection.selectedControl}currentStyle(){let t=x.create();return t?(t=t.normalize(),this.style.current(t)):this.style.fromNode(this.$editable)}styleFromNode(t){return this.style.fromNode(t)}undo(){this.context.triggerEvent("before.command",this.$editable),this.history.undo(),this.context.triggerEvent("change",this.$editable)}commit(){this.context.triggerEvent("before.command",this.$editable),this.history.commit(),this.context.triggerEvent("change",this.$editable)}redo(){this.context.triggerEvent("before.command",this.$editable),this.history.redo(),this.context.triggerEvent("change",this.$editable)}beforeCommand(){this.context.triggerEvent("before.command",this.$editable),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}afterCommand(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable)}tab(){const t=this.selection.getRange();if(t.isOnList())this.indent(t);else if(t.collapsed&&t.isOnCell())this.table.tab(t);else{if(this.options.tabSize===0)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}untab(){const t=this.selection.getRange();if(t.isOnList())this.outdent(t);else if(t.collapsed&&t.isOnCell())this.table.tab(t,!0);else if(this.options.tabSize===0)return!1}wrapCommand(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}removed(t,e,i){t=x.create(),t.collapsed&&t.isOnCell()&&(e=t.ec,(i=e.tagName)&&e.childElementCount===1&&e.childNodes[0].tagName==="BR"&&(i==="P"?e.remove():["TH","TD"].indexOf(i)>=0&&e.firstChild.remove()))}insertImage(t,e){return Nr(t).then(i=>{this.beforeCommand(),typeof e=="function"?e(i):(typeof e=="string"&&i.attr("data-filename",e),i.css("width",Math.min(this.$editable.width(),i.width()))),i.show(),this.selection.getRange().insertNode(i[0]),this.selection.setRange(x.createFromNodeAfter(i[0])),this.afterCommand()}).fail(i=>{this.context.triggerEvent("image.upload.error",i)})}insertImagesAsDataURL(t){$.each(t,(e,i)=>{const n=i.name;this.options.maximumImageFileSize&&this.options.maximumImageFileSizethis.insertImage(r,n)).fail(()=>{this.context.triggerEvent("image.upload.error")})})}insertImagesOrCallback(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}getSelectedText(){return this.selection.getTextContent()}getTagStyleClass(t){let e=p.find(this.options.styleTags,i=>$.isPlainObject(i)&&i.tag.toUpperCase()==t.toUpperCase());return e==null?void 0:e.className}onFormatBlock(t,e){let i=this.createRange(),n=$([i.sc,i.ec]).closest(t),r={};if(n.length)for(const a of n[0].attributes)a.value&&(r[a.name]=a.value);if(document.execCommand("FormatBlock",!1,L.isMSIE?"<"+t+">":t),i=this.createRange(),n=$([i.sc,i.ec]).closest(t),l.setAttrs(n,r),e!=null&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e!=null&&e.length)){const a=this.selection.getRange();n=$([a.sc,a.ec]).closest(t),n.removeClass();const c=e[0].className||"";c&&n.addClass(c)}this.cleanEmptyStyling(n)}formatPara(){this.formatBlock("P")}fontStyling(t,e){const i=this.selection.getRange();if(i!==""){const n=this.style.styleNodes(i);if(this.$editor.find(".note-status-output").html(""),$(n).css(t,e),i.collapsed){const r=p.head(n);r&&!l.nodeLength(r)&&(r.innerHTML=v.ZERO_WIDTH_NBSP_CHAR,this.selection.setRange(x.createFromNode(r.firstChild)),this.$editable.data(Ir,r))}else this.selection.setRange(i)}else{const n=$.now();this.$editor.find(".note-status-output").html('
'+this.lang.output.noSelection+"
"),setTimeout(function(){$("#note-status-output-"+n).remove()},5e3)}}unlink(){let t=$(this.selection.selectedControl);if(t.is("img")&&t.parent().is("a"))this.beforeCommand(),t.unwrap(),this.afterCommand(!0),this.context.modules.imagePopover.hide();else{let e=this.selection.getRange();if(e.isOnAnchor()){const i=l.ancestor(e.sc,l.isAnchor);e=x.createFromNode(i),this.selection.setRange(e),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}}getLinkInfo(){var r;this.hasFocus()||this.focus();let t,e,i;t=this.selection.selectedControl,(r=t==null?void 0:t.parentElement)!=null&&r.matches("a")&&(e=t.parentElement,i=x.create(e,0,e,e.childNodes.length)),i||(i=this.selection.getRange().expand(l.isAnchor)),e||(e=p.head(i.nodes(l.isAnchor)));const n={range:i,a:e,img:t,text:t?null:i.toString()};return e&&(n.url=e.getAttribute("href"),n.cssClass=e.className,n.cssStyle=e.style.cssText,n.rel=e.rel,n.isNewWindow=e.target=="_blank"),n}addRow(t){const e=this.selection.getRange();e.collapsed&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}addCol(t){const e=this.selection.getRange();e.collapsed&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}deleteRow(){const t=this.selection.getRange();t.collapsed&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}deleteCol(){const t=this.selection.getRange();t.collapsed&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}deleteTable(){const t=this.selection.getRange();t.collapsed&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}resizeTo(t,e,i){let n;if(i){const r=t.y/t.x,a=e.data("ratio");n={width:a>r?t.x:t.y/a,height:a>r?t.x*a:t.y}}else n={width:t.x,height:t.y};e.css(n)}hasFocus(){return this.$editable.is(":focus")}focus(){this.hasFocus()||this.$editable.trigger("focus")}isEmpty(){return l.isEmpty(this.$editable[0])||l.emptyPara===this.$editable.html()}empty(){this.context.invoke("code",l.emptyPara)}normalizeContent(){this.$editable[0].normalize()}showPopover(t,e,i="top"){if(t!=null&&t.length){let n=t.data("popper");n&&n.destroy(),n=new Popper(e,t[0],{placement:i,modifiers:{computeStyle:{gpuAcceleration:!1},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.$editable[0]}}}),n.scheduleUpdate(),this.context.triggerEvent("popover.shown"),t.data("popper",n).show()}}hidePopover(t){if(t!=null&&t.length){const e=t.data("popper");e&&(e.destroy(),t.removeData("popper")),t.hide()}}}class Or{constructor(t){this.context=t,this.options=t.options,this.$editable=t.layoutInfo.editable}initialize(){this.$editable.on("paste",this.pasteByEvent.bind(this))}pasteByEvent(t){if(this.context.isDisabled())return;const e=t.originalEvent.clipboardData;if(e&&e.items&&e.items.length){const i=e.files,n=e.getData("Text");i.length>0&&this.options.allowClipboardImagePasting&&(this.context.invoke("editor.insertImagesOrCallback",i),t.preventDefault()),n.length>0&&this.context.invoke("editor.isLimited",n.length)&&t.preventDefault()}else if(window.clipboardData){let i=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()}setTimeout(()=>{this.context.invoke("editor.afterCommand")},10)}}class Fr{constructor(t){this.context=t,this.$eventListener=$(document),this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.options=t.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=$(['
','
',"
"].join("")).prependTo(this.$editor)}initialize(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=t=>{t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}attachDragAndDropEvent(){let t=$();const e=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=i=>{const n=this.context.invoke("codeview.isActivated"),r=this.$editor.width()>0&&this.$editor.height()>0;!n&&!t.length&&r&&(this.$editor.addClass("dragover"),this.$dropzone.width(this.$editor.width()),this.$dropzone.height(this.$editor.height()),e.text(this.lang.image.dragImageHere)),t=t.add(i.target)},this.documentEventHandlers.onDragleave=i=>{t=t.not(i.target),(!t.length||i.target.nodeName==="BODY")&&(t=$(),this.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=()=>{t=$(),this.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",()=>{this.$dropzone.addClass("hover"),e.text(this.lang.image.dropImage)}).on("dragleave",()=>{this.$dropzone.removeClass("hover"),e.text(this.lang.image.dragImageHere)}),this.$dropzone.on("drop",i=>{const n=i.originalEvent.dataTransfer;i.preventDefault(),n&&n.files&&n.files.length?(this.$editable.trigger("focus"),this.context.invoke("editor.insertImagesOrCallback",n.files)):$.each(n.types,(r,a)=>{if(a.toLowerCase().indexOf("_moz_")>-1)return;const c=n.getData(a);a.toLowerCase().indexOf("text")>-1?this.context.invoke("editor.pasteHTML",c):$(c).each((d,h)=>{this.context.invoke("editor.insertNode",h)})})}).on("dragover",!1)}destroy(){Object.keys(this.documentEventHandlers).forEach(t=>{this.$eventListener.off(t.slice(2).toLowerCase(),this.documentEventHandlers[t])}),this.documentEventHandlers={}}}const go="__note-jm__",mo="";class Ur{constructor(t){this.context=t,this.$editor=t.layoutInfo.editor,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.options=t.options,this.CodeMirrorConstructor=window.CodeMirror,this.options.codemirror.CodeMirrorConstructor&&(this.CodeMirrorConstructor=this.options.codemirror.CodeMirrorConstructor)}sync(t){const e=this.isActivated(),i=this.CodeMirrorConstructor;e&&(t?i?this.$codable.data("cmEditor").getDoc().setValue(t):this.$codable.val(t):i&&this.$codable.data("cmEditor").save())}initialize(){this.$codable.on("keyup",t=>{t.keyCode===T.code.ESCAPE&&this.deactivate()})}isActivated(){return this.$editor.hasClass("codeview")}toggle(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}purify(t){if(this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){const e=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);t=t.replace(/(.*?(?:<\/iframe>)?)/gi,function(i){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(i))return"";for(const n of e)if(new RegExp('src="(https?:)?//'+n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(i))return i;return""})}return t}normalizeSelRange(){const e=this.context.modules.editor.selection;let i;return e.selectedControl?i=x.createFromNodeBefore(e.selectedControl):i=e.getRange().cloneRange().collapse(!0),x.getNativeRange(i)}activate(){this.context.triggerEvent("codeview.activating");const t=this.CodeMirrorConstructor,e=this.context.modules.editor;this.normalizeSelRange().insertNode(document.createComment(go));let n=e.html();const r=q.findPosition(n,mo);if(r&&(n=n.replace(mo,"")),this.$codable.val(n),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.context.invoke("airPopover.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.trigger("focus"),t){const a=t.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){const c=new t.TernServer(this.options.codemirror.tern);a.ternServer=c,a.on("cursorActivity",d=>{c.updateArgHints(d)})}if(a.on("blur",c=>{this.context.triggerEvent("blur.codeview",a.getValue(),c)}),a.on("change",()=>{this.context.triggerEvent("change.codeview",a.getValue(),a)}),a.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",a),r){const c={line:r.line,ch:r.column};a.setCursor(c),a.scrollIntoView(c)}}else this.$codable.on("blur",a=>{this.context.triggerEvent("blur.codeview",this.$codable.val(),a)}),this.$codable.on("input",()=>{this.context.triggerEvent("change.codeview",this.$codable.val(),this.$codable)})}deactivate(){if(this.context.triggerEvent("codeview.leaving"),this.CodeMirrorConstructor){const n=this.$codable.data("cmEditor");this.$codable.val(n.getValue()),n.toTextArea()}const e=this.purify(l.value(this.$codable,this.options.prettifyHtml)||l.emptyPara),i=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),i&&this.context.triggerEvent("change",this.$editable),this.$editable.trigger("focus"),this.context.invoke("toolbar.updateCodeview",!1),this.context.invoke("airPopover.updateCodeview",!1)}destroy(){this.isActivated()&&this.deactivate()}}const bo=24;class Vr{constructor(t){this.$document=$(document),this.$statusbar=t.layoutInfo.statusbar,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.options=t.options}initialize(){if(this.options.airMode||this.options.disableResizeEditor){this.destroy();return}this.$statusbar.on("mousedown touchstart",t=>{t.preventDefault(),t.stopPropagation();const e=this.$editable.offset().top-this.$document.scrollTop(),i=this.$codable.offset().top-this.$document.scrollTop(),n=r=>{let a=r.type=="mousemove"?r:r.originalEvent.touches[0],c=a.clientY-(e+bo),d=a.clientY-(i+bo);c=this.options.minheight>0?Math.max(c,this.options.minheight):c,c=this.options.maxHeight>0?Math.min(c,this.options.maxHeight):c,d=this.options.minheight>0?Math.max(d,this.options.minheight):d,d=this.options.maxHeight>0?Math.min(d,this.options.maxHeight):d,this.$editable.height(c),this.$codable.height(d)};this.$document.on("mousemove touchmove",n).one("mouseup touchend",()=>{this.$document.off("mousemove touchmove",n)})})}destroy(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}class _r{constructor(t){this.context=t,this.$editor=t.layoutInfo.editor,this.$toolbar=t.layoutInfo.toolbar,this.$editable=t.layoutInfo.editable,this.$codable=t.layoutInfo.codable,this.$window=$(window),this.$scrollbar=$("html, body"),this.scrollbarClassName="note-fullscreen-body",this.onResize=()=>{this.resizeTo({h:this.$window.height()-this.$toolbar.outerHeight()})}}resizeTo(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}toggle(){this.$editor.toggleClass("fullscreen");const t=this.isFullscreen();this.$scrollbar.toggleClass(this.scrollbarClassName,t),t?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight"))),this.context.invoke("toolbar.updateFullscreen",t)}isFullscreen(){return this.$editor.hasClass("fullscreen")}destroy(){this.$scrollbar.removeClass(this.scrollbarClassName)}}class jr{constructor(t){this.context=t,this.editor=t.modules.editor,this.$document=$(document),this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":(e,i)=>{this.update(i.target,i)&&i.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":(e,i)=>{this.update(i==null?void 0:i.target,i)},"summernote.disable":()=>{this.hide()},"summernote.codeview.toggled":()=>{this.update()}}}initialize(){this.$handle=$(['
','
','
','
','
','
','
',this.options.disableResizeImage?"":'
',"
","
"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",t=>{if(l.isControlSizing(t.target)){t.preventDefault(),t.stopPropagation();const e=this.$handle.find(".note-control-selection").data("target"),i=e.offset(),n=this.$document.scrollTop(),r=a=>{this.context.invoke("editor.resizeTo",{x:a.clientX-i.left,y:a.clientY-(i.top-n)},e,!a.shiftKey),this.update(e[0],a)};this.$document.on("mousemove",r).one("mouseup",a=>{a.preventDefault(),this.$document.off("mousemove",r),this.context.invoke("editor.afterCommand")}),e.data("ratio")||e.data("ratio",e.height()/e.width())}}),this.$handle.on("wheel",t=>{t.preventDefault(),this.update()})}destroy(){this.$handle.remove()}update(t,e){if(this.context.isDisabled())return!1;t=t||this.editor.selection.selectedControl;const i=(e==null?void 0:e.type)=="scroll";i&&(t=this.editor.selection.selectedControl);const n=l.isImg(t),r=this.$handle.find(".note-control-selection");if(i||this.context.invoke("imagePopover.update",t,e),n){const a=$(t),c=this.$editingArea[0].getBoundingClientRect(),d=t.getBoundingClientRect();r.css({display:"block",left:d.left-c.left,top:d.top-c.top,width:d.width,height:d.height}).data("target",a);const h=new Image;h.src=a.attr("src");let u=Math.ceil(d.width)+"x"+Math.ceil(d.height);h.width>0&&h.height>0&&(u+=" ("+this.lang.image.original+": "+h.width+"x"+h.height+")");const f=r.find(".note-control-selection-info").text(u),g=f.outerWidth()>d.width-10||f.outerHeight()>d.height-10;f.toggle(!g),this.context.invoke("editor.saveTarget",t)}else this.hide();return n}hide(){this.$handle.children().hide(),this.context.invoke("editor.clearTarget")}}const qr="http://",Wr=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@|xmpp:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i;class Kr{constructor(t){this.context=t,this.options=t.options,this.$editable=t.layoutInfo.editable,this.events={"summernote.keyup":(e,i)=>{i.isDefaultPrevented()||this.handleKeyup(i)},"summernote.keydown":(e,i)=>{this.handleKeydown(i)}}}initialize(){this.lastWordRange=null}destroy(){this.lastWordRange=null}replace(){if(!this.lastWordRange)return;const t=this.lastWordRange.toString(),e=t.match(Wr);if(e&&(e[1]||e[2])){const i=e[1]?t:qr+t,n=this.options.showDomainOnlyForAutolink?t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:xmpp?:?)?(?:www\.)?/i,"").split("/")[0]:t,r=$("").html(n).attr("href",i)[0];this.context.options.linkTargetBlank&&$(r).attr("target","_blank"),this.lastWordRange.insertNode(r),this.lastWordRange=null,this.context.invoke("editor.focus"),this.context.triggerEvent("change",this.$editable)}}handleKeydown(t){if(p.contains([T.code.ENTER,T.code.SPACE],t.keyCode)){const e=this.context.invoke("editor.createRange").getWordRange({trim:!0});this.lastWordRange=e}}handleKeyup(t){(T.code.SPACE===t.keyCode||T.code.ENTER===t.keyCode&&!t.shiftKey)&&this.replace()}}class Gr{constructor(t){this.$note=t.layoutInfo.note,this.events={"summernote.change":()=>{this.$note.val(t.invoke("code"))}}}shouldInitialize(){return l.isTextarea(this.$note[0])}}class Qr{constructor(t){this.context=t,this.options=t.options.replace||{},this.keys=[T.code.ENTER,T.code.SPACE,T.code.PERIOD,T.code.COMMA,T.code.SEMICOLON,T.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":(e,i)=>{i.isDefaultPrevented()||this.handleKeyup(i)},"summernote.keydown":(e,i)=>{this.handleKeydown(i)}}}shouldInitialize(){return!!this.options.match}initialize(){this.lastWord=null}destroy(){this.lastWord=null}replace(){if(!this.lastWord)return;const t=this,e=this.lastWord.toString();this.options.match(e,function(i){if(i){let n="";if(typeof i=="string"?n=l.createText(i):i instanceof jQuery?n=i[0]:i instanceof Node&&(n=i),!n)return;t.lastWord.insertNode(n),t.lastWord=null,t.context.invoke("editor.focus")}})}handleKeydown(t){if(this.previousKeydownCode&&p.contains(this.keys,this.previousKeydownCode)){this.previousKeydownCode=t.keyCode;return}if(p.contains(this.keys,t.keyCode)){const e=this.context.invoke("editor.createRange").getWordRange();this.lastWord=e}this.previousKeydownCode=t.keyCode}handleKeyup(t){p.contains(this.keys,t.keyCode)&&this.replace()}}class Zr{constructor(t){this.context=t,this.$editingArea=t.layoutInfo.editingArea,this.options=t.options,this.options.inheritPlaceholder===!0&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":()=>{this.update()},"summernote.codeview.toggled":()=>{this.update()}}}shouldInitialize(){return!!this.options.placeholder}initialize(){this.$placeholder=$('
'),this.$placeholder.on("click",()=>{this.context.invoke("focus")}).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}destroy(){this.$placeholder.remove()}update(){const t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}class Yr{constructor(t){this.ui=$.summernote.ui,this.context=t,this.$toolbar=t.layoutInfo.toolbar,this.options=t.options,this.lang=this.options.langInfo,this.invertedKeyMap=W.invert(this.options.keyMap[L.isMac?"mac":"pc"])}representShortcut(t){let e=this.invertedKeyMap[t];return!this.options.shortcuts||!e?"":(L.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧")),e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")," ("+e+")")}button(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}initialize(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}destroy(){delete this.fontInstalledMap}isFontInstalled(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=L.isFontInstalled(t)||p.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}isFontDeservedToAdd(t){return t=t.toLowerCase(),t!==""&&this.isFontInstalled(t)&&L.genericFontFamilies.indexOf(t)===-1}loadCustomColors(t){const e="note:customcolors:"+t.data("event"),i=localStorage.getItem(e);let n;if(i)try{n=JSON.parse(i),n.length>8&&(n=n.slice(-8))}catch{localStorage.removeItem(e)}return n||[]}saveCustomColor(t,e){const i="note:customcolors:"+t.data("event"),n=this.loadCustomColors(t);n.push(e),n.length>8&&n.shift(),localStorage.setItem(i,JSON.stringify(n)),this.updateCustomColorPalette(t,n)}updateCustomColorPalette(t,e){const i=[e.concat(Array(8-e.length).fill("#FFFFFF")).slice(0,8)];t.html(this.ui.palette({colors:i,colorsName:i,eventName:t.data("event"),container:this.options.container}).render()),t.find(".note-color-btn").eq(e.length-1).addClass("omega")}colorPalette(t,e,i,n){return this.ui.buttonGroup({className:"note-color "+t,children:[this.button({className:"note-current-color-button",contents:$(this.ui.icon(this.options.icons.paintbrush)).addClass("note-recent-color")[0].outerHTML,tooltip:e,click:r=>{const a=$(r.currentTarget);i&&n?this.context.invoke("editor.color",{backColor:a.attr("data-backColor"),foreColor:a.attr("data-foreColor")}):i?this.context.invoke("editor.color",{backColor:a.attr("data-backColor")}):n&&this.context.invoke("editor.color",{foreColor:a.attr("data-foreColor")})},callback:r=>{const a=r.find(".note-recent-color");i&&(a.css("background-color",this.options.colorButton.backColor),r.attr("data-backColor",this.options.colorButton.backColor)),n?(a.css("color",this.options.colorButton.foreColor),r.attr("data-foreColor",this.options.colorButton.foreColor)):a.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(i?['
','
'+this.lang.color.background+"",'",'",'',"
",'
','
','
','
',"
"].join(""):"")+(n?['
','
'+this.lang.color.foreground+"",'",'",'',"
",'
','
','
','
',"
"].join(""):""),callback:r=>{r.find(".note-holder").each((a,c)=>{const d=$(c);d.append(this.ui.palette({colors:this.options.colors,colorsName:this.options.colorsName,eventName:d.data("event"),container:this.options.container}).render())}),r.find(".note-holder-custom").each((a,c)=>{const d=$(c),h=this.loadCustomColors(d);this.updateCustomColorPalette(d,h)}),r.find("input[type=color]").each((a,c)=>{$(c).on("change",d=>{const h=d.currentTarget,u=r.find("#"+$(h).data("event")),f=h.value.toUpperCase();this.saveCustomColor(u,f),this.updateCustomColorPalette(u,this.loadCustomColors(u)),u.find(".note-color-btn.omega").first().trigger("click")})})},click:r=>{r.stopPropagation();const a=$("."+t).find(".note-dropdown-menu"),c=$(r.target.closest("button")),d=c.data("event"),h=c.attr("data-value");if(console.log(r,d,r.target),d==="openPalette")a.find("#"+h).trigger("click");else{if(p.contains(["backColor","foreColor"],d)){const u=d==="backColor"?"background-color":"color",f=c.closest(".note-color").find(".note-recent-color"),g=c.closest(".note-color").find(".note-current-color-button");f.css(u,h),g.attr("data-"+d,h)}this.context.invoke("editor."+d,h)}}})]}).render()}addToolbarButtons(){this.context.memo("button.style",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.paragraph),this.options),tooltip:this.lang.style.style,data:{toggle:"dropdown"}}),this.ui.dropdown({className:"dropdown-style",items:this.options.styleTags,title:this.lang.style.style,template:f=>{typeof f=="string"&&(f={tag:f,title:Object.prototype.hasOwnProperty.call(this.lang.style,f)?this.lang.style[f]:f});const g=f.tag,C=f.title,H=f.style?' style="'+f.style+'" ':"",B=f.className?' class="'+f.className+'"':"";return"<"+g+H+B+">"+C+""},click:this.context.createInvokeHandler("editor.formatBlock")})]).render());for(let f=0,g=this.options.styleTags.length;fthis.button({className:"note-btn-style-"+C,contents:'
'+C.toUpperCase()+"
",tooltip:this.lang.style[C],click:this.context.createInvokeHandler("editor.formatBlock")}).render())}this.context.memo("button.bold",()=>this.button({className:"note-btn-bold",contents:this.ui.icon(this.options.icons.bold),tooltip:this.lang.font.bold+this.representShortcut("bold"),click:this.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()),this.context.memo("button.italic",()=>this.button({className:"note-btn-italic",contents:this.ui.icon(this.options.icons.italic),tooltip:this.lang.font.italic+this.representShortcut("italic"),click:this.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()),this.context.memo("button.underline",()=>this.button({className:"note-btn-underline",contents:this.ui.icon(this.options.icons.underline),tooltip:this.lang.font.underline+this.representShortcut("underline"),click:this.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()),this.context.memo("button.clear",()=>this.button({className:"note-btn-removeformat",contents:this.ui.icon(this.options.icons.eraser),tooltip:this.lang.font.clear+this.representShortcut("removeFormat"),click:this.context.createInvokeHandler("editor.removeFormat")}).render());const t=this.button({className:"note-btn-strikethrough",contents:this.ui.icon(this.options.icons.strikethrough),tooltip:this.lang.font.strikethrough+this.representShortcut("strikethrough"),click:this.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}),e=this.button({className:"note-btn-superscript",contents:this.ui.icon(this.options.icons.superscript),tooltip:this.lang.font.superscript,click:this.context.createInvokeHandlerAndUpdateState("editor.superscript")}),i=this.button({className:"note-btn-subscript",contents:this.ui.icon(this.options.icons.subscript),tooltip:this.lang.font.subscript,click:this.context.createInvokeHandlerAndUpdateState("editor.subscript")}),n=this.button({className:"note-btn-inlinecode",contents:this.ui.icon(this.options.icons.inlineCode),tooltip:this.lang.font.code,click:this.context.createInvokeHandlerAndUpdateState("editor.code")});this.context.memo("button.strikethrough",()=>t.render()),this.context.memo("button.superscript",()=>e.render()),this.context.memo("button.subscript",()=>i.render()),this.context.memo("button.inlinecode",()=>n.render()),this.context.memo("button.moreFontStyles",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle no-chevron",contents:this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.ellipsis),this.options),data:{toggle:"dropdown"}}),this.ui.dropdown({className:"note-toolbar",css:{"min-width":"auto"},items:this.ui.buttonGroup({className:"note-more-fontstyles",children:[t,e,i,n]}).render()})]).render()),this.context.memo("button.fontname",()=>{const f=this.context.invoke("editor.currentStyle");return this.options.addDefaultFonts&&(p.isEmpty(f["font-family"])||$.each(f["font-family"].split(","),(g,C)=>{C=C.trim().replace(/['"]+/g,""),this.isFontDeservedToAdd(C)&&this.options.fontNames.indexOf(C)===-1&&this.options.fontNames.push(C)})),this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents('',this.options),tooltip:this.lang.font.name,data:{toggle:"dropdown"}}),this.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:this.options.icons.menuCheck,items:this.options.fontNames.filter(this.isFontInstalled.bind(this)),title:this.lang.font.name,template:g=>''+g+"",click:this.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),this.context.memo("button.fontsize",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents('',this.options),tooltip:this.lang.font.size,data:{toggle:"dropdown"}}),this.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:this.options.icons.menuCheck,items:this.options.fontSizes,title:this.lang.font.size,click:this.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()),this.context.memo("button.fontsizeunit",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents('',this.options),tooltip:this.lang.font.sizeunit,data:{toggle:"dropdown"}}),this.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:this.options.icons.menuCheck,items:this.options.fontSizeUnits,title:this.lang.font.sizeunit,click:this.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()),this.context.memo("button.color",()=>this.colorPalette("note-color-all",this.lang.color.recent,!0,!0)),this.context.memo("button.forecolor",()=>this.colorPalette("note-color-fore",this.lang.color.foreground,!1,!0)),this.context.memo("button.backcolor",()=>this.colorPalette("note-color-back",this.lang.color.background,!0,!1)),this.context.memo("button.ul",()=>this.button({contents:this.ui.icon(this.options.icons.unorderedlist),tooltip:this.lang.lists.unordered+this.representShortcut("insertUnorderedList"),click:this.context.createInvokeHandler("editor.insertUnorderedList")}).render()),this.context.memo("button.ol",()=>this.button({contents:this.ui.icon(this.options.icons.orderedlist),tooltip:this.lang.lists.ordered+this.representShortcut("insertOrderedList"),click:this.context.createInvokeHandler("editor.insertOrderedList")}).render());const r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),a=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),c=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),d=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),h=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),u=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",k.invoke(r,"render")),this.context.memo("button.justifyCenter",k.invoke(a,"render")),this.context.memo("button.justifyRight",k.invoke(c,"render")),this.context.memo("button.justifyFull",k.invoke(d,"render")),this.context.memo("button.outdent",k.invoke(h,"render")),this.context.memo("button.indent",k.invoke(u,"render")),this.context.memo("button.paragraph",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft),this.options),tooltip:this.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),this.ui.dropdown({className:"note-toolbar",css:{"min-width":"auto"},children:[this.ui.buttonGroup({className:"note-align",children:[r,a,c,d]}),this.ui.buttonGroup({className:"note-list",children:[h,u]})]})]).render()),this.context.memo("button.height",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight),this.options),tooltip:this.lang.font.height,data:{toggle:"dropdown"}}),this.ui.dropdownCheck({items:this.options.lineHeights,checkClassName:this.options.icons.menuCheck,className:"dropdown-line-height",title:this.lang.font.height,click:this.context.createInvokeHandler("editor.lineHeight")})]).render()),this.context.memo("button.table",()=>this.ui.buttonGroup([this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table),this.options),tooltip:this.lang.table.table,data:{toggle:"dropdown"}}),this.ui.dropdown({title:this.lang.table.table,className:"note-table",items:['
','
','
','
',"
",'
1 x 1
'].join("")})],{callback:f=>{f.find(".note-dimension-picker-mousecatcher").css({width:this.options.insertTableMaxSize.col+"em",height:this.options.insertTableMaxSize.row+"em"}).on("mousedown",this.context.createInvokeHandler("editor.insertTable")).on("mousemove",this.tableMoveHandler.bind(this))}}).render()),this.context.memo("button.link",()=>this.button({contents:this.ui.icon(this.options.icons.link),tooltip:this.lang.link.link+this.representShortcut("linkDialog.show"),click:this.context.createInvokeHandler("linkDialog.show")}).render()),this.context.memo("button.image",()=>this.button({contents:this.ui.icon(this.options.icons.picture),tooltip:this.lang.image.image,click:this.context.createInvokeHandler("imageDialog.show")}).render()),this.context.memo("button.video",()=>this.button({contents:this.ui.icon(this.options.icons.video),tooltip:this.lang.video.video,click:this.context.createInvokeHandler("videoDialog.show")}).render()),this.context.memo("button.hr",()=>this.button({contents:this.ui.icon(this.options.icons.minus),tooltip:this.lang.hr.insert+this.representShortcut("insertHorizontalRule"),click:this.context.createInvokeHandler("editor.insertHorizontalRule")}).render()),this.context.memo("button.fullscreen",()=>this.button({className:"btn-fullscreen note-codeview-keep",contents:this.ui.icon(this.options.icons.arrowsAlt),tooltip:this.lang.options.fullscreen,click:this.context.createInvokeHandler("fullscreen.toggle")}).render()),this.context.memo("button.codeview",()=>this.button({className:"btn-codeview note-codeview-keep",contents:this.ui.icon(this.options.icons.code),tooltip:this.lang.options.codeview,click:this.context.createInvokeHandler("codeview.toggle")}).render()),this.context.memo("button.redo",()=>this.button({className:"note-redo disabled",contents:this.ui.icon(this.options.icons.redo),tooltip:this.lang.history.redo+this.representShortcut("redo"),click:this.context.createInvokeHandler("editor.redo")}).render()),this.context.memo("button.undo",()=>this.button({className:"note-undo disabled",contents:this.ui.icon(this.options.icons.undo),tooltip:this.lang.history.undo+this.representShortcut("undo"),click:this.context.createInvokeHandler("editor.undo")}).render()),this.context.memo("button.help",()=>this.button({contents:this.ui.icon(this.options.icons.question),tooltip:this.lang.options.help,click:this.context.createInvokeHandler("helpDialog.show")}).render())}addImagePopoverButtons(){this.context.memo("button.resizeFull",()=>this.button({contents:'100%',tooltip:this.lang.image.resizeFull,click:this.context.createInvokeHandler("editor.resize","1")}).render()),this.context.memo("button.resizeHalf",()=>this.button({contents:'50%',tooltip:this.lang.image.resizeHalf,click:this.context.createInvokeHandler("editor.resize","0.5")}).render()),this.context.memo("button.resizeQuarter",()=>this.button({contents:'25%',tooltip:this.lang.image.resizeQuarter,click:this.context.createInvokeHandler("editor.resize","0.25")}).render()),this.context.memo("button.resizeNone",()=>this.button({contents:this.ui.icon(this.options.icons.rollback),tooltip:this.lang.image.resizeNone,click:this.context.createInvokeHandler("editor.resize","0")}).render()),this.context.memo("button.floatLeft",()=>this.button({contents:this.ui.icon(this.options.icons.floatLeft),tooltip:this.lang.image.floatLeft,click:this.context.createInvokeHandler("editor.floatMe","left")}).render()),this.context.memo("button.floatRight",()=>this.button({contents:this.ui.icon(this.options.icons.floatRight),tooltip:this.lang.image.floatRight,click:this.context.createInvokeHandler("editor.floatMe","right")}).render()),this.context.memo("button.floatNone",()=>this.button({contents:this.ui.icon(this.options.icons.floatNone),tooltip:this.lang.image.floatNone,click:this.context.createInvokeHandler("editor.floatMe","none")}).render()),this.context.memo("button.removeMedia",()=>this.button({contents:this.ui.icon(this.options.icons.trash),tooltip:this.lang.image.remove,click:this.context.createInvokeHandler("editor.removeMedia")}).render())}addLinkPopoverButtons(){this.context.memo("button.linkDialogShow",()=>this.button({contents:this.ui.icon(this.options.icons.link),tooltip:this.lang.link.edit,click:this.context.createInvokeHandler("linkDialog.show")}).render()),this.context.memo("button.unlink",()=>this.button({className:"note-unlink",contents:this.ui.icon(this.options.icons.unlink),tooltip:this.lang.link.unlink,click:this.context.createInvokeHandler("editor.unlink")}).render())}addTablePopoverButtons(){this.context.memo("button.addRowUp",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.rowAbove),tooltip:this.lang.table.addRowAbove,click:this.context.createInvokeHandler("editor.addRow","top")}).render()),this.context.memo("button.addRowDown",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.rowBelow),tooltip:this.lang.table.addRowBelow,click:this.context.createInvokeHandler("editor.addRow","bottom")}).render()),this.context.memo("button.addColLeft",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.colBefore),tooltip:this.lang.table.addColLeft,click:this.context.createInvokeHandler("editor.addCol","left")}).render()),this.context.memo("button.addColRight",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.colAfter),tooltip:this.lang.table.addColRight,click:this.context.createInvokeHandler("editor.addCol","right")}).render()),this.context.memo("button.deleteRow",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.rowRemove),tooltip:this.lang.table.delRow,click:this.context.createInvokeHandler("editor.deleteRow")}).render()),this.context.memo("button.deleteCol",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.colRemove),tooltip:this.lang.table.delCol,click:this.context.createInvokeHandler("editor.deleteCol")}).render()),this.context.memo("button.deleteTable",()=>this.button({className:"btn-md",contents:this.ui.icon(this.options.icons.trash),tooltip:this.lang.table.delTable,click:this.context.createInvokeHandler("editor.deleteTable")}).render())}build(t,e){for(let i=0,n=e.length;ii["font-bold"]==="bold",".note-btn-italic":()=>i["font-italic"]==="italic",".note-btn-underline":()=>i["font-underline"]==="underline",".note-btn-subscript":()=>i["font-subscript"]==="subscript",".note-btn-superscript":()=>i["font-superscript"]==="superscript",".note-btn-strikethrough":()=>i["font-strikethrough"]==="strikethrough",".note-btn-inlinecode":()=>i["font-code"]==="code"}),i["font-family"]){const n=i["font-family"].split(",").map(a=>a.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")),r=p.find(n,this.isFontInstalled.bind(this));e.find(".dropdown-fontname a").each((a,c)=>{const d=$(c),h=d.data("value")+""==r+"";d.toggleClass("checked",h)}),e.find(".note-current-fontname").text(r).css("font-family",r).removeClass("text-muted")}else e.find(".note-current-fontname").text("Standard").css("font-family","").addClass("text-muted");if(i["font-size"]){const n=i["font-size"];e.find(".dropdown-fontsize a").each((a,c)=>{const d=$(c),h=d.data("value")+""==n+"";d.toggleClass("checked",h)}),e.find(".note-current-fontsize").text(n);const r=i["font-size-unit"];e.find(".dropdown-fontsizeunit a").each((a,c)=>{const d=$(c),h=d.data("value")+""==r+"";d.toggleClass("checked",h)}),e.find(".note-current-fontsizeunit").text(r)}if(i["line-height"]){const n=i["line-height"];e.find(".dropdown-line-height a").each((r,a)=>{const c=$(a),d=$(a).data("value")+""==n+"";c.toggleClass("checked",d)}),e.find(".note-current-line-height").text(n)}}updateBtnStates(t,e){$.each(e,(i,n)=>{this.ui.toggleBtnActive(t.find(i),n())})}tableMoveHandler(t){const i=$(t.target.parentNode),n=i.next(),r=i.find(".note-dimension-picker-mousecatcher"),a=i.find(".note-dimension-picker-highlighted"),c=i.find(".note-dimension-picker-unhighlighted");let d;if(t.offsetX===void 0){const u=$(t.target).offset();d={x:t.pageX-u.left,y:t.pageY-u.top}}else d={x:t.offsetX,y:t.offsetY};const h={c:Math.ceil(d.x/18)||1,r:Math.ceil(d.y/18)||1};a.css({width:h.c+"em",height:h.r+"em"}),r.data("value",h.c+"x"+h.r),h.c>3&&h.c3&&h.r{this.context.invoke("buttons.updateCurrentStyle")}),this.$note.on("summernote.change",()=>{let t=this.context.modules.editor.history;this.$toolbar.find(".note-undo").toggleClass("disabled",!t.canUndo()),this.$toolbar.find(".note-redo").toggleClass("disabled",!t.canRedo())}),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}destroy(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}followScroll(){if(this.$editor.hasClass("fullscreen"))return!1;const t=this.$editor.outerHeight(),e=this.$editor.width(),i=this.$toolbar.height(),n=this.$statusbar.height();let r=0;this.options.otherStaticBar&&(r=$(this.options.otherStaticBar).outerHeight());const a=this.$document.scrollTop(),c=this.$editor.offset().top,d=c+t,h=c-r,u=d-r-i-n;!this.isFollowing&&a>h&&au)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}changeContainer(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}updateFullscreen(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}updateCodeview(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}activate(t){let e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!0)}deactivate(t){let e=this.$toolbar.find("button");t||(e=e.not(".note-codeview-keep")),this.ui.toggleBtn(e,!1)}}class Xr{constructor(t){this.context=t,this.ui=$.summernote.ui,this.$body=$(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo,this.editor=t.modules.editor,t.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}initialize(){const t=this.options.dialogsInBody?this.$body:this.options.container,e=['
',` `,'
',` `,this.options.callbacks.onFileBrowse?`
`:"","
","
",'
',` `,` `,"
",'
',` `,` `,"
",'
',` `,` `,"
",'
',` `,` `,"
",this.options.disableLinkTarget?"":$("
").append(this.ui.checkbox({id:"sn-checkbox-open-in-new-window",className:"form-switch note-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html()].join(""),i=['",'"].join("");this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.link,fade:this.options.dialogsFade,body:e,footer:i}).render().appendTo(t)}destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}bindEnterKey(t,e){t.on("keypress",i=>{if(i.keyCode===T.code.ENTER)return i.preventDefault(),i.stopPropagation(),e.trigger("click"),!1})}onCheckLinkUrl(t){t.on("blur",e=>{let i=this.editor.checkLinkUrl(e.target.value);i&&(e.target.value=i)})}showLinkDialog(t){return $.Deferred(e=>{let i=this,n=this.$dialog.find(".note-link-text"),r=this.$dialog.find(".note-link-url"),a=this.$dialog.find(".note-link-class"),c=this.$dialog.find(".note-link-style"),d=this.$dialog.find(".note-link-rel"),h=this.$dialog.find(".note-link-btn"),u=this.$dialog.find("#sn-checkbox-open-in-new-window"),f=this.$dialog.find(".btn-browse"),g;function C(){var w=r.val();t.img||(w=!!w&&!!n.val()),i.ui.toggleBtn(h,w)}function H(){L.isSupportTouch||r.trigger("focus")}!t.url&&t.text&&(t.url=this.editor.checkLinkUrl(t.text)),n.val(t.text),r.val(t.url),a.val(t.cssClass),c.val(t.cssStyle),d.val(t.rel);const B=t.isNewWindow!==void 0?t.isNewWindow:this.options.linkTargetBlank;u.prop("checked",B),this.ui.onDialogShown(this.$dialog,()=>{this.context.triggerEvent("dialog.shown"),n.on("input paste propertychange",()=>{t.text=q.escape(n.val()),C()}),r.on("input paste propertychange",()=>{t.text||n.val(r.val()),C()}),f.on("click.linkDialog",w=>{w.preventDefault(),g=$.Deferred(m=>{this.context.triggerEvent("file.browse",w,null,m)}).promise(),g.then(m=>{r.val(m).trigger("change").trigger("input")}).always(()=>{H()})}),H(),C(),this.bindEnterKey(r,h),this.bindEnterKey(n,h),this.onCheckLinkUrl(r),h.one("click",w=>{w.preventDefault(),e.resolve({img:t.img,a:t.a,range:t.range,url:r.val(),text:n.val(),cssClasss:a.val(),cssStyle:c.val(),rel:d.val(),isNewWindow:u.is(":checked")}),this.ui.hideDialog(this.$dialog)})}),this.ui.onDialogHidden(this.$dialog,()=>{n.off(),r.off(),h.off(),f.off(),e.state()==="pending"&&e.reject(),g&&g.state()==="pending"&&g.reject()}),this.ui.showDialog(this.$dialog)}).promise()}show(){const t=this.context.invoke("editor.getLinkInfo");this.$dialog.find(".form-group-text").toggle(!t.img),this.showLinkDialog(t).then(e=>{this.context.invoke("editor.selection.restoreBookmark"),this.context.invoke("editor.createLink",e)}).fail(()=>{this.context.invoke("editor.selection.restoreBookmark")})}}class ta{constructor(t){this.context=t,this.editor=t.modules.editor,this.ui=$.summernote.ui,this.options=t.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":()=>{this.update()},"summernote.disable summernote.dialog.shown summernote.popover.shown":()=>{this.hide()},"summernote.blur":(e,i)=>{i.originalEvent&&i.originalEvent.relatedTarget?this.$popover[0].contains(i.originalEvent.relatedTarget)||this.hide():this.hide()}}}shouldInitialize(){return!p.isEmpty(this.options.popover.link)}initialize(){this.$popover=this.ui.popover({className:"note-link-popover",callback:e=>{e.find(".popover-content,.note-popover-content").prepend(' ')}}).render().appendTo(this.options.container);const t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",e=>{e.preventDefault()})}destroy(){this.$popover.remove()}update(){if(!this.context.invoke("editor.hasFocus")){this.hide();return}const t=this.context.invoke("editor.selection.getRange");if(t.collapsed&&t.isOnAnchor()){const e=l.ancestor(t.sc,l.isAnchor),i=$(e).attr("href");this.$popover.find("a").attr("href",i).attr("title",i).text(i),this.editor.showPopover(this.$popover,e)}else this.hide()}hide(){this.editor.hidePopover(this.$popover)}}class ea{constructor(t){this.context=t,this.editor=t.modules.editor,this.ui=$.summernote.ui,this.$body=$(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo,this.context.memo("button.imageAttributes",()=>{var e=this.ui.button({contents:this.ui.icon(this.options.icons.pencil),callback:i=>{i.data("placement","bottom"),i.data("trigger","hover"),i.attr("title",this.lang.image.imageProps),i.tooltip()},click:()=>{this.show()}});return e.render()})}initialize(){const t=this.options.dialogsInBody?this.$body:this.options.container,e=['
',` `,'
',` `,this.options.callbacks.onFileBrowse?`
`:"","
","
",'
',` `,` `,"
",'
',` `,` `,"
",'
',` `,` `,"
",'
',` `,` `,"
"].join(""),i=['",'"].join("");this.$dialog=this.ui.dialog({className:"image-dialog",title:this.lang.image.image,fade:this.options.dialogsFade,body:e,footer:i}).render().appendTo(t)}destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}bindEnterKey(t){this.$dialog.find(".note-input").on("keypress.imageDialog",e=>{if(e.keyCode===T.code.ENTER)return e.preventDefault(),e.stopPropagation(),t.trigger("click"),!1})}show(){let t={},e=$(this.editor.selection.selectedControl);e.length&&(t={img:e,src:e.attr("src"),alt:e.attr("alt"),title:e.attr("title"),cssClass:e.attr("class"),cssStyle:e.attr("style")}),this.showImageDialog(t).then(i=>{this.ui.hideDialog(this.$dialog),this.context.invoke("editor.selection.restoreBookmark");const n=(r,a)=>{a&&l.setAttr(r,"src",this.$dialog.find(".note-image-src").val()),l.setAttr(r,"alt",this.$dialog.find(".note-image-alt").val()),l.setAttr(r,"title",this.$dialog.find(".note-image-title").val()),l.setAttr(r,"class",this.$dialog.find(".note-image-class").val()),l.setAttr(r,"style",this.$dialog.find(".note-image-style").val())};i.img?(n(i.img,!0),this.context.layoutInfo.note.val(this.context.invoke("code")),this.context.layoutInfo.note.change()):this.context.invoke("editor.insertImage",this.$dialog.find(".note-image-src").val(),n)}).fail(()=>{this.context.invoke("editor.selection.restoreBookmark")})}showImageDialog(t){return $.Deferred(e=>{let i=this.$dialog.find(".note-image-src"),n=this.$dialog.find(".note-image-class"),r=this.$dialog.find(".note-image-style"),a=this.$dialog.find(".note-image-alt"),c=this.$dialog.find(".note-image-title"),d=this.$dialog.find(".note-image-btn"),h=this.$dialog.find(".btn-browse"),u;i.on("input.imageDialog",f=>{this.ui.toggleBtn(d,i.val())}),i.val(t.src),n.val(t.cssClass),r.val(t.cssStyle),a.val(t.alt),c.val(t.title),this.ui.toggleBtn(d,t.src),this.ui.onDialogShown(this.$dialog,()=>{this.context.triggerEvent("dialog.shown");function f(){L.isSupportTouch||i.trigger("focus")}f(),h.on("click.imageDialog",g=>{g.preventDefault(),u=$.Deferred(C=>{this.context.triggerEvent("file.browse",g,"image",C)}).promise(),u.then(C=>{i.val(C).trigger("change").trigger("input")}).always(()=>{f()})}),this.bindEnterKey(d),d.one("click",g=>{g.preventDefault(),e.resolve({img:t.img,src:t.src,alt:t.alt,title:t.title,cssClass:t.cssClass,cssStyle:t.cssStyle}),this.ui.hideDialog(this.$dialog)})}),this.ui.onDialogHidden(this.$dialog,()=>{this.$dialog.find(".note-input").off("keypress"),i.off(),d.off(),h.off(),e.state()==="pending"&&e.reject(),u&&u.state()==="pending"&&u.reject()}),this.ui.showDialog(this.$dialog)}).promise()}}class oa{constructor(t){this.context=t,this.editor=t.modules.editor,this.ui=$.summernote.ui,this.editable=t.layoutInfo.editable[0],this.options=t.options,this.events={"summernote.disable summernote.dialog.shown summernote.popover.shown":()=>{this.hide()},"summernote.blur":(e,i)=>{i.originalEvent&&i.originalEvent.relatedTarget?this.$popover[0].contains(i.originalEvent.relatedTarget)||this.hide():this.hide()}}}shouldInitialize(){return!p.isEmpty(this.options.popover.image)}initialize(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);const t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",e=>{e.preventDefault()})}destroy(){this.$popover.remove()}update(t,e){if(l.isImg(t)){const i=$(t),n=this.$popover.find(".note-unlink");if(n.length){const r=i.parent().is("a");n.toggle(r)}this.editor.showPopover(this.$popover,t)}else this.hide()}hide(){this.editor.hidePopover(this.$popover)}}class sa{constructor(t){this.context=t,this.editor=t.modules.editor,this.ui=$.summernote.ui,this.options=t.options,this.events={"summernote.mousedown":(e,i)=>{this.update(i==null?void 0:i.target,i)},"summernote.keyup summernote.scroll summernote.change":(e,i)=>{this.update(i==null?void 0:i.target,i)},"summernote.disable summernote.dialog.shown summernote.popover.shown":()=>{this.hide()},"summernote.blur":(e,i)=>{i.originalEvent&&i.originalEvent.relatedTarget?this.$popover[0].contains(i.originalEvent.relatedTarget)||this.hide():this.hide()}}}shouldInitialize(){return!p.isEmpty(this.options.popover.table)}initialize(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);const t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),L.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",e=>{e.preventDefault()})}destroy(){this.$popover.remove()}update(t,e){if(this.context.isDisabled()||(e==null?void 0:e.type)=="scroll")return!1;if((l.isCell(t)||l.isCell(t==null?void 0:t.parentElement))&&!(l.isVoid(t)||l.isAnchor(t)||l.isAnchor(t==null?void 0:t.parentElement))){const a=l.ancestor(t,l.isTable);return a&&this.editor.showPopover(this.$popover,a),!0}return this.hide(),!1}hide(){this.editor.hidePopover(this.$popover)}}class ia{constructor(t){this.context=t,this.ui=$.summernote.ui,this.$body=$(document.body),this.$editor=t.layoutInfo.editor,this.options=t.options,this.lang=this.options.langInfo}initialize(){const t=this.options.dialogsInBody?this.$body:this.options.container,e=['
',``,``,"
"].join(""),n=``;this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}bindEnterKey(t,e){t.on("keypress",i=>{i.keyCode===T.code.ENTER&&(i.preventDefault(),e.trigger("click"))})}createVideoNode(t){const e=/(?:youtu\.be\/|youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=|shorts\/|live\/))([^&\n?]+)(?:.*[?&]t=([^&\n]+))?.*/,i=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/,n=t.match(e),r=/(?:\.|\/\/)drive\.google\.com\/file\/d\/(.[a-zA-Z0-9_-]*)\/view/,a=t.match(r),c=/(?:www\.|\/\/)instagram\.com\/(reel|p)\/(.[a-zA-Z0-9_-]*)/,d=t.match(c),h=/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/,u=t.match(h),f=/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/,g=t.match(f),C=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,H=t.match(C),B=/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/,w=t.match(B),m=/\/\/(.*)\/videos\/watch\/([^?]*)(?:\?(?:start=(\w*))?(?:&stop=(\w*))?(?:&loop=([10]))?(?:&autoplay=([10]))?(?:&muted=([10]))?)?/,b=t.match(m),S=/\/\/v\.qq\.com.*?vid=(.+)/,N=t.match(S),j=/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/,I=t.match(j),tt=/^.+.(mp4|m4v)$/,Q=t.match(tt),U=/^.+.(ogg|ogv)$/,st=t.match(U),Ca=/^.+.(webm)$/,ya=t.match(Ca),wa=/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/,te=t.match(wa);let V;if(n&&n[1].length===11){const oe=n[1];var ht=0;if(typeof n[2]<"u"){const se=n[2].match(i);if(se)for(var ko=[3600,60,1],ut=0,ka=ko.length;ut").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+oe+(ht>0?"?start="+ht:"")).attr("width","640").attr("height","360")}else if(a&&a[0].length)V=$("