Vehicle-Anti-Theft-Face-Rec.../venv/Lib/site-packages/notebook/static/edit/js/main.min.js.map

78 lines
1.7 MiB
Text
Raw Normal View History

2020-11-12 16:05:57 +00:00
{
"version": 3,
"sources": [
"components/jquery/jquery.min.js",
"base/js/namespace.js",
"components/codemirror/lib/codemirror.js",
"components/moment/min/moment-with-locales.js",
"components/underscore/underscore-min.js",
"components/codemirror/mode/meta.js",
"base/js/utils.js",
"base/js/events.js",
"base/js/page.js",
"services/config.js",
"components/jed/jed.js",
"base/js/i18n.js",
"components/bootstrap/dist/js/bootstrap.min.js",
"base/js/dialog.js",
"components/codemirror/addon/comment/comment.js",
"components/codemirror/addon/dialog/dialog.js",
"components/codemirror/addon/edit/closebrackets.js",
"components/codemirror/addon/edit/matchbrackets.js",
"components/codemirror/addon/search/searchcursor.js",
"components/codemirror/addon/search/search.js",
"components/codemirror/keymap/emacs.js",
"components/codemirror/keymap/sublime.js",
"components/codemirror/keymap/vim.js",
"edit/js/editor.js",
"edit/js/menubar.js",
"base/js/keyboard.js",
"bidi/numericshaping.js",
"bidi/bidi.js",
"edit/js/savewidget.js",
"base/js/notificationwidget.js",
"base/js/notificationarea.js",
"edit/js/notificationarea.js",
"auth/js/loginwidget.js",
"edit/js/main.js"
],
"names": [],
"mappings": "AAAA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
"file": "main.min.js",
"sourcesContent": [
"/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */\n!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return t(e)}:t(e)}(\"undefined\"!=typeof window?window:this,function(C,e){\"use strict\";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return\"function\"==typeof e&&\"number\"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement(\"script\");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[o.call(e)]||\"object\":typeof e}var f=\"3.5.1\",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&\"length\"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for(\"boolean\"==typeof a&&(l=a,a=arguments[s]||{},s++),\"object\"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],\"__proto__\"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:\"jQuery\"+(f+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==o.call(e))&&(!(t=r(e))||\"function\"==typeof(n=v.call(t,\"constructor\")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,\"string\"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),\"function\"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){n[\"[object \"+t+\"]\"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S=\"sizzle\"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\nvar Jupyter = Jupyter || {};\n\nvar jprop = function(name, module_path){\n Object.defineProperty(Jupyter, name, {\n get: function() { \n console.warn('accessing `'+name+'` is deprecated. Use `requirejs(\"'+module_path+'\")`');\n return requirejs(module_path); \n },\n enumerable: true,\n configurable: false\n });\n}\n\nvar jglobal = function(name, module_path){\n Object.defineProperty(Jupyter, name, {\n get: function() { \n console.warn('accessing `'+name+'` is deprecated. Use `requirejs(\"'+module_path+'\").'+name+'`');\n return requirejs(module_path)[name]; \n },\n enumerable: true,\n configurable: false\n });\n}\n\ndefine('base/js/namespace',[],function(){\n \"use strict\";\n\n // expose modules\n \n jprop('utils','base/js/utils')\n \n //Jupyter.load_extensions = Jupyter.utils.load_extensions;\n // \n jprop('security','base/js/security');\n jprop('keyboard','base/js/keyboard');\n jprop('dialog','base/js/dialog');\n jprop('mathjaxutils','notebook/js/mathjaxutils');\n\n\n //// exposed constructors\n jglobal('CommManager','services/kernels/comm')\n jglobal('Comm','services/kernels/comm')\n\n jglobal('NotificationWidget','base/js/notificationwidget');\n jglobal('Kernel','services/kernels/kernel');\n jglobal('Session','services/sessions/session');\n jglobal('LoginWidget','auth/js/loginwidget');\n jglobal('Page','base/js/page');\n\n // notebook\n jglobal('TextCell','notebook/js/textcell');\n jglobal('OutputArea','notebook/js/outputarea');\n jglobal('KeyboardManager','notebook/js/keyboardmanager');\n jglobal('Completer','notebook/js/completer');\n jglobal('Notebook','notebook/js/notebook');\n jglobal('Tooltip','notebook/js/tooltip');\n jglobal('Toolbar','notebook/js/toolbar');\n jglobal('SaveWidget','notebook/js/savewidget');\n jglobal('Pager','notebook/js/pager');\n jglobal('QuickHelp','notebook/js/quickhelp');\n jglobal('MarkdownCell','notebook/js/textcell');\n jglobal('RawCell','notebook/js/textcell');\n jglobal('Cell','notebook/js/cell');\n jglobal('MainToolBar','notebook/js/maintoolbar');\n jglobal('NotebookNotificationArea','notebook/js/notificationarea');\n jglobal('NotebookTour', 'notebook/js/tour');\n jglobal('MenuBar', 'notebook/js/menubar');\n\n // tree\n jglobal('SessionList','tree/js/sessionlist');\n\n Jupyter.version = \"6.1.5\";\n Jupyter._target = '_blank';\n\n return Jupyter;\n});\n\n// deprecated since 4.0, remove in 5+\nvar IPython = Jupyter;\n\n",
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('codemirror/lib/codemirror',factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);
";(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('moment',factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\nvar hookCallback;\n\nfunction hooks () {\n return hookCallback.apply(null, arguments);\n}\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\nfunction setHookCallback (callback) {\n hookCallback = callback;\n}\n\nfunction isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n}\n\nfunction isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n}\n\nfunction isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return (Object.getOwnPropertyNames(obj).length === 0);\n } else {\n var k;\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n return false;\n }\n }\n return true;\n }\n}\n\nfunction isUndefined(input) {\n return input === void 0;\n}\n\nfunction isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n}\n\nfunction isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n}\n\nfunction map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n}\n\nfunction hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n}\n\nfunction extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n}\n\nfunction createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n}\n\nfunction defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null,\n rfc2822 : false,\n weekdayMismatch : false\n };\n}\n\nfunction getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n}\n\nvar some;\nif (Array.prototype.some) {\n some = Array.prototype.some;\n} else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n}\n\nfunction isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n f
"// Underscore.js 1.8.3\n// http://underscorejs.org\n// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if(\"number\"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i=\"constructor\";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};\"undefined\"!=typeof exports?(\"undefined\"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION=\"1.8.3\";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w(\"length\"),k=function(n){var t=O(n);return\"number\"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),(\"number\"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/mode/meta',[\"../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n CodeMirror.modeInfo = [\n {name: \"APL\", mime: \"text/apl\", mode: \"apl\", ext: [\"dyalog\", \"apl\"]},\n {name: \"PGP\", mimes: [\"application/pgp\", \"application/pgp-encrypted\", \"application/pgp-keys\", \"application/pgp-signature\"], mode: \"asciiarmor\", ext: [\"asc\", \"pgp\", \"sig\"]},\n {name: \"ASN.1\", mime: \"text/x-ttcn-asn\", mode: \"asn.1\", ext: [\"asn\", \"asn1\"]},\n {name: \"Asterisk\", mime: \"text/x-asterisk\", mode: \"asterisk\", file: /^extensions\\.conf$/i},\n {name: \"Brainfuck\", mime: \"text/x-brainfuck\", mode: \"brainfuck\", ext: [\"b\", \"bf\"]},\n {name: \"C\", mime: \"text/x-csrc\", mode: \"clike\", ext: [\"c\", \"h\", \"ino\"]},\n {name: \"C++\", mime: \"text/x-c++src\", mode: \"clike\", ext: [\"cpp\", \"c++\", \"cc\", \"cxx\", \"hpp\", \"h++\", \"hh\", \"hxx\"], alias: [\"cpp\"]},\n {name: \"Cobol\", mime: \"text/x-cobol\", mode: \"cobol\", ext: [\"cob\", \"cpy\"]},\n {name: \"C#\", mime: \"text/x-csharp\", mode: \"clike\", ext: [\"cs\"], alias: [\"csharp\", \"cs\"]},\n {name: \"Clojure\", mime: \"text/x-clojure\", mode: \"clojure\", ext: [\"clj\", \"cljc\", \"cljx\"]},\n {name: \"ClojureScript\", mime: \"text/x-clojurescript\", mode: \"clojure\", ext: [\"cljs\"]},\n {name: \"Closure Stylesheets (GSS)\", mime: \"text/x-gss\", mode: \"css\", ext: [\"gss\"]},\n {name: \"CMake\", mime: \"text/x-cmake\", mode: \"cmake\", ext: [\"cmake\", \"cmake.in\"], file: /^CMakeLists.txt$/},\n {name: \"CoffeeScript\", mimes: [\"application/vnd.coffeescript\", \"text/coffeescript\", \"text/x-coffeescript\"], mode: \"coffeescript\", ext: [\"coffee\"], alias: [\"coffee\", \"coffee-script\"]},\n {name: \"Common Lisp\", mime: \"text/x-common-lisp\", mode: \"commonlisp\", ext: [\"cl\", \"lisp\", \"el\"], alias: [\"lisp\"]},\n {name: \"Cypher\", mime: \"application/x-cypher-query\", mode: \"cypher\", ext: [\"cyp\", \"cypher\"]},\n {name: \"Cython\", mime: \"text/x-cython\", mode: \"python\", ext: [\"pyx\", \"pxd\", \"pxi\"]},\n {name: \"Crystal\", mime: \"text/x-crystal\", mode: \"crystal\", ext: [\"cr\"]},\n {name: \"CSS\", mime: \"text/css\", mode: \"css\", ext: [\"css\"]},\n {name: \"CQL\", mime: \"text/x-cassandra\", mode: \"sql\", ext: [\"cql\"]},\n {name: \"D\", mime: \"text/x-d\", mode: \"d\", ext: [\"d\"]},\n {name: \"Dart\", mimes: [\"application/dart\", \"text/x-dart\"], mode: \"dart\", ext: [\"dart\"]},\n {name: \"diff\", mime: \"text/x-diff\", mode: \"diff\", ext: [\"diff\", \"patch\"]},\n {name: \"Django\", mime: \"text/x-django\", mode: \"django\"},\n {name: \"Dockerfile\", mime: \"text/x-dockerfile\", mode: \"dockerfile\", file: /^Dockerfile$/},\n {name: \"DTD\", mime: \"application/xml-dtd\", mode: \"dtd\", ext: [\"dtd\"]},\n {name: \"Dylan\", mime: \"text/x-dylan\", mode: \"dylan\", ext: [\"dylan\", \"dyl\", \"intr\"]},\n {name: \"EBNF\", mime: \"text/x-ebnf\", mode: \"ebnf\"},\n {name: \"ECL\", mime: \"text/x-ecl\", mode: \"ecl\", ext: [\"ecl\"]},\n {name: \"edn\", mime: \"application/edn\", mode: \"clojure\", ext: [\"edn\"]},\n {name: \"Eiffel\", mime: \"text/x-eiffel\", mode: \"eiffel\", ext: [\"e\"]},\n {name: \"Elm\", mime: \"text/x-elm\", mode: \"elm\", ext: [\"elm\"]},\n {name: \"Embedded Javascript\", mime: \"application/x-ejs\", mode: \"htmlembedded\", ext: [\"ejs\"]},\n {name: \"Embedded Ruby\", mime: \"application/x-erb\", mode: \"htmlembedded\", ext: [\"erb\"]},\n {name: \"Erlang\", mime: \"text/x-erlang\", mode: \"erlang\", ext: [\"erl\"]},\n {name: \"Esper\", mime: \"text
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('base/js/utils',[\n 'jquery',\n 'codemirror/lib/codemirror',\n 'moment',\n 'underscore',\n // silently upgrades CodeMirror\n 'codemirror/mode/meta',\n], function($, CodeMirror, moment, _){\n \"use strict\";\n \n // keep track of which extensions have been loaded already\n var extensions_loaded = [];\n\n /**\n * Whether or not an extension has been loaded\n * @param {string} extension - name of the extension\n * @return {boolean} true if loaded already\n */\n var is_loaded = function(extension) {\n var ext_path = \"nbextensions/\" + extension;\n return extensions_loaded.indexOf(ext_path) >= 0;\n };\n\n /**\n * Load a single extension.\n * @param {string} extension - extension path.\n * @return {Promise} that resolves to an extension module handle\n */\n var load_extension = function (extension) {\n return new Promise(function(resolve, reject) {\n var ext_path = \"nbextensions/\" + extension;\n requirejs([ext_path], function(module) {\n if (!is_loaded(extension)) {\n console.log(\"Loading extension: \" + extension);\n if (module && module.load_ipython_extension) {\n Promise.resolve(module.load_ipython_extension()).then(function() {\n resolve(module);\n }).catch(reject);\n }\n extensions_loaded.push(ext_path);\n } else {\n console.log(\"Loaded extension already: \" + extension);\n resolve(module);\n }\n }, function(err) {\n reject(err);\n });\n });\n };\n\n /**\n * Load multiple extensions.\n * Takes n-args, where each arg is a string path to the extension.\n * @return {Promise} that resolves to a list of loaded module handles.\n */\n var load_extensions = function () {\n console.log('load_extensions', arguments);\n return Promise.all(Array.prototype.map.call(arguments, load_extension)).catch(function(err) {\n console.error(\"Failed to load extension\" + (err.requireModules.length>1?'s':'') + \":\", err.requireModules, err);\n });\n };\n\n /**\n * Return a list of extensions that should be active\n * The config for nbextensions comes in as a dict where keys are\n * nbextensions paths and the values are a bool indicating if it\n * should be active. This returns a list of nbextension paths\n * where the value is true\n */\n function filter_extensions(nbext_config) {\n var active = [];\n Object.keys(nbext_config).forEach(function (nbext) {\n if (nbext_config[nbext]) {active.push(nbext);}\n });\n return active;\n }\n\n /**\n * Wait for a config section to load, and then load the extensions specified\n * in a 'load_extensions' key inside it.\n */\n function load_extensions_from_config(section) {\n return section.loaded.then(function() {\n if (section.data.load_extensions) {\n var active = filter_extensions(section.data.load_extensions);\n return load_extensions.apply(this, active);\n }\n }).catch(utils.reject('Could not load nbextensions from ' + section.section_name + ' config file'));\n }\n\n //============================================================================\n // Cross-browser RegEx Split\n //============================================================================\n\n // This code has been MODIFIED from the code licensed below to not replace the\n // default browser split. The license is reproduced here.\n\n // see http://blog.stevenlevithan.com/archives/cross-browser-split for more info:\n /*!\n * Cross-Browser Split 1.1.1\n * Copyright 2007-2012
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Give us an object to bind all events to. This object should be created\n// before all other objects so it exists when others register event handlers.\n// To register an event handler:\n//\n// requirejs(['base/js/events'], function (events) {\n// events.on(\"event.Namespace\", function () { do_stuff(); });\n// });\n\ndefine('base/js/events',['jquery', 'base/js/namespace'], function($, Jupyter) {\n \"use strict\";\n \n // Events singleton\n if (!window._Events) {\n window._Events = function () {};\n window._events = new window._Events();\n }\n \n // Backwards compatibility.\n Jupyter.Events = window._Events;\n Jupyter.events = window._events;\n \n var events = $([window._events]);\n\n // catch and log errors in triggered events\n events._original_trigger = events.trigger;\n events.trigger = function (name, data) {\n try {\n this._original_trigger.apply(this, arguments);\n } catch (e) {\n console.error(\"Exception in event handler for \" + name, e, arguments);\n }\n }\n return events;\n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('base/js/page',[\n 'jquery',\n 'base/js/events',\n], function($, events){\n \"use strict\";\n\n var Page = function (header_div_selector, site_div_selector) {\n /**\n * Constructor\n *\n * Parameters\n * header_div_selector: string\n * site_div_selector: string\n */\n this.header_div_element = $(header_div_selector || 'div#header');\n this.site_div_element = $(site_div_selector || 'div#site');\n\n this.bind_events();\n };\n\n Page.prototype.bind_events = function () {\n // resize site on:\n // - window resize\n // - header change\n // - page load\n var _handle_resize = $.proxy(this._resize_site, this);\n\n $(window).resize(_handle_resize);\n\n // On document ready, resize codemirror.\n $(document).ready(_handle_resize);\n events.on('resize-header.Page', _handle_resize);\n };\n\n Page.prototype.show = function () {\n /**\n * The header and site divs start out hidden to prevent FLOUC.\n * Main scripts should call this method after styling everything.\n */\n this.show_header();\n this.show_site();\n };\n\n Page.prototype.show_header = function () {\n /**\n * The header and site divs start out hidden to prevent FLOUC.\n * Main scripts should call this method after styling everything.\n */\n this.header_div_element.css('display','block');\n };\n\n Page.prototype.show_site = function () {\n /**\n * The header and site divs start out hidden to prevent FLOUC.\n * Main scripts should call this method after styling everything.\n */\n this.site_div_element.css('display', 'block');\n this._resize_site();\n };\n\n Page.prototype._resize_site = function(e) {\n /**\n * Update the site's size.\n */\n\n // In the case an event is passed in, only trigger if the event does\n // *not* have a target DOM node (i.e., it is not bubbling up). See\n // https://bugs.jquery.com/ticket/9841#comment:8\n if (!(e && e.target && e.target.tagName)) {\n $('div#site').height($(window).height() - $('#header').height());\n }\n };\n\n return {'Page': Page};\n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('services/config',[\n 'base/js/utils',\n ],\nfunction(utils) {\n \"use strict\";\n var ConfigSection = function(section_name, options) {\n this.section_name = section_name;\n this.base_url = options.base_url;\n this.data = {};\n \n var that = this;\n \n /* .loaded is a promise, fulfilled the first time the config is loaded\n * from the server. Code can do:\n * conf.loaded.then(function() { ... using conf.data ... });\n */\n this._one_load_finished = false;\n this.loaded = new Promise(function(resolve, reject) {\n that._finish_firstload = resolve;\n });\n };\n\n ConfigSection.prototype.api_url = function() {\n return utils.url_path_join(this.base_url, 'api/config',\n utils.encode_uri_components(this.section_name));\n };\n \n ConfigSection.prototype._load_done = function() {\n if (!this._one_load_finished) {\n this._one_load_finished = true;\n this._finish_firstload();\n }\n };\n \n ConfigSection.prototype.load = function() {\n var that = this;\n return utils.promising_ajax(this.api_url(), {\n cache: false,\n type: \"GET\",\n dataType: \"json\",\n }).then(function(data) {\n that.data = data;\n that._load_done();\n return data;\n });\n };\n \n /**\n * Modify the config values stored. Update the local data immediately,\n * send the change to the server, and use the updated data from the server\n * when the reply comes.\n */\n ConfigSection.prototype.update = function(newdata) {\n $.extend(true, this.data, newdata); // true -> recursive update\n \n var that = this;\n return utils.promising_ajax(this.api_url(), {\n processData: false,\n type : \"PATCH\",\n data: JSON.stringify(newdata),\n dataType : \"json\",\n contentType: 'application/json',\n }).then(function(data) {\n that.data = data;\n that._load_done();\n return data;\n });\n };\n \n \n var ConfigWithDefaults = function(section, defaults, classname) {\n this.section = section;\n this.defaults = defaults;\n this.classname = classname;\n };\n \n ConfigWithDefaults.prototype._class_data = function() {\n if (this.classname) {\n return this.section.data[this.classname] || {};\n } else {\n return this.section.data;\n }\n };\n \n /**\n * Wait for config to have loaded, then get a value or the default.\n * Returns a promise.\n */\n ConfigWithDefaults.prototype.get = function(key) {\n var that = this;\n return this.section.loaded.then(function() {\n return that.get_sync(key);\n });\n };\n \n /**\n * Return a config value. If config is not yet loaded, return the default\n * instead of waiting for it to load.\n */\n ConfigWithDefaults.prototype.get_sync = function(key) {\n var data = this._class_data();\n if (key === undefined) {\n // no key specified, return full config data\n return $.extend(true, {}, this.defaults, data);\n }\n\n var value = data[key];\n if (value !== undefined) {\n if (typeof value == 'object') {\n // merge with defaults if it's an object\n return $.extend(true, {}, this.defaults[key], value);\n } else {\n return value;\n }\n }\n return this.defaults[key];\n };\n \n /**\n * Set a config value. Send the update to the server, and change our\n * local copy of the data immediately.\n * Returns a promise which is fulfilled when the server replies to the\n * change.\n
"/**\n * @preserve jed.js https://github.com/SlexAxton/Jed\n */\n/*\n-----------\nA gettext compatible i18n library for modern JavaScript Applications\n\nby Alex Sexton - AlexSexton [at] gmail - @SlexAxton\n\nMIT License\n\nA jQuery Foundation project - requires CLA to contribute -\nhttps://contribute.jquery.org/CLA/\n\n\n\nJed offers the entire applicable GNU gettext spec'd set of\nfunctions, but also offers some nicer wrappers around them.\nThe api for gettext was written for a language with no function\noverloading, so Jed allows a little more of that.\n\nMany thanks to Joshua I. Miller - unrtst@cpan.org - who wrote\ngettext.js back in 2008. I was able to vet a lot of my ideas\nagainst his. I also made sure Jed passed against his tests\nin order to offer easy upgrades -- jsgettext.berlios.de\n*/\n(function (root, undef) {\n\n // Set up some underscore-style functions, if you already have\n // underscore, feel free to delete this section, and use it\n // directly, however, the amount of functions used doesn't\n // warrant having underscore as a full dependency.\n // Underscore 1.3.0 was used to port and is licensed\n // under the MIT License by Jeremy Ashkenas.\n var ArrayProto = Array.prototype,\n ObjProto = Object.prototype,\n slice = ArrayProto.slice,\n hasOwnProp = ObjProto.hasOwnProperty,\n nativeForEach = ArrayProto.forEach,\n breaker = {};\n\n // We're not using the OOP style _ so we don't need the\n // extra level of indirection. This still means that you\n // sub out for real `_` though.\n var _ = {\n forEach : function( obj, iterator, context ) {\n var i, l, key;\n if ( obj === null ) {\n return;\n }\n\n if ( nativeForEach && obj.forEach === nativeForEach ) {\n obj.forEach( iterator, context );\n }\n else if ( obj.length === +obj.length ) {\n for ( i = 0, l = obj.length; i < l; i++ ) {\n if ( i in obj && iterator.call( context, obj[i], i, obj ) === breaker ) {\n return;\n }\n }\n }\n else {\n for ( key in obj) {\n if ( hasOwnProp.call( obj, key ) ) {\n if ( iterator.call (context, obj[key], key, obj ) === breaker ) {\n return;\n }\n }\n }\n }\n },\n extend : function( obj ) {\n this.forEach( slice.call( arguments, 1 ), function ( source ) {\n for ( var prop in source ) {\n obj[prop] = source[prop];\n }\n });\n return obj;\n }\n };\n // END Miniature underscore impl\n\n // Jed is a constructor function\n var Jed = function ( options ) {\n // Some minimal defaults\n this.defaults = {\n \"locale_data\" : {\n \"messages\" : {\n \"\" : {\n \"domain\" : \"messages\",\n \"lang\" : \"en\",\n \"plural_forms\" : \"nplurals=2; plural=(n != 1);\"\n }\n // There are no default keys, though\n }\n },\n // The default domain if one is missing\n \"domain\" : \"messages\",\n // enable debug mode to log untranslated strings to the console\n \"debug\" : false\n };\n\n // Mix in the sent options with the default options\n this.options = _.extend( {}, this.defaults, options );\n this.textdomain( this.options.domain );\n\n if ( options.domain && ! this.options.locale_data[ this.options.domain ] ) {\n throw new Error('Text domain set to non-existent domain: `' + options.domain + '`');\n }\n };\n\n // The gettext spec sets this character as the default\n // delimiter for context lookups.\n // e.g.: context\\u0004key\n // If your translation company uses something different,\n // just change this at any time and it will use that instead.\n Jed.context_delimiter = String.fromCharCode( 4 );\n\n function getPluralFormFunc ( plural_form_string ) {\n return Jed.PF.compile( plural_form_string || \"nplurals=2; plural=(n != 1);\");\n }\n\n function Chain( key, i18n ){\n this._key = key;\n this._i
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Module to handle i18n ( Internationalization ) and translated UI\n\ndefine('base/js/i18n',[\n 'jed'\n\t], function(Jed) {\n \"use strict\";\n\n var i18n = new Jed(document.nbjs_translations);\n i18n._ = i18n.gettext;\n i18n.msg = i18n; // Just a place holder until the init promise resolves.\n\n return i18n;\n});\n\n",
"/*!\n * Bootstrap v3.4.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under the MIT license\n */\nif(\"undefined\"==typeof jQuery)throw new Error(\"Bootstrap's JavaScript requires jQuery\");!function(t){\"use strict\";var e=jQuery.fn.jquery.split(\" \")[0].split(\".\");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error(\"Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4\")}(),function(n){\"use strict\";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one(\"bsTransitionEnd\",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement(\"bootstrap\"),e={WebkitTransition:\"webkitTransitionEnd\",MozTransition:\"transitionend\",OTransition:\"oTransitionEnd otransitionend\",transition:\"transitionend\"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){\"use strict\";var e='[data-dismiss=\"alert\"]',a=function(t){s(t).on(\"click\",e,this.close)};a.VERSION=\"3.4.1\",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr(\"data-target\");i||(i=(i=e.attr(\"href\"))&&i.replace(/.*(?=#[^\\s]*$)/,\"\")),i=\"#\"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger(\"closed.bs.alert\").remove()}t&&t.preventDefault(),o.length||(o=e.closest(\".alert\")),o.trigger(t=s.Event(\"close.bs.alert\")),t.isDefaultPrevented()||(o.removeClass(\"in\"),s.support.transition&&o.hasClass(\"fade\")?o.one(\"bsTransitionEnd\",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data(\"bs.alert\");e||t.data(\"bs.alert\",e=new a(this)),\"string\"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on(\"click.bs.alert.data-api\",e,a.prototype.close)}(jQuery),function(s){\"use strict\";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data(\"bs.button\"),i=\"object\"==typeof o&&o;e||t.data(\"bs.button\",e=new n(this,i)),\"toggle\"==o?e.toggle():o&&e.setState(o)})}n.VERSION=\"3.4.1\",n.DEFAULTS={loadingText:\"loading...\"},n.prototype.setState=function(t){var e=\"disabled\",i=this.$element,o=i.is(\"input\")?\"val\":\"html\",n=i.data();t+=\"Text\",null==n.resetText&&i.data(\"resetText\",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),\"loadingText\"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle=\"buttons\"]');if(e.length){var i=this.$element.find(\"input\");\"radio\"==i.prop(\"type\")?(i.prop(\"checked\")&&(t=!1),e.find(\".active\").removeClass(\"active\"),this.$element.addClass(\"active\")):\"checkbox\"==i.prop(\"type\")&&(i.prop(\"checked\")!==this.$element.hasClass(\"active\")&&(t=!1),this.$element.toggleClass(\"active\")),i.prop(\"checked\",this.$element.hasClass(\"active\")),t&&i.trigger(\"change\")}else this.$element.attr(\"aria-pressed\",!this.$element.hasClass(\"active\")),this.$element.toggleClass(\"active\")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on(\"click.bs.button.data-api\",'[data-toggle^=\"button\"]',function(t){var e=s(t.target).closest(\".btn\");i.call(e,\"toggle\"),s(t.target).is('input[type=\"radio\"], input[type=\"checkbox\"]')||(t.preventDefault(),e.is(\"input,button\")?e.trigger(\"focus\"):e.find(\"input:visible,button:visible\").first().trigger(\"focus\"))}).on(\"focu
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('base/js/dialog',['jquery',\n 'codemirror/lib/codemirror',\n 'bootstrap',\n\t'base/js/i18n'],\n\tfunction($, CodeMirror, bs, i18n) {\n \"use strict\";\n\n /**\n * A wrapper around bootstrap modal for easier use\n * Pass it an option dictionary with the following properties:\n *\n * - body : <string> or <DOM node>, main content of the dialog\n * if pass a <string> it will be wrapped in a p tag and\n * html element escaped, unless you specify sanitize=false\n * option.\n * - title : Dialog title, default to empty string.\n * - buttons : dict of btn_options who keys are button label.\n * see btn_options below for description\n * - open : callback to trigger on dialog open.\n * - destroy:\n * - notebook : notebook instance\n * - keyboard_manager: keyboard manager instance.\n *\n * Unlike bootstrap modals, the backdrop options is set by default \n * to 'static'.\n *\n * The rest of the options are passed as is to bootstrap modals. \n *\n * btn_options: dict with the following property:\n * \n * - click : callback to trigger on click\n * - class : css classes to add to button.\n *\n *\n *\n **/\n var modal = function (options) {\n\n var modal = $(\"<div/>\")\n .addClass(\"modal\")\n .addClass(\"fade\")\n .attr(\"role\", \"dialog\");\n var dialog = $(\"<div/>\")\n .addClass(\"modal-dialog\")\n .appendTo(modal);\n var dialog_content = $(\"<div/>\")\n .addClass(\"modal-content\")\n .appendTo(dialog);\n if(typeof(options.body) === 'string' && options.sanitize !== false){\n options.body = $(\"<p/>\").text(options.body);\n }\n dialog_content.append(\n $(\"<div/>\")\n .addClass(\"modal-header\")\n .mousedown(function() {\n $(\".modal\").draggable({handle: '.modal-header'});\n })\n .append($(\"<button>\")\n .attr(\"type\", \"button\")\n .attr(\"aria-label\", i18n.msg._(\"close\"))\n .addClass(\"close\")\n .attr(\"data-dismiss\", \"modal\")\n .attr(\"aria-hidden\", \"true\")\n .html(\"&times;\")\n ).append(\n $(\"<h4/>\")\n .addClass('modal-title')\n .text(options.title || \"\")\n )\n ).append(\n $(\"<div/>\")\n .addClass(\"modal-body\")\n .append(\n options.body || $(\"<p/>\")\n )\n );\n \n var footer = $(\"<div/>\").addClass(\"modal-footer\");\n \n var default_button;\n \n for (var label in options.buttons) {\n var btn_opts = options.buttons[label];\n var button = $(\"<button/>\")\n .addClass(\"btn btn-default btn-sm\")\n .attr(\"data-dismiss\", \"modal\")\n .text(i18n.msg.translate(label).fetch());\n if (btn_opts.id) {\n button.attr('id', btn_opts.id);\n }\n if (btn_opts.click) {\n button.click($.proxy(btn_opts.click, dialog_content));\n }\n if (btn_opts.class) {\n button.addClass(btn_opts.class);\n }\n footer.append(button);\n if (options.default_button && label === options.default_button) {\n default_button = button;\n }\n }\n if (!options.default_button) {\n default_button = footer.find(\"button\").last();\n }\n dialog_content.append(footer);\n // hook up on-open event\n modal.on(\"shown.bs.m
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/comment/comment',[\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var noOptions = {};\n var nonWS = /[^\\s\\u00a0]/;\n var Pos = CodeMirror.Pos;\n\n function firstNonWS(str) {\n var found = str.search(nonWS);\n return found == -1 ? 0 : found;\n }\n\n CodeMirror.commands.toggleComment = function(cm) {\n cm.toggleComment();\n };\n\n CodeMirror.defineExtension(\"toggleComment\", function(options) {\n if (!options) options = noOptions;\n var cm = this;\n var minLine = Infinity, ranges = this.listSelections(), mode = null;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var from = ranges[i].from(), to = ranges[i].to();\n if (from.line >= minLine) continue;\n if (to.line >= minLine) to = Pos(minLine, 0);\n minLine = from.line;\n if (mode == null) {\n if (cm.uncomment(from, to, options)) mode = \"un\";\n else { cm.lineComment(from, to, options); mode = \"line\"; }\n } else if (mode == \"un\") {\n cm.uncomment(from, to, options);\n } else {\n cm.lineComment(from, to, options);\n }\n }\n });\n\n // Rough heuristic to try and detect lines that are part of multi-line string\n function probablyInsideString(cm, pos, line) {\n return /\\bstring\\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\\'\\\"\\`]/.test(line)\n }\n\n function getMode(cm, pos) {\n var mode = cm.getMode()\n return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)\n }\n\n CodeMirror.defineExtension(\"lineComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var firstLine = self.getLine(from.line);\n if (firstLine == null || probablyInsideString(self, from, firstLine)) return;\n\n var commentString = options.lineComment || mode.lineComment;\n if (!commentString) {\n if (options.blockCommentStart || mode.blockCommentStart) {\n options.fullLines = true;\n self.blockComment(from, to, options);\n }\n return;\n }\n\n var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);\n var pad = options.padding == null ? \" \" : options.padding;\n var blankLines = options.commentBlankLines || from.line == to.line;\n\n self.operation(function() {\n if (options.indent) {\n var baseString = null;\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i);\n var whitespace = line.slice(0, firstNonWS(line));\n if (baseString == null || baseString.length > whitespace.length) {\n baseString = whitespace;\n }\n }\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i), cut = baseString.length;\n if (!blankLines && !nonWS.test(line)) continue;\n if (line.slice(0, cut) != baseString) cut = firstNonWS(line);\n self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));\n }\n } else {\n for (var i = from.line; i < end; ++i) {\n if (blankLines || nonWS.test(self.getLine(i)))\n self.replaceRange(commentString + pad, Pos(i, 0));\n }\n }\n });\n });\n\n CodeMirror.defineExtension(\"blockComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var startString = options.blockCommentStart || mode.blockCommentStart;\n var endString = options.blockCommentEnd || mode.blockCommentEnd;\n if (!startString || !endString) {\n if ((o
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/dialog/dialog',[\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom)\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n else\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n CodeMirror.addClass(wrap, 'dialog-opened');\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n if (!options) options = {};\n\n closeNotification(this, null);\n\n var dialog = dialogDiv(this, template, options.bottom);\n var closed = false, me = this;\n function close(newVal) {\n if (typeof newVal == 'string') {\n inp.value = newVal;\n } else {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n\n if (options.onClose) options.onClose(dialog);\n }\n }\n\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n inp.focus();\n\n if (options.value) {\n inp.value = options.value;\n if (options.selectValueOnOpen !== false) {\n inp.select();\n }\n }\n\n if (options.onInput)\n CodeMirror.on(inp, \"input\", function(e) { options.onInput(e, inp.value, close);});\n if (options.onKeyUp)\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n }\n if (e.keyCode == 13) callback(inp.value, e);\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(dialog, \"focusout\", function (evt) {\n if (evt.relatedTarget !== null) close();\n });\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(button, \"blur\", close);\n\n button.focus();\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/edit/closebrackets',[\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n cm.execCommand(\"goCharLeft\");\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == c
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/edit/matchbrackets',[\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < range
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/search/searchcursor',[\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"./searchcursor\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/addon/search/search',[\"../../lib/codemirror\", \"./searchcursor\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function searchOverlay(query, caseInsensitive) {\n if (typeof query == \"string\")\n query = new RegExp(query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), caseInsensitive ? \"gi\" : \"g\");\n else if (!query.global)\n query = new RegExp(query.source, query.ignoreCase ? \"gi\" : \"g\");\n\n return {token: function(stream) {\n query.lastIndex = stream.pos;\n var match = query.exec(stream.string);\n if (match && match.index == stream.pos) {\n stream.pos += match[0].length || 1;\n return \"searching\";\n } else if (match) {\n stream.pos = match.index;\n } else {\n stream.skipToEnd();\n }\n }};\n }\n\n function SearchState() {\n this.posFrom = this.posTo = this.lastQuery = this.query = null;\n this.overlay = null;\n }\n\n function getSearchState(cm) {\n return cm.state.search || (cm.state.search = new SearchState());\n }\n\n function queryCaseInsensitive(query) {\n return typeof query == \"string\" && query == query.toLowerCase();\n }\n\n function getSearchCursor(cm, query, pos) {\n // Heuristic: if the query string is all lowercase, do a case insensitive search.\n return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});\n }\n\n function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {\n cm.openDialog(text, onEnter, {\n value: deflt,\n selectValueOnOpen: true,\n closeOnEnter: false,\n onClose: function() { clearSearch(cm); },\n onKeyDown: onKeyDown\n });\n }\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});\n else f(prompt(shortText, deflt));\n }\n\n function confirmDialog(cm, text, shortText, fs) {\n if (cm.openConfirm) cm.openConfirm(text, fs);\n else if (confirm(shortText)) fs[0]();\n }\n\n function parseString(string) {\n return string.replace(/\\\\([nrt\\\\])/g, function(match, ch) {\n if (ch == \"n\") return \"\\n\"\n if (ch == \"r\") return \"\\r\"\n if (ch == \"t\") return \"\\t\"\n if (ch == \"\\\\\") return \"\\\\\"\n return match\n })\n }\n\n function parseQuery(query) {\n var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n if (isRE) {\n try { query = new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\"); }\n catch(e) {} // Not a regular expression after all, do a string search\n } else {\n query = parseString(query)\n }\n if (typeof query == \"string\" ? query == \"\" : query.test(\"\"))\n query = /x^/;\n return query;\n }\n\n function startSearch(cm, state, query) {\n state.queryText = query;\n state.query = parseQuery(query);\n cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));\n state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));\n cm.addOverlay(state.overlay);\n if (cm.showMatchesOnScrollbar) {\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n state.annotate = cm.showMatchesOn
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/keymap/emacs',[\"../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }\n\n // Kill 'ring'\n\n var killRing = [];\n function addToRing(str) {\n killRing.push(str);\n if (killRing.length > 50) killRing.shift();\n }\n function growRingTop(str) {\n if (!killRing.length) return addToRing(str);\n killRing[killRing.length - 1] += str;\n }\n function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || \"\"; }\n function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }\n\n var lastKill = null;\n\n function kill(cm, from, to, ring, text) {\n if (text == null) text = cm.getRange(from, to);\n\n if (ring == \"grow\" && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))\n growRingTop(text);\n else if (ring !== false)\n addToRing(text);\n cm.replaceRange(\"\", from, to, \"+delete\");\n\n if (ring == \"grow\") lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};\n else lastKill = null;\n }\n\n // Boundaries of various units\n\n function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }\n\n function byWord(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"word\", true);\n }\n\n function byLine(cm, pos, dir) {\n return cm.findPosV(pos, dir, \"line\", cm.doc.sel.goalColumn);\n }\n\n function byPage(cm, pos, dir) {\n return cm.findPosV(pos, dir, \"page\", cm.doc.sel.goalColumn);\n }\n\n function byParagraph(cm, pos, dir) {\n var no = pos.line, line = cm.getLine(no);\n var sawText = /\\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));\n var fst = cm.firstLine(), lst = cm.lastLine();\n for (;;) {\n no += dir;\n if (no < fst || no > lst)\n return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));\n line = cm.getLine(no);\n var hasText = /\\S/.test(line);\n if (hasText) sawText = true;\n else if (sawText) return Pos(no, 0);\n }\n }\n\n function bySentence(cm, pos, dir) {\n var line = pos.line, ch = pos.ch;\n var text = cm.getLine(pos.line), sawWord = false;\n for (;;) {\n var next = text.charAt(ch + (dir < 0 ? -1 : 0));\n if (!next) { // End/beginning of line reached\n if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);\n text = cm.getLine(line + dir);\n if (!/\\S/.test(text)) return Pos(line, ch);\n line += dir;\n ch = dir < 0 ? text.length : 0;\n continue;\n }\n if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));\n if (!sawWord) sawWord = /\\w/.test(next);\n ch += dir;\n }\n }\n\n function byExpr(cm, pos, dir) {\n var wrap;\n if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, {strict: true}))\n && wrap.match && (wrap.forward ? 1 : -1) == dir)\n return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;\n\n for (var first = true;; first = false) {\n var token = cm.getTokenAt(pos);\n var after = Pos(pos.line, dir < 0 ? token.start : token.end);\n if (first && dir > 0 && token.end == pos.ch || !/\\w/.test(token.string)) {\n var newPos = cm.findPosH(after, dir, \"char\");\n if (posEq(after, newPos)) return pos;\n else pos = newPos;\n } else {\n return after;\n }\n }\n }\n\n // Prefixes (only crudely supported)\n\n function getPrefix(cm, precise) {\n var digits = cm.state.emacsPrefix;\n if (!digits) return precise ? null : 1;\
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// A rough approximation of Sublime Text's keybindings\n// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/edit/matchbrackets\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/keymap/sublime',[\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var cmds = CodeMirror.commands;\n var Pos = CodeMirror.Pos;\n\n // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.\n function findPosSubword(doc, start, dir) {\n if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));\n var line = doc.getLine(start.line);\n if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));\n var state = \"start\", type, startPos = start.ch;\n for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {\n var next = line.charAt(dir < 0 ? pos - 1 : pos);\n var cat = next != \"_\" && CodeMirror.isWordChar(next) ? \"w\" : \"o\";\n if (cat == \"w\" && next.toUpperCase() == next) cat = \"W\";\n if (state == \"start\") {\n if (cat != \"o\") { state = \"in\"; type = cat; }\n else startPos = pos + dir\n } else if (state == \"in\") {\n if (type != cat) {\n if (type == \"w\" && cat == \"W\" && dir < 0) pos--;\n if (type == \"W\" && cat == \"w\" && dir > 0) { // From uppercase to lowercase\n if (pos == startPos + 1) { type = \"w\"; continue; }\n else pos--;\n }\n break;\n }\n }\n }\n return Pos(start.line, pos);\n }\n\n function moveSubword(cm, dir) {\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosSubword(cm.doc, range.head, dir);\n else\n return dir < 0 ? range.from() : range.to();\n });\n }\n\n cmds.goSubwordLeft = function(cm) { moveSubword(cm, -1); };\n cmds.goSubwordRight = function(cm) { moveSubword(cm, 1); };\n\n cmds.scrollLineUp = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, \"local\");\n if (cm.getCursor().line >= visibleBottomLine)\n cm.execCommand(\"goLineUp\");\n }\n cm.scrollTo(null, info.top - cm.defaultTextHeight());\n };\n cmds.scrollLineDown = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleTopLine = cm.lineAtHeight(info.top, \"local\")+1;\n if (cm.getCursor().line <= visibleTopLine)\n cm.execCommand(\"goLineDown\");\n }\n cm.scrollTo(null, info.top + cm.defaultTextHeight());\n };\n\n cmds.splitSelectionByLine = function(cm) {\n var ranges = cm.listSelections(), lineRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n for (var line = from.line; line <= to.line; ++line)\n if (!(to.line > from.line && line == to.line && to.ch == 0))\n lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),\n head: line == to.line ? to : Pos(line)});\n }\n cm.setSelections(lineRanges, 0);\n };\n\n cmds.singleSelectionTop = function(cm) {\n var range = cm.listSelections()[0];\n cm.setSelection(range.anchor, range.head, {scroll: false});\n };\n\n cmds.selectLine = function(cm) {\n var ranges = cm.listSelections(), extended = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n extended.pus
"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n/**\n * Supported keybindings:\n * Too many to list. Refer to defaultKeymap below.\n *\n * Supported Ex commands:\n * Refer to defaultExCommandMap below.\n *\n * Registers: unnamed, -, a-z, A-Z, 0-9\n * (Does not respect the special case for number registers when delete\n * operator is made with these commands: %, (, ), , /, ?, n, N, {, } )\n * TODO: Implement the remaining registers.\n *\n * Marks: a-z, A-Z, and 0-9\n * TODO: Implement the remaining special marks. They have more complex\n * behavior.\n *\n * Events:\n * 'vim-mode-change' - raised on the editor anytime the current mode changes,\n * Event object: {mode: \"visual\", subMode: \"linewise\"}\n *\n * Code structure:\n * 1. Default keymap\n * 2. Variable declarations and short basic helpers\n * 3. Instance (External API) implementation\n * 4. Internal state tracking objects (input state, counter) implementation\n * and instantiation\n * 5. Key handler (the main command dispatcher) implementation\n * 6. Motion, operator, and action implementations\n * 7. Helper functions for the key handler, motions, operators, and actions\n * 8. Set up Vim to work as a keymap for CodeMirror.\n * 9. Ex command implementations.\n */\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/dialog/dialog\"), require(\"../addon/edit/matchbrackets.js\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define('codemirror/keymap/vim',[\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/dialog/dialog\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n 'use strict';\n\n var defaultKeymap = [\n // Key to key mapping. This goes first to make it possible to override\n // existing mappings.\n { keys: '<Left>', type: 'keyToKey', toKeys: 'h' },\n { keys: '<Right>', type: 'keyToKey', toKeys: 'l' },\n { keys: '<Up>', type: 'keyToKey', toKeys: 'k' },\n { keys: '<Down>', type: 'keyToKey', toKeys: 'j' },\n { keys: '<Space>', type: 'keyToKey', toKeys: 'l' },\n { keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},\n { keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal'},\n { keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },\n { keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },\n { keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },\n { keys: '<S-BS>', type: 'keyToKey', toKeys: 'b', context: 'normal' },\n { keys: '<C-n>', type: 'keyToKey', toKeys: 'j' },\n { keys: '<C-p>', type: 'keyToKey', toKeys: 'k' },\n { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>' },\n { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },\n { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },\n { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },\n { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },\n { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},\n { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },\n { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },\n { keys: '<Home>', type: 'keyToKey', toKeys: '0' },\n { keys: '<End>', type: 'keyToKey', toKeys: '$' },\n { keys: '<PageUp>', type: 'keyToKey', toKeys: '<C-b>' },\n { keys: '<PageDown>', type: 'keyToKey', toKeys: '<C-f>' },\n { keys: '<CR>', type: 'keyToKey', toKeys: 'j^', context: 'normal' },\n { keys: '<Ins>', type: 'action', action: 'toggleOverwrite', context: 'insert' },\n // Motions\n { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }},\n { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('edit/js/editor',[\n 'jquery',\n 'base/js/utils',\n 'base/js/i18n',\n 'base/js/dialog',\n 'codemirror/lib/codemirror',\n 'codemirror/mode/meta',\n 'codemirror/addon/comment/comment',\n 'codemirror/addon/dialog/dialog',\n 'codemirror/addon/edit/closebrackets',\n 'codemirror/addon/edit/matchbrackets',\n 'codemirror/addon/search/searchcursor',\n 'codemirror/addon/search/search',\n 'codemirror/keymap/emacs',\n 'codemirror/keymap/sublime',\n 'codemirror/keymap/vim',\n ],\nfunction(\n $,\n utils,\n i18n,\n dialog,\n CodeMirror\n) {\n \"use strict\";\n\n var Editor = function(selector, options) {\n var that = this;\n this.selector = selector;\n this.clean = false;\n this.contents = options.contents;\n this.events = options.events;\n this.base_url = options.base_url;\n this.file_path = options.file_path;\n this.config = options.config;\n this.file_extension_modes = options.file_extension_modes || {};\n this.last_modified = null;\n this._changed_on_disk_dialog = null;\n\n this.codemirror = new CodeMirror($(this.selector)[0]);\n this.codemirror.on('changes', function(cm, changes){\n that._clean_state();\n });\n this.generation = -1;\n \n // It appears we have to set commands on the CodeMirror class, not the\n // instance. I'd like to be wrong, but since there should only be one CM\n // instance on the page, this is good enough for now.\n CodeMirror.commands.save = $.proxy(this.save, this);\n \n this.save_enabled = false;\n \n this.config.loaded.then(function () {\n // load codemirror config\n var cfg = that.config.data.Editor || {};\n var cmopts = $.extend(true, {}, // true = recursive copy\n Editor.default_codemirror_options,\n cfg.codemirror_options || {}\n );\n that._set_codemirror_options(cmopts);\n that.events.trigger('config_changed.Editor', {config: that.config});\n if (cfg.file_extension_modes) {\n // check for file extension in user preferences\n var modename = cfg.file_extension_modes[that._get_file_extension()];\n if (modename) {\n var modeinfo = CodeMirror.findModeByName(modename);\n if (modeinfo) {\n that.set_codemirror_mode(modeinfo);\n }\n }\n }\n that._clean_state();\n });\n this.clean_sel = $('<div/>');\n $('.last_modified').before(this.clean_sel);\n this.clean_sel.addClass('dirty-indicator-dirty');\n };\n \n // default CodeMirror options\n Editor.default_codemirror_options = {\n extraKeys: {\n \"Cmd-Right\": \"goLineRight\",\n \"End\": \"goLineRight\",\n \"Cmd-Left\": \"goLineLeft\",\n \"Tab\": \"indentMore\",\n \"Shift-Tab\" : \"indentLess\",\n \"Cmd-/\" : \"toggleComment\",\n \"Ctrl-/\" : \"toggleComment\",\n },\n indentUnit: 4,\n theme: \"ipython\",\n lineNumbers: true,\n lineWrapping: true\n };\n \n Editor.prototype.load = function() {\n /** load the file */\n var that = this;\n var cm = this.codemirror;\n return this.contents.get(this.file_path, {type: 'file', format: 'text'})\n .then(function(model) {\n cm.setValue(model.content);\n\n // Setting the file's initial value creates a history entry,\n // which we don't want.\n cm.clearHistory();\n that._set_mode_for_model(model);\n that.save_enabled = true;\n that.generation = cm.changeGeneration();\n that.events.tri
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('edit/js/menubar',[\n 'jquery',\n 'base/js/namespace',\n 'base/js/utils',\n 'base/js/dialog',\n 'codemirror/lib/codemirror',\n 'codemirror/mode/meta',\n], function($, IPython, utils, dialog, CodeMirror) {\n \"use strict\";\n \n var MenuBar = function (selector, options) {\n /**\n * Constructor\n *\n * A MenuBar Class to generate the menubar of IPython notebook\n *\n * Parameters:\n * selector: string\n * options: dictionary\n * Dictionary of keyword arguments.\n * codemirror: CodeMirror instance\n * contents: ContentManager instance\n * events: $(Events) instance\n * base_url : string\n * file_path : string\n */\n options = options || {};\n this.base_url = options.base_url || utils.get_body_data(\"baseUrl\");\n this.selector = selector;\n this.editor = options.editor;\n this.events = options.events;\n this.save_widget = options.save_widget;\n\n if (this.selector !== undefined) {\n this.element = $(selector);\n this.bind_events();\n }\n this._load_mode_menu();\n Object.seal(this);\n };\n\n MenuBar.prototype.bind_events = function () {\n var that = this;\n var editor = that.editor;\n \n // File\n this.element.find('#new-file').click(function () {\n var w = window.open(undefined, IPython._target);\n // Create a new file in the current directory\n var parent = utils.url_path_split(editor.file_path)[0];\n editor.contents.new_untitled(parent, {type: \"file\"}).then(\n function (data) {\n w.location = utils.url_path_join(\n that.base_url, 'edit', utils.encode_uri_components(data.path)\n );\n },\n function(error) {\n w.close();\n dialog.modal({\n title : 'Creating New File Failed',\n body : \"The error was: \" + error.message,\n buttons : {'OK' : {'class' : 'btn-primary'}}\n });\n }\n );\n });\n this.element.find('#save-file').click(function () {\n editor.save();\n });\n this.element.find('#rename-file').click(function () {\n that.save_widget.rename();\n });\n this.element.find('#download-file').click(function () {\n window.open(utils.url_path_join(\n that.base_url, 'files',\n utils.encode_uri_components(that.editor.file_path)\n ) + '?download=1');\n });\n \n // Edit\n this.element.find('#menu-find').click(function () {\n editor.codemirror.execCommand(\"find\");\n });\n this.element.find('#menu-replace').click(function () {\n editor.codemirror.execCommand(\"replace\");\n });\n this.element.find('#menu-keymap-default').click(function () {\n editor.update_codemirror_options({\n vimMode: false,\n keyMap: 'default'\n });\n });\n this.element.find('#menu-keymap-sublime').click(function () {\n editor.update_codemirror_options({\n vimMode: false,\n keyMap: 'sublime'\n });\n });\n this.element.find('#menu-keymap-emacs').click(function () {\n editor.update_codemirror_options({\n vimMode: false,\n keyMap: 'emacs'\n });\n });\n this.element.find('#menu-keymap-vim').click(function () {\n editor.update_codemirror_options({\n vimMode: true,\n keyMap: 'vim'\n });\n
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n *\n *\n * @module keyboard\n * @namespace keyboard\n * @class ShortcutManager\n */\n\ndefine('base/js/keyboard',[\n 'jquery',\n 'base/js/utils',\n 'underscore',\n], function($, utils, _) {\n \"use strict\";\n\n\n /**\n * Setup global keycodes and inverse keycodes.\n *\n * See http://unixpapa.com/js/key.html for a complete description. The short of\n * it is that there are different keycode sets. Firefox uses the \"Mozilla keycodes\"\n * and Webkit/IE use the \"IE keycodes\". These keycode sets are mostly the same\n * but have minor differences.\n **/\n\n // These apply to Firefox, (Webkit and IE)\n // This does work **only** on US keyboard.\n var _keycodes = {\n 'a': 65, 'b': 66, 'c': 67, 'd': 68, 'e': 69, 'f': 70, 'g': 71, 'h': 72, 'i': 73,\n 'j': 74, 'k': 75, 'l': 76, 'm': 77, 'n': 78, 'o': 79, 'p': 80, 'q': 81, 'r': 82,\n 's': 83, 't': 84, 'u': 85, 'v': 86, 'w': 87, 'x': 88, 'y': 89, 'z': 90,\n '1 !': 49, '2 @': 50, '3 #': 51, '4 $': 52, '5 %': 53, '6 ^': 54,\n '7 &': 55, '8 *': 56, '9 (': 57, '0 )': 48, \n '[ {': 219, '] }': 221, '` ~': 192, ', <': 188, '. >': 190, '/ ?': 191,\n '\\\\ |': 220, '\\' \"': 222,\n 'numpad0': 96, 'numpad1': 97, 'numpad2': 98, 'numpad3': 99, 'numpad4': 100,\n 'numpad5': 101, 'numpad6': 102, 'numpad7': 103, 'numpad8': 104, 'numpad9': 105,\n 'multiply': 106, 'add': 107, 'subtract': 109, 'decimal': 110, 'divide': 111,\n 'f1': 112, 'f2': 113, 'f3': 114, 'f4': 115, 'f5': 116, 'f6': 117, 'f7': 118,\n 'f8': 119, 'f9': 120, 'f10': 121, 'f11': 122, 'f12': 123, 'f13': 124, 'f14': 125, 'f15': 126,\n 'backspace': 8, 'tab': 9, 'enter': 13, 'shift': 16, 'ctrl': 17, 'alt': 18,\n 'meta': 91, 'capslock': 20, 'esc': 27, 'space': 32, 'pageup': 33, 'pagedown': 34,\n 'end': 35, 'home': 36, 'left': 37, 'up': 38, 'right': 39, 'down': 40,\n 'insert': 45, 'delete': 46, 'numlock': 144,\n };\n \n // These apply to Firefox and Opera\n var _mozilla_keycodes = {\n '; :': 59, '= +': 61, '- _': 173, 'meta': 224, 'minus':173\n };\n \n // This apply to Webkit and IE\n var _ie_keycodes = {\n '; :': 186, '= +': 187, '- _': 189, 'minus':189\n };\n \n var browser = utils.browser[0];\n var platform = utils.platform;\n \n if (browser === 'Firefox' || browser === 'Opera' || browser === 'Netscape') {\n $.extend(_keycodes, _mozilla_keycodes);\n } else if (browser === 'Safari' || browser === 'Chrome' || browser === 'MSIE') {\n $.extend(_keycodes, _ie_keycodes);\n }\n\n var keycodes = {};\n var inv_keycodes = {};\n for (var name in _keycodes) {\n var names = name.split(' ');\n if (names.length === 1) {\n var n = names[0];\n keycodes[n] = _keycodes[n];\n inv_keycodes[_keycodes[n]] = n;\n } else {\n var primary = names[0];\n var secondary = names[1];\n keycodes[primary] = _keycodes[name];\n keycodes[secondary] = _keycodes[name];\n inv_keycodes[_keycodes[name]] = primary;\n }\n }\n\n var normalize_key = function (key) {\n return inv_keycodes[keycodes[key]];\n };\n\n var normalize_shortcut = function (shortcut) {\n /**\n * @function _normalize_shortcut\n * @private\n * return a dict containing the normalized shortcut and the number of time it should be pressed:\n *\n * Put a shortcut into normalized form:\n * 1. Make lowercase\n * 2. Replace cmd by meta\n * 3. Sort '-' separated modifiers into the order alt-ctrl-meta-shift\n * 4. Normalize keys\n **/\n if (platform === 'MacOS') {\n shortcut = shortcut.toLowerCase().replace('cmdtrl-', 'cmd-');\n } else {\n shortcut = shortcut.toLowerCase().replace('cmdtrl-', 'ctrl-');\n
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('bidi/numericshaping',[],\n function(bidi) {\n \"use strict\";\n\t\n var regex = /([0-9])|([\\u0660-\\u0669])|([\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FF\\u0750-\\u077F\\u08A0-\\u08E3\\u200F\\u202B\\u202E\\u2067\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFC\\uFDFE-\\uFDFF\\uFE70-\\uFEFE]+)|([^0-9\\u0660-\\u0669\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FF\\u0750-\\u077F\\u08A0-\\u08E3\\u200F\\u202B\\u202E\\u2067\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFC\\uFDFE-\\uFDFF\\uFE70-\\uFEFE\\u0600-\\u0607\\u0609-\\u060A\\u060C\\u060E-\\u061A\\u064B-\\u066C\\u0670\\u06D6-\\u06E4\\u06E7-\\u06ED\\u06F0-\\u06F9\\u08E4-\\u08FF\\uFD3E-\\uFD3F\\uFDD0-\\uFDEF\\uFDFD\\uFEFF\\u0000-\\u0040\\u005B-\\u0060\\u007B-\\u007F\\u0080-\\u00A9\\u00AB-\\u00B4\\u00B6-\\u00B9\\u00BB-\\u00BF\\u00D7\\u00F7\\u02B9-\\u02BA\\u02C2-\\u02CF\\u02D2-\\u02DF\\u02E5-\\u02ED\\u02EF-\\u02FF\\u2070\\u2074-\\u207E\\u2080-\\u208E\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u2150-\\u215F\\u2189\\uA720-\\uA721\\uA788\\uFF01-\\uFF20\\uFF3B-\\uFF40\\uFF5B-\\uFF65\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE]+)/g;\n\t\n var shape = function(text, shaperType) {\n text = text.toString();\n if (!text) { \n return text;\n }\n switch (shaperType) {\n case \"defaultNumeral\":\n return _shapeEuropean(text);\n case \"national\":\n return _shapeArabic(text);\n default:\n return text;\n }\n };\n \n var _shapeEuropean = function(text) {\n return text.replace(/[\\u0660-\\u0669]/g, function(c) {\n return c.charCodeAt(0) - 1632;\n });\n };\n\n var _shapeArabic = function(text) {\n return text.replace(/[0-9]/g, function(c) {\n return String.fromCharCode(parseInt(c) + 1632);\n });\n };\n \n var numericshaping = {\n shapeNumerals : shape\n };\n \n return numericshaping; \n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('bidi/bidi',['bidi/numericshaping'], function(numericshaping) {\n 'use strict';\n\n var shaperType = '';\n\n var _uiLang = function() {\n return navigator.language.toLowerCase();\n };\n\n var _loadLocale = function() {\n if (_isMirroringEnabled()) {\n document.body.dir = 'rtl';\n }\n\n requirejs(['moment'], function (moment) {\n console.log('Loaded moment locale', moment.locale(_uiLang()));\n });\n\n shaperType = _uiLang().split('-')[0] == 'ar' ? 'national' : 'defaultNumeral';\n };\n\n var _isMirroringEnabled = function() {\n return new RegExp('^(ar|ara|arc|ae|ave|egy|he|heb|nqo|pal|phn|sam|syc|syr|fa|per|fas|ckb|ur|urd)').test(_uiLang());\n };\n\n /**\n * @param value : the string to apply the bidi-support on it.\n * @param flag :indicates the type of bidi-support (Numeric-shaping ,Base-text-dir ).\n */\n var _applyBidi = function(value /*, flag*/) {\n value = numericshaping.shapeNumerals(value, shaperType);\n return value;\n };\n\n var bidi = {\n applyBidi: _applyBidi,\n isMirroringEnabled: _isMirroringEnabled,\n loadLocale: _loadLocale,\n };\n\n return bidi;\n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('edit/js/savewidget',[\n 'jquery',\n 'base/js/utils',\n 'base/js/dialog',\n 'base/js/keyboard',\n 'moment',\n 'bidi/bidi',\n], function($, utils, dialog, keyboard, moment, bidi) {\n \"use strict\";\n \n var SaveWidget = function (selector, options) {\n this.editor = undefined;\n this.selector = selector;\n this.events = options.events;\n this.editor = options.editor;\n this._last_modified = undefined;\n this._filename = undefined;\n this.keyboard_manager = options.keyboard_manager;\n if (this.selector !== undefined) {\n this.element = $(selector);\n this.bind_events();\n }\n };\n\n\n SaveWidget.prototype.bind_events = function () {\n var that = this;\n this.element.find('span.filename').click(function () {\n that.rename();\n });\n this.events.on('save_status_clean.Editor', function (evt) {\n that.update_document_title();\n });\n this.events.on('save_status_dirty.Editor', function (evt) {\n that.update_document_title(undefined, true);\n });\n this.events.on('file_loaded.Editor', function (evt, model) {\n that.update_filename(model.name);\n that.update_document_title(model.name);\n that.update_last_modified(model.last_modified);\n });\n this.events.on('file_saved.Editor', function (evt, model) {\n that.update_filename(model.name);\n that.update_document_title(model.name);\n that.update_last_modified(model.last_modified);\n });\n this.events.on('file_renamed.Editor', function (evt, model) {\n that.update_filename(model.name);\n that.update_document_title(model.name);\n that.update_address_bar(model.path);\n });\n this.events.on('file_save_failed.Editor', function () {\n that.set_save_status('Save Failed!');\n });\n };\n\n\n SaveWidget.prototype.rename = function (options) {\n options = options || {};\n var that = this;\n var dialog_body = $('<div/>').append(\n $(\"<p/>\").addClass(\"rename-message\")\n .text('Enter a new filename:')\n ).append(\n $(\"<br/>\")\n ).append(\n $('<input/>').attr('type','text').attr('size','25').addClass('form-control')\n .val(that.editor.get_filename())\n );\n var d = dialog.modal({\n title: \"Rename File\",\n body: dialog_body,\n default_button: \"Cancel\",\n buttons : {\n \"Cancel\": {},\n \"OK\": {\n class: \"btn-primary\",\n click: function () {\n var new_name = d.find('input').val();\n if (!new_name) {\n // Reset the message\n d.find('.rename-message').text(\"Enter a new filename:\");\n return false;\n }\n d.find('.rename-message').text(\"Renaming...\");\n d.find('input[type=\"text\"]').prop('disabled', true);\n that.editor.rename(new_name).then(\n function () {\n d.modal('hide');\n }, function (error) {\n d.find('.rename-message').text(error.message || 'Unknown error');\n d.find('input[type=\"text\"]').prop('disabled', false).focus().select();\n }\n );\n return false;\n }\n }\n },\n open : function () {\n // Upon ENTER, click the OK button.\n d.find('input[type=\"text\"]').ke
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('base/js/notificationwidget',['jquery'], function($) {\n \"use strict\";\n\n /**\n * Construct a NotificationWidget object.\n *\n * @constructor\n * @param {string} selector - a jQuery selector string for the\n * notification widget element\n */\n var NotificationWidget = function (selector) {\n this.selector = selector;\n this.timeout = null;\n this.busy = false;\n if (this.selector !== undefined) {\n this.element = $(selector);\n this.style();\n }\n this.element.hide();\n this.inner = $('<span/>');\n this.element.append(this.inner);\n };\n\n /**\n * Add the 'notification_widget' CSS class to the widget element.\n *\n * @method style\n */\n NotificationWidget.prototype.style = function () {\n // use explicit bootstrap classes here,\n // because multiple inheritance in LESS doesn't work\n // for this particular combination\n this.element.addClass('notification_widget btn btn-xs navbar-btn');\n };\n \n /**\n * hide the widget and empty the text\n **/\n NotificationWidget.prototype.hide = function () {\n var that = this;\n this.element.fadeOut(100, function(){that.inner.text('');});\n };\n\n /**\n * Set the notification widget message to display for a certain\n * amount of time (timeout). The widget will be shown forever if\n * timeout is <= 0 or undefined. If the widget is clicked while it\n * is still displayed, execute an optional callback\n * (click_callback). If the callback returns false, it will\n * prevent the notification from being dismissed.\n *\n * Options:\n * class - CSS class name for styling\n * icon - CSS class name for the widget icon\n * title - HTML title attribute for the widget\n *\n * @method set_message\n * @param {string} msg - The notification to display\n * @param {integer} [timeout] - The amount of time in milliseconds to display the widget\n * @param {function} [click_callback] - The function to run when the widget is clicked\n * @param {Object} [options] - Additional options\n */\n NotificationWidget.prototype.set_message = function (msg, timeout, click_callback, options) {\n options = options || {};\n\n // unbind potential previous callback\n this.element.unbind('click');\n this.inner.attr('class', options.icon);\n this.inner.attr('title', options.title);\n this.inner.text(msg);\n this.element.fadeIn(100);\n\n // reset previous set style\n this.element.removeClass();\n this.style();\n if (options.class) {\n this.element.addClass(options.class);\n }\n\n // clear previous timer\n if (this.timeout !== null) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n // set the timer if a timeout is given\n var that = this;\n if (timeout !== undefined && timeout >= 0) {\n this.timeout = setTimeout(function () {\n that.element.fadeOut(100, function () {that.inner.text('');});\n that.element.unbind('click');\n that.timeout = null;\n }, timeout);\n }\n\n // if no click callback assume we will just dismiss the notification\n if (click_callback === undefined) {\n click_callback = function(){return true};\n }\n // on click, remove widget if click callback say so\n // and unbind click event.\n this.element.click(function () {\n if (click_callback() !== false) {\n that.element.fadeOut(100, function () {that.inner.text('');});\n that.element.unbind('click');\n }\n if (that.timeout !== null) {\n clearTimeout(that.timeout);\n that.t
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('base/js/notificationarea',[\n 'jquery',\n 'base/js/notificationwidget',\n], function($, notificationwidget) {\n \"use strict\";\n\n // store reference to the NotificationWidget class\n var NotificationWidget = notificationwidget.NotificationWidget;\n\n /**\n * Construct the NotificationArea object. Options are:\n * events: $(Events) instance\n * save_widget: SaveWidget instance\n * notebook: Notebook instance\n * keyboard_manager: KeyboardManager instance\n *\n * @constructor\n * @param {string} selector - a jQuery selector string for the\n * notification area element\n * @param {Object} [options] - a dictionary of keyword arguments.\n */\n var NotificationArea = function (selector, options) {\n this.selector = selector;\n this.events = options.events;\n if (this.selector !== undefined) {\n this.element = $(selector);\n }\n this.widget_dict = {};\n };\n\n /**\n * Get a widget by name, creating it if it doesn't exist.\n *\n * @method widget\n * @param {string} name - the widget name\n */\n NotificationArea.prototype.widget = function (name) {\n if (this.widget_dict[name] === undefined) {\n return this.new_notification_widget(name);\n }\n return this.get_widget(name);\n };\n\n /**\n * Get a widget by name, throwing an error if it doesn't exist.\n *\n * @method get_widget\n * @param {string} name - the widget name\n */\n NotificationArea.prototype.get_widget = function (name) {\n if(this.widget_dict[name] === undefined) {\n throw new Error('no widgets with this name');\n }\n return this.widget_dict[name];\n };\n\n /**\n * Create a new notification widget with the given name. The\n * widget must not already exist.\n *\n * @method new_notification_widget\n * @param {string} name - the widget name\n */\n NotificationArea.prototype.new_notification_widget = function (name) {\n if (this.widget_dict[name] !== undefined) {\n throw new Error('widget with that name already exists!');\n }\n\n // create the element for the notification widget and add it\n // to the notification aread element\n var div = $('<div/>').attr('id', 'notification_' + name);\n $(this.selector).append(div);\n\n // create the widget object and return it\n this.widget_dict[name] = new NotificationWidget('#notification_' + name);\n return this.widget_dict[name];\n };\n\n return {'NotificationArea': NotificationArea};\n});\n\n",
"define('edit/js/notificationarea',[\n 'base/js/notificationarea'\n], function(notificationarea) {\n \"use strict\";\n var NotificationArea = notificationarea.NotificationArea;\n \n var EditorNotificationArea = function(selector, options) {\n NotificationArea.apply(this, [selector, options]);\n }\n \n EditorNotificationArea.prototype = Object.create(NotificationArea.prototype);\n \n /**\n * Initialize the default set of notification widgets.\n *\n * @method init_notification_widgets\n */\n EditorNotificationArea.prototype.init_notification_widgets = function () {\n var that = this;\n var savew = this.new_notification_widget('save');\n \n this.events.on(\"file_saved.Editor\", function() {\n savew.set_message(\"File saved\", 2000);\n });\n };\n \n\n return {EditorNotificationArea: EditorNotificationArea};\n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\ndefine('auth/js/loginwidget',[\n 'jquery',\n 'base/js/utils',\n], function($, utils){\n \"use strict\";\n\n var LoginWidget = function (selector, options) {\n options = options || {};\n this.base_url = options.base_url || utils.get_body_data(\"baseUrl\");\n this.selector = selector;\n if (this.selector !== undefined) {\n this.element = $(selector);\n this.bind_events();\n }\n };\n\n\n LoginWidget.prototype.bind_events = function () {\n var that = this;\n this.element.find(\"button#logout\").click(function () {\n window.location = utils.url_path_join(\n that.base_url,\n \"logout\"\n );\n });\n this.element.find(\"button#login\").click(function () {\n window.location = utils.url_path_join(\n that.base_url,\n \"login\"\n );\n });\n };\n\n return {'LoginWidget': LoginWidget};\n});\n\n",
"// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nrequirejs([\n 'jquery',\n 'contents',\n 'base/js/namespace',\n 'base/js/utils',\n 'base/js/page',\n 'base/js/events',\n 'services/config',\n 'edit/js/editor',\n 'edit/js/menubar',\n 'edit/js/savewidget',\n 'edit/js/notificationarea',\n 'bidi/bidi',\n 'auth/js/loginwidget', \n], function(\n $,\n contents_service,\n IPython,\n utils,\n page,\n events,\n configmod,\n editmod,\n menubar,\n savewidget,\n notificationarea,\n bidi,\n loginwidget,\n ){\n \"use strict\";\n\n try {\n requirejs(['custom/custom'], function() {});\n bidi.loadLocale();\n } catch(err) {\n console.log(\"Error loading custom.js from edition service. Continuing and logging\");\n console.warn(err);\n }\n \n page = new page.Page('div#header', 'div#site');\n\n var base_url = utils.get_body_data('baseUrl');\n var file_path = utils.get_body_data('filePath');\n // This enables logout\n var login_widget = new loginwidget.LoginWidget('#login_widget', {\n base_url: base_url\n });\n var config = new configmod.ConfigSection('edit', {base_url: base_url});\n config.load();\n var common_config = new configmod.ConfigSection('common', {base_url: base_url});\n common_config.load();\n var contents = new contents_service.Contents({\n base_url: base_url,\n common_config: common_config\n });\n \n var editor = new editmod.Editor('#texteditor-container', {\n base_url: base_url,\n events: events,\n contents: contents,\n file_path: file_path,\n config: config,\n });\n \n // Make it available for debugging\n IPython.editor = editor;\n \n var save_widget = new savewidget.SaveWidget('span#save_widget', {\n editor: editor,\n events: events,\n });\n \n var menus = new menubar.MenuBar('#menubar', {\n base_url: base_url,\n editor: editor,\n events: events,\n save_widget: save_widget,\n });\n \n var notification_area = new notificationarea.EditorNotificationArea(\n '#notification_area', {\n events: events,\n });\n editor.notification_area = notification_area;\n notification_area.init_notification_widgets();\n\n utils.load_extensions_from_config(config);\n utils.load_extensions_from_config(common_config);\n editor.load();\n page.show();\n\n window.onbeforeunload = function () {\n if (editor.save_enabled && !editor.codemirror.isClean(editor.generation)) {\n return \"Unsaved changes will be lost. Close anyway?\";\n }\n };\n\n // Make sure the codemirror editor is sized appropriately.\n var _handle_resize = function() {\n var backdrop = $(\"#texteditor-backdrop\");\n\n // account for padding on the backdrop wrapper\n var padding = backdrop.outerHeight(true) - backdrop.height();\n $('div.CodeMirror').height($(\"#site\").height() - padding);\n };\n $(window).resize(_handle_resize);\n\n // On document ready, resize codemirror.\n $(document).ready(_handle_resize);\n});\n\ndefine(\"edit/js/main\", function(){});\n\n"
]
}