/*! * froala_editor v4.3.1 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2024 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o["default"]:o,Object.assign(o.DEFAULTS,{listAdvancedTypes:!0}),o.PLUGINS.lists=function(g){var u=g.$;function h(e){return'')}function N(e){return'')}function c(e,t){!function c(e,t){for(var a=[],n=0;n").concat(l.html(),""))}}(e,t);var a,n=g.html.defaultTag(),r=null;e.length&&(a="rtl"==g.opts.direction||"rtl"==u(e[0]).css("direction")?"margin-right":"margin-left");for(var o=0;o'):"<".concat(t,">"),s="");for(l-=r;0"),s+=s,l-=g.opts.indentMargin;n&&e[o].tagName.toLowerCase()==n?u(e[o]).replaceWith("".concat(i,"").concat(u(e[o]).html(),"").concat(s)):u(e[o]).wrap("".concat(i,"
  • ").concat(s))}g.clean.lists()}function d(e){var t,a,n=[];for(t=e.length-1;0<=t;t--)for(a=t-1;0<=a;a--){if(u(e[a]).find(e[t]).length||e[a]==e[t]){u(e[t]).addClass("fr-removed-block-".concat(t)),n.push(t),e.splice(t,1);break}if(u(e[a]).contains(e[t])){u(e[a]).addClass("fr-removed-block-".concat(a)),n.push(a),e.splice(a,1);break}}var r=[],o=!1;for(t=0;t ul, > ol").last();c.length&&c.wrap("<".concat(i.tagName,">"))}l.before(N("LI")),l.after(h("LI"))}else if("OL"==i.parentNode.tagName)o||(l.before(N("OL")),l.after(h("OL")));else if("UL"==i.parentNode.tagName)o||(l.before(N("UL")),l.after(h("UL")));else{var d="";s&&(d+=' class="'.concat(s,'"'));var p="rtl"==g.opts.direction||"rtl"==l.css("direction")?"margin-right":"margin-left";g.helpers.getPX(u(i).css(p))&&0<=(u(i).attr("style")||"").indexOf("".concat(p,":"))&&(d+=' style="'.concat(p,":").concat(g.helpers.getPX(u(i).css(p)),'px;"')),g.html.defaultTag()&&0===l.find(g.html.blockTagsQuery()).length&&l.wrapInner(g.html.defaultTag()+d),g.node.isEmpty(l.get(0),!0)||0!==l.find(g.html.blockTagsQuery()).length||("DIV"==i.parentNode.tagName&&g.html.defaultTag()?(l.prepend(h(g.html.defaultTag())),l.append(N(g.html.defaultTag()))):l.append("
    ")),l.append(h("LI")),l.prepend(N("LI"))}l.after(h(i.tagName)),"LI"==i.parentNode.tagName&&(i=i.parentNode.parentNode),r.indexOf(i)<0&&r.push(i)}for(t=0;t<\/span>/g,"")).replace(/<\/span>/g,"<$1>"),f.replaceWith(g.node.openTagString(f.get(0))+m+g.node.closeTagString(f.get(0)))}return g.$el.find("li:empty").remove(),g.$el.find("ul:empty, ol:empty").remove(),g.clean.lists(),g.$el.find("ul:empty, ol:empty").remove(),g.html.wrap(),n}function m(e,t){var a=u(document.createElement("li"));if(e.childNodes.length)for(var n=e.childNodes[0].attributes,r=0;r ul, > ol").last().get(0);if(r)m(r,e[a]),u(n).append(u(r)),u(e[a]).remove();else{var o=u(n).find("> ul, > ol").last().get(0);if(o)u(o).append(u(e[a]));else{var l=u("<".concat(e[a].parentNode.tagName,">"));u(n).append(l),l.append(u(e[a]))}}}else if(!n||"OL"!=n.tagName&&"UL"!=n.tagName){var i=e[a].parentNode;if(t=!0,"UL"==i.tagName||"OL"==i.tagName){var s=u(e[a]).find("> ol, > ul"),c=null==e[a].previousSibling;if(s.length){var d=s.first().get(0);m(d,e[a]),c?u(i).prepend(u(d)):u(i).append(u(d)),u(e[a]).remove()}else u(e[a]).wrap("<".concat(i.tagName,">"));c&&0 li").length&&u(i).attr("start","2")}}else{var p=u(e[a]).find("> ol, > ul").first().get(0);p?(m(p,e[a]),u(n).append(u(p).children()),u(e[a]).remove(),u(p).remove()):u(n).append(u(e[a]))}}g.clean.lists(),g.selection.restore()}(n):function s(e){g.selection.save();var t=[];do{t=d(e),e=[];for(var a=0;a