{"version":3,"file":"ext-spellcheck-6c8cb779.js","sources":["../../node_modules/ace-builds/src-noconflict/ext-spellcheck.js"],"sourcesContent":["ace.define(\"ace/ext/spellcheck\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/editor\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar event = require(\"../lib/event\");\nexports.contextMenuHandler = function (e) {\n var host = e.target;\n var text = host.textInput.getElement();\n if (!host.selection.isEmpty())\n return;\n var c = host.getCursorPosition();\n var r = host.session.getWordRange(c.row, c.column);\n var w = host.session.getTextRange(r);\n host.session.tokenRe.lastIndex = 0;\n if (!host.session.tokenRe.test(w))\n return;\n var PLACEHOLDER = \"\\x01\\x01\";\n var value = w + \" \" + PLACEHOLDER;\n text.value = value;\n text.setSelectionRange(w.length, w.length + 1);\n text.setSelectionRange(0, 0);\n text.setSelectionRange(0, w.length);\n var afterKeydown = false;\n event.addListener(text, \"keydown\", function onKeydown() {\n event.removeListener(text, \"keydown\", onKeydown);\n afterKeydown = true;\n });\n host.textInput.setInputHandler(function (newVal) {\n if (newVal == value)\n return '';\n if (newVal.lastIndexOf(value, 0) === 0)\n return newVal.slice(value.length);\n if (newVal.substr(text.selectionEnd) == value)\n return newVal.slice(0, -value.length);\n if (newVal.slice(-2) == PLACEHOLDER) {\n var val = newVal.slice(0, -2);\n if (val.slice(-1) == \" \") {\n if (afterKeydown)\n return val.substring(0, text.selectionEnd);\n val = val.slice(0, -1);\n host.session.replace(r, val);\n return \"\";\n }\n }\n return newVal;\n });\n};\nvar Editor = require(\"../editor\").Editor;\nrequire(\"../config\").defineOptions(Editor.prototype, \"editor\", {\n spellcheck: {\n set: function (val) {\n var text = this.textInput.getElement();\n text.spellcheck = !!val;\n if (!val)\n this.removeListener(\"nativecontextmenu\", exports.contextMenuHandler);\n else\n this.on(\"nativecontextmenu\", exports.contextMenuHandler);\n },\n value: true\n }\n});\n\n}); (function() {\n ace.require([\"ace/ext/spellcheck\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n "],"names":["require","exports","module","event","e","host","text","c","r","w","PLACEHOLDER","value","afterKeydown","onKeydown","newVal","val","Editor","m"],"mappings":"gaAAA,IAAI,OAAO,qBAAqB,CAAC,UAAU,UAAU,SAAS,gBAAgB,aAAa,YAAY,EAAG,SAASA,EAASC,EAASC,EAAO,CAC5I,IAAIC,EAAQH,EAAQ,cAAc,EAClCC,EAAQ,mBAAqB,SAAUG,EAAG,CACtC,IAAIC,EAAOD,EAAE,OACTE,EAAOD,EAAK,UAAU,WAAU,EACpC,GAAKA,EAAK,UAAU,QAAS,EAE7B,KAAIE,EAAIF,EAAK,oBACTG,EAAIH,EAAK,QAAQ,aAAaE,EAAE,IAAKA,EAAE,MAAM,EAC7CE,EAAIJ,EAAK,QAAQ,aAAaG,CAAC,EAEnC,GADAH,EAAK,QAAQ,QAAQ,UAAY,EAC7B,EAACA,EAAK,QAAQ,QAAQ,KAAKI,CAAC,EAEhC,KAAIC,EAAc,KACdC,EAAQF,EAAI,IAAMC,EACtBJ,EAAK,MAAQK,EACbL,EAAK,kBAAkBG,EAAE,OAAQA,EAAE,OAAS,CAAC,EAC7CH,EAAK,kBAAkB,EAAG,CAAC,EAC3BA,EAAK,kBAAkB,EAAGG,EAAE,MAAM,EAClC,IAAIG,EAAe,GACnBT,EAAM,YAAYG,EAAM,UAAW,SAASO,GAAY,CACpDV,EAAM,eAAeG,EAAM,UAAWO,CAAS,EAC/CD,EAAe,EACvB,CAAK,EACDP,EAAK,UAAU,gBAAgB,SAAUS,EAAQ,CAC7C,GAAIA,GAAUH,EACV,MAAO,GACX,GAAIG,EAAO,YAAYH,EAAO,CAAC,IAAM,EACjC,OAAOG,EAAO,MAAMH,EAAM,MAAM,EACpC,GAAIG,EAAO,OAAOR,EAAK,YAAY,GAAKK,EACpC,OAAOG,EAAO,MAAM,EAAG,CAACH,EAAM,MAAM,EACxC,GAAIG,EAAO,MAAM,EAAE,GAAKJ,EAAa,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