All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ber-security.graylog.graylog-plugin-correlation-count.6.0.0.source-code.c19292ad0187d75dd9580319cbfd5688.js Maven / Gradle / Ivy

There is a newer version: 5.1.3
Show newest version
(()=>{var Y=(f,w)=>()=>(w||f((w={exports:{}}).exports,w),w.exports);var J=Y((G,K)=>{ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(f,w,U){"use strict";var A=f("./lib/dom"),C=f("./lib/oop"),_=f("./lib/event_emitter").EventEmitter,y=f("./lib/lang"),m=f("./range").Range,g=f("./range_list").RangeList,S=f("./keyboard/hash_handler").HashHandler,x=f("./tokenizer").Tokenizer,R=f("./clipboard"),P={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,i,t){var n=e.session.getTextRange();return t?n.replace(/\n\r?([ \t]*\S)/g,`
`+t+"$1"):n},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return R.getText&&R.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var i=e.session.$mode||{};return i.blockComment&&i.blockComment.start||""},BLOCK_COMMENT_END:function(e){var i=e.session.$mode||{};return i.blockComment&&i.blockComment.end||""},LINE_COMMENT:function(e){var i=e.session.$mode||{};return i.lineCommentStart||""},CURRENT_YEAR:E.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:E.bind(null,{year:"2-digit"}),CURRENT_MONTH:E.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:E.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:E.bind(null,{month:"short"}),CURRENT_DATE:E.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:E.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:E.bind(null,{weekday:"short"}),CURRENT_HOUR:E.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:E.bind(null,{minute:"2-digit"}),CURRENT_SECOND:E.bind(null,{second:"2-digit"})};P.SELECTED_TEXT=P.SELECTION;function E(e){var i=new Date().toLocaleString("en-us",e);return i.length==1?"0"+i:i}var M=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=P}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function i(o){return o=o.substr(1),/^\d+$/.test(o)?[{tabstopId:parseInt(o,10)}]:[{text:o}]}function t(o){return"(?:[^\\\\"+o+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(o,c,l){var s=l[0];return s.fmtString=!0,s.guard=o.slice(1,-1),s.flag="",""},next:"formatString"};return e.$tokenizer=new x({start:[{regex:/\\./,onMatch:function(o,c,l){var s=o[1];return(s=="}"&&l.length||"`$\\".indexOf(s)!=-1)&&(o=s),[o]}},{regex:/}/,onMatch:function(o,c,l){return[l.length?l.shift():o]}},{regex:/\$(?:\d+|\w+)/,onMatch:i},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(o,c,l){var s=i(o.substr(1));return l.unshift(s[0]),s},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(o,c,l){var s=o.slice(1,-1).replace(/\\[,|\\]|,/g,function(p){return p.length==2?p[1]:"\0"}).split("\0").map(function(p){return{value:p}});return l[0].choices=s,[s[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(o,c,l){return l.length&&l[0].expectElse?(l[0].expectElse=!1,l[0].ifEnd={elseEnd:l[0]},[l[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(o,c,l){var s=o[1];return s=="}"&&l.length||"`$\\".indexOf(s)!=-1?o=s:s=="n"?o=`
`:s=="t"?o="	":"ulULE".indexOf(s)!=-1&&(o={changeCase:s,local:s>"a"}),[o]}},{regex:"/\\w*}",onMatch:function(o,c,l){var s=l.shift();return s&&(s.flag=o.slice(1,-1)),this.next=s&&s.tabstopId?"start":"",[s||o]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(o,c,l){return[{text:o.slice(1)}]}},{regex:/\${\w+/,onMatch:function(o,c,l){var s={text:o.slice(2)};return l.unshift(s),[s]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(o,c,l){var s=l.shift();return this.next=s&&s.tabstopId?"start":"",[s||o]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(o,c,l){var s=l[0];return s.formatFunction=o.slice(2,-1),[l.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(o,c,l){o[1]=="+"&&(l[0].ifEnd=l[0]),o[1]=="?"&&(l[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(i,t){return this.getTokenizer().getLineTokens(i,t).tokens.map(function(n){return n.value||n})},e.prototype.getVariableValue=function(i,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var o=this.variables[t];return typeof o=="function"&&(o=this.variables[t](i,t,n)),o==null?"":o},e.prototype.tmStrFormat=function(i,t,n){if(!t.fmt)return i;var o=t.flag||"",c=t.guard;c=new RegExp(c,o.replace(/[^gim]/g,""));var l=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,p=i.replace(c,function(){var a=s.variables.__;s.variables.__=[].slice.call(arguments);for(var h=s.resolveVariables(l,n),v="E",u=0;u=0&&p.splice(a,1)}}i.content?c(i):Array.isArray(i)&&i.forEach(c)},e.prototype.parseSnippetFile=function(i){i=i.replace(/\r/g,"");for(var t=[],n={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,c;c=o.exec(i);){if(c[1])try{n=JSON.parse(c[1]),t.push(n)}catch{}if(c[4])n.content=c[4].replace(/^\t/gm,""),t.push(n),n={};else{var l=c[2],s=c[3];if(l=="regex"){var p=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=p.exec(s)[1],n.trigger=p.exec(s)[1],n.endTrigger=p.exec(s)[1],n.endGuard=p.exec(s)[1]}else l=="snippet"?(n.tabTrigger=s.match(/^\S*/)[0],n.name||(n.name=s)):l&&(n[l]=s)}}return t},e.prototype.getSnippetByName=function(i,t){var n=this.snippetNameMap,o;return this.getActiveScopes(t).some(function(c){var l=n[c];return l&&(o=l[i]),!!o},this),o},e}();C.implement(M.prototype,_);var O=function(e,i,t){t===void 0&&(t={});var n=e.getCursorPosition(),o=e.session.getLine(n.row),c=e.session.getTabString(),l=o.match(/^\s*/)[0];n.column1?(z=F[F.length-1].length,N+=F.length-1):z+=$.length,B+=$}else $&&($.start?$.end={row:N,column:z}:$.start={row:N,column:z})}),{text:B,tabstops:p,tokens:s}},H=function(){function e(i){if(this.index=0,this.ranges=[],this.tabstops=[],i.tabstopManager)return i.tabstopManager;i.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=y.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(i)}return e.prototype.attach=function(i){this.$openTabstops=null,this.selectedTabstop=null,this.editor=i,this.session=i.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},e.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},e.prototype.onChange=function(i){for(var t=i.action[0]=="r",n=this.selectedTabstop||{},o=n.parents||{},c=this.tabstops.slice(),l=0;l2&&(this.tabstops.length&&s.push(s.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,s))},e.prototype.addTabstopMarkers=function(i){var t=this.session;i.forEach(function(n){n.markerId||(n.markerId=t.addMarker(n,"ace_snippet-marker","text"))})},e.prototype.removeTabstopMarkers=function(i){var t=this.session;i.forEach(function(n){t.removeMarker(n.markerId),n.markerId=null})},e.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var i=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&i--,this.tabstops.forEach(function(t){t.snippetId===i?this.addTabstopMarkers(t):this.removeTabstopMarkers(t)},this)}},e.prototype.removeRange=function(i){var t=i.tabstop.indexOf(i);t!=-1&&i.tabstop.splice(t,1),t=this.ranges.indexOf(i),t!=-1&&this.ranges.splice(t,1),t=i.tabstop.rangeList.ranges.indexOf(i),t!=-1&&i.tabstop.splice(t,1),this.session.removeMarker(i.markerId),i.tabstop.length||(t=this.tabstops.indexOf(i.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},e}();H.prototype.keyboardHandler=new S,H.prototype.keyboardHandler.bindKeys({Tab:function(e){w.snippetManager&&w.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var L=function(e,i){e.row==0&&(e.column+=i.column),e.row+=i.row},d=function(e,i){e.row==i.row&&(e.column-=i.column),e.row-=i.row};A.importCssString(`
.ace_snippet-marker {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    background: rgba(194, 193, 208, 0.09);
    border: 1px dotted rgba(211, 208, 235, 0.62);
    position: absolute;
}`,"snippets.css",!1),w.snippetManager=new M;var r=f("./editor").Editor;(function(){this.insertSnippet=function(e,i){return w.snippetManager.insertSnippet(this,e,i)},this.expandSnippet=function(e){return w.snippetManager.expandWithTab(this,e)}}).call(r.prototype)});ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(f,w,U){"use strict";var A=function(){function C(_){this.editor=_,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return C.prototype.setScreenReaderContent=function(_){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var m=this.popup.getRow(),g=this.popup.renderer.$textLayer,S=g.element.childNodes[m-g.config.firstRow];if(S){for(var x="doc-tooltip ",R=0;R=D?h="bottom":h="top"),h==="top"?(N.bottom=p.top-this.$borderSize,N.top=N.bottom-D):h==="bottom"&&(N.top=p.top+a+this.$borderSize,N.bottom=N.top+D);var $=N.top>=0&&N.bottom<=b;if(!v&&!$)return!1;$?k.$maxPixelHeight=null:h==="top"?k.$maxPixelHeight=B:k.$maxPixelHeight=z,h==="top"?(u.style.top="",u.style.bottom=b-N.bottom+"px",e.isTopdown=!1):(u.style.top=N.top+"px",u.style.bottom="",e.isTopdown=!0),u.style.display="";var F=p.left;return F+u.offsetWidth>T&&(F=T-u.offsetWidth),u.style.left=F+"px",u.style.right="",e.isOpen||(e.isOpen=!0,this._signal("show"),t=null),e.anchorPos=p,e.anchor=h,!0},e.show=function(p,a,h){this.tryShow(p,a,h?"bottom":void 0,!0)},e.goTo=function(p){var a=this.getRow(),h=this.session.getLength()-1;switch(p){case"up":a=a<=0?h:a-1;break;case"down":a=a>=h?-1:a+1;break;case"start":a=0;break;case"end":a=h;break}this.setRow(a)},e.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},e.$imageSize=0,e.$borderSize=1,e}return L}();g.importCssString(`
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
    background-color: #CAD6FA;
    z-index: 1;
}
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
    background-color: #3a674e;
}
.ace_editor.ace_autocomplete .ace_line-hover {
    border: 1px solid #abbffe;
    margin-top: -1px;
    background: rgba(233,233,253,0.4);
    position: absolute;
    z-index: 2;
}
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
    border: 1px solid rgba(109, 150, 13, 0.8);
    background: rgba(58, 103, 78, 0.62);
}
.ace_completion-meta {
    opacity: 0.5;
    margin-left: 0.9em;
}
.ace_completion-message {
    margin-left: 0.9em;
    color: blue;
}
.ace_editor.ace_autocomplete .ace_completion-highlight{
    color: #2d69c7;
}
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
    color: #93ca12;
}
.ace_editor.ace_autocomplete {
    width: 300px;
    z-index: 200000;
    border: 1px lightgray solid;
    position: fixed;
    box-shadow: 2px 3px 5px rgba(0,0,0,.2);
    line-height: 1.4;
    background: #fefefe;
    color: #111;
}
.ace_dark.ace_editor.ace_autocomplete {
    border: 1px #484747 solid;
    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
    line-height: 1.4;
    background: #25282c;
    color: #c1c1c1;
}
.ace_autocomplete .ace_text-layer  {
    width: calc(100% - 8px);
}
.ace_autocomplete .ace_line {
    display: flex;
    align-items: center;
}
.ace_autocomplete .ace_line > * {
    min-width: 0;
    flex: 0 0 auto;
}
.ace_autocomplete .ace_line .ace_ {
    flex: 0 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ace_autocomplete .ace_completion-spacer {
    flex: 1;
}
.ace_autocomplete.ace_loading:after  {
    content: "";
    position: absolute;
    top: 0px;
    height: 2px;
    width: 8%;
    background: blue;
    z-index: 100;
    animation: ace_progress 3s infinite linear;
    animation-delay: 300ms;
    transform: translateX(-100%) scaleX(1);
}
@keyframes ace_progress {
    0% { transform: translateX(-100%) scaleX(1) }
    50% { transform: translateX(625%) scaleX(2) } 
    100% { transform: translateX(1500%) scaleX(3) } 
}
@media (prefers-reduced-motion) {
    .ace_autocomplete.ace_loading:after {
        transform: translateX(625%) scaleX(2);
        animation: none;
     }
}
`,"autocompletion.css",!1),w.AcePopup=H,w.$singleLineEditor=O,w.getAriaId=R});ace.define("ace/autocomplete/util",["require","exports","module"],function(f,w,U){"use strict";w.parForEach=function(C,_,y){var m=0,g=C.length;g===0&&y();for(var S=0;S=0&&y.test(C[g]);g--)m.push(C[g]);return m.reverse().join("")},w.retrieveFollowingIdentifier=function(C,_,y){y=y||A;for(var m=[],g=_;g0)for(var e=this.popup.getFirstVisibleRow();e<=this.popup.getLastVisibleRow();e++){var i=this.popup.getData(e);i&&(!r||i.hideInlinePreview)&&this.$seen(i)}},d.prototype.$onPopupShow=function(r){this.$onPopupChange(r),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},d.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var r=this.editor.container.parentNode,e=[];r;)e.push(r),r.addEventListener("scroll",this.onLayoutChange,{passive:!0}),r=r.parentNode;this.$elements=e}},d.prototype.unObserveLayoutChanges=function(){var r=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(e){e.removeEventListener("scroll",r.onLayoutChange,{passive:!0})}),this.$elements=null},d.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},d.prototype.$updatePopupPosition=function(){var r=this.editor,e=r.renderer,i=e.layerConfig.lineHeight,t=e.$cursorLayer.getPixelPosition(this.base,!0);t.left-=this.popup.getTextLeftOffset();var n=r.container.getBoundingClientRect();t.top+=n.top-e.layerConfig.offset,t.left+=n.left-r.renderer.scrollLeft,t.left+=e.gutterWidth;var o={top:t.top,left:t.left};e.$ghostText&&e.$ghostTextWidget&&this.base.row===e.$ghostText.position.row&&(o.top+=e.$ghostTextWidget.el.offsetHeight);var c=r.container.getBoundingClientRect().bottom-i,l=cthis.filterText&&r.lastIndexOf(this.filterText,0)===0)var e=this.filtered;else var e=this.all;this.filterText=r,e=this.filterCompletions(e,this.filterText),e=e.sort(function(t,n){return n.exactMatch-t.exactMatch||n.$score-t.$score||(t.caption||t.value).localeCompare(n.caption||n.value)});var i=null;e=e.filter(function(t){var n=t.snippet||t.caption||t.value;return n===i?!1:(i=n,!0)}),this.filtered=e},d.prototype.filterCompletions=function(r,e){var i=[],t=e.toUpperCase(),n=e.toLowerCase();e:for(var o=0,c;c=r[o];o++){var l=!this.ignoreCaption&&c.caption||c.value||c.snippet;if(l){var s=-1,p=0,a=0,h,v;if(this.exactMatch){if(e!==l.substr(0,e.length))continue e}else{var u=l.toLowerCase().indexOf(n);if(u>-1)a=u;else for(var b=0;b=0&&(k<0||T0&&(s===-1&&(a+=10),a+=v,p=p|1<=i.length&&(i=void 0),{value:i&&i[o++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},C=f("../tooltip").Tooltip,_=f("../lib/event_emitter").EventEmitter,y=f("../lib/lang"),m=f("../lib/dom"),g=f("../lib/oop"),S=f("../lib/useragent"),x="command_bar_tooltip_button",R="command_bar_button_value",P="command_bar_button_caption",E="command_bar_keybinding",M="command_bar_tooltip",O="MoreOptionsButton",H=100,L=4,d=function(i,t){return t.row>i.row||t.row===i.row&&t.column>i.column?i:t},r={Ctrl:{mac:"^"},Option:{mac:"\u2325"},Command:{mac:"\u2318"},Cmd:{mac:"\u2318"},Shift:"\u21E7",Left:"\u2190",Right:"\u2192",Up:"\u2191",Down:"\u2193"},e=function(){function i(t,n){var o,c;n=n||{},this.parentNode=t,this.tooltip=new C(this.parentNode),this.moreOptions=new C(this.parentNode),this.maxElementsOnTooltip=n.maxElementsOnTooltip||L,this.$alwaysShow=n.alwaysShow||!1,this.eventListeners={},this.elements={},this.commands={},this.tooltipEl=m.buildDom(["div",{class:M}],this.tooltip.getElement()),this.moreOptionsEl=m.buildDom(["div",{class:M+" tooltip_more_options"}],this.moreOptions.getElement()),this.$showTooltipTimer=y.delayedCall(this.$showTooltip.bind(this),n.showDelay||H),this.$hideTooltipTimer=y.delayedCall(this.$hideTooltip.bind(this),n.hideDelay||H),this.$tooltipEnter=this.$tooltipEnter.bind(this),this.$onMouseMove=this.$onMouseMove.bind(this),this.$onChangeScroll=this.$onChangeScroll.bind(this),this.$onEditorChangeSession=this.$onEditorChangeSession.bind(this),this.$scheduleTooltipForHide=this.$scheduleTooltipForHide.bind(this),this.$preventMouseEvent=this.$preventMouseEvent.bind(this);try{for(var l=A(["mousedown","mouseup","click"]),s=l.next();!s.done;s=l.next()){var p=s.value;this.tooltip.getElement().addEventListener(p,this.$preventMouseEvent),this.moreOptions.getElement().addEventListener(p,this.$preventMouseEvent)}}catch(a){o={error:a}}finally{try{s&&!s.done&&(c=l.return)&&c.call(l)}finally{if(o)throw o.error}}}return i.prototype.registerCommand=function(t,n){var o=Object.keys(this.commands).length=v.top&&s.top<=v.bottom&&s.left>=v.left+t.gutterWidth&&s.left<=v.right;if(!u&&this.isShown()){this.$hideTooltip();return}else if(u&&!this.isShown()&&this.getAlwaysShow()){this.$showTooltip();return}var b=s.top-p.offsetHeight,T=Math.min(a-p.offsetWidth,s.left),k=b>=0&&b+p.offsetHeight<=h&&T>=0&&T+p.offsetWidth<=a;if(!k){this.$hideTooltip();return}if(this.tooltip.setPosition(T,b),this.isMoreOptionsShown()){b=b+p.offsetHeight,T=this.elements[O].getBoundingClientRect().left;var D=this.moreOptions.getElement(),h=window.innerHeight;b+D.offsetHeight>h&&(b-=p.offsetHeight+D.offsetHeight),T+D.offsetWidth>a&&(T=a-D.offsetWidth),this.moreOptions.setPosition(T,b)}}}},i.prototype.update=function(){Object.keys(this.elements).forEach(this.$updateElement.bind(this))},i.prototype.detach=function(){this.tooltip.hide(),this.moreOptions.hide(),this.$updateOnHoverHandlers(!1),this.editor&&(this.editor.off("changeSession",this.$onEditorChangeSession),this.editor.session&&(this.editor.session.off("changeScrollLeft",this.$onChangeScroll),this.editor.session.off("changeScrollTop",this.$onChangeScroll))),this.$mouseInTooltip=!1,this.editor=null},i.prototype.destroy=function(){this.tooltip&&this.moreOptions&&(this.detach(),this.tooltip.destroy(),this.moreOptions.destroy()),this.eventListeners={},this.commands={},this.elements={},this.tooltip=this.moreOptions=this.parentNode=null},i.prototype.$createCommand=function(t,n,o){var c=o?this.tooltipEl:this.moreOptionsEl,l=[],s=n.bindKey;s&&(typeof s=="object"&&(s=S.isMac?s.mac:s.win),s=s.split("|")[0],l=s.split("-"),l=l.map(function(h){if(r[h]){if(typeof r[h]=="string")return r[h];if(S.isMac&&r[h].mac)return r[h].mac}return h}));var p;o&&n.iconCssClass?p=["div",{class:["ace_icon_svg",n.iconCssClass].join(" "),"aria-label":n.name+" ("+n.bindKey+")"}]:(p=[["div",{class:R}],["div",{class:P},n.name]],l.length&&p.push(["div",{class:E},l.map(function(h){return["div",h]})])),m.buildDom(["div",{class:[x,n.cssClass||""].join(" "),ref:t},p],c,this.elements),this.commands[t]=n;var a=function(h){this.editor&&this.editor.focus(),this.$shouldHideMoreOptions=this.isMoreOptionsShown(),!this.elements[t].disabled&&n.exec&&n.exec(this.editor),this.$shouldHideMoreOptions&&this.$setMoreOptionsVisibility(!1),this.update(),h.preventDefault()}.bind(this);this.eventListeners[t]=a,this.elements[t].addEventListener("click",a.bind(this)),this.$updateElement(t)},i.prototype.$setMoreOptionsVisibility=function(t){t?(this.moreOptions.setTheme(this.editor.renderer.theme),this.moreOptions.setClassName(M+"_wrapper"),this.moreOptions.show(),this.update(),this.updatePosition()):this.moreOptions.hide()},i.prototype.$onEditorChangeSession=function(t){t.oldSession&&(t.oldSession.off("changeScrollTop",this.$onChangeScroll),t.oldSession.off("changeScrollLeft",this.$onChangeScroll)),this.detach()},i.prototype.$onChangeScroll=function(){this.editor.renderer&&(this.isShown()||this.getAlwaysShow())&&this.editor.renderer.once("afterRender",this.updatePosition.bind(this))},i.prototype.$onMouseMove=function(t){if(!this.$mouseInTooltip){var n=this.editor.getCursorPosition(),o=this.editor.renderer.textToScreenCoordinates(n.row,n.column),c=this.editor.renderer.lineHeight,l=t.clientY>=o.pageY&&t.clientY",y.escapeHTML(t.caption),"","
",y.escapeHTML(x(t.snippet))].join(""))},id:"snippetCompleter"},P=[R,g,S];w.setCompleters=function(t){P.length=0,t&&P.push.apply(P,t)},w.addCompleter=function(t){P.push(t)},w.textCompleter=g,w.keyWordCompleter=S,w.snippetCompleter=R;var E={name:"expandSnippet",exec:function(t){return A.expandWithTab(t)},bindKey:"Tab"},M=function(t,n){O(n.session.$mode)},O=function(t){typeof t=="string"&&(t=_.$modes[t]),t&&(A.files||(A.files={}),H(t.$id,t.snippetFileId),t.modes&&t.modes.forEach(O))},H=function(t,n){!n||!t||A.files[t]||(A.files[t]={},_.loadModule(n,function(o){o&&(A.files[t]=o,!o.snippets&&o.snippetText&&(o.snippets=A.parseSnippetFile(o.snippetText)),A.register(o.snippets||[],o.scope),o.includeScopes&&(A.snippetMap[o.scope].includeScopes=o.includeScopes,o.includeScopes.forEach(function(c){O("ace/mode/"+c)})))}))},L=function(t){var n=t.editor,o=n.completer&&n.completer.activated;if(t.command.name==="backspace")o&&!m.getCompletionPrefix(n)&&n.completer.detach();else if(t.command.name==="insertstring"&&!o){d=t;var c=t.editor.$liveAutocompletionDelay;c?r.delay(c):e(t)}},d,r=y.delayedCall(function(){e(d)},0),e=function(t){var n=t.editor,o=m.getCompletionPrefix(n),c=m.triggerAutocomplete(n);if(o&&o.length>=n.$liveAutocompletionThreshold||c){var l=C.for(n);l.autoShown=!0,l.showPopup(n)}},i=f("../editor").Editor;f("../config").defineOptions(i.prototype,"editor",{enableBasicAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:P),this.commands.addCommand(C.startCommand)):this.commands.removeCommand(C.startCommand)},value:!1},enableLiveAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:P),this.commands.on("afterExec",L)):this.commands.off("afterExec",L)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(t){t?(this.commands.addCommand(E),this.on("changeMode",M),M(null,this)):(this.commands.removeCommand(E),this.off("changeMode",M))},value:!1}})});ace.define("ace/ext/inline_autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/inline","ace/autocomplete","ace/autocomplete","ace/editor","ace/autocomplete/util","ace/lib/dom","ace/lib/lang","ace/ext/command_bar","ace/ext/command_bar","ace/ext/language_tools","ace/ext/language_tools","ace/ext/language_tools","ace/config"],function(f,w,U){"use strict";var A=f("../keyboard/hash_handler").HashHandler,C=f("../autocomplete/inline").AceInline,_=f("../autocomplete").FilteredList,y=f("../autocomplete").CompletionProvider,m=f("../editor").Editor,g=f("../autocomplete/util"),S=f("../lib/dom"),x=f("../lib/lang"),R=f("./command_bar").CommandBarTooltip,P=f("./command_bar").BUTTON_CLASS_NAME,E=f("./language_tools").snippetCompleter,M=f("./language_tools").textCompleter,O=f("./language_tools").keyWordCompleter,H=function(r,e){e.completer&&e.completer.destroy()},L=function(){function r(e){this.editor=e,this.keyboardHandler=new A(this.commands),this.$index=-1,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.changeTimer=x.delayedCall(function(){this.updateCompletions()}.bind(this))}return r.prototype.getInlineRenderer=function(){return this.inlineRenderer||(this.inlineRenderer=new C),this.inlineRenderer},r.prototype.getInlineTooltip=function(){return this.inlineTooltip||(this.inlineTooltip=r.createInlineTooltip(document.body||document.documentElement)),this.inlineTooltip},r.prototype.show=function(e){this.activated=!0,this.editor.completer!==this&&(this.editor.completer&&this.editor.completer.detach(),this.editor.completer=this),this.editor.on("changeSelection",this.changeListener),this.editor.on("blur",this.blurListener),this.updateCompletions(e)},r.prototype.$open=function(){this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({}),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.getInlineTooltip().attach(this.editor),this.$index===-1?this.setIndex(0):this.$showCompletion(),this.changeTimer.cancel()},r.prototype.insertMatch=function(){var e=this.getCompletionProvider().insertByIndex(this.editor,this.$index);return this.detach(),e},r.prototype.changeListener=function(e){var i=this.editor.selection.lead;(i.row!=this.base.row||i.column=0},r.prototype.setIndex=function(e){if(!(!this.completions||!this.completions.filtered)){var i=Math.max(-1,Math.min(this.completions.filtered.length-1,e));i!==this.$index&&(this.$index=i,this.$showCompletion())}},r.prototype.getCompletionProvider=function(e){return this.completionProvider||(this.completionProvider=new y(e)),this.completionProvider},r.prototype.$showCompletion=function(){this.getInlineRenderer().show(this.editor,this.completions.filtered[this.$index],this.completions.filterText)||this.getInlineRenderer().hide(),this.inlineTooltip&&this.inlineTooltip.isShown()&&this.inlineTooltip.update()},r.prototype.$updatePrefix=function(){var e=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:e});return this.completions.setFilter(i),this.completions.filtered.length?this.completions.filtered.length==1&&this.completions.filtered[0].value==i&&!this.completions.filtered[0].snippet?this.detach():(this.$open(this.editor,i),i):this.detach()},r.prototype.updateCompletions=function(o){var n="";if(o&&o.matches){var t=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(t.row,t.column),this.base.$insertRight=!0,this.completions=new _(o.matches),this.$open(this.editor,"")}this.base&&this.completions&&(n=this.$updatePrefix());var i=this.editor.getSession(),t=this.editor.getCursorPosition(),n=g.getCompletionPrefix(this.editor);this.base=i.doc.createAnchor(t.row,t.column-n.length),this.base.$insertRight=!0;var o={exactMatch:!0,ignoreCaption:!0};this.getCompletionProvider({prefix:n,base:this.base,pos:t}).provideCompletions(this.editor,o,function(c,l,s){var p=l.filtered,a=g.getCompletionPrefix(this.editor);if(s){if(!p.length)return this.detach();if(p.length==1&&p[0].value==a&&!p[0].snippet)return this.detach()}this.completions=l,this.$open(this.editor,a)}.bind(this))},r.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener)),this.changeTimer.cancel(),this.inlineTooltip&&this.inlineTooltip.detach(),this.setIndex(-1),this.completionProvider&&this.completionProvider.detach(),this.inlineRenderer&&this.inlineRenderer.isOpen()&&this.inlineRenderer.hide(),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null},r.prototype.destroy=function(){this.detach(),this.inlineRenderer&&this.inlineRenderer.destroy(),this.inlineTooltip&&this.inlineTooltip.destroy(),this.editor&&this.editor.completer==this&&(this.editor.off("destroy",H),this.editor.completer=null),this.inlineTooltip=this.editor=this.inlineRenderer=null},r.prototype.updateDocTooltip=function(){},r}();L.prototype.commands={Previous:{bindKey:"Alt-[",name:"Previous",exec:function(r){r.completer.goTo("prev")}},Next:{bindKey:"Alt-]",name:"Next",exec:function(r){r.completer.goTo("next")}},Accept:{bindKey:{win:"Tab|Ctrl-Right",mac:"Tab|Cmd-Right"},name:"Accept",exec:function(r){return r.completer.insertMatch()}},Close:{bindKey:"Esc",name:"Close",exec:function(r){r.completer.detach()}}},L.for=function(r){return r.completer instanceof L||(r.completer&&(r.completer.destroy(),r.completer=null),r.completer=new L(r),r.once("destroy",H)),r.completer},L.startCommand={name:"startInlineAutocomplete",exec:function(r,e){var i=L.for(r);i.show(e)},bindKey:{win:"Alt-C",mac:"Option-C"}};var d=[E,M,O];f("../config").defineOptions(m.prototype,"editor",{enableInlineAutocompletion:{set:function(r){r?(this.completers||(this.completers=Array.isArray(r)?r:d),this.commands.addCommand(L.startCommand)):this.commands.removeCommand(L.startCommand)},value:!1}}),L.createInlineTooltip=function(r){var e=new R(r);return e.registerCommand("Previous",Object.assign({},L.prototype.commands.Previous,{enabled:!0,type:"button",iconCssClass:"ace_arrow_rotated"})),e.registerCommand("Position",{enabled:!1,getValue:function(i){return i?[i.completer.getIndex()+1,i.completer.getLength()].join("/"):""},type:"text",cssClass:"completion_position"}),e.registerCommand("Next",Object.assign({},L.prototype.commands.Next,{enabled:!0,type:"button",iconCssClass:"ace_arrow"})),e.registerCommand("Accept",Object.assign({},L.prototype.commands.Accept,{enabled:function(i){return!!i&&i.completer.getIndex()>=0},type:"button"})),e.registerCommand("ShowTooltip",{name:"Always Show Tooltip",exec:function(){e.setAlwaysShow(!e.getAlwaysShow())},enabled:!0,getValue:function(){return e.getAlwaysShow()},type:"checkbox"}),e},S.importCssString(` .ace_icon_svg.ace_arrow, .ace_icon_svg.ace_arrow_rotated { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODM3MDEgMTVMNC41ODc1MSAxMy43MTU1TDEwLjE0NjggOEw0LjU4NzUxIDIuMjg0NDZMNS44MzcwMSAxTDEyLjY0NjUgOEw1LjgzNzAxIDE1WiIgZmlsbD0iYmxhY2siLz48L3N2Zz4="); } .ace_icon_svg.ace_arrow_rotated { transform: rotate(180deg); } div.`.concat(P,`.completion_position { padding: 0; } `),"inlineautocomplete.css",!1),w.InlineAutocomplete=L});(function(){ace.require(["ace/ext/inline_autocomplete"],function(f){typeof K=="object"&&typeof G=="object"&&K&&(K.exports=f)})})()});J();})(); //# sourceMappingURL=c19292ad0187d75dd9580319cbfd5688.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy