Liferay.Loader.define("liferay!layout-content-page-editor-web$codemirror@5.65.2/addon/hint/javascript-hint",["module","exports","require","../../lib/codemirror"],(function(t,e,r){window,function(t){var e=t.Pos;function forEach(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function scriptHint(r,n,o,i){var a=r.getCursor(),s=o(r,a);if(!/\b(?:string|comment)\b/.test(s.type)){var f=t.innerMode(r.getMode(),s.state);if("json"!==f.mode.helperType){s.state=f.state,/^[\w$_]*$/.test(s.string)?s.end>a.ch&&(s.end=a.ch,s.string=s.string.slice(0,a.ch-s.start)):s={start:a.ch,end:a.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var l=s;"property"==l.type;){if("."!=(l=o(r,e(a.line,l.start))).string)return;if(l=o(r,e(a.line,l.start)),!c)var c=[];c.push(l)}return{list:getCompletions(s,c,n,i),from:e(a.line,s.start),to:e(a.line,s.end)}}}}function getCoffeeScriptToken(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",(function javascriptHint(t,e){return scriptHint(t,i,(function(t,e){return t.getTokenAt(e)}),e)})),t.registerHelper("hint","coffeescript",(function coffeescriptHint(t,e){return scriptHint(t,a,getCoffeeScriptToken,e)}));var r="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),n="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),o="prototype apply call bind".split(" "),i="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),a="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function getCompletions(t,e,i,a){var s=[],f=t.string,l=a&&a.globalScope||window;function maybeAdd(t){0!=t.lastIndexOf(f,0)||function arrayContains(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(s,t)||s.push(t)}function gatherCompletions(t){"string"==typeof t?forEach(r,maybeAdd):t instanceof Array?forEach(n,maybeAdd):t instanceof Function&&forEach(o,maybeAdd),function forAllProps(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,maybeAdd)}if(e&&e.length){var c,p=e.pop();for(p.type&&0===p.type.indexOf("variable")?(a&&a.additionalContext&&(c=a.additionalContext[p.string]),a&&!1===a.useGlobalScope||(c=c||l[p.string])):"string"==p.type?c="":"atom"==p.type?c=1:"function"==p.type&&(null==l.jQuery||"$"!=p.string&&"jQuery"!=p.string||"function"!=typeof l.jQuery?null!=l._&&"_"==p.string&&"function"==typeof l._&&(c=l._()):c=l.jQuery());null!=c&&e.length;)c=c[e.pop().string];null!=c&&gatherCompletions(c)}else{for(var d=t.state.localVars;d;d=d.next)maybeAdd(d.name);for(var u=t.state.context;u;u=u.prev)for(d=u.vars;d;d=d.next)maybeAdd(d.name);for(d=t.state.globalVars;d;d=d.next)maybeAdd(d.name);if(a&&null!=a.additionalContext)for(var y in a.additionalContext)maybeAdd(y);a&&!1===a.useGlobalScope||gatherCompletions(l),forEach(i,maybeAdd)}return s}}("object"==typeof e&&"object"==typeof t?r("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=javascript-hint.js.map