src/pyams_skin/resources/js/ext/ace/ext-emmet.min.js
changeset 557 bca7a7e058a3
equal deleted inserted replaced
-1:000000000000 557:bca7a7e058a3
       
     1 ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"],function(e,a,t){"use strict";var n=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,h=e("./lib/lang"),l=e("./range").Range,r=e("./anchor").Anchor,s=e("./keyboard/hash_handler").HashHandler,o=e("./tokenizer").Tokenizer,u=l.comparePoints,c=function(){this.snippetMap={},this.snippetNameMap={}};(function(){n.implement(this,i),this.getTokenizer=function(){function r(e,t,n){return e=e.substr(1),/^\d+$/.test(e)&&!n.inFormatString?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function e(e){return"(?:[^\\\\"+e+"]|\\\\.)"}return c.$tokenizer=new o({start:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectIf?(n[0].expectIf=!1,n[0].elseBranch=n[0],[n[0]]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length?e=i:-1!="`$\\".indexOf(i)?e=i:n.inFormatString&&("n"==i?e="\n":"t"==i?e="\n":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:"a"<i})),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:r},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,t,n){var i=r(e.substr(1),0,n);return n.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+e("\\|")+"*\\|",onMatch:function(e,t,n){n[0].choices=e.slice(1,-1).split(",")},next:"start"},{regex:"/("+e("/")+"+)/(?:("+e("/")+"*)/)(\\w*):?",onMatch:function(e,t,n){var i=n[0];return i.fmtString=e,e=this.splitRegex.exec(e),i.guard=e[1],i.fmt=e[2],i.flag=e[3],""},next:"start"},{regex:"`"+e("`")+"*`",onMatch:function(e,t,n){return n[0].code=e.splice(1,-1),""},next:"start"},{regex:"\\?",onMatch:function(e,t,n){n[0]&&(n[0].expectIf=!0)},next:"start"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:"/("+e("/")+"+)/",token:"regex"},{regex:"",onMatch:function(e,t,n){n.inFormatString=!0},next:"start"}]}),c.prototype.getTokenizer=function(){return c.$tokenizer},c.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.$getDefaultValue=function(e,t){if(/^[A-Z]\d+$/.test(t)){var n=t.substr(1);return(this.variables[t[0]+"__"]||{})[n]}if(/^\d+$/.test(t))return(this.variables.__||{})[t];if(t=t.replace(/^TM_/,""),e){var i=e.session;switch(t){case"CURRENT_WORD":var r=i.getWordRange();case"SELECTION":case"SELECTED_TEXT":return i.getTextRange(r);case"CURRENT_LINE":return i.getLine(e.getCursorPosition().row);case"PREV_LINE":return i.getLine(e.getCursorPosition().row-1);case"LINE_INDEX":return e.getCursorPosition().column;case"LINE_NUMBER":return e.getCursorPosition().row+1;case"SOFT_TABS":return i.getUseSoftTabs()?"YES":"NO";case"TAB_SIZE":return i.getTabSize();case"FILENAME":case"FILEPATH":return"";case"FULLNAME":return"Ace"}}},this.variables={},this.getVariableValue=function(e,t){return this.variables.hasOwnProperty(t)?this.variables[t](e,t)||"":this.$getDefaultValue(e,t)||""},this.tmStrFormat=function(e,t,s){var n=t.flag||"",i=t.guard;i=new RegExp(i,n.replace(/[^gi]/,""));var a=this.tokenizeTmSnippet(t.fmt,"formatString"),o=this,r=e.replace(i,function(){o.variables.__=arguments;for(var e=o.resolveVariables(a,s),t="E",n=0;n<e.length;n++){var i=e[n];if("object"==typeof i)if(e[n]="",i.changeCase&&i.local){var r=e[n+1];r&&"string"==typeof r&&("u"==i.changeCase?e[n]=r[0].toUpperCase():e[n]=r[0].toLowerCase(),e[n+1]=r.substr(1))}else i.changeCase&&(t=i.changeCase);else"U"==t?e[n]=i.toUpperCase():"L"==t&&(e[n]=i.toLowerCase())}return e.join("")});return this.variables.__=null,r},this.resolveVariables=function(n,e){function t(e){var t=n.indexOf(e,r+1);-1!=t&&(r=t)}for(var i=[],r=0;r<n.length;r++){var s=n[r];if("string"==typeof s)i.push(s);else{if("object"!=typeof s)continue;if(s.skip)t(s);else{if(s.processed<r)continue;if(s.text){var a=this.getVariableValue(e,s.text);a&&s.fmtString&&(a=this.tmStrFormat(a,s)),s.processed=r,null==s.expectIf?a&&(i.push(a),t(s)):a?s.skip=s.elseBranch:t(s)}else null!=s.tabstopId?i.push(s):null!=s.changeCase&&i.push(s)}}}return i},this.insertSnippetForSelection=function(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(h[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}var i=e.getCursorPosition(),r=e.session.getLine(i.row),s=e.session.getTabString(),a=r.match(/^\s*/)[0];i.column<a.length&&(a=a.slice(0,i.column)),t=t.replace(/\r/g,"");var o=this.tokenizeTmSnippet(t);o=(o=this.resolveVariables(o,e)).map(function(e){return"\n"==e?e+a:"string"==typeof e?e.replace(/\t/g,s):e});var c=[];o.forEach(function(e,t){if("object"==typeof e){var n=e.tabstopId,i=c[n];if(i||((i=c[n]=[]).index=n,i.value=""),-1===i.indexOf(e)){i.push(e);var r=o.indexOf(e,t+1);if(-1!==r){var s=o.slice(t+1,r);s.some(function(e){return"object"==typeof e})&&!i.value?i.value=s:s.length&&(!i.value||"string"!=typeof i.value)&&(i.value=s.join(""))}}}}),c.forEach(function(e){e.length=0});for(var h={},l=0;l<o.length;l++){var u=o[l];if("object"==typeof u){var p=u.tabstopId,d=o.indexOf(u,l+1);if(h[p])h[p]===u&&(h[p]=null);else{var g=c[p],f="string"==typeof g.value?[g.value]:n(g.value);f.unshift(l+1,Math.max(0,d-l)),f.push(u),h[p]=u,o.splice.apply(o,f),-1===g.indexOf(u)&&g.push(u)}}}var m=0,b=0,v="";o.forEach(function(e){if("string"==typeof e){var t=e.split("\n");1<t.length?(b=t[t.length-1].length,m+=t.length-1):b+=e.length,v+=e}else e.start?e.end={row:m,column:b}:e.start={row:m,column:b}});var x=e.getSelectionRange(),S=e.session.replace(x,v),_=new y(e),w=e.inVirtualSelectionMode&&e.selection.index;_.addTabstops(c,x.start,S,w)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"===t&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),r=e.session.getLine(i.row),s=r.substring(0,i.column),a=r.substr(i.column),o=this.snippetMap;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(n=this.findMatchingSnippet(t,s,a)),!!n},this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var r=e[i];if((!r.startRe||r.startRe.test(t))&&((!r.endRe||r.endRe.test(n))&&(r.startRe||r.endRe)))return r.matchBefore=r.startRe?r.startRe.exec(t):[""],r.matchAfter=r.endRe?r.endRe.exec(n):[""],r.replaceBefore=r.triggerRe?r.triggerRe.exec(t)[0]:"",r.replaceAfter=r.endTriggerRe?r.endTriggerRe.exec(n)[0]:"",r}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,i){function r(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function s(e,t,n){return e=r(e),t=r(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function t(e){e.scope||(e.scope=i||"_"),i=e.scope,a[i]||(a[i]=[],o[i]={});var t=o[i];if(e.name){var n=t[e.name];n&&c.unregister(n),t[e.name]=e}a[i].push(e),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=h.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=s(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=s(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}var a=this.snippetMap,o=this.snippetNameMap,c=this;e||(e=[]),e&&e.content?t(e):Array.isArray(e)&&e.forEach(t),this._signal("registerSnippets",{scope:i})},this.unregister=function(e,r){function t(e){var t=a[e.scope||r];if(t&&t[e.name]){delete t[e.name];var n=s[e.scope||r],i=n&&n.indexOf(e);0<=i&&n.splice(i,1)}}var s=this.snippetMap,a=this.snippetNameMap;e.content?t(e):Array.isArray(e)&&e.forEach(t)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=r.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(e){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var s=t[2],a=t[3];if("regex"==s){var o=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=o.exec(a)[1],i.trigger=o.exec(a)[1],i.endTrigger=o.exec(a)[1],i.endGuard=o.exec(a)[1]}else"snippet"==s?(i.tabTrigger=a.match(/^\S*/)[0],i.name||(i.name=a)):i[s]=a}}return n},this.getSnippetByName=function(n,e){var i,r=this.snippetNameMap;return this.getActiveScopes(e).some(function(e){var t=r[e];return t&&(i=t[n]),!!i},this),i}}).call(c.prototype);var y=function(e){if(e.tabstopManager)return e.tabstopManager;(e.tabstopManager=this).$onChange=this.onChange.bind(this),this.$onChangeSelection=h.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,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)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t="r"==e.action[0],n=e.start,i=e.end,r=n.row,s=i.row-r,a=i.column-n.column;if(t&&(s=-s,a=-a),!this.$inChange&&t){var o=this.selectedTabstop;if(o&&!o.some(function(e){return u(e.start,n)<=0&&0<=u(e.end,i)}))return this.detach()}for(var c=this.ranges,h=0;h<c.length;h++){var l=c[h];l.end.row<n.row||(t&&u(n,l.start)<0&&0<u(i,l.end)?(this.removeRange(l),h--):(l.start.row==r&&l.start.column>n.column&&(l.start.column+=a),l.end.row==r&&l.end.column>=n.column&&(l.end.column+=a),l.start.row>=r&&(l.start.row+=s),l.end.row>=r&&(l.end.row+=s),0<u(l.start,l.end)&&this.removeRange(l)))}c.length||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges){this.$inChange=!0;for(var t=this.editor.session,n=t.getTextRange(e.firstNonLinked),i=e.length;i--;){var r=e[i];if(r.linked){var s=a.snippetManager.tmStrFormat(n,r.original);t.replace(r,s)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=this.ranges.length;i--;)if(!this.ranges[i].linked){var r=this.ranges[i].contains(e.row,e.column),s=n||this.ranges[i].contains(t.row,t.column);if(r&&s)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){if(this.selectedTabstop=t,this.editor.inVirtualSelectionMode)this.editor.selection.setRange(t.firstNonLinked);else{var n=this.editor.multiSelect;n.toSingleRange(t.firstNonLinked.clone());for(var i=t.length;i--;)t.hasLinkedRanges&&t[i].linked||n.addRange(t[i].clone(),!0);n.ranges[0]&&n.addRange(n.ranges[0].clone())}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)}},this.addTabstops=function(e,a,t){if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var n=l.fromPoints(t,t);g(n.start,a),g(n.end,a),e[0]=[n],e[0].index=0}var o=[this.index+1,0],c=this.ranges;e.forEach(function(e,t){for(var n=this.$openTabstops[t]||e,i=e.length;i--;){var r=e[i],s=l.fromPoints(r.start,r.end||r.start);d(s.start,a),d(s.end,a),s.original=r,s.tabstop=n,c.push(s),n!=e?n.unshift(s):n[i]=s,r.fmtString?(s.linked=!0,n.hasLinkedRanges=!0):n.firstNonLinked||(n.firstNonLinked=s)}n.firstNonLinked||(n.hasLinkedRanges=!1),n===e&&(o.push(n),this.$openTabstops[t]=n),this.addTabstopMarkers(n)},this),2<o.length&&(this.tabstops.length&&o.push(o.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,o))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);e.tabstop.splice(t,1),t=this.ranges.indexOf(e),this.ranges.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new s,this.keyboardHandler.bindKeys({Tab:function(e){a.snippetManager&&a.snippetManager.expandWithTab(e)||e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(e){return!1}})}).call(y.prototype);var p={};p.onChange=r.prototype.onChange,p.setPosition=function(e,t){this.pos.row=e,this.pos.column=t},p.update=function(e,t,n){this.$insertRight=n,this.pos=e,this.onChange(t)};var d=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},g=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").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;}"),a.snippetManager=new c;var f=e("./editor").Editor;(function(){this.insertSnippet=function(e,t){return a.snippetManager.insertSnippet(this,e,t)},this.expandSnippet=function(e){return a.snippetManager.expandWithTab(this,e)}}).call(f.prototype)}),ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","tabStops","resources","utils","actions","ace/config","ace/config"],function(t,a,e){"use strict";function n(){}var h,i,r=t("ace/keyboard/hash_handler").HashHandler,s=t("ace/editor").Editor,o=t("ace/snippets").snippetManager,c=t("ace/range").Range;n.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),h||(h=window.emmet),(h.resources||h.require("resources")).setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange(),t=this.ace.session.doc;return{start:t.positionToIndex(e.start),end:t.positionToIndex(e.end)}},createSelection:function(e,t){var n=this.ace.session.doc;this.ace.selection.setRange({start:n.indexToPosition(e),end:n.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace,t=e.getCursorPosition().row,n=e.session.getLine(t).length,i=e.session.doc.positionToIndex({row:t,column:0});return{start:i,end:i+n}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.session.doc.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,i){null==n&&(n=null==t?this.getContent().length:t),null==t&&(t=0);var r=this.ace,s=r.session.doc,a=c.fromPoints(s.indexToPosition(t),s.indexToPosition(n));r.session.remove(a),a.end=a.start,e=this.$updateTabstops(e),o.insertSnippet(r,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if("html"==e||"php"==e){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);"string"!=typeof n&&(n=n[0]),n&&(1<(n=n.split("-")).length?e=n[0]:"php"==e&&(e="html"))}return e},getProfileName:function(){var e=h.resources||h.require("resources");switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var t=e.getVariable("profile");return t||(t=-1!=this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i)?"xhtml":"html"),t;default:var n=this.ace.session.$mode;return n.emmetConfig&&n.emmetConfig.profile||"xhtml"}},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var s=0,a=null,o=h.tabStops||h.require("tabStops"),t=(h.resources||h.require("resources")).getVocabulary("user"),c={tabstop:function(e){var t=parseInt(e.group,10),n=0===t;n?t=++s:t+=1e3;var i=e.placeholder;i&&(i=o.processText(i,c));var r="${"+t+(i?":"+i:"")+"}";return n&&(a=[e.start,r]),r},escape:function(e){return"$"==e?"\\$":"\\"==e?"\\\\":e}};if(e=o.processText(e,c),t.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e))e+="${0}";else if(a){e=(h.utils?h.utils.common:h.require("utils")).replaceSubstring(e,"${0}",a[0],a[1])}return e}};var l={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},u=new n;for(var p in a.commands=new r,a.runEmmetCommand=function t(n){try{u.setupContext(n);var e=h.actions||h.require("actions");if("expand_abbreviation_with_tab"==this.action){if(!n.selection.isEmpty())return!1;var i=n.selection.lead,r=n.session.getTokenAt(i.row,i.column);if(r&&/\btag\b/.test(r.type))return!1}if("wrap_with_abbreviation"==this.action)return setTimeout(function(){e.run("wrap_with_abbreviation",u)},0);var s=e.run(this.action,u)}catch(e){if(!h)return a.load(t.bind(this,n)),!0;n._signal("changeStatus","string"==typeof e?e:e.message),console.log(e),s=!1}return s},l)a.commands.addCommand({name:"emmet:"+p,action:p,bindKey:l[p],exec:a.runEmmetCommand,multiSelectAction:"forEach"});a.updateCommands=function(e,t){t?e.keyBinding.addKeyboardHandler(a.commands):e.keyBinding.removeKeyboardHandler(a.commands)},a.isSupportedMode=function(e){if(!e)return!1;if(e.emmetConfig)return!0;var t=e.$id||e;return/css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(t)},a.isAvailable=function(e,t){if(/(evaluate_math_expression|expand_abbreviation)$/.test(t))return!0;var n=e.session.$mode,i=a.isSupportedMode(n);if(i&&n.$modes)try{u.setupContext(e),/js|php/.test(u.getSyntax())&&(i=!1)}catch(e){}return i};var d=function(e,t){var n=t;if(n){var i=a.isSupportedMode(n.session.$mode);!1===e.enableEmmet&&(i=!1),i&&a.load(),a.updateCommands(n,i)}};a.load=function(e){"string"==typeof i&&t("ace/config").loadModule(i,function(){i=null,e&&e()})},a.AceEmmetEditor=n,t("ace/config").defineOptions(s.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",d),d({enableEmmet:!!e},this)},value:!0}}),a.setCore=function(e){"string"==typeof e?i=e:h=e}}),ace.require(["ace/ext/emmet"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});