Liferay.Loader.define("dynamic-data-mapping-form-field-type$liferay-ckeditor@4.16.2-liferay.1/ckeditor/plugins/scayt/plugin", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    CKEDITOR.plugins.add("scayt", { requires: "menubutton,dialog", lang: "af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh", icons: "scayt", hidpi: !0, tabToOpen: null, dialogName: "scaytDialog", onLoad: function (a) {
        "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css"));
        CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path + "dialogs/dialog.css"));var c = !1;CKEDITOR.on("instanceLoaded", function (a) {
          if (!c && CKEDITOR.plugins.autocomplete) {
            c = !0;var b = CKEDITOR.plugins.autocomplete.prototype.getModel;CKEDITOR.plugins.autocomplete.prototype.getModel = function (a) {
              var d = this.editor;a = b.bind(this)(a);a.on("change-isActive", function (a) {
                a.data ? d.fire("autocompletePanelShow") : d.fire("autocompletePanelHide");
              });return a;
            };
          }
        });
      }, init: function (a) {
        var c = this,
            d = CKEDITOR.plugins.scayt;
        this.bindEvents(a);this.parseConfig(a);this.addRule(a);CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));this.addMenuItems(a);var b = a.lang.scayt,
            e = CKEDITOR.env;a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, { label: b.text_title, title: a.plugins.wsc ? a.lang.wsc.title : b.text_title, modes: { wysiwyg: !(e.ie && (8 > e.version || e.quirks)) }, toolbar: "spellchecker,20", refresh: function () {
            var b = a.ui.instances.Scayt.getState();a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
            a.fire("scaytButtonState", b);
          }, onRender: function () {
            var b = this;a.on("scaytButtonState", function (a) {
              void 0 !== typeof a.data && b.setState(a.data);
            });
          }, onMenu: function () {
            var b = a.scayt;a.getMenuItem("scaytToggle").label = a.lang.scayt[b && d.state.scayt[a.name] ? "btn_disable" : "btn_enable"];var c = { scaytToggle: CKEDITOR.TRISTATE_OFF, scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
              scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED };a.config.scayt_uiTabs[0] || delete c.scaytOptions;a.config.scayt_uiTabs[1] || delete c.scaytLangs;a.config.scayt_uiTabs[2] || delete c.scaytDict;b && !CKEDITOR.plugins.scayt.isNewUdSupported(b) && (delete c.scaytDict, a.config.scayt_uiTabs[2] = 0, CKEDITOR.plugins.scayt.alarmCompatibilityMessage());return c;
          } });a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function (b, d) {
          var e = a.scayt,
              l,
              m;e && (m = e.getSelectionNode()) && (l = c.menuGenerator(a, m), e.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" .")));return l;
        }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function (b) {
          return function () {
            var d = a.scayt;d && d.hideBanner();return b.apply(this);
          };
        }));
      }, addMenuItems: function (a) {
        var c = this,
            d = CKEDITOR.plugins.scayt;a.addMenuGroup("scaytButton");for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" + b[e];
        if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length) for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10);a.addCommand("scaytToggle", { exec: function (a) {
            var b = a.scayt;d.state.scayt[a.name] = !d.state.scayt[a.name];!0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a);
          } });a.addCommand("scaytAbout", { exec: function (a) {
            a.scayt.tabToOpen = "about";d.openDialog(c.dialogName, a);
          } });a.addCommand("scaytOptions", { exec: function (a) {
            a.scayt.tabToOpen = "options";d.openDialog(c.dialogName, a);
          } });a.addCommand("scaytLangs", { exec: function (a) {
            a.scayt.tabToOpen = "langs";d.openDialog(c.dialogName, a);
          } });a.addCommand("scaytDict", { exec: function (a) {
            a.scayt.tabToOpen = "dictionaries";d.openDialog(c.dialogName, a);
          } });b = { scaytToggle: { label: a.lang.scayt.btn_enable, group: "scaytButton", command: "scaytToggle" }, scaytAbout: { label: a.lang.scayt.btn_about, group: "scaytButton", command: "scaytAbout" }, scaytOptions: { label: a.lang.scayt.btn_options, group: "scaytButton", command: "scaytOptions" }, scaytLangs: { label: a.lang.scayt.btn_langs,
            group: "scaytButton", command: "scaytLangs" }, scaytDict: { label: a.lang.scayt.btn_dictionaries, group: "scaytButton", command: "scaytDict" } };a.plugins.wsc && (b.WSC = { label: a.lang.wsc.toolbar, group: "scaytButton", onClick: function () {
            var b = CKEDITOR.plugins.scayt,
                d = a.scayt,
                c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();(c = c.replace(/\s/g, "")) ? (d && b.state.scayt[a.name] && d.setMarkupPaused && d.setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert("Nothing to check!");
          } });
        a.addMenuItems(b);
      }, bindEvents: function (a) {
        var c = CKEDITOR.plugins.scayt,
            d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE,
            b = function () {
          c.destroy(a);
        },
            e = function () {
          !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a);
        },
            f = function () {
          var b = a.editable();b.attachListener(b, "focus", function (b) {
            CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;var c, k;if ((d || b) && a._.savedSelection) {
              b = a._.savedSelection.getSelectedElement();b = !b && a._.savedSelection.getRanges();for (var f = 0; f < b.length; f++) k = b[f], "string" === typeof k.startContainer.$.nodeValue && (c = k.startContainer.getText().length, (c < k.startOffset || c < k.endOffset) && a.unlockSelection(!1));
            }
          }, this, null, -10);
        },
            g = function () {
          d ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function () {
            setTimeout(b, 0);
          }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();f();var c = a.editable();c.attachListener(c, "mousedown", function (b) {
            b = b.data.getTarget();var d = a.widgets && a.widgets.getByElement(b);
            d && (d.wrapper = b.getAscendant(function (a) {
              return a.hasAttribute("data-cke-widget-wrapper");
            }, !0));
          }, this, null, -10);
        };a.on("contentDom", g);a.on("beforeCommandExec", function (b) {
          var d = a.scayt,
              e = !1,
              f = !1,
              h = !0;b.data.name in c.options.disablingCommandExec && "wysiwyg" == a.mode ? d && (c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b.data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data.name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !d || ("cut" === b.data.name && (h = !1, f = !0), "language" === b.data.name && (f = e = !0), a.fire("reloadMarkupScayt", { removeOptions: { removeInside: h, forceBookmark: f, language: e }, timeout: 0 }));
        });a.on("beforeSetMode", function (b) {
          if ("source" == b.data) {
            if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);a.document && a.document.getBody().removeAttribute("_jquid");
          }
        });a.on("afterCommandExec", function (b) {
          "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function () {
            c.reloadMarkup(a.scayt);
          }, 250);
        });a.on("readOnly", function (b) {
          var d;b && (d = a.scayt, !0 === b.editor.readOnly ? d && d.fire("removeMarkupInDocument", {}) : d ? c.reloadMarkup(d) : "wysiwyg" == b.editor.mode && !0 === c.state.scayt[b.editor.name] && (c.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)));
        });a.on("beforeDestroy", b);a.on("setData", function () {
          b();(a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g();
        }, this, null, 50);a.on("reloadMarkupScayt", function (b) {
          var d = b.data && b.data.removeOptions,
              e = b.data && b.data.timeout,
              f = b.data && b.data.language,
              h = a.scayt;h && setTimeout(function () {
            f && (d.selectionNode = a.plugins.language.getCurrentLangElement(a), d.selectionNode = d.selectionNode && d.selectionNode.$ || null);h.removeMarkupInSelectionNode(d);c.reloadMarkup(h);
          }, e || 0);
        });a.on("insertElement", function () {
          a.fire("reloadMarkupScayt", { removeOptions: { forceBookmark: !0 } });
        }, this, null, 50);a.on("insertHtml", function () {
          a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);a.fire("reloadMarkupScayt");
        }, this, null, 50);a.on("insertText", function () {
          a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);a.fire("reloadMarkupScayt");
        }, this, null, 50);a.on("scaytDialogShown", function (b) {
          b.data.selectPage(a.scayt.tabToOpen);
        });a.on("autocompletePanelShow", function (b) {
          (b = a.scayt) && b.setMarkupPaused && b.setMarkupPaused(!0);
        });a.on("autocompletePanelHide", function (b) {
          (b = a.scayt) && b.setMarkupPaused && b.setMarkupPaused(!1);
        });
      }, parseConfig: function (a) {
        var c = CKEDITOR.plugins.scayt;c.replaceOldOptionsNames(a.config);"boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);c.state.scayt[a.name] = a.config.scayt_autoStartup;"boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);"boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1);c.state.grayt[a.name] = a.config.grayt_autoStartup;a.config.scayt_contextCommands || (a.config.scayt_contextCommands = "ignoreall|add");a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control");a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 3;if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 3;if (void 0 === a.config.scayt_customDictionaryIds || "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = "";if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null;if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
          var d = [],
              b = [];a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");CKEDITOR.tools.search(a.config.scayt_uiTabs, function (a) {
            1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) : b.push(!1);
          });null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1];
        } else a.config.scayt_uiTabs = [1, 1, 1];"string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);"string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);"string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null);"string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions = "on");"string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");"string" !== typeof a.config.scayt_customPunctuation && (a.config.scayt_customPunctuation = "-");"string" !== typeof a.config.scayt_srcUrl && (a.config.scayt_srcUrl = "https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");"boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !0);"boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
        CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords = !1);a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1);a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
        a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1);if (a.config.scayt_disableOptionsStorage) {
          var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0,
              e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
              f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
              g = CKEDITOR.tools.search,
              k = CKEDITOR.tools.indexOf;a.config.scayt_disableOptionsStorage = function (a) {
            for (var b = [], d = 0; d < a.length; d++) {
              var c = a[d],
                  p = !!g(a, "options");if (!g(e, c) || p && g(f, function (a) {
                if ("lang" === a) return !1;
              })) return;g(f, c) && f.splice(k(f, c), 1);if ("all" === c || p && g(a, "lang")) return [];"options" === c && (f = ["lang"]);
            }return b = b.concat(f);
          }(c);
        }
      }, addRule: function (a) {
        var c = CKEDITOR.plugins.scayt,
            d = a.dataProcessor,
            b = d && d.htmlFilter,
            e = a._.elementsPath && a._.elementsPath.filters,
            d = d && d.dataFilter,
            f = a.addRemoveFormatFilter,
            k = function (b) {
          var d = !0;a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1);return d;
        };e && e.push(function (b) {
          if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute))) return !1;
        });d && d.addRules({ elements: { span: function (a) {
              var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
                  d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];c && (b || d) && delete a.name;return a;
            } } });b && b.addRules({ elements: { span: function (a) {
              var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
                  d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];c && (b || d) && delete a.name;return a;
            } } });f && f.call(a, k);
      }, scaytMenuDefinition: function (a) {
        var c = this,
            d = CKEDITOR.plugins.scayt;a = a.scayt;return { scayt: { scayt_ignore: { label: a.getLocal("btn_ignore"), group: "scayt_control", order: 1, exec: function (a) {
                a.scayt.ignoreWord();
              } }, scayt_ignoreall: { label: a.getLocal("btn_ignoreAll"), group: "scayt_control", order: 2, exec: function (a) {
                a.scayt.ignoreAllWords();
              } }, scayt_add: { label: a.getLocal("btn_addWord"), group: "scayt_control", order: 3, exec: function (a) {
                var d = a.scayt;setTimeout(function () {
                  d.addWordToUserDictionary();
                }, 10);
              } }, scayt_option: { label: a.getLocal("btn_options"),
              group: "scayt_control", order: 4, exec: function (a) {
                a.scayt.tabToOpen = "options";d.openDialog(c.dialogName, a);
              }, verification: function (a) {
                return 1 == a.config.scayt_uiTabs[0] ? !0 : !1;
              } }, scayt_language: { label: a.getLocal("btn_langs"), group: "scayt_control", order: 5, exec: function (a) {
                a.scayt.tabToOpen = "langs";d.openDialog(c.dialogName, a);
              }, verification: function (a) {
                return 1 == a.config.scayt_uiTabs[1] ? !0 : !1;
              } }, scayt_dictionary: { label: a.getLocal("btn_dictionaries"), group: "scayt_control", order: 6, exec: function (a) {
                a.scayt.tabToOpen = "dictionaries";d.openDialog(c.dialogName, a);
              }, verification: function (a) {
                return 1 == a.config.scayt_uiTabs[2] ? !0 : !1;
              } }, scayt_about: { label: a.getLocal("btn_about"), group: "scayt_control", order: 7, exec: function (a) {
                a.scayt.tabToOpen = "about";d.openDialog(c.dialogName, a);
              } } }, grayt: { grayt_problemdescription: { label: "Grammar problem description", group: "grayt_description", order: 1, state: CKEDITOR.TRISTATE_DISABLED, exec: function (a) {} }, grayt_ignore: { label: a.getLocal("btn_ignore"), group: "grayt_control", order: 2, exec: function (a) {
                a.scayt.ignorePhrase();
              } },
            grayt_ignoreall: { label: a.getLocal("btn_ignoreAll"), group: "grayt_control", order: 3, exec: function (a) {
                a.scayt.ignoreAllPhrases();
              } } } };
      }, buildSuggestionMenuItems: function (a, c, d) {
        var b = {},
            e = {},
            f = d ? "word" : "phrase",
            g = d ? "startGrammarCheck" : "startSpellCheck",
            k = a.scayt;if (0 < c.length && "no_any_suggestions" !== c[0]) {
          if (d) for (d = 0; d < c.length; d++) {
            var l = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g));d < a.config.scayt_maxSuggestions ? (a.addMenuItem(l, { label: c[d], command: l, group: "scayt_suggest", order: d + 1 }), b[l] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(l, { label: c[d], command: l, group: "scayt_moresuggest", order: d + 1 }), e[l] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", { label: k.getLocal("btn_moreSuggestions"), group: "scayt_moresuggest", order: 10, getItems: function () {
                return e;
              } }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF));
          } else for (d = 0; d < c.length; d++) l = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_"), a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)), a.addMenuItem(l, { label: c[d], command: l, group: "grayt_suggest", order: d + 1 }), b[l] = CKEDITOR.TRISTATE_OFF;
        } else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", { exec: function () {} }), a.addMenuItem("no_scayt_suggest", { label: k.getLocal("btn_noSuggestions") || "no_scayt_suggest", command: "no_scayt_suggest", group: "scayt_suggest", order: 0 });return b;
      }, menuGenerator: function (a, c) {
        var d = a.scayt,
            b = this.scaytMenuDefinition(a),
            e = {},
            f = a.config.scayt_contextCommands.split("|"),
            g = c.getAttribute(d.getLangAttribute()) || d.getLang(),
            k,
            l,
            m,
            n;l = d.isScaytNode(c);m = d.isGraytNode(c);l ? (b = b.scayt, k = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", { lang: g, word: k }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l)) : m && (b = b.grayt, e = c.getAttribute(d.getGraytNodeAttributeName()), d.getGraytNodeRuleAttributeName ? (k = c.getAttribute(d.getGraytNodeRuleAttributeName()), d.getProblemDescriptionText(e, k, g)) : d.getProblemDescriptionText(e, g), n = d.getProblemDescriptionText(e, k, g), b.grayt_problemdescription && n && (n = n.replace(/([.!?])\s/g, "$1\x3cbr\x3e"), b.grayt_problemdescription.label = n), d.fire("getGrammarSuggestionsList", { lang: g, phrase: e, rule: k }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l));if (l && "off" == a.config.scayt_contextCommands) return e;for (var h in b) l && -1 == CKEDITOR.tools.indexOf(f, h.replace("scayt_", "")) && "all" != a.config.scayt_contextCommands || m && "grayt_problemdescription" !== h && -1 == CKEDITOR.tools.indexOf(f, h.replace("grayt_", "")) && "all" != a.config.scayt_contextCommands || (e[h] = "undefined" != typeof b[h].state ? b[h].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof b[h].verification || b[h].verification(a) || delete e[h], a.addCommand(h, { exec: b[h].exec }), a.addMenuItem(h, { label: a.lang.scayt[b[h].label] || b[h].label, command: h, group: b[h].group, order: b[h].order }));return e;
      }, createCommand: function (a, c, d) {
        return { exec: function (b) {
            b = b.scayt;var e = {};e[c] = a;b.replaceSelectionNode(e);"startGrammarCheck" === d && b.removeMarkupInSelectionNode({ grammarOnly: !0 });b.fire(d);
          } };
      } });
    CKEDITOR.plugins.scayt = { charsToObserve: [{ charName: "cke-fillingChar", charCode: function () {
          var a = CKEDITOR.version,
              c = [4, 5, 6],
              d = String.fromCharCode(8203),
              b = Array(8).join(d),
              e,
              f;if (!a) return d;for (var a = a.split("."), g = 0; g < c.length; g++) {
            e = c[g];f = Number(a[g]);if (f > e) return b;if (f < e) break;
          }return d;
        }() }], state: { scayt: {}, grayt: {} }, warningCounter: 0, suggestions: [], options: { disablingCommandExec: { source: !0, newpage: !0, templates: !0 }, data_attribute_name: "data-scayt-word", misspelled_word_class: "scayt-misspell-word",
        problem_grammar_data_attribute: "data-grayt-phrase", problem_grammar_class: "gramm-problem" }, backCompatibilityMap: { scayt_service_protocol: "scayt_serviceProtocol", scayt_service_host: "scayt_serviceHost", scayt_service_port: "scayt_servicePort", scayt_service_path: "scayt_servicePath", scayt_customerid: "scayt_customerId" }, openDialog: function (a, c) {
        var d = c.scayt;d.isAllModulesReady && !1 === d.isAllModulesReady() || (c.lockSelection(), c.openDialog(a));
      }, alarmCompatibilityMessage: function () {
        5 > this.warningCounter && (console.warn("You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at support@webspellchecker.net."), this.warningCounter += 1);
      }, isNewUdSupported: function (a) {
        return a.getUserDictionary ? !0 : !1;
      }, reloadMarkup: function (a) {
        var c;a && (c = a.getScaytLangList(), a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(), c && c.ltr && c.rtl && a.fire("startSpellCheck, startGrammarCheck")));
      }, replaceOldOptionsNames: function (a) {
        for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c]);
      }, createScayt: function (a) {
        var c = this,
            d = CKEDITOR.plugins.scayt;this.loadScaytLibrary(a, function (a) {
          function e(a) {
            return new SCAYT.CKSCAYT(a, function () {}, function () {});
          }var f;a.window && (f = "BODY" == a.editable().$.nodeName ? a.window.getFrame() : a.editable());if (f) {
            f = { lang: a.config.scayt_sLang, container: f.$, customDictionary: a.config.scayt_customDictionaryIds, userDictionaryName: a.config.scayt_userDictionaryName, localization: a.langCode, customer_id: a.config.scayt_customerId, customPunctuation: a.config.scayt_customPunctuation, debug: a.config.scayt_debug, data_attribute_name: c.options.data_attribute_name, misspelled_word_class: c.options.misspelled_word_class,
              problem_grammar_data_attribute: c.options.problem_grammar_data_attribute, problem_grammar_class: c.options.problem_grammar_class, "options-to-restore": a.config.scayt_disableOptionsStorage, focused: a.editable().hasFocus, ignoreElementsRegex: a.config.scayt_elementsToIgnore, ignoreGraytElementsRegex: a.config.grayt_elementsToIgnore, minWordLength: a.config.scayt_minWordLength, graytAutoStartup: a.config.grayt_autoStartup, charsToObserve: d.charsToObserve };a.config.scayt_serviceProtocol && (f.service_protocol = a.config.scayt_serviceProtocol);
            a.config.scayt_serviceHost && (f.service_host = a.config.scayt_serviceHost);a.config.scayt_servicePort && (f.service_port = a.config.scayt_servicePort);a.config.scayt_servicePath && (f.service_path = a.config.scayt_servicePath);"boolean" === typeof a.config.scayt_ignoreAllCapsWords && (f["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords);"boolean" === typeof a.config.scayt_ignoreDomainNames && (f["ignore-domain-names"] = a.config.scayt_ignoreDomainNames);"boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases && (f["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases);"boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (f["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers);var g;try {
              g = e(f);
            } catch (k) {
              c.alarmCompatibilityMessage(), delete f.charsToObserve, g = e(f);
            }g.subscribe("suggestionListSend", function (a) {
              for (var b = {}, d = [], c = 0; c < a.suggestionList.length; c++) b["word_" + a.suggestionList[c]] || (b["word_" + a.suggestionList[c]] = a.suggestionList[c], d.push(a.suggestionList[c]));
              CKEDITOR.plugins.scayt.suggestions = d;
            });g.subscribe("selectionIsChanged", function (d) {
              a.getSelection().isLocked && "restoreSelection" !== d.action && a.lockSelection();"restoreSelection" === d.action && a.selectionChange(!0);
            });g.subscribe("graytStateChanged", function (c) {
              d.state.grayt[a.name] = c.state;
            });g.addMarkupHandler && g.addMarkupHandler(function (d) {
              var c = a.editable(),
                  e = c.getCustomData(d.charName);e && (e.$ = d.node, c.setCustomData(d.charName, e));
            });a.scayt = g;a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON);
          } else d.state.scayt[a.name] = !1;
        });
      }, destroy: function (a) {
        a.scayt && a.scayt.destroy();delete a.scayt;a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF);
      }, loadScaytLibrary: function (a, c) {
        var d,
            b = function () {
          CKEDITOR.fireOnce("scaytReady");a.scayt || "function" === typeof c && c(a);
        };"undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (d = a.config.scayt_srcUrl, CKEDITOR.scriptLoader.load(d, function (a) {
          a && b();
        })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && b();
      } };
    CKEDITOR.on("dialogDefinition", function (a) {
      var c = a.data.name;a = a.data.definition.dialog;"scaytDialog" !== c && "checkspell" !== c && (a.on("show", function (a) {
        a = a.sender && a.sender.getParentEditor();var b = CKEDITOR.plugins.scayt,
            c = a.scayt;c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0);
      }), a.on("hide", function (a) {
        a = a.sender && a.sender.getParentEditor();var b = CKEDITOR.plugins.scayt,
            c = a.scayt;c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);
      }));if ("scaytDialog" === c) a.on("cancel", function (a) {
        return !1;
      }, this, null, -1);if ("checkspell" === c) a.on("cancel", function (a) {
        a = a.sender && a.sender.getParentEditor();var b = CKEDITOR.plugins.scayt,
            c = a.scayt;c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);a.unlockSelection();
      }, this, null, -2);if ("link" === c) a.on("ok", function (a) {
        var b = a.sender && a.sender.getParentEditor();b && setTimeout(function () {
          b.fire("reloadMarkupScayt", { removeOptions: { removeInside: !0, forceBookmark: !0 }, timeout: 0 });
        }, 0);
      });if ("replace" === c) a.on("hide", function (a) {
        a = a.sender && a.sender.getParentEditor();var b = CKEDITOR.plugins.scayt,
            c = a.scayt;a && setTimeout(function () {
          c && (c.fire("removeMarkupInDocument", {}), b.reloadMarkup(c));
        }, 0);
      });
    });
    CKEDITOR.on("scaytReady", function () {
      if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
        var a = CKEDITOR.editor.prototype;a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function (a) {
          return function () {
            var b = null,
                c = this.scayt;if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) {
              if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()),
                  c = c.removeMarkupFromString(this._.previousValue),
                  b = b && c !== f;
            } else b = a.call(this);return b;
          };
        });a.resetDirty = CKEDITOR.tools.override(a.resetDirty, function (a) {
          return function () {
            var b = this.scayt;CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this);
          };
        });
      }if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
        var a = CKEDITOR.plugins.undo.Image.prototype,
            c = "function" == typeof a.equalsContent ? "equalsContent" : "equals";a[c] = CKEDITOR.tools.override(a[c], function (a) {
          return function (b) {
            var c = b.editor.scayt,
                f = this.contents,
                g = b.contents,
                k = null;CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c.removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || "");k = a.apply(this, arguments);this.contents = f;b.contents = g;return k;
          };
        });
      }
    });
  }
});
//# sourceMappingURL=plugin.js.map