!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.ZenArea=t()}}(function(){return function t(e,n,r){function a(i,o){if(!n[i]){if(!e[i]){var u="function"==typeof require&&require;if(!o&&u)return u(i,!0);if(s)return s(i,!0);throw new Error("Cannot find module '"+i+"'")}var l=n[i]={exports:{}};e[i][0].call(l.exports,function(t){var n=e[i][1][t];return a(n?n:t)},l,l.exports,t,e,n,r)}return n[i].exports}for(var s="function"==typeof require&&require,i=0;ie){var n=e;e=t,t=n}for(var r=this.value,a=0,s=0;t>s;s++)if(a=r.indexOf("\n",a)+1,!a)return this.get(r.length,r.length);var i=a;for(s=0;e-t>s;s++)if(a=r.indexOf("\n",a)+1,!a)return this.get(i,r.length);return this.get(i,t==e?a:a-1)},r.prototype.getCurrentLines=function(){var t=this.value,e=this.selection;return e.start=Math.max(0,t.lastIndexOf("\n",e.start-1)+1),e.end=Math.min(t.length,t.indexOf("\n",e.end)),-1==e.end&&(e.end=t.length),this.get(e.start,e.end)},r.prototype.getExpandedLeft=function(t){for(var e=this.selection;!t(e)&&e.start>0;)e=this.get(e.start-1,e.end);return e},r.prototype.getExpandedRight=function(t){for(var e=this.value,n=this.selection;!t(n)&&n.end-1?e=n=a:(e=-i.moveStart("character",-a),e+=s.slice(0,e).split("\n").length-1,i.compareEndPoints("EndToEnd",o)>-1?n=a:(n=-i.moveEnd("character",-a),n+=s.slice(0,n).split("\n").length-1)),{start:e,end:n,length:n-e,value:t.value.substring(e,n)}}}),r.prototype.select=function(t,e){if(null==e&&(e=t),t>e){var n=e;e=t,t=n}var r=this._textarea;return r.focus(),r.setSelectionRange?r.setSelectionRange(t,e):r.createTextRange&&(r=r.createTextRange(),r.collapse(!0),r.moveEnd("character",e),r.moveStart("character",t),r.select()),this.focus()},r.prototype.selectAll=function(){return this.select(0,this.value.length)},r.prototype.selectLines=function(t,e){var n=this.getLines(t,e);return this.select(n.start,n.end)},r.prototype.selectCurrentLines=function(){var t=this.getCurrentLines();return this.select(t.start,t.end)},r.prototype.selectLeft=function(t){var e=this.getExpandedLeft(t);return this.select(e.start,e.end)},r.prototype.selectRight=function(t){var e=this.getExpandedRight(t);return this.select(e.start,e.end)},r.prototype.expandSelection=function(){var t=this.getExpanded();return this.select(t.start,t.end)}},{"./zenarea":8}],7:[function(t,e,n){"use strict";n.isBoundary=function(t){var e=t.charCodeAt(0);return 47>=e||e>=58&&63>=e||e>=91&&96>=e||e>=123&&191>=e||e>=8192&&8303>=e||e>=8592&&8959>=e},n.isEmptyOrBoundary=function(t){return""==t||n.isBoundary(t)},n.isEmptyOrNewline=function(t){return""==t||"\n"==t},n.containsBoundaries=function(t){for(var e=0;e to ZenArea constructor.");this._textarea._zen=this,this._keyBindings={},this.init()};Object.defineProperty(s.prototype,"value",{get:function(){return this._textarea.value}}),s.prototype.focus=function(){return this._textarea.focus(),this},s.prototype.init=function(){var t=this._textarea;Object.keys(r).forEach(function(e){t.addEventListener(e,r[e])})},s.prototype.destroy=function(){var t=this._textarea;Object.keys(r).forEach(function(e){t.removeEventListener(e,r[e])})},s.prototype.bind=function(t,e,n){var r=a.parseKey(t);return r.command=e,r.args=Array.isArray(n)?n:[],this._keyBindings[a.normalizeName(r)]=r,this},t("./getters"),t("./selection"),t("./search"),t("./manipulation")},{"./events":1,"./getters":3,"./manipulation":4,"./search":5,"./selection":6,"./utils":7}]},{},[2])(2)});