!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.GraphiQL=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function getLocation(r,e){for(var o,t=0,n=e,i=/\r\n|[\n\r]/g;(o=i.exec(r))&&o.index<e;)t+=1,n=e-(o.index+o[0].length);return _codemirror2.default.Pos(t,n)}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_jsonLint=require("./jsonLint");_codemirror2.default.registerHelper("lint","json",function(r){var e=_jsonLint.jsonLint(r);return e?[{message:e.message,severity:"error",from:getLocation(r,e.start),to:getLocation(r,e.end)}]:[]})},{"./jsonLint":2,codemirror:49}],2:[function(require,module,exports){"use strict";function jsonLint(e,r){string=e,strLen=e.length,end=-1;try{ch(),lex(),r?readVal():readObj(),expect("EOF")}catch(t){return t}}function readObj(){if(expect("{"),!skip("}")){do expect("String"),expect(":"),readVal();while(skip(","));expect("}")}}function readArr(){if(expect("["),!skip("]")){do readVal();while(skip(","));expect("]")}}function readVal(){switch(kind){case"[":return readArr();case"{":return readObj();case"String":return lex();default:return expect("Value")}}function syntaxError(e){return{message:e,start:start,end:end}}function expect(e){if(kind===e)return lex();throw syntaxError("Expected "+e+" but got "+string.slice(start,end)+".")}function skip(e){return kind===e?(lex(),!0):void 0}function ch(){strLen>end&&(end++,code=end===strLen?0:string.charCodeAt(end))}function lex(){for(;9===code||10===code||13===code||32===code;)ch();if(0===code)return void(kind="EOF");switch(start=end,code){case 34:return kind="String",readString();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return kind="Value",readNumber();case 102:if("false"!==string.slice(start,start+5))break;return end+=4,ch(),void(kind="Value");case 110:if("null"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Value");case 116:if("true"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Value")}kind=string[start],ch()}function readString(){for(ch();34!==code;)if(ch(),92===code)switch(ch(),code){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:ch();break;case 117:ch(),readHex(),readHex(),readHex(),readHex();break;default:throw syntaxError("Bad character escape sequence.")}else if(end===strLen)throw syntaxError("Unterminated string.");if(34===code)return void ch();throw syntaxError("Unterminated string.")}function readHex(){if(code>=48&&57>=code||code>=65&&70>=code||code>=97&&102>=code)return ch();throw syntaxError("Expected hexadecimal digit.")}function readNumber(){45===code&&ch(),48===code?ch():readDigits(),46===code&&(ch(),readDigits()),(69===code||101===code)&&(ch(),(43===code||45===code)&&ch(),readDigits())}function readDigits(){if(48>code||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&57>=code)}exports.__esModule=!0,exports.jsonLint=jsonLint;var string,strLen,start,end,code,kind},{}],3:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e,t){return e instanceof _graphql.GraphQLNonNull?_react2.default.createElement("span",null,renderType(e.ofType,t),"!"):e instanceof _graphql.GraphQLList?_react2.default.createElement("span",null,"[",renderType(e.ofType,t),"]"):_react2.default.createElement("a",{className:"type-name",onClick:function(a){return t(e,a)}},e.name)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_marked=require("marked"),_marked2=_interopRequireDefault(_marked),_graphql=require("graphql"),DocExplorer=function(e){function t(){var a=this;_classCallCheck(this,t),e.call(this),this._onToggleBtnClick=function(){a.setState({expanded:!a.state.expanded})},this._onNavBackClick=function(){a.setState({navStack:a.state.navStack.slice(0,-1),searchValue:null})},this._onClickTypeOrField=function(e){a.showDoc(e)},this._onSearch=function(e){a.setState({searchValue:e.target.value})},this.state={navStack:[],searchValue:null}}return _inherits(t,e),t.prototype.showDoc=function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1]===e;a||(t=t.concat([e])),this.setState({navStack:t})},_createClass(t,null,[{key:"propTypes",value:{schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema)},enumerable:!0}]),t.prototype.shouldComponentUpdate=function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack||this.state.searchValue!==t.searchValue},t.prototype.render=function(){var e,t=this,a=this.props.schema,r=this.state.navStack;r.length>0&&(e=r[r.length-1]);var n,c;e?(n=e.name,c=_graphql.isType(e)?_react2.default.createElement(TypeDoc,{key:e.name,type:e,onClickType:this._onClickTypeOrField,onClickField:this._onClickTypeOrField}):_react2.default.createElement(FieldDoc,{key:e.name,field:e,onClickType:this._onClickTypeOrField})):this.state.searchValue?(n="Search Results",c=_react2.default.createElement(SearchDoc,{searchValue:this.state.searchValue,schema:a,onClickType:this._onClickTypeOrField,onClickField:this._onClickTypeOrField})):a&&(n="Documentation Explorer",c=_react2.default.createElement(SchemaDoc,{schema:a,onClickType:this._onClickTypeOrField,onSearch:this._onSearch}));var l;1===r.length?l="Schema":r.length>1&&(l=r[r.length-2].name);var o=_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"}));return _react2.default.createElement("div",{className:"doc-explorer"},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},l&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this._onNavBackClick},l),_react2.default.createElement("div",{className:"doc-explorer-title"},n),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},!e&&_react2.default.createElement("label",{className:"search-box-outer"},_react2.default.createElement("input",{className:"search-box-input",onKeyUp:function(e){return t._onSearch(e)},type:"text",placeholder:"Search the schema ..."})),this.props.schema?c:o))},t}(_react2.default.Component);exports.DocExplorer=DocExplorer;var SearchDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.schema!==e.schema||this.props.searchValue!==e.searchValue},t.prototype.render=function(){var e=this.props.searchValue,t=this.props.schema,a=this.props.onClickType,r=this.props.onClickField,n=t.getTypeMap(),c=[],l=[];return Object.keys(n).forEach(function(t){var o=n[t],s=[];-1!==t.indexOf(e)&&s.push("Type Name"),s.length&&c.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:o,onClick:a}))),o.getFields&&!function(){var t=o.getFields();Object.keys(t).forEach(function(n){var c=t[n];if(-1!==n.indexOf(e))l.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return r(c,o,e)}},c.name)," on ",_react2.default.createElement(TypeLink,{type:o,onClick:a})));else if(c.args&&c.args.length){var s=c.args.filter(function(t){return-1!==t.name.indexOf(e)});s.length>0&&l.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return r(c,o,e)}},c.name),"(",_react2.default.createElement("span",null,s.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:a}))})),")"," on ",_react2.default.createElement(TypeLink,{type:o,onClick:a})))}})}()}),0===c.length&&0===l.length?_react2.default.createElement("span",{className:"doc-alert-text"},"No results found."):_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"doc-category"},(c.length>0||l.length>0)&&_react2.default.createElement("div",{className:"doc-category-title"},"search results"),c,l))},t}(_react2.default.Component),SchemaDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.schema!==e.schema},t.prototype.render=function(){var e=this.props.schema,t=e.getQueryType(),a=e.getMutationType&&e.getMutationType(),r=e.getSubscriptionType&&e.getSubscriptionType();return _react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:"A GraphQL schema provides a root type for each kind of operation."}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"root types"),_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"query"),": ",_react2.default.createElement(TypeLink,{type:t,onClick:this.props.onClickType})),a&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"mutation"),": ",_react2.default.createElement(TypeLink,{type:a,onClick:this.props.onClickType})),r&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"subscription"),": ",_react2.default.createElement(TypeLink,{type:r,onClick:this.props.onClickType}))))},t}(_react2.default.Component),TypeDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.type!==e.type},t.prototype.render=function(){var e,t,a=this.props.type,r=this.props.onClickType||function(){},n=this.props.onClickField||function(){};a instanceof _graphql.GraphQLUnionType?(e="possible types",t=a.getPossibleTypes()):a instanceof _graphql.GraphQLInterfaceType?(e="implementations",t=a.getPossibleTypes()):a instanceof _graphql.GraphQLObjectType&&(e="implements",t=a.getInterfaces());var c;t&&t.length>0&&(c=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},e),t.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:e,onClick:r}))})));var l;if(a.getFields){var o=a.getFields(),s=Object.keys(o).map(function(e){return o[e]});l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),s.map(function(e){var t;return e.args&&e.args.length>0&&(t=e.args.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))})),_react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(t){return n(e,a,t)}},e.name),t&&["(",_react2.default.createElement("span",null,t),")"],": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))}))}var i;return a instanceof _graphql.GraphQLEnumType&&(i=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),a.getValues().map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},e.name),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:a.description||"No Description"}),a instanceof _graphql.GraphQLObjectType&&c,l,i,!(a instanceof _graphql.GraphQLObjectType)&&c)},t}(_react2.default.Component),FieldDoc=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.field!==e.field},t.prototype.render=function(){var e,t=this,a=this.props.field;return a.args&&a.args.length>0&&(e=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"arguments"),a.args.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:t.props.onClickType})),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:a.description||"No Description"}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(TypeLink,{type:a.type,onClick:this.props.onClickType})),e)},t}(_react2.default.Component),TypeLink=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.type!==e.type},t.prototype.render=function(){return renderType(this.props.type,this.props.onClick)},t}(_react2.default.Component),Description=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.markdown!==e.markdown},t.prototype.render=function(){var e=this.props.markdown;if(!e)return _react2.default.createElement("div",null);var t=_marked2.default(e,{sanitize:!0});return _react2.default.createElement("div",{className:this.props.className,dangerouslySetInnerHTML:{__html:t}})},t}(_react2.default.Component)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{graphql:142,marked:203}],4:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),ExecuteButton=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("button",{className:"execute-button",onClick:this.props.onClick,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},_react2.default.createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"})))},t.prototype.componentDidMount=function(){var e=this;this.keyHandler=function(t){(t.metaKey||t.ctrlKey)&&13===t.keyCode&&(t.preventDefault(),e.props.onClick&&e.props.onClick())},document.addEventListener("keydown",this.keyHandler,!0)},t.prototype.componentWillUnmount=function(){document.removeEventListener("keydown",this.keyHandler,!0)},_createClass(t,null,[{key:"propTypes",value:{onClick:_react.PropTypes.func},enumerable:!0}]),t}(_react2.default.Component);exports.ExecuteButton=ExecuteButton}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_graphql=require("graphql"),_ExecuteButton=require("./ExecuteButton"),_ToolbarButton=require("./ToolbarButton"),_QueryEditor=require("./QueryEditor"),_VariableEditor=require("./VariableEditor"),_ResultViewer=require("./ResultViewer"),_DocExplorer=require("./DocExplorer"),_utilityElementPosition=require("../utility/elementPosition"),_utilityFillLeafs=require("../utility/fillLeafs"),_utilityFind=require("../utility/find"),_utilityFind2=_interopRequireDefault(_utilityFind),_utilityIntrospectionQueries=require("../utility/introspectionQueries"),GraphiQL=function(e){function t(r){var i=this;if(_classCallCheck(this,t),e.call(this,r),this._runEditorQuery=function(){i.setState({isWaitingForResponse:!0,response:null}),i._editorQueryID++;var e=i._editorQueryID,t=i.autoCompleteLeafs()||i.state.query;i._fetchQuery(t,i.state.variables,function(t){e===i._editorQueryID&&i.setState({isWaitingForResponse:!1,response:JSON.stringify(t,null,2)})})},this._prettifyQuery=function(){var e=_graphql.print(_graphql.parse(i.state.query)),t=i.refs.queryEditor.getCodeMirror();t.setValue(e)},this._onEditQuery=function(e){return i._storageSet("query",e),i.setState({query:e}),i.props.onEditQuery?i.props.onEditQuery(e):void 0},this._onEditVariables=function(e){i._storageSet("variables",e),i.setState({variables:e}),i.props.onEditVariables&&i.props.onEditVariables(e)},this._onHintInformationRender=function(e){e.addEventListener("click",i._onClickHintInformation);var t;e.addEventListener("DOMNodeRemoved",t=function(){e.removeEventListener("DOMNodeRemoved",t),e.removeEventListener("click",i._onClickHintInformation)})},this._onClickHintInformation=function(e){if("typeName"===e.target.className){var t=e.target.innerHTML,r=i.state.schema;if(r){var n=r.getType(t);n&&i.setState({docsOpen:!0},function(){i.refs.docExplorer.showDoc(n)})}}},this._onToggleDocs=function(){i.setState({docsOpen:!i.state.docsOpen})},this._onResizeStart=function(e){if(i._didClickDragBar(e)){e.preventDefault();var t=e.clientX-_utilityElementPosition.getLeft(e.target),r=function(e){if(0===e.buttons)return n();var r=_reactDom2.default.findDOMNode(i.refs.editorBar),a=e.clientX-_utilityElementPosition.getLeft(r)-t,o=r.clientWidth-a;i.setState({editorFlex:a/o})},n=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){i._storageSet("editorFlex",i.state.editorFlex),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),r=null,n=null});document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}},this._onDocsResizeStart=function(e){e.preventDefault();var t=i.state.docsWidth,r=e.clientX-_utilityElementPosition.getLeft(e.target),n=function(e){if(0===e.buttons)return a();var t=_reactDom2.default.findDOMNode(i),n=e.clientX-_utilityElementPosition.getLeft(t)-r,o=t.clientWidth-n;100>o?i.setState({docsOpen:!1}):i.setState({docsOpen:!0,docsWidth:Math.min(o,650)})},a=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){i.state.docsOpen?i._storageSet("docExplorerWidth",i.state.docsWidth):i.setState({docsWidth:t}),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",a),n=null,a=null});document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)},this._onVariableResizeStart=function(e){e.preventDefault();var t=!1,r=i.state.variableEditorOpen,n=i.state.variableEditorHeight,a=e.clientY-_utilityElementPosition.getTop(e.target),o=function(e){if(0===e.buttons)return s();t=!0;var r=_reactDom2.default.findDOMNode(i.refs.editorBar),o=e.clientY-_utilityElementPosition.getTop(r)-a,l=r.clientHeight-o;60>l?i.setState({variableEditorOpen:!1,variableEditorHeight:n}):i.setState({variableEditorOpen:!0,variableEditorHeight:l})},s=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){t?i._storageSet("variableEditorHeight",i.state.variableEditorHeight):i.setState({variableEditorOpen:!r}),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s),o=null,s=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)},"function"!=typeof r.fetcher)throw new TypeError("GraphiQL requires a fetcher function.");this._storage=r.storage||window.localStorage;var n=void 0!==r.query?r.query:void 0!==this._storageGet("query")?this._storageGet("query"):void 0!==r.defaultQuery?r.defaultQuery:defaultQuery,a=void 0!==r.variables?r.variables:this._storageGet("variables");this.state={schema:r.schema,query:n,variables:a,response:r.response,editorFlex:this._storageGet("editorFlex")||1,variableEditorOpen:Boolean(a),variableEditorHeight:this._storageGet("variableEditorHeight")||200,docsOpen:!1,docsWidth:this._storageGet("docExplorerWidth")||350,isWaitingForResponse:!1},this._editorQueryID=0}return _inherits(t,e),t.prototype.autoCompleteLeafs=function(){var e=_utilityFillLeafs.fillLeafs(this.state.schema,this.state.query,this.props.getDefaultFieldNames),t=e.insertions,r=e.result;if(t&&t.length>0){var i=this.refs.queryEditor.getCodeMirror();i.operation(function(){var e=i.getCursor(),n=i.indexFromPos(e);i.setValue(r);var a=0,o=t.map(function(e){var t=e.index,r=e.string;return i.markText(i.posFromIndex(t+a),i.posFromIndex(t+(a+=r.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return o.forEach(function(e){return e.clear()})},7e3);var s=n;t.forEach(function(e){var t=e.index,r=e.string;n>t&&(s+=r.length)});var l=i.posFromIndex(s);i.setCursor(l)})}return r},_createClass(t,null,[{key:"propTypes",value:{fetcher:_react.PropTypes.func.isRequired,schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),query:_react.PropTypes.string,response:_react.PropTypes.string,storage:_react.PropTypes.shape({getItem:_react.PropTypes.func,setItem:_react.PropTypes.func}),defaultQuery:_react.PropTypes.string,variables:_react.PropTypes.string,onEditQuery:_react.PropTypes.func,onEditVariables:_react.PropTypes.func,getDefaultFieldNames:_react.PropTypes.func},enumerable:!0}]),t.prototype.componentWillReceiveProps=function(e){var t=this.state.schema,r=this.state.query,i=this.state.variables,n=this.state.response;void 0!==e.schema&&(t=e.schema),void 0!==e.query&&(r=e.query),void 0!==e.variables&&(i=e.variables),void 0!==e.response&&(n=e.response),this.setState({schema:t,query:r,variables:i,response:n})},t.prototype.componentDidMount=function(){var e=this;if(void 0===this.state.schema){var t=this.props.fetcher;t({query:_utilityIntrospectionQueries.introspectionQuery}).catch(function(){return t({query:_utilityIntrospectionQueries.introspectionQuerySansSubscriptions})}).then(function(t){if(void 0===e.state.schema)if(t.data)e.setState({schema:_graphql.buildClientSchema(t.data)});else{var r="string"==typeof t?t:JSON.stringify(t,null,2);e.setState({response:r})}}).catch(function(t){e.setState({response:t&&(t.stack||String(t))})})}},t.prototype.componentDidUpdate=function(e,t){(this.state.variableEditorOpen!==t.variableEditorOpen||this.state.variableEditorHeight!==t.variableEditorHeight)&&window.dispatchEvent(new Event("resize"))},t.prototype.render=function(){var e=[];_react2.default.Children.forEach(this.props.children,function(t){e.push(t)});var r=_utilityFind2.default(e,function(e){return e.type===t.Logo})||_react2.default.createElement(t.Logo,null),i=_utilityFind2.default(e,function(e){return e.type===t.Toolbar})||_react2.default.createElement(t.Toolbar,null,_react2.default.createElement(t.ToolbarButton,{onClick:this._prettifyQuery,title:"Prettify Query",label:"Prettify"})),n=_utilityFind2.default(e,function(e){return e.type===t.Footer}),a={WebkitFlex:this.state.editorFlex,flex:this.state.editorFlex},o={display:this.state.docsOpen?"block":"none",width:this.state.docsWidth},s=this.state.variableEditorOpen,l={height:s?this.state.variableEditorHeight:null};return _react2.default.createElement("div",{id:"graphiql-container"},_react2.default.createElement("div",{className:"editorWrap"},_react2.default.createElement("div",{className:"topBarWrap"},_react2.default.createElement("div",{className:"topBar"},r,_react2.default.createElement(_ExecuteButton.ExecuteButton,{onClick:this._runEditorQuery}),i),!this.state.docsOpen&&_react2.default.createElement("button",{className:"docExplorerShow",onClick:this._onToggleDocs},"Docs")),_react2.default.createElement("div",{ref:"editorBar",className:"editorBar",onMouseDown:this._onResizeStart},_react2.default.createElement("div",{className:"queryWrap",style:a},_react2.default.createElement(_QueryEditor.QueryEditor,{ref:"queryEditor",schema:this.state.schema,value:this.state.query,onEdit:this._onEditQuery,onHintInformationRender:this._onHintInformationRender}),_react2.default.createElement("div",{className:"variable-editor",style:l},_react2.default.createElement("div",{className:"variable-editor-title",style:{cursor:s?"row-resize":"n-resize"},onMouseDown:this._onVariableResizeStart},"Query Variables"),_react2.default.createElement(_VariableEditor.VariableEditor,{value:this.state.variables,onEdit:this._onEditVariables}))),_react2.default.createElement("div",{className:"resultWrap"},this.state.isWaitingForResponse&&_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})),_react2.default.createElement(_ResultViewer.ResultViewer,{ref:"result",value:this.state.response}),n))),_react2.default.createElement("div",{className:"docExplorerWrap",style:o},_react2.default.createElement("div",{className:"docExplorerResizer",onMouseDown:this._onDocsResizeStart}),_react2.default.createElement(_DocExplorer.DocExplorer,{ref:"docExplorer",schema:this.state.schema},_react2.default.createElement("div",{className:"docExplorerHide",onClick:this._onToggleDocs},"✕"))))},t.prototype._storageGet=function(e){return this._storage.getItem("graphiql:"+e)},t.prototype._storageSet=function(e,t){this._storage.setItem("graphiql:"+e,t)},t.prototype._fetchQuery=function(e,t,r){var i=this;this.props.fetcher({query:e,variables:t}).then(r).catch(function(e){i.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e))})})},t.prototype._didClickDragBar=function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var r=_reactDom2.default.findDOMNode(this.refs.result);t;){if(t===r)return!0;t=t.parentNode}return!1},t}(_react2.default.Component);exports.GraphiQL=GraphiQL,GraphiQL.Logo=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"title"},this.props.children||_react2.default.createElement("span",null,"Graph",_react2.default.createElement("em",null,"i"),"QL"))},t}(_react2.default.Component),GraphiQL.Toolbar=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"toolbar"},this.props.children)},t}(_react2.default.Component),GraphiQL.ToolbarButton=_ToolbarButton.ToolbarButton,GraphiQL.Footer=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.render=function(){return _react2.default.createElement("div",{className:"footer"},this.props.children)},t}(_react2.default.Component);var defaultQuery="# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser IDE for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will\n# see intelligent typeaheads aware of the current GraphQL type schema and\n# live syntax and validation errors highlighted within the text.\n#\n# To bring up the auto-complete at any point, just press Ctrl-Space.\n#\n# Press the run button above, or Cmd-Enter to execute the query, and the result\n# will appear in the pane to the right.\n\n"}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/elementPosition":11,"../utility/fillLeafs":12,"../utility/find":13,"../utility/introspectionQueries":14,"./DocExplorer":3,"./ExecuteButton":4,"./QueryEditor":6,"./ResultViewer":7,"./ToolbarButton":8,"./VariableEditor":9,graphql:142}],6:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e){return e instanceof _graphql.GraphQLNonNull?renderType(e.ofType)+"!":e instanceof _graphql.GraphQLList?"["+renderType(e.ofType)+"]":'<a class="typeName">'+e.name+"</a>";
}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_marked=require("marked"),_marked2=_interopRequireDefault(_marked),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql");require("codemirror/addon/hint/show-hint"),require("codemirror/addon/comment/comment"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/hint"),require("codemirror-graphql/lint"),require("codemirror-graphql/mode");var QueryEditor=function(e){function t(r){var o=this;_classCallCheck(this,t),e.call(this),this._onKeyUp=function(e,t){var r=t.keyCode;(r>=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&50===r||t.shiftKey&&57===r)&&o.editor.execCommand("autocomplete")},this._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},this._onHasCompletion=function(e,t){var r,i;_codemirror2.default.on(t,"select",function(t,n){if(!r){var a=n.parentNode,s=a.parentNode;r=document.createElement("div"),s.appendChild(r);var l=a.style.top,d="",p=e.cursorCoords().top;parseInt(l,10)<p&&(l="",d=window.innerHeight-p+3+"px"),r.className="CodeMirror-hints-wrapper",r.style.left=a.style.left,r.style.top=l,r.style.bottom=d,a.style.left="",a.style.top="",i=document.createElement("div"),i.className="CodeMirror-hint-information",d?(r.appendChild(i),r.appendChild(a)):(r.appendChild(a),r.appendChild(i));var c;r.addEventListener("DOMNodeRemoved",c=function(e){e.target===a&&(r.removeEventListener("DOMNodeRemoved",c),r.parentNode.removeChild(r),r=null,i=null,c=null)})}var u=t.description?_marked2.default(t.description,{smartypants:!0}):"Self descriptive.",h=t.type?'<span class="infoType">'+renderType(t.type)+"</span>":"";i.innerHTML='<div class="content">'+("<p>"===u.slice(0,3)?"<p>"+h+u.slice(3):h+u)+"</div>";var m=o.props.onHintInformationRender;m&&m(i)})},this.cachedValue=r.value||""}return _inherits(t,e),_createClass(t,null,[{key:"propTypes",value:{schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func},enumerable:!0}]),t.prototype.getCodeMirror=function(){return this.editor},t.prototype.componentDidMount=function(){var e=this;this.editor=_codemirror2.default(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{schema:this.props.schema},hintOptions:{schema:this.props.schema,closeOnUnfocus:!1,completeSingle:!1},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!0})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)},t.prototype.componentWillUnmount=function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null},t.prototype.componentDidUpdate=function(e){this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,_codemirror2.default.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1},t.prototype.render=function(){return _react2.default.createElement("div",{className:"query-editor"})},t}(_react2.default.Component);exports.QueryEditor=QueryEditor}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{codemirror:49,"codemirror-graphql/hint":36,"codemirror-graphql/lint":37,"codemirror-graphql/mode":38,"codemirror/addon/comment/comment":39,"codemirror/addon/edit/closebrackets":40,"codemirror/addon/edit/matchbrackets":41,"codemirror/addon/fold/brace-fold":42,"codemirror/addon/fold/foldgutter":44,"codemirror/addon/hint/show-hint":45,"codemirror/addon/lint/lint":46,"codemirror/keymap/sublime":48,graphql:142,marked:203}],7:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/keymap/sublime"),require("codemirror/mode/javascript/javascript");var ResultViewer=function(e){function t(){_classCallCheck(this,t),e.apply(this,arguments)}return _inherits(t,e),t.prototype.componentDidMount=function(){this.viewer=_codemirror2.default(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",readOnly:!0,theme:"graphiql",mode:{name:"javascript",json:!0},keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-foldgutter"],extraKeys:{"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}})},t.prototype.componentWillUnmount=function(){this.viewer=null},t.prototype.shouldComponentUpdate=function(e){return this.props.value!==e.value},t.prototype.componentDidUpdate=function(){this.viewer.setValue(this.props.value||"")},t.prototype.render=function(){return _react2.default.createElement("div",{className:"result-window"})},_createClass(t,null,[{key:"propTypes",value:{value:_react.PropTypes.string},enumerable:!0}]),t}(_react2.default.Component);exports.ResultViewer=ResultViewer}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{codemirror:49,"codemirror/addon/fold/brace-fold":42,"codemirror/addon/fold/foldgutter":44,"codemirror/keymap/sublime":48,"codemirror/mode/javascript/javascript":50}],8:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}exports.__esModule=!0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),ToolbarButton=function(e){function t(r){var o=this;_classCallCheck(this,t),e.call(this,r),this.onClick=function(e){e.preventDefault();try{o.props.onClick(),o.setState({error:null})}catch(t){o.setState({error:t})}},this.state={error:null}}return _inherits(t,e),_createClass(t,null,[{key:"propTypes",value:{onClick:_react.PropTypes.func,title:_react.PropTypes.string,label:_react.PropTypes.string},enumerable:!0}]),t.prototype.render=function(){var e=this.state.error;return _react2.default.createElement("a",{className:"toolbar-button"+(e?" error":""),onClick:this.onClick,title:e?e.message:this.props.title},this.props.label)},t}(_react2.default.Component);exports.ToolbarButton=ToolbarButton}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}exports.__esModule=!0;var _createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror/mode/javascript/javascript"),require("../codemirror/lint/json-lint");var VariableEditor=function(e){function r(t){var o=this;_classCallCheck(this,r),e.call(this),this._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},this.cachedValue=t.value||""}return _inherits(r,e),_createClass(r,null,[{key:"propTypes",value:{value:_react.PropTypes.string,onEdit:_react.PropTypes.func},enumerable:!0}]),r.prototype.componentDidMount=function(){this.editor=_codemirror2.default(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,theme:"graphiql",mode:{name:"javascript",json:!0},lint:!0,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit)},r.prototype.componentWillUnmount=function(){this.editor.off("change",this._onEdit),this.editor=null},r.prototype.componentDidUpdate=function(e){this.ignoreChangeEvent=!0,this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1},r.prototype.render=function(){return _react2.default.createElement("div",{className:"codemirrorWrap",ref:"codemirror"})},r}(_react2.default.Component);exports.VariableEditor=VariableEditor}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../codemirror/lint/json-lint":1,codemirror:49,"codemirror/addon/fold/brace-fold":42,"codemirror/addon/fold/foldgutter":44,"codemirror/addon/lint/lint":46,"codemirror/keymap/sublime":48,"codemirror/mode/javascript/javascript":50}],10:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":5}],11:[function(require,module,exports){"use strict";function getLeft(t){for(var e=0,f=t;f.offsetParent;)e+=f.offsetLeft,f=f.offsetParent;return e}function getTop(t){for(var e=0,f=t;f.offsetParent;)e+=f.offsetTop,f=f.offsetParent;return e}exports.__esModule=!0,exports.getLeft=getLeft,exports.getTop=getTop},{}],12:[function(require,module,exports){"use strict";function fillLeafs(e,t,r){var n=[];if(!e)return{insertions:n,result:t};var i=void 0;try{i=_graphql.parse(t)}catch(a){return{insertions:n,result:t}}var l=r||defaultGetDefaultFieldNames,s=new _graphql.TypeInfo(e);return _graphql.visit(i,{leave:function(e){s.leave(e)},enter:function(e){if(s.enter(e),"Field"===e.kind&&!e.selectionSet){var r=s.getType(),i=buildSelectionSet(r,l);if(i){var a=getIndentation(t,e.loc.start);n.push({index:e.loc.end,string:" "+_graphql.print(i).replace(/\n/g,"\n"+a)})}}}}),{insertions:n,result:withInsertions(t,n)}}function defaultGetDefaultFieldNames(e){if(!e.getFields)return[];var t=e.getFields();if(t.id)return["id"];if(t.edges)return["edges"];if(t.node)return["node"];var r=[];return Object.keys(t).forEach(function(e){_graphql.isLeafType(t[e].type)&&r.push(e)}),r}function buildSelectionSet(e,t){var r=_graphql.getNamedType(e);if(e&&!_graphql.isLeafType(e)){var n=t(r);if(Array.isArray(n)&&0!==n.length)return{kind:"SelectionSet",selections:n.map(function(e){var n=r.getFields()[e],i=n?n.type:null;return{kind:"Field",name:{kind:"Name",value:e},selectionSet:buildSelectionSet(i,t)}})}}}function withInsertions(e,t){if(0===t.length)return e;var r="",n=0;return t.forEach(function(t){var i=t.index,a=t.string;r+=e.slice(n,i)+a,n=i}),r+=e.slice(n)}function getIndentation(e,t){for(var r=t,n=t;r;){var i=e.charCodeAt(r-1);if(10===i||13===i||8232===i||8233===i)break;r--,9!==i&&11!==i&&12!==i&&32!==i&&160!==i&&(n=r)}return e.substring(r,n)}exports.__esModule=!0,exports.fillLeafs=fillLeafs;var _graphql=require("graphql")},{graphql:142}],13:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}exports.__esModule=!0,exports.default=find,module.exports=exports.default},{}],14:[function(require,module,exports){"use strict";exports.__esModule=!0;var _graphql=require("graphql");exports.introspectionQuery=_graphql.introspectionQuery;var introspectionQuerySansSubscriptions="\n  query IntrospectionQuery {\n    __schema {\n      queryType { name }\n      mutationType { name }\n      types {\n        ...FullType\n      }\n      directives {\n        name\n        description\n        args {\n          ...InputValue\n        }\n        onOperation\n        onFragment\n        onField\n      }\n    }\n  }\n\n  fragment FullType on __Type {\n    kind\n    name\n    description\n    fields(includeDeprecated: true) {\n      name\n      description\n      args {\n        ...InputValue\n      }\n      type {\n        ...TypeRef\n      }\n      isDeprecated\n      deprecationReason\n    }\n    inputFields {\n      ...InputValue\n    }\n    interfaces {\n      ...TypeRef\n    }\n    enumValues(includeDeprecated: true) {\n      name\n      description\n      isDeprecated\n      deprecationReason\n    }\n    possibleTypes {\n      ...TypeRef\n    }\n  }\n\n  fragment InputValue on __InputValue {\n    name\n    description\n    type { ...TypeRef }\n    defaultValue\n  }\n\n  fragment TypeRef on __Type {\n    kind\n    name\n    ofType {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n        }\n      }\n    }\n  }\n";exports.introspectionQuerySansSubscriptions=introspectionQuerySansSubscriptions},{graphql:142}],15:[function(require,module,exports){module.exports={default:require("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":51}],16:[function(require,module,exports){module.exports={default:require("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":52}],17:[function(require,module,exports){module.exports={default:require("core-js/library/fn/is-iterable"),__esModule:!0}},{"core-js/library/fn/is-iterable":53}],18:[function(require,module,exports){module.exports={default:require("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":54}],19:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":55}],20:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":56}],21:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":57}],22:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/get-own-property-descriptor"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-descriptor":58}],23:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":59}],24:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":60}],25:[function(require,module,exports){module.exports={default:require("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":61}],26:[function(require,module,exports){module.exports={default:require("core-js/library/fn/set"),__esModule:!0}},{"core-js/library/fn/set":62}],27:[function(require,module,exports){"use strict";exports.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},exports.__esModule=!0},{}],28:[function(require,module,exports){"use strict";var _Object$defineProperty=require("babel-runtime/core-js/object/define-property").default;exports.default=function(){function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,n.key,n)}}return function(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}}(),exports.__esModule=!0},{"babel-runtime/core-js/object/define-property":21}],29:[function(require,module,exports){"use strict";var _Object$assign=require("babel-runtime/core-js/object/assign").default;exports.default=_Object$assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},exports.__esModule=!0},{"babel-runtime/core-js/object/assign":19}],30:[function(require,module,exports){"use strict";var _Object$getOwnPropertyDescriptor=require("babel-runtime/core-js/object/get-own-property-descriptor").default;exports.default=function(r,e,t){for(var o=!0;o;){var i=r,u=e,n=t;o=!1,null===i&&(i=Function.prototype);var a=_Object$getOwnPropertyDescriptor(i,u);if(void 0!==a){if("value"in a)return a.value;var c=a.get;if(void 0===c)return;return c.call(n)}var l=Object.getPrototypeOf(i);if(null===l)return;r=l,e=u,t=n,o=!0,a=l=void 0}},exports.__esModule=!0},{"babel-runtime/core-js/object/get-own-property-descriptor":22}],31:[function(require,module,exports){"use strict";var _Object$create=require("babel-runtime/core-js/object/create").default,_Object$setPrototypeOf=require("babel-runtime/core-js/object/set-prototype-of").default;exports.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(_Object$setPrototypeOf?_Object$setPrototypeOf(e,t):e.__proto__=t)},exports.__esModule=!0},{"babel-runtime/core-js/object/create":20,"babel-runtime/core-js/object/set-prototype-of":24}],32:[function(require,module,exports){"use strict";exports.default=function(e){return e&&e.__esModule?e:{default:e}},exports.__esModule=!0},{}],33:[function(require,module,exports){"use strict";exports.default=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r},exports.__esModule=!0},{}],34:[function(require,module,exports){"use strict";var _getIterator=require("babel-runtime/core-js/get-iterator").default,_isIterable=require("babel-runtime/core-js/is-iterable").default;exports.default=function(){function r(r,e){var t=[],n=!0,a=!1,i=void 0;try{for(var u,o=_getIterator(r);!(n=(u=o.next()).done)&&(t.push(u.value),!e||t.length!==e);n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(_isIterable(Object(e)))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),exports.__esModule=!0},{"babel-runtime/core-js/get-iterator":16,"babel-runtime/core-js/is-iterable":17}],35:[function(require,module,exports){"use strict";var _Array$from=require("babel-runtime/core-js/array/from").default;exports.default=function(r){if(Array.isArray(r)){for(var e=0,a=Array(r.length);e<r.length;e++)a[e]=r[e];return a}return _Array$from(r)},exports.__esModule=!0},{"babel-runtime/core-js/array/from":15}],36:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTypeInfo(e,t){var n={type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return forEachState(t,function(t){switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":n.fieldDef=n.type&&t.name?getFieldDef(e,n.parentType,t.name):null,n.type=n.fieldDef&&n.fieldDef.type;break;case"SelectionSet":n.parentType=_graphql.getNamedType(n.type);break;case"Directive":n.directiveDef=t.name&&e.getDirective(t.name);break;case"Arguments":n.argDefs="Field"===t.prevState.kind?n.fieldDef&&n.fieldDef.args:"Directive"===t.prevState.kind?n.directiveDef&&n.directiveDef.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(var r=0;r<n.argDefs.length;r++)if(n.argDefs[r].name===t.name){n.argDef=n.argDefs[r];break}n.inputType=n.argDef&&n.argDef.type;break;case"ListValue":var i=_graphql.getNullableType(n.inputType);n.inputType=i instanceof _graphql.GraphQLList?i.ofType:null;break;case"ObjectValue":var a=_graphql.getNamedType(n.inputType);n.objectFieldDefs=a instanceof _graphql.GraphQLInputObjectType?a.getFields():null;break;case"ObjectField":var p=t.name&&n.objectFieldDefs?n.objectFieldDefs[t.name]:null;n.inputType=p&&p.type}}),n}function getDefinitionState(e){var t=void 0;return forEachState(e,function(e){switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}}),t}function forEachState(e,t){for(var n=[],r=e;r&&r.kind;)n.push(r),r=r.prevState;for(var i=n.length-1;i>=0;i--)t(n[i])}function getFragmentDefinitions(e){var t=[];return runMode(e,"graphql",function(e){"FragmentDefinition"===e.kind&&e.name&&e.type&&t.push({kind:"FragmentDefinition",name:{kind:"Name",value:e.name},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.type}}})}),t}function runMode(e,t,n){var r=_codemirror2.default.getMode(_codemirror2.default.defaults,t),i=_codemirror2.default.startState(r);e.eachLine(function(e){for(var t=new _codemirror2.default.StringStream(e.text);!t.eol();){var a=r.token(t,i);n(i,a,t),t.start=t.pos}})}function getFieldDef(e,t,n){return n===_graphqlTypeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.SchemaMetaFieldDef:n===_graphqlTypeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.TypeMetaFieldDef:n===_graphqlTypeIntrospection.TypeNameMetaFieldDef.name&&_graphql.isCompositeType(t)?_graphqlTypeIntrospection.TypeNameMetaFieldDef:t.getFields?t.getFields()[n]:void 0}function hintList(e,t,n,r,i){var a=filterAndSortList(i,normalizeText(r.string));if(a){var p=null!==r.type&&/\w/.test(r.string[0])?r.start:r.end,o={list:a,from:_codemirror2.default.Pos(n.line,p),to:_codemirror2.default.Pos(n.line,r.end)};return _codemirror2.default.signal(e,"hasCompletion",e,o,r),o}}function filterAndSortList(e,t){var n=t?e.map(function(e){return{proximity:getProximity(normalizeText(e.text),t),entry:e}}).filter(function(e){return e.proximity<=2}).sort(function(e,t){return e.proximity-t.proximity||e.entry.text.length-t.entry.text.length}).map(function(e){return e.entry}):e;return n.length>0?n:e}function normalizeText(e){return e.toLowerCase().replace(/\W/g,"")}function getProximity(e,t){var n=lexicalDistance(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function lexicalDistance(e,t){var n,r,i=[],a=e.length,p=t.length;for(n=0;a>=n;n++)i[n]=[n];for(r=1;p>=r;r++)i[0][r]=r;for(n=1;a>=n;n++)for(r=1;p>=r;r++){var o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[a][p]}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_graphqlTypeIntrospection=require("graphql/type/introspection");require("./mode"),_codemirror2.default.registerHelper("hint","graphql",function(e,t){var n=t.schema;if(n){var r=e.getCursor(),i=e.getTokenAt(r),a=getTypeInfo(n,i.state),p=i.state,o=p.kind,l=p.step;if("comment"!==i.type){if("Document"===o)return hintList(e,t,r,i,[{text:"query"},{text:"mutation"},{text:"subscription"},{text:"fragment"},{text:"{"}]);if(("SelectionSet"===o||"Field"===o||"AliasedField"===o)&&a.parentType){var u;if(a.parentType.getFields){var f=a.parentType.getFields();u=Object.keys(f).map(function(e){return f[e]})}else u=[];return _graphql.isAbstractType(a.parentType)&&u.push(_graphqlTypeIntrospection.TypeNameMetaFieldDef),a.parentType===n.getQueryType()&&u.push(_graphqlTypeIntrospection.SchemaMetaFieldDef,_graphqlTypeIntrospection.TypeMetaFieldDef),hintList(e,t,r,i,u.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("Arguments"===o||"Argument"===o&&0===l){var s=a.argDefs;if(s)return hintList(e,t,r,i,s.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if(("ObjectValue"===o||"ObjectField"===o&&0===l)&&a.objectFieldDefs){var c=Object.keys(a.objectFieldDefs).map(function(e){return a.objectFieldDefs[e]});return hintList(e,t,r,i,c.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("EnumValue"===o||"ListValue"===o&&1===l||"ObjectField"===o&&2===l||"Argument"===o&&2===l){var d=_graphql.getNamedType(a.inputType);if(d instanceof _graphql.GraphQLEnumType){var y=d.getValues(),g=Object.keys(y).map(function(e){return y[e]});return hintList(e,t,r,i,g.map(function(e){return{text:e.name,type:d,description:e.description}}))}if(d===_graphql.GraphQLBoolean)return hintList(e,t,r,i,[{text:"true",type:_graphql.GraphQLBoolean,description:"Not false."},{text:"false",type:_graphql.GraphQLBoolean,description:"Not true."}])}if("TypeCondition"===o&&1===l||"NamedType"===o&&"TypeCondition"===p.prevState.kind){var m;return a.parentType?m=_graphql.isAbstractType(a.parentType)?a.parentType.getPossibleTypes():[a.parentType]:!function(){var e=n.getTypeMap();m=Object.keys(e).map(function(t){return e[t]}).filter(_graphql.isCompositeType)}(),hintList(e,t,r,i,m.map(function(e){return{text:e.name,description:e.description}}))}if("FragmentSpread"===o&&1===l){var h=function(){var p=n.getTypeMap(),o=getDefinitionState(i.state),l=getFragmentDefinitions(e),u=l.filter(function(e){return p[e.typeCondition.name.value]&&!(o&&"FragmentDefinition"===o.kind&&o.name===e.name.value)&&_graphql.doTypesOverlap(a.parentType,p[e.typeCondition.name.value])});return{v:hintList(e,t,r,i,u.map(function(e){return{text:e.name.value,type:p[e.typeCondition.name.value],description:"fragment "+e.name.value+" on "+e.typeCondition.name.value}}))}}();if("object"==typeof h)return h.v}if("VariableDefinition"===o&&2===l||"ListType"===o&&1===l||"NamedType"===o&&("VariableDefinition"===p.prevState.kind||"ListType"===p.prevState.kind)){var T=n.getTypeMap(),v=Object.keys(T).map(function(e){return T[e]}).filter(_graphql.isInputType);return hintList(e,t,r,i,v.map(function(e){return{text:e.name,description:e.description}}))}if("Directive"===o){var D=n.getDirectives().filter(function(e){return e.onField&&"Field"===p.prevState.kind||e.onFragment&&("FragmentDefinition"===p.prevState.kind||"InlineFragment"===p.prevState.kind||"FragmentSpread"===p.prevState.kind)||e.onOperation&&("Query"===p.prevState.kind||"Mutation"===p.prevState.kind||"Subscription"===p.prevState.kind)});return hintList(e,t,r,i,D.map(function(e){return{text:e.name,description:e.description}}))}}}})},{"./mode":38,codemirror:49,graphql:142,"graphql/type/introspection":159}],37:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function errorAnnotations(r,e){return e.nodes.map(function(o){var t="Variable"!==o.kind&&o.name?o.name:o.variable?o.variable:o;return{message:e.message,severity:"error",type:"validation",from:r.posFromIndex(t.loc.start),to:r.posFromIndex(t.loc.end)}})}function mapCat(r,e){return Array.prototype.concat.apply([],r.map(e))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql");_codemirror2.default.registerHelper("lint","graphql",function(r,e,o){var t=e.schema;try{var a=_graphql.parse(r)}catch(n){var i=n.locations[0],l=_codemirror2.default.Pos(i.line-1,i.column),s=o.getTokenAt(l);return[{message:n.message,severity:"error",type:"syntax",from:_codemirror2.default.Pos(i.line-1,s.start),to:_codemirror2.default.Pos(i.line-1,s.end)}]}var u=t?_graphql.validate(t,a):[];return mapCat(u,function(r){return errorAnnotations(o,r)})})},{codemirror:49,graphql:142}],38:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getToken(e,t){if(t.needsAdvance&&(t.needsAdvance=!1,advanceRule(t)),e.sol()&&(t.indentLevel=Math.floor(e.indentation()/this.config.tabSize)),e.eatSpace()||e.eatWhile(","))return null;if(e.match(this.lineComment))return e.skipToEnd(),"comment";var n=lex(e);if(!n)return e.match(/\w+|./),"invalidchar";if(saveState(t),"Punctuation"===n.kind)if(/^[{([]/.test(n.value))t.levels=(t.levels||[]).concat(t.indentLevel+1);else if(/^[})\]]/.test(n.value)){var i=t.levels=(t.levels||[]).slice(0,-1);i.length>0&&i[i.length-1]<t.indentLevel&&(t.indentLevel=i[i.length-1])}for(;t.rule;){var r="function"==typeof t.rule?0===t.step?t.rule(n,e):null:t.rule[t.step];
if(r){if(r.ofRule&&(r=r.ofRule),"string"==typeof r){pushRule(t,r);continue}if(r.match&&r.match(n))return r.update&&r.update(t,n),"Punctuation"===n.kind?advanceRule(t):t.needsAdvance=!0,r.style}unsuccessful(t)}return restoreState(t),"invalidchar"}function indent(e,t){var n=e.levels,i=n&&0!==n.length?n[n.length-1]-(this.electricInput.test(t)?1:0):e.indentLevel;return i*this.config.indentUnit}function assign(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++)e[n[i]]=t[n[i]];return e}function saveState(e){assign(stateCache,e)}function restoreState(e){assign(e,stateCache)}function pushRule(e,t){e.prevState=assign({},e),e.kind=t,e.name=null,e.type=null,e.rule=ParseRules[t],e.step=0}function popRule(e){e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.prevState=e.prevState.prevState}function advanceRule(e){for(e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)popRule(e),!e.rule||Array.isArray(e.rule)&&e.rule[e.step].isList||e.step++}function unsuccessful(e){for(;e.rule&&(!Array.isArray(e.rule)||!e.rule[e.step].ofRule);)popRule(e);e.rule&&advanceRule(e)}function lex(e){for(var t=Object.keys(LexRules),n=0;n<t.length;n++){var i=e.match(LexRules[t[n]]);if(i)return{kind:t[n],value:i[0]}}}function butNot(e,t){var n=e.match;return e.match=function(e){return n(e)&&t.every(function(t){return!t.match(e)})},e}function opt(e){return{ofRule:e}}function list(e){return{ofRule:e,isList:!0}}function t(e,t){return{style:t,match:function(t){return t.kind===e}}}function p(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}function word(e){return{style:"keyword",match:function(t){return"Name"===t.kind&&t.value===e}}}function name(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){e.name=t.value}}}function type(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){e.prevState.type=t.value}}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);_codemirror2.default.defineMode("graphql",function(e){return{config:e,token:getToken,indent:indent,startState:function(){var e={level:0};return pushRule(e,"Document"),e},electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}});var stateCache={},LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|@|\[|\]|\{|\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/},ParseRules={Document:[list("Definition")],Definition:function(e){switch(e.value){case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return"FragmentDefinition";case"{":return"ShortQuery"}},Query:[word("query"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],ShortQuery:["SelectionSet"],Mutation:[word("mutation"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Subscription:[word("subscription"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],VariableDefinitions:[p("("),list("VariableDefinition"),p(")")],VariableDefinition:["Variable",p(":"),"Type",opt("DefaultValue")],Variable:[p("$","variable"),name("variable")],DefaultValue:[p("="),"Value"],SelectionSet:[p("{"),list("Selection"),p("}")],Selection:function(e,t){return"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("qualifier"),p(":"),"Field"],Field:[name("property"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Arguments:[p("("),list("Argument"),p(")")],Argument:[name("attribute"),p(":"),"Value"],FragmentSpread:[p("..."),name("def"),list("Directive")],InlineFragment:[p("..."),opt("TypeCondition"),list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),opt(butNot(name("def"),[word("on")])),"TypeCondition",list("Directive"),"SelectionSet"],TypeCondition:[word("on"),type("atom")],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"EnumValue"}},NumberValue:[t("Number","number")],StringValue:[t("String","string")],BooleanValue:[t("Name","builtin")],EnumValue:[name("string-2")],ListValue:[p("["),list("Value"),p("]")],ObjectValue:[p("{"),list("ObjectField"),p("}")],ObjectField:[name("attribute"),p(":"),"Value"],Type:function(e){return"["===e.value?"ListType":"NamedType"},ListType:[p("["),"NamedType",p("]"),opt(p("!"))],NamedType:[name("atom"),opt(p("!"))],Directive:[p("@","meta"),name("meta"),opt("Arguments")]}},{codemirror:49}],39:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(i);return-1==n?0:n}var t={},i=/[^\s\u00a0]/,l=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),r=null,a=o.length-1;a>=0;a--){var m=o[a].from(),c=o[a].to();m.line>=i||(c.line>=i&&(c=l(i,0)),i=m.line,null==r?n.uncomment(m,c,e)?r="un":(n.lineComment(m,c,e),r="line"):"un"==r?n.uncomment(m,c,e):n.lineComment(m,c,e))}}),e.defineExtension("lineComment",function(e,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent){for(var t=null,o=e.line;g>o;++o){var m=a.getLine(o),f=m.slice(0,n(m));(null==t||t.length>f.length)&&(t=f)}for(var o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var C=o.blockCommentStart||m.blockCommentStart,p=o.blockCommentEnd||m.blockCommentEnd;if(!C||!p)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(C),R=L.lastIndexOf(p);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(p)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(C,e.ch),E=-1==O?-1:k.slice(0,e.ch).indexOf(p,O+C.length);if(-1!=O&&-1!=E&&E+p.length!=e.ch)return!1;E=L.indexOf(p,n.ch);var M=L.slice(n.ch).lastIndexOf(C,E-n.ch);return O=-1==E||-1==M?-1:n.ch+M,-1!=E&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+p.length));var e=x+C.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})})},{"../../lib/codemirror":49}],40:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=t(i,"pairs"),o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}for(var s=o.length-1;s>=0;s--){var f=o[s].head;n.replaceRange("",h(f.line,f.ch-1),h(f.line,f.ch+1),"+delete")}}function a(n){var i=r(n),a=i&&t(i,"explode");if(!a||n.getOption("disableInput"))return e.Pass;for(var o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),o=n.listSelections();for(var e=0;e<o.length;e++){var t=o[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function o(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var a=r(n);if(!a||n.getOption("disableInput"))return e.Pass;var s=t(a,"pairs"),c=s.indexOf(i);if(-1==c)return e.Pass;for(var u,d,g=t(a,"triples"),p=s.charAt(c+1)==i,v=n.listSelections(),m=c%2==0,b=0;b<v.length;b++){var x,C=v[b],P=C.head,d=n.getRange(P,h(P.line,P.ch+1));if(m&&!C.empty())x="surround";else if(!p&&m||d!=i)if(p&&P.ch>1&&g.indexOf(i)>=0&&n.getRange(h(P.line,P.ch-2),P)==i+i&&(P.ch<=2||n.getRange(h(P.line,P.ch-3),h(P.line,P.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(d)||!f(n,P,i))return e.Pass;x="both"}else{if(!m||n.getLine(P.line).length!=P.ch&&!l(d,s)&&!/\s/.test(d))return e.Pass;x="both"}else x=g.indexOf(i)>=0&&n.getRange(P,h(P.line,P.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=c%2?s.charAt(c-1):i,k=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=S+t[e]+k;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=o(t[e]);n.setSelections(t)}else"both"==u?(n.replaceSelection(S+k,null),n.triggerElectric(S+k),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(S+S+S+S,"before"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var n=e.getRange(h(t.line,t.ch-1),h(t.line,t.ch+1));return 2==n.length?n:null}function f(t,n,r){var i=t.getLine(n.line),a=t.getTokenAt(n);if(/\bstring2?\b/.test(a.type))return!1;var o=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=n.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var d=u.pairs+"`",g={Backspace:i,Enter:a},p=0;p<d.length;p++)g["'"+d.charAt(p)+"'"]=n(d.charAt(p))})},{"../../lib/codemirror":49}],41:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){var o=e.getLineHandle(t.line),f=t.ch-1,l=f>=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(0>n?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l<f.length;l++){var u=f[l].empty()&&t(e,f[l].head,!1,i);if(u&&e.getLine(u.from.line).length<=r){var h=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";c.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:h})),u.to&&e.getLine(u.to.line).length<=r&&c.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:h}))}}if(c.length){o&&e.state.focused&&e.focus();var s=function(){e.operation(function(){for(var e=0;e<c.length;e++)c[e].clear()})};if(!n)return s;setTimeout(s,800)}}function r(e){e.operation(function(){f&&(f(),f=null),f=i(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})})},{"../../lib/codemirror":49}],42:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u<n.ch)break;if(o=r.getTokenTypeAt(e.Pos(l,u+1)),!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==s)break;s=1,i=f.length}}}var i,o,l=n.line,f=r.getLine(l),s="{",u="}",i=t("{");if(null==i&&(s="[",u="]",i=t("[")),null!=i){var a,d,c=1,g=r.lastLine();e:for(var v=l;g>=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),e.registerHelper("fold","include",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":49}],43:[function(require,module,exports){!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.line<u)return null;for(var r=o.findMarksAt(e.from),t=0;t<r.length;++t)if(r[t].__isFold&&"fold"!==f){if(!n)return null;e.cleared=!0,r[t].clear()}return e}if(t&&t.call){var d=t;t=null}else var d=r(o,t,"rangeFinder");"number"==typeof i&&(i=n.Pos(i,0));var u=r(o,t,"minFoldSize"),a=l(!0);if(r(o,t,"scanUp"))for(;!a&&i.line>o.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e<o.length;++e)if(o[e].__isFold)return!0}),n.commands.toggleFold=function(n){n.foldCode(n.getCursor())},n.commands.fold=function(n){n.foldCode(n.getCursor(),null,"fold")},n.commands.unfold=function(n){n.foldCode(n.getCursor(),null,"unfold")},n.commands.foldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r<n.length;++r){var i=n[r](o,e);if(i)return i}}}),n.registerHelper("fold","auto",function(n,o){for(var e=n.getHelpers(o,"fold"),r=0;r<e.length;r++){var i=e[r](n,o);if(i)return i}});var i={rangeFinder:n.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};n.defineOption("foldOptions",null),n.defineExtension("foldOption",function(n,o){return r(this,n,o)})})},{"../../lib/codemirror":49}],44:[function(require,module,exports){!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],o):o(CodeMirror)}(function(o){"use strict";function t(o){this.options=o,this.from=this.to=0}function e(o){return o===!0&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o}function r(o,t){for(var e=o.findMarksAt(c(t)),r=0;r<e.length;++r)if(e[r].__isFold&&e[r].find().from.line==t)return e[r]}function n(o){if("string"==typeof o){var t=document.createElement("div");return t.className=o+" CodeMirror-guttermarker-subtle",t}return o.cloneNode(!0)}function i(o,t,e){var i=o.state.foldGutter.options,f=t,d=o.foldOption(i,"minFoldSize"),a=o.foldOption(i,"rangeFinder");o.eachLine(t,e,function(t){var e=null;if(r(o,f))e=n(i.indicatorFolded);else{var u=c(f,0),l=a&&a(o,u);l&&l.to.line-l.from.line>=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var n=o.state.foldGutter;if(n){var i=n.options;if(e==i.gutter){var f=r(o,t);f?f.clear():o.foldCode(c(t,0),i.rangeFinder)}}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.from<t.from&&(i(o,e.from,t.from),t.from=e.from),e.to>t.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r<e.to&&i(o,r,r+1)}}o.defineOption("foldGutter",!1,function(r,n,i){i&&i!=o.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",d),r.off("change",a),r.off("viewportChange",u),r.off("fold",l),r.off("unfold",l),r.off("swapDoc",a)),n&&(r.state.foldGutter=new t(e(n)),f(r),r.on("gutterClick",d),r.on("change",a),r.on("viewportChange",u),r.on("fold",l),r.on("unfold",l),r.on("swapDoc",a))});var c=o.Pos})},{"../../lib/codemirror":49,"./foldcode":43}],45:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function i(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}function e(t,i,e){var n=t.options.hintOptions,o={};for(var s in d)o[s]=d[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);return o.hint.resolve&&(o.hint=o.hint.resolve(t,i)),o}function n(t){return"string"==typeof t?t:t.text}function o(t,i){function e(t,e){var o;o="string"!=typeof e?function(t){return e(t,i)}:n.hasOwnProperty(e)?n[e]:e,s[t]=o}var n={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(-i.menuSize()+1,!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&e(c,o[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&e(c,r[c]);return s}function s(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function c(i,e){this.completion=i,this.data=e,this.picked=!1;var c=this,r=i.cm,h=this.hints=document.createElement("ul");h.className="CodeMirror-hints",this.selectedHint=e.selectedHint||0;for(var u=e.list,f=0;f<u.length;++f){var d=h.appendChild(document.createElement("li")),p=u[f],m=l+(f!=this.selectedHint?"":" "+a);null!=p.className&&(m=p.className+" "+m),d.className=m,p.render?p.render(d,e,p):d.appendChild(document.createTextNode(p.displayText||n(p))),d.hintId=f}var g=r.cursorCoords(i.options.alignWithWord?e.from:null),v=g.left,y=g.bottom,w=!0;h.style.left=v+"px",h.style.top=y+"px";var k=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),H=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(i.options.container||document.body).appendChild(h);var C=h.getBoundingClientRect(),b=C.bottom-H;if(b>0){var A=C.bottom-C.top,x=g.top-(g.bottom-C.top);if(x-A>0)h.style.top=(y=g.top-A)+"px",w=!1;else if(A>H){h.style.height=H-5+"px",h.style.top=(y=g.bottom-C.top)+"px";var S=r.getCursor();e.from.ch!=S.ch&&(g=r.cursorCoords(S),h.style.left=(v=g.left)+"px",C=h.getBoundingClientRect())}}var T=C.right-k;if(T>0&&(C.right-C.left>k&&(h.style.width=k-5+"px",T-=C.right-C.left-k),h.style.left=(v=g.left-T)+"px"),r.addKeyMap(this.keyMap=o(i,{moveFocus:function(t,i){c.changeActive(c.selectedHint+t,i)},setFocus:function(t){c.changeActive(t)},menuSize:function(){return c.screenAmount()},length:u.length,close:function(){i.close()},pick:function(){c.pick()},data:e})),i.options.closeOnUnfocus){var M;r.on("blur",this.onBlur=function(){M=setTimeout(function(){i.close()},100)}),r.on("focus",this.onFocus=function(){clearTimeout(M)})}var F=r.getScrollInfo();return r.on("scroll",this.onScroll=function(){var t=r.getScrollInfo(),e=r.getWrapperElement().getBoundingClientRect(),n=y+F.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return w||(o+=h.offsetHeight),o<=e.top||o>=e.bottom?i.close():(h.style.top=n+"px",void(h.style.left=v+F.left-t.left+"px"))}),t.on(h,"dblclick",function(t){var i=s(h,t.target||t.srcElement);i&&null!=i.hintId&&(c.changeActive(i.hintId),c.pick())}),t.on(h,"click",function(t){var e=s(h,t.target||t.srcElement);e&&null!=e.hintId&&(c.changeActive(e.hintId),i.options.completeOnSingleClick&&c.pick())}),t.on(h,"mousedown",function(){setTimeout(function(){r.focus()},20)}),t.signal(e,"select",u[0],h.firstChild),!0}function r(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n<i.length;n++)i[n].supportsSelection&&e.push(i[n]);return e}function h(i,e){var n,o=i.getHelpers(e,"hint");if(o.length){for(var s,c=!1,h=0;h<o.length;h++)o[h].async&&(c=!0);return c?(s=function(t,i,e){function n(o,c){if(o==s.length)return i(null);var r=s[o];if(r.async)r(t,function(t){t?i(t):n(o+1)},e);else{var c=r(t,e);c?i(c):n(o+1)}}var s=r(t,o);n(0)},s.async=!0):s=function(t,i){for(var e=r(t,o),n=0;n<e.length;n++){var s=e[n](t,i);if(s&&s.list.length)return s}},s.supportsSelection=!0,s}return(n=i.getHelper(i.getCursor(),"hintWords"))?function(i){return t.hint.fromList(i,{words:n})}:t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}var l="CodeMirror-hint",a="CodeMirror-hint-active";t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",function(n){n=e(this,this.getCursor("start"),n);var o=this.listSelections();if(!(o.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var s=0;s<o.length;s++)if(o[s].head.line!=o[s].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var c=this.state.completionActive=new i(this,n);c.options.hint&&(t.signal(this,"startCompletion",this),c.update(!0))}});var u=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},f=window.cancelAnimationFrame||clearTimeout;i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,e){var o=i.list[e];o.hint?o.hint(this.cm,i,o):this.cm.replaceRange(n(o),o.from||i.from,o.to||i.to,"complete"),t.signal(i,"pick",o),this.close()},cursorActivity:function(){this.debounce&&(f(this.debounce),this.debounce=0);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch<this.startPos.ch||this.cm.somethingSelected()||t.ch&&this.options.closeCharacters.test(i.charAt(t.ch-1)))this.close();else{var e=this;this.debounce=u(function(){e.update()}),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick)if(this.options.hint.async){var i=++this.tick,e=this;this.options.hint(this.cm,function(n){e.tick==i&&e.finishUpdate(n,t)},this.options)}else this.finishUpdate(this.options.hint(this.cm,this.options),t)},finishUpdate:function(i,e){this.data&&t.signal(this.data,"update"),i&&this.data&&t.cmpPos(i.from,this.data.from)&&(i=null),this.data=i;var n=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),i&&i.list.length&&(n&&1==i.list.length?this.pick(i,0):(this.widget=new c(this,i),t.signal(i,"shown")))}},c.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,e){if(i>=this.data.list.length?i=e?this.data.list.length-1:0:0>i&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+a,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+a,n.offsetTop<this.hints.scrollTop?this.hints.scrollTop=n.offsetTop-3:n.offsetTop+n.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:h}),t.registerHelper("hint","fromList",function(i,e){var n=i.getCursor(),o=i.getTokenAt(n),s=t.Pos(n.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var c=o.string,r=t.Pos(n.line,o.start);else var c="",r=s;for(var h=[],l=0;l<e.words.length;l++){var a=e.words[l];a.slice(0,c.length)==c&&h.push(a)}return h.length?{list:h,from:r,to:s}:void 0}),t.commands.autocomplete=t.showHint;var d={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})},{"../../lib/codemirror":49}],46:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),l&&(o(l),l=null)}var l=e(n,r),s=setInterval(function(){if(l)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}return l?void 0:clearInterval(s)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)},this.waitingFor=0}function a(t,e){return e instanceof Function?{getAnnotations:e}:(e&&e!==!0||(e={}),e)}function l(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(y);
for(var n=0;n<e.marked.length;++n)e.marked[n].clear();e.marked.length=0}function s(e,n,o,i){var a=document.createElement("div"),l=a;return a.className="CodeMirror-lint-marker-"+n,o&&(l=a.appendChild(document.createElement("div")),l.className="CodeMirror-lint-marker-multiple"),0!=i&&t.on(l,"mouseover",function(t){r(t,e,l)}),a}function u(t,e){return"error"==t?t:e}function c(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}function f(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+e,n.appendChild(document.createTextNode(t.message)),n}function m(e,n,o){function r(){a=-1,e.off("change",r)}var i=e.state.lint,a=++i.waitingFor;e.on("change",r),n(e.getValue(),function(n,o){e.off("change",r),i.waitingFor==a&&(o&&n instanceof t&&(n=o),p(e,n))},o,e)}function d(e){var n=e.state.lint,o=n.options,r=o.options||o,i=o.getAnnotations||e.getHelper(t.Pos(0,0),"lint");i&&(o.async||i.async?m(e,i,r):p(e,i(e.getValue(),r,e)))}function p(t,e){l(t);for(var n=t.state.lint,o=n.options,r=c(e),i=0;i<r.length;++i){var a=r[i];if(a){for(var m=null,d=n.hasGutter&&document.createDocumentFragment(),p=0;p<a.length;++p){var v=a[p],h=v.severity;h||(h="error"),m=u(m,h),o.formatAnnotation&&(v=o.formatAnnotation(v)),n.hasGutter&&d.appendChild(f(v)),v.to&&n.marked.push(t.markText(v.from,v.to,{className:"CodeMirror-lint-mark-"+h,__annotation:v}))}n.hasGutter&&t.setGutterMarker(i,y,s(d,m,a.length>1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function v(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500))}function h(t,e){var n=e.target||e.srcElement;r(e,f(t),n)}function g(t,e){var n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var o=n.getBoundingClientRect(),r=(o.left+o.right)/2,i=(o.top+o.bottom)/2,a=t.findMarksAt(t.coordsChar({left:r,top:i},"client")),l=0;l<a.length;++l){var s=a[l].__annotation;if(s)return h(s,e)}}var y="CodeMirror-lint-markers";t.defineOption("lint",!1,function(e,n,o){if(o&&o!=t.Init&&(l(e),e.state.lint.options.lintOnChange!==!1&&e.off("change",v),t.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver),clearTimeout(e.state.lint.timeout),delete e.state.lint),n){for(var r=e.getOption("gutters"),s=!1,u=0;u<r.length;++u)r[u]==y&&(s=!0);var c=e.state.lint=new i(e,a(e,n),s);c.options.lintOnChange!==!1&&e.on("change",v),0!=c.options.tooltips&&t.on(e.getWrapperElement(),"mouseover",c.onMouseOver),d(e)}}),t.defineExtension("performLint",function(){this.state.lint&&d(this)})})},{"../../lib/codemirror":49}],47:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var o,s,l=e.getLine(r.line).slice(0,r.ch),h=0;;){t.lastIndex=h;var c=t.exec(l);if(!c)break;if(o=c,s=o.index,h=o.index+(o[0].length||1),h==l.length)break}var f=o&&o[0].length||0;f||(0==s&&0==l.length?o=void 0:s!=e.getLine(r.line).length&&f++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),o=t.exec(l),f=o&&o[0].length||0,s=o&&o.index;s+f==l.length||f||(f=1)}return o&&f?{from:i(r.line,s),to:i(r.line,s+f),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},h=t.split("\n");if(1==h.length)t.length?this.matches=function(r,o){if(r){var h=e.getLine(o.line).slice(0,o.ch),c=l(h),f=c.lastIndexOf(t);if(f>-1)return f=n(h,c,f),{from:i(o.line,f),to:i(o.line,f+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),c=l(h),f=c.indexOf(t);if(f>-1)return f=n(h,c,f)+o.ch,{from:i(o.line,f),to:i(o.line,f+s.length)}}}:this.matches=function(){};else{var c=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[r].length))!=h[h.length-1])return;for(var o=i(n.line,c[r].length),s=n.line-1,f=r-1;f>=1;--f,--s)if(h[f]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-c[0].length;if(l(u.slice(a))!=h[0])return;return{from:i(s,a),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-c[0].length;if(l(u.slice(a))==h[0]){for(var g=i(n.line,a),s=n.line+1,f=1;r>f;++f,++s)if(h[f]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,c[r].length))==h[r])return{from:g,to:i(s,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})})},{"../../lib/codemirror":49}],48:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function n(n,t,r){if(0>r&&0==t.ch)return n.clipPos(h(t.line-1));var o=n.getLine(t.line);if(r>0&&t.ch>=o.length)return n.clipPos(h(t.line+1,0));for(var i,a="start",l=t.ch,s=0>r?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(0>r?l-1:l),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==a)"o"!=u&&(a="in",i=u);else if("in"==a&&i!=u){if("w"==i&&"W"==u&&0>r&&l--,"W"==i&&"w"==u&&r>0){i="w";continue}break}}return h(t.line,l)}function t(e,t){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?n(e.doc,r.head,t):0>t?r.from():r.to()})}function r(n,t){return n.isReadOnly()?e.Pass:void n.operation(function(){for(var e=n.listSelections().length,r=[],o=-1,i=0;e>i;i++){var a=n.listSelections()[i].head;if(!(a.line<=o)){var l=h(a.line+(t?0:1),0);n.replaceRange("\n",l,null,"+insertLine"),n.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),o=a.line+1}}n.setSelections(r)})}function o(n,t){for(var r=t.ch,o=r,i=n.getLine(t.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;o<i.length&&e.isWordChar(i.charAt(o));)++o;return{from:h(t.line,r),to:h(t.line,o),word:i.slice(r,o)}}function i(e){var n=e.getCursor(),t=e.scanForBracket(n,-1);if(t)for(;;){var r=e.scanForBracket(n,1);if(!r)return;if(r.ch==g.charAt(g.indexOf(t.ch)+1))return e.setSelection(h(t.pos.line,t.pos.ch+1),r.pos,!1),!0;n=h(r.pos.line,r.pos.ch+1)}}function a(n,t){if(n.isReadOnly())return e.Pass;for(var r,o=n.listSelections(),i=[],a=0;a<o.length;a++){var l=o[a];if(!l.empty()){for(var s=l.from().line,c=l.to().line;a<o.length-1&&o[a+1].from().line==c;)c=l[++a].to().line;i.push(s,c)}}i.length?r=!0:i.push(n.firstLine(),n.lastLine()),n.operation(function(){for(var e=[],o=0;o<i.length;o+=2){var a=i[o],l=i[o+1],s=h(a,0),c=h(l),f=n.getRange(s,c,!1);t?f.sort():f.sort(function(e,n){var t=e.toUpperCase(),r=n.toUpperCase();return t!=r&&(e=t,n=r),n>e?-1:e==n?0:1}),n.replaceRange(f,s,c),r&&e.push({anchor:s,head:c})}r&&n.setSelections(e,0)})}function l(n,t){n.operation(function(){for(var r=n.listSelections(),i=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(i.push(l),a.push("")):a.push(t(n.getRange(s.from(),s.to())))}n.replaceSelections(a,"around","case");for(var c,l=i.length-1;l>=0;l--){var s=r[i[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=o(n,s.head);c=f.from,n.replaceRange(t(f.word),f.from,f.to)}}})}function s(n){var t=n.getCursor("from"),r=n.getCursor("to");if(0==e.cmpPos(t,r)){var i=o(n,t);if(!i.word)return;t=i.from,r=i.to}return{from:t,to:r,query:n.getRange(t,r),word:i}}function c(e,n){var t=s(e);if(t){var r=t.query,o=e.getSearchCursor(r,n?t.to:t.from);(n?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,n?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(n?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):t.word&&e.setSelection(t.from,t.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap.default==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){t(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){t(e,1)};var m=d?"Ctrl-Alt-":"Ctrl-";u[f[m+"Up"]="scrollLineUp"]=function(e){var n=e.getScrollInfo();if(!e.somethingSelected()){var t=e.lineAtHeight(n.top+n.clientHeight,"local");e.getCursor().line>=t&&e.execCommand("goLineUp")}e.scrollTo(null,n.top-e.defaultTextHeight())},u[f[m+"Down"]="scrollLineDown"]=function(e){var n=e.getScrollInfo();if(!e.somethingSelected()){var t=e.lineAtHeight(n.top,"local")+1;e.getCursor().line<=t&&e.execCommand("goLineDown")}e.scrollTo(null,n.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var n=e.listSelections(),t=[],r=0;r<n.length;r++)for(var o=n[r].from(),i=n[r].to(),a=o.line;a<=i.line;++a)i.line>o.line&&a==i.line&&0==i.ch||t.push({anchor:a==o.line?o:h(a,0),head:a==i.line?i:h(a)});e.setSelections(t,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var n=e.listSelections()[0];e.setSelection(n.anchor,n.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var n=e.listSelections(),t=[],r=0;r<n.length;r++){var o=n[r];t.push({anchor:h(o.from().line,0),head:h(o.to().line+1,0)})}e.setSelections(t)},f["Shift-"+p+"K"]="deleteLine",u[f[p+"Enter"]="insertLineAfter"]=function(e){return r(e,!1)},u[f["Shift-"+p+"Enter"]="insertLineBefore"]=function(e){return r(e,!0)},u[f[p+"D"]="selectNextOccurrence"]=function(n){var t=n.getCursor("from"),r=n.getCursor("to"),i=n.state.sublimeFindFullWord==n.doc.sel;if(0==e.cmpPos(t,r)){var a=o(n,t);if(!a.word)return;n.setSelection(a.from,a.to),i=!0}else{var l=n.getRange(t,r),s=i?new RegExp("\\b"+l+"\\b"):l,c=n.getSearchCursor(s,r);c.findNext()?n.addSelection(c.from(),c.to()):(c=n.getSearchCursor(s,h(n.firstLine(),0)),c.findNext()&&n.addSelection(c.from(),c.to()))}i&&(n.state.sublimeFindFullWord=n.doc.sel)};var g="(){}[]";u[f["Shift-"+p+"Space"]="selectScope"]=function(e){i(e)||e.execCommand("selectAll")},u[f["Shift-"+p+"M"]="selectBetweenBrackets"]=function(n){return i(n)?void 0:e.Pass},u[f[p+"M"]="goToBracket"]=function(n){n.extendSelectionsBy(function(t){var r=n.scanForBracket(t.head,1);if(r&&0!=e.cmpPos(r.pos,t.head))return r.pos;var o=n.scanForBracket(t.head,-1);return o&&h(o.pos.line,o.pos.ch+1)||t.head})};var v=d?"Cmd-Ctrl-":"Shift-Ctrl-";u[f[v+"Up"]="swapLineUp"]=function(n){if(n.isReadOnly())return e.Pass;for(var t=n.listSelections(),r=[],o=n.firstLine()-1,i=[],a=0;a<t.length;a++){var l=t[a],s=l.from().line-1,c=l.to().line;i.push({anchor:h(l.anchor.line-1,l.anchor.ch),head:h(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--c,s>o?r.push(s,c):r.length&&(r[r.length-1]=c),o=c}n.operation(function(){for(var e=0;e<r.length;e+=2){var t=r[e],o=r[e+1],a=n.getLine(t);n.replaceRange("",h(t,0),h(t+1,0),"+swapLine"),o>n.lastLine()?n.replaceRange("\n"+a,h(n.lastLine()),null,"+swapLine"):n.replaceRange(a+"\n",h(o,0),null,"+swapLine")}n.setSelections(i),n.scrollIntoView()})},u[f[v+"Down"]="swapLineDown"]=function(n){if(n.isReadOnly())return e.Pass;for(var t=n.listSelections(),r=[],o=n.lastLine()+1,i=t.length-1;i>=0;i--){var a=t[i],l=a.to().line+1,s=a.from().line;0!=a.to().ch||a.empty()||l--,o>l?r.push(l,s):r.length&&(r[r.length-1]=s),o=s}n.operation(function(){for(var e=r.length-2;e>=0;e-=2){var t=r[e],o=r[e+1],i=n.getLine(t);t==n.lastLine()?n.replaceRange("",h(t-1),h(t),"+swapLine"):n.replaceRange("",h(t,0),h(t+1,0),"+swapLine"),n.replaceRange(i+"\n",h(o,0),null,"+swapLine")}n.scrollIntoView()})},u[f[p+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},u[f[p+"J"]="joinLines"]=function(e){for(var n=e.listSelections(),t=[],r=0;r<n.length;r++){for(var o=n[r],i=o.from(),a=i.line,l=o.to().line;r<n.length-1&&n[r+1].from().line==l;)l=n[++r].to().line;t.push({start:a,end:l,anchor:!o.empty()&&i})}e.operation(function(){for(var n=0,r=[],o=0;o<t.length;o++){for(var i,a=t[o],l=a.anchor&&h(a.anchor.line-n,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-n;s==a.end&&(i=h(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",h(c),h(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++n)}r.push({anchor:l||i,head:i})}e.setSelections(r,0)})},u[f["Shift-"+p+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var n=e.listSelections().length,t=0;n>t;t++){var r=e.listSelections()[t];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",h(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){a(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},u[f.F2="nextBookmark"]=function(e){var n=e.state.sublimeBookmarks;if(n)for(;n.length;){var t=n.shift(),r=t.find();if(r)return n.push(t),e.setSelection(r.from,r.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var n=e.state.sublimeBookmarks;if(n)for(;n.length;){n.unshift(n.pop());var t=n[n.length-1].find();if(t)return e.setSelection(t.from,t.to);n.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var n=e.listSelections(),t=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<n.length;r++){for(var o=n[r].from(),i=n[r].to(),a=e.findMarks(o,i),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<t.length;s++)t[s]==a[l]&&t.splice(s--,1);break}l==a.length&&t.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},u[f["Shift-"+p+"F2"]="clearBookmarks"]=function(e){var n=e.state.sublimeBookmarks;if(n)for(var t=0;t<n.length;t++)n[t].clear();n.length=0},u[f["Alt-F2"]="selectBookmarks"]=function(e){var n=e.state.sublimeBookmarks,t=[];if(n)for(var r=0;r<n.length;r++){var o=n[r].find();o?t.push({anchor:o.from,head:o.to}):n.splice(r--,0)}t.length&&e.setSelections(t,0)},f["Alt-Q"]="wrapLines";var S=p+"K ";f[S+p+"Backspace"]="delLineLeft",u[f.Backspace="smartBackspace"]=function(n){if(n.somethingSelected())return e.Pass;var t=n.getCursor(),r=n.getRange({line:t.line,ch:0},t),o=e.countColumn(r,null,n.getOption("tabSize")),i=n.getOption("indentUnit");if(r&&!/\S/.test(r)&&o%i==0){var a=new h(t.line,e.findColumn(r,o-i,i));return a.ch==t.ch?e.Pass:n.replaceRange("",a,t,"+delete")}return e.Pass},u[f[S+p+"K"]="delLineRight"]=function(e){e.operation(function(){for(var n=e.listSelections(),t=n.length-1;t>=0;t--)e.replaceRange("",n[t].anchor,h(n[t].to().line),"+delete");e.scrollIntoView()})},u[f[S+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[S+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[S+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[S+p+"A"]="selectToSublimeMark"]=function(e){var n=e.state.sublimeMark&&e.state.sublimeMark.find();n&&e.setSelection(e.getCursor(),n)},u[f[S+p+"W"]="deleteToSublimeMark"]=function(n){var t=n.state.sublimeMark&&n.state.sublimeMark.find();if(t){var r=n.getCursor(),o=t;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}n.state.sublimeKilled=n.getRange(r,o),n.replaceRange("",r,o)}},u[f[S+p+"X"]="swapWithSublimeMark"]=function(e){var n=e.state.sublimeMark&&e.state.sublimeMark.find();n&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(n))},u[f[S+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[S+p+"G"]="clearBookmarks",u[f[S+p+"C"]="showInCenter"]=function(e){var n=e.cursorCoords(null,"local");e.scrollTo(null,(n.top+n.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var n=e.listSelections(),t=0;t<n.length;t++){var r=n[t];r.head.line>e.firstLine()&&e.addSelection(h(r.head.line-1,r.head.ch))}})},u[f["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var n=e.listSelections(),t=0;t<n.length;t++){var r=n[t];r.head.line<e.lastLine()&&e.addSelection(h(r.head.line+1,r.head.ch))}})},u[f[p+"F3"]="findUnder"]=function(e){c(e,!0)},u[f["Shift-"+p+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},u[f["Alt-F3"]="findAllUnder"]=function(e){var n=s(e);if(n){for(var t=e.getSearchCursor(n.query),r=[],o=-1;t.findNext();)r.push({anchor:t.from(),head:t.to()}),t.from().line<=n.from.line&&t.from().ch<=n.from.ch&&o++;e.setSelections(r,o)}},f["Shift-"+p+"["]="fold",f["Shift-"+p+"]"]="unfold",f[S+p+"0"]=f[S+p+"j"]="unfoldAll",f[p+"I"]="findIncremental",f["Shift-"+p+"I"]="findIncrementalReverse",f[p+"H"]="replace",f.F3="findNext",f["Shift-F3"]="findPrev",e.normalizeKeyMap(f)})},{"../addon/edit/matchbrackets":41,"../addon/search/searchcursor":47,"../lib/codemirror":49}],49:[function(require,module,exports){!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?zi(n):{},zi(Jo,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new Sl(i,n.mode,null,n.lineSeparator)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!Wo&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ai,keySeq:null,specialChars:null};var a=this;bo&&11>wo&&setTimeout(function(){a.display.input.reset(!0)},20),Ut(this),$i(),wt(this),this.curOp.forceUpdate=!0,qn(this,i),n.autofocus&&!Wo||a.hasFocus()?setTimeout(Fi(vr,this),20):mr(this);for(var c in el)el.hasOwnProperty(c)&&el[c](this,n[c],tl);C(this),n.finishInit&&n.finishInit(this);for(var h=0;h<ol.length;++h)ol[h](this);Ct(this),xo&&n.lineWrapping&&"optimizelegibility"==getComputedStyle(l.lineDiv).textRendering&&(l.lineDiv.style.textRendering="auto")}function t(e,t,r){var n=this;this.input=r,n.scrollbarFiller=Ui("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=Ui("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Ui("div",null,"CodeMirror-code"),n.selectionDiv=Ui("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Ui("div",null,"CodeMirror-cursors"),n.measure=Ui("div",null,"CodeMirror-measure"),n.lineMeasure=Ui("div",null,"CodeMirror-measure"),n.lineSpace=Ui("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Ui("div",[Ui("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Ui("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=Ui("div",null,null,"position: absolute; height: "+Pl+"px; width: 1px;"),n.gutters=Ui("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Ui("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Ui("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),bo&&8>wo&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),xo||vo&&Wo||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Et(e)}function i(e){e.options.lineWrapping?(Zl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ql(e.display.wrapper,"CodeMirror-wrap"),f(e)),l(e),Et(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(Cn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function l(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&ei(e,t)})}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),st(e)}function a(e){u(e),Et(e),setTimeout(function(){x(e)},20)}function u(e){var t=e.display.gutters,r=e.options.gutters;Vi(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(Ui("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function h(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=gn(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=vn(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,n=i.to.line,r+=n.text.length-i.to.ch}return r}function f(e){var t=e.display,r=e.doc;t.maxLine=Zn(r,r.first),t.maxLineLength=h(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=h(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Hi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ke(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Xe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=Ui("div",[Ui("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ui("div",[Ui("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Wl(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Wl(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>wo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&ql(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Wl(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?ir(t,e):nr(t,e)},t),t.display.scrollbars.addClass&&Zl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ve(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ri(t,n),l=ri(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=ri(t,ni(Zn(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=ri(t,ni(Zn(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&r[l].gutter&&(r[l].gutter.style.left=o);var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function C(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=S(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(Ui("div",[Ui("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",c(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function T(e,t,r){var n=e.display;this.viewport=t,this.visible=w(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ye(e),this.force=r,this.dims=H(e),this.events=[]}function k(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Xe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xe(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return zt(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Gt(e))return!1;C(e)&&(zt(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Io&&(o=wn(e.doc,o),l=xn(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Bt(e,o,l),r.viewOffset=ni(Zn(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Gt(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=ji();return a>4&&(r.lineDiv.style.display="none"),P(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&ji()!=u&&u.offsetHeight&&u.focus(),Vi(r.cursorDiv),Vi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Re(e,400)),r.updateLineNumbers=null,!0}function N(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ye(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ke(e.display)-_e(e),r.top)}),t.visible=w(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);n=!1){O(e);var i=p(e);Pe(e),A(e,i),y(e,i)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function W(e,t){var r=new T(e,t);if(M(e,r)){O(e),N(e,r);var n=p(e);Pe(e),A(e,n),y(e,n),r.finish()}}function A(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+Xe(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,o=t.view[n];if(!o.hidden){if(bo&&8>wo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=yt(t)),(a>.001||-.001>a)&&(ei(o.line,i),D(o.line),o.rest))for(var u=0;u<o.rest.length;u++)D(o.rest[u])}}}function D(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function H(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:L(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function P(e,t,r){function n(t){var r=t.nextSibling;return xo&&Ao&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var i=e.display,o=e.options.lineNumbers,l=i.lineDiv,s=l.firstChild,a=i.view,u=i.viewFrom,c=0;c<a.length;c++){var h=a[c];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=n(s);var f=o&&null!=t&&u>=t&&h.lineNumber;h.changes&&(Hi(h.changes,"gutter")>-1&&(f=!1),E(e,h,u,r)),f&&(Vi(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=h.node.nextSibling}else{var d=V(e,h,u,r);l.insertBefore(d,s)}u+=h.size}for(;s;)s=n(s)}function E(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?G(e,t,r,n):"class"==o?B(t):"widget"==o&&U(e,t,n)}t.changes=null}function I(e){return e.node==e.text&&(e.node=Ui("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),bo&&8>wo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=I(e);
e.background=r.insertBefore(Ui("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Fn(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=Ui("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),l=t.gutter=Ui("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(Ui("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var a=e.options.gutters[s],u=o.hasOwnProperty(a)&&o[a];u&&l.appendChild(Ui("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[a]+"px; width: "+n.gutterWidth[a]+"px"))}}}function U(e,t,r){t.alignable&&(t.alignable=null);for(var n,i=t.node.firstChild;i;i=n){var n=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}K(e,t,r)}function V(e,t,r,n){var i=F(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),B(t),G(e,t,r,n),K(e,t,n),t.node}function K(e,t,r){if(j(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)j(e,t.rest[n],t,r,!1)}function j(e,t,r,n,i){if(t.widgets)for(var o=I(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=Ui("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),X(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Li(a,"redraw")}}function X(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Y(e){return zo(e.line,e.ch)}function _(e,t){return Fo(e,t)<0?t:e}function $(e,t){return Fo(e,t)<0?e:t}function q(e){e.state.focused||(e.display.input.focus(),vr(e))}function Z(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=o.splitLines(t),a=null;if(l&&n.ranges.length>1)if(Ro&&Ro.join("\n")==t){if(n.ranges.length%Ro.length==0){a=[];for(var u=0;u<Ro.length;u++)a.push(o.splitLines(Ro[u]))}}else s.length==n.ranges.length&&(a=Pi(s,function(e){return[e]}));for(var u=n.ranges.length-1;u>=0;u--){var c=n.ranges[u],h=c.from(),f=c.to();c.empty()&&(r&&r>0?h=zo(h.line,h.ch-r):e.state.overwrite&&!l&&(f=zo(f.line,Math.min(Zn(o,f.line).text.length,f.ch+Di(s).length))));var d=e.curOp.updateInput,p={from:h,to:f,text:a?a[u%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Tr(e.doc,p),Li(e,"inputRead",e,p)}t&&!l&&J(e,t),zr(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Wt(t,function(){Z(t,r,0,null,"paste")}),!0):void 0}function J(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Rr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Rr(e,i.head.line,"smart"));l&&Li(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:zo(i,0),head:zo(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function re(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ai,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ne(){var e=Ui("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Ui("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return xo?e.style.width="1000px":e.setAttribute("wrap","off"),No&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ai,this.gracePeriod=!1}function oe(e,t){var r=Je(e,t.line);if(!r||r.hidden)return null;var n=Zn(e.doc,t.line),i=qe(r,n,t.line),o=ii(n),l="left";if(o){var s=uo(o,t.ch);l=s%2?"right":"left"}var a=rt(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function le(e,t){return t&&(e.bad=!0),e}function se(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return le(e.clipPos(zo(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return ae(o,t,r)}}function ae(e,t,r){function n(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=0>i?u.map:c[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var a=ti(0>i?e.line:e.rest[i]),h=o[l]+n;return(0>n||s!=t)&&(h=o[l+(n?1:0)]),zo(a,h)}}}var i=e.text.firstChild,o=!1;if(!t||!Yl(i,t))return le(zo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?Di(e.rest):e.line;return le(zo(ti(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,h=n(s,a,r);if(h)return le(h,o);for(var f=a.nextSibling,d=s?s.nodeValue.length-r:0;f;f=f.nextSibling){if(h=n(f,f.firstChild,0))return le(zo(h.line,h.ch-d),o);d+=f.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(h=n(p,p.firstChild,-1))return le(zo(h.line,h.ch+d),o);d+=f.textContent.length}}function ue(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var c,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(zo(n,0),zo(i+1,0),o(+h));return void(f.length&&(c=f[0].find())&&(s+=Qn(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(a=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;a&&(s+=u,a=!1),s+=p}}for(var s="",a=!1,u=e.doc.lineSeparator();l(t),t!=r;)t=t.nextSibling;return s}function ce(e,t){this.ranges=e,this.primIndex=t}function he(e,t){this.anchor=e,this.head=t}function fe(e,t){var r=e[t];e.sort(function(e,t){return Fo(e.from(),t.from())}),t=Hi(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(Fo(o.to(),i.from())>=0){var l=$(o.from(),i.from()),s=_(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new he(a?s:l,a?l:s))}}return new ce(e,t)}function de(e,t){return new ce([new he(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.line<e.first)return zo(e.first,0);var r=e.first+e.size-1;return t.line>r?zo(r,Zn(e,r).text.length):ve(t,Zn(e,t.line).text.length)}function ve(e,t){var r=e.ch;return null==r||r>t?zo(e.line,t):0>r?zo(e.line,0):e}function me(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ge(e,t[n]);return r}function be(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=Fo(r,i)<0;o!=Fo(n,i)<0?(i=r,r=n):o!=Fo(r,n)<0&&(r=n)}return new he(i,r)}return new he(n||r,r)}function we(e,t,r,n){ke(e,new ce([be(e,e.sel.primary(),t,r)],0),n)}function xe(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=be(e,e.sel.ranges[i],t[i],null);var o=fe(n,e.sel.primIndex);ke(e,o,r)}function Ce(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ke(e,fe(i,e.sel.primIndex),n)}function Se(e,t,r,n){ke(e,de(t,r),n)}function Le(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new he(ge(e,t[r].anchor),ge(e,t[r].head))},origin:r&&r.origin};return Dl(e,"beforeSelectionChange",e,n),e.cm&&Dl(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?fe(n.ranges,n.ranges.length-1):t}function Te(e,t,r){var n=e.history.done,i=Di(n);i&&i.ranges?(n[n.length-1]=t,Me(e,t,r)):ke(e,t,r)}function ke(e,t,r){Me(e,t,r),hi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Me(e,t,r){(Ni(e,"beforeSelectionChange")||e.cm&&Ni(e.cm,"beforeSelectionChange"))&&(t=Le(e,t,r));var n=r&&r.bias||(Fo(t.primary().head,e.sel.primary().head)<0?-1:1);Ne(e,Ae(e,t,n,!0)),r&&r.scroll===!1||!e.cm||zr(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mi(e.cm)),Li(e,"cursorActivity",e))}function We(e){Ne(e,Ae(e,e.sel,null,!1),Il)}function Ae(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=De(e,l.anchor,s&&s.anchor,r,n),u=De(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new he(a,u))}return i?fe(i,t.primIndex):t}function Oe(e,t,r,n,i){var o=Zn(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(Dl(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u,c=a.find(0>n?1:-1);if((0>n?a.inclusiveRight:a.inclusiveLeft)&&(c=He(e,c,-n,o)),c&&c.line==t.line&&(u=Fo(c,r))&&(0>n?0>u:u>0))return Oe(e,c,t,n,i)}var h=a.find(0>n?-1:1);return(0>n?a.inclusiveLeft:a.inclusiveRight)&&(h=He(e,h,n,o)),h?Oe(e,h,t,n,i):null}}return t}function De(e,t,r,n,i){var o=n||1,l=Oe(e,t,r,o,i)||!i&&Oe(e,t,r,o,!0)||Oe(e,t,r,-o,i)||!i&&Oe(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,zo(e.first,0))}function He(e,t,r,n){return 0>r&&0==t.ch?t.line>e.first?ge(e,zo(t.line-1)):null:r>0&&t.ch==(n||Zn(e,t.line)).text.length?t.line<e.first+e.size-1?zo(t.line+1,0):null:new zo(t.line,t.ch+r)}function Pe(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ee(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t!==!1||l!=r.sel.primIndex){var s=r.sel.ranges[l],a=s.empty();(a||e.options.showCursorWhenSelecting)&&Ie(e,s.head,i),a||ze(e,s,o)}return n}function Ie(e,t,r){var n=dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(Ui("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(Ui("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function ze(e,t,r){function n(e,t,r,n){0>t&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Ui("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ft(e,zo(t,r),"div",h,n)}var s,a,h=Zn(l,t),f=h.text.length;return eo(ii(h),r||0,null==i?f:i,function(e,t,l){var h,d,p,g=o(e,"left");if(e==t)h=g,d=p=g.left;else{if(h=o(t-1,"right"),"rtl"==l){var v=g;g=h,h=v}d=g.left,p=h.right}null==r&&0==e&&(d=u),h.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottom<h.top&&n(d,g.bottom,null,h.top)),null==i&&t==f&&(p=c),(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g),(!a||h.bottom>a.bottom||h.bottom==a.bottom&&h.right>a.right)&&(a=h),u+1>d&&(d=u),n(d,h.top,p-d,h.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=je(e.display),u=a.left,c=Math.max(o.sizerWidth,Ye(e)-o.sizer.offsetLeft)-a.right,h=t.from(),f=t.to();if(h.line==f.line)i(h.line,h.ch,f.ch);else{var d=Zn(l,h.line),p=Zn(l,f.line),g=yn(d)==yn(p),v=i(h.line,h.ch,g?d.text.length+1:null).end,m=i(f.line,g?0:null,f.ch).start;g&&(v.top<m.top-2?(n(v.right,v.top,null,v.bottom),n(u,m.top,m.left,m.bottom)):n(v.right,v.top,m.left-v.right,v.bottom)),v.bottom<m.top&&n(u,v.bottom,null,m.top)}r.appendChild(s)}function Fe(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Fi(Be,e))}function Be(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=sl(t.mode,Ue(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=Pn(e,o,s?sl(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(t.frontier),o.stateAfter=s?n:sl(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&In(e,o.text,n),o.stateAfter=t.frontier%5==0?sl(t.mode,n):null;return++t.frontier,+new Date>r?(Re(e,e.options.workDelay),!0):void 0}),i.length&&Wt(e,function(){for(var t=0;t<i.length;t++)It(e,i[t],"text")})}}function Ge(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=Zn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Rl(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Ue(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ge(e,t,r),l=o>n.first&&Zn(n,o-1).stateAfter;return l=l?sl(n.mode,l):al(n.mode),n.iter(o,t,function(r){In(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=s?sl(n.mode,l):null,++o}),r&&(n.frontier=o),l}function Ve(e){return e.lineSpace.offsetTop}function Ke(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function je(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ki(e.measure,Ui("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Xe(e){return Pl-e.display.nativeBarWidth}function Ye(e){return e.display.scroller.clientWidth-Xe(e)-e.display.barWidth}function _e(e){return e.display.scroller.clientHeight-Xe(e)-e.display.barHeight}function $e(e,t,r){var n=e.options.lineWrapping,i=n&&Ye(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qe(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var n=0;n<e.rest.length;n++)if(ti(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ze(e,t){t=yn(t);var r=ti(t),n=e.display.externalMeasured=new Ht(e.doc,t,r);n.lineN=r;var i=n.built=Fn(e,n);return n.text=i.pre,Ki(e.display.lineMeasure,i.pre),n}function Qe(e,t,r,n){return tt(e,et(e,t),r,n)}function Je(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ft(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function et(e,t){var r=ti(t),n=Je(e,r);n&&!n.text?n=null:n&&n.changes&&(E(e,n,r,H(e)),e.curOp.forceUpdate=!0),n||(n=Ze(e,t));var i=qe(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($e(e,t.view,t.rect),t.hasHeights=!0),o=nt(e,t,r,n),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function rt(e,t,r){for(var n,i,o,l,s=0;s<e.length;s+=3){var a=e[s],u=e[s+1];if(a>t?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)n=e[(s+=3)+2],l="right";break}}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:u}}function nt(e,t,r,n){var i,o=rt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;4>c;c++){for(;s&&Gi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&Gi(t.line.text.charAt(o.coverStart+a));)++a;if(bo&&9>wo&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var h=Vl(l,s,a).getClientRects();i=h.length?h["right"==n?h.length-1:0]:Vo}else i=Vl(l,s,a).getBoundingClientRect()||Vo;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}bo&&11>wo&&(i=it(e.display.measure,i))}else{s>0&&(u=n="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(bo&&9>wo&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+bt(e.display),top:f.top,bottom:f.bottom}:Vo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;c<v.length-1&&!(g<v[c]);c++);var m=c?v[c-1]:0,y=v[c],b={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:m,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=d,b.rbottom=p),b}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ji(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function lt(e){e.display.externalMeasure=null,Vi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function st(e){lt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function at(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ut(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ct(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Tn(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=ni(t);if("local"==n?l+=Ve(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ut());var a=s.left+("window"==n?0:at());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function ht(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=at(),i-=ut();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function ft(e,t,r,n,i){return n||(n=Zn(e.doc,t.line)),ct(e,n,Qe(e,n,t.ch,i),r)}function dt(e,t,r,n,i,o){function l(t,l){var s=tt(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,ct(e,n,s,r)}function s(e,t){var r=a[t],n=r.level%2;return e==to(r)&&t&&r.level<a[t-1].level?(r=a[--t],e=ro(r)-(r.level%2?0:1),n=!0):e==ro(r)&&t<a.length-1&&r.level<a[t+1].level&&(r=a[++t],e=to(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?l(e-1):l(e,n)}n=n||Zn(e.doc,t.line),i||(i=et(e,n));var a=ii(n),u=t.ch;if(!a)return l(u);var c=uo(a,u),h=s(u,c);return null!=os&&(h.other=s(u,os)),h}function pt(e,t){var r=0,t=ge(e.doc,t);e.options.lineWrapping||(r=bt(e.display)*t.ch);var n=Zn(e.doc,t.line),i=ni(n)+Ve(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function gt(e,t,r,n){var i=zo(e,t);return i.xRel=n,r&&(i.outside=!0),i}function vt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return gt(n.first,0,!0,-1);var i=ri(n,r),o=n.first+n.size-1;if(i>o)return gt(n.first+n.size-1,Zn(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Zn(n,i);;){var s=mt(e,l,i,t,r),a=vn(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=ti(l=u.to.line)}}function mt(e,t,r,n,i){function o(n){var i=dt(e,zo(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:l<i.top?i.left+a:(s=!1,i.left)}var l=i-ni(t),s=!1,a=2*e.display.wrapper.clientWidth,u=et(e,t),c=ii(t),h=t.text.length,f=no(t),d=io(t),p=o(f),g=s,v=o(d),m=s;if(n>v)return gt(r,d,m,1);for(;;){if(c?d==f||d==ho(t,f,1):1>=d-f){for(var y=p>n||v-n>=n-p?f:d,b=n-(y==f?p:v);Gi(t.text.charAt(y));)++y;var w=gt(r,y,y==f?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(h/2),C=f+x;if(c){C=f;for(var S=0;x>S;++S)C=ho(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),h=x):(f=C,p=L,g=s,h-=x)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Bo){Bo=Ui("pre");for(var t=0;49>t;++t)Bo.appendChild(document.createTextNode("x")),Bo.appendChild(Ui("br"));Bo.appendChild(document.createTextNode("x"))}Ki(e.measure,Bo);var r=Bo.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Vi(e.measure),r||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ui("span","xxxxxxxxxx"),r=Ui("pre",[t]);Ki(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++jo},Ko?Ko.ops.push(e.curOp):e.curOp.ownsGroup=Ko={ops:[e.curOp],delayedCallbacks:[]}}function xt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Ct(e){var t=e.curOp,r=t.ownsGroup;if(r)try{xt(r)}finally{Ko=null;for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;St(r)}}function St(e){for(var t=e.ops,r=0;r<t.length;r++)Lt(t[r]);for(var r=0;r<t.length;r++)Tt(t[r]);for(var r=0;r<t.length;r++)kt(t[r]);for(var r=0;r<t.length;r++)Mt(t[r]);for(var r=0;r<t.length;r++)Nt(t[r])}function Lt(e){var t=e.cm,r=t.display;k(t),e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function kt(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Xe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ye(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&A(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Fe(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),!e.focus||e.focus!=ji()||document.hasFocus&&!document.hasFocus()||q(e.cm)}function Nt(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&N(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-Ye(t),e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,x(t)),e.scrollToPos){var i=Hr(t,ge(n,e.scrollToPos.from),ge(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Dr(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Dl(o[s],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Dl(l[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Dl(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wt(e,t){if(e.curOp)return t();wt(e);try{return t()}finally{Ct(e)}}function At(e,t){return function(){if(e.curOp)return t.apply(e,arguments);wt(e);try{return t.apply(e,arguments)}finally{Ct(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);wt(this);try{return e.apply(this,arguments)}finally{Ct(this)}}}function Dt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);wt(t);try{return e.apply(this,arguments)}finally{Ct(t)}}}function Ht(e,t,r){this.line=t,this.rest=bn(t),this.size=this.rest?ti(Di(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Cn(e,t)}function Pt(e,t,r){for(var n,i=[],o=t;r>o;o=n){var l=new Ht(e.doc,Zn(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Et(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Io&&wn(e.doc,t)<i.viewTo&&zt(e);else if(r<=i.viewFrom)Io&&xn(e.doc,r+n)>i.viewFrom?zt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zt(e);else if(t<=i.viewFrom){var o=Rt(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):zt(e)}else if(r>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):zt(e)}else{var l=Rt(e,t,t,-1),s=Rt(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Pt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):zt(e)}var a=i.externalMeasured;a&&(r<a.lineN?a.lineN+=n:t<a.lineN+a.size&&(i.externalMeasured=null))}function It(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Ft(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Hi(l,r)&&l.push(r)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ft(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,0>t)return n}function Rt(e,t,r,n){var i,o=Ft(e,t),l=e.display.view;if(!Io||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;wn(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Bt(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Pt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ft(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Pt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Ft(e,r)))),n.viewTo=r}function Gt(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Ut(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Wl(i.scroller,"mousedown",At(e,Yt)),bo&&11>wo?Wl(i.scroller,"dblclick",At(e,function(t){if(!ki(e,t)){var r=Xt(e,t);if(r&&!Qt(e,t)&&!jt(e.display,t)){kl(t);var n=e.findWordAt(r);we(e.doc,n.anchor,n.head)}}})):Wl(i.scroller,"dblclick",function(t){ki(e,t)||kl(t)}),Po||Wl(i.scroller,"contextmenu",function(t){yr(e,t)});var o,l={end:0};Wl(i.scroller,"touchstart",function(t){if(!ki(e,t)&&!r(t)){clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Wl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!jt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new he(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new he(zo(s.line,0),ge(e.doc,zo(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),kl(r)}t()}),Wl(i.scroller,"touchcancel",t),Wl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),Dl(e,"scroll",e))}),Wl(i.scroller,"mousewheel",function(t){or(e,t)}),Wl(i.scroller,"DOMMouseScroll",function(t){or(e,t)}),Wl(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){ki(e,t)||Nl(t)},over:function(t){ki(e,t)||(tr(e,t),Nl(t))},start:function(t){er(e,t)},drop:At(e,Jt),leave:function(){rr(e)}};var s=i.input.getField();Wl(s,"keyup",function(t){dr.call(e,t)}),Wl(s,"keydown",At(e,hr)),Wl(s,"keypress",At(e,pr)),Wl(s,"focus",Fi(vr,e)),Wl(s,"blur",Fi(mr,e))}function Vt(t,r,n){var i=n&&n!=e.Init;if(!r!=!i){
var o=t.display.dragFunctions,l=r?Wl:Ol;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function jt(e,t){for(var r=xi(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Xt(e,t,r,n){var i=e.display;if(!r&&"true"==xi(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=vt(e,o,l);if(n&&1==u.xRel&&(a=Zn(e.doc,u.line).text).length==u.ch){var c=Rl(a,a.length,e.options.tabSize)-a.length;u=zo(u.line,Math.max(0,Math.round((o-je(e.display).left)/bt(e.display))-c))}return u}function Yt(e){var t=this,r=t.display;if(!(ki(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,jt(r,e))return void(xo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Qt(t,e)){var n=Xt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?_t(t,e,n):xi(e)==r.scroller&&kl(e);break;case 2:xo&&(t.state.lastMiddleDown=+new Date),n&&we(t.doc,n),setTimeout(function(){r.input.focus()},20),kl(e);break;case 3:Po?yr(t,e):gr(t)}}}}function _t(e,t,r){bo?setTimeout(Fi(q,e),0):e.curOp.focus=ji();var n,i=+new Date;Uo&&Uo.time>i-400&&0==Fo(Uo.pos,r)?n="triple":Go&&Go.time>i-400&&0==Fo(Go.pos,r)?(n="double",Uo={time:i,pos:r}):(n="single",Go={time:i,pos:r});var o,l=e.doc.sel,s=Ao?t.metaKey:t.ctrlKey;e.options.dragDrop&&Jl&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(Fo((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(Fo(o.to(),r)>0||r.xRel<0)?$t(e,t,r,s):qt(e,t,r,n,s)}function $t(e,t,r,n){var i=e.display,o=+new Date,l=At(e,function(s){xo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ol(document,"mouseup",l),Ol(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(kl(s),!n&&+new Date-200<o&&we(e.doc,r),xo||bo&&9==wo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});xo&&(i.scroller.draggable=!0),e.state.draggingText=l,i.scroller.dragDrop&&i.scroller.dragDrop(),Wl(document,"mouseup",l),Wl(i.scroller,"drop",l)}function qt(e,t,r,n,i){function o(t){if(0!=Fo(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Rl(Zn(u,r.line).text,r.ch,o),s=Rl(Zn(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=Zn(u,p).text,y=Bl(m,a,o);a==d?i.push(new he(zo(p,y),zo(p,y))):m.length>y&&i.push(new he(zo(p,y),zo(p,Bl(m,d,o))))}i.length||i.push(new he(r,r)),ke(u,fe(f.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new he(zo(t.line,0),ge(u,zo(t.line+1,0)));Fo(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=_(b.to(),C.head))}var i=f.ranges.slice(0);i[h]=new he(ge(u,w),x),ke(u,fe(i,h),zl)}}function l(t){var r=++y,i=Xt(e,t,!0,"rect"==n);if(i)if(0!=Fo(i,v)){e.curOp.focus=ji(),o(i);var s=w(a,u);(i.line>=s.to||i.line<s.from)&&setTimeout(At(e,function(){y==r&&l(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(At(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,kl(t),a.input.focus(),Ol(document,"mousemove",b),Ol(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;kl(t);var c,h,f=u.sel,d=f.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),c=h>-1?d[h]:new he(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),t.altKey)n="rect",i||(c=new he(r,r)),r=Xt(e,t,!0,!0),h=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?be(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new he(zo(r.line,0),ge(u,zo(r.line+1,0)));c=e.display.shift||u.extend?be(u,c,g.anchor,g.head):g}else c=be(u,c,r);i?-1==h?(h=d.length,ke(u,fe(d.concat([c]),h),{scroll:!1,origin:"*mouse"})):d.length>1&&d[h].empty()&&"single"==n&&!t.shiftKey?(ke(u,fe(d.slice(0,h).concat(d.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=u.sel):Ce(u,h,c,zl):(h=0,ke(u,new ce([c],0),zl),f=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=At(e,function(e){Ci(e)?l(e):s(e)}),x=At(e,s);e.state.selectingText=x,Wl(document,"mousemove",b),Wl(document,"mouseup",x)}function Zt(e,t,r,n){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&kl(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ni(e,r))return wi(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){var c=ri(e.doc,o),h=e.options.gutters[a];return Dl(e,r,e,c,h,t),wi(t)}}}function Qt(e,t){return Zt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(rr(t),!ki(t,e)&&!jt(t.display,e)){kl(e),bo&&(Xo=+new Date);var r=Xt(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=Hi(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=At(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=ge(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tr(t.doc,a),Te(t.doc,de(r,Qo(a)))}}),s.readAsText(e)}},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Ao?e.altKey:e.ctrlKey))var u=t.listSelections();if(Me(t.doc,de(r,r)),u)for(var a=0;a<u.length;++a)Or(t.doc,"",u[a].anchor,u[a].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function er(e,t){if(bo&&(!e.state.draggingText||+new Date-Xo<100))return void Nl(t);if(!ki(e,t)&&!jt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!To)){var r=Ui("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Lo&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Lo&&r.parentNode.removeChild(r)}}function tr(e,t){var r=Xt(e,t);if(r){var n=document.createDocumentFragment();Ie(e,r,n),e.display.dragCursor||(e.display.dragCursor=Ui("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ki(e.display.dragCursor,n)}}function rr(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,vo||W(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),vo&&W(e),Re(e,100))}function ir(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function or(e,t){var r=$o(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&Ao&&xo)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==u){e.display.currentWheelTarget=u;break e}if(n&&!vo&&!Lo&&null!=_o)return i&&a&&nr(e,Math.max(0,Math.min(l.scrollTop+i*_o,l.scrollHeight-l.clientHeight))),ir(e,Math.max(0,Math.min(l.scrollLeft+n*_o,l.scrollWidth-l.clientWidth))),(!i||i&&a)&&kl(t),void(o.wheelStartX=null);if(i&&null!=_o){var f=i*_o,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;0>f?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),W(e,{top:d,bottom:p})}20>Yo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(_o=(_o*Yo+r)/(Yo+1),++Yo)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function lr(e,t,r){if("string"==typeof t&&(t=ul[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=El}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function sr(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=hl(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&hl(t,e.options.extraKeys,r,e)||hl(t,e.options.keyMap,r,e)}function ar(e,t,r,n){var i=e.state.keySeq;if(i){if(fl(t))return"handled";qo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=sr(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Li(e,"keyHandled",e,t,r),("handled"==o||"multi"==o)&&(kl(r),Fe(e)),i&&!o&&/\'$/.test(t)?(kl(r),!0):!!o}function ur(e,t){var r=dl(t,!0);return r?t.shiftKey&&!e.state.keySeq?ar(e,"Shift-"+r,t,function(t){return lr(e,t,!0)})||ar(e,r,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?lr(e,t):void 0}):ar(e,r,t,function(t){return lr(e,t)}):!1}function cr(e,t,r){return ar(e,"'"+r+"'",t,function(t){return lr(e,t,!0)})}function hr(e){var t=this;if(t.curOp.focus=ji(),!ki(t,e)){bo&&11>wo&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ur(t,e);Lo&&(Zo=n?r:null,!n&&88==r&&!rs&&(Ao?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fr(t)}}function fr(e){function t(e){18!=e.keyCode&&e.altKey||(ql(r,"CodeMirror-crosshair"),Ol(document,"keyup",t),Ol(document,"mouseover",t))}var r=e.display.lineDiv;Zl(r,"CodeMirror-crosshair"),Wl(document,"keyup",t),Wl(document,"mouseover",t)}function dr(e){16==e.keyCode&&(this.doc.sel.shift=!1),ki(this,e)}function pr(e){var t=this;if(!(jt(t.display,e)||ki(t,e)||e.ctrlKey&&!e.altKey||Ao&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Lo&&r==Zo)return Zo=null,void kl(e);if(!Lo||e.which&&!(e.which<10)||!ur(t,e)){var i=String.fromCharCode(null==n?r:n);cr(t,e,i)||t.display.input.onKeyPress(e)}}}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,mr(e))},100)}function vr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Dl(e,"focus",e),e.state.focused=!0,Zl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),xo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fe(e))}function mr(e){e.state.delayingBlurEvent||(e.state.focused&&(Dl(e,"blur",e),e.state.focused=!1,ql(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e,t){jt(e.display,t)||br(e,t)||ki(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function br(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wr(e,t){if(Fo(e,t.from)<0)return e;if(Fo(e,t.to)<=0)return Qo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Qo(t).ch-t.to.ch),zo(r,n)}function xr(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new he(wr(i.anchor,t),wr(i.head,t)))}return fe(r,e.sel.primIndex)}function Cr(e,t,r){return e.line==t.line?zo(r.line,e.ch-t.ch+r.ch):zo(r.line+(e.line-t.line),e.ch)}function Sr(e,t,r){for(var n=[],i=zo(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Cr(s.from,i,o),u=Cr(Qo(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=Fo(c.head,c.anchor)<0;n[l]=new he(h?u:a,h?a:u)}else n[l]=new he(a,a)}return new ce(n,e.sel.primIndex)}function Lr(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=ge(e,t)),r&&(this.to=ge(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),Dl(e,"beforeChange",e,n),e.cm&&Dl(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Tr(e,t,r){if(e.cm){if(!e.cm.curOp)return At(e.cm,Tr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"))||(t=Lr(e,t,!0))){var n=Eo&&!r&&an(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)kr(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else kr(e,t)}}function kr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Fo(t.from,t.to)){var r=xr(e,t);ui(e,t,r,e.cm?e.cm.curOp.id:NaN),Wr(e,t,r,on(e,t));var n=[];$n(e,function(e,r){r||-1!=Hi(n,e.history)||(bi(e.history,t),n.push(e.history)),Wr(e,t,null,on(e,t))})}}function Mr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;n=l.pop(),n.ranges;){if(fi(n,s),r&&!n.equals(e.sel))return void ke(e,n,{clearRedo:!1});o=n}var u=[];fi(o,s),s.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"),a=n.changes.length-1;a>=0;--a){var h=n.changes[a];if(h.origin=t,c&&!Lr(e,h,!1))return void(l.length=0);u.push(li(e,h));var f=a?xr(e,h):Di(l);Wr(e,h,f,sn(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Qo(h)});var d=[];$n(e,function(e,t){t||-1!=Hi(d,e.history)||(bi(e.history,h),d.push(e.history)),Wr(e,h,null,sn(e,h))})}}}}function Nr(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Pi(e.sel.ranges,function(e){return new he(zo(e.anchor.line+t,e.anchor.ch),zo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Et(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)It(e.cm,n,"gutter")}}function Wr(e,t,r,n){if(e.cm&&!e.cm.curOp)return At(e.cm,Wr)(e,t,r,n);if(t.to.line<e.first)return void Nr(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Nr(e,i),t={from:zo(e.first,0),to:zo(t.to.line+i,t.to.ch),text:[Di(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:zo(o,Zn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qn(e,t.from,t.to),r||(r=xr(e,t)),e.cm?Ar(e.cm,t,n):Xn(e,t,n),Me(e,r,Il)}}function Ar(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=ti(yn(Zn(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&Mi(e),Xn(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=h(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),Re(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Et(e):l.line!=s.line||1!=t.text.length||jn(e.doc,t)?Et(e,l.line,s.line+1,c):It(e,l.line,"text");var f=Ni(e,"changes"),d=Ni(e,"change");if(d||f){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&Li(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Or(e,t,r,n,i){if(n||(n=r),Fo(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Tr(e,{from:r,to:n,text:t,origin:i})}function Dr(e,t){if(!ki(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=Ui("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Ve(e.display))+"px; height: "+(t.bottom-t.top+Xe(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Hr(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=dt(e,t),s=r&&r!=t?dt(e,r):l,a=Er(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(nr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(ir(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function Pr(e,t,r,n,i){var o=Er(e,t,r,n,i);null!=o.scrollTop&&nr(e,o.scrollTop),null!=o.scrollLeft&&ir(e,o.scrollLeft)}function Er(e,t,r,n,i){var o=e.display,l=yt(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=_e(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Ke(o),h=l>r,f=i>c-l;if(s>r)u.scrollTop=h?0:r;else if(i>s+a){var d=Math.min(r,(f?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ye(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Ir(e,t,r){(null!=t||null!=r)&&Fr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function zr(e){Fr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?zo(t.line,t.ch-1):t,n=zo(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Fr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=pt(e,t.from),n=pt(e,t.to),i=Er(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Rr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ue(e,t):r="prev");var l=e.options.tabSize,s=Zn(o,t),a=Rl(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==El||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Rl(Zn(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="	";if(u>f&&(h+=Oi(u-f)),h!=c)return Or(o,h,zo(t,0),zo(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<c.length){var f=zo(t,c.length);Ce(o,d,new he(f,f));break}}}function Br(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Zn(e,pe(e,t)):i=ti(t),null==i?null:(n(o,i)&&e.cm&&It(e.cm,i,r),o)}function Gr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&Fo(o.from,Di(n).to)<=0;){var l=n.pop();if(Fo(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Wt(e,function(){for(var t=n.length-1;t>=0;t--)Or(e.doc,"",n[t].from,n[t].to,"+delete");zr(e)})}function Ur(e,t,r,n,i){function o(){var t=s+r;return t<e.first||t>=e.first+e.size?!1:(s=t,c=Zn(e,t))}function l(e){var t=(i?ho:fo)(c,a,r,!0);if(null==t){if(e||!o())return!1;a=i?(0>r?io:no)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Zn(e,s);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,f="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>r)||l(!p);p=!1){var g=c.text.charAt(a)||"\n",v=Ri(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||v||(v="s"),h&&h!=v){0>r&&(r=1,l());break}if(v&&(h=v),r>0&&!l(!p))break}var m=De(e,zo(s,a),t,u,!0);return Fo(t,m)||(m.hitSide=!0),m}function Vr(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*yt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=vt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Kr(t,r,n,i){e.defaults[t]=r,n&&(el[t]=i?function(e,t,r){r!=tl&&n(e,t,r)}:n)}function jr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Xr(e){return"string"==typeof e?cl[e]:e}function Yr(e,t,r,n,i){if(n&&n.shared)return _r(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return At(e.cm,Yr)(e,t,r,n,i);var o=new vl(e,i),l=Fo(t,r);if(n&&zi(n,o,!1),l>0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ui("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mn(e,t.line,t,r,o)||t.line!=r.line&&mn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Io=!0}o.addToHistory&&ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&yn(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ei(e,0),tn(e,new Qr(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Cn(e,t)&&ei(t,0)}),o.clearOnEnter&&Wl(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++gl,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Et(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)It(u,c,"text");o.atomic&&We(u.doc),Li(u,"markerAdded",u,o)}return o}function _r(e,t,r,n,i){n=zi(n),n.shared=!1;var o=[Yr(e,t,r,n,i)],l=o[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Yr(e,ge(e,t),ge(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=Di(o)}),new ml(o,l)}function $r(e){return e.findMarks(zo(e.first,0),e.clipPos(zo(e.lastLine())),function(e){return e.parent})}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(Fo(o,l)){var s=Yr(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Zr(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];$n(r.primary.doc,function(e){n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==Hi(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function Qr(e,t,r){this.marker=e,this.from=t,this.to=r}function Jr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function en(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function rn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Qr(l,o.from,a?null:o.to))}}return n}function nn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Qr(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}function on(e,t){if(t.full)return null;var r=me(e,t.from.line)&&Zn(e,t.from.line).markedSpans,n=me(e,t.to.line)&&Zn(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==Fo(t.from,t.to),s=rn(r,i,l),a=nn(n,o,l),u=1==t.text.length,c=Di(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Jr(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var h=0;h<a.length;++h){var f=a[h];if(null!=f.to&&(f.to+=c),null==f.from){var d=Jr(s,f.marker);d||(f.from=c,u&&(s||(s=[])).push(f))}else f.from+=c,u&&(s||(s=[])).push(f)}s&&(s=ln(s)),a&&a!=s&&(a=ln(a));var p=[s];if(!u){var g,v=t.text.length-2;if(v>0&&s)for(var h=0;h<s.length;++h)null==s[h].to&&(g||(g=[])).push(new Qr(s[h].marker,null,null));for(var h=0;v>h;++h)p.push(g);p.push(a)}return p}function ln(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function sn(e,t){var r=gi(e,t),n=on(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function an(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=Hi(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(Fo(u.to,s.from)<0||Fo(u.from,s.to)>0)){var c=[a,1],h=Fo(u.from,s.from),f=Fo(u.to,s.to);(0>h||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function un(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function cn(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function hn(e){return e.inclusiveLeft?-1:0}function fn(e){return e.inclusiveRight?1:0}function dn(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=Fo(n.from,i.from)||hn(e)-hn(t);if(o)return-o;var l=Fo(n.to,i.to)||fn(e)-fn(t);return l?l:t.id-e.id}function pn(e,t){var r,n=Io&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||dn(r,i.marker)<0)&&(r=i.marker);return r}function gn(e){return pn(e,!0)}function vn(e){return pn(e,!1)}function mn(e,t,r,n,i){var o=Zn(e,t),l=Io&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=Fo(u.from,r)||hn(a.marker)-hn(i),h=Fo(u.to,n)||fn(a.marker)-fn(i);if(!(c>=0&&0>=h||0>=c&&h>=0)&&(0>=c&&(Fo(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Fo(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yn(e){for(var t;t=gn(e);)e=t.find(-1,!0).line;return e}function bn(e){for(var t,r;t=vn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function wn(e,t){var r=Zn(e,t),n=yn(r);return r==n?t:ti(n)}function xn(e,t){if(t>e.lastLine())return t;var r,n=Zn(e,t);if(!Cn(e,n))return t;for(;r=vn(n);)n=r.find(1,!0).line;return ti(n)+1}function Cn(e,t){var r=Io&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Sn(e,t,n))return!0}}function Sn(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Sn(e,n.line,Jr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Sn(e,t,i))return!0}function Ln(e,t,r){ni(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ir(e,null,r)}function Tn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Yl(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Ki(t.display.measure,Ui("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t,r,n){var i=new yl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Br(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Cn(e,t)){var n=ni(t)<e.scrollTop;ei(t,t.height+Tn(i)),n&&Ir(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Mn(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),un(e),cn(e,r);var i=n?n(e):1;i!=e.height&&ei(e,i)}function Nn(e){e.parent=null,un(e)}function Wn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function An(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var n=e.innerMode(t,r);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function On(t,r,n,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function Dn(e,t,r,n){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?sl(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=ge(l,t);var a,u=Zn(l,t.line),c=Ue(e,t.line,r),h=new pl(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pos<t.ch)&&!h.eol();)h.start=h.pos,o=On(s,h,c),n&&a.push(i(!0));return n?a:i()}function Hn(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new pl(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&Wn(An(r,n),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&In(e,t,n,h.pos),h.pos=t.length,a=null):a=Wn(On(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)u=Math.min(h.start,u+5e4),i(u,c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e4);i(p,c),u=p}}function Pn(e,t,r,n){var i=[e.state.modeGen],o={};Hn(e,t.text,e.doc.mode,r,function(e,t){i.push(e,t)},o,n);for(var l=0;l<e.state.overlays.length;++l){var s=e.state.overlays[l],a=1,u=0;Hn(e,t.text,s.mode,!0,function(e,t){for(var r=a;e>u;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function En(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ue(e,ti(t)),i=Pn(e,t,t.text.length>e.options.maxHighlightLength?sl(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function In(e,t,r,n){var i=e.doc.mode,o=new pl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&An(i,r);!o.eol();)On(i,o,r),o.start=o.pos}function zn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?xl:wl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Fn(e,t){var r=Ui("span",null,null,xo?"padding-right: .1px":null),n={pre:Ui("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(bo||xo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Bn,Qi(e.display.measure)&&(o=ii(l))&&(n.addToken=Un(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&ti(l);Kn(l,n,En(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Yi(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Yi(l.styleClasses.textClass,n.textClass||""))),
0==n.map.length&&n.map.push(0,0,n.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return xo&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Dl(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Yi(n.pre.className,n.textClass||"")),n}function Rn(e){var t=Ui("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,r,n,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Gn):t,a=e.cm.state.specialChars,u=!1;if(a.test(t))for(var c=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var f=a.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(s.slice(h,h+d));bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;if(h+=d+1,"	"==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g,p=c.appendChild(Ui("span",Oi(v),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text","	"),e.col+=v}else if("\r"==f[0]||"\n"==f[0]){var p=c.appendChild(Ui("span","\r"==f[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bo&&9>wo&&(u=!0),e.pos+=t.length}if(r||n||i||u||l){var m=r||"";n&&(m+=n),i&&(m+=i);var y=Ui("span",[c],m,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function Gn(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}function Un(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=0;h<t.length;h++){var f=t[h];if(f.to>u&&f.from<=u)break}if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function Vn(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Kn(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y,b=[],w=0;w<n.length;++w){var x=n[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?b.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(y||(y=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||dn(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(y)for(var w=0;w<y.length;w+=2)y[w+1]==m&&(u+=" "+y[w]);if(!f||f.from==p)for(var w=0;w<b.length;++w)Vn(t,0,b[w]);if(f&&(f.from||0)==p){if(Vn(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var S=Math.min(d,m);;){if(v){var L=p+v.length;if(!f){var T=L>S?v.slice(0,S-p):v;t.addToken(t,T,l?l+a:a,c,p+T.length==m?u:"",h,s)}if(L>=S){v=v.slice(S-p),p=S;break}p=L,c=""}v=i.slice(o,o=r[g++]),l=zn(r[g++],t.cm.options)}}else for(var g=1;g<r.length;g+=2)t.addToken(t,i.slice(o,o=r[g]),zn(r[g+1],t.cm.options))}function jn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Di(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Xn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){Mn(e,r,i,n),Li(e,"change",e,t)}function l(e,t){for(var r=e,o=[];t>r;++r)o.push(new bl(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Zn(e,s.line),h=Zn(e,a.line),f=Di(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(jn(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new bl(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Li(e,"change",e,t)}function Yn(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function _n(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}function $n(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;(!r||a)&&(t(s.doc,a),n(s.doc,e,a))}}}n(e,null,!0)}function qn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,l(e),r(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,Et(e)}function Zn(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function Qn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Jn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function ei(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function ti(e){if(null==e.parent)return null;for(var t=e.parent,r=Hi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ri(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(o>t){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;n<e.lines.length;++n){var l=e.lines[n],s=l.height;if(s>t)break;t-=s}return r+n}function ni(e){e=yn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var n=0;n<o.children.length;++n){var l=o.children[n];if(l==r)break;t+=l.height}return t}function ii(e){var t=e.order;return null==t&&(t=e.order=ls(e.text)),t}function oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function li(e,t){var r={from:Y(t.from),to:Qo(t),text:Qn(e,t.from,t.to)};return di(e,r,t.from.line,t.to.line+1),$n(e,function(e){di(e,r,t.from.line,t.to.line+1)},!0),r}function si(e){for(;e.length;){var t=Di(e);if(!t.ranges)break;e.pop()}}function ai(e,t){return t?(si(e.done),Di(e.done)):e.done.length&&!Di(e.done).ranges?Di(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Di(e.done)):void 0}function ui(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==n))){var s=Di(o.changes);0==Fo(t.from,t.to)&&0==Fo(t.from,s.to)?s.to=Qo(t):o.changes.push(li(e,t))}else{var a=Di(i.done);for(a&&a.ranges||fi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Dl(e,"historyAdded")}function ci(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function hi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ci(e,o,Di(i.done),t))?i.done[i.done.length-1]=t:fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&si(i.undone)}function fi(e,t){var r=Di(t);r&&r.ranges&&r.equals(e)||t.push(e)}function di(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function gi(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(pi(r[n]));return i}function vi(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?ce.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];i.push({changes:s});for(var a=0;a<l.length;++a){var u,c=l[a];if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&Hi(t,Number(u[1]))>-1&&(Di(s)[h]=c[h],delete c[h])}}}return i}function mi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function yi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)mi(o.ranges[s].anchor,t,r,n),mi(o.ranges[s].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var a=o.changes[s];if(r<a.from.line)a.from=zo(a.from.line+n,a.from.ch),a.to=zo(a.to.line+n,a.to.ch);else if(t<=a.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function bi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;yi(e.done,r,n,i),yi(e.undone,r,n,i)}function wi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xi(e){return e.target||e.srcElement}function Ci(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ao&&e.ctrlKey&&1==t&&(t=3),t}function Si(e,t,r){var n=e._handlers&&e._handlers[t];return r?n&&n.length>0?n.slice():Al:n||Al}function Li(e,t){function r(e){return function(){e.apply(null,o)}}var n=Si(e,t,!1);if(n.length){var i,o=Array.prototype.slice.call(arguments,2);Ko?i=Ko.delayedCallbacks:Hl?i=Hl:(i=Hl=[],setTimeout(Ti,0));for(var l=0;l<n.length;++l)i.push(r(n[l]))}}function Ti(){var e=Hl;Hl=null;for(var t=0;t<e.length;++t)e[t]()}function ki(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Dl(e,r||t.type,e,t),wi(t)||t.codemirrorIgnore}function Mi(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==Hi(r,t[n])&&r.push(t[n])}function Ni(e,t){return Si(e,t).length>0}function Wi(e){e.prototype.on=function(e,t){Wl(this,e,t)},e.prototype.off=function(e,t){Ol(this,e,t)}}function Ai(){this.id=null}function Oi(e){for(;Gl.length<=e;)Gl.push(Di(Gl)+" ");return Gl[e]}function Di(e){return e[e.length-1]}function Hi(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function Pi(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Ei(){}function Ii(e,t){var r;return Object.create?r=Object.create(e):(Ei.prototype=e,r=new Ei),t&&zi(t,r),r}function zi(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Fi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ri(e,t){return t?t.source.indexOf("\\w")>-1&&jl(e)?!0:t.test(e):jl(e)}function Bi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Gi(e){return e.charCodeAt(0)>=768&&Xl.test(e)}function Ui(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Vi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ki(e,t){return Vi(e).appendChild(t)}function ji(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Xi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Yi(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Xi(r[n]).test(t)&&(t+=" "+r[n]);return t}function _i(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function $i(){Ql||(qi(),Ql=!0)}function qi(){var e;Wl(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,_i(Kt)},100))}),Wl(window,"blur",function(){_i(mr)})}function Zi(e){if(null==_l){var t=Ui("span","​");Ki(e,Ui("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_l=t.offsetWidth<=1&&t.offsetHeight>2&&!(bo&&8>wo))}var r=_l?Ui("span","​"):Ui("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Qi(e){if(null!=$l)return $l;var t=Ki(e,document.createTextNode("AخA")),r=Vl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Vl(t,1,2).getBoundingClientRect();return $l=n.right-r.right<3}function Ji(e){if(null!=ns)return ns;var t=Ki(e,Ui("span","x")),r=t.getBoundingClientRect(),n=Vl(t,0,1).getBoundingClientRect();return ns=Math.abs(r.left-n.left)>1}function eo(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function to(e){return e.level%2?e.to:e.from}function ro(e){return e.level%2?e.from:e.to}function no(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?ro(Di(t)):e.text.length}function oo(e,t){var r=Zn(e.doc,t),n=yn(r);n!=r&&(t=ti(n));var i=ii(n),o=i?i[0].level%2?io(n):no(n):0;return zo(t,o)}function lo(e,t){for(var r,n=Zn(e.doc,t);r=vn(n);)n=r.find(1,!0).line,t=null;var i=ii(n),o=i?i[0].level%2?no(n):io(n):n.text.length;return zo(null==t?ti(n):t,o)}function so(e,t){var r=oo(e,t.line),n=Zn(e.doc,r.line),i=ii(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return zo(r.line,l?0:o)}return r}function ao(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function uo(e,t){os=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return ao(e,i.level,e[r].level)?(i.from!=i.to&&(os=r),n):(i.from!=i.to&&(os=n),r);r=n}}return r}function co(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Gi(e.text.charAt(t)));return t}function ho(e,t,r,n){var i=ii(e);if(!i)return fo(e,t,r,n);for(var o=uo(i,t),l=i[o],s=co(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s<l.to)return s;if(s==l.from||s==l.to)return uo(i,s)==o?s:(l=i[o+=r],r>0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?co(e,l.to,-1,n):co(e,l.from,1,n)}}function fo(e,t,r,n){var i=t+r;if(n)for(;i>0&&Gi(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,go=navigator.platform,vo=/gecko\/\d/i.test(po),mo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),bo=mo||yo,wo=bo&&(mo?document.documentMode||6:yo[1]),xo=/WebKit\//.test(po),Co=xo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Lo=/Opera\//.test(po),To=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Wo=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Ao=No||/Mac/.test(go),Oo=/win/i.test(go),Do=Lo&&po.match(/Version\/(\d*\.\d*)/);Do&&(Do=Number(Do[1])),Do&&Do>=15&&(Lo=!1,xo=!0);var Ho=Ao&&(Co||Lo&&(null==Do||12.11>Do)),Po=vo||bo&&wo>=9,Eo=!1,Io=!1;g.prototype=zi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Ao&&!ko?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ai,this.disableVert=new Ai},enableZeroWidthBar:function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=zi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={native:g,null:v},T.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Dl.apply(null,this.events[e])};var zo=e.Pos=function(e,t){return this instanceof zo?(this.line=e,void(this.ch=t)):new zo(e,t)},Fo=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Ro=null;re.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=Ro.join("\n"),Ul(o));else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type?n.setSelections(t.ranges,null,Il):(r.prevInput="",o.value=t.text.join("\n"),Ul(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}var r=this,n=this.cm,i=this.wrapper=ne(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),No&&(o.style.width="0px"),Wl(o,"input",function(){bo&&wo>=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Wl(o,"paste",function(e){ki(n,e)||Q(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Wl(o,"cut",t),Wl(o,"copy",t),Wl(e.scroller,"paste",function(t){jt(e,t)||ki(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Wl(e.lineSpace,"selectstart",function(t){jt(e,t)||kl(t)}),Wl(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Wl(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Ee(e);if(e.options.moveInputWithCursor){var i=dt(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Ki(r.cursorDiv,e.cursors),Ki(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rs&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Ul(this.textarea),bo&&wo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",bo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Wo||ji()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||ts(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(bo&&wo>=9&&this.hasSelection===n||Ao&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);l>o&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var s=this;return Wt(e,function(){Z(e,n.slice(o),r.length-o,null,s.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=n,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&wo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",l.style.cssText=c,bo&&9>wo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!bo||bo&&9>wo)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?At(i,ul.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Xt(i,e),a=o.scroller.scrollTop;if(s&&!Lo){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&At(i,ke)(i.doc,de(s),Il);var c=l.style.cssText;if(n.wrapper.style.position="absolute",l.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",xo)var h=window.scrollY;if(o.input.focus(),xo&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bo&&wo>=9&&t(),Po){Nl(e);var f=function(){Ol(window,"mouseup",f),setTimeout(r,20)};Wl(window,"mouseup",f)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ei,needsContentAttribute:!1},re.prototype),ie.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Il),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ro.join("\n"));else{var r=ne(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Ro.join("\n");var o=document.activeElement;Ul(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}}var r=this,n=r.cm,i=r.div=e.lineDiv;te(i),Wl(i,"paste",function(e){ki(n,e)||Q(e,n)}),Wl(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=de(zo(i.head.line,l),zo(i.head.line,l+t.length)))}}),Wl(i,"compositionupdate",function(e){r.composing.data=e.data}),Wl(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Wl(i,"touchstart",function(){r.forceCompositionEnd()}),Wl(i,"input",function(){r.composing||(n.isReadOnly()||!r.pollContent())&&Wt(r.cm,function(){Et(n)})}),Wl(i,"copy",t),Wl(i,"cut",t)},prepareSelection:function(){var e=Ee(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=se(this.cm,e.anchorNode,e.anchorOffset),n=se(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Fo($(r,n),t.from())||0!=Fo(_(r,n),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Vl(i.node,i.offset,o.offset,o.node)}catch(h){}c&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ki(this.cm.display.cursorDiv,e.cursors),Ki(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Yl(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Wt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=se(t,e.anchorNode,e.anchorOffset),n=se(t,e.focusNode,e.focusOffset);r&&n&&Wt(t,function(){ke(t.doc,de(r,n),Il),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Ft(e,n.line)))var l=ti(t.view[0].line),s=t.view[0].node;else var l=ti(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Ft(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=ti(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var h=e.doc.splitLines(ue(e,s,c,l,u)),f=Qn(e.doc,zo(l,0),zo(u,Zn(e.doc,u).text.length));h.length>1&&f.length>1;)if(Di(h)==Di(f))h.pop(),f.pop(),u--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Di(h),b=Di(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;h[h.length-1]=y.slice(0,y.length-p),h[0]=h[0].slice(d);var x=zo(l,d),C=zo(u,f.length?Di(f).length-p:0);return h.length>1||h[0]||Fo(x,C)?(Or(e.doc,h,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?At(this.cm,Et)(this.cm):e.data&&e.data!=e.startData&&At(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||At(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ei,resetPosition:Ei,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:re,contenteditable:ie},ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=Fo(r.anchor,n.anchor)||0!=Fo(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new he(Y(this.ranges[t].anchor),Y(this.ranges[t].head));return new ce(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Fo(t,n.from())>=0&&Fo(e,n.to())<=0)return r}return-1}},he.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return _(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Bo,Go,Uo,Vo={left:0,right:0,top:0,bottom:0},Ko=null,jo=0,Xo=0,Yo=0,_o=null;bo?_o=-.53:vo?_o=15:So?_o=-.7:To&&(_o=-1/3);var $o=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=$o(e);return t.x*=_o,t.y*=_o,t};var qo=new Ai,Zo=null,Qo=e.changeEnd=function(e){return e.text?zo(e.from.line+e.text.length-1,Di(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,el.hasOwnProperty(e)&&At(this,el[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Ot(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,Et(this)}),removeOverlay:Ot(function(e){
for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Et(this)}}),indentLine:Ot(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),me(this.doc,e)&&Rr(this,e,t,r)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Rr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&zr(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Rr(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&Ce(this.doc,n,new he(o,u[n].to()),Il)}}}),getTokenAt:function(e,t){return Dn(this,e,t)},getLineTokens:function(e,t){return Dn(this,zo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,r=En(this,Zn(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("cm-overlay "):-1;return 0>s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ll.hasOwnProperty(t))return r;var n=ll[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var l=n[i[t][o]];l&&r.push(l)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var o=0;o<n._global.length;o++){var s=n._global[o];s.pred(i,this)&&-1==Hi(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=pe(r,null==e?r.first+r.size-1:e),Ue(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?ge(this.doc,e):e?n.from():n.to(),dt(this,r,t||"page")},charCoords:function(e,t){return ft(this,ge(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ht(this,e,t||"page"),vt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ht(this,{top:e,left:0},t||"page").top,ri(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=Zn(this.doc,e)}else r=e;return ct(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ni(r):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,r){return Br(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Bi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,It(t,n,"gutter"),Bi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!me(this.doc,e))return null;var t=e;if(e=Zn(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=dt(this,ge(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&Pr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ot(hr),triggerOnKeyPress:Ot(pr),triggerOnKeyUp:dr,execCommand:function(e){return ul.hasOwnProperty(e)?ul[e].call(null,this):void 0},triggerElectric:Ot(function(e){J(this,e)}),findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=ge(this.doc,e);t>o&&(l=Ur(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ot(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ur(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Fl)}),deleteH:Ot(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Gr(this,function(r){var i=Ur(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=ge(this.doc,e);t>l;++l){var a=dt(this,s,"div");if(null==o?o=a.left:a.left=o,s=Vr(this,a,i,r),s.hitSide)break}return s},moveV:Ot(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=dt(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Vr(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Ir(r,null,ft(r,a,"div").top-s.top),a},Fl),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,r=Zn(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var l=r.charAt(n),s=Ri(l,o)?function(e){return Ri(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ri(e)};n>0&&s(r.charAt(n-1));)--n;for(;i<r.length&&s(r.charAt(i));)++i}return new he(zo(e.line,n),zo(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Zl(this.display.cursorDiv,"CodeMirror-overwrite"):ql(this.display.cursorDiv,"CodeMirror-overwrite"),Dl(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ji()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ot(function(e,t){(null!=e||null!=t)&&Fr(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xe(this)-this.display.barHeight,width:e.scrollWidth-Xe(this)-this.display.barWidth,clientHeight:_e(this),clientWidth:Ye(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:zo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Fr(this),this.curOp.scrollToPos=e;else{var r=Er(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:Ot(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&lt(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){It(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,Dl(n,"refresh",this)}),operation:function(e){return Wt(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;Et(this),this.curOp.forceUpdate=!0,st(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-yt(this.display))>.5)&&l(this),Dl(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,qn(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Li(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Wi(e);var Jo=e.defaults={},el=e.optionHandlers={},tl=e.Init={toString:function(){return"CodeMirror.Init"}};Kr("value","",function(e,t){e.setValue(t)},!0),Kr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Kr("indentUnit",2,r,!0),Kr("indentWithTabs",!1),Kr("smartIndent",!0),Kr("tabSize",4,function(e){n(e),st(e),Et(e)},!0),Kr("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(zo(n,o))}n++});for(var i=r.length-1;i>=0;i--)Or(e.doc,t,r[i],zo(r[i].line,r[i].ch+t.length))}}),Kr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test("	")?"":"|	"),"g"),n!=e.Init&&t.refresh()}),Kr("specialCharPlaceholder",Rn,function(e){e.refresh()},!0),Kr("electricChars",!0),Kr("inputStyle",Wo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Kr("rtlMoveVisually",!Oo),Kr("wholeLineUpdateBefore",!0),Kr("theme","default",function(e){s(e),a(e)},!0),Kr("keyMap","default",function(t,r,n){var i=Xr(r),o=n!=e.Init&&Xr(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Kr("extraKeys",null),Kr("lineWrapping",!1,i,!0),Kr("gutters",[],function(e){d(e.options),a(e)},!0),Kr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Kr("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Kr("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Kr("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Kr("firstLineNumber",1,a,!0),Kr("lineNumberFormatter",function(e){return e},a,!0),Kr("showCursorWhenSelecting",!1,Pe,!0),Kr("resetSelectionOnContextMenu",!0),Kr("lineWiseCopyCut",!0),Kr("readOnly",!1,function(e,t){"nocursor"==t?(mr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Kr("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Kr("dragDrop",!0,Vt),Kr("allowDropFileTypes",null),Kr("cursorBlinkRate",530),Kr("cursorScrollMargin",0),Kr("cursorHeight",1,Pe,!0),Kr("singleCursorHeightPerLine",!0,Pe,!0),Kr("workTime",100),Kr("workDelay",100),Kr("flattenSpans",!0,n,!0),Kr("addModeClass",!1,n,!0),Kr("pollInterval",100),Kr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Kr("historyEventDelay",1250),Kr("viewportMargin",10,function(e){e.refresh()},!0),Kr("maxHighlightLength",1e4,n,!0),Kr("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Kr("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Kr("autofocus",null);var rl=e.modes={},nl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),rl[t]=r},e.defineMIME=function(e,t){nl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&nl.hasOwnProperty(t))t=nl[t];else if(t&&"string"==typeof t.name&&nl.hasOwnProperty(t.name)){var r=nl[t.name];"string"==typeof r&&(r={name:r}),t=Ii(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=rl[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(il.hasOwnProperty(r.name)){var o=il[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var il=e.modeExtensions={};e.extendMode=function(e,t){var r=il.hasOwnProperty(e)?il[e]:il[e]={};zi(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){Sl.prototype[e]=t},e.defineOption=Kr;var ol=[];e.defineInitHook=function(e){ol.push(e)};var ll=e.helpers={};e.registerHelper=function(t,r,n){ll.hasOwnProperty(t)||(ll[t]=e[t]={_global:[]}),ll[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),ll[t]._global.push({pred:n,val:i})};var sl=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},al=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ul=e.commands={selectAll:function(e){e.setSelection(zo(e.firstLine(),0),zo(e.lastLine()),Il)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Il)},killLine:function(e){Gr(e,function(t){if(t.empty()){var r=Zn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:zo(t.head.line+1,0)}:{from:t.head,to:zo(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Gr(e,function(t){return{from:zo(t.from().line,0),to:ge(e.doc,zo(t.to().line+1,0))}})},delLineLeft:function(e){Gr(e,function(e){return{from:zo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(zo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(zo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return so(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Fl)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Fl)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?so(e,t.head):n},Fl)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=Rl(e.getLine(o.line),o.ch,n);t.push(new Array(n-l%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Wt(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n].head,o=Zn(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new zo(i.line,i.ch-1)),i.ch>0)i=new zo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),zo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Zn(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),zo(i.line-1,l.length-1),zo(i.line,1),"+transpose")}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Wt(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0)}zr(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},cl=e.keyMap={};cl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},cl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cl.default=Ao?cl.macDefault:cl.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Pi(r.split(" "),jr),o=0;o<i.length;o++){var l,s;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e};var hl=e.lookupKey=function(e,t,r,n){t=Xr(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return hl(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=hl(e,t.fallthrough[o],r,n);if(l)return l}}},fl=e.isModifierKey=function(e){var t="string"==typeof e?e:is[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},dl=e.keyName=function(e,t){if(Lo&&34==e.keyCode&&e.char)return!1;var r=is[e.keyCode],n=r;return null==n||e.altGraphKey?!1:(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(Ho?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(Ho?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};e.fromTextArea=function(t,r){function n(){t.value=u.getValue()}if(r=r?zi(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var i=ji();r.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Wl(t.form,"submit",n),!r.leaveSubmitMethodAlone)){var o=t.form,l=o.submit;try{var s=o.submit=function(){n(),o.submit=l,o.submit(),o.submit=s}}catch(a){}}r.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ol(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=l))}},t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u};var pl=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};pl.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else var r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Rl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Rl(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Rl(this.string,null,this.tabSize)-(this.lineStart?Rl(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var gl=0,vl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};Wi(vl),vl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ni(this,"clear")){var r=this.find();r&&Li(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Jr(l.markedSpans,this);e&&!this.collapsed?It(e,ti(l),"text"):e&&(null!=s.to&&(i=ti(l)),null!=s.from&&(n=ti(l))),l.markedSpans=en(l.markedSpans,s),null==s.from&&this.collapsed&&!Cn(this.doc,l)&&e&&ei(l,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var a=yn(this.lines[o]),u=h(a);u>e.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Et(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&We(e.doc)),e&&Li(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},vl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=Jr(o.markedSpans,this);if(null!=l.from&&(r=zo(t?o:ti(o),l.from),-1==e))return r;if(null!=l.to&&(n=zo(t?o:ti(o),l.to),1==e))return n}return r&&{from:r,to:n}},vl.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&Wt(r,function(){var n=e.line,i=ti(e.line),o=Je(r,i);if(o&&(ot(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Cn(t.doc,n)&&null!=t.height){var l=t.height;t.height=null;var s=Tn(t)-l;s&&ei(n,n.height+s)}})},vl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Hi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vl.prototype.detachLine=function(e){if(this.lines.splice(Hi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var gl=0,ml=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Wi(ml),ml.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Li(this,"clear")}},ml.prototype.find=function(e,t){return this.primary.find(e,t)};var yl=e.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Wi(yl),yl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=ti(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Tn(this);ei(r,Math.max(0,r.height-o)),e&&Wt(e,function(){Ln(e,r,-o),It(e,n,"widget")})}},yl.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=Tn(this)-e;n&&(ei(r,r.height+n),t&&Wt(t,function(){t.curOp.forceUpdate=!0,Ln(t,r,n)}))};var bl=e.Line=function(e,t,r){this.text=e,cn(this,t),this.height=r?r(this):1};Wi(bl),bl.prototype.lineNo=function(){return ti(this)};var wl={},xl={};Yn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;n>r;++r){var i=this.lines[r];this.height-=i.height,Nn(i),Li(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;n>e;++e)if(r(this.lines[e]))return!0}},_n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(i>e){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Yn))){var s=[];this.collapse(s),this.children=[new Yn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Yn(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new _n(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Hi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new _n(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>e){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Cl=0,Sl=e.Doc=function(e,t,r,n){if(!(this instanceof Sl))return new Sl(e,t,r,n);null==r&&(r=0),_n.call(this,[new Yn([new bl("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=zo(r,0);this.sel=de(i),this.history=new oi(null),this.id=++Cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Xn(this,{from:i,to:i,text:e}),ke(this,de(i),Il)};Sl.prototype=Ii(_n.prototype,{constructor:Sl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Jn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Dt(function(e){var t=zo(this.first,0),r=this.first+this.size-1;Tr(this,{from:t,to:zo(r,Zn(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),ke(this,de(t))}),replaceRange:function(e,t,r,n){t=ge(this,t),r=r?ge(this,r):t,Or(this,e,t,r,n)},getRange:function(e,t,r){var n=Qn(this,ge(this,e),ge(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return me(this,e)?Zn(this,e):void 0},getLineNumber:function(e){return ti(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Zn(this,e)),yn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ge(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Dt(function(e,t,r){Se(this,ge(this,"number"==typeof e?zo(e,t||0):e),null,r)}),setSelection:Dt(function(e,t,r){Se(this,ge(this,e),ge(this,t||e),r)}),extendSelection:Dt(function(e,t,r){we(this,ge(this,e),t&&ge(this,t),r)}),extendSelections:Dt(function(e,t){xe(this,ye(this,e),t)}),extendSelectionsBy:Dt(function(e,t){var r=Pi(this.sel.ranges,e);xe(this,ye(this,r),t)}),setSelections:Dt(function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new he(ge(this,e[n].anchor),ge(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ke(this,fe(i,t),r)}}),addSelection:Dt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new he(ge(this,e),ge(this,t||e))),ke(this,fe(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Qn(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Qn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Dt(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&Sr(this,n,t),o=n.length-1;o>=0;o--)Tr(this,n[o]);
s?Te(this,s):this.cm&&zr(this.cm)}),undo:Dt(function(){Mr(this,"undo")}),redo:Dt(function(){Mr(this,"redo")}),undoSelection:Dt(function(){Mr(this,"undo",!0)}),redoSelection:Dt(function(){Mr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vi(this.history.done),undone:vi(this.history.undone)}},setHistory:function(e){var t=this.history=new oi(this.history.maxGeneration);t.done=vi(e.done.slice(0),null,!0),t.undone=vi(e.undone.slice(0),null,!0)},addLineClass:Dt(function(e,t,r){return Br(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Xi(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:Dt(function(e,t,r){return Br(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(Xi(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:Dt(function(e,t,r){return kn(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Yr(this,ge(this,e),ge(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ge(this,e),Yr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ge(this,e);var t=[],r=Zn(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ge(this,e),t=ge(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];i==e.line&&e.ch>a.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(n){var i=n.text.length+1;return i>e?(t=e,!0):(e-=i,void++r)}),ge(this,zo(r,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new Sl(Jn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Sl(Jn(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],qr(n,$r(this)),n},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),Zr($r(this));break}}if(t.history==this.history){var i=[t.id];$n(t,function(e){i.push(e.id)},!0),t.history=new oi(null),t.history.done=vi(this.history.done,i),t.history.undone=vi(this.history.undone,i)}},iterLinkedDocs:function(e){$n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):es(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Sl.prototype.eachLine=Sl.prototype.iter;var Ll="iter insert remove copy getEditor constructor".split(" ");for(var Tl in Sl.prototype)Sl.prototype.hasOwnProperty(Tl)&&Hi(Ll,Tl)<0&&(e.prototype[Tl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sl.prototype[Tl]));Wi(Sl);var kl=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Ml=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Nl=e.e_stop=function(e){kl(e),Ml(e)},Wl=e.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={}),i=n[t]||(n[t]=[]);i.push(r)}},Al=[],Ol=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else for(var n=Si(e,t,!1),i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}},Dl=e.signal=function(e,t){var r=Si(e,t,!0);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},Hl=null,Pl=30,El=e.Pass={toString:function(){return"CodeMirror.Pass"}},Il={scroll:!1},zl={origin:"*mouse"},Fl={origin:"+move"};Ai.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Rl=e.countColumn=function(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,l=i||0;;){var s=e.indexOf("	",o);if(0>s||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Bl=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("	",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Gl=[""],Ul=function(e){e.select()};No?Ul=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(Ul=function(e){try{e.select()}catch(t){}});var Vl,Kl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jl=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Kl.test(e))},Xl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Vl=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Yl=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};bo&&11>wo&&(ji=function(){try{return document.activeElement}catch(e){return document.body}});var _l,$l,ql=e.rmClass=function(e,t){var r=e.className,n=Xi(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Zl=e.addClass=function(e,t){var r=e.className;Xi(t).test(r)||(e.className+=(r?" ":"")+t)},Ql=!1,Jl=function(){if(bo&&9>wo)return!1;var e=Ui("div");return"draggable"in e||"dragDrop"in e}(),es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ts=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rs=function(){var e=Ui("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ns=null,is=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var os,ls=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,h=[],f=0;c>f;++f)h.push(n=e(r.charCodeAt(f)));for(var f=0,d=u;c>f;++f){var n=h[f];"m"==n?h[f]=d:d=n}for(var f=0,p=u;c>f;++f){var n=h[f];"1"==n&&"r"==p?h[f]="n":l.test(n)&&(p=n,"r"==n&&(h[f]="R"))}for(var f=1,d=h[0];c-1>f;++f){var n=h[f];"+"==n&&"1"==d&&"1"==h[f+1]?h[f]="1":","!=n||d!=h[f+1]||"1"!=d&&"n"!=d||(h[f]=d),d=n}for(var f=0;c>f;++f){var n=h[f];if(","==n)h[f]="N";else if("%"==n){for(var g=f+1;c>g&&"%"==h[g];++g);for(var v=f&&"!"==h[f-1]||c>g&&"1"==h[g]?"1":"N",m=f;g>m;++m)h[m]=v;f=g-1}}for(var f=0,p=u;c>f;++f){var n=h[f];"L"==p&&"1"==n?h[f]="L":l.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(h[f])){for(var g=f+1;c>g&&o.test(h[g]);++g);for(var y="L"==(f?h[f-1]:u),b="L"==(c>g?h[g]:u),v=y||b?"L":"R",m=f;g>m;++m)h[m]=v;f=g-1}for(var w,x=[],f=0;c>f;)if(s.test(h[f])){var C=f;for(++f;c>f&&s.test(h[f]);++f);x.push(new t(0,C,f))}else{var S=f,L=x.length;for(++f;c>f&&"L"!=h[f];++f);for(var m=S;f>m;)if(a.test(h[m])){m>S&&x.splice(L,0,new t(1,S,m));var T=m;for(++m;f>m&&a.test(h[m]);++m);x.splice(L,0,new t(2,T,m)),S=m}else++m;f>S&&x.splice(L,0,new t(1,S,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==Di(x).level&&(w=r.match(/\s+$/))&&(Di(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),2==x[0].level&&x.unshift(new t(1,x[0].to,x[0].to)),x[0].level!=Di(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.11.0",e})},{}],50:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function a(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return he=e,ge=r,t}function o(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=c(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(r.tokenize=u,u(e,r)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,r,1)?(a(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Ae),i("operator","operator",e.current()));if("`"==n)return r.tokenize=l,l(e,r);if("#"==n)return e.skipToEnd(),i("error","error");if(Ae.test(n))return e.eatWhile(Ae),i("operator","operator",e.current());if(Ie.test(n)){e.eatWhile(Ie);var o=e.current(),s=ze.propertyIsEnumerable(o)&&ze[o];return s&&"."!=r.lastType?i(s.type,s.style,o):i("variable","variable",o)}}function c(e){return function(t,r){var n,a=!1;if(Me&&"@"==t.peek()&&t.match(Te))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function u(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=$e.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(Ie.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,a){var i=e.cc;for(Ce.state=e,Ce.stream=a,Ce.marked=null,Ce.cc=i,Ce.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():Ve?j:w;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Ce.marked?Ce.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Ce.cc.push(arguments[e])}function v(){return m.apply(null,arguments),!0}function y(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ce.state;if(Ce.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function k(){Ce.state.context={prev:Ce.state.context,vars:Ce.state.localVars},Ce.state.localVars=We}function b(){Ce.state.localVars=Ce.state.context.vars,Ce.state.context=Ce.state.context.prev}function x(e,t){var r=function(){var r=Ce.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,Ce.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function h(){var e=Ce.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function g(e){function t(r){return r==e?v():";"==e?m():v(t)}return t}function w(e,t){return"var"==e?v(x("vardef",t.length),Q,g(";"),h):"keyword a"==e?v(x("form"),j,w,h):"keyword b"==e?v(x("form"),w,h):"{"==e?v(x("}"),G,h):";"==e?v():"if"==e?("else"==Ce.state.lexical.info&&Ce.state.cc[Ce.state.cc.length-1]==h&&Ce.state.cc.pop()(),v(x("form"),j,w,h,_)):"function"==e?v(ie):"for"==e?v(x("form"),ee,w,h):"variable"==e?v(x("stat"),S):"switch"==e?v(x("form"),j,x("}","switch"),g("{"),G,h,h):"case"==e?v(j,g(":")):"default"==e?v(g(":")):"catch"==e?v(x("form"),k,g("("),oe,g(")"),w,h,b):"class"==e?v(x("form"),ce,h):"export"==e?v(x("stat"),fe,h):"import"==e?v(x("stat"),de,h):"module"==e?v(x("form"),R,x("}"),g("{"),G,h,h):m(x("stat"),j,g(";"),h)}function j(e){return V(e,!1)}function M(e){return V(e,!0)}function V(e,t){if(Ce.state.fatArrowAt==Ce.stream.start){var r=t?C:q;if("("==e)return v(k,x(")"),D(R,")"),h,g("=>"),r,b);if("variable"==e)return m(k,R,g("=>"),r,b)}var n=t?A:z;return qe.hasOwnProperty(e)?v(n):"function"==e?v(ie,n):"keyword c"==e?v(t?I:E):"("==e?v(x(")"),E,be,g(")"),h,n):"operator"==e||"spread"==e?v(t?M:j):"["==e?v(x("]"),ye,h,n):"{"==e?F(B,"}",null,n):"quasi"==e?m(T,n):"new"==e?v(W(t)):v()}function E(e){return e.match(/[;\}\)\],]/)?m():m(j)}function I(e){return e.match(/[;\}\)\],]/)?m():m(M)}function z(e,t){return","==e?v(j):A(e,t,!1)}function A(e,t,r){var n=0==r?z:A,a=0==r?j:M;return"=>"==e?v(k,r?C:q,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(j,g(":"),a):v(a):"quasi"==e?m(T,n):";"!=e?"("==e?F(M,")","call",n):"."==e?v(N,n):"["==e?v(x("]"),E,g("]"),h,n):void 0:void 0}function T(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?v(T):v(j,$)}function $(e){return"}"==e?(Ce.marked="string-2",Ce.state.tokenize=l,v(T)):void 0}function q(e){return s(Ce.stream,Ce.state),m("{"==e?w:j)}function C(e){return s(Ce.stream,Ce.state),m("{"==e?w:M)}function W(e){return function(t){return"."==t?v(e?P:O):m(e?M:j)}}function O(e,t){return"target"==t?(Ce.marked="keyword",v(z)):void 0}function P(e,t){return"target"==t?(Ce.marked="keyword",v(A)):void 0}function S(e){return":"==e?v(h,w):m(z,g(";"),h)}function N(e){return"variable"==e?(Ce.marked="property",v()):void 0}function B(e,t){return"variable"==e||"keyword"==Ce.style?(Ce.marked="property",v("get"==t||"set"==t?H:U)):"number"==e||"string"==e?(Ce.marked=Me?"property":Ce.style+" property",v(U)):"jsonld-keyword"==e?v(U):"modifier"==e?v(B):"["==e?v(j,g("]"),U):"spread"==e?v(j):void 0}function H(e){return"variable"!=e?m(U):(Ce.marked="property",v(ie))}function U(e){return":"==e?v(M):"("==e?m(ie):void 0}function D(e,t){function r(n){if(","==n){var a=Ce.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(g(t))}return function(n){return n==t?v():m(e,r)}}function F(e,t,r){for(var n=3;n<arguments.length;n++)Ce.cc.push(arguments[n]);return v(x(t,r),D(e,t),h)}function G(e){return"}"==e?v():m(w,G)}function J(e){return Ee&&":"==e?v(L):void 0}function K(e,t){return"="==t?v(M):void 0}function L(e){return"variable"==e?(Ce.marked="variable-3",v()):void 0}function Q(){return m(R,J,Y,Z)}function R(e,t){return"modifier"==e?v(R):"variable"==e?(y(t),v()):"spread"==e?v(R):"["==e?F(R,"]"):"{"==e?F(X,"}"):void 0}function X(e,t){return"variable"!=e||Ce.stream.match(/^\s*:/,!1)?("variable"==e&&(Ce.marked="property"),"spread"==e?v(R):"}"==e?m():v(g(":"),R,Y)):(y(t),v(Y))}function Y(e,t){return"="==t?v(M):void 0}function Z(e){return","==e?v(Q):void 0}function _(e,t){return"keyword b"==e&&"else"==t?v(x("form","else"),w,h):void 0}function ee(e){return"("==e?v(x(")"),te,g(")"),h):void 0}function te(e){return"var"==e?v(Q,g(";"),ne):";"==e?v(ne):"variable"==e?v(re):m(j,g(";"),ne)}function re(e,t){return"in"==t||"of"==t?(Ce.marked="keyword",v(j)):v(z,ne)}function ne(e,t){return";"==e?v(ae):"in"==t||"of"==t?(Ce.marked="keyword",v(j)):m(j,g(";"),ae)}function ae(e){")"!=e&&v(j)}function ie(e,t){return"*"==t?(Ce.marked="keyword",v(ie)):"variable"==e?(y(t),v(ie)):"("==e?v(k,x(")"),D(oe,")"),h,w,b):void 0}function oe(e){return"spread"==e?v(oe):m(R,J,K)}function ce(e,t){return"variable"==e?(y(t),v(ue)):void 0}function ue(e,t){return"extends"==t?v(j,ue):"{"==e?v(x("}"),le,h):void 0}function le(e,t){return"variable"==e||"keyword"==Ce.style?"static"==t?(Ce.marked="keyword",v(le)):(Ce.marked="property","get"==t||"set"==t?v(se,ie,le):v(ie,le)):"*"==t?(Ce.marked="keyword",v(le)):";"==e?v(le):"}"==e?v():void 0}function se(e){return"variable"!=e?m():(Ce.marked="property",v())}function fe(e,t){return"*"==t?(Ce.marked="keyword",v(ve,g(";"))):"default"==t?(Ce.marked="keyword",v(j,g(";"))):m(w)}function de(e){return"string"==e?v():m(pe,ve)}function pe(e,t){return"{"==e?F(pe,"}"):("variable"==e&&y(t),"*"==t&&(Ce.marked="keyword"),v(me))}function me(e,t){return"as"==t?(Ce.marked="keyword",v(pe)):void 0}function ve(e,t){return"from"==t?(Ce.marked="keyword",v(j)):void 0}function ye(e){return"]"==e?v():m(M,ke)}function ke(e){return"for"==e?m(be,g("]")):","==e?v(D(I,"]")):m(D(M,"]"))}function be(e){return"for"==e?v(ee,be):"if"==e?v(j,be):void 0}function xe(e,t){return"operator"==e.lastType||","==e.lastType||Ae.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var he,ge,we=r.indentUnit,je=n.statementIndent,Me=n.jsonld,Ve=n.json||Me,Ee=n.typescript,Ie=n.wordCharacters||/[\w$\xa1-\uffff]/,ze=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n};if(Ee){var c={type:"variable",style:"variable-3"},u={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:a,string:c,number:c,boolean:c,any:c};for(var l in u)o[l]=u[l]}return o}(),Ae=/[+\-*&%=<>!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$e="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ce={state:null,column:null,marked:null,cc:null},We={name:"this",next:{name:"arguments"}};return h.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new f((e||0)-we,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=u&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==he?r:(t.lastType="operator"!=he||"++"!=ge&&"--"!=ge?he:"incdec",p(t,r,he,ge,e))},indent:function(t,r){if(t.tokenize==u)return e.Pass;if(t.tokenize!=o)return 0;var a=r&&r.charAt(0),i=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==h)i=i.prev;else if(l!=_)break}"stat"==i.type&&"}"==a&&(i=i.prev),je&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s=i.type,f=a==s;return"vardef"==s?i.indented+("operator"==t.lastType||","==t.lastType?i.info+1:0):"form"==s&&"{"==a?i.indented:"form"==s?i.indented+we:"stat"==s?i.indented+(xe(t,r)?je||we:0):"switch"!=i.info||f||0==n.doubleIndentSwitch?i.align?i.column+(f?0:1):i.indented+(f?0:we):i.indented+(/^(?:case|default)\b/.test(r)?we:2*we)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ve?null:"/*",blockCommentEnd:Ve?null:"*/",lineComment:Ve?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ve?"json":"javascript",jsonldMode:Me,jsonMode:Ve,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==j||t==M)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":49}],51:[function(require,module,exports){require("../../modules/es6.string.iterator"),require("../../modules/es6.array.from"),module.exports=require("../../modules/$.core").Array.from},{"../../modules/$.core":71,"../../modules/es6.array.from":119,"../../modules/es6.string.iterator":129}],52:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.get-iterator")},{"../modules/core.get-iterator":117,"../modules/es6.string.iterator":129,"../modules/web.dom.iterable":132}],53:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.is-iterable")},{"../modules/core.is-iterable":118,"../modules/es6.string.iterator":129,"../modules/web.dom.iterable":132}],54:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.map"),require("../modules/es7.map.to-json"),module.exports=require("../modules/$.core").Map},{"../modules/$.core":71,"../modules/es6.map":121,"../modules/es6.object.to-string":126,"../modules/es6.string.iterator":129,"../modules/es7.map.to-json":130,"../modules/web.dom.iterable":132}],55:[function(require,module,exports){require("../../modules/es6.object.assign"),module.exports=require("../../modules/$.core").Object.assign},{"../../modules/$.core":71,"../../modules/es6.object.assign":122}],56:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r){return $.create(e,r)}},{"../../modules/$":93}],57:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r,u){return $.setDesc(e,r,u)}},{"../../modules/$":93}],58:[function(require,module,exports){var $=require("../../modules/$");require("../../modules/es6.object.get-own-property-descriptor"),module.exports=function(e,r){return $.getDesc(e,r)}},{"../../modules/$":93,"../../modules/es6.object.get-own-property-descriptor":123}],59:[function(require,module,exports){require("../../modules/es6.object.keys"),module.exports=require("../../modules/$.core").Object.keys},{"../../modules/$.core":71,"../../modules/es6.object.keys":124}],60:[function(require,module,exports){require("../../modules/es6.object.set-prototype-of"),module.exports=require("../../modules/$.core").Object.setPrototypeOf},{"../../modules/$.core":71,"../../modules/es6.object.set-prototype-of":125}],61:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.promise"),module.exports=require("../modules/$.core").Promise},{"../modules/$.core":71,"../modules/es6.object.to-string":126,"../modules/es6.promise":127,"../modules/es6.string.iterator":129,"../modules/web.dom.iterable":132}],62:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.set"),require("../modules/es7.set.to-json"),module.exports=require("../modules/$.core").Set},{"../modules/$.core":71,"../modules/es6.object.to-string":126,"../modules/es6.set":128,"../modules/es6.string.iterator":129,"../modules/es7.set.to-json":131,"../modules/web.dom.iterable":132}],63:[function(require,module,exports){module.exports=function(o){if("function"!=typeof o)throw TypeError(o+" is not a function!");return o}},{}],64:[function(require,module,exports){module.exports=function(){}},{}],65:[function(require,module,exports){var isObject=require("./$.is-object");module.exports=function(e){if(!isObject(e))throw TypeError(e+" is not an object!");return e}},{"./$.is-object":86}],66:[function(require,module,exports){var cof=require("./$.cof"),TAG=require("./$.wks")("toStringTag"),ARG="Arguments"==cof(function(){return arguments}());module.exports=function(e){var n,r,t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=(n=Object(e))[TAG])?r:ARG?cof(n):"Object"==(t=cof(n))&&"function"==typeof n.callee?"Arguments":t}},{"./$.cof":67,"./$.wks":115}],67:[function(require,module,exports){var toString={}.toString;module.exports=function(t){return toString.call(t).slice(8,-1)}},{}],68:[function(require,module,exports){"use strict";var $=require("./$"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),ctx=require("./$.ctx"),strictNew=require("./$.strict-new"),defined=require("./$.defined"),forOf=require("./$.for-of"),$iterDefine=require("./$.iter-define"),step=require("./$.iter-step"),ID=require("./$.uid")("id"),$has=require("./$.has"),isObject=require("./$.is-object"),setSpecies=require("./$.set-species"),DESCRIPTORS=require("./$.descriptors"),isExtensible=Object.isExtensible||isObject,SIZE=DESCRIPTORS?"_s":"size",id=0,fastKey=function(e,t){if(!isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!$has(e,ID)){if(!isExtensible(e))return"F";if(!t)return"E";hide(e,ID,++id)}return"O"+e[ID]},getEntry=function(e,t){var r,i=fastKey(t);if("F"!==i)return e._i[i];for(r=e._f;r;r=r.n)if(r.k==t)return r};module.exports={getConstructor:function(e,t,r,i){var n=e(function(e,s){strictNew(e,n,t),e._i=$.create(null),e._f=void 0,e._l=void 0,e[SIZE]=0,void 0!=s&&forOf(s,r,e[i],e)});return redefineAll(n.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var t=this,r=getEntry(t,e);if(r){var i=r.n,n=r.p;delete t._i[r.i],r.r=!0,n&&(n.n=i),i&&(i.p=n),t._f==r&&(t._f=i),t._l==r&&(t._l=n),t[SIZE]--}return!!r},forEach:function(e){for(var t,r=ctx(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!getEntry(this,e)}}),DESCRIPTORS&&$.setDesc(n.prototype,"size",{get:function(){return defined(this[SIZE])}}),n},def:function(e,t,r){var i,n,s=getEntry(e,t);return s?s.v=r:(e._l=s={i:n=fastKey(t,!0),k:t,v:r,p:i=e._l,n:void 0,r:!1},e._f||(e._f=s),i&&(i.n=s),e[SIZE]++,"F"!==n&&(e._i[n]=s)),
e},getEntry:getEntry,setStrong:function(e,t,r){$iterDefine(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?step(0,r.k):"values"==t?step(0,r.v):step(0,[r.k,r.v]):(e._t=void 0,step(1))},r?"entries":"values",!r,!0),setSpecies(t)}}},{"./$":93,"./$.ctx":72,"./$.defined":73,"./$.descriptors":74,"./$.for-of":78,"./$.has":80,"./$.hide":81,"./$.is-object":86,"./$.iter-define":89,"./$.iter-step":91,"./$.redefine-all":99,"./$.set-species":103,"./$.strict-new":107,"./$.uid":114}],69:[function(require,module,exports){var forOf=require("./$.for-of"),classof=require("./$.classof");module.exports=function(r){return function(){if(classof(this)!=r)throw TypeError(r+"#toJSON isn't generic");var o=[];return forOf(this,!1,o.push,o),o}}},{"./$.classof":66,"./$.for-of":78}],70:[function(require,module,exports){"use strict";var $=require("./$"),global=require("./$.global"),$export=require("./$.export"),fails=require("./$.fails"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),forOf=require("./$.for-of"),strictNew=require("./$.strict-new"),isObject=require("./$.is-object"),setToStringTag=require("./$.set-to-string-tag"),DESCRIPTORS=require("./$.descriptors");module.exports=function(e,r,t,i,o,s){var n=global[e],c=n,u=o?"set":"add",a=c&&c.prototype,f={};return DESCRIPTORS&&"function"==typeof c&&(s||a.forEach&&!fails(function(){(new c).entries().next()}))?(c=r(function(r,t){strictNew(r,c,e),r._c=new n,void 0!=t&&forOf(t,o,r[u],r)}),$.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","),function(e){var r="add"==e||"set"==e;e in a&&(!s||"clear"!=e)&&hide(c.prototype,e,function(t,i){if(!r&&s&&!isObject(t))return"get"==e?void 0:!1;var o=this._c[e](0===t?0:t,i);return r?this:o})}),"size"in a&&$.setDesc(c.prototype,"size",{get:function(){return this._c.size}})):(c=i.getConstructor(r,e,o,u),redefineAll(c.prototype,t)),setToStringTag(c,e),f[e]=c,$export($export.G+$export.W+$export.F,f),s||i.setStrong(c,e,o),c}},{"./$":93,"./$.descriptors":74,"./$.export":76,"./$.fails":77,"./$.for-of":78,"./$.global":79,"./$.hide":81,"./$.is-object":86,"./$.redefine-all":99,"./$.set-to-string-tag":104,"./$.strict-new":107}],71:[function(require,module,exports){var core=module.exports={version:"1.2.6"};"number"==typeof __e&&(__e=core)},{}],72:[function(require,module,exports){var aFunction=require("./$.a-function");module.exports=function(n,r,t){if(aFunction(n),void 0===r)return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,u){return n.call(r,t,u)};case 3:return function(t,u,e){return n.call(r,t,u,e)}}return function(){return n.apply(r,arguments)}}},{"./$.a-function":63}],73:[function(require,module,exports){module.exports=function(o){if(void 0==o)throw TypeError("Can't call method on  "+o);return o}},{}],74:[function(require,module,exports){module.exports=!require("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":77}],75:[function(require,module,exports){var isObject=require("./$.is-object"),document=require("./$.global").document,is=isObject(document)&&isObject(document.createElement);module.exports=function(e){return is?document.createElement(e):{}}},{"./$.global":79,"./$.is-object":86}],76:[function(require,module,exports){var global=require("./$.global"),core=require("./$.core"),ctx=require("./$.ctx"),PROTOTYPE="prototype",$export=function(o,r,e){var t,n,p,x=o&$export.F,c=o&$export.G,$=o&$export.S,l=o&$export.P,i=o&$export.B,P=o&$export.W,u=c?core:core[r]||(core[r]={}),O=c?global:$?global[r]:(global[r]||{})[PROTOTYPE];c&&(e=r);for(t in e)n=!x&&O&&t in O,n&&t in u||(p=n?O[t]:e[t],u[t]=c&&"function"!=typeof O[t]?e[t]:i&&n?ctx(p,global):P&&O[t]==p?function(o){var r=function(r){return this instanceof o?new o(r):o(r)};return r[PROTOTYPE]=o[PROTOTYPE],r}(p):l&&"function"==typeof p?ctx(Function.call,p):p,l&&((u[PROTOTYPE]||(u[PROTOTYPE]={}))[t]=p))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,module.exports=$export},{"./$.core":71,"./$.ctx":72,"./$.global":79}],77:[function(require,module,exports){module.exports=function(r){try{return!!r()}catch(t){return!0}}},{}],78:[function(require,module,exports){var ctx=require("./$.ctx"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),anObject=require("./$.an-object"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");module.exports=function(e,r,t,i){var o,a,n,l=getIterFn(e),c=ctx(t,i,r?2:1),u=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(isArrayIter(l))for(o=toLength(e.length);o>u;u++)r?c(anObject(a=e[u])[0],a[1]):c(e[u]);else for(n=l.call(e);!(a=n.next()).done;)call(n,c,a.value,r)}},{"./$.an-object":65,"./$.ctx":72,"./$.is-array-iter":85,"./$.iter-call":87,"./$.to-length":112,"./core.get-iterator-method":116}],79:[function(require,module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},{}],80:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(r,e){return hasOwnProperty.call(r,e)}},{}],81:[function(require,module,exports){var $=require("./$"),createDesc=require("./$.property-desc");module.exports=require("./$.descriptors")?function(e,r,t){return $.setDesc(e,r,createDesc(1,t))}:function(e,r,t){return e[r]=t,e}},{"./$":93,"./$.descriptors":74,"./$.property-desc":98}],82:[function(require,module,exports){module.exports=require("./$.global").document&&document.documentElement},{"./$.global":79}],83:[function(require,module,exports){module.exports=function(e,r,l){var a=void 0===l;switch(r.length){case 0:return a?e():e.call(l);case 1:return a?e(r[0]):e.call(l,r[0]);case 2:return a?e(r[0],r[1]):e.call(l,r[0],r[1]);case 3:return a?e(r[0],r[1],r[2]):e.call(l,r[0],r[1],r[2]);case 4:return a?e(r[0],r[1],r[2],r[3]):e.call(l,r[0],r[1],r[2],r[3])}return e.apply(l,r)}},{}],84:[function(require,module,exports){var cof=require("./$.cof");module.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==cof(e)?e.split(""):Object(e)}},{"./$.cof":67}],85:[function(require,module,exports){var Iterators=require("./$.iterators"),ITERATOR=require("./$.wks")("iterator"),ArrayProto=Array.prototype;module.exports=function(r){return void 0!==r&&(Iterators.Array===r||ArrayProto[ITERATOR]===r)}},{"./$.iterators":92,"./$.wks":115}],86:[function(require,module,exports){module.exports=function(o){return"object"==typeof o?null!==o:"function"==typeof o}},{}],87:[function(require,module,exports){var anObject=require("./$.an-object");module.exports=function(r,t,e,a){try{return a?t(anObject(e)[0],e[1]):t(e)}catch(c){var n=r.return;throw void 0!==n&&anObject(n.call(r)),c}}},{"./$.an-object":65}],88:[function(require,module,exports){"use strict";var $=require("./$"),descriptor=require("./$.property-desc"),setToStringTag=require("./$.set-to-string-tag"),IteratorPrototype={};require("./$.hide")(IteratorPrototype,require("./$.wks")("iterator"),function(){return this}),module.exports=function(r,t,e){r.prototype=$.create(IteratorPrototype,{next:descriptor(1,e)}),setToStringTag(r,t+" Iterator")}},{"./$":93,"./$.hide":81,"./$.property-desc":98,"./$.set-to-string-tag":104,"./$.wks":115}],89:[function(require,module,exports){"use strict";var LIBRARY=require("./$.library"),$export=require("./$.export"),redefine=require("./$.redefine"),hide=require("./$.hide"),has=require("./$.has"),Iterators=require("./$.iterators"),$iterCreate=require("./$.iter-create"),setToStringTag=require("./$.set-to-string-tag"),getProto=require("./$").getProto,ITERATOR=require("./$.wks")("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this};module.exports=function(e,r,t,i,n,s,u){$iterCreate(t,r,i);var o,a,T=function(e){if(!BUGGY&&e in E)return E[e];switch(e){case KEYS:return function(){return new t(this,e)};case VALUES:return function(){return new t(this,e)}}return function(){return new t(this,e)}},R=r+" Iterator",h=n==VALUES,A=!1,E=e.prototype,$=E[ITERATOR]||E[FF_ITERATOR]||n&&E[n],f=$||T(n);if($){var I=getProto(f.call(new e));setToStringTag(I,R,!0),!LIBRARY&&has(E,FF_ITERATOR)&&hide(I,ITERATOR,returnThis),h&&$.name!==VALUES&&(A=!0,f=function(){return $.call(this)})}if(LIBRARY&&!u||!BUGGY&&!A&&E[ITERATOR]||hide(E,ITERATOR,f),Iterators[r]=f,Iterators[R]=returnThis,n)if(o={values:h?f:T(VALUES),keys:s?f:T(KEYS),entries:h?T("entries"):f},u)for(a in o)a in E||redefine(E,a,o[a]);else $export($export.P+$export.F*(BUGGY||A),r,o);return o}},{"./$":93,"./$.export":76,"./$.has":80,"./$.hide":81,"./$.iter-create":88,"./$.iterators":92,"./$.library":94,"./$.redefine":100,"./$.set-to-string-tag":104,"./$.wks":115}],90:[function(require,module,exports){var ITERATOR=require("./$.wks")("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(r,t){if(!t&&!SAFE_CLOSING)return!1;var n=!1;try{var e=[7],i=e[ITERATOR]();i.next=function(){n=!0},e[ITERATOR]=function(){return i},r(e)}catch(u){}return n}},{"./$.wks":115}],91:[function(require,module,exports){module.exports=function(e,n){return{value:n,done:!!e}}},{}],92:[function(require,module,exports){module.exports={}},{}],93:[function(require,module,exports){var $Object=Object;module.exports={create:$Object.create,getProto:$Object.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:$Object.getOwnPropertyDescriptor,setDesc:$Object.defineProperty,setDescs:$Object.defineProperties,getKeys:$Object.keys,getNames:$Object.getOwnPropertyNames,getSymbols:$Object.getOwnPropertySymbols,each:[].forEach}},{}],94:[function(require,module,exports){module.exports=!0},{}],95:[function(require,module,exports){var head,last,notify,global=require("./$.global"),macrotask=require("./$.task").set,Observer=global.MutationObserver||global.WebKitMutationObserver,process=global.process,Promise=global.Promise,isNode="process"==require("./$.cof")(process),flush=function(){var e,o,s;for(isNode&&(e=process.domain)&&(process.domain=null,e.exit());head;)o=head.domain,s=head.fn,o&&o.enter(),s(),o&&o.exit(),head=head.next;last=void 0,e&&e.enter()};if(isNode)notify=function(){process.nextTick(flush)};else if(Observer){var toggle=1,node=document.createTextNode("");new Observer(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=-toggle}}else notify=Promise&&Promise.resolve?function(){Promise.resolve().then(flush)}:function(){macrotask.call(global,flush)};module.exports=function(e){var o={fn:e,next:void 0,domain:isNode&&process.domain};last&&(last.next=o),head||(head=o,notify()),last=o}},{"./$.cof":67,"./$.global":79,"./$.task":109}],96:[function(require,module,exports){var $=require("./$"),toObject=require("./$.to-object"),IObject=require("./$.iobject");module.exports=require("./$.fails")(function(){var e=Object.assign,t={},r={},o=Symbol(),c="abcdefghijklmnopqrst";return t[o]=7,c.split("").forEach(function(e){r[e]=e}),7!=e({},t)[o]||Object.keys(e({},r)).join("")!=c})?function(e,t){for(var r=toObject(e),o=arguments,c=o.length,n=1,i=$.getKeys,s=$.getSymbols,a=$.isEnum;c>n;)for(var b,u=IObject(o[n++]),j=s?i(u).concat(s(u)):i(u),l=j.length,f=0;l>f;)a.call(u,b=j[f++])&&(r[b]=u[b]);return r}:Object.assign},{"./$":93,"./$.fails":77,"./$.iobject":84,"./$.to-object":113}],97:[function(require,module,exports){var $export=require("./$.export"),core=require("./$.core"),fails=require("./$.fails");module.exports=function(e,r){var o=(core.Object||{})[e]||Object[e],t={};t[e]=r(o),$export($export.S+$export.F*fails(function(){o(1)}),"Object",t)}},{"./$.core":71,"./$.export":76,"./$.fails":77}],98:[function(require,module,exports){module.exports=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}}},{}],99:[function(require,module,exports){var redefine=require("./$.redefine");module.exports=function(e,r){for(var n in r)redefine(e,n,r[n]);return e}},{"./$.redefine":100}],100:[function(require,module,exports){module.exports=require("./$.hide")},{"./$.hide":81}],101:[function(require,module,exports){module.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},{}],102:[function(require,module,exports){var getDesc=require("./$").getDesc,isObject=require("./$.is-object"),anObject=require("./$.an-object"),check=function(e,t){if(anObject(e),!isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,c){try{c=require("./$.ctx")(Function.call,getDesc(Object.prototype,"__proto__").set,2),c(e,[]),t=!(e instanceof Array)}catch(r){t=!0}return function(e,r){return check(e,r),t?e.__proto__=r:c(e,r),e}}({},!1):void 0),check:check}},{"./$":93,"./$.an-object":65,"./$.ctx":72,"./$.is-object":86}],103:[function(require,module,exports){"use strict";var core=require("./$.core"),$=require("./$"),DESCRIPTORS=require("./$.descriptors"),SPECIES=require("./$.wks")("species");module.exports=function(e){var r=core[e];DESCRIPTORS&&r&&!r[SPECIES]&&$.setDesc(r,SPECIES,{configurable:!0,get:function(){return this}})}},{"./$":93,"./$.core":71,"./$.descriptors":74,"./$.wks":115}],104:[function(require,module,exports){var def=require("./$").setDesc,has=require("./$.has"),TAG=require("./$.wks")("toStringTag");module.exports=function(e,r,a){e&&!has(e=a?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:r})}},{"./$":93,"./$.has":80,"./$.wks":115}],105:[function(require,module,exports){var global=require("./$.global"),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(o){return store[o]||(store[o]={})}},{"./$.global":79}],106:[function(require,module,exports){var anObject=require("./$.an-object"),aFunction=require("./$.a-function"),SPECIES=require("./$.wks")("species");module.exports=function(e,n){var r,t=anObject(e).constructor;return void 0===t||void 0==(r=anObject(t)[SPECIES])?n:aFunction(r)}},{"./$.a-function":63,"./$.an-object":65,"./$.wks":115}],107:[function(require,module,exports){module.exports=function(e,r,o){if(!(e instanceof r))throw TypeError(o+": use the 'new' operator!");return e}},{}],108:[function(require,module,exports){var toInteger=require("./$.to-integer"),defined=require("./$.defined");module.exports=function(e){return function(r,t){var n,i,d=String(defined(r)),o=toInteger(t),u=d.length;return 0>o||o>=u?e?"":void 0:(n=d.charCodeAt(o),55296>n||n>56319||o+1===u||(i=d.charCodeAt(o+1))<56320||i>57343?e?d.charAt(o):n:e?d.slice(o,o+2):(n-55296<<10)+(i-56320)+65536)}}},{"./$.defined":73,"./$.to-integer":110}],109:[function(require,module,exports){var defer,channel,port,ctx=require("./$.ctx"),invoke=require("./$.invoke"),html=require("./$.html"),cel=require("./$.dom-create"),global=require("./$.global"),process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",run=function(){var e=+this;if(queue.hasOwnProperty(e)){var n=queue[e];delete queue[e],n()}},listner=function(e){run.call(e.data)};setTask&&clearTask||(setTask=function(e){for(var n=[],t=1;arguments.length>t;)n.push(arguments[t++]);return queue[++counter]=function(){invoke("function"==typeof e?e:Function(e),n)},defer(counter),counter},clearTask=function(e){delete queue[e]},"process"==require("./$.cof")(process)?defer=function(e){process.nextTick(ctx(run,e,1))}:MessageChannel?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listner,defer=ctx(port.postMessage,port,1)):global.addEventListener&&"function"==typeof postMessage&&!global.importScripts?(defer=function(e){global.postMessage(e+"","*")},global.addEventListener("message",listner,!1)):defer=ONREADYSTATECHANGE in cel("script")?function(e){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run.call(e)}}:function(e){setTimeout(ctx(run,e,1),0)}),module.exports={set:setTask,clear:clearTask}},{"./$.cof":67,"./$.ctx":72,"./$.dom-create":75,"./$.global":79,"./$.html":82,"./$.invoke":83}],110:[function(require,module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)}},{}],111:[function(require,module,exports){var IObject=require("./$.iobject"),defined=require("./$.defined");module.exports=function(e){return IObject(defined(e))}},{"./$.defined":73,"./$.iobject":84}],112:[function(require,module,exports){var toInteger=require("./$.to-integer"),min=Math.min;module.exports=function(e){return e>0?min(toInteger(e),9007199254740991):0}},{"./$.to-integer":110}],113:[function(require,module,exports){var defined=require("./$.defined");module.exports=function(e){return Object(defined(e))}},{"./$.defined":73}],114:[function(require,module,exports){var id=0,px=Math.random();module.exports=function(o){return"Symbol(".concat(void 0===o?"":o,")_",(++id+px).toString(36))}},{}],115:[function(require,module,exports){var store=require("./$.shared")("wks"),uid=require("./$.uid"),Symbol=require("./$.global").Symbol;module.exports=function(r){return store[r]||(store[r]=Symbol&&Symbol[r]||(Symbol||uid)("Symbol."+r))}},{"./$.global":79,"./$.shared":105,"./$.uid":114}],116:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").getIteratorMethod=function(r){return void 0!=r?r[ITERATOR]||r["@@iterator"]||Iterators[classof(r)]:void 0}},{"./$.classof":66,"./$.core":71,"./$.iterators":92,"./$.wks":115}],117:[function(require,module,exports){var anObject=require("./$.an-object"),get=require("./core.get-iterator-method");module.exports=require("./$.core").getIterator=function(e){var r=get(e);if("function"!=typeof r)throw TypeError(e+" is not iterable!");return anObject(r.call(e))}},{"./$.an-object":65,"./$.core":71,"./core.get-iterator-method":116}],118:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").isIterable=function(r){var e=Object(r);return void 0!==e[ITERATOR]||"@@iterator"in e||Iterators.hasOwnProperty(classof(e))}},{"./$.classof":66,"./$.core":71,"./$.iterators":92,"./$.wks":115}],119:[function(require,module,exports){"use strict";var ctx=require("./$.ctx"),$export=require("./$.export"),toObject=require("./$.to-object"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");$export($export.S+$export.F*!require("./$.iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var r,t,o,i,n=toObject(e),a="function"==typeof this?this:Array,c=arguments,u=c.length,l=u>1?c[1]:void 0,$=void 0!==l,g=0,f=getIterFn(n);if($&&(l=ctx(l,u>2?c[2]:void 0,2)),void 0==f||a==Array&&isArrayIter(f))for(r=toLength(n.length),t=new a(r);r>g;g++)t[g]=$?l(n[g],g):n[g];else for(i=f.call(n),t=new a;!(o=i.next()).done;g++)t[g]=$?call(i,l,[o.value,g],!0):o.value;return t.length=g,t}})},{"./$.ctx":72,"./$.export":76,"./$.is-array-iter":85,"./$.iter-call":87,"./$.iter-detect":90,"./$.to-length":112,"./$.to-object":113,"./core.get-iterator-method":116}],120:[function(require,module,exports){"use strict";var addToUnscopables=require("./$.add-to-unscopables"),step=require("./$.iter-step"),Iterators=require("./$.iterators"),toIObject=require("./$.to-iobject");module.exports=require("./$.iter-define")(Array,"Array",function(e,t){this._t=toIObject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,s=this._i++;return!e||s>=e.length?(this._t=void 0,step(1)):"keys"==t?step(0,s):"values"==t?step(0,e[s]):step(0,[s,e[s]])},"values"),Iterators.Arguments=Iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries")},{"./$.add-to-unscopables":64,"./$.iter-define":89,"./$.iter-step":91,"./$.iterators":92,"./$.to-iobject":111}],121:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var n=strong.getEntry(this,t);return n&&n.v},set:function(t,n){return strong.def(this,0===t?0:t,n)}},strong,!0)},{"./$.collection":70,"./$.collection-strong":68}],122:[function(require,module,exports){var $export=require("./$.export");$export($export.S+$export.F,"Object",{assign:require("./$.object-assign")})},{"./$.export":76,"./$.object-assign":96}],123:[function(require,module,exports){var toIObject=require("./$.to-iobject");require("./$.object-sap")("getOwnPropertyDescriptor",function(t){return function(e,r){return t(toIObject(e),r)}})},{"./$.object-sap":97,"./$.to-iobject":111}],124:[function(require,module,exports){var toObject=require("./$.to-object");require("./$.object-sap")("keys",function(e){return function(t){return e(toObject(t))}})},{"./$.object-sap":97,"./$.to-object":113}],125:[function(require,module,exports){var $export=require("./$.export");$export($export.S,"Object",{setPrototypeOf:require("./$.set-proto").set})},{"./$.export":76,"./$.set-proto":102}],126:[function(require,module,exports){},{}],127:[function(require,module,exports){"use strict";var Wrapper,$=require("./$"),LIBRARY=require("./$.library"),global=require("./$.global"),ctx=require("./$.ctx"),classof=require("./$.classof"),$export=require("./$.export"),isObject=require("./$.is-object"),anObject=require("./$.an-object"),aFunction=require("./$.a-function"),strictNew=require("./$.strict-new"),forOf=require("./$.for-of"),setProto=require("./$.set-proto").set,same=require("./$.same-value"),SPECIES=require("./$.wks")("species"),speciesConstructor=require("./$.species-constructor"),asap=require("./$.microtask"),PROMISE="Promise",process=global.process,isNode="process"==classof(process),P=global[PROMISE],testResolve=function(e){var r=new P(function(){});return e&&(r.constructor=Object),P.resolve(r)===r},USE_NATIVE=function(){function e(r){var t=new P(r);return setProto(t,e.prototype),t}var r=!1;try{if(r=P&&P.resolve&&testResolve(),setProto(e,P),e.prototype=$.create(P.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(r=!1),r&&require("./$.descriptors")){var t=!1;P.resolve($.setDesc({},"then",{get:function(){t=!0}})),r=t}}catch(o){r=!1}return r}(),sameConstructor=function(e,r){return LIBRARY&&e===P&&r===Wrapper?!0:same(e,r)},getConstructor=function(e){var r=anObject(e)[SPECIES];return void 0!=r?r:e},isThenable=function(e){var r;return isObject(e)&&"function"==typeof(r=e.then)?r:!1},PromiseCapability=function(e){var r,t;this.promise=new e(function(e,o){if(void 0!==r||void 0!==t)throw TypeError("Bad Promise constructor");r=e,t=o}),this.resolve=aFunction(r),this.reject=aFunction(t)},perform=function(e){try{e()}catch(r){return{error:r}}},notify=function(e,r){if(!e.n){e.n=!0;var t=e.c;asap(function(){for(var o=e.v,n=1==e.s,i=0,s=function(r){var t,i,s=n?r.ok:r.fail,c=r.resolve,a=r.reject;try{s?(n||(e.h=!0),t=s===!0?o:s(o),t===r.promise?a(TypeError("Promise-chain cycle")):(i=isThenable(t))?i.call(t,c,a):c(t)):a(o)}catch(u){a(u)}};t.length>i;)s(t[i++]);t.length=0,e.n=!1,r&&setTimeout(function(){var r,t,n=e.p;isUnhandled(n)&&(isNode?process.emit("unhandledRejection",o,n):(r=global.onunhandledrejection)?r({promise:n,reason:o}):(t=global.console)&&t.error&&t.error("Unhandled promise rejection",o)),e.a=void 0},1)})}},isUnhandled=function(e){var r,t=e._d,o=t.a||t.c,n=0;if(t.h)return!1;for(;o.length>n;)if(r=o[n++],r.fail||!isUnhandled(r.promise))return!1;return!0},$reject=function(e){var r=this;r.d||(r.d=!0,r=r.r||r,r.v=e,r.s=2,r.a=r.c.slice(),notify(r,!0))},$resolve=function(e){var r,t=this;if(!t.d){t.d=!0,t=t.r||t;try{if(t.p===e)throw TypeError("Promise can't be resolved itself");(r=isThenable(e))?asap(function(){var o={r:t,d:!1};try{r.call(e,ctx($resolve,o,1),ctx($reject,o,1))}catch(n){$reject.call(o,n)}}):(t.v=e,t.s=1,notify(t,!1))}catch(o){$reject.call({r:t,d:!1},o)}}};USE_NATIVE||(P=function(e){aFunction(e);var r=this._d={p:strictNew(this,P,PROMISE),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{e(ctx($resolve,r,1),ctx($reject,r,1))}catch(t){$reject.call(r,t)}},require("./$.redefine-all")(P.prototype,{then:function(e,r){var t=new PromiseCapability(speciesConstructor(this,P)),o=t.promise,n=this._d;return t.ok="function"==typeof e?e:!0,t.fail="function"==typeof r&&r,n.c.push(t),n.a&&n.a.push(t),n.s&&notify(n,!1),o},catch:function(e){return this.then(void 0,e)}})),$export($export.G+$export.W+$export.F*!USE_NATIVE,{Promise:P}),require("./$.set-to-string-tag")(P,PROMISE),require("./$.set-species")(PROMISE),Wrapper=require("./$.core")[PROMISE],$export($export.S+$export.F*!USE_NATIVE,PROMISE,{reject:function(e){var r=new PromiseCapability(this),t=r.reject;return t(e),r.promise}}),$export($export.S+$export.F*(!USE_NATIVE||testResolve(!0)),PROMISE,{resolve:function(e){if(e instanceof P&&sameConstructor(e.constructor,this))return e;var r=new PromiseCapability(this),t=r.resolve;return t(e),r.promise}}),$export($export.S+$export.F*!(USE_NATIVE&&require("./$.iter-detect")(function(e){P.all(e).catch(function(){})})),PROMISE,{all:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.resolve,n=t.reject,i=[],s=perform(function(){forOf(e,!1,i.push,i);var t=i.length,s=Array(t);t?$.each.call(i,function(e,i){var c=!1;r.resolve(e).then(function(e){c||(c=!0,s[i]=e,--t||o(s))},n)}):o(s)});return s&&n(s.error),t.promise},race:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.reject,n=perform(function(){forOf(e,!1,function(e){r.resolve(e).then(t.resolve,o)})});return n&&o(n.error),t.promise}})},{"./$":93,"./$.a-function":63,"./$.an-object":65,"./$.classof":66,"./$.core":71,"./$.ctx":72,"./$.descriptors":74,"./$.export":76,"./$.for-of":78,"./$.global":79,"./$.is-object":86,"./$.iter-detect":90,"./$.library":94,"./$.microtask":95,"./$.redefine-all":99,"./$.same-value":101,"./$.set-proto":102,"./$.set-species":103,"./$.set-to-string-tag":104,"./$.species-constructor":106,"./$.strict-new":107,"./$.wks":115}],128:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return strong.def(this,t=0===t?0:t,t)}},strong)},{"./$.collection":70,"./$.collection-strong":68}],129:[function(require,module,exports){"use strict";var $at=require("./$.string-at")(!0);require("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,e=this._i;return e>=i.length?{value:void 0,done:!0}:(t=$at(i,e),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":89,"./$.string-at":108}],130:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Map",{toJSON:require("./$.collection-to-json")("Map")})},{"./$.collection-to-json":69,"./$.export":76}],131:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Set",{toJSON:require("./$.collection-to-json")("Set")})},{"./$.collection-to-json":69,"./$.export":76}],132:[function(require,module,exports){require("./es6.array.iterator");var Iterators=require("./$.iterators");Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array},{"./$.iterators":92,"./es6.array.iterator":120}],133:[function(require,module,exports){"use strict";var _get=require("babel-runtime/helpers/get").default,_inherits=require("babel-runtime/helpers/inherits").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _language=require("../language"),GraphQLError=function(e){function r(e,t,i,n,o){_classCallCheck(this,r),_get(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e),this.message=e,Object.defineProperty(this,"stack",{value:i||e}),Object.defineProperty(this,"nodes",{value:t}),Object.defineProperty(this,"source",{get:function(){if(n)return n;if(t&&t.length>0){var e=t[0];return e&&e.loc&&e.loc.source}}}),Object.defineProperty(this,"positions",{get:function(){if(o)return o;if(t){var e=t.map(function(e){return e.loc&&e.loc.start});if(e.some(function(e){return e}))return e}}}),Object.defineProperty(this,"locations",{get:function(){var e=this;return this.positions&&this.source?this.positions.map(function(r){return(0,_language.getLocation)(e.source,r)}):void 0}})}return _inherits(r,e),r}(Error);exports.GraphQLError=GraphQLError},{"../language":148,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/get":30,"babel-runtime/helpers/inherits":31}],134:[function(require,module,exports){"use strict";function formatError(e){return(0,_jsutilsInvariant2.default)(e,"Received null or undefined error."),{message:e.message,locations:e.locations}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant)},{"../jsutils/invariant":144,"babel-runtime/helpers/interop-require-default":32}],135:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _GraphQLError=require("./GraphQLError");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _GraphQLError.GraphQLError}});var _syntaxError=require("./syntaxError");Object.defineProperty(exports,"syntaxError",{enumerable:!0,get:function(){return _syntaxError.syntaxError}});var _locatedError=require("./locatedError");Object.defineProperty(exports,"locatedError",{enumerable:!0,get:function(){return _locatedError.locatedError}});var _formatError=require("./formatError");Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _formatError.formatError}})},{"./GraphQLError":133,"./formatError":134,"./locatedError":136,"./syntaxError":137}],136:[function(require,module,exports){"use strict";function locatedError(r,e){var o=r?r.message||String(r):"An unknown error occurred.",a=r?r.stack:null,t=new _GraphQLError.GraphQLError(o,e,a);return t.originalError=r,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":133}],137:[function(require,module,exports){"use strict";function syntaxError(r,n,o){var t=(0,_languageLocation.getLocation)(r,n),a=new _GraphQLError.GraphQLError("Syntax Error "+r.name+" ("+t.line+":"+t.column+") "+o+"\n\n"+highlightSourceAtLocation(r,t),void 0,void 0,r,[n]);return a}function highlightSourceAtLocation(r,n){var o=n.line,t=(o-1).toString(),a=o.toString(),e=(o+1).toString(),i=e.length,l=r.body.split(/\r\n|[\n\r]/g);return(o>=2?lpad(i,t)+": "+l[o-2]+"\n":"")+lpad(i,a)+": "+l[o-1]+"\n"+Array(2+i+n.column).join(" ")+"^\n"+(o<l.length?lpad(i,e)+": "+l[o]+"\n":"")}function lpad(r,n){return Array(r-n.length+1).join(" ")+n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.syntaxError=syntaxError;var _languageLocation=require("../language/location"),_GraphQLError=require("./GraphQLError")},{"../language/location":151,"./GraphQLError":133}],138:[function(require,module,exports){"use strict";function execute(e,r,t,n,i){(0,_jsutilsInvariant2.default)(e,"Must provide schema"),(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.");var a=buildExecutionContext(e,r,t,n,i);return new _Promise(function(e){e(executeOperation(a,a.operation,t))}).catch(function(e){return a.errors.push(e),
null}).then(function(e){return a.errors.length?{data:e,errors:a.errors}:{data:e}})}function buildExecutionContext(e,r,t,n,i){var a=[],o=void 0,u=_Object$create(null);if(r.definitions.forEach(function(e){switch(e.kind){case _language.Kind.OPERATION_DEFINITION:if(!i&&o)throw new _error.GraphQLError("Must provide operation name if query contains multiple operations.");(!i||e.name&&e.name.value===i)&&(o=e);break;case _language.Kind.FRAGMENT_DEFINITION:u[e.name.value]=e;break;default:throw new _error.GraphQLError("GraphQL cannot execute a request containing a "+e.kind+".",e)}}),!o)throw i?new _error.GraphQLError("Must provide an operation."):new _error.GraphQLError('Unknown operation named "'+i+'".');var l=(0,_values.getVariableValues)(e,o.variableDefinitions||[],n||{}),s={schema:e,fragments:u,rootValue:t,operation:o,variableValues:l,errors:a};return s}function executeOperation(e,r,t){var n=getOperationRootType(e.schema,r),i=collectFields(e,n,r.selectionSet,_Object$create(null),_Object$create(null));return"mutation"===r.operation?executeFieldsSerially(e,n,t,i):executeFields(e,n,t,i)}function getOperationRootType(e,r){switch(r.operation){case"query":return e.getQueryType();case"mutation":var t=e.getMutationType();if(!t)throw new _error.GraphQLError("Schema is not configured for mutations",[r]);return t;case"subscription":var n=e.getSubscriptionType();if(!n)throw new _error.GraphQLError("Schema is not configured for subscriptions",[r]);return n;default:throw new _error.GraphQLError("Can only execute queries, mutations and subscriptions",[r])}}function executeFieldsSerially(e,r,t,n){return _Object$keys(n).reduce(function(i,a){return i.then(function(i){var o=n[a],u=resolveField(e,r,t,o);return void 0===u?i:isThenable(u)?u.then(function(e){return i[a]=e,i}):(i[a]=u,i)})},_Promise.resolve({}))}function executeFields(e,r,t,n){var i=!1,a=_Object$keys(n).reduce(function(a,o){var u=n[o],l=resolveField(e,r,t,u);return void 0===l?a:(a[o]=l,isThenable(l)&&(i=!0),a)},_Object$create(null));return i?promiseForObject(a):a}function collectFields(e,r,t,n,i){for(var a=0;a<t.selections.length;a++){var o=t.selections[a];switch(o.kind){case _language.Kind.FIELD:if(!shouldIncludeNode(e,o.directives))continue;var u=getFieldEntryKey(o);n[u]||(n[u]=[]),n[u].push(o);break;case _language.Kind.INLINE_FRAGMENT:if(!shouldIncludeNode(e,o.directives)||!doesFragmentConditionMatch(e,o,r))continue;collectFields(e,r,o.selectionSet,n,i);break;case _language.Kind.FRAGMENT_SPREAD:var l=o.name.value;if(i[l]||!shouldIncludeNode(e,o.directives))continue;i[l]=!0;var s=e.fragments[l];if(!s||!shouldIncludeNode(e,s.directives)||!doesFragmentConditionMatch(e,s,r))continue;collectFields(e,r,s.selectionSet,n,i)}}return n}function shouldIncludeNode(e,r){var t=r&&(0,_jsutilsFind2.default)(r,function(e){return e.name.value===_typeDirectives.GraphQLSkipDirective.name});if(t){var n=(0,_values.getArgumentValues)(_typeDirectives.GraphQLSkipDirective.args,t.arguments,e.variableValues),i=n.if;return!i}var a=r&&(0,_jsutilsFind2.default)(r,function(e){return e.name.value===_typeDirectives.GraphQLIncludeDirective.name});if(a){var o=(0,_values.getArgumentValues)(_typeDirectives.GraphQLIncludeDirective.args,a.arguments,e.variableValues),u=o.if;return Boolean(u)}return!0}function doesFragmentConditionMatch(e,r,t){var n=r.typeCondition;if(!n)return!0;var i=(0,_utilitiesTypeFromAST.typeFromAST)(e.schema,n);return i===t?!0:(0,_typeDefinition.isAbstractType)(i)?i.isPossibleType(t):!1}function promiseForObject(e){var r=_Object$keys(e),t=r.map(function(r){return e[r]});return _Promise.all(t).then(function(e){return e.reduce(function(e,t,n){return e[r[n]]=t,e},_Object$create(null))})}function getFieldEntryKey(e){return e.alias?e.alias.value:e.name.value}function resolveField(e,r,t,n){var i=n[0],a=i.name.value,o=getFieldDef(e.schema,r,a);if(o){var u=o.type,l=o.resolve||defaultResolveFn,s=(0,_values.getArgumentValues)(o.args,i.arguments,e.variableValues),c={fieldName:a,fieldASTs:n,returnType:u,parentType:r,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues},p=resolveOrError(l,t,s,c);return completeValueCatchingError(e,u,n,c,p)}}function resolveOrError(e,r,t,n){try{return e(r,t,n)}catch(i){return i instanceof Error?i:new Error(i)}}function completeValueCatchingError(e,r,t,n,i){if(r instanceof _typeDefinition.GraphQLNonNull)return completeValue(e,r,t,n,i);try{var a=completeValue(e,r,t,n,i);return isThenable(a)?a.then(void 0,function(r){return e.errors.push(r),_Promise.resolve(null)}):a}catch(o){return e.errors.push(o),null}}function completeValue(e,r,t,n,i){if(isThenable(i))return i.then(function(i){return completeValue(e,r,t,n,i)},function(e){return _Promise.reject((0,_error.locatedError)(e,t))});if(i instanceof Error)throw(0,_error.locatedError)(i,t);if(r instanceof _typeDefinition.GraphQLNonNull){var a=completeValue(e,r.ofType,t,n,i);if(null===a)throw new _error.GraphQLError("Cannot return null for non-nullable "+("field "+n.parentType+"."+n.fieldName+"."),t);return a}if((0,_jsutilsIsNullish2.default)(i))return null;if(r instanceof _typeDefinition.GraphQLList){var o=function(){(0,_jsutilsInvariant2.default)(Array.isArray(i),"User Error: expected iterable, but did not find one "+("for field "+n.parentType+"."+n.fieldName+"."));var a=r.ofType,o=!1,u=i.map(function(r){var i=completeValueCatchingError(e,a,t,n,r);return!o&&isThenable(i)&&(o=!0),i});return{v:o?_Promise.all(u):u}}();if("object"==typeof o)return o.v}if(r instanceof _typeDefinition.GraphQLScalarType||r instanceof _typeDefinition.GraphQLEnumType){(0,_jsutilsInvariant2.default)(r.serialize,"Missing serialize method on type");var u=r.serialize(i);return(0,_jsutilsIsNullish2.default)(u)?null:u}var l=void 0;if(r instanceof _typeDefinition.GraphQLObjectType)l=r;else if((0,_typeDefinition.isAbstractType)(r)){var s=r;if(l=s.getObjectType(i,n),l&&!s.isPossibleType(l))throw new _error.GraphQLError('Runtime Object type "'+l+'" is not a possible type '+('for "'+s+'".'),t)}if(!l)return null;if(l.isTypeOf&&!l.isTypeOf(i,n))throw new _error.GraphQLError('Expected value of type "'+l+'" but got: '+i+".",t);for(var c=_Object$create(null),p=_Object$create(null),f=0;f<t.length;f++){var d=t[f].selectionSet;d&&(c=collectFields(e,l,d,c,p))}return executeFields(e,l,i,c)}function defaultResolveFn(e,r,t){var n=t.fieldName;if("number"!=typeof e&&"string"!=typeof e&&e){var i=e[n];return"function"==typeof i?i.call(e):i}}function isThenable(e){return"object"==typeof e&&null!==e&&"function"==typeof e.then}function getFieldDef(e,r,t){return t===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===r?_typeIntrospection.SchemaMetaFieldDef:t===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===r?_typeIntrospection.TypeMetaFieldDef:t===_typeIntrospection.TypeNameMetaFieldDef.name?_typeIntrospection.TypeNameMetaFieldDef:r.getFields()[t]}var _Promise=require("babel-runtime/core-js/promise").default,_Object$create=require("babel-runtime/core-js/object/create").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.execute=execute;var _error=require("../error"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesTypeFromAST=require("../utilities/typeFromAST"),_language=require("../language"),_values=require("./values"),_typeDefinition=require("../type/definition"),_typeSchema=require("../type/schema"),_typeIntrospection=require("../type/introspection"),_typeDirectives=require("../type/directives")},{"../error":135,"../jsutils/find":143,"../jsutils/invariant":144,"../jsutils/isNullish":145,"../language":148,"../type/definition":156,"../type/directives":157,"../type/introspection":159,"../type/schema":161,"../utilities/typeFromAST":175,"./values":140,"babel-runtime/core-js/object/create":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/promise":25,"babel-runtime/helpers/interop-require-default":32}],139:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _execute=require("./execute");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execute.execute}})},{"./execute":138}],140:[function(require,module,exports){"use strict";function getVariableValues(e,i,r){return i.reduce(function(i,t){var u=t.variable.name.value;return i[u]=getVariableValue(e,t,r[u]),i},{})}function getArgumentValues(e,i,r){if(!e||!i)return{};var t=(0,_jsutilsKeyMap2.default)(i,function(e){return e.name.value});return e.reduce(function(e,i){var u=i.name,a=t[u]?t[u].value:null,l=(0,_utilitiesValueFromAST.valueFromAST)(a,i.type,r);return(0,_jsutilsIsNullish2.default)(l)&&(l=i.defaultValue),(0,_jsutilsIsNullish2.default)(l)||(e[u]=l),e},{})}function getVariableValue(e,i,r){var t=(0,_utilitiesTypeFromAST.typeFromAST)(e,i.type),u=i.variable;if(!t||!(0,_typeDefinition.isInputType)(t))throw new _error.GraphQLError('Variable "$'+u.name.value+'" expected value of type '+('"'+(0,_languagePrinter.print)(i.type)+'" which cannot be used as an input type.'),[i]);var a=t,l=(0,_utilitiesIsValidJSValue.isValidJSValue)(r,a);if(!l.length){if((0,_jsutilsIsNullish2.default)(r)){var n=i.defaultValue;if(n)return(0,_utilitiesValueFromAST.valueFromAST)(n,a)}return coerceValue(a,r)}if((0,_jsutilsIsNullish2.default)(r))throw new _error.GraphQLError('Variable "$'+u.name.value+'" of required type '+('"'+(0,_languagePrinter.print)(i.type)+'" was not provided.'),[i]);var s=l?"\n"+l.join("\n"):"";throw new _error.GraphQLError('Variable "$'+u.name.value+'" got invalid value '+(JSON.stringify(r)+"."+s),[i])}function coerceValue(e,i){for(var r=!0;r;){var t=e,u=i;a=l=n=s=void 0,r=!1;var a=u;if(t instanceof _typeDefinition.GraphQLNonNull)e=t.ofType,i=a,r=!0;else{if((0,_jsutilsIsNullish2.default)(a))return null;if(t instanceof _typeDefinition.GraphQLList){var l=function(){var e=t.ofType;return Array.isArray(a)?{v:a.map(function(i){return coerceValue(e,i)})}:{v:[coerceValue(e,a)]}}();if("object"==typeof l)return l.v}if(t instanceof _typeDefinition.GraphQLInputObjectType){var n=function(){if("object"!=typeof a||null===a)return{v:null};var e=t.getFields();return{v:_Object$keys(e).reduce(function(i,r){var t=e[r],u=coerceValue(t.type,a[r]);return(0,_jsutilsIsNullish2.default)(u)&&(u=t.defaultValue),(0,_jsutilsIsNullish2.default)(u)||(i[r]=u),i},{})}}();if("object"==typeof n)return n.v}(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLScalarType||t instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var s=t.parseValue(a);if(!(0,_jsutilsIsNullish2.default)(s))return s}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.getVariableValues=getVariableValues,exports.getArgumentValues=getArgumentValues;var _error=require("../error"),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_utilitiesTypeFromAST=require("../utilities/typeFromAST"),_utilitiesValueFromAST=require("../utilities/valueFromAST"),_utilitiesIsValidJSValue=require("../utilities/isValidJSValue"),_languagePrinter=require("../language/printer"),_typeDefinition=require("../type/definition")},{"../error":135,"../jsutils/invariant":144,"../jsutils/isNullish":145,"../jsutils/keyMap":146,"../language/printer":153,"../type/definition":156,"../utilities/isValidJSValue":171,"../utilities/typeFromAST":175,"../utilities/valueFromAST":176,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32}],141:[function(require,module,exports){"use strict";function graphql(e,r,a,u,t){return new _Promise(function(i){var n=new _languageSource.Source(r||"","GraphQL request"),o=(0,_languageParser.parse)(n),l=(0,_validationValidate.validate)(e,o);i(l.length>0?{errors:l}:(0,_executionExecute.execute)(e,o,a,u,t))}).catch(function(e){return{errors:[e]}})}var _Promise=require("babel-runtime/core-js/promise").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.graphql=graphql;var _languageSource=require("./language/source"),_languageParser=require("./language/parser"),_validationValidate=require("./validation/validate"),_executionExecute=require("./execution/execute")},{"./execution/execute":138,"./language/parser":152,"./language/source":154,"./validation/validate":202,"babel-runtime/core-js/promise":25}],142:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _graphql=require("./graphql");Object.defineProperty(exports,"graphql",{enumerable:!0,get:function(){return _graphql.graphql}});var _type=require("./type");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _type.GraphQLSchema}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _type.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _type.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _type.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _type.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _type.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _type.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _type.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _type.GraphQLNonNull}}),Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _type.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _type.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _type.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _type.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _type.GraphQLID}}),Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _type.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _type.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _type.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _type.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _type.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _type.isAbstractType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _type.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _type.getNamedType}});var _language=require("./language");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _language.Source}}),Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _language.getLocation}}),Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _language.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _language.parseValue}}),Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _language.print}}),Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _language.visit}}),Object.defineProperty(exports,"Kind",{enumerable:!0,get:function(){return _language.Kind}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _language.BREAK}});var _execution=require("./execution");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execution.execute}});var _validation=require("./validation");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validation.validate}}),Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _validation.specifiedRules}});var _error=require("./error");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _error.GraphQLError}}),Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _error.formatError}});var _utilities=require("./utilities");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _utilities.introspectionQuery}}),Object.defineProperty(exports,"getOperationAST",{enumerable:!0,get:function(){return _utilities.getOperationAST}}),Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _utilities.buildClientSchema}}),Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _utilities.buildASTSchema}}),Object.defineProperty(exports,"extendSchema",{enumerable:!0,get:function(){return _utilities.extendSchema}}),Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _utilities.printSchema}}),Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _utilities.typeFromAST}}),Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _utilities.valueFromAST}}),Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _utilities.astFromValue}}),Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _utilities.TypeInfo}}),Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _utilities.isValidJSValue}}),Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _utilities.isValidLiteralValue}}),Object.defineProperty(exports,"concatAST",{enumerable:!0,get:function(){return _utilities.concatAST}}),Object.defineProperty(exports,"isEqualType",{enumerable:!0,get:function(){return _utilities.isEqualType}}),Object.defineProperty(exports,"isTypeSubTypeOf",{enumerable:!0,get:function(){return _utilities.isTypeSubTypeOf}}),Object.defineProperty(exports,"doTypesOverlap",{enumerable:!0,get:function(){return _utilities.doTypesOverlap}})},{"./error":135,"./execution":139,"./graphql":141,"./language":148,"./type":158,"./utilities":169,"./validation":177}],143:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=find,module.exports=exports.default},{}],144:[function(require,module,exports){"use strict";function invariant(e,t){if(!e)throw new Error(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=invariant,module.exports=exports.default},{}],145:[function(require,module,exports){"use strict";function isNullish(e){return null===e||void 0===e||e!==e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isNullish,module.exports=exports.default},{}],146:[function(require,module,exports){"use strict";function keyMap(e,t){return e.reduce(function(e,r){return e[t(r)]=r,e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyMap,module.exports=exports.default},{}],147:[function(require,module,exports){"use strict";function keyValMap(e,t,r){return e.reduce(function(e,u){return e[t(u)]=r(u),e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyValMap,module.exports=exports.default},{}],148:[function(require,module,exports){"use strict";var _interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0});var _kinds=require("./kinds"),Kind=_interopRequireWildcard(_kinds),_location=require("./location");Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _location.getLocation}}),exports.Kind=Kind;var _lexer=require("./lexer");Object.defineProperty(exports,"lex",{enumerable:!0,get:function(){return _lexer.lex}});var _parser=require("./parser");Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _parser.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _parser.parseValue}});var _printer=require("./printer");Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _printer.print}});var _source=require("./source");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _source.Source}});var _visitor=require("./visitor");Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _visitor.visit}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _visitor.BREAK}})},{"./kinds":149,"./lexer":150,"./location":151,"./parser":152,"./printer":153,"./source":154,"./visitor":155,"babel-runtime/helpers/interop-require-wildcard":33}],149:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var NAME="Name";exports.NAME=NAME;var DOCUMENT="Document";exports.DOCUMENT=DOCUMENT;var OPERATION_DEFINITION="OperationDefinition";exports.OPERATION_DEFINITION=OPERATION_DEFINITION;var VARIABLE_DEFINITION="VariableDefinition";exports.VARIABLE_DEFINITION=VARIABLE_DEFINITION;var VARIABLE="Variable";exports.VARIABLE=VARIABLE;var SELECTION_SET="SelectionSet";exports.SELECTION_SET=SELECTION_SET;var FIELD="Field";exports.FIELD=FIELD;var ARGUMENT="Argument";exports.ARGUMENT=ARGUMENT;var FRAGMENT_SPREAD="FragmentSpread";exports.FRAGMENT_SPREAD=FRAGMENT_SPREAD;var INLINE_FRAGMENT="InlineFragment";exports.INLINE_FRAGMENT=INLINE_FRAGMENT;var FRAGMENT_DEFINITION="FragmentDefinition";exports.FRAGMENT_DEFINITION=FRAGMENT_DEFINITION;var INT="IntValue";exports.INT=INT;var FLOAT="FloatValue";exports.FLOAT=FLOAT;var STRING="StringValue";exports.STRING=STRING;var BOOLEAN="BooleanValue";exports.BOOLEAN=BOOLEAN;var ENUM="EnumValue";exports.ENUM=ENUM;var LIST="ListValue";exports.LIST=LIST;var OBJECT="ObjectValue";exports.OBJECT=OBJECT;var OBJECT_FIELD="ObjectField";exports.OBJECT_FIELD=OBJECT_FIELD;var DIRECTIVE="Directive";exports.DIRECTIVE=DIRECTIVE;var NAMED_TYPE="NamedType";exports.NAMED_TYPE=NAMED_TYPE;var LIST_TYPE="ListType";exports.LIST_TYPE=LIST_TYPE;var NON_NULL_TYPE="NonNullType";exports.NON_NULL_TYPE=NON_NULL_TYPE;var OBJECT_TYPE_DEFINITION="ObjectTypeDefinition";exports.OBJECT_TYPE_DEFINITION=OBJECT_TYPE_DEFINITION;var FIELD_DEFINITION="FieldDefinition";exports.FIELD_DEFINITION=FIELD_DEFINITION;var INPUT_VALUE_DEFINITION="InputValueDefinition";exports.INPUT_VALUE_DEFINITION=INPUT_VALUE_DEFINITION;var INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition";exports.INTERFACE_TYPE_DEFINITION=INTERFACE_TYPE_DEFINITION;var UNION_TYPE_DEFINITION="UnionTypeDefinition";exports.UNION_TYPE_DEFINITION=UNION_TYPE_DEFINITION;var SCALAR_TYPE_DEFINITION="ScalarTypeDefinition";exports.SCALAR_TYPE_DEFINITION=SCALAR_TYPE_DEFINITION;var ENUM_TYPE_DEFINITION="EnumTypeDefinition";exports.ENUM_TYPE_DEFINITION=ENUM_TYPE_DEFINITION;var ENUM_VALUE_DEFINITION="EnumValueDefinition";exports.ENUM_VALUE_DEFINITION=ENUM_VALUE_DEFINITION;var INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition";exports.INPUT_OBJECT_TYPE_DEFINITION=INPUT_OBJECT_TYPE_DEFINITION;var TYPE_EXTENSION_DEFINITION="TypeExtensionDefinition";exports.TYPE_EXTENSION_DEFINITION=TYPE_EXTENSION_DEFINITION},{}],150:[function(require,module,exports){"use strict";function lex(e){var r=0;return function(n){var a=readToken(e,void 0===n?r:n);return r=a.end,a}}function getTokenDesc(e){return e.value?getTokenKindDesc(e.kind)+' "'+e.value+'"':getTokenKindDesc(e.kind)}function getTokenKindDesc(e){return tokenDescription[e]}function makeToken(e,r,n,a){return{kind:e,start:r,end:n,value:a}}function printCharCode(e){return isNaN(e)?"<EOF>":127>e?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function readToken(e,r){var n=e.body,a=n.length,o=positionAfterWhitespace(n,r);if(o>=a)return makeToken(TokenKind.EOF,o,o);var c=charCodeAt.call(n,o);if(32>c&&9!==c&&10!==c&&13!==c)throw(0,_error.syntaxError)(e,o,"Invalid character "+printCharCode(c)+".");switch(c){case 33:return makeToken(TokenKind.BANG,o,o+1);case 36:return makeToken(TokenKind.DOLLAR,o,o+1);case 40:return makeToken(TokenKind.PAREN_L,o,o+1);case 41:return makeToken(TokenKind.PAREN_R,o,o+1);case 46:if(46===charCodeAt.call(n,o+1)&&46===charCodeAt.call(n,o+2))return makeToken(TokenKind.SPREAD,o,o+3);break;case 58:return makeToken(TokenKind.COLON,o,o+1);case 61:return makeToken(TokenKind.EQUALS,o,o+1);case 64:return makeToken(TokenKind.AT,o,o+1);case 91:return makeToken(TokenKind.BRACKET_L,o,o+1);case 93:return makeToken(TokenKind.BRACKET_R,o,o+1);case 123:return makeToken(TokenKind.BRACE_L,o,o+1);case 124:return makeToken(TokenKind.PIPE,o,o+1);case 125:return makeToken(TokenKind.BRACE_R,o,o+1);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return readName(e,o);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(e,o,c);case 34:return readString(e,o)}throw(0,_error.syntaxError)(e,o,"Unexpected character "+printCharCode(c)+".")}function positionAfterWhitespace(e,r){for(var n=e.length,a=r;n>a;){var o=charCodeAt.call(e,a);if(65279===o||9===o||32===o||10===o||13===o||44===o)++a;else{if(35!==o)break;for(++a;n>a&&null!==(o=charCodeAt.call(e,a))&&(o>31||9===o)&&10!==o&&13!==o;)++a}}return a}function readNumber(e,r,n){var a=e.body,o=n,c=r,t=!1;if(45===o&&(o=charCodeAt.call(a,++c)),48===o){if(o=charCodeAt.call(a,++c),o>=48&&57>=o)throw(0,_error.syntaxError)(e,c,"Invalid number, unexpected digit after 0: "+printCharCode(o)+".")}else c=readDigits(e,c,o),o=charCodeAt.call(a,c);return 46===o&&(t=!0,o=charCodeAt.call(a,++c),c=readDigits(e,c,o),o=charCodeAt.call(a,c)),(69===o||101===o)&&(t=!0,o=charCodeAt.call(a,++c),(43===o||45===o)&&(o=charCodeAt.call(a,++c)),c=readDigits(e,c,o)),makeToken(t?TokenKind.FLOAT:TokenKind.INT,r,c,slice.call(a,r,c))}function readDigits(e,r,n){var a=e.body,o=r,c=n;if(c>=48&&57>=c){do c=charCodeAt.call(a,++o);while(c>=48&&57>=c);return o}throw(0,_error.syntaxError)(e,o,"Invalid number, expected digit but got: "+printCharCode(c)+".")}function readString(e,r){for(var n=e.body,a=r+1,o=a,c=0,t="";a<n.length&&null!==(c=charCodeAt.call(n,a))&&10!==c&&13!==c&&34!==c;){if(32>c&&9!==c)throw(0,_error.syntaxError)(e,a,"Invalid character within String: "+printCharCode(c)+".");if(++a,92===c){switch(t+=slice.call(n,o,a-1),c=charCodeAt.call(n,a)){case 34:t+='"';break;case 47:t+="/";break;case 92:t+="\\";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="	";break;case 117:var i=uniCharCode(charCodeAt.call(n,a+1),charCodeAt.call(n,a+2),charCodeAt.call(n,a+3),charCodeAt.call(n,a+4));if(0>i)throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: "+("\\u"+n.slice(a+1,a+5)+"."));t+=String.fromCharCode(i),a+=4;break;default:throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: \\"+String.fromCharCode(c)+".")}++a,o=a}}if(34!==c)throw(0,_error.syntaxError)(e,a,"Unterminated string.");return t+=slice.call(n,o,a),makeToken(TokenKind.STRING,r,a+1,t)}function uniCharCode(e,r,n,a){return char2hex(e)<<12|char2hex(r)<<8|char2hex(n)<<4|char2hex(a)}function char2hex(e){return e>=48&&57>=e?e-48:e>=65&&70>=e?e-55:e>=97&&102>=e?e-87:-1}function readName(e,r){for(var n=e.body,a=n.length,o=r+1,c=0;o!==a&&null!==(c=charCodeAt.call(n,o))&&(95===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c);)++o;return makeToken(TokenKind.NAME,r,o,slice.call(n,r,o))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lex=lex,exports.getTokenDesc=getTokenDesc,exports.getTokenKindDesc=getTokenKindDesc;var _error=require("../error"),TokenKind={EOF:1,BANG:2,DOLLAR:3,PAREN_L:4,PAREN_R:5,SPREAD:6,COLON:7,EQUALS:8,AT:9,BRACKET_L:10,BRACKET_R:11,BRACE_L:12,PIPE:13,BRACE_R:14,NAME:15,INT:16,FLOAT:17,STRING:18};exports.TokenKind=TokenKind;var tokenDescription={};tokenDescription[TokenKind.EOF]="EOF",tokenDescription[TokenKind.BANG]="!",tokenDescription[TokenKind.DOLLAR]="$",tokenDescription[TokenKind.PAREN_L]="(",tokenDescription[TokenKind.PAREN_R]=")",tokenDescription[TokenKind.SPREAD]="...",tokenDescription[TokenKind.COLON]=":",tokenDescription[TokenKind.EQUALS]="=",tokenDescription[TokenKind.AT]="@",tokenDescription[TokenKind.BRACKET_L]="[",tokenDescription[TokenKind.BRACKET_R]="]",tokenDescription[TokenKind.BRACE_L]="{",tokenDescription[TokenKind.PIPE]="|",tokenDescription[TokenKind.BRACE_R]="}",tokenDescription[TokenKind.NAME]="Name",tokenDescription[TokenKind.INT]="Int",tokenDescription[TokenKind.FLOAT]="Float",tokenDescription[TokenKind.STRING]="String";var charCodeAt=String.prototype.charCodeAt,slice=String.prototype.slice},{"../error":135}],151:[function(require,module,exports){"use strict";function getLocation(e,o){for(var t=/\r\n|[\n\r]/g,n=1,r=o+1,i=void 0;(i=t.exec(e.body))&&i.index<o;)n+=1,r=o+1-(i.index+i[0].length);return{line:n,column:r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLocation=getLocation},{}],152:[function(require,module,exports){"use strict";function parse(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseDocument(t)}function parseValue(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseValueLiteral(t,!1)}function parseName(e){var n=expect(e,_lexer.TokenKind.NAME);return{kind:_kinds.NAME,value:n.value,loc:loc(e,n.start)}}function parseDocument(e){var n=e.token.start,r=[];do r.push(parseDefinition(e));while(!skip(e,_lexer.TokenKind.EOF));return{kind:_kinds.DOCUMENT,definitions:r,loc:loc(e,n)}}function parseDefinition(e){if(peek(e,_lexer.TokenKind.BRACE_L))return parseOperationDefinition(e);if(peek(e,_lexer.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return parseOperationDefinition(e);case"fragment":return parseFragmentDefinition(e);case"type":case"interface":case"union":case"scalar":case"enum":case"input":return parseTypeDefinition(e);case"extend":return parseTypeExtensionDefinition(e)}throw unexpected(e)}function parseOperationDefinition(e){var n=e.token.start;if(peek(e,_lexer.TokenKind.BRACE_L))return{kind:_kinds.OPERATION_DEFINITION,operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:parseSelectionSet(e),loc:loc(e,n)};var r=expect(e,_lexer.TokenKind.NAME),t="mutation"===r.value?"mutation":"subscription"===r.value?"subscription":"query"===r.value?"query":function(){throw unexpected(e,r)}(),a=void 0;return peek(e,_lexer.TokenKind.NAME)&&(a=parseName(e)),{kind:_kinds.OPERATION_DEFINITION,operation:t,name:a,variableDefinitions:parseVariableDefinitions(e),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseVariableDefinitions(e){
return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseVariableDefinition,_lexer.TokenKind.PAREN_R):[]}function parseVariableDefinition(e){var n=e.token.start;return{kind:_kinds.VARIABLE_DEFINITION,variable:parseVariable(e),type:(expect(e,_lexer.TokenKind.COLON),parseType(e)),defaultValue:skip(e,_lexer.TokenKind.EQUALS)?parseValueLiteral(e,!0):null,loc:loc(e,n)}}function parseVariable(e){var n=e.token.start;return expect(e,_lexer.TokenKind.DOLLAR),{kind:_kinds.VARIABLE,name:parseName(e),loc:loc(e,n)}}function parseSelectionSet(e){var n=e.token.start;return{kind:_kinds.SELECTION_SET,selections:many(e,_lexer.TokenKind.BRACE_L,parseSelection,_lexer.TokenKind.BRACE_R),loc:loc(e,n)}}function parseSelection(e){return peek(e,_lexer.TokenKind.SPREAD)?parseFragment(e):parseField(e)}function parseField(e){var n=e.token.start,r=parseName(e),t=void 0,a=void 0;return skip(e,_lexer.TokenKind.COLON)?(t=r,a=parseName(e)):(t=null,a=r),{kind:_kinds.FIELD,alias:t,name:a,arguments:parseArguments(e),directives:parseDirectives(e),selectionSet:peek(e,_lexer.TokenKind.BRACE_L)?parseSelectionSet(e):null,loc:loc(e,n)}}function parseArguments(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseArgument,_lexer.TokenKind.PAREN_R):[]}function parseArgument(e){var n=e.token.start;return{kind:_kinds.ARGUMENT,name:parseName(e),value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,!1)),loc:loc(e,n)}}function parseFragment(e){var n=e.token.start;if(expect(e,_lexer.TokenKind.SPREAD),peek(e,_lexer.TokenKind.NAME)&&"on"!==e.token.value)return{kind:_kinds.FRAGMENT_SPREAD,name:parseFragmentName(e),directives:parseDirectives(e),loc:loc(e,n)};var r=null;return"on"===e.token.value&&(advance(e),r=parseNamedType(e)),{kind:_kinds.INLINE_FRAGMENT,typeCondition:r,directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseFragmentDefinition(e){var n=e.token.start;return expectKeyword(e,"fragment"),{kind:_kinds.FRAGMENT_DEFINITION,name:parseFragmentName(e),typeCondition:(expectKeyword(e,"on"),parseNamedType(e)),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseFragmentName(e){if("on"===e.token.value)throw unexpected(e);return parseName(e)}function parseValueLiteral(e,n){var r=e.token;switch(r.kind){case _lexer.TokenKind.BRACKET_L:return parseList(e,n);case _lexer.TokenKind.BRACE_L:return parseObject(e,n);case _lexer.TokenKind.INT:return advance(e),{kind:_kinds.INT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.FLOAT:return advance(e),{kind:_kinds.FLOAT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.STRING:return advance(e),{kind:_kinds.STRING,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.NAME:if("true"===r.value||"false"===r.value)return advance(e),{kind:_kinds.BOOLEAN,value:"true"===r.value,loc:loc(e,r.start)};if("null"!==r.value)return advance(e),{kind:_kinds.ENUM,value:r.value,loc:loc(e,r.start)};break;case _lexer.TokenKind.DOLLAR:if(!n)return parseVariable(e)}throw unexpected(e)}function parseConstValue(e){return parseValueLiteral(e,!0)}function parseValueValue(e){return parseValueLiteral(e,!1)}function parseList(e,n){var r=e.token.start,t=n?parseConstValue:parseValueValue;return{kind:_kinds.LIST,values:any(e,_lexer.TokenKind.BRACKET_L,t,_lexer.TokenKind.BRACKET_R),loc:loc(e,r)}}function parseObject(e,n){var r=e.token.start;expect(e,_lexer.TokenKind.BRACE_L);for(var t=[];!skip(e,_lexer.TokenKind.BRACE_R);)t.push(parseObjectField(e,n));return{kind:_kinds.OBJECT,fields:t,loc:loc(e,r)}}function parseObjectField(e,n){var r=e.token.start;return{kind:_kinds.OBJECT_FIELD,name:parseName(e),value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,n)),loc:loc(e,r)}}function parseDirectives(e){for(var n=[];peek(e,_lexer.TokenKind.AT);)n.push(parseDirective(e));return n}function parseDirective(e){var n=e.token.start;return expect(e,_lexer.TokenKind.AT),{kind:_kinds.DIRECTIVE,name:parseName(e),arguments:parseArguments(e),loc:loc(e,n)}}function parseType(e){var n=e.token.start,r=void 0;return skip(e,_lexer.TokenKind.BRACKET_L)?(r=parseType(e),expect(e,_lexer.TokenKind.BRACKET_R),r={kind:_kinds.LIST_TYPE,type:r,loc:loc(e,n)}):r=parseNamedType(e),skip(e,_lexer.TokenKind.BANG)?{kind:_kinds.NON_NULL_TYPE,type:r,loc:loc(e,n)}:r}function parseNamedType(e){var n=e.token.start;return{kind:_kinds.NAMED_TYPE,name:parseName(e),loc:loc(e,n)}}function parseTypeDefinition(e){if(!peek(e,_lexer.TokenKind.NAME))throw unexpected(e);switch(e.token.value){case"type":return parseObjectTypeDefinition(e);case"interface":return parseInterfaceTypeDefinition(e);case"union":return parseUnionTypeDefinition(e);case"scalar":return parseScalarTypeDefinition(e);case"enum":return parseEnumTypeDefinition(e);case"input":return parseInputObjectTypeDefinition(e);default:throw unexpected(e)}}function parseObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"type");var r=parseName(e),t=parseImplementsInterfaces(e),a=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.OBJECT_TYPE_DEFINITION,name:r,interfaces:t,fields:a,loc:loc(e,n)}}function parseImplementsInterfaces(e){var n=[];if("implements"===e.token.value){advance(e);do n.push(parseNamedType(e));while(!peek(e,_lexer.TokenKind.BRACE_L))}return n}function parseFieldDefinition(e){var n=e.token.start,r=parseName(e),t=parseArgumentDefs(e);expect(e,_lexer.TokenKind.COLON);var a=parseType(e);return{kind:_kinds.FIELD_DEFINITION,name:r,arguments:t,type:a,loc:loc(e,n)}}function parseArgumentDefs(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseInputValueDef,_lexer.TokenKind.PAREN_R):[]}function parseInputValueDef(e){var n=e.token.start,r=parseName(e);expect(e,_lexer.TokenKind.COLON);var t=parseType(e),a=null;return skip(e,_lexer.TokenKind.EQUALS)&&(a=parseConstValue(e)),{kind:_kinds.INPUT_VALUE_DEFINITION,name:r,type:t,defaultValue:a,loc:loc(e,n)}}function parseInterfaceTypeDefinition(e){var n=e.token.start;expectKeyword(e,"interface");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INTERFACE_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseUnionTypeDefinition(e){var n=e.token.start;expectKeyword(e,"union");var r=parseName(e);expect(e,_lexer.TokenKind.EQUALS);var t=parseUnionMembers(e);return{kind:_kinds.UNION_TYPE_DEFINITION,name:r,types:t,loc:loc(e,n)}}function parseUnionMembers(e){var n=[];do n.push(parseNamedType(e));while(skip(e,_lexer.TokenKind.PIPE));return n}function parseScalarTypeDefinition(e){var n=e.token.start;expectKeyword(e,"scalar");var r=parseName(e);return{kind:_kinds.SCALAR_TYPE_DEFINITION,name:r,loc:loc(e,n)}}function parseEnumTypeDefinition(e){var n=e.token.start;expectKeyword(e,"enum");var r=parseName(e),t=many(e,_lexer.TokenKind.BRACE_L,parseEnumValueDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.ENUM_TYPE_DEFINITION,name:r,values:t,loc:loc(e,n)}}function parseEnumValueDefinition(e){var n=e.token.start,r=parseName(e);return{kind:_kinds.ENUM_VALUE_DEFINITION,name:r,loc:loc(e,n)}}function parseInputObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"input");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseInputValueDef,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INPUT_OBJECT_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseTypeExtensionDefinition(e){var n=e.token.start;expectKeyword(e,"extend");var r=parseObjectTypeDefinition(e);return{kind:_kinds.TYPE_EXTENSION_DEFINITION,definition:r,loc:loc(e,n)}}function makeParser(e,n){var r=(0,_lexer.lex)(e);return{_lexToken:r,source:e,options:n,prevEnd:0,token:r()}}function loc(e,n){return e.options.noLocation?null:e.options.noSource?{start:n,end:e.prevEnd}:{start:n,end:e.prevEnd,source:e.source}}function advance(e){var n=e.token.end;e.prevEnd=n,e.token=e._lexToken(n)}function peek(e,n){return e.token.kind===n}function skip(e,n){var r=e.token.kind===n;return r&&advance(e),r}function expect(e,n){var r=e.token;if(r.kind===n)return advance(e),r;throw(0,_error.syntaxError)(e.source,r.start,"Expected "+(0,_lexer.getTokenKindDesc)(n)+", found "+(0,_lexer.getTokenDesc)(r))}function expectKeyword(e,n){var r=e.token;if(r.kind===_lexer.TokenKind.NAME&&r.value===n)return advance(e),r;throw(0,_error.syntaxError)(e.source,r.start,'Expected "'+n+'", found '+(0,_lexer.getTokenDesc)(r))}function unexpected(e,n){var r=n||e.token;return(0,_error.syntaxError)(e.source,r.start,"Unexpected "+(0,_lexer.getTokenDesc)(r))}function any(e,n,r,t){expect(e,n);for(var a=[];!skip(e,t);)a.push(r(e));return a}function many(e,n,r,t){expect(e,n);for(var a=[r(e)];!skip(e,t);)a.push(r(e));return a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.parse=parse,exports.parseValue=parseValue,exports.parseConstValue=parseConstValue,exports.parseType=parseType,exports.parseNamedType=parseNamedType;var _source=require("./source"),_error=require("../error"),_lexer=require("./lexer"),_kinds=require("./kinds")},{"../error":135,"./kinds":149,"./lexer":150,"./source":154}],153:[function(require,module,exports){"use strict";function print(n){return(0,_visitor.visit)(n,{leave:printDocASTReducer})}function join(n,e){return n?n.filter(function(n){return n}).join(e||""):""}function block(n){return length(n)?indent("{\n"+join(n,"\n"))+"\n}":""}function wrap(n,e,i){return e?n+e+(i||""):""}function indent(n){return n&&n.replace(/\n/g,"\n  ")}function length(n){return n?n.length:0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.print=print;var _visitor=require("./visitor"),printDocASTReducer={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return join(n.definitions,"\n\n")+"\n"},OperationDefinition:function(n){var e=n.operation,i=n.name,t=wrap("(",join(n.variableDefinitions,", "),")"),r=join(n.directives," "),u=n.selectionSet;return i?join([e,join([i,t]),r,u]," "):u},VariableDefinition:function(n){var e=n.variable,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},SelectionSet:function(n){var e=n.selections;return block(e)},Field:function(n){var e=n.alias,i=n.name,t=n.arguments,r=n.directives,u=n.selectionSet;return join([wrap("",e,": ")+i+wrap("(",join(t,", "),")"),join(r," "),u]," ")},Argument:function(n){var e=n.name,i=n.value;return e+": "+i},FragmentSpread:function(n){var e=n.name,i=n.directives;return"..."+e+wrap(" ",join(i," "))},InlineFragment:function(n){var e=n.typeCondition,i=n.directives,t=n.selectionSet;return join(["...",wrap("on ",e),join(i," "),t]," ")},FragmentDefinition:function(n){var e=n.name,i=n.typeCondition,t=n.directives,r=n.selectionSet;return"fragment "+e+" on "+i+" "+wrap("",join(t," ")," ")+r},IntValue:function(n){var e=n.value;return e},FloatValue:function(n){var e=n.value;return e},StringValue:function(n){var e=n.value;return JSON.stringify(e)},BooleanValue:function(n){var e=n.value;return JSON.stringify(e)},EnumValue:function(n){var e=n.value;return e},ListValue:function(n){var e=n.values;return"["+join(e,", ")+"]"},ObjectValue:function(n){var e=n.fields;return"{"+join(e,", ")+"}"},ObjectField:function(n){var e=n.name,i=n.value;return e+": "+i},Directive:function(n){var e=n.name,i=n.arguments;return"@"+e+wrap("(",join(i,", "),")")},NamedType:function(n){var e=n.name;return e},ListType:function(n){var e=n.type;return"["+e+"]"},NonNullType:function(n){var e=n.type;return e+"!"},ObjectTypeDefinition:function(n){var e=n.name,i=n.interfaces,t=n.fields;return"type "+e+" "+wrap("implements ",join(i,", ")," ")+block(t)},FieldDefinition:function(n){var e=n.name,i=n.arguments,t=n.type;return e+wrap("(",join(i,", "),")")+": "+t},InputValueDefinition:function(n){var e=n.name,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},InterfaceTypeDefinition:function(n){var e=n.name,i=n.fields;return"interface "+e+" "+block(i)},UnionTypeDefinition:function(n){var e=n.name,i=n.types;return"union "+e+" = "+join(i," | ")},ScalarTypeDefinition:function(n){var e=n.name;return"scalar "+e},EnumTypeDefinition:function(n){var e=n.name,i=n.values;return"enum "+e+" "+block(i)},EnumValueDefinition:function(n){var e=n.name;return e},InputObjectTypeDefinition:function(n){var e=n.name,i=n.fields;return"input "+e+" "+block(i)},TypeExtensionDefinition:function(n){var e=n.definition;return"extend "+e}}},{"./visitor":155}],154:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var Source=function e(r,s){_classCallCheck(this,e),this.body=r,this.name=s||"GraphQL"};exports.Source=Source},{"babel-runtime/helpers/class-call-check":27}],155:[function(require,module,exports){"use strict";function visit(e,i,n){var t=n||QueryDocumentKeys,r=void 0,a=Array.isArray(e),o=[e],l=-1,s=[],u=void 0,f=[],v=[],p=e;do{l++;var d=l===o.length,y=void 0,c=void 0,m=d&&0!==s.length;if(d){if(y=0===v.length?void 0:f.pop(),c=u,u=v.pop(),m){if(a)c=c.slice();else{var g={};for(var A in c)c.hasOwnProperty(A)&&(g[A]=c[A]);c=g}for(var D=0,h=0;h<s.length;h++){var V=_slicedToArray(s[h],1),T=V[0],E=_slicedToArray(s[h],2),F=E[1];a&&(T-=D),a&&null===F?(c.splice(T,1),D++):c[T]=F}}l=r.index,o=r.keys,s=r.edits,a=r.inArray,r=r.prev}else{if(y=u?a?l:o[l]:void 0,c=u?u[y]:p,null===c||void 0===c)continue;u&&f.push(y)}var b=void 0;if(!Array.isArray(c)){if(!isNode(c))throw new Error("Invalid AST Node: "+JSON.stringify(c));var I=getVisitFn(i,c.kind,d);if(I){if(b=I.call(i,c,y,u,f,v),b===BREAK)break;if(b===!1){if(!d){f.pop();continue}}else if(void 0!==b&&(s.push([y,b]),!d)){if(!isNode(b)){f.pop();continue}c=b}}}void 0===b&&m&&s.push([y,c]),d||(r={inArray:a,index:l,keys:o,edits:s,prev:r},a=Array.isArray(c),o=a?c:t[c.kind]||[],l=-1,s=[],u&&v.push(u),u=c)}while(void 0!==r);return 0!==s.length&&(p=s[0][1]),p}function isNode(e){return e&&"string"==typeof e.kind}function visitInParallel(e){var i=new Array(e.length);return{enter:function(n){for(var t=0;t<e.length;t++)if(!i[t]){var r=getVisitFn(e[t],n.kind,!1);if(r){var a=r.apply(e[t],arguments);if(a===!1)i[t]=n;else if(a===BREAK)i[t]=BREAK;else if(void 0!==a)return a}}},leave:function(n){for(var t=0;t<e.length;t++)if(i[t])i[t]===n&&(i[t]=null);else{var r=getVisitFn(e[t],n.kind,!0);if(r){var a=r.apply(e[t],arguments);if(a===BREAK)i[t]=BREAK;else if(void 0!==a&&a!==!1)return a}}}}}function visitWithTypeInfo(e,i){return{enter:function(n){e.enter(n);var t=getVisitFn(i,n.kind,!1);if(t){var r=t.apply(i,arguments);return void 0!==r&&(e.leave(n),isNode(r)&&e.enter(r)),r}},leave:function(n){var t=getVisitFn(i,n.kind,!0),r=void 0;return t&&(r=t.apply(i,arguments)),e.leave(n),r}}}function getVisitFn(e,i,n){var t=e[i];if(t){if(!n&&"function"==typeof t)return t;var r=n?t.leave:t.enter;if("function"==typeof r)return r}else{var a=n?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[i];if("function"==typeof o)return o}}}var _slicedToArray=require("babel-runtime/helpers/sliced-to-array").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.visit=visit,exports.visitInParallel=visitInParallel,exports.visitWithTypeInfo=visitWithTypeInfo;var QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],ObjectTypeDefinition:["name","interfaces","fields"],FieldDefinition:["name","arguments","type"],InputValueDefinition:["name","type","defaultValue"],InterfaceTypeDefinition:["name","fields"],UnionTypeDefinition:["name","types"],ScalarTypeDefinition:["name"],EnumTypeDefinition:["name","values"],EnumValueDefinition:["name"],InputObjectTypeDefinition:["name","fields"],TypeExtensionDefinition:["definition"]};exports.QueryDocumentKeys=QueryDocumentKeys;var BREAK={};exports.BREAK=BREAK},{"babel-runtime/helpers/sliced-to-array":34}],156:[function(require,module,exports){"use strict";function isType(e){return e instanceof GraphQLScalarType||e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType||e instanceof GraphQLEnumType||e instanceof GraphQLInputObjectType||e instanceof GraphQLList||e instanceof GraphQLNonNull}function isInputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType||t instanceof GraphQLInputObjectType}function isOutputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLObjectType||t instanceof GraphQLInterfaceType||t instanceof GraphQLUnionType||t instanceof GraphQLEnumType}function isLeafType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType}function isCompositeType(e){return e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function isAbstractType(e){return e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function getNullableType(e){return e instanceof GraphQLNonNull?e.ofType:e}function getNamedType(e){for(var t=e;t instanceof GraphQLList||t instanceof GraphQLNonNull;)t=t.ofType;return t}function resolveMaybeThunk(e){return"function"==typeof e?e():e}function defineInterfaces(e,t){var n=resolveMaybeThunk(t);return n?((0,_jsutilsInvariant2.default)(Array.isArray(n),e+" interfaces must be an Array or a function which returns an Array."),n.forEach(function(t){(0,_jsutilsInvariant2.default)(t instanceof GraphQLInterfaceType,e+" may only implement Interface types, it cannot "+("implement: "+t+".")),"function"!=typeof t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof e.isTypeOf,"Interface Type "+t+' does not provide a "resolveType" function '+("and implementing Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this implementing type during execution.")}),n):[]}function defineFieldMap(e,t){var n=resolveMaybeThunk(t);(0,_jsutilsInvariant2.default)(isPlainObj(n),e+" fields must be an object with field names as keys or a function which returns such an object.");var a=_Object$keys(n);(0,_jsutilsInvariant2.default)(a.length>0,e+" fields must be an object with field names as keys or a function which returns such an object.");var s={};return a.forEach(function(t){assertValidName(t);var a=_extends({},n[t],{name:t});(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+t+' should provide "deprecationReason" instead of "isDeprecated".'),(0,_jsutilsInvariant2.default)(isOutputType(a.type),e+"."+t+" field type must be Output Type but "+("got: "+a.type+".")),a.args?((0,_jsutilsInvariant2.default)(isPlainObj(a.args),e+"."+t+" args must be an object with argument names as keys."),a.args=_Object$keys(a.args).map(function(n){assertValidName(n);var s=a.args[n];return(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+t+"("+n+":) argument type must be "+("Input Type but got: "+s.type+".")),{name:n,description:void 0===s.description?null:s.description,type:s.type,defaultValue:void 0===s.defaultValue?null:s.defaultValue}})):a.args=[],s[t]=a}),s}function isPlainObj(e){return e&&"object"==typeof e&&!Array.isArray(e)}function addImplementationToInterfaces(e){e.getInterfaces().forEach(function(t){t._implementations.push(e)})}function getTypeOf(e,t,n){for(var a=n.getPossibleTypes(),s=0;s<a.length;s++){var i=a[s];if("function"==typeof i.isTypeOf&&i.isTypeOf(e,t))return i}}function defineEnumValues(e,t){(0,_jsutilsInvariant2.default)(isPlainObj(t),e+" values must be an object with value names as keys.");var n=_Object$keys(t);return(0,_jsutilsInvariant2.default)(n.length>0,e+" values must be an object with value names as keys."),n.map(function(n){assertValidName(n);var a=t[n];return(0,_jsutilsInvariant2.default)(isPlainObj(a),e+"."+n+' must refer to an object with a "value" key '+("representing an internal value but got: "+a+".")),(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+n+' should provide "deprecationReason" instead of "isDeprecated".'),{name:n,description:a.description,deprecationReason:a.deprecationReason,value:(0,_jsutilsIsNullish2.default)(a.value)?n:a.value}})}function assertValidName(e){(0,_jsutilsInvariant2.default)(NAME_RX.test(e),'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'+e+'" does not.')}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_extends=require("babel-runtime/helpers/extends").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isType=isType,exports.isInputType=isInputType,exports.isOutputType=isOutputType,exports.isLeafType=isLeafType,exports.isCompositeType=isCompositeType,exports.isAbstractType=isAbstractType,exports.getNullableType=getNullableType,exports.getNamedType=getNamedType;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_languageKinds=require("../language/kinds"),GraphQLScalarType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,(0,_jsutilsInvariant2.default)("function"==typeof t.serialize,this+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(t.parseValue||t.parseLiteral)&&(0,_jsutilsInvariant2.default)("function"==typeof t.parseValue&&"function"==typeof t.parseLiteral,this+' must provide both "parseValue" and "parseLiteral" functions.'),this._scalarConfig=t}return _createClass(e,[{key:"serialize",value:function(e){var t=this._scalarConfig.serialize;return t(e)}},{key:"parseValue",value:function(e){var t=this._scalarConfig.parseValue;return t?t(e):null}},{key:"parseLiteral",value:function(e){var t=this._scalarConfig.parseLiteral;return t?t(e):null}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLScalarType=GraphQLScalarType;var GraphQLObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.isTypeOf&&(0,_jsutilsInvariant2.default)("function"==typeof t.isTypeOf,this+' must provide "isTypeOf" as a function.'),this.isTypeOf=t.isTypeOf,this._typeConfig=t,addImplementationToInterfaces(this)}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getInterfaces",value:function(){return this._interfaces||(this._interfaces=defineInterfaces(this,this._typeConfig.interfaces))}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLObjectType=GraphQLObjectType;var GraphQLInterfaceType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,this._typeConfig=t,this._implementations=[]}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getPossibleTypes",value:function(){return this._implementations}},{key:"isPossibleType",value:function(e){var t=this._possibleTypes||(this._possibleTypes=(0,_jsutilsKeyMap2.default)(this.getPossibleTypes(),function(e){return e.name}));return Boolean(t[e.name])}},{key:"getObjectType",value:function(e,t){var n=this.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInterfaceType=GraphQLInterfaceType;var GraphQLUnionType=function(){function e(t){var n=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,(0,_jsutilsInvariant2.default)(Array.isArray(t.types)&&t.types.length>0,"Must provide Array of types for Union "+t.name+"."),t.types.forEach(function(e){(0,_jsutilsInvariant2.default)(e instanceof GraphQLObjectType,n+" may only contain Object types, it cannot contain: "+e+"."),"function"!=typeof n.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof e.isTypeOf,"Union Type "+n+' does not provide a "resolveType" function '+("and possible Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this possible type during execution.")}),this._types=t.types,this._typeConfig=t}return _createClass(e,[{key:"getPossibleTypes",value:function(){return this._types}},{key:"isPossibleType",value:function(e){var t=this._possibleTypeNames;return t||(this._possibleTypeNames=t=this.getPossibleTypes().reduce(function(e,t){return e[t.name]=!0,e},{})),t[e.name]===!0}},{key:"getObjectType",value:function(e,t){var n=this._typeConfig.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLUnionType=GraphQLUnionType;var GraphQLEnumType=function(){function e(t){_classCallCheck(this,e),this.name=t.name,assertValidName(t.name),this.description=t.description,this._values=defineEnumValues(this,t.values),this._enumConfig=t}return _createClass(e,[{key:"getValues",value:function(){return this._values}},{key:"serialize",value:function(e){var t=this._getValueLookup().get(e);return t?t.name:null}},{key:"parseValue",value:function(e){if("string"==typeof e){var t=this._getNameLookup()[e];if(t)return t.value}}},{key:"parseLiteral",value:function(e){if(e.kind===_languageKinds.ENUM){var t=this._getNameLookup()[e.value];if(t)return t.value}}},{key:"_getValueLookup",value:function(){var e=this;return this._valueLookup||!function(){var t=new _Map;e.getValues().forEach(function(e){t.set(e.value,e)}),e._valueLookup=t}(),this._valueLookup}},{key:"_getNameLookup",value:function(){var e=this;return this._nameLookup||!function(){var t=_Object$create(null);e.getValues().forEach(function(e){t[e.name]=e}),e._nameLookup=t}(),this._nameLookup}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLEnumType=GraphQLEnumType;var GraphQLInputObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,this._typeConfig=t}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=this._defineFieldMap())}},{key:"_defineFieldMap",value:function(){var e=this,t=resolveMaybeThunk(this._typeConfig.fields);(0,_jsutilsInvariant2.default)(isPlainObj(t),this+" fields must be an object with field names as keys or a function which returns such an object.");var n=_Object$keys(t);(0,_jsutilsInvariant2.default)(n.length>0,this+" fields must be an object with field names as keys or a function which returns such an object.");var a={};return n.forEach(function(n){assertValidName(n);var s=_extends({},t[n],{name:n});(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+n+" field type must be Input Type but "+("got: "+s.type+".")),a[n]=s}),a}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInputObjectType=GraphQLInputObjectType;var GraphQLList=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t),"Can only create List of a GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return"["+String(this.ofType)+"]"}}]),e}();exports.GraphQLList=GraphQLList;var GraphQLNonNull=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t)&&!(t instanceof e),"Can only create NonNull of a Nullable GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return this.ofType.toString()+"!"}}]),e}();exports.GraphQLNonNull=GraphQLNonNull;var NAME_RX=/^[_a-zA-Z][_a-zA-Z0-9]*$/},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../jsutils/keyMap":146,"../language/kinds":149,"babel-runtime/core-js/map":18,"babel-runtime/core-js/object/create":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/create-class":28,"babel-runtime/helpers/extends":29,"babel-runtime/helpers/interop-require-default":32}],157:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_scalars=require("./scalars"),GraphQLDirective=function e(i){_classCallCheck(this,e),this.name=i.name,this.description=i.description,this.args=i.args||[],this.onOperation=Boolean(i.onOperation),this.onFragment=Boolean(i.onFragment),this.onField=Boolean(i.onField)};exports.GraphQLDirective=GraphQLDirective;var GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Included when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLIncludeDirective=GraphQLIncludeDirective;var GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Skipped when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLSkipDirective=GraphQLSkipDirective},{"./definition":156,"./scalars":160,"babel-runtime/helpers/class-call-check":27}],158:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _schema=require("./schema");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _schema.GraphQLSchema}});var _definition=require("./definition");Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _definition.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _definition.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _definition.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _definition.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _definition.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _definition.isAbstractType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _definition.getNullableType}}),Object.defineProperty(exports,"getNamedType",{
enumerable:!0,get:function(){return _definition.getNamedType}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _definition.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _definition.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _definition.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _definition.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _definition.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _definition.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _definition.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _definition.GraphQLNonNull}});var _scalars=require("./scalars");Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _scalars.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _scalars.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _scalars.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _scalars.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _scalars.GraphQLID}})},{"./definition":156,"./scalars":160,"./schema":161}],159:[function(require,module,exports){"use strict";var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_definition=require("./definition"),_scalars=require("./scalars"),__Schema=new _definition.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{types:{description:"A list of all types supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))),resolve:function(e){var i=e.getTypeMap();return _Object$keys(i).map(function(e){return i[e]})}},queryType:{description:"The type that query operations will be rooted at.",type:new _definition.GraphQLNonNull(__Type),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:function(e){return e.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:function(e){return e.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))),resolve:function(e){return e.getDirectives()}}}}});exports.__Schema=__Schema;var __Directive=new _definition.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL’s execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},onOperation:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onFragment:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onField:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)}}}}),__Type=new _definition.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new _definition.GraphQLNonNull(__TypeKind),resolve:function(e){if(e instanceof _definition.GraphQLScalarType)return TypeKind.SCALAR;if(e instanceof _definition.GraphQLObjectType)return TypeKind.OBJECT;if(e instanceof _definition.GraphQLInterfaceType)return TypeKind.INTERFACE;if(e instanceof _definition.GraphQLUnionType)return TypeKind.UNION;if(e instanceof _definition.GraphQLEnumType)return TypeKind.ENUM;if(e instanceof _definition.GraphQLInputObjectType)return TypeKind.INPUT_OBJECT;if(e instanceof _definition.GraphQLList)return TypeKind.LIST;if(e instanceof _definition.GraphQLNonNull)return TypeKind.NON_NULL;throw new Error("Unknown kind of type: "+e)}},name:{type:_scalars.GraphQLString},description:{type:_scalars.GraphQLString},fields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLObjectType||e instanceof _definition.GraphQLInterfaceType){var t=function(){var i=e.getFields(),t=_Object$keys(i).map(function(e){return i[e]});return n||(t=t.filter(function(e){return!e.deprecationReason})),{v:t}}();if("object"==typeof t)return t.v}return null}},interfaces:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLObjectType?e.getInterfaces():void 0}},possibleTypes:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLInterfaceType||e instanceof _definition.GraphQLUnionType?e.getPossibleTypes():void 0}},enumValues:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLEnumType){var t=e.getValues();return n||(t=t.filter(function(e){return!e.deprecationReason})),t}}},inputFields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)),resolve:function(e){if(e instanceof _definition.GraphQLInputObjectType){var i=function(){var i=e.getFields();return{v:_Object$keys(i).map(function(e){return i[e]})}}();if("object"==typeof i)return i.v}}},ofType:{type:__Type}}}}),__Field=new _definition.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},type:{type:new _definition.GraphQLNonNull(__Type)},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),__InputValue=new _definition.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},type:{type:new _definition.GraphQLNonNull(__Type)},defaultValue:{type:_scalars.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(e){return(0,_jsutilsIsNullish2.default)(e.defaultValue)?null:(0,_languagePrinter.print)((0,_utilitiesAstFromValue.astFromValue)(e.defaultValue,e))}}}}}),__EnumValue=new _definition.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),TypeKind={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"};exports.TypeKind=TypeKind;var __TypeKind=new _definition.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new _definition.GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:function(e,i,n){var t=n.schema;return t}};exports.SchemaMetaFieldDef=SchemaMetaFieldDef;var TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",type:new _definition.GraphQLNonNull(_scalars.GraphQLString)}],resolve:function(e,i,n){var t=i.name,r=n.schema;return function(){return r.getType(t)}()}};exports.TypeMetaFieldDef=TypeMetaFieldDef;var TypeNameMetaFieldDef={name:"__typename",type:new _definition.GraphQLNonNull(_scalars.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,i,n){var t=n.parentType;return t.name}};exports.TypeNameMetaFieldDef=TypeNameMetaFieldDef},{"../jsutils/isNullish":145,"../language/printer":153,"../utilities/astFromValue":163,"./definition":156,"./scalars":160,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32}],160:[function(require,module,exports){"use strict";function coerceInt(e){var a=Number(e);return a===a&&MAX_INT>=a&&a>=MIN_INT?(0>a?Math.ceil:Math.floor)(a):null}function coerceFloat(e){var a=Number(e);return a===a?a:null}Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_language=require("../language"),MAX_INT=2147483647,MIN_INT=-2147483648,GraphQLInt=new _definition.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ",serialize:coerceInt,parseValue:coerceInt,parseLiteral:function(e){if(e.kind===_language.Kind.INT){var a=parseInt(e.value,10);if(MAX_INT>=a&&a>=MIN_INT)return a}return null}});exports.GraphQLInt=GraphQLInt;var GraphQLFloat=new _definition.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ",serialize:coerceFloat,parseValue:coerceFloat,parseLiteral:function(e){return e.kind===_language.Kind.FLOAT||e.kind===_language.Kind.INT?parseFloat(e.value):null}});exports.GraphQLFloat=GraphQLFloat;var GraphQLString=new _definition.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING?e.value:null}});exports.GraphQLString=GraphQLString;var GraphQLBoolean=new _definition.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Boolean,parseValue:Boolean,parseLiteral:function(e){return e.kind===_language.Kind.BOOLEAN?e.value:null}});exports.GraphQLBoolean=GraphQLBoolean;var GraphQLID=new _definition.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING||e.kind===_language.Kind.INT?e.value:null}});exports.GraphQLID=GraphQLID},{"../language":148,"./definition":156}],161:[function(require,module,exports){"use strict";function typeMapReducer(e,t){for(var i=!0;i;){var r=e,n=t;if(a=void 0,i=!1,!n)return r;if(!(n instanceof _definition.GraphQLList||n instanceof _definition.GraphQLNonNull)){if(r[n.name])return(0,_jsutilsInvariant2.default)(r[n.name]===n,"Schema must contain unique named types but contains multiple "+('types named "'+n+'".')),r;r[n.name]=n;var a=r;return(n instanceof _definition.GraphQLUnionType||n instanceof _definition.GraphQLInterfaceType)&&(a=n.getPossibleTypes().reduce(typeMapReducer,a)),n instanceof _definition.GraphQLObjectType&&(a=n.getInterfaces().reduce(typeMapReducer,a)),(n instanceof _definition.GraphQLObjectType||n instanceof _definition.GraphQLInterfaceType||n instanceof _definition.GraphQLInputObjectType)&&!function(){var e=n.getFields();_Object$keys(e).forEach(function(t){var i=e[t];if(i.args){var r=i.args.map(function(e){return e.type});a=r.reduce(typeMapReducer,a)}a=typeMapReducer(a,i.type)})}(),a}e=r,t=n.ofType,i=!0}}function assertObjectImplementsInterface(e,t){var i=e.getFields(),r=t.getFields();_Object$keys(r).forEach(function(n){var a=i[n],s=r[n];(0,_jsutilsInvariant2.default)(a,'"'+t+'" expects field "'+n+'" but "'+e+'" does not provide it.'),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isTypeSubTypeOf)(a.type,s.type),t+"."+n+' expects type "'+s.type+'" but '+(e+"."+n+' provides type "'+a.type+'".')),s.args.forEach(function(i){var r=i.name,s=(0,_jsutilsFind2.default)(a.args,function(e){return e.name===r});(0,_jsutilsInvariant2.default)(s,t+"."+n+' expects argument "'+r+'" but '+(e+"."+n+" does not provide it.")),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isEqualType)(i.type,s.type),t+"."+n+"("+r+':) expects type "'+i.type+'" '+("but "+e+"."+n+"("+r+":) provides ")+('type "'+s.type+'".'))}),a.args.forEach(function(i){var r=i.name,a=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===r});a||(0,_jsutilsInvariant2.default)(!(i.type instanceof _definition.GraphQLNonNull),e+"."+n+"("+r+":) is of required type "+('"'+i.type+'" but is not also provided by the ')+("interface "+t+"."+n+"."))})})}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_directives=require("./directives"),_introspection=require("./introspection"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_utilitiesTypeComparators=require("../utilities/typeComparators"),GraphQLSchema=function(){function e(t){var i=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)("object"==typeof t,"Must provide configuration object."),(0,_jsutilsInvariant2.default)(t.query instanceof _definition.GraphQLObjectType,"Schema query must be Object Type but got: "+t.query+"."),this._queryType=t.query,(0,_jsutilsInvariant2.default)(!t.mutation||t.mutation instanceof _definition.GraphQLObjectType,"Schema mutation must be Object Type if provided but "+("got: "+t.mutation+".")),this._mutationType=t.mutation,(0,_jsutilsInvariant2.default)(!t.subscription||t.subscription instanceof _definition.GraphQLObjectType,"Schema subscription must be Object Type if provided but "+("got: "+t.subscription+".")),this._subscriptionType=t.subscription,(0,_jsutilsInvariant2.default)(!t.directives||Array.isArray(t.directives)&&t.directives.every(function(e){return e instanceof _directives.GraphQLDirective}),"Schema directives must be Array<GraphQLDirective> if provided but "+("got: "+t.directives+".")),this._directives=t.directives||[_directives.GraphQLIncludeDirective,_directives.GraphQLSkipDirective],this._typeMap=[this.getQueryType(),this.getMutationType(),this.getSubscriptionType(),_introspection.__Schema].reduce(typeMapReducer,{}),_Object$keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){return assertObjectImplementsInterface(t,e)})})}return _createClass(e,[{key:"getQueryType",value:function(){return this._queryType}},{key:"getMutationType",value:function(){return this._mutationType}},{key:"getSubscriptionType",value:function(){return this._subscriptionType}},{key:"getTypeMap",value:function(){return this._typeMap}},{key:"getType",value:function(e){return this.getTypeMap()[e]}},{key:"getDirectives",value:function(){return this._directives}},{key:"getDirective",value:function(e){return(0,_jsutilsFind2.default)(this.getDirectives(),function(t){return t.name===e})}}]),e}();exports.GraphQLSchema=GraphQLSchema},{"../jsutils/find":143,"../jsutils/invariant":144,"../utilities/typeComparators":174,"./definition":156,"./directives":157,"./introspection":159,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/create-class":28,"babel-runtime/helpers/interop-require-default":32}],162:[function(require,module,exports){"use strict";function getFieldDef(e,t,i){var n=i.name.value;return n===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.SchemaMetaFieldDef:n===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.TypeMetaFieldDef:n===_typeIntrospection.TypeNameMetaFieldDef.name&&(t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType||t instanceof _typeDefinition.GraphQLUnionType)?_typeIntrospection.TypeNameMetaFieldDef:t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType?t.getFields()[n]:void 0}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition"),_typeIntrospection=require("../type/introspection"),_typeFromAST=require("./typeFromAST"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),TypeInfo=function(){function e(t,i){_classCallCheck(this,e),this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._directive=null,this._argument=null,this._getFieldDef=i||getFieldDef}return _createClass(e,[{key:"getType",value:function(){return this._typeStack.length>0?this._typeStack[this._typeStack.length-1]:void 0}},{key:"getParentType",value:function(){return this._parentTypeStack.length>0?this._parentTypeStack[this._parentTypeStack.length-1]:void 0}},{key:"getInputType",value:function(){return this._inputTypeStack.length>0?this._inputTypeStack[this._inputTypeStack.length-1]:void 0}},{key:"getFieldDef",value:function(){return this._fieldDefStack.length>0?this._fieldDefStack[this._fieldDefStack.length-1]:void 0}},{key:"getDirective",value:function(){return this._directive}},{key:"getArgument",value:function(){return this._argument}},{key:"enter",value:function(e){var t=this._schema;switch(e.kind){case Kind.SELECTION_SET:var i=(0,_typeDefinition.getNamedType)(this.getType()),n=void 0;(0,_typeDefinition.isCompositeType)(i)&&(n=i),this._parentTypeStack.push(n);break;case Kind.FIELD:var a=this.getParentType(),p=void 0;a&&(p=this._getFieldDef(t,a,e)),this._fieldDefStack.push(p),this._typeStack.push(p&&p.type);break;case Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case Kind.OPERATION_DEFINITION:var r=void 0;"query"===e.operation?r=t.getQueryType():"mutation"===e.operation?r=t.getMutationType():"subscription"===e.operation&&(r=t.getSubscriptionType()),this._typeStack.push(r);break;case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:var s=e.typeCondition,c=s?(0,_typeFromAST.typeFromAST)(t,s):this.getType();this._typeStack.push(c);break;case Kind.VARIABLE_DEFINITION:var u=(0,_typeFromAST.typeFromAST)(t,e.type);this._inputTypeStack.push(u);break;case Kind.ARGUMENT:var o=void 0,y=void 0,_=this.getDirective()||this.getFieldDef();_&&(o=(0,_jsutilsFind2.default)(_.args,function(t){return t.name===e.name.value}),o&&(y=o.type)),this._argument=o,this._inputTypeStack.push(y);break;case Kind.LIST:var l=(0,_typeDefinition.getNullableType)(this.getInputType());this._inputTypeStack.push(l instanceof _typeDefinition.GraphQLList?l.ofType:void 0);break;case Kind.OBJECT_FIELD:var h=(0,_typeDefinition.getNamedType)(this.getInputType()),d=void 0;if(h instanceof _typeDefinition.GraphQLInputObjectType){var T=h.getFields()[e.name.value];d=T?T.type:void 0}this._inputTypeStack.push(d)}}},{key:"leave",value:function(e){switch(e.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._inputTypeStack.pop()}}}]),e}();exports.TypeInfo=TypeInfo},{"../jsutils/find":143,"../language/kinds":149,"../type/definition":156,"../type/introspection":159,"./typeFromAST":175,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/create-class":28,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/interop-require-wildcard":33}],163:[function(require,module,exports){"use strict";function astFromValue(e,i){var n=!0;e:for(;n;){var a=e,t=i;r=u=s=l=o=void 0,n=!1;var r=a;if(!(t instanceof _typeDefinition.GraphQLNonNull)){if((0,_jsutilsIsNullish2.default)(r))return null;if(Array.isArray(r)){var u=function(){var e=t instanceof _typeDefinition.GraphQLList?t.ofType:null;return{v:{kind:_languageKinds.LIST,values:r.map(function(i){var n=astFromValue(i,e);return(0,_jsutilsInvariant2.default)(n,"Could not create AST item."),n})}}}();if("object"==typeof u)return u.v}else if(t instanceof _typeDefinition.GraphQLList){e=r,i=t.ofType,n=!0;continue e}if("boolean"==typeof r)return{kind:_languageKinds.BOOLEAN,value:r};if("number"==typeof r){var s=String(r),l=/^[0-9]+$/.test(s);return l?t===_typeScalars.GraphQLFloat?{kind:_languageKinds.FLOAT,value:s+".0"}:{kind:_languageKinds.INT,value:s}:{kind:_languageKinds.FLOAT,value:s}}if("string"==typeof r)return t instanceof _typeDefinition.GraphQLEnumType&&/^[_a-zA-Z][_a-zA-Z0-9]*$/.test(r)?{kind:_languageKinds.ENUM,value:r}:{kind:_languageKinds.STRING,value:JSON.stringify(r).slice(1,-1)};(0,_jsutilsInvariant2.default)("object"==typeof r&&null!==r);var o=[];return _Object$keys(r).forEach(function(e){var i=void 0;if(t instanceof _typeDefinition.GraphQLInputObjectType){var n=t.getFields()[e];i=n&&n.type}var a=astFromValue(r[e],i);a&&o.push({kind:_languageKinds.OBJECT_FIELD,name:{kind:_languageKinds.NAME,value:e},value:a})}),{kind:_languageKinds.OBJECT,fields:o}}e=r,i=t.ofType,n=!0}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.astFromValue=astFromValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars")},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../language/kinds":149,"../type/definition":156,"../type/scalars":160,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32}],164:[function(require,module,exports){"use strict";function buildWrappedType(e,n){if(n.kind===_languageKinds.LIST_TYPE)return new _type.GraphQLList(buildWrappedType(e,n.type));if(n.kind===_languageKinds.NON_NULL_TYPE){var r=buildWrappedType(e,n.type);return(0,_jsutilsInvariant2.default)(!(r instanceof _type.GraphQLNonNull),"No nesting nonnull."),new _type.GraphQLNonNull(r)}return e}function getNamedTypeAST(e){for(var n=e;n.kind===_languageKinds.LIST_TYPE||n.kind===_languageKinds.NON_NULL_TYPE;)n=n.type;return n}function buildASTSchema(e,n,r,t){function u(e){var n=i(e.name.value);return(0,_jsutilsInvariant2.default)(n instanceof _type.GraphQLObjectType,"AST must provide object type."),n}function a(e){var n=getNamedTypeAST(e).name.value,r=i(n);return buildWrappedType(r,e)}function i(e){if(m[e])return m[e];if(!g[e])throw new Error("Type "+e+" not found in document");var n=l(g[e]);if(!n)throw new Error("Nothing constructed for "+e);return m[e]=n,n}function l(e){if(!e)throw new Error("def must be defined");switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return s(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return f(e);case _languageKinds.ENUM_TYPE_DEFINITION:return c(e);case _languageKinds.UNION_TYPE_DEFINITION:return d(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return y(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return T(e);default:throw new Error(e.kind+" not supported")}}function s(e){var n=e.name.value,r={name:n,fields:function(){return o(e)},interfaces:function(){return p(e)}};return new _type.GraphQLObjectType(r)}function o(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:a(e.type),args:_(e.arguments)}})}function p(e){return e.interfaces.map(function(e){return a(e)})}function _(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name.value},function(e){var n=a(e.type);return{type:n,defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function f(e){var n=e.name.value,r={name:n,resolveType:function(){return null},fields:function(){return o(e)}};return new _type.GraphQLInterfaceType(r)}function c(e){var n=new _type.GraphQLEnumType({name:e.name.value,values:(0,_jsutilsKeyValMap2.default)(e.values,function(e){return e.name.value},function(){return{}})});return n}function d(e){return new _type.GraphQLUnionType({name:e.name.value,resolveType:function(){return null},types:e.types.map(function(e){return a(e)})})}function y(e){return new _type.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function T(e){return new _type.GraphQLInputObjectType({name:e.name.value,fields:function(){return _(e.fields)}})}if(!e)throw new Error("must pass in ast");if(!n)throw new Error("must pass in query type");for(var I=[],E=0;E<e.definitions.length;E++){var N=e.definitions[E];switch(N.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:case _languageKinds.INTERFACE_TYPE_DEFINITION:case _languageKinds.ENUM_TYPE_DEFINITION:case _languageKinds.UNION_TYPE_DEFINITION:case _languageKinds.SCALAR_TYPE_DEFINITION:case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:I.push(N)}}var g=(0,_jsutilsKeyMap2.default)(I,function(e){return e.name.value});if(!g[n])throw new Error("Specified query type "+n+" not found in document.");if(r&&!g[r])throw new Error("Specified mutation type "+r+" not found in document.");if(t&&!g[t])throw new Error("Specified subscription type "+t+" not found in document.");var m={String:_type.GraphQLString,Int:_type.GraphQLInt,Float:_type.GraphQLFloat,Boolean:_type.GraphQLBoolean,ID:_type.GraphQLID};return I.forEach(function(e){return i(e.name.value)}),new _type.GraphQLSchema({query:u(g[n]),mutation:r?u(g[r]):null,subscription:t?u(g[t]):null})}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildASTSchema=buildASTSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageKinds=require("../language/kinds"),_type=require("../type")},{"../jsutils/invariant":144,"../jsutils/keyMap":146,"../jsutils/keyValMap":147,"../language/kinds":149,"../type":158,"./valueFromAST":176,"babel-runtime/helpers/interop-require-default":32}],165:[function(require,module,exports){"use strict";function buildClientSchema(e){function n(e){if(e.kind===_typeIntrospection.TypeKind.LIST){var r=e.ofType;if(!r)throw new Error("Decorated type deeper than introspection query.");return new _typeDefinition.GraphQLList(n(r))}if(e.kind===_typeIntrospection.TypeKind.NON_NULL){var i=e.ofType;if(!i)throw new Error("Decorated type deeper than introspection query.");var a=n(i);return(0,_jsutilsInvariant2.default)(!(a instanceof _typeDefinition.GraphQLNonNull),"No nesting nonnull."),new _typeDefinition.GraphQLNonNull(a)}return t(e.name)}function t(e){if(I[e])return I[e];var n=T[e];if(!n)throw new Error("Invalid or incomplete schema, unknown type: "+e+". Ensure that a full introspection query is used in order to build a client schema.");
var t=u(n);return I[e]=t,t}function r(e){var t=n(e);return(0,_jsutilsInvariant2.default)((0,_typeDefinition.isInputType)(t),"Introspection must provide input type for arguments."),t}function i(e){var t=n(e);return(0,_jsutilsInvariant2.default)((0,_typeDefinition.isOutputType)(t),"Introspection must provide output type for fields."),t}function a(e){var t=n(e);return(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLObjectType,"Introspection must provide object type for possibleTypes."),t}function o(e){var t=n(e);return(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLInterfaceType,"Introspection must provide interface type for interfaces."),t}function u(e){switch(e.kind){case _typeIntrospection.TypeKind.SCALAR:return p(e);case _typeIntrospection.TypeKind.OBJECT:return s(e);case _typeIntrospection.TypeKind.INTERFACE:return c(e);case _typeIntrospection.TypeKind.UNION:return l(e);case _typeIntrospection.TypeKind.ENUM:return f(e);case _typeIntrospection.TypeKind.INPUT_OBJECT:return y(e);default:throw new Error("Invalid or incomplete schema, unknown kind: "+e.kind+". Ensure that a full introspection query is used in order to build a client schema.")}}function p(e){return new _typeDefinition.GraphQLScalarType({name:e.name,description:e.description,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function s(e){return new _typeDefinition.GraphQLObjectType({name:e.name,description:e.description,interfaces:e.interfaces.map(o),fields:function(){return d(e)}})}function c(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return d(e)},resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function l(e){return new _typeDefinition.GraphQLUnionType({name:e.name,description:e.description,types:e.possibleTypes.map(a),resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function f(e){return new _typeDefinition.GraphQLEnumType({name:e.name,description:e.description,values:(0,_jsutilsKeyValMap2.default)(e.enumValues,function(e){return e.name},function(e){return{description:e.description,deprecationReason:e.deprecationReason}})})}function y(e){return new _typeDefinition.GraphQLInputObjectType({name:e.name,description:e.description,fields:function(){return _(e.inputFields)}})}function d(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name},function(e){return{description:e.description,deprecationReason:e.deprecationReason,type:i(e.type),args:_(e.args),resolve:function(){throw new Error("Client Schema cannot be used for execution.")}}})}function _(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name},m)}function m(e){var n=r(e.type),t=e.defaultValue?(0,_valueFromAST.valueFromAST)((0,_languageParser.parseValue)(e.defaultValue),n):null;return{name:e.name,description:e.description,type:n,defaultValue:t}}function h(e){return new _typeDirectives.GraphQLDirective({name:e.name,description:e.description,args:e.args.map(m),onOperation:e.onOperation,onFragment:e.onFragment,onField:e.onField})}var v=e.__schema,T=(0,_jsutilsKeyMap2.default)(v.types,function(e){return e.name}),I={String:_typeScalars.GraphQLString,Int:_typeScalars.GraphQLInt,Float:_typeScalars.GraphQLFloat,Boolean:_typeScalars.GraphQLBoolean,ID:_typeScalars.GraphQLID};v.types.forEach(function(e){return t(e.name)});var w=a(v.queryType),j=v.mutationType?a(v.mutationType):null,D=v.subscriptionType?a(v.subscriptionType):null,L=v.directives?v.directives.map(h):[];return new _typeSchema.GraphQLSchema({query:w,mutation:j,subscription:D,directives:L})}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildClientSchema=buildClientSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageParser=require("../language/parser"),_typeSchema=require("../type/schema"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars"),_typeDirectives=require("../type/directives"),_typeIntrospection=require("../type/introspection")},{"../jsutils/invariant":144,"../jsutils/keyMap":146,"../jsutils/keyValMap":147,"../language/parser":152,"../type/definition":156,"../type/directives":157,"../type/introspection":159,"../type/scalars":160,"../type/schema":161,"./valueFromAST":176,"babel-runtime/helpers/interop-require-default":32}],166:[function(require,module,exports){"use strict";function concatAST(e){for(var t=[],n=0;n<e.length;n++)for(var o=e[n].definitions,r=0;r<o.length;r++)t.push(o[r]);return{kind:"Document",definitions:t}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatAST=concatAST},{}],167:[function(require,module,exports){"use strict";function extendSchema(e,n){function r(e){var n=i(e.name);return(0,_jsutilsInvariant2.default)(n,"Invalid schema"),n}function t(e){var n=i(e.name.value);if(!n)throw new _errorGraphQLError.GraphQLError('Unknown type: "'+e.name.value+'". Ensure that this type exists either in the original schema, or is added in a type definition.',[e]);return n}function i(n){var r=O[n];if(r)return r;var t=e.getType(n);if(t){var i=a(t);return O[n]=i,i}var u=L[n];if(u){var i=f(u);return O[n]=i,i}}function a(e){return e instanceof _typeDefinition.GraphQLObjectType?u(e):e instanceof _typeDefinition.GraphQLInterfaceType?o(e):e instanceof _typeDefinition.GraphQLUnionType?s(e):e}function u(e){return new _typeDefinition.GraphQLObjectType({name:e.name,description:e.description,interfaces:function(){return p(e)},fields:function(){return c(e)}})}function o(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return c(e)},resolveType:throwClientSchemaExecutionError})}function s(e){return new _typeDefinition.GraphQLUnionType({name:e.name,description:e.description,types:e.getPossibleTypes().map(r),resolveType:throwClientSchemaExecutionError})}function p(e){var n=e.getInterfaces().map(r),i=N[e.name];return i&&i.forEach(function(r){r.definition.interfaces.forEach(function(r){var i=r.name.value;if(n.some(function(e){return e.name===i}))throw new _errorGraphQLError.GraphQLError("'Type \""+e.name+'" already implements "'+i+'". It cannot also be implemented in this type extension.',[r]);n.push(t(r))})}),n}function c(e){var n={},r=e.getFields();_Object$keys(r).forEach(function(e){var t=r[e];n[e]={description:t.description,deprecationReason:t.deprecationReason,type:l(t.type),args:(0,_jsutilsKeyMap2.default)(t.args,function(e){return e.name}),resolve:throwClientSchemaExecutionError}});var t=N[e.name];return t&&t.forEach(function(t){t.definition.fields.forEach(function(t){var i=t.name.value;if(r[i])throw new _errorGraphQLError.GraphQLError('Field "'+e.name+"."+i+'" already exists in the schema. It cannot also be defined in this type extension.',[t]);n[i]={type:g(t.type),args:v(t.arguments),resolve:throwClientSchemaExecutionError}})}),n}function l(e){return e instanceof _typeDefinition.GraphQLList?new _typeDefinition.GraphQLList(l(e.ofType)):e instanceof _typeDefinition.GraphQLNonNull?new _typeDefinition.GraphQLNonNull(l(e.ofType)):r(e)}function f(e){switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return _(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return y(e);case _languageKinds.UNION_TYPE_DEFINITION:return h(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return d(e);case _languageKinds.ENUM_TYPE_DEFINITION:return E(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return m(e)}}function _(e){return new _typeDefinition.GraphQLObjectType({name:e.name.value,interfaces:function(){return T(e)},fields:function(){return I(e)}})}function y(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name.value,fields:function(){return I(e)},resolveType:throwClientSchemaExecutionError})}function h(e){return new _typeDefinition.GraphQLUnionType({name:e.name.value,types:e.types.map(t),resolveType:throwClientSchemaExecutionError})}function d(e){return new _typeDefinition.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function E(e){return new _typeDefinition.GraphQLEnumType({name:e.name.value,values:(0,_jsutilsKeyValMap2.default)(e.values,function(e){return e.name.value},function(){return{}})})}function m(e){return new _typeDefinition.GraphQLInputObjectType({name:e.name.value,fields:function(){return v(e.fields)}})}function T(e){return e.interfaces.map(t)}function I(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:g(e.type),args:v(e.arguments),resolve:throwClientSchemaExecutionError}})}function v(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name.value},function(e){var n=g(e.type);return{type:n,defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function g(e){return e.kind===_languageKinds.LIST_TYPE?new _typeDefinition.GraphQLList(g(e.type)):e.kind===_languageKinds.NON_NULL_TYPE?new _typeDefinition.GraphQLNonNull(g(e.type)):t(e)}(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Must provide valid GraphQLSchema"),(0,_jsutilsInvariant2.default)(n&&n.kind===_languageKinds.DOCUMENT,"Must provide valid Document AST");for(var L={},N={},D=0;D<n.definitions.length;D++){var Q=n.definitions[D];switch(Q.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:case _languageKinds.INTERFACE_TYPE_DEFINITION:case _languageKinds.ENUM_TYPE_DEFINITION:case _languageKinds.UNION_TYPE_DEFINITION:case _languageKinds.SCALAR_TYPE_DEFINITION:case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:var G=Q.name.value;if(e.getType(G))throw new _errorGraphQLError.GraphQLError('Type "'+G+'" already exists in the schema. It cannot also be defined in this type definition.',[Q]);L[G]=Q;break;case _languageKinds.TYPE_EXTENSION_DEFINITION:var w=Q.definition.name.value,S=e.getType(w);if(!S)throw new _errorGraphQLError.GraphQLError('Cannot extend type "'+w+'" because it does not exist in the existing schema.',[Q.definition]);if(!(S instanceof _typeDefinition.GraphQLObjectType))throw new _errorGraphQLError.GraphQLError('Cannot extend non-object type "'+w+'".',[Q.definition]);var j=N[w];j?j.push(Q):j=[Q],N[w]=j}}if(0===_Object$keys(N).length&&0===_Object$keys(L).length)return e;var O={String:_typeScalars.GraphQLString,Int:_typeScalars.GraphQLInt,Float:_typeScalars.GraphQLFloat,Boolean:_typeScalars.GraphQLBoolean,ID:_typeScalars.GraphQLID},b=r(e.getQueryType()),K=e.getMutationType(),x=K?r(K):null,F=e.getSubscriptionType(),C=F?r(F):null;return _Object$keys(e.getTypeMap()).forEach(function(n){return r(e.getType(n))}),_Object$keys(L).forEach(function(e){return t(L[e])}),new _typeSchema.GraphQLSchema({query:b,mutation:x,subscription:C,directives:e.getDirectives()})}function throwClientSchemaExecutionError(){throw new Error("Client Schema cannot be used for execution.")}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendSchema=extendSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_errorGraphQLError=require("../error/GraphQLError"),_typeSchema=require("../type/schema"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars"),_languageKinds=require("../language/kinds")},{"../error/GraphQLError":133,"../jsutils/invariant":144,"../jsutils/keyMap":146,"../jsutils/keyValMap":147,"../language/kinds":149,"../type/definition":156,"../type/scalars":160,"../type/schema":161,"./valueFromAST":176,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32}],168:[function(require,module,exports){"use strict";function getOperationAST(e,n){for(var i=null,r=0;r<e.definitions.length;r++){var t=e.definitions[r];if(t.kind===_languageKinds.OPERATION_DEFINITION)if(n){if(t.name&&t.name.value===n)return t}else{if(i)return null;i=t}}return i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOperationAST=getOperationAST;var _languageKinds=require("../language/kinds")},{"../language/kinds":149}],169:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _introspectionQuery=require("./introspectionQuery");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _introspectionQuery.introspectionQuery}});var _getOperationAST=require("./getOperationAST");Object.defineProperty(exports,"getOperationAST",{enumerable:!0,get:function(){return _getOperationAST.getOperationAST}});var _buildClientSchema=require("./buildClientSchema");Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _buildClientSchema.buildClientSchema}});var _buildASTSchema=require("./buildASTSchema");Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _buildASTSchema.buildASTSchema}});var _extendSchema=require("./extendSchema");Object.defineProperty(exports,"extendSchema",{enumerable:!0,get:function(){return _extendSchema.extendSchema}});var _schemaPrinter=require("./schemaPrinter");Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _schemaPrinter.printSchema}}),Object.defineProperty(exports,"printIntrospectionSchema",{enumerable:!0,get:function(){return _schemaPrinter.printIntrospectionSchema}});var _typeFromAST=require("./typeFromAST");Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _typeFromAST.typeFromAST}});var _valueFromAST=require("./valueFromAST");Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _valueFromAST.valueFromAST}});var _astFromValue=require("./astFromValue");Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _astFromValue.astFromValue}});var _TypeInfo=require("./TypeInfo");Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _TypeInfo.TypeInfo}});var _isValidJSValue=require("./isValidJSValue");Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _isValidJSValue.isValidJSValue}});var _isValidLiteralValue=require("./isValidLiteralValue");Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _isValidLiteralValue.isValidLiteralValue}});var _concatAST=require("./concatAST");Object.defineProperty(exports,"concatAST",{enumerable:!0,get:function(){return _concatAST.concatAST}});var _typeComparators=require("./typeComparators");Object.defineProperty(exports,"isEqualType",{enumerable:!0,get:function(){return _typeComparators.isEqualType}}),Object.defineProperty(exports,"isTypeSubTypeOf",{enumerable:!0,get:function(){return _typeComparators.isTypeSubTypeOf}}),Object.defineProperty(exports,"doTypesOverlap",{enumerable:!0,get:function(){return _typeComparators.doTypesOverlap}})},{"./TypeInfo":162,"./astFromValue":163,"./buildASTSchema":164,"./buildClientSchema":165,"./concatAST":166,"./extendSchema":167,"./getOperationAST":168,"./introspectionQuery":170,"./isValidJSValue":171,"./isValidLiteralValue":172,"./schemaPrinter":173,"./typeComparators":174,"./typeFromAST":175,"./valueFromAST":176}],170:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var introspectionQuery="\n  query IntrospectionQuery {\n    __schema {\n      queryType { name }\n      mutationType { name }\n      subscriptionType { name }\n      types {\n        ...FullType\n      }\n      directives {\n        name\n        description\n        args {\n          ...InputValue\n        }\n        onOperation\n        onFragment\n        onField\n      }\n    }\n  }\n\n  fragment FullType on __Type {\n    kind\n    name\n    description\n    fields(includeDeprecated: true) {\n      name\n      description\n      args {\n        ...InputValue\n      }\n      type {\n        ...TypeRef\n      }\n      isDeprecated\n      deprecationReason\n    }\n    inputFields {\n      ...InputValue\n    }\n    interfaces {\n      ...TypeRef\n    }\n    enumValues(includeDeprecated: true) {\n      name\n      description\n      isDeprecated\n      deprecationReason\n    }\n    possibleTypes {\n      ...TypeRef\n    }\n  }\n\n  fragment InputValue on __InputValue {\n    name\n    description\n    type { ...TypeRef }\n    defaultValue\n  }\n\n  fragment TypeRef on __Type {\n    kind\n    name\n    ofType {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n        }\n      }\n    }\n  }\n";exports.introspectionQuery=introspectionQuery},{}],171:[function(require,module,exports){"use strict";function isValidJSValue(e,t){for(var r=!0;r;){var i=e,n=t;if(a=u=l=s=o=f=v=_=j=m=void 0,r=!1,!(n instanceof _typeDefinition.GraphQLNonNull)){if((0,_jsutilsIsNullish2.default)(i))return[];if(n instanceof _typeDefinition.GraphQLList){var a=function(){var e=n.ofType;return Array.isArray(i)?{v:i.reduce(function(t,r,i){var n=isValidJSValue(r,e);return t.concat(n.map(function(e){return"In element #"+i+": "+e}))},[])}:{v:isValidJSValue(i,e)}}();if("object"==typeof a)return a.v}if(n instanceof _typeDefinition.GraphQLInputObjectType){if("object"!=typeof i||null===i)return['Expected "'+n.name+'", found not an object.'];var u=n.getFields(),l=[],s=!0,o=!1,f=void 0;try{for(var p,y=_getIterator(_Object$keys(i));!(s=(p=y.next()).done);s=!0){var c=p.value;u[c]||l.push('In field "'+c+'": Unknown field.')}}catch(d){o=!0,f=d}finally{try{!s&&y.return&&y.return()}finally{if(o)throw f}}var v=!0,_=!1,j=void 0;try{for(var b,h=function(){var e=b.value,t=isValidJSValue(i[e],u[e].type);l.push.apply(l,_toConsumableArray(t.map(function(t){return'In field "'+e+'": '+t})))},I=_getIterator(_Object$keys(u));!(v=(b=I.next()).done);v=!0)h()}catch(d){_=!0,j=d}finally{try{!v&&I.return&&I.return()}finally{if(_)throw j}}return l}(0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLScalarType||n instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var m=n.parseValue(i);return(0,_jsutilsIsNullish2.default)(m)?['Expected type "'+n.name+'", found '+JSON.stringify(i)+"."]:[]}if((0,_jsutilsIsNullish2.default)(i))return n.ofType.name?['Expected "'+n.ofType.name+'!", found null.']:["Expected non-null value, found null."];e=i,t=n.ofType,r=!0}}var _toConsumableArray=require("babel-runtime/helpers/to-consumable-array").default,_getIterator=require("babel-runtime/core-js/get-iterator").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidJSValue=isValidJSValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../type/definition":156,"babel-runtime/core-js/get-iterator":16,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/to-consumable-array":35}],172:[function(require,module,exports){"use strict";function isValidLiteralValue(e,t){for(var i=!0;i;){var r=e,n=t;if(a=u=l=s=o=f=p=v=j=g=b=q=void 0,i=!1,!(r instanceof _typeDefinition.GraphQLNonNull)){if(!n)return[];if(n.kind===_languageKinds.VARIABLE)return[];if(r instanceof _typeDefinition.GraphQLList){var a=function(){var e=r.ofType;return n.kind===_languageKinds.LIST?{v:n.values.reduce(function(t,i,r){var n=isValidLiteralValue(e,i);return t.concat(n.map(function(e){return"In element #"+r+": "+e}))},[])}:{v:isValidLiteralValue(e,n)}}();if("object"==typeof a)return a.v}if(r instanceof _typeDefinition.GraphQLInputObjectType){if(n.kind!==_languageKinds.OBJECT)return['Expected "'+r.name+'", found not an object.'];var u=r.getFields(),l=[],s=n.fields,o=!0,f=!1,p=void 0;try{for(var d,y=_getIterator(s);!(o=(d=y.next()).done);o=!0){var _=d.value;u[_.name.value]||l.push('In field "'+_.name.value+'": Unknown field.')}}catch(c){f=!0,p=c}finally{try{!o&&y.return&&y.return()}finally{if(f)throw p}}var v=(0,_jsutilsKeyMap2.default)(s,function(e){return e.name.value}),j=!0,g=!1,b=void 0;try{for(var h,m=function(){var e=h.value,t=isValidLiteralValue(u[e].type,v[e]&&v[e].value);l.push.apply(l,_toConsumableArray(t.map(function(t){return'In field "'+e+'": '+t})))},I=_getIterator(_Object$keys(u));!(j=(h=I.next()).done);j=!0)m()}catch(c){g=!0,b=c}finally{try{!j&&I.return&&I.return()}finally{if(g)throw b}}return l}(0,_jsutilsInvariant2.default)(r instanceof _typeDefinition.GraphQLScalarType||r instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var q=r.parseLiteral(n);return(0,_jsutilsIsNullish2.default)(q)?['Expected type "'+r.name+'", found '+(0,_languagePrinter.print)(n)+"."]:[]}if(!n)return r.ofType.name?['Expected "'+r.ofType.name+'!", found null.']:["Expected non-null value, found null."];e=r.ofType,t=n,i=!0}}var _toConsumableArray=require("babel-runtime/helpers/to-consumable-array").default,_getIterator=require("babel-runtime/core-js/get-iterator").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidLiteralValue=isValidLiteralValue;var _languagePrinter=require("../language/printer"),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish)},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../jsutils/keyMap":146,"../language/kinds":149,"../language/printer":153,"../type/definition":156,"babel-runtime/core-js/get-iterator":16,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/to-consumable-array":35}],173:[function(require,module,exports){"use strict";function printSchema(n){return printFilteredSchema(n,isDefinedType)}function printIntrospectionSchema(n){return printFilteredSchema(n,isIntrospectionType)}function isDefinedType(n){return!isIntrospectionType(n)&&!isBuiltInScalar(n)}function isIntrospectionType(n){return 0===n.indexOf("__")}function isBuiltInScalar(n){return"String"===n||"Boolean"===n||"Int"===n||"Float"===n||"ID"===n}function printFilteredSchema(n,e){var t=n.getTypeMap(),i=_Object$keys(t).filter(e).sort(function(n,e){return n.localeCompare(e)}).map(function(n){return t[n]});return i.map(printType).join("\n\n")+"\n"}function printType(n){return n instanceof _typeDefinition.GraphQLScalarType?printScalar(n):n instanceof _typeDefinition.GraphQLObjectType?printObject(n):n instanceof _typeDefinition.GraphQLInterfaceType?printInterface(n):n instanceof _typeDefinition.GraphQLUnionType?printUnion(n):n instanceof _typeDefinition.GraphQLEnumType?printEnum(n):((0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLInputObjectType),printInputObject(n))}function printScalar(n){return"scalar "+n.name}function printObject(n){var e=n.getInterfaces(),t=e.length?" implements "+e.map(function(n){return n.name}).join(", "):"";return"type "+n.name+t+" {\n"+printFields(n)+"\n}"}function printInterface(n){return"interface "+n.name+" {\n"+printFields(n)+"\n}"}function printUnion(n){return"union "+n.name+" = "+n.getPossibleTypes().join(" | ")}function printEnum(n){var e=n.getValues();return"enum "+n.name+" {\n"+e.map(function(n){return"  "+n.name}).join("\n")+"\n}"}function printInputObject(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return"input "+n.name+" {\n"+t.map(function(n){return"  "+printInputValue(n)}).join("\n")+"\n}"}function printFields(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return t.map(function(n){return"  "+n.name+printArgs(n)+": "+n.type}).join("\n")}function printArgs(n){return 0===n.args.length?"":"("+n.args.map(printInputValue).join(", ")+")"}function printInputValue(n){var e=n.name+": "+n.type;return(0,_jsutilsIsNullish2.default)(n.defaultValue)||(e+=" = "+(0,_languagePrinter.print)((0,_utilitiesAstFromValue.astFromValue)(n.defaultValue,n.type))),e}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.printSchema=printSchema,exports.printIntrospectionSchema=printIntrospectionSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../language/printer":153,"../type/definition":156,"../utilities/astFromValue":163,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32}],174:[function(require,module,exports){"use strict";function isEqualType(e,i){for(var n=!0;n;){var t=e,p=i;if(n=!1,t===p)return!0;if(t instanceof _typeDefinition.GraphQLNonNull&&p instanceof _typeDefinition.GraphQLNonNull)e=t.ofType,i=p.ofType,n=!0;else{if(!(t instanceof _typeDefinition.GraphQLList&&p instanceof _typeDefinition.GraphQLList))return!1;e=t.ofType,i=p.ofType,n=!0}}}function isTypeSubTypeOf(e,i){var n=!0;e:for(;n;){var t=e,p=i;if(n=!1,t===p)return!0;if(p instanceof _typeDefinition.GraphQLNonNull){if(t instanceof _typeDefinition.GraphQLNonNull){e=t.ofType,i=p.ofType,n=!0;continue e}return!1}if(!(t instanceof _typeDefinition.GraphQLNonNull)){if(p instanceof _typeDefinition.GraphQLList){if(t instanceof _typeDefinition.GraphQLList){e=t.ofType,i=p.ofType,n=!0;continue e}return!1}return t instanceof _typeDefinition.GraphQLList?!1:(0,_typeDefinition.isAbstractType)(p)&&t instanceof _typeDefinition.GraphQLObjectType&&p.isPossibleType(t)?!0:!1}e=t.ofType,i=p,n=!0}}function doTypesOverlap(e,i){var n=i;return e===n?!0:e instanceof _typeDefinition.GraphQLInterfaceType||e instanceof _typeDefinition.GraphQLUnionType?n instanceof _typeDefinition.GraphQLInterfaceType||n instanceof _typeDefinition.GraphQLUnionType?e.getPossibleTypes().some(function(e){return n.isPossibleType(e)}):e.isPossibleType(n):n instanceof _typeDefinition.GraphQLInterfaceType||n instanceof _typeDefinition.GraphQLUnionType?n.isPossibleType(e):!1}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEqualType=isEqualType,exports.isTypeSubTypeOf=isTypeSubTypeOf,exports.doTypesOverlap=doTypesOverlap;var _typeDefinition=require("../type/definition")},{"../type/definition":156}],175:[function(require,module,exports){"use strict";function typeFromAST(e,i){var t=void 0;return i.kind===_languageKinds.LIST_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLList(t)):i.kind===_languageKinds.NON_NULL_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLNonNull(t)):((0,_jsutilsInvariant2.default)(i.kind===_languageKinds.NAMED_TYPE,"Must be a named type."),e.getType(i.name.value))}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeFromAST=typeFromAST;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":144,"../language/kinds":149,"../type/definition":156,"babel-runtime/helpers/interop-require-default":32}],176:[function(require,module,exports){"use strict";function valueFromAST(e,i,t){for(var r=!0;r;){var u=e,n=i,a=t;if(l=s=f=o=void 0,r=!1,n instanceof _typeDefinition.GraphQLNonNull)e=u,i=n.ofType,t=a,r=!0;else{if(!u)return null;if(u.kind===Kind.VARIABLE){var l=u.name.value;return a&&a.hasOwnProperty(l)?a[l]:null}if(n instanceof _typeDefinition.GraphQLList){var s=function(){var e=n.ofType;return u.kind===Kind.LIST?{v:u.values.map(function(i){return valueFromAST(i,e,a)})}:{v:[valueFromAST(u,e,a)]}}();if("object"==typeof s)return s.v}if(n instanceof _typeDefinition.GraphQLInputObjectType){var f=function(){var e=n.getFields();if(u.kind!==Kind.OBJECT)return{v:null};var i=(0,_jsutilsKeyMap2.default)(u.fields,function(e){return e.name.value});return{v:_Object$keys(e).reduce(function(t,r){var u=e[r],n=i[r],l=valueFromAST(n&&n.value,u.type,a);return(0,_jsutilsIsNullish2.default)(l)&&(l=u.defaultValue),(0,_jsutilsIsNullish2.default)(l)||(t[r]=l),t},{})}}();if("object"==typeof f)return f.v}(0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLScalarType||n instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var o=n.parseLiteral(u);if(!(0,_jsutilsIsNullish2.default)(o))return o}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.valueFromAST=valueFromAST;var _jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":144,"../jsutils/isNullish":145,"../jsutils/keyMap":146,"../language/kinds":149,"../type/definition":156,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/interop-require-wildcard":33}],177:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _validate=require("./validate");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validate.validate}});var _specifiedRules=require("./specifiedRules");Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _specifiedRules.specifiedRules}})},{"./specifiedRules":201,"./validate":202}],178:[function(require,module,exports){"use strict";function badValueMessage(e,r,a,t){var u=t?"\n"+t.join("\n"):"";return'Argument "'+e+'" has invalid value '+a+"."+u}function ArgumentsOfCorrectType(e){return{Argument:function(r){var a=e.getArgument();if(a){var t=(0,_utilitiesIsValidLiteralValue.isValidLiteralValue)(a.type,r.value);t&&t.length>0&&e.reportError(new _error.GraphQLError(badValueMessage(r.name.value,a.type,(0,
_languagePrinter.print)(r.value),t),[r.value]))}return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badValueMessage=badValueMessage,exports.ArgumentsOfCorrectType=ArgumentsOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":135,"../../language/printer":153,"../../utilities/isValidLiteralValue":172}],179:[function(require,module,exports){"use strict";function defaultForNonNullArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+r+'" is required and will not '+('use the default value. Perhaps you meant to use type "'+a+'".')}function badValueForDefaultArgMessage(e,r,a,t){var l=t?"\n"+t.join("\n"):"";return'Variable "$'+e+" has invalid default value "+a+"."+l}function DefaultValuesOfCorrectType(e){return{VariableDefinition:function(r){var a=r.variable.name.value,t=r.defaultValue,l=e.getInputType();if(l instanceof _typeDefinition.GraphQLNonNull&&t&&e.reportError(new _error.GraphQLError(defaultForNonNullArgMessage(a,l,l.ofType),[t])),l&&t){var u=(0,_utilitiesIsValidLiteralValue.isValidLiteralValue)(l,t);u&&u.length>0&&e.reportError(new _error.GraphQLError(badValueForDefaultArgMessage(a,l,(0,_languagePrinter.print)(t),u),[t]))}return!1},SelectionSet:function(){return!1},FragmentDefinition:function(){return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultForNonNullArgMessage=defaultForNonNullArgMessage,exports.badValueForDefaultArgMessage=badValueForDefaultArgMessage,exports.DefaultValuesOfCorrectType=DefaultValuesOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":135,"../../language/printer":153,"../../type/definition":156,"../../utilities/isValidLiteralValue":172}],180:[function(require,module,exports){"use strict";function undefinedFieldMessage(e,n,t){var r='Cannot query field "'+e+'" on type "'+n+'".',i=5;if(0!==t.length){var o=t.slice(0,i).map(function(e){return'"'+e+'"'}).join(", ");t.length>i&&(o+=", and "+(t.length-i)+" other types"),r+=" However, this field exists on "+o+".",r+=" Perhaps you meant to use an inline fragment?"}return r}function FieldsOnCorrectType(e){return{Field:function(n){var t=e.getParentType();if(t){var r=e.getFieldDef();if(!r){var i=[];(0,_typeDefinition.isAbstractType)(t)&&(i=getSiblingInterfacesIncludingField(t,n.name.value),i=i.concat(getImplementationsIncludingField(t,n.name.value))),e.reportError(new _error.GraphQLError(undefinedFieldMessage(n.name.value,t.name,i),[n]))}}}}}function getImplementationsIncludingField(e,n){return e.getPossibleTypes().filter(function(e){return void 0!==e.getFields()[n]}).map(function(e){return e.name}).sort()}function getSiblingInterfacesIncludingField(e,n){var t=e.getPossibleTypes().filter(function(e){return e instanceof _typeDefinition.GraphQLObjectType}),r=t.reduce(function(e,t){return t.getInterfaces().forEach(function(t){void 0!==t.getFields()[n]&&(void 0===e[t.name]&&(e[t.name]=0),e[t.name]+=1)}),e},{});return _Object$keys(r).sort(function(e,n){return r[n]-r[e]})}var _Object$keys=require("babel-runtime/core-js/object/keys").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedFieldMessage=undefinedFieldMessage,exports.FieldsOnCorrectType=FieldsOnCorrectType;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":135,"../../type/definition":156,"babel-runtime/core-js/object/keys":23}],181:[function(require,module,exports){"use strict";function inlineFragmentOnNonCompositeErrorMessage(e){return'Fragment cannot condition on non composite type "'+e+'".'}function fragmentOnNonCompositeErrorMessage(e,n){return'Fragment "'+e+'" cannot condition on non composite '+('type "'+n+'".')}function FragmentsOnCompositeTypes(e){return{InlineFragment:function(n){var r=e.getType();n.typeCondition&&r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))},FragmentDefinition:function(n){var r=e.getType();r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(n.name.value,(0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inlineFragmentOnNonCompositeErrorMessage=inlineFragmentOnNonCompositeErrorMessage,exports.fragmentOnNonCompositeErrorMessage=fragmentOnNonCompositeErrorMessage,exports.FragmentsOnCompositeTypes=FragmentsOnCompositeTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition")},{"../../error":135,"../../language/printer":153,"../../type/definition":156}],182:[function(require,module,exports){"use strict";function unknownArgMessage(e,n,r){return'Unknown argument "'+e+'" on field "'+n+'" of '+('type "'+r+'".')}function unknownDirectiveArgMessage(e,n){return'Unknown argument "'+e+'" on directive "@'+n+'".'}function KnownArgumentNames(e){return{Argument:function(n,r,i,t,a){var u=a[a.length-1];if(u.kind===_languageKinds.FIELD){var s=e.getFieldDef();if(s){var o=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===n.name.value});if(!o){var g=e.getParentType();(0,_jsutilsInvariant2.default)(g),e.reportError(new _error.GraphQLError(unknownArgMessage(n.name.value,s.name,g.name),[n]))}}}else if(u.kind===_languageKinds.DIRECTIVE){var l=e.getDirective();if(l){var f=(0,_jsutilsFind2.default)(l.args,function(e){return e.name===n.name.value});f||e.reportError(new _error.GraphQLError(unknownDirectiveArgMessage(n.name.value,l.name),[n]))}}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownArgMessage=unknownArgMessage,exports.unknownDirectiveArgMessage=unknownDirectiveArgMessage,exports.KnownArgumentNames=KnownArgumentNames;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../../language/kinds")},{"../../error":135,"../../jsutils/find":143,"../../jsutils/invariant":144,"../../language/kinds":149,"babel-runtime/helpers/interop-require-default":32}],183:[function(require,module,exports){"use strict";function unknownDirectiveMessage(e){return'Unknown directive "'+e+'".'}function misplacedDirectiveMessage(e,r){return'Directive "'+e+'" may not be used on "'+r+'".'}function KnownDirectives(e){return{Directive:function(r,i,n,a,s){var t=(0,_jsutilsFind2.default)(e.getSchema().getDirectives(),function(e){return e.name===r.name.value});if(!t)return void e.reportError(new _error.GraphQLError(unknownDirectiveMessage(r.name.value),[r]));var o=s[s.length-1];switch(o.kind){case _languageKinds.OPERATION_DEFINITION:t.onOperation||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"operation"),[r]));break;case _languageKinds.FIELD:t.onField||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"field"),[r]));break;case _languageKinds.FRAGMENT_SPREAD:case _languageKinds.INLINE_FRAGMENT:case _languageKinds.FRAGMENT_DEFINITION:t.onFragment||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"fragment"),[r]))}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownDirectiveMessage=unknownDirectiveMessage,exports.misplacedDirectiveMessage=misplacedDirectiveMessage,exports.KnownDirectives=KnownDirectives;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds")},{"../../error":135,"../../jsutils/find":143,"../../language/kinds":149,"babel-runtime/helpers/interop-require-default":32}],184:[function(require,module,exports){"use strict";function unknownFragmentMessage(e){return'Unknown fragment "'+e+'".'}function KnownFragmentNames(e){return{FragmentSpread:function(n){var r=n.name.value,a=e.getFragment(r);a||e.reportError(new _error.GraphQLError(unknownFragmentMessage(r),[n.name]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownFragmentMessage=unknownFragmentMessage,exports.KnownFragmentNames=KnownFragmentNames;var _error=require("../../error")},{"../../error":135}],185:[function(require,module,exports){"use strict";function unknownTypeMessage(e){return'Unknown type "'+e+'".'}function KnownTypeNames(e){return{ObjectTypeDefinition:function(){return!1},InterfaceTypeDefinition:function(){return!1},UnionTypeDefinition:function(){return!1},InputObjectTypeDefinition:function(){return!1},NamedType:function(n){var r=n.name.value,t=e.getSchema().getType(r);t||e.reportError(new _error.GraphQLError(unknownTypeMessage(r),[n]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownTypeMessage=unknownTypeMessage,exports.KnownTypeNames=KnownTypeNames;var _error=require("../../error")},{"../../error":135}],186:[function(require,module,exports){"use strict";function anonOperationNotAloneMessage(){return"This anonymous operation must be the only defined operation."}function LoneAnonymousOperation(n){var e=0;return{Document:function(n){e=n.definitions.filter(function(n){return n.kind===_languageKinds.OPERATION_DEFINITION}).length},OperationDefinition:function(o){!o.name&&e>1&&n.reportError(new _error.GraphQLError(anonOperationNotAloneMessage(),[o]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.anonOperationNotAloneMessage=anonOperationNotAloneMessage,exports.LoneAnonymousOperation=LoneAnonymousOperation;var _error=require("../../error"),_languageKinds=require("../../language/kinds")},{"../../error":135,"../../language/kinds":149}],187:[function(require,module,exports){"use strict";function cycleErrorMessage(e,r){var t=r.length?" via "+r.join(", "):"";return'Cannot spread fragment "'+e+'" within itself'+t+"."}function NoFragmentCycles(e){function r(o){var c=o.name.value;t[c]=!0;var i=e.getFragmentSpreads(o);if(0!==i.length){a[c]=n.length;for(var l=0;l<i.length;l++){var u=i[l],s=u.name.value,v=a[s];if(void 0===v){if(n.push(u),!t[s]){var g=e.getFragment(s);g&&r(g)}n.pop()}else{var f=n.slice(v);e.reportError(new _error.GraphQLError(cycleErrorMessage(s,f.map(function(e){return e.name.value})),f.concat(u)))}}a[c]=void 0}}var t=_Object$create(null),n=[],a=_Object$create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(e){return t[e.name.value]||r(e),!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.cycleErrorMessage=cycleErrorMessage,exports.NoFragmentCycles=NoFragmentCycles;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],188:[function(require,module,exports){"use strict";function undefinedVarMessage(e,r){return r?'Variable "$'+e+'" is not defined by operation "'+r+'".':'Variable "$'+e+'" is not defined.'}function NoUndefinedVariables(e){var r=_Object$create(null);return{OperationDefinition:{enter:function(){r=_Object$create(null)},leave:function(a){var n=e.getRecursiveVariableUsages(a);n.forEach(function(n){var i=n.node,t=i.name.value;r[t]!==!0&&e.reportError(new _error.GraphQLError(undefinedVarMessage(t,a.name&&a.name.value),[i,a]))})}},VariableDefinition:function(e){r[e.variable.name.value]=!0}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedVarMessage=undefinedVarMessage,exports.NoUndefinedVariables=NoUndefinedVariables;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],189:[function(require,module,exports){"use strict";function unusedFragMessage(e){return'Fragment "'+e+'" is never used.'}function NoUnusedFragments(e){var r=[],n=[];return{OperationDefinition:function(e){return r.push(e),!1},FragmentDefinition:function(e){return n.push(e),!1},Document:{leave:function(){var t=_Object$create(null);r.forEach(function(r){e.getRecursivelyReferencedFragments(r).forEach(function(e){t[e.name.value]=!0})}),n.forEach(function(r){var n=r.name.value;t[n]!==!0&&e.reportError(new _error.GraphQLError(unusedFragMessage(n),[r]))})}}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedFragMessage=unusedFragMessage,exports.NoUnusedFragments=NoUnusedFragments;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],190:[function(require,module,exports){"use strict";function unusedVariableMessage(e,r){return r?'Variable "$'+e+'" is never used in operation "'+r+'".':'Variable "$'+e+'" is never used.'}function NoUnusedVariables(e){var r=[];return{OperationDefinition:{enter:function(){r=[]},leave:function(a){var n=_Object$create(null),i=e.getRecursiveVariableUsages(a),u=a.name?a.name.value:null;i.forEach(function(e){var r=e.node;n[r.name.value]=!0}),r.forEach(function(r){var a=r.variable.name.value;n[a]!==!0&&e.reportError(new _error.GraphQLError(unusedVariableMessage(a,u),[r]))})}},VariableDefinition:function(e){r.push(e)}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedVariableMessage=unusedVariableMessage,exports.NoUnusedVariables=NoUnusedVariables;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],191:[function(require,module,exports){"use strict";function fieldsConflictMessage(e,r){return'Fields "'+e+'" conflict because '+reasonMessage(r)+"."}function reasonMessage(e){return Array.isArray(e)?e.map(function(e){var r=_slicedToArray(e,2),t=r[0],a=r[1];return'subfields "'+t+'" conflict because '+reasonMessage(a)}).join(" and "):e}function OverlappingFieldsCanBeMerged(e){function r(e){var r=[];return _Object$keys(e).forEach(function(a){var i=e[a];if(i.length>1)for(var n=0;n<i.length;n++)for(var s=n;s<i.length;s++){var l=t(a,i[n],i[s]);l&&r.push(l)}}),r}function t(t,i,n){var s=_slicedToArray(i,3),l=s[0],u=s[1],o=s[2],c=_slicedToArray(n,3),d=c[0],f=c[1],p=c[2];if(u!==f&&!(l!==d&&l instanceof _typeDefinition.GraphQLObjectType&&d instanceof _typeDefinition.GraphQLObjectType||a.has(u,f))){a.add(u,f);var _=u.name.value,g=f.name.value;if(_!==g)return[[t,_+" and "+g+" are different fields"],[u],[f]];var y=o&&o.type,v=p&&p.type;if(y&&v&&!(0,_utilitiesTypeComparators.isEqualType)(y,v))return[[t,"they return differing types "+y+" and "+v],[u],[f]];if(!sameArguments(u.arguments||[],f.arguments||[]))return[[t,"they have differing arguments"],[u],[f]];var m=u.selectionSet,h=f.selectionSet;if(m&&h){var A={},T=collectFieldASTsAndDefs(e,(0,_typeDefinition.getNamedType)(y),m,A);T=collectFieldASTsAndDefs(e,(0,_typeDefinition.getNamedType)(v),h,A,T);var S=r(T);if(S.length>0)return[[t,S.map(function(e){var r=_slicedToArray(e,1),t=r[0];return t})],S.reduce(function(e,r){var t=_slicedToArray(r,2),a=t[1];return e.concat(a)},[u]),S.reduce(function(e,r){var t=_slicedToArray(r,3),a=t[2];return e.concat(a)},[f])]}}}var a=new PairSet;return{SelectionSet:{leave:function(t){var a=collectFieldASTsAndDefs(e,e.getParentType(),t),i=r(a);i.forEach(function(r){var t=_slicedToArray(r,3),a=_slicedToArray(t[0],2),i=a[0],n=a[1],s=t[1],l=t[2];return e.reportError(new _error.GraphQLError(fieldsConflictMessage(i,n),s.concat(l)))})}}}}function sameArguments(e,r){return e.length!==r.length?!1:e.every(function(e){var t=(0,_jsutilsFind2.default)(r,function(r){return r.name.value===e.name.value});return t?sameValue(e.value,t.value):!1})}function sameValue(e,r){return!e&&!r||(0,_languagePrinter.print)(e)===(0,_languagePrinter.print)(r)}function collectFieldASTsAndDefs(e,r,t,a,i){for(var n=a||{},s=i||{},l=0;l<t.selections.length;l++){var u=t.selections[l];switch(u.kind){case _languageKinds.FIELD:var o=u.name.value,c=void 0;(r instanceof _typeDefinition.GraphQLObjectType||r instanceof _typeDefinition.GraphQLInterfaceType)&&(c=r.getFields()[o]);var d=u.alias?u.alias.value:o;s[d]||(s[d]=[]),s[d].push([r,u,c]);break;case _languageKinds.INLINE_FRAGMENT:var f=u.typeCondition,p=f?(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),u.typeCondition):r;s=collectFieldASTsAndDefs(e,p,u.selectionSet,n,s);break;case _languageKinds.FRAGMENT_SPREAD:var _=u.name.value;if(n[_])continue;n[_]=!0;var g=e.getFragment(_);if(!g)continue;var y=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),g.typeCondition);s=collectFieldASTsAndDefs(e,y,g.selectionSet,n,s)}}return s}function _pairSetAdd(e,r,t){var a=e.get(r);a||(a=new _Set,e.set(r,a)),a.add(t)}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_slicedToArray=require("babel-runtime/helpers/sliced-to-array").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Set=require("babel-runtime/core-js/set").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldsConflictMessage=fieldsConflictMessage,exports.OverlappingFieldsCanBeMerged=OverlappingFieldsCanBeMerged;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST"),PairSet=function(){function e(){_classCallCheck(this,e),this._data=new _Map}return _createClass(e,[{key:"has",value:function(e,r){var t=this._data.get(e);return t&&t.has(r)}},{key:"add",value:function(e,r){_pairSetAdd(this._data,e,r),_pairSetAdd(this._data,r,e)}}]),e}()},{"../../error":135,"../../jsutils/find":143,"../../language/kinds":149,"../../language/printer":153,"../../type/definition":156,"../../utilities/typeComparators":174,"../../utilities/typeFromAST":175,"babel-runtime/core-js/map":18,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/set":26,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/create-class":28,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/sliced-to-array":34}],192:[function(require,module,exports){"use strict";function typeIncompatibleSpreadMessage(e,r,t){return'Fragment "'+e+'" cannot be spread here as objects of '+('type "'+r+'" can never be of type "'+t+'".')}function typeIncompatibleAnonSpreadMessage(e,r){return"Fragment cannot be spread here as objects of "+('type "'+e+'" can never be of type "'+r+'".')}function PossibleFragmentSpreads(e){return{InlineFragment:function(r){var t=e.getType(),a=e.getParentType();t&&a&&!(0,_utilitiesTypeComparators.doTypesOverlap)(t,a)&&e.reportError(new _error.GraphQLError(typeIncompatibleAnonSpreadMessage(a,t),[r]))},FragmentSpread:function(r){var t=r.name.value,a=getFragmentType(e,t),p=e.getParentType();a&&p&&!(0,_utilitiesTypeComparators.doTypesOverlap)(a,p)&&e.reportError(new _error.GraphQLError(typeIncompatibleSpreadMessage(t,p,a),[r]))}}}function getFragmentType(e,r){var t=e.getFragment(r);return t&&(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),t.typeCondition)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeIncompatibleSpreadMessage=typeIncompatibleSpreadMessage,exports.typeIncompatibleAnonSpreadMessage=typeIncompatibleAnonSpreadMessage,exports.PossibleFragmentSpreads=PossibleFragmentSpreads;var _error=require("../../error"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":135,"../../utilities/typeComparators":174,"../../utilities/typeFromAST":175}],193:[function(require,module,exports){"use strict";function missingFieldArgMessage(e,r,i){return'Field "'+e+'" argument "'+r+'" of type "'+i+'" is required but not provided.'}function missingDirectiveArgMessage(e,r,i){return'Directive "@'+e+'" argument "'+r+'" of type '+('"'+i+'" is required but not provided.')}function ProvidedNonNullArguments(e){return{Field:{leave:function(r){var i=e.getFieldDef();if(!i)return!1;var t=r.arguments||[],n=(0,_jsutilsKeyMap2.default)(t,function(e){return e.name.value});i.args.forEach(function(i){var t=n[i.name];!t&&i.type instanceof _typeDefinition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingFieldArgMessage(r.name.value,i.name,i.type),[r]))})}},Directive:{leave:function(r){var i=e.getDirective();if(!i)return!1;var t=r.arguments||[],n=(0,_jsutilsKeyMap2.default)(t,function(e){return e.name.value});i.args.forEach(function(i){var t=n[i.name];!t&&i.type instanceof _typeDefinition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingDirectiveArgMessage(r.name.value,i.name,i.type),[r]))})}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.missingFieldArgMessage=missingFieldArgMessage,exports.missingDirectiveArgMessage=missingDirectiveArgMessage,exports.ProvidedNonNullArguments=ProvidedNonNullArguments;var _error=require("../../error"),_jsutilsKeyMap=require("../../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_typeDefinition=require("../../type/definition")},{"../../error":135,"../../jsutils/keyMap":146,"../../type/definition":156,"babel-runtime/helpers/interop-require-default":32}],194:[function(require,module,exports){"use strict";function noSubselectionAllowedMessage(e,r){return'Field "'+e+'" of type "'+r+'" must not have a sub selection.'}function requiredSubselectionMessage(e,r){return'Field "'+e+'" of type "'+r+'" must have a sub selection.'}function ScalarLeafs(e){return{Field:function(r){var o=e.getType();o&&((0,_typeDefinition.isLeafType)(o)?r.selectionSet&&e.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(r.name.value,o),[r.selectionSet])):r.selectionSet||e.reportError(new _error.GraphQLError(requiredSubselectionMessage(r.name.value,o),[r])))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noSubselectionAllowedMessage=noSubselectionAllowedMessage,exports.requiredSubselectionMessage=requiredSubselectionMessage,exports.ScalarLeafs=ScalarLeafs;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":135,"../../type/definition":156}],195:[function(require,module,exports){"use strict";function duplicateArgMessage(e){return'There can be only one argument named "'+e+'".'}function UniqueArgumentNames(e){var r=_Object$create(null);return{Field:function(){r=_Object$create(null)},Directive:function(){r=_Object$create(null)},Argument:function(t){var n=t.name.value;return r[n]?e.reportError(new _error.GraphQLError(duplicateArgMessage(n),[r[n],t.name])):r[n]=t.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateArgMessage=duplicateArgMessage,exports.UniqueArgumentNames=UniqueArgumentNames;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],196:[function(require,module,exports){"use strict";function duplicateFragmentNameMessage(e){return'There can only be one fragment named "'+e+'".'}function UniqueFragmentNames(e){var r=_Object$create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(a){var n=a.name.value;return r[n]?e.reportError(new _error.GraphQLError(duplicateFragmentNameMessage(n),[r[n],a.name])):r[n]=a.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateFragmentNameMessage=duplicateFragmentNameMessage,exports.UniqueFragmentNames=UniqueFragmentNames;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],197:[function(require,module,exports){"use strict";function duplicateInputFieldMessage(e){return'There can be only one input field named "'+e+'".'}function UniqueInputFieldNames(e){var r=[],t=_Object$create(null);return{ObjectValue:{enter:function(){r.push(t),t=_Object$create(null)},leave:function(){t=r.pop()}},ObjectField:function(r){var n=r.name.value;return t[n]?e.reportError(new _error.GraphQLError(duplicateInputFieldMessage(n),[t[n],r.name])):t[n]=r.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateInputFieldMessage=duplicateInputFieldMessage,exports.UniqueInputFieldNames=UniqueInputFieldNames;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],198:[function(require,module,exports){"use strict";function duplicateOperationNameMessage(e){return'There can only be one operation named "'+e+'".'}function UniqueOperationNames(e){var r=_Object$create(null);return{OperationDefinition:function(a){var t=a.name;return t&&(r[t.value]?e.reportError(new _error.GraphQLError(duplicateOperationNameMessage(t.value),[r[t.value],t])):r[t.value]=t),!1},FragmentDefinition:function(){return!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateOperationNameMessage=duplicateOperationNameMessage,exports.UniqueOperationNames=UniqueOperationNames;var _error=require("../../error")},{"../../error":135,"babel-runtime/core-js/object/create":20}],199:[function(require,module,exports){"use strict";function nonInputTypeOnVarMessage(e,r){return'Variable "$'+e+'" cannot be non-input type "'+r+'".'}function VariablesAreInputTypes(e){return{VariableDefinition:function(r){var n=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,_typeDefinition.isInputType)(n)){var t=r.variable.name.value;e.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(t,(0,_languagePrinter.print)(r.type)),[r.type]))}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nonInputTypeOnVarMessage=nonInputTypeOnVarMessage,exports.VariablesAreInputTypes=VariablesAreInputTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":135,"../../language/printer":153,"../../type/definition":156,"../../utilities/typeFromAST":175}],200:[function(require,module,exports){"use strict";function badVarPosMessage(e,r,i){return'Variable "$'+e+'" of type "'+r+'" used in position '+('expecting type "'+i+'".')}function VariablesInAllowedPosition(e){var r=_Object$create(null);return{OperationDefinition:{enter:function(){r=_Object$create(null)},leave:function(i){var t=e.getRecursiveVariableUsages(i);t.forEach(function(i){var t=i.node,a=i.type,o=t.name.value,n=r[o];if(n&&a){var s=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),n.type);s&&!(0,_utilitiesTypeComparators.isTypeSubTypeOf)(effectiveType(s,n),a)&&e.reportError(new _error.GraphQLError(badVarPosMessage(o,s,a),[n,t]))}})}},VariableDefinition:function(e){r[e.variable.name.value]=e}}}function effectiveType(e,r){return!r.defaultValue||e instanceof _typeDefinition.GraphQLNonNull?e:new _typeDefinition.GraphQLNonNull(e)}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.badVarPosMessage=badVarPosMessage,exports.VariablesInAllowedPosition=VariablesInAllowedPosition;var _error=require("../../error"),_typeDefinition=require("../../type/definition"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":135,"../../type/definition":156,"../../utilities/typeComparators":174,"../../utilities/typeFromAST":175,"babel-runtime/core-js/object/create":20}],201:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _rulesUniqueOperationNames=require("./rules/UniqueOperationNames"),_rulesLoneAnonymousOperation=require("./rules/LoneAnonymousOperation"),_rulesKnownTypeNames=require("./rules/KnownTypeNames"),_rulesFragmentsOnCompositeTypes=require("./rules/FragmentsOnCompositeTypes"),_rulesVariablesAreInputTypes=require("./rules/VariablesAreInputTypes"),_rulesScalarLeafs=require("./rules/ScalarLeafs"),_rulesFieldsOnCorrectType=require("./rules/FieldsOnCorrectType"),_rulesUniqueFragmentNames=require("./rules/UniqueFragmentNames"),_rulesKnownFragmentNames=require("./rules/KnownFragmentNames"),_rulesNoUnusedFragments=require("./rules/NoUnusedFragments"),_rulesPossibleFragmentSpreads=require("./rules/PossibleFragmentSpreads"),_rulesNoFragmentCycles=require("./rules/NoFragmentCycles"),_rulesNoUndefinedVariables=require("./rules/NoUndefinedVariables"),_rulesNoUnusedVariables=require("./rules/NoUnusedVariables"),_rulesKnownDirectives=require("./rules/KnownDirectives"),_rulesKnownArgumentNames=require("./rules/KnownArgumentNames"),_rulesUniqueArgumentNames=require("./rules/UniqueArgumentNames"),_rulesArgumentsOfCorrectType=require("./rules/ArgumentsOfCorrectType"),_rulesProvidedNonNullArguments=require("./rules/ProvidedNonNullArguments"),_rulesDefaultValuesOfCorrectType=require("./rules/DefaultValuesOfCorrectType"),_rulesVariablesInAllowedPosition=require("./rules/VariablesInAllowedPosition"),_rulesOverlappingFieldsCanBeMerged=require("./rules/OverlappingFieldsCanBeMerged"),_rulesUniqueInputFieldNames=require("./rules/UniqueInputFieldNames"),specifiedRules=[_rulesUniqueOperationNames.UniqueOperationNames,_rulesLoneAnonymousOperation.LoneAnonymousOperation,_rulesKnownTypeNames.KnownTypeNames,_rulesFragmentsOnCompositeTypes.FragmentsOnCompositeTypes,_rulesVariablesAreInputTypes.VariablesAreInputTypes,_rulesScalarLeafs.ScalarLeafs,_rulesFieldsOnCorrectType.FieldsOnCorrectType,_rulesUniqueFragmentNames.UniqueFragmentNames,_rulesKnownFragmentNames.KnownFragmentNames,_rulesNoUnusedFragments.NoUnusedFragments,_rulesPossibleFragmentSpreads.PossibleFragmentSpreads,_rulesNoFragmentCycles.NoFragmentCycles,_rulesNoUndefinedVariables.NoUndefinedVariables,_rulesNoUnusedVariables.NoUnusedVariables,_rulesKnownDirectives.KnownDirectives,_rulesKnownArgumentNames.KnownArgumentNames,_rulesUniqueArgumentNames.UniqueArgumentNames,_rulesArgumentsOfCorrectType.ArgumentsOfCorrectType,_rulesProvidedNonNullArguments.ProvidedNonNullArguments,_rulesDefaultValuesOfCorrectType.DefaultValuesOfCorrectType,_rulesVariablesInAllowedPosition.VariablesInAllowedPosition,_rulesOverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged,_rulesUniqueInputFieldNames.UniqueInputFieldNames];exports.specifiedRules=specifiedRules},{"./rules/ArgumentsOfCorrectType":178,"./rules/DefaultValuesOfCorrectType":179,"./rules/FieldsOnCorrectType":180,"./rules/FragmentsOnCompositeTypes":181,"./rules/KnownArgumentNames":182,"./rules/KnownDirectives":183,"./rules/KnownFragmentNames":184,"./rules/KnownTypeNames":185,"./rules/LoneAnonymousOperation":186,"./rules/NoFragmentCycles":187,"./rules/NoUndefinedVariables":188,"./rules/NoUnusedFragments":189,"./rules/NoUnusedVariables":190,"./rules/OverlappingFieldsCanBeMerged":191,"./rules/PossibleFragmentSpreads":192,"./rules/ProvidedNonNullArguments":193,"./rules/ScalarLeafs":194,"./rules/UniqueArgumentNames":195,
"./rules/UniqueFragmentNames":196,"./rules/UniqueInputFieldNames":197,"./rules/UniqueOperationNames":198,"./rules/VariablesAreInputTypes":199,"./rules/VariablesInAllowedPosition":200}],202:[function(require,module,exports){"use strict";function validate(e,t,r){(0,_jsutilsInvariant2.default)(e,"Must provide schema"),(0,_jsutilsInvariant2.default)(t,"Must provide document"),(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.");var i=new _utilitiesTypeInfo.TypeInfo(e);return visitUsingRules(e,i,t,r||_specifiedRules.specifiedRules)}function visitUsingRules(e,t,r,i){var a=new ValidationContext(e,r,t),n=i.map(function(e){return e(a)});return(0,_languageVisitor.visit)(r,(0,_languageVisitor.visitWithTypeInfo)(t,(0,_languageVisitor.visitInParallel)(n))),a.getErrors()}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.validate=validate,exports.visitUsingRules=visitUsingRules;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageVisitor=(require("../error"),require("../language/visitor")),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeSchema=require("../type/schema"),_utilitiesTypeInfo=require("../utilities/TypeInfo"),_specifiedRules=require("./specifiedRules"),ValidationContext=function(){function e(t,r,i){_classCallCheck(this,e),this._schema=t,this._ast=r,this._typeInfo=i,this._errors=[],this._fragmentSpreads=new _Map,this._recursivelyReferencedFragments=new _Map,this._variableUsages=new _Map,this._recursiveVariableUsages=new _Map}return _createClass(e,[{key:"reportError",value:function(e){this._errors.push(e)}},{key:"getErrors",value:function(){return this._errors}},{key:"getSchema",value:function(){return this._schema}},{key:"getDocument",value:function(){return this._ast}},{key:"getFragment",value:function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce(function(e,t){return t.kind===Kind.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e},{})),t[e]}},{key:"getFragmentSpreads",value:function(e){var t=this._fragmentSpreads.get(e);if(!t){t=[];for(var r=[e.selectionSet];0!==r.length;)for(var i=r.pop(),a=0;a<i.selections.length;a++){var n=i.selections[a];n.kind===Kind.FRAGMENT_SPREAD?t.push(n):n.selectionSet&&r.push(n.selectionSet)}this._fragmentSpreads.set(e,t)}return t}},{key:"getRecursivelyReferencedFragments",value:function(e){var t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];for(var r=_Object$create(null),i=[e];0!==i.length;)for(var a=i.pop(),n=this.getFragmentSpreads(a),s=0;s<n.length;s++){var u=n[s].name.value;if(r[u]!==!0){r[u]=!0;var l=this.getFragment(u);l&&(t.push(l),i.push(l))}}this._recursivelyReferencedFragments.set(e,t)}return t}},{key:"getVariableUsages",value:function(e){var t=this,r=this._variableUsages.get(e);return r||!function(){var i=[],a=new _utilitiesTypeInfo.TypeInfo(t._schema);(0,_languageVisitor.visit)(e,(0,_languageVisitor.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(e){i.push({node:e,type:a.getInputType()})}})),r=i,t._variableUsages.set(e,r)}(),r}},{key:"getRecursiveVariableUsages",value:function(e){var t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(var r=this.getRecursivelyReferencedFragments(e),i=0;i<r.length;i++)Array.prototype.push.apply(t,this.getVariableUsages(r[i]));this._recursiveVariableUsages.set(e,t)}return t}},{key:"getType",value:function(){return this._typeInfo.getType()}},{key:"getParentType",value:function(){return this._typeInfo.getParentType()}},{key:"getInputType",value:function(){return this._typeInfo.getInputType()}},{key:"getFieldDef",value:function(){return this._typeInfo.getFieldDef()}},{key:"getDirective",value:function(){return this._typeInfo.getDirective()}},{key:"getArgument",value:function(){return this._typeInfo.getArgument()}}]),e}();exports.ValidationContext=ValidationContext},{"../error":135,"../jsutils/invariant":144,"../language/kinds":149,"../language/visitor":155,"../type/schema":161,"../utilities/TypeInfo":162,"./specifiedRules":201,"babel-runtime/core-js/map":18,"babel-runtime/core-js/object/create":20,"babel-runtime/helpers/class-call-check":27,"babel-runtime/helpers/create-class":28,"babel-runtime/helpers/interop-require-default":32,"babel-runtime/helpers/interop-require-wildcard":33}],203:[function(require,module,exports){(function(global){(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function a(t,n,i){if(i||"function"==typeof n){i||(i=n,n=null),n=h({},a.defaults,n||{});var l,o,p=n.highlight,u=0;try{l=e.lex(t,n)}catch(c){return i(c)}o=l.length;var g=function(e){if(e)return n.highlight=p,i(e);var t;try{t=r.parse(l,n)}catch(s){e=s}return n.highlight=p,e?i(e):i(null,t)};if(!p||p.length<3)return g();if(delete n.highlight,!o)return g();for(;u<l.length;u++)!function(e){return"code"!==e.type?--o||g():p(e.text,e.lang,function(t,n){return t?g(t):null==n||n===e.text?--o||g():(e.text=n,e.escaped=!0,void(--o||g()))})}(l[u])}else try{return n&&(n=h({},a.defaults,n)),r.parse(e.lex(t,n),n)}catch(c){if(c.message+="\nPlease report this to https://github.com/chjj/marked.",(n||a.defaults).silent)return"<p>An error occured:</p><pre>"+s(c.message+"",!0)+"</pre>";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].split(/ *\| */);this.tokens.push(h)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(h)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var u={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};u._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,u._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+s(t,!0)+'">'+(n?e:s(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"\n</code></pre>"},n.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},n.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},n.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},n.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},n.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},n.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},n.prototype.strong=function(e){return"<strong>"+e+"</strong>"},n.prototype.em=function(e){return"<em>"+e+"</em>"},n.prototype.codespan=function(e){return"<code>"+e+"</code>"},n.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.prototype.del=function(e){return"<del>"+e+"</del>"},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"},n.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",s=0;s<t.length;s++)n+=this.renderer.tablecell(this.inline.output(t[s]),{header:!1,align:this.token.align[s]});l+=this.renderer.tablerow(n)}return this.renderer.table(i,l);case"blockquote_start":for(var l="";"blockquote_end"!==this.next().type;)l+=this.tok();return this.renderer.blockquote(l);case"list_start":for(var l="",o=this.token.ordered;"list_end"!==this.next().type;)l+=this.tok();return this.renderer.list(l,o);case"list_item_start":for(var l="";"list_item_end"!==this.next().type;)l+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(l);case"loose_item_start":for(var l="";"list_item_end"!==this.next().type;)l+=this.tok();return this.renderer.listitem(l);case"html":var h=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(h);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},o.exec=o,a.options=a.setOptions=function(e){return h(a.defaults,e),a},a.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new n,xhtml:!1},a.Parser=r,a.parser=r.parse,a.Renderer=n,a.Lexer=e,a.lexer=e.lex,a.InlineLexer=t,a.inlineLexer=t.output,a.parse=a,"undefined"!=typeof module&&"object"==typeof exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):this.marked=a}).call(function(){return this||("undefined"!=typeof window?window:global)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)});
