leanote v1.1 build

This commit is contained in:
lealife committed 2015-10-10 16:55:36 +08:00
1 parent c844c8b188
commit a4d9d8e0d3
12 files changed
+240 -82

No files matched your search

+1 -1
View File
@@ -4,4 +4,4 @@
* Licensed under http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
*//*! normalize.css v2.1.3 | MIT License | git.io/normalize */hr,img{border:0}body,figure{margin:0}.img-thumbnail,.thumbnail{-webkit-transition:all .2s ease-in-out}.breadcrumb,.carousel-indicators,.dropdown-menu,.media-list,.nav,.pager{list-style:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:62.5%;-webkit-tap-highlight-color:transparent}a{background:0 0}a:active,a:hover{outline:0}h1{margin:.67em 0}b,strong{font-weight:700}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}svg:not(:root){overflow:hidden}button,input,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{blockquote,img,pre,tr{page-break-inside:avoid}*{color:#000!important;text-shadow:none!important;background:0 0!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}@page{margin:2cm .5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.open .dropdown-toggle.btn-danger,.open .dropdown-toggle.btn-default,.open .dropdown-toggle.btn-info,.open .dropdown-toggle.btn-success,.open .dropdown-toggle.btn-warning{background-image:none}.img-thumbnail,body{line-height:1.428571429;background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{font-family:Arial,Tahoma,sans-serif,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;color:#333}a{color:#428bca;text-decoration:none}a:focus,a:hover{color:#2a6496;text-decoration:underline}a:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;border:1px solid #ddd;border-radius:4px;transition:all .2s ease-in-out}pre code,table{background-color:transparent}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.collapsing,.dropdown,.glyphicon{position:relative}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}h1,h2,h3,h4,h5,h6{margin-bottom:10px}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-primary:hover{color:#3071a9}.text-warning{color:#c09853}.text-warning:hover{color:#a47e3c}.text-danger{color:#b94a48}.text-danger:hover{color:#953b39}.text-success{color:#468847}.text-success:hover{color:#356635}.text-info{color:#3a87ad}.text-info:hover{color:#2d6987}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:Arial,Tahoma,sans-serif,HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,"Microsoft Yahei",Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .sLine truncated
*//*! normalize.css v2.1.3 | MIT License | git.io/normalize */hr,img{border:0}body,figure{margin:0}.img-thumbnail,.thumbnail{-webkit-transition:all .2s ease-in-out}.breadcrumb,.carousel-indicators,.dropdown-menu,.media-list,.nav,.pager{list-style:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}h1{margin:.67em 0}b,strong{font-weight:700}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}svg:not(:root){overflow:hidden}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{blockquote,img,pre,tr{page-break-inside:avoid}*{color:#000!important;text-shadow:none!important;background:0 0!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}@page{margin:2cm .5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.open .dropdown-toggle.btn-danger,.open .dropdown-toggle.btn-default,.open .dropdown-toggle.btn-info,.open .dropdown-toggle.btn-success,.open .dropdown-toggle.btn-warning{background-image:none}.img-thumbnail,body{background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:62.5%;-webkit-tap-highlight-color:transparent}body{font-family:Arial,Tahoma,sans-serif,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333}button,input,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:focus,a:hover{color:#2a6496;text-decoration:underline}a:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;border:1px solid #ddd;border-radius:4px;transition:all .2s ease-in-out}pre code,table{background-color:transparent}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.collapsing,.dropdown,.glyphicon{position:relative}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}h1,h2,h3,h4,h5,h6{margin-bottom:10px}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-primary:hover{color:#3071a9}.text-warning{color:#c09853}.text-warning:hover{color:#a47e3c}.text-danger{color:#b94a48}.text-danger:hover{color:#953b39}.text-success{color:#468847}.text-success:hover{color:#356635}.text-info{color:#3a87ad}.text-info:hover{color:#2d6987}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:Arial,Tahoma,sans-serif,HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,"Microsoft Yahei",Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4Line truncated
+1 -1
View File
@@ -1 +1 @@
.tour-backdrop,div.jGrowl.bottom-right{right:0;bottom:0}#wmd-input>.editor-margin .discussion.active,#wmd-input>.editor-margin .discussion:hover,.btn-link:hover{text-decoration:none}.form-control:focus{border-color:#f0f0f0;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6)}@media (min-width:768px){.navbar-form .col-sm-1{width:8.33333333%!important}.navbar-form .col-sm-2{width:16.66666667%!important}.navbar-form .col-sm-3{width:25%!important}.navbar-form .col-sm-4{width:33.33333333%!important}.navbar-form .col-sm-5{width:41.66666667%!important}.navbar-form .col-sm-6{width:50%!important}.navbar-form .col-sm-7{width:58.33333333%!important}.navbar-form .col-sm-8{width:66.66666667%!important}.navbar-form .col-sm-9{width:75%!important}.navbar-form .col-sm-10{width:83.33333333%!important}.navbar-form .col-sm-11{width:91.66666667%!important}.navbar-form .col-sm-12{width:100%!important}}.navbar-form *{float:none}pre.prettyprint *{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}pre.prettyprint{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}code.prettyprint,pre.prettyprint{padding:8px;background-color:#f7f7f9;border:1px solid #e1e1e8;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;display:block}code.prettyprint ol.linenums,pre.prettyprint ol.linenums{padding:0 0 0 30px;margin:0}code.prettyprint ol.linenums li,pre.prettyprint ol.linenums li{padding-left:0;color:#bebec5;line-height:20px}code.prettyprint .com,pre.prettyprint .com{color:#93a1a1;font-style:italic}code.prettyprint .lit,pre.prettyprint .lit{color:#195f91}code.prettyprint .clo,code.prettyprint .opn,code.prettyprint .pun,pre.prettyprint .clo,pre.prettyprint .opn,pre.prettyprint .pun{color:#93a1a1}code.prettyprint .fun,pre.prettyprint .fun{color:#dc322f}code.prettyprint .atv,code.prettyprint .str,pre.prettyprint .atv,pre.prettyprint .str{color:#d14}code.prettyprint .kwd,code.prettyprint .tag,pre.prettyprint .kwd,pre.prettyprint .tag{color:#1e347b}code.prettyprint .atn,code.prettyprint .dec,code.prettyprint .typ,code.prettyprint .var,pre.prettyprint .atn,pre.prettyprint .dec,pre.prettyprint .typ,pre.prettyprint .var{color:teal}code.prettyprint .pln,pre.prettyprint .pln{color:#48484c}.container{margin-bottom:180px;text-align:justify}blockquote p,ol,ol ol,ol ul,ul,ul ol,ul ul{margin-bottom:.3em}a code{color:inherit}pre{word-break:break-word;border-radius:5px}blockquote,p{margin:0 0 .3em}hr{margin:2em 0}img{max-width:100%}.flow-chart,.sequence-diagram{text-align:center;margin-bottom:.3em}.flow-chart text,.sequence-diagram text{font-size:15px!important;font-family:"Source Sans Pro",sans-serif!important}.flow-chart [fill="#ffffff"],.sequence-diagram [fill="#ffffff"]{fill:#f8f8f8}.flow-chart [stroke="#000000"],.sequence-diagram [stroke="#000000"]{stroke:#3f3f3f}.flow-chart text[stroke="#000000"],.sequence-diagram text[stroke="#000000"]{stroke:none}.flow-chart [fill="#000000"],.flow-chart [fill="#000"],.flow-chart [fill=black],.sequence-diagram [fill="#000000"],.sequence-diagram [fill="#000"],.sequence-diagram [fill=black]{fill:#3f3f3f}code,pre{font-family:"Source Code Pro",monospace;font-size:.9em}code{white-space:normal}pre.prettyprint{text-align:start;border:0;padding:10px 20px}pre.prettyprint code{background-color:transparent!important}dd,dt{margin-top:5px;margin-bottom:5px}dd{margin-left:40px}table{margin-bottom:20px}table td,table th{padding:8px;line-height:20px;vertical-align:top;border-top:1px solid #ddd}table th{font-weight:700}table thead th{vertical-align:bottom}table caption+thead tr:first-child td,table caption+thead tr:first-child th,table colgroup+thead tr:first-child td,table colgroup+thead tr:first-child th,table thead:first-child tr:first-child td,table thead:first-child tr:first-child th{border-top:0}table tbody+tbody{border-top:2px solid #ddd}blockquote{border-left-width:10px;background-color:rgba(128,128,128,.05);border-top-right-radius:5px;border-bottom-right-radius:5px;padding:15px 20px}blockquote p{font-size:1em;line-height:1.45}blockquote ol:last-child,blockquote ul:last-child{margin-bottom:0}kbd{padding:.1em .6em;border:1px solid rgba(63,63,63,.25);-webkit-box-shadow:0 1px 0 rgba(63,63,63,.25);box-shadow:0 1px 0 rgba(63,63,63,.25);font-size:.7em;font-family:sans-serif;background-color:#fff;color:#333;border-radius:3px;display:inline-block;margin:0 .1em;white-space:nowrap}.toc ul{list-style-type:none;margin-bottom:15px}.footnote{vertical-align:top;position:relative;top:-.5em;font-size:.8em}.tour-backdrop{position:fixed;top:0;left:0;z-index:1030;background-color:#000;opacity:.8}.tour-step-backdrop{position:relative;z-index:1031;background:inherit}.tour-step-background{position:absolute;z-index:1030;background:inherit;border-radius:6px}.popover[class*=tour-]{z-iLine truncated
.tour-backdrop,div.jGrowl.bottom-right{right:0;bottom:0}#wmd-input>.editor-margin .discussion.active,#wmd-input>.editor-margin .discussion:hover,.btn-link:hover{text-decoration:none}.form-control:focus{border-color:#f0f0f0;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6)}@media (min-width:768px){.navbar-form .col-sm-1{width:8.33333333%!important}.navbar-form .col-sm-2{width:16.66666667%!important}.navbar-form .col-sm-3{width:25%!important}.navbar-form .col-sm-4{width:33.33333333%!important}.navbar-form .col-sm-5{width:41.66666667%!important}.navbar-form .col-sm-6{width:50%!important}.navbar-form .col-sm-7{width:58.33333333%!important}.navbar-form .col-sm-8{width:66.66666667%!important}.navbar-form .col-sm-9{width:75%!important}.navbar-form .col-sm-10{width:83.33333333%!important}.navbar-form .col-sm-11{width:91.66666667%!important}.navbar-form .col-sm-12{width:100%!important}}.navbar-form *{float:none}pre.prettyprint *{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}pre.prettyprint{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}code.prettyprint,pre.prettyprint{padding:8px;background-color:#f7f7f9;border:1px solid #e1e1e8;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;display:block}code.prettyprint ol.linenums,pre.prettyprint ol.linenums{padding:0 0 0 30px;margin:0}code.prettyprint ol.linenums li,pre.prettyprint ol.linenums li{padding-left:0;color:#bebec5;line-height:20px}code.prettyprint .com,pre.prettyprint .com{color:#93a1a1;font-style:italic}code.prettyprint .lit,pre.prettyprint .lit{color:#195f91}code.prettyprint .clo,code.prettyprint .opn,code.prettyprint .pun,pre.prettyprint .clo,pre.prettyprint .opn,pre.prettyprint .pun{color:#93a1a1}code.prettyprint .fun,pre.prettyprint .fun{color:#dc322f}code.prettyprint .atv,code.prettyprint .str,pre.prettyprint .atv,pre.prettyprint .str{color:#d14}code.prettyprint .kwd,code.prettyprint .tag,pre.prettyprint .kwd,pre.prettyprint .tag{color:#1e347b}code.prettyprint .atn,code.prettyprint .dec,code.prettyprint .typ,code.prettyprint .var,pre.prettyprint .atn,pre.prettyprint .dec,pre.prettyprint .typ,pre.prettyprint .var{color:teal}code.prettyprint .pln,pre.prettyprint .pln{color:#48484c}.container{margin-bottom:180px;text-align:justify}blockquote p,ol,ol ol,ol ul,ul,ul ol,ul ul{margin-bottom:.3em}a code{color:inherit}pre{word-break:break-word;border-radius:5px}blockquote,p{margin:0 0 .3em}hr{margin:2em 0}img{max-width:100%}.flow-chart,.sequence-diagram{text-align:center;margin-bottom:.3em}.flow-chart text,.sequence-diagram text{font-size:15px!important;font-family:"Source Sans Pro",sans-serif!important}.flow-chart [fill="#ffffff"],.sequence-diagram [fill="#ffffff"]{fill:#f8f8f8}.flow-chart [stroke="#000000"],.sequence-diagram [stroke="#000000"]{stroke:#3f3f3f}.flow-chart text[stroke="#000000"],.sequence-diagram text[stroke="#000000"]{stroke:none}.flow-chart [fill="#000000"],.flow-chart [fill="#000"],.flow-chart [fill=black],.sequence-diagram [fill="#000000"],.sequence-diagram [fill="#000"],.sequence-diagram [fill=black]{fill:#3f3f3f}code,pre{font-family:"Source Code Pro",monospace;font-size:.9em}code{white-space:normal}pre.prettyprint{text-align:start;border:0;padding:10px 20px}pre.prettyprint code{background-color:transparent!important}dd,dt{margin-top:5px;margin-bottom:5px}dd{margin-left:40px}table{margin-bottom:20px}table td,table th{padding:8px;line-height:20px;vertical-align:top;border-top:1px solid #ddd}table th{font-weight:700}table thead th{vertical-align:bottom}table caption+thead tr:first-child td,table caption+thead tr:first-child th,table colgroup+thead tr:first-child td,table colgroup+thead tr:first-child th,table thead:first-child tr:first-child td,table thead:first-child tr:first-child th{border-top:0}table tbody+tbody{border-top:2px solid #ddd}blockquote{border-left-width:10px;background-color:rgba(128,128,128,.05);border-top-right-radius:5px;border-bottom-right-radius:5px;padding:15px 20px}blockquote p{font-size:1em;line-height:1.45}blockquote ol:last-child,blockquote ul:last-child{margin-bottom:0}kbd{padding:.1em .6em;border:1px solid rgba(63,63,63,.25);-webkit-box-shadow:0 1px 0 rgba(63,63,63,.25);box-shadow:0 1px 0 rgba(63,63,63,.25);font-size:.7em;font-family:sans-serif;background-color:#fff;color:#333;border-radius:3px;display:inline-block;margin:0 .1em;white-space:nowrap}.toc ul{list-style-type:none;margin-bottom:15px}.footnote{vertical-align:top;position:relative;top:-.5em;font-size:.8em}.tour-backdrop{position:fixed;top:0;left:0;z-index:1030;background-color:#000;opacity:.8}.tour-step-backdrop{position:relative;z-index:1031;background:inherit}.tour-step-background{position:absolute;z-index:1030;background:inherit;border-radius:6px}.popover[class*=tour-]{z-iLine truncated
+3 -3
View File
@@ -1,6 +1,6 @@
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return log("-------------------ajax:"),log(e),log(n),i="undefined"==typeof i?!0:!1,$.ajax({type:t,url:e,data:n,async:i,success:function(t){_ajaxCallback(t,o,r)},error:function(t){_ajaxCallback(t,o,r)}})}function ajaxGet(t,e,n,o,r){return _ajax("GET",t,e,n,o,r)}function ajaxPost(t,e,n,o,r){_ajax("POST",t,e,n,o,r)}function ajaxPostJson(t,e,n,o,r){log("-------------------ajaxPostJson:"),log(t),log(e),r="undefined"==typeof r?!0:!1,$.ajax({url:t,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:r,data:JSON.stringify(e),success:function(t,e){_ajaxCallback(t,n,o)},error:function(t){_ajaxCallback(t,n,o)}})}function findParents(t,e){if($(t).is(e))return $(t);for(var n=$(t).parents(),o=0;o<n.length;++o)if(log(n.eq(o)),n.eq(o).is(e))return n.seq(o);return null}function getVendorPrefix(){for(var t=document.body||document.documentElement,e=t.style,n=["webkit","khtml","moz","ms","o"],o=0;o<n.length;){if("string"==typeof e[n[o]+"Transition"])return n[o];o++}}function editorIframeTabindex(t){var e=$("#editorContent");e.attr("tabindex",t),setTimeout(function(){e.attr("tabindex",t)},500),setTimeout(function(){e.attr("tabindex",t)},1e3)}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),editorIframeTabindex(3),$("#wmd-input").attr("tabindex",2),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),editorIframeTabindex(2),$("#wmd-input").attr("tabindex",3),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),o&&o(),LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if($("#editorContent").html(t),"undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime(),r.setContent(t),o&&o(),r.undoManager.clear()}else clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!1,!1,o)},100)}function previewIsEmpty(t){return t&&t.substr(0,previewToken.length)!=previewToken?!1:!0}function isAceError(t){return t?-1!=t.indexOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):!1}function getEditorContent(t){if(t)return[MD.getContent(),"<div>"+$("#preview-contents").html()+"</div>"];var e=tinymce.activeEditor;if(e){var n=$(e.getBody()).clone();if(n.find(".toggle-raw").remove(),window.LeaAce&&LeaAce.getAce)for(var o=n.find("pre"),r=0;r<o.length;++r){var i=o.eq(r),a=i.attr("id"),s=LeaAce.getAce(a);if(s){var l=s.getValue();isAceError(l)&&(l=i.html()),l=l.replace(/</g,"&lt").replace(/>/g,"&gt"),i.removeAttr("style","").removeAttr("contenteditable").removeClass("ace_editor"),i.html(l)}}if(n.find("pinit").remove(),n.find(".thunderpin").remove(),n.find(".pin").parent().remove(),n=$(n).html())for(;;){var c=n.lastIndexOf("</script>");if(-1==c)return n;var u=n.length;if(u-9!=c)return n;var f=n.lastIndexOf("<script ");if(-1==f&&(f=n.lastIndexOf("<script>")),-1==f)return n;n=n.substring(0,f)}return n}}function disableEditor(){var t=tinymce.activeEditor;t&&(t.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var t=tinymce.activeEditor;t&&t.show()}}function showDialog(t,e){$("#leanoteDialog #modalTitle").html(e.title),$("#leanoteDialog .modal-body").html($("#"+t+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+t+" .modal-footer").html()),delete e.title,e.show=!0,$("#leanLine truncated
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=6e5,Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始..."),changedNote=Note.curChangedSaveIt(!1)},Note.intervalTime)},Note.stopInterval=function(){clearInterval(Note.interval),setTimeout(function(){Note.startInterval()},Note.intervalTime)},Note.addNoteCache=function(t){Note.cache[t.NoteId]=t,Note.clearCacheByNotebookId(t.NotebookId)},Note.setNoteCache=function(t,e){Note.cache[t.NoteId]?$.extend(Note.cache[t.NoteId],t):Note.cache[t.NoteId]=t,void 0==e&&(e=!0),e&&Note.clearCacheByNotebookId(t.NotebookId)},Note.getCurNote=function(){var t=this;return""==t.curNoteId?null:t.cache[t.curNoteId]},Note.getNote=function(t){var e=this;return e.cache[t]},Note.clearCacheByNotebookId=function(t){t&&(Note.cacheByNotebookId[t]={},Note.cacheByNotebookId.all={},Note.notebookIds[t]=!0)},Note.notebookHasNotes=function(t){var e=Note.getNotesByNotebookId(t);return!isEmpty(e)},Note.getNotesByNotebookId=function(t,e,o){if(e||(e="UpdatedTime"),"undefined"==o&&(o=!1),t||(t="all"),!Note.cacheByNotebookId[t])return[];if(Note.cacheByNotebookId[t][e])return Note.cacheByNotebookId[t][e];var a=[];for(var n in Note.cache)if(n){var i=Note.cache[n];i.IsTrash||i.IsShared||("all"==t||i.NotebookId==t)&&a.push(i)}return a.sort(function(t,a){var n=t[e],i=a[e];if(o){if(i>n)return-1;if(n>i)return 1}else{if(i>n)return 1;if(n>i)return-1}return 0}),Note.cacheByNotebookId[t][e]=a,a},Note.curNoteIsDirtied=function(){var t=this,e=t.getCurNote();e&&(e.isDirty=!0)},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){void 0==t&&(t=!0);var e,o,a,n=Note.cache[Note.curNoteId]||{},i=$("#noteTitle").val(),r=Tag.getTags(),s=getEditorContent(n.IsMarkdown);if(isArray(s))e=s[0],o=s[1],a=e,e&&previewIsEmpty(o)&&Converter&&(o=Converter.makeHtml(e)),e||(o=""),n.Preview=o;else{e=s;try{a=$(e).text()}catch(c){}}var d={hasChanged:!1,IsNew:n.IsNew,IsMarkdown:n.IsMarkdown,FromUserId:n.FromUserId,NoteId:n.NoteId,NotebookId:n.NotebookId,Version:n.Version||0};if(d.IsNew)$.extend(d,n);else if(!n.isDirty)return log("no dirty"),d.hasChanged=!1,d;if(n.Title!=i&&(d.hasChanged=!0,d.Title=i,!d.Title),arrayEqual(n.Tags,r)||(d.hasChanged=!0,d.Tags=r.join(",")),t&&n.Content!=e||!t&&(!n.IsMarkdown&&$(n.Content).text()!=a||n.IsMarkdown&&n.Content!=a)){d.hasChanged=!0,d.Content=e;var l=o||e;n.HasSelfDefined&&n.IsBlog||(d.Desc=Note.genDesc(l),d.ImgSrc=Note.getImgSrc(l),d.Abstract=Note.genAbstract(l))}else log("text相同"),log(n.Content==e);return d.UserId=n.UserId||"",d},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var d=document.createElement("div");return d.innerHTML=i,d.innerHTML},Note.getImgSrc=function(t){if(!t)return"";var e=$(t).find("img");for(var o in e){var a=e.eq(o).attr("src");if(a)return a}return""},Note.saveInProcess={},Note.savePool={},Note.curChangedSaveIt=function(t,e){var o=this;if(Note.curNoteId&&!Note.isReadOnly){var a=Note.curHasChanged(t);return a.hasChanged||a.IsNew?(Note.renderChangedNote(a),delete a.hasChanged,showMsg(getMsg("saving")),o.saveInProLine truncated
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?(Note.saveNote(e),void LeaAce.removeCurToggleRaw()):void e.preventDefault()}),e.on("click",function(e){})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",content_css:["/css/editor/editor.css"],skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext pasteCopyImage | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt()},$("body").on("keydown",Note.saveNote)}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function openSetInfoDialog(e){showDialogRemote("/user/account",{tab:e})}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$("#leftNotebook").width(30),$("#notebook").hide(),$("#noteAndEditor").css("left",30),$("#notebookSplitter").hide(),$("#logo").hide(),$("#leftSwitcher").hide(),$("#leftSwitcher2").show(),$("#leftNotebook .slimScrollDiv").hide(),e&&updateLeftIsMin(!0)}function maxLeft(e){$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),$("#notebook").show(),$("#notebookSplitter").show(),$("#leftSwitcher2").hide(),$("#logo").show(),$("#leftSwitcher").show(),$("#leftNotebook .slimScrollDiv").show(),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #Line truncated
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return log("-------------------ajax:"),log(e),log(n),i="undefined"==typeof i?!0:!1,$.ajax({type:t,url:e,data:n,async:i,success:function(t){_ajaxCallback(t,o,r)},error:function(t){_ajaxCallback(t,o,r)}})}function ajaxGet(t,e,n,o,r){return _ajax("GET",t,e,n,o,r)}function ajaxPost(t,e,n,o,r){_ajax("POST",t,e,n,o,r)}function ajaxPostJson(t,e,n,o,r){log("-------------------ajaxPostJson:"),log(t),log(e),r="undefined"==typeof r?!0:!1,$.ajax({url:t,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:r,data:JSON.stringify(e),success:function(t,e){_ajaxCallback(t,n,o)},error:function(t){_ajaxCallback(t,n,o)}})}function findParents(t,e){if($(t).is(e))return $(t);for(var n=$(t).parents(),o=0;o<n.length;++o)if(log(n.eq(o)),n.eq(o).is(e))return n.seq(o);return null}function getVendorPrefix(){for(var t=document.body||document.documentElement,e=t.style,n=["webkit","khtml","moz","ms","o"],o=0;o<n.length;){if("string"==typeof e[n[o]+"Transition"])return n[o];o++}}function editorIframeTabindex(t){var e=$("#editorContent");e.attr("tabindex",t),setTimeout(function(){e.attr("tabindex",t)},500),setTimeout(function(){e.attr("tabindex",t)},1e3)}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),editorIframeTabindex(3),$("#wmd-input").attr("tabindex",2),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),editorIframeTabindex(2),$("#wmd-input").attr("tabindex",3),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),o&&o(),LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if($("#editorContent").html(t),"undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime(),r.setContent(t),o&&o(),r.undoManager.clear()}else clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!1,!1,o)},100)}function previewIsEmpty(t){return t&&t.substr(0,previewToken.length)!=previewToken?!1:!0}function isAceError(t){return t?-1!=t.indexOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):!1}function getEditorContent(t){if(t)return[MD.getContent(),"<div>"+$("#preview-contents").html()+"</div>"];var e=tinymce.activeEditor;if(e){var n=$(e.getBody()).clone();if(n.find(".toggle-raw").remove(),window.LeaAce&&LeaAce.getAce)for(var o=n.find("pre"),r=0;r<o.length;++r){var i=o.eq(r),a=i.attr("id"),s=LeaAce.getAce(a);if(s){var l=s.getValue();isAceError(l)&&(l=i.html()),l=l.replace(/</g,"&lt").replace(/>/g,"&gt"),i.removeAttr("style","").removeAttr("contenteditable").removeClass("ace_editor"),i.html(l)}}if(n.find("pinit").remove(),n.find(".thunderpin").remove(),n.find(".pin").parent().remove(),n=$(n).html())for(;;){var c=n.lastIndexOf("</script>");if(-1==c)return n;var u=n.length;if(u-9!=c)return n;var f=n.lastIndexOf("<script ");if(-1==f&&(f=n.lastIndexOf("<script>")),-1==f)return n;n=n.substring(0,f)}return n}}function disableEditor(){var t=tinymce.activeEditor;t&&(t.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var t=tinymce.activeEditor;t&&t.show()}}function showDialog(t,e){$("#leanoteDialog #modalTitle").html(e.title),$("#leanoteDialog .modal-body").html($("#"+t+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+t+" .modal-footer").html()),delete e.title,e.show=!0,$("#leanLine truncated
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=6e5,Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始..."),changedNote=Note.curChangedSaveIt(!1)},Note.intervalTime)},Note.stopInterval=function(){clearInterval(Note.interval),setTimeout(function(){Note.startInterval()},Note.intervalTime)},Note.addNoteCache=function(t){Note.cache[t.NoteId]=t,Note.clearCacheByNotebookId(t.NotebookId)},Note.setNoteCache=function(t,e){Note.cache[t.NoteId]?$.extend(Note.cache[t.NoteId],t):Note.cache[t.NoteId]=t,void 0==e&&(e=!0),e&&Note.clearCacheByNotebookId(t.NotebookId)},Note.getCurNote=function(){var t=this;return""==t.curNoteId?null:t.cache[t.curNoteId]},Note.getNote=function(t){var e=this;return e.cache[t]},Note.clearCacheByNotebookId=function(t){t&&(Note.cacheByNotebookId[t]={},Note.cacheByNotebookId.all={},Note.notebookIds[t]=!0)},Note.notebookHasNotes=function(t){var e=Note.getNotesByNotebookId(t);return!isEmpty(e)},Note.getNotesByNotebookId=function(t,e,o){if(e||(e="UpdatedTime"),"undefined"==o&&(o=!1),t||(t="all"),!Note.cacheByNotebookId[t])return[];if(Note.cacheByNotebookId[t][e])return Note.cacheByNotebookId[t][e];var a=[];for(var n in Note.cache)if(n){var i=Note.cache[n];i.IsTrash||i.IsShared||("all"==t||i.NotebookId==t)&&a.push(i)}return a.sort(function(t,a){var n=t[e],i=a[e];if(o){if(i>n)return-1;if(n>i)return 1}else{if(i>n)return 1;if(n>i)return-1}return 0}),Note.cacheByNotebookId[t][e]=a,a},Note.curNoteIsDirtied=function(){var t=this,e=t.getCurNote();e&&(e.isDirty=!0)},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){void 0==t&&(t=!0);var e,o,a,n=Note.cache[Note.curNoteId]||{},i=$("#noteTitle").val(),r=Tag.getTags(),s=getEditorContent(n.IsMarkdown);if(isArray(s))e=s[0],o=s[1],a=e,e&&previewIsEmpty(o)&&Converter&&(o=Converter.makeHtml(e)),e||(o=""),n.Preview=o;else{e=s;try{a=$(e).text()}catch(c){}}var d={hasChanged:!1,IsNew:n.IsNew,IsMarkdown:n.IsMarkdown,FromUserId:n.FromUserId,NoteId:n.NoteId,NotebookId:n.NotebookId,Version:n.Version||0};if(d.IsNew)$.extend(d,n);else if(!t&&!n.isDirty)return log("no dirty"),d.hasChanged=!1,d;if(n.Title!=i&&(d.hasChanged=!0,d.Title=i,!d.Title),arrayEqual(n.Tags,r)||(d.hasChanged=!0,d.Tags=r.join(",")),t&&n.Content!=e||!t&&(!n.IsMarkdown&&$(n.Content).text()!=a||n.IsMarkdown&&n.Content!=a)){d.hasChanged=!0,d.Content=e;var N=o||e;n.HasSelfDefined&&n.IsBlog||(d.Desc=Note.genDesc(N),d.ImgSrc=Note.getImgSrc(N),d.Abstract=Note.genAbstract(N))}else log("text相同"),log(n.Content==e);return d.UserId=n.UserId||"",d},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var d=document.createElement("div");return d.innerHTML=i,d.innerHTML},Note.getImgSrc=function(t){if(!t)return"";var e=$(t).find("img");for(var o in e){var a=e.eq(o).attr("src");if(a)return a}return""},Note.saveInProcess={},Note.savePool={},Note.curChangedSaveIt=function(t,e){var o=this;if(Note.curNoteId&&!Note.isReadOnly){var a=Note.curHasChanged(t);return a.hasChanged||a.IsNew?(Note.renderChangedNote(a),delete a.hasChanged,showMsg(getMsg("saving")),o.saveILine truncated
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?void LeaAce.removeCurToggleRaw():void e.preventDefault()}),e.on("click",function(e){})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",content_css:["/css/editor/editor.css"],skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt()},$("body").on("keydown",Note.saveNote)}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function openSetInfoDialog(e){showDialogRemote("/user/account",{tab:e})}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$("#leftNotebook").width(30),$("#notebook").hide(),$("#noteAndEditor").css("left",30),$("#notebookSplitter").hide(),$("#logo").hide(),$("#leftSwitcher").hide(),$("#leftSwitcher2").show(),$("#leftNotebook .slimScrollDiv").hide(),e&&updateLeftIsMin(!0)}function maxLeft(e){$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),$("#notebook").show(),$("#notebookSplitter").show(),$("#leftSwitcher2").hide(),$("#logo").show(),$("#leftSwitcher").show(),$("#leftNotebook .slimScrollDiv").show(),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #notesAndSort").show(),$("#noteListLine truncated
function revertTagStatus(){$("#addTagTrigger").show(),$("#addTagInput").hide()}function hideTagList(a){$("#tagDropdown").removeClass("open"),a&&a.stopPropagation()}function showTagList(a){$("#tagDropdown").addClass("open"),a&&a.stopPropagation()}function reRenderTags(){var a=["label label-default","label label-info"],e=0;$("#tags").children().each(function(){var t=$(this).attr("class");("label label-default"==t||"label label-info"==t)&&($(this).removeClass(t).addClass(a[e%2]),e++)})}Tag.classes={"蓝色":"label label-blue","红色":"label label-red","绿色":"label label-green","黄色":"label label-yellow",blue:"label label-blue",red:"label label-red",green:"label label-green",yellow:"label label-yellow"},Tag.mapCn2En={"蓝色":"blue","红色":"red","绿色":"green","黄色":"yellow"},Tag.mapEn2Cn={blue:"蓝色",red:"红色",green:"绿色",yellow:"黄色"},Tag.t=$("#tags"),Tag.getTags=function(){var a=[];return Tag.t.children().each(function(){var e=$(this).data("tag");e=Tag.mapCn2En[e]||e,a.push(e)}),a},Tag.clearTags=function(){Tag.t.html("")},Tag.renderTags=function(a){if(Tag.t.html(""),!isEmpty(a))for(var e=0;e<a.length;++e){var t=a[e];Tag.appendTag(t)}},Tag.renderReadOnlyTags=function(a){function e(){return t?"label label-default":(t=!0,"label label-info")}$("#noteReadTags").html(""),(isEmpty(a)||1==a.length&&""==a[0])&&$("#noteReadTags").html(getMsg("noTag"));var t=!0;for(var t in a){var l=a[t];l=Tag.mapEn2Cn[l]||l;var n=Tag.classes[l];n||(n=e()),tag=tt('<span class="?">?</span>',n,trimTitle(l)),$("#noteReadTags").append(tag)}},Tag.appendTag=function(a,e){var t,l,n=!1;if("object"==typeof a){if(t=a.classes,l=a.text,!l)return}else{if(a=$.trim(a),l=a,!l)return;var t=Tag.classes[l];t?n=!0:t="label label-default"}var g=l;"zh"==LEA.locale&&(l=Tag.mapEn2Cn[l]||l,g=Tag.mapCn2En[g]||g),a=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',t,l,l);var r=!1;$("#tags").children().each(function(){if(n){var e=$("<div></div>").append($(this).clone()).html();e==a&&($(this).remove(),r=!0)}else l+"X"==$(this).text()&&($(this).remove(),r=!0)}),$("#tags").append(a),hideTagList(),n||reRenderTags(),e&&(Note.curNoteIsDirtied(),r||Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:g},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})}))},Tag.removeTag=function(a){var e=a.data("tag");a.remove(),reRenderTags(),"zh"==LEA.locale&&(e=Tag.mapCn2En[e]||e),Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:e},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})})},Tag.tags=[],Tag.renderTagNav=function(a){a=a||[],Tag.tags=a,$("#tagNav").html("");for(var e in a){var t=a[e],l=t.Tag,n=l;if("zh"==LEA.locale)var n=Tag.mapEn2Cn[l]||n;n=trimTitle(n);var g=Tag.classes[l]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',l,g,n))}},Tag.addTagNav=function(a){var e=this;for(var t in e.tags){var l=e.tags[t];if(l.Tag==a.Tag){e.tags.splice(t,1);break}}e.tags.unshift(a),e.renderTagNav(e.tags)},$(function(){function a(){$li=$(this).closest("li");var a=$.trim($li.data("tag"));confirm("Are you sure ?")&&ajaxPost("/tag/deleteTag",{tag:a},function(e){if(reIsOk(e)){var t=e.Item;Note.deleteNoteTag(t,a),$li.remove()}})}function e(){var a=$(this).closest("li"),e=$.trim(a.data("tag"));Note.curChangedSaveIt(),Note.clearAll(),$("#tagSearch").html(a.html()).show(),$("#tagSearch .tag-delete").remove(),showLoading(),ajaxGet("/note/searchNoteByTags",{tags:[e]},function(a){hideLoading(),a&&(Note.renderNotes(a),isEmpty(a)||Note.changeNote(a[0].NoteId))})}$("#addTagTrigger").click(function(){$(this).hide(),$("#addTagInput").show().focus().val("")}),$("#addTagInput").click(function(a){showTagList(a)}),$("#addTagInput").blur(function(){var a=$(this).val();a&&Tag.appendTag(a,!0)}),$("#addTagInput").keydown(function(a){13==a.keyCode&&(hideTagList(),$("#addTagInput").val()?($(this).trigger("blur"),$("#addTagTrigger").trigger("click")):$(this).trigger("blur"))}),$("#tagColor li").click(function(a){var e;e=$(this).attr("role")?$(this).find("span"):$(this),Tag.appendTag({classes:e.attr("class"),text:e.text()},!0)}),$("#tags").on("click","i",function(){Tag.removeTag($(this).parent())}),$("#myTag .folderBody").on("click","li .label",e),$("#myTag .folderBody").on("click","li .tag-delete",a)});
Notebook.curNotebookId="",Notebook.cache={},Notebook.notebooks=[],Notebook.notebookNavForListNote="",Notebook.notebookNavForNewNote="",Notebook.setCache=function(o){var e=o.NotebookId;e&&(Notebook.cache[e]||(Notebook.cache[e]={}),$.extend(Notebook.cache[e],o))},Notebook.getCurNotebookId=function(){return Notebook.curNotebookId},Notebook.getCurNotebook=function(){return Notebook.cache[Notebook.curNotebookId]},Notebook._updateNotebookNumberNotes=function(o,e){var t=this,N=t.getNotebook(o);N&&(N.NumberNotes+=e,N.NumberNotes<0&&(N.NumberNotes=0),$("#numberNotes_"+o).html(N.NumberNotes))},Notebook.incrNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,1)},Notebook.minusNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,-1)},Notebook.getNotebook=function(o){return Notebook.cache[o]},Notebook.getNotebookTitle=function(o){var e=Notebook.cache[o];return e?e.Title:"未知"},Notebook.getTreeSetting=function(o,e){function t(o,t){var N=5,n=$("#"+o+" #"+t.tId+"_switch"),a=$("#"+o+" #"+t.tId+"_ico");if(n.remove(),a.before(n),e?Share.isDefaultNotebookId(t.NotebookId)||a.after($('<span class="fa notebook-setting" title="setting"></span>')):Notebook.isAllNotebookId(t.NotebookId)||Notebook.isTrashNotebookId(t.NotebookId)||(a.after($('<span class="notebook-number-notes" id="numberNotes_'+t.NotebookId+'">'+(t.NumberNotes||0)+"</span>")),a.after($('<span class="fa notebook-setting" title="setting"></span>'))),t.level>1){var r="<span style='display: inline-block;width:"+N*t.level+"px'></span>";n.before(r)}}function N(o,e){for(var t=0,N=e.length;N>t;t++)if(e[t].drag===!1)return!1;return!0}function n(o,e,t,N){return t?t.drop!==!1:!0}function a(o,e,t,N,n){function a(o){return o.level==d}var r=t[0];if(N){var i,k=b.tree,s={curNotebookId:r.NotebookId};if(i="inner"==n?N:N.getParentNode()){s.parentNotebookId=i.NotebookId;var d=i.level+1,l=k.getNodesByFilter(a,!1,i)}else var l=k.getNodes();s.siblings=[];for(var c in l){var h=l[c].NotebookId;Notebook.isAllNotebookId(h)||Notebook.isTrashNotebookId(h)||s.siblings.push(h)}ajaxPost("/notebook/dragNotebooks",{data:JSON.stringify(s)}),setTimeout(function(){Notebook.changeNav()},100)}}var r=!o,b=this;if(e)var i=function(o,e,t){var N=t.NotebookId,n=$(o.target).closest(".friend-notebooks").attr("fromUserId");Share.changeNotebook(n,N)},k=null;else var i=function(o,e,t){var N=t.NotebookId;Notebook.changeNotebook(N)},k=function(o){var e=$(o.target).attr("notebookId");Notebook.isAllNotebookId(e)||Notebook.isTrashNotebookId(e)||b.updateNotebookTitle(o.target)};var s={view:{showLine:!1,showIcon:!1,selectedMulti:!1,dblClickExpand:!1,addDiyDom:t},data:{key:{name:"Title",children:"Subs"}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isMove:r,prev:r,inner:r,next:r}},callback:{beforeDrag:N,beforeDrop:n,onDrop:a,onClick:i,onDblClick:k,beforeRename:function(o,e,t,N){if(""==t)return e.IsNew?(b.tree.removeNode(e),!0):!1;if(e.Title==t)return!0;if(e.IsNew){var n=e.getParentNode(),a=n?n.NotebookId:"";b.doAddNotebook(e.NotebookId,t,a)}else b.doUpdateNotebookTitle(e.NotebookId,t);return!0}}};return s},Notebook.allNotebookId="0",Notebook.trashNotebookId="-1",Notebook.curNotebookIsTrashOrAll=function(){return Notebook.curNotebookId==Notebook.trashNotebookId||Notebook.curNotebookId==Notebook.allNotebookId},Notebook.renderNotebooks=function(o){var e=this;(!o||"object"!=typeof o||o.length<0)&&(o=[]);for(var t=0,N=o.length;N>t;++t){var n=o[t];n.Title=trimTitle(n.Title)}o=[{NotebookId:Notebook.allNotebookId,Title:getMsg("all"),drop:!1,drag:!1}].concat(o),o.push({NotebookId:Notebook.trashNotebookId,Title:getMsg("trash"),drop:!1,drag:!1}),Notebook.notebooks=o,e.tree=$.fn.zTree.init($("#notebookList"),e.getTreeSetting(),o);var a=$("#notebookList");a.hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),isEmpty(o)||(Notebook.curNotebookId=o[0].NotebookId,e.cacheAllNotebooks(o)),Notebook.renderNav(),Notebook.changeNotebookNavForNewNote(o[0].NotebookId)},Notebook.cacheAllNotebooks=function(o){var e=this;for(var t in o){var N=o[t];Notebook.cache[N.NotebookId]=N,isEmpty(N.Subs)||e.cacheAllNotebooks(N.Subs)}},Notebook.expandNotebookTo=function(o,e){var t=this,N=!1,n=t.tree;if(e&&(n=Share.trees[e]),n){var a=n.getNodeByTId(o);if(a)for(;;){var r=a.getParentNode();if(!r){N||Notebook.changeNotebookNav(o);break}n.expandNode(r,!0),N||(Notebook.changeNotebookNav(o),N=!0),a=r}}},Notebook.renderNav=function(o){var e=this;e.changeNav()},Notebook.searchNotebookForAddNote=function(o){var e=this;if(o){var t=e.tree.getNodesByParamFuzzy("Title",o);t=t||[];var N=[];for(var n in t){var a=t[n].NotebookId;e.isAllNotebookId(a)||e.isTrashNotebookId(a)||N.push(t[n])}isEmpty(N)?$("#notebookNavForNewNote").html(""):$("#notebookNavForNewNote").html(e.getChangedNotebooks(N))}else $("#notebookNavForNewNote").html(e.everNavForNewNote)},Notebook.searchNotebookForList=function(o){var e=this,t=$("#notebookListForSearch"),N=$("#notebookList")Line truncated
function addShareNoteOrNotebook(e){var t="#tr"+e,o=Share.dialogNoteOrNotebookId,r=isEmailFromInput(t+" #friendsEmail","#shareMsg",getMsg("inputFriendEmail"));if(r){var a=$(t+' input[name="perm'+e+'"]:checked').val()||0,n=a,s="/share/addShareNote",i={noteId:o,emails:[r],perm:a};Share.dialogIsNote||(s="/share/addShareNotebook",i={notebookId:o,emails:[r],perm:a}),hideAlert("#shareMsg"),post(s,i,function(e){var e=e[r];if(e)if(e.Ok){var a=tt("<td>?</td>","#");a+=tt("<td>?</td>",r),a+=tt('<td><a href="#" noteOrNotebookId="?" perm="?" toUserId="?" title="'+getMsg("clickToChangePermission")+'" class="btn btn-default change-perm">?</a></td>',o,n,e.Id,n&&"0"!=n?getMsg("writable"):getMsg("readOnly")),a+=tt('<td><a href="#" noteOrNotebookId="?" toUserId="?" class="btn btn-warning delete-share">'+getMsg("delete")+"</a></td>",o,e.Id),$(t).html(a)}else{var s=UrlPrefix+"/register?iu="+UserInfo.Username;showAlert("#shareMsg",getMsg("friendNotExits",[getMsg("app"),'<input style="background: none;border: 1px solid #ccc;width: 300px;padding: 3px;border-radius: 3px;outline: none;" onclick="$(this).focus().select()" type="text" value="'+s+'" />'])+"</a> <br /> "+getMsg("sendInviteEmailToYourFriend")+', <a href="#" onclick="sendRegisterEmail(\''+r+"')\">"+getMsg("send"),"warning")}},t+" .btn-success")}}function sendRegisterEmail(e){showDialog2("#sendRegisterEmailDialog",{postShow:function(){$("#emailContent").val(getMsg("inviteEmailBody",[UserInfo.Username,getMsg("app")])),setTimeout(function(){$("#emailContent").focus()},500),$("#toEmail").val(e)}})}function deleteShareNoteOrNotebook(e){$("#tr"+e).remove()}Share.defaultNotebookId="share0",Share.defaultNotebookTitle=getMsg("defaulthhare"),Share.sharedUserInfos={},Share.userNavs={},Share.notebookCache={},Share.cache={},Share.dialogIsNote=!0,Share.setCache=function(e){e&&e.NoteId&&(Share.cache[e.NoteId]=e)},Share.getNotebooksForNew=function(e,t){for(var o=this,r="",a=t.length,n=0;a>n;++n){var s=t[n];s.IsShared=!0,s.UserId=e,o.notebookCache[s.NotebookId]=s,Notebook.cache[s.NotebookId]=s;var i="",d=!1;if(!isEmpty(s.Subs)){log(11),log(s.Subs);var d=o.getNotebooksForNew(e,s.Subs);d&&(i="dropdown-submenu")}var h="";if(s.Perm){var h=tt('<li role="presentation" class="clearfix ?" userId="?" notebookId="?"><div class="new-note-left pull-left" title="为该笔记本新建笔记" href="#">?</div><div title="为该笔记本新建markdown笔记" class="new-note-right pull-left">M</div>',i,e,s.NotebookId,s.Title);d&&(h+="<ul class='dropdown-menu'>",h+=d,h+="</ul>"),h+="</li>"}r+=h}return r},Share.trees={},Share.renderShareNotebooks=function(e,t){function o(e){}function r(){var e=$(this).attr("notebookId");return!Share.isDefaultNotebookId(e)}var a=Share;if(!isEmpty(e)){(!t||"object"!=typeof t||t.length<0)&&(t={});var n=$("#shareNotebooks");for(var s in e){var i=e[s],d=t[i.UserId]||[];userNotebooks=[{NotebookId:a.defaultNotebookId,Title:Share.defaultNotebookTitle}].concat(d),a.notebookCache[a.defaultNotebookId]=userNotebooks[0];var h=i.Username||i.Email;i.Username=h,Share.sharedUserInfos[i.UserId]=i;var l=i.UserId,c=tt('<li class="each-user"><div class="friend-header" fromUserId="?"><i class="fa fa-angle-down"></i><span>?</span> <span class="fa notebook-setting" title="setting"></span> </div>',i.UserId,h),N="friendContainer_"+l,u='<ul class="friend-notebooks ztree" id="'+N+'" fromUserId="'+l+'"></ul>';n.append(c+u+"</li>"),a.trees[l]=$.fn.zTree.init($("#"+N),Notebook.getTreeSetting(!0,!0),userNotebooks),a.userNavs[l]={forNew:a.getNotebooksForNew(l,d)},log(a.userNavs)}$(".friend-notebooks").hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),$(".friend-header i").click(function(){var e=$(this),t=$(this).parent().next();t.is(":hidden")?(t.slideDown("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-down")):(t.slideUp("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-right"))});var f={width:180,items:[{text:getMsg("deleteSharedNotebook"),icon:"",faIcon:"fa-trash-o",action:Share.deleteShareNotebook}],onShow:o,onContextMenu:r,parent:"#shareNotebooks",children:".notebook-item"},b=$("#shareNotebooks").contextmenu(f),k={width:180,items:[{text:getMsg("deleteAllShared"),icon:"",faIcon:"fa-trash-o",action:Share.deleteUserShareNoteAndNotebook}],parent:"#shareNotebooks",children:".friend-header"},g=$("#shareNotebooks").contextmenu(k);$(".friend-header").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();g.showMenu(e,t)}),$("#shareNotebooks .notebook-item").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();b.showMenu(e,t)})}},Share.isDefaultNotebookId=function(e){return Share.defaultNotebookId==e},Share.toggleToSharedNav=function(e,t){$("#curNotebookForListNote").html(Share.notebookCache[t].Title+"("+Share.sharedUserInfos[e].Username+")");var o=Share.userNavs[e].forNew;if(o){$("#notebookNaLine truncated
+3 -1
View File
@@ -913,10 +913,12 @@ var Pjax = {
// ajax后调用
changeNote: function(noteInfo) {
var me = this;
log("push");
var noteId = noteInfo.NoteId;
var title = noteInfo.Title;
var url = '/note/' + noteId;
if (location.href.indexOf('?online') > 0) {
url += '?online=1'
}
if(location.hash) {
url += location.hash;
}
+1 -1
View File
@@ -1 +1 @@
var MSG={"app":"Leanote","share":"Share","noTag":"No Tags","inputEmail":"Email is required","history":"Histories","editorTips":"Tips","editorTipsInfo":"<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in this situation you can use shift+enter to get out of current code block.","all":"Newest","trash":"Trash","delete":"Delete","unTitled":"UnTitled","writingMode":"Writing Mode","normalMode":"Normal Mode","saving":"Saving","saveSuccess":"Save success","update":"Update","close":"Close","cancel":"Cancel","send":"Send","shareToFriends":"Share to friends","publicAsBlog":"Public as blog","cancelPublic":"Cancel public","move":"Move","copy":"Copy","rename":"Rename","exportPdf":"Export PDF","addChildNotebook":"Add child notebook","deleteAllShared":"Delete shared user","deleteSharedNotebook":"Delete shared notebook","copyToMyNotebook":"Copy to my notebook","defaulthhare":"Default","friendEmail":"Friend email","readOnly":"Read only","writable":"Writable","inputFriendEmail":"Friend email is required","clickToChangePermission":"Click to change permission","sendInviteEmailToYourFriend":"Send invite email to your friend","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","emailBodyRequired":"Email body is required","sendSuccess":"success","inviteEmailBody":"Hi,I am %s, %s is awesome, come on!","historiesNum":"We have saved at most <b>10</b> latest histories with each note","noHistories":"No histories","datetime":"Datetime","restoreFromThisVersion":"Restore from this version","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","errorEmail":"Please input the right email"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
var MSG={"app":"Leanote","share":"Share","noTag":"No Tags","inputEmail":"Email is required","history":"History","editorTips":"Tips","editorTipsInfo":"<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in this situation you can use shift+enter to get out of current code block.","all":"Newest","trash":"Trash","delete":"Delete","unTitled":"UnTitled","writingMode":"Writing Mode","normalMode":"Normal Mode","saving":"Saving","saveSuccess":"Save success","update":"Update","close":"Close","cancel":"Cancel","send":"Send","shareToFriends":"Share to friends","publicAsBlog":"Public as blog","cancelPublic":"Cancel public","move":"Move","copy":"Copy","rename":"Rename","exportPdf":"Export PDF","addChildNotebook":"Add child notebook","deleteAllShared":"Delete shared user","deleteSharedNotebook":"Delete shared notebook","copyToMyNotebook":"Copy to my notebook","defaulthhare":"Default","friendEmail":"Friend email","readOnly":"Read only","writable":"Writable","inputFriendEmail":"Friend email is required","clickToChangePermission":"Click to change permission","sendInviteEmailToYourFriend":"Send invite email to your friend","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","emailBodyRequired":"Email body is required","sendSuccess":"success","inviteEmailBody":"Hi,I am %s, %s is awesome, come on!","historiesNum":"We have saved at most <b>10</b> latest histories with each note","noHistories":"No histories","datetime":"Datetime","restoreFromThisVersion":"Restore from this version","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","errorEmail":"Please input the right email"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
+1 -1
View File
@@ -1 +1 @@
var MSG={"app":"Leanote","share":"分享","noTag":"无标签","inputEmail":"请输入Email","history":"历史记录","editorTips":"帮助","editorTipsInfo":"<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src=\"/images/outofcode.png\" style=\"width: 90px\"/>按shift+enter可跳出当前代码块.","all":"最新","trash":"废纸篓","delete":"删除","unTitled":"无标题","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","Update Time":"更新时间","Create Time":"创建时间","Post Url":"博文链接","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","sendSuccess":"发送成功","defaulthhare":"默认共享","friendEmail":"好友邮箱","readOnly":"只读","writable":"可写","inputFriendEmail":"请输入好友邮箱","clickToChangePermission":"点击改变权限","sendInviteEmailToYourFriend":"发送邀请email给Ta","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","emailBodyRequired":"邮件内容不能为空","inviteEmailBody":"Hi, 你好, 我是%s, %s非常好用, 快来注册吧!","historiesNum":"leanote会保存笔记的最近<b>10</b>份历史记录","noHistories":"无历史记录","datetime":"日期","restoreFromThisVersion":"从该版本还原","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","errorEmail":"请输入正确的email"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
var MSG={"app":"Leanote","share":"分享","noTag":"无标签","inputEmail":"请输入Email","history":"历史记录","editorTips":"帮助","editorTipsInfo":"<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src=\"/images/outofcode.png\" style=\"width: 90px\"/>按shift+enter可跳出当前代码块.","all":"最新","trash":"废纸篓","delete":"删除","unTitled":"无标题","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","sendSuccess":"发送成功","defaulthhare":"默认共享","friendEmail":"好友邮箱","readOnly":"只读","writable":"可写","inputFriendEmail":"请输入好友邮箱","clickToChangePermission":"点击改变权限","sendInviteEmailToYourFriend":"发送邀请email给Ta","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","emailBodyRequired":"邮件内容不能为空","inviteEmailBody":"Hi, 你好, 我是%s, %s非常好用, 快来注册吧!","historiesNum":"leanote会保存笔记的最近<b>10</b>份历史记录","noHistories":"无历史记录","datetime":"日期","restoreFromThisVersion":"从该版本还原","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","errorEmail":"请输入正确的email"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
+16 -16
View File
@@ -1,17 +1,17 @@
var requirejs,require,define;!function(ba){function G(e){return"[object Function]"===K.call(e)}function H(e){return"[object Array]"===K.call(e)}function v(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function T(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function t(e,t){return fa.call(e,t)}function m(e,i){return t(e,i)&&e[i]}function B(e,i){for(var n in e)if(t(e,n)&&i(e[n],n))break}function U(e,i,n,r){return i&&B(i,function(i,o){(n||!t(e,o))&&(!r||"object"!=typeof i||!i||H(i)||G(i)||i instanceof RegExp?e[o]=i:(e[o]||(e[o]={}),U(e[o],i,n,r)))}),e}function u(e,t){return function(){return t.apply(e,arguments)}}function ca(e){throw e}function da(e){if(!e)return e;var t=ba;return v(e.split("."),function(e){t=t[e]}),t}function C(e,t,i,n){return t=Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e),t.requireType=e,t.requireModules=n,i&&(t.originalError=i),t}function ga(e){function i(e,t,i){var n,r,o,a,s,u,d,c,t=t&&t.split("/"),f=D.map,p=f&&f["*"];if(e){for(e=e.split("/"),r=e.length-1,D.nodeIdCompat&&Q.test(e[r])&&(e[r]=e[r].replace(Q,"")),"."===e[0].charAt(0)&&t&&(r=t.slice(0,t.length-1),e=r.concat(e)),r=e,o=0;o<r.length;o++)a=r[o],"."===a?(r.splice(o,1),o-=1):".."===a&&0!==o&&(1!=o||".."!==r[2])&&".."!==r[o-1]&&o>0&&(r.splice(o-1,2),o-=2);e=e.join("/")}if(i&&f&&(t||p)){r=e.split("/"),o=r.length;e:for(;o>0;o-=1){if(s=r.slice(0,o).join("/"),t)for(a=t.length;a>0;a-=1)if((i=m(f,t.slice(0,a).join("/")))&&(i=m(i,s))){n=i,u=o;break e}!d&&p&&m(p,s)&&(d=m(p,s),c=o)}!n&&d&&(n=d,u=c),n&&(r.splice(0,u,n),e=r.join("/"))}return(n=m(D.pkgs,e))?n:e}function n(e){z&&v(document.getElementsByTagName("script"),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===k.contextName?(t.parentNode.removeChild(t),!0):void 0})}function r(e){var t=m(D.paths,e);return t&&H(t)&&1<t.length?(t.shift(),k.require.undef(e),k.makeRequire(null,{skipMap:!0})([e]),!0):void 0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,n,r){var a,s,u=null,d=t?t.name:null,c=e,f=!0,p="";return e||(f=!1,e="_@r"+(J+=1)),e=o(e),u=e[0],e=e[1],u&&(u=i(u,d,r),s=m(F,u)),e&&(u?p=s&&s.normalize?s.normalize(e,function(e){return i(e,d,r)}):-1===e.indexOf("!")?i(e,d,r):e:(p=i(e,d,r),e=o(p),u=e[0],p=e[1],n=!0,a=k.nameToUrl(p))),n=!u||s||n?"":"_unnormalized"+(P+=1),{prefix:u,name:p,parentMap:t,unnormalized:!!n,url:a,originalName:c,isDefine:f,id:(u?u+"!"+p:p)+n}}function s(e){var t=e.id,i=m(w,t);return i||(i=w[t]=new k.Module(e)),i}function d(e,i,n){var r=e.id,o=m(w,r);!t(F,r)||o&&!o.defineEmitComplete?(o=s(e),o.error&&"error"===i?n(o.error):o.on(i,n)):"defined"===i&&n(F[r])}function c(e,t){var i=e.requireModules,n=!1;t?t(e):(v(i,function(t){(t=m(w,t))&&(t.error=e,t.events.error&&(n=!0,t.emit("error",e)))}),n||g.onError(e))}function f(){R.length&&(ha.apply(O,[O.length,0].concat(R)),R=[])}function p(e){delete w[e],delete A[e]}function l(e,t,i){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,v(e.depMaps,function(n,r){var o=n.id,a=m(w,o);a&&!e.depMatched[r]&&!i[o]&&(m(t,o)?(e.defineDep(r,F[o]),e.check()):l(a,t,i))}),i[n]=!0)}function h(){var e,t,i=(e=1e3*D.waitSeconds)&&k.startTime+e<(new Date).getTime(),o=[],a=[],s=!1,u=!0;if(!y){if(y=!0,B(A,function(e){var d=e.map,c=d.id;if(e.enabled&&(d.isDefine||a.push(e),!e.error))if(!e.inited&&i)r(c)?s=t=!0:(o.push(c),n(c));else if(!e.inited&&e.fetched&&d.isDefine&&(s=!0,!d.prefix))return u=!1}),i&&o.length)return e=C("timeout","Load timeout for modules: "+o,null,o),e.contextName=k.contextName,c(e);u&&v(a,function(e){l(e,{},{})}),i&&!t||!s||!z&&!ea||S||(S=setTimeout(function(){S=0,h()},50)),y=!1}}function x(e){t(F,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function b(e){var e=e.currentTarget||e.srcElement,t=k.onScriptLoad;return e.detachEvent&&!Y?e.detachEvent("onreadystatechange",t):e.removeEventListener("load",t,!1),t=k.onScriptError,(!e.detachEvent||Y)&&e.removeEventListener("error",t,!1),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function q(){var e;for(f();O.length;){if(e=O.shift(),null===e[0])return c(C("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));x(e)}}var y,E,k,j,S,D={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},w={},A={},L={},O=[],F={},I={},_={},J=1,P=1;return j={require:function(e){return e.require?e.require:e.require=k.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?F[e.map.id]=e.exports:e.exports=F[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return m(D.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},E=function(e){this.events=m(L,e.id)||{},this.map=e,this.shim=m(D.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},E.prototype={init:function(e,t,i,n){n=n||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&Line truncated
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&x(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),b.initialized=!0,b.supported=!1}function o(t){var e="Rangy warning: "+t;b.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!b.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&x(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),b.initialized=!0,b.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](b)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=S.length;n>e;++e)S[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),x=r(n),b={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:x,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};b.fail=a,b.warn=o,{}.hasOwnProperty?b.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];b.init=s,b.addInitListener=function(t){b.initialized?t(b):w.push(t)};var S=[];b.addCreateMissingNativeApiListener=function(t){S.push(t)},b.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){b.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},b.createModule=function(t,e){var n=new c(t);b.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},b.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=b.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var C=!1,E=function(){C||(C=!0,b.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),b)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}function i(t){for(var e=0;t=t.previousSibling;)e++;return e}function a(t){var e;return c(t)?t.length:(e=t.childNodes)?e.length:0}function o(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(N(r,n))return n;return null}function s(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function l(t,e,n){for(var r,i=n?t:t.parentNode;i;){if(r=i.parentNode,r===e)return i;i=r}return null}function c(t){var e=t.nodeType;return 3==e||4==e||8==e}function u(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function h(t,e){var n=t.cloneNode(!1);return n.deleteData(0,e),t.deleteData(e,t.length-e),u(n,t),n}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=E)return t.ownerDocument;if(typeof t.document!=E)return t.document;if(t.parentNode)return f(t.parentNode);throw new Error("getDocument: no document fouLine truncated
else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=C.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,x,b="boolean",w="_rangySelection",_=t.dom,S=t.util,C=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=S.areHostObjects(M,["anchorNode","focusNode"]&&S.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=S.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;S.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&S.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),S.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,x=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;S.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelection=i,e.refresh(t)):(e=new p(n,i,t),t[w]=e),e},t.getIframeSelection=function(e){return t.getSelection(_.getIframeWindow(e))};var q=p.prototype;if(!A&&D&&S.areHostMethods(M,["removeAllRanges","addRange"])){q.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),o(this)};var G=function(e,n){var r=C.getRangeDocument(n),i=t.createRange(r);i.collapseToPoint(n.endContainer,n.endOffset),e.nativeSelection.addRange(s(i)),e.nativeSelection.extend(n.startContainer,n.startOffset),e.refresh()};q.addRange=P?function(e,n){if(H&&R&&this.docSelection.type==I)d(this,e);else if(n&&F)G(this,e);else{var r;if(B?r=this.rangeCount:(this.removeAllRanges(),r=0),this.nativeSelection.addRange(s(e)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=U(this.nativeSelection,this.rangeCount-1);a&&!C.rangesEqual(a,e)&&(e=new E(a))}this._ranges[this.rangeLine truncated
var i=b.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=b.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return b.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=b.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(b.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r<e.length;++r)if(!A[e.charAt(r)])throw new SyntaxError("Unknown regex flag "+e.charAt(r));return{pattern:t,flags:e}}function u(t){return t=t||{},s(t,"String")&&(t=m.forEach(t,/[^\s,]+/,function(t){this[t]=!0},{})),t}function h(t){if(!/^[\w$]$/.test(t))throw new Error("Flag must be a single character A-Za-z0-9_$");A[t]=!0}function f(t,e,n,r,i){for(var a,o,s=C.length,l=null;s--;)if(o=C[s],(o.scope===r||"all"===o.scope)&&(!o.flag||e.indexOf(o.flag)>-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),x.astral=t}function p(t){RegExp.prototype.exec=(t?w:b).exec,RegExp.prototype.test=(t?w:b).test,String.prototype.match=(t?w:b).match,String.prototype.replace=(t?w:b).replace,String.prototype.split=(t?w:b).split,x.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",x={astral:!1,natives:!1},b={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},S={},C=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=b.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!S[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d<n.length;){do a=f(n,i,d,u,l),a&&a.reparse&&(n=n.slice(0,d)+a.output+n.slice(d+a.matchLength));while(a&&a.reparse);a?(h+=a.output,d+=a.matchLength||1):(o=m.exec(n,T[u],d,"sticky")[0],h+=o,d+=o.length,"["===o&&u===E?u=k:"]"===o&&u===k&&(u=E))}S[s]={pattern:b.replace.call(h,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:b.replace.call(i,/[^gimy]+/g,""),captures:l.hasNamedCapture?l.captureNames:null}}return s=S[s],e(new RegExp(s.pattern,s.flags),s.captures,!0)},m.prototype=new RegExp,m.version="3.0.0-pre",m.addToken=function(t,e,n){n=n||{};var i,a=n.optionalFlags;if(n.flag&&h(n.flag),a)for(a=b.split.call(a,""),i=0;i<a.length;++i)h(a[i]);C.push({regex:r(t,{add:"g"+(R?"y":"")}),handler:e,scope:n.scope||E,flag:n.flag,reparse:n.reparse}),m.cache.flush("patterns")},m.cache=function(t,e){var n=t+"***"+(e||"");return _[n]||(_[n]=m(t,e))},m.cache.flush=function(t){"patterns"===t?S={}:_={}},m.escape=function(t){return b.replace.call(g(t),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},m.exec=function(t,e,n,a){var o,s,l="g";return R&&(a||e.sticky&&a!==!1)&&(l+="y"),e[y]=e[y]||i(),s=e[y][l]||(e[y][l]=r(e,{add:l,remove:a===!1?"y":""})),s.lastIndex=n=n||0,o=w.exec.call(s,t),a&&o&&o.index!==n&&(o=null),e.global&&(e.lastIndex=o?s.lastIndex:0),o},m.forEach=function(t,e,n,r){for(var i,a=0,o=-1;i=m.exec(t,e,a);)n.call(r,i,++o,t,e),a=i.index+(i[0].length||1);return r},m.globalize=function(t){return r(t,{add:"g",addProto:!0})},m.install=function(t){t=u(t),!x.astral&&t.astral&&d(!0),!x.natives&&t.natives&&p(!0)},m.isInstalled=function(t){return!!x[t]},m.isRegExp=function(t){return"[object RegExp]"===M.call(t)},m.match=function(t,e,n){var a,o,s=e.global&&"one"!==n||"all"===n,l=(s?"g":"")+(e.sticky?"y":"");return e[y]=e[y]||i(),o=e[y][l||"noGY"]||(e[y][l||"noGY"]=r(e,{add:l,remove:"one"===n?"g":""})),a=b.match.call(g(t),o),e.global&&(e.lastIndex="one"===n&&a?a.index+a[0].length:0),s?a||[]:a&&a[0]},m.matchChain=function(t,e){return function n(t,r){var i,a=e[r].regex?e[r]:{regex:e[r]},o=[],s=function(t){if(a.backref){if(!(t.hasOwnProperty(a.backref)||+a.backref<t.length))throw new ReferenceError("Backreference to undefined group: "+a.backref);o.push(t[a.backref]||"")}else o.push(t[0])};for(i=0;i<t.lenLine truncated
}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");t.addUnicodeData([{name:"ASCII",bmp:"\x00-"},{name:"Alphabetic",bmp:"A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͅͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևְ-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-ٗٙ-ٟٮ-ۓە-ۜۡ-ۭۨ-ۯۺ-ۼۿܐ-ܿݍ-ޱߊ-ߪߴߵߺࠀ-ࠗࠚ-ࠬࡀ-ࡘࢠࢢ-ࢬࣤ-ࣰࣩ-ࣾऀ-ऻऽ-ौॎ-ॐॕ-ॣॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হঽ-ৄেৈোৌৎৗড়ঢ়য়-ৣৰৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੂੇੈੋੌੑਖ਼-ੜਫ਼ੰ-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ૅે-ૉોૌૐૠ-ૣଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽ-ୄେୈୋୌୖୗଡ଼ଢ଼ୟ-ୣୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-ௌௐௗఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-ౌౕౖౘౙౠ-ౣಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊ-ೌೕೖೞೠ-ೣೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൌൎൗൠ-ൣൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ුූෘ-ෟෲෳก-ฺเ-ๆํກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆໍໜ-ໟༀཀ-ཇཉ-ཬཱ-ཱྀྈ-ྗྙ-ྼက-ံးျ-ဿၐ-ၢၥ-ၨၮ-ႆႎႜႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜓᜠ-ᜳᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-ឳា-ៈៗៜᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-ᤸᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨛᨠ-ᩞᩡ-ᩴᪧᬀ-ᬳᬵ-ᭃᭅ-ᭋᮀ-ᮩᮬ-ᮯᮺ-ᯥᯧ-ᯱᰀ-ᰵᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙴ-ꙻꙿ-ꚗꚟ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠧꡀ-ꡳꢀ-ꣃꣲ-ꣷꣻꤊ-ꤪꤰ-ꥒꥠ-ꥼꦀ-ꦲꦴ-ꦿꧏꨀ-ꨶꩀ-ꩍꩠ-ꩶꩺꪀ-ꪾꫀꫂꫛ-ꫝꫠ-ꫯꫲ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",astral:"�[�-�]|�[�-�]|�[�-�]|�[�-�]|�[�-��-��-��-��-��-�]|[��-��-�][�-�]|�[�-�]|�[�-��-�]|�[�-�]|�[�-�]|�[�-���-�����-��-��-��-����-����-��-��-��-��-��-��-�]|�[�-��-��-����-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-��-���-��-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-������-��-��������-�������������-��-��-��-���-��-��-��-��-�]|�[�-��-�]|�[��]|�[�-�]|�[�-�]"},{name:"Any",isBmpLast:!0,bmp:"\x00-￿",astral:"[�-�][�-�]"},{name:"Assigned",inverseOf:"Cn"},{name:"Default_Ignorable_Code_Point",bmp:"­͏ᅟᅠ឴឵᠋-᠍​-‏‪-‮⁠-ㅤ︀-️ᅠ￰-￸",astral:"[�-�][�-�]|�[�-�]"},{name:"Lowercase",bmp:"a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʸˀˁˠ-ˤͅͱͳͷͺ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᶿḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆῇLine truncated
}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1.0">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="'+e.MAIN_URL+'res-min/themes/base.css" />','<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>",'<body><div class="container"><%= documentHTML %></div></body>',"</html>"].join("\n"),pdfTemplate:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />','<script type="text/x-mathjax-config">','MathJax.Hub.Config({ messageStyle: "none" });',"</script>",'<script type="text/javascript" src="http://localhost/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>","<body><%= documentHTML %></body>","</html>"].join("\n"),pdfOptions:["{",' "marginTop": 25,',' "marginRight": 25,',' "marginBottom": 25,',' "marginLeft": 25,',' "pageSize": "A4"',"}"].join("\n"),couchdbUrl:e.COUCHDB_URL,extensionSettings:{}};try{t.extend(r,JSON.parse(n.settings))}catch(i){}return r}),function(t,e){function n(t,e,n){return t.addEventListener?void t.addEventListener(e,n,!1):void t.attachEvent("on"+e,n)}function r(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return C[t.which]?C[t.which]:E[t.which]?E[t.which]:String.fromCharCode(t.which).toLowerCase()}function i(t,e){return t.sort().join(",")===e.sort().join(",")}function a(t){t=t||{};var e,n=!1;for(e in R)t[e]?n=!0:R[e]=0;n||(L=!1)}function o(t,e,n,r,a,o){var s,l,c=[],u=n.type;if(!I[t])return[];for("keyup"==u&&d(t)&&(e=[t]),s=0;s<I[t].length;++s)if(l=I[t][s],(r||!l.seq||R[l.seq]==l.level)&&u==l.action&&("keypress"==u&&!n.metaKey&&!n.ctrlKey||i(e,l.modifiers))){var h=!r&&l.combo==a,f=r&&l.seq==r&&l.level==o;(h||f)&&I[t].splice(s,1),c.push(l)}return c}function s(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function l(t){return t.preventDefault?void t.preventDefault():void(t.returnValue=!1)}function c(t){return t.stopPropagation?void t.stopPropagation():void(t.cancelBubble=!0)}function u(t,e,n,r){D.stopCallback(e,e.target||e.srcElement,n,r)||t(e,n)===!1&&(l(e),c(e))}function h(t,e,n){var r,i=o(t,e,n),s={},l=0,c=!1;for(r=0;r<i.length;++r)i[r].seq&&(l=Math.max(l,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=l)continue;c=!0,s[i[r].seq]=1,u(i[r].callback,n,i[r].combo,i[r].seq)}else c||u(i[r].callback,n,i[r].combo);var h="keypress"==n.type&&M;n.type!=L||d(t)||h||a(s),M=c&&"keydown"==n.type}function f(t){"number"!=typeof t.which&&(t.which=t.keyCode);var e=r(t);return e?"keyup"==t.type&&A===e?void(A=!1):void D.handleKey(e,s(t),t):void 0}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(){clearTimeout(S),S=setTimeout(a,1e3)}function g(){if(!_){_={};for(var t in C)t>95&&112>t||C.hasOwnProperty(t)&&(_[C[t]]=t)}return _}function m(t,e,n){return n||(n=g()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e,n,i){function o(e){return function(){L=e,++R[t],p()}}function s(e){u(n,e,t),"keyup"!==i&&(A=r(e)),setTimeout(a,10)}R[t]=0;for(var l=0;l<e.length;++l){var c=l+1===e.length,h=c?s:o(i||x(e[l+1]).action);b(e[l],h,i,t,l)}}function y(t){return"+"===t?["+"]:t.split("+")}function x(t,e){var n,r,i,a=[];for(n=y(t),i=0;i<n.length;++i)r=n[i],T[r]&&(r=T[r]),e&&"keypress"!=e&&k[r]&&(r=k[r],a.push("shift")),d(r)&&a.push(r);return e=m(r,a,e),{key:r,modifiers:a,action:e}}function b(t,e,n,r,i){N[t+":"+n]=e,t=t.replace(/\s+/g," ");var a,s=t.split(" ");return s.length>1?void v(t,s,e,n):(a=x(t,n),I[a.key]=I[a.key]||[],o(a.key,a.modifiers,{type:a.action},r,t,i),void I[a.key][r?"unshift":"push"]({callback:e,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}function w(t,e,n){for(var r=0;r<t.length;++r)b(t[r],e,n)}for(var _,S,C={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},E={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},k={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"Line truncated
},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");""===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?e.get=function(t,e){var n,r,i="utf-8",a=new java.io.File(t),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),i)),l="";try{for(n=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=s.readLine());)n.append(o),n.append(r);l=String(n.toString())}finally{s.close()}e(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),a="@mozilla.org/windows-registry-key;1"in r,e.get=function(t,e){var n,o,s,l={};a&&(t=t.replace(/\//g,"\\")),s=new FileUtils.File(t);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(s,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),l),o.close(),n.close(),e(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),e}),define("text!html/markdownExtraSettingsBlock.html",[],function(){return'<p>Adds extra features to the original Markdown syntax.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-markdownextra-tables">Tables</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-tables">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-deflist">Definition lists</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-deflist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-attrlist">Special attributes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-attrlist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-footnotes">Footnotes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-footnotes">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-comments">Comments</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-comments">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-smartypants">SmartyPants</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-smartypants">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-newlines">GFM newlines</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-newlines">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-intraword">GFM intra-word stars/underscores</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-intraword">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-strikethrough">GFM strikethrough</label>\n <div class="col-sm-7">\n <div class="checkbox"Line truncated
},Markdown.Extra.init=function(t,e){var n=new Markdown.Extra,i=[],a=[],o=[],s=["unHashExtraBlocks"];return e=e||{},e.extensions=e.extensions||["all"],r(e.extensions,"all")&&(e.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]),a.push("wrapHeaders"),r(e.extensions,"attr_list")&&(i.push("hashFcbAttributeBlocks"),a.push("hashHeaderAttributeBlocks"),s.push("applyAttributeBlocks"),n.attributeBlocks=!0),r(e.extensions,"fenced_code_gfm")&&(a.push("fencedCodeBlocks"),i.push("fencedCodeBlocks")),r(e.extensions,"tables")&&a.push("tables"),r(e.extensions,"def_list")&&a.push("definitionLists"),r(e.extensions,"footnotes")&&(i.push("stripFootnoteDefinitions"),a.push("doFootnotes"),s.push("printFootnotes")),r(e.extensions,"smartypants")&&s.push("runSmartyPants"),r(e.extensions,"strikethrough")&&o.push("strikethrough"),r(e.extensions,"newlines")&&o.push("newlines"),t.hooks.chain("postNormalization",function(t){return n.doTransform(i,t)+"\n"}),t.hooks.chain("preBlockGamut",function(t,e){return n.blockGamutHookCallback=e,t=u(t),t=n.doTransform(a,t)+"\n",t=h(t)}),t.hooks.chain("postSpanGamut",function(t){return n.doTransform(o,t)}),n.previousPostConversion=t.hooks.postConversion,t.hooks.chain("postConversion",function(t){return t=n.doTransform(s,t),n.hashBlocks=[],n.footnotes={},n.usedFootnotes=[],t}),"highlighter"in e&&(n.googleCodePrettify="prettify"===e.highlighter,n.highlightJs="highlight"===e.highlighter),"table_class"in e&&(n.tableClass=e.table_class),n.converter=t,n},Markdown.Extra.prototype.doTransform=function(t,e){for(var n=0;n<t.length;n++)e=this[t[n]](e);return e},Markdown.Extra.prototype.hashExtraBlock=function(t){return"\n<p>~X"+(this.hashBlocks.push(t)-1)+"X</p>\n"},Markdown.Extra.prototype.hashExtraInline=function(t){return"~X"+(this.hashBlocks.push(t)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(t){function e(){var r=!1;t=t.replace(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g,function(t,e){r=!0;var i=parseInt(e,10);return n.hashBlocks[i]}),r===!0&&e()}var n=this;return e(),t},Markdown.Extra.prototype.wrapHeaders=function(t){function e(t){return"\n"+t+"\n"}return t=t.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,e),t=t.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,e),t=t.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,e)};var m="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",v=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+m+"[ \\t]*(?:\\n|0x03)","gm"),y=new RegExp("^(.*)[ \\t]+"+m+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),x=new RegExp("^(```[^`\\n]*)[ \\t]+"+m+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t=t.replace(v,e),t=t.replace(y,e)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t.replace(x,e)},Markdown.Extra.prototype.applyAttributeBlocks=function(t){var e=this,n=new RegExp('<p>~XX(\\d+)XX</p>[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?</\\2>))',"gm");return t=t.replace(n,function(t,n,r,i,o){if(!r)return"";for(var s=parseInt(n,10),l=e.hashBlocks[s],c=l.match(/#[^\s#.]+/g)||[],u=c[0]?' id="'+c[0].substr(1,c[0].length-1)+'"':"",h=l.match(/\.[^\s#.]+/g)||[],f=0;f<h.length;f++)h[f]=h[f].substr(1,h[f].length-1);var d="";return i&&(h=a(h,[i])),h.length>0&&(d=' class="'+h.join(" ")+'"'),"<"+r+u+d+o})},Markdown.Extra.prototype.tables=function(e){function n(e,n,i,a){n=n.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),a=a.replace(/^ *[|]/gm,""),n=n.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),a=a.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var o=0;o<alignspecs.length;o++){var s=alignspecs[o];align[o]=s.match(/^ *-+: *$/m)?' align="right"':s.match(/^ *:-+: *$/m)?' align="center"':s.match(/^ *:-+ *$/m)?' align="left"':""}var c=n.split(/ *[|] */),u=c.length,h=r.tableClass?' class="'+r.tableClass+'"':"",f=["<table",h,">\n","<thead>\n","<tr>\n"].join("");for(o=0;u>o;o++){var d=l(t(c[o]),r);f+=[" <th",align[o],">",d,"</th>\n"].join("")}f+="</tr>\n</thead>\n";var p=a.split("\n");for(o=0;o<p.length;o++)if(!p[o].match(/^\s*$/)){for(var g=p[o].split(/ *[|] */),m=u-g.length,v=0;m>v;v++)g.push("");for(f+="<tr>\n",v=0;u>v;v++){var y=l(t(g[v]),r);f+=[" <td",align[v],">",y,"</td>\n"].join("")}f+="</tr>\n"}return f+="</table>\n",r.hashExtraBlock(f)}var r=this,i=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),a=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(i,n),e=e.replace(a,n)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(t){var e=this;return t=t.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(t,n,r){return n=d(n),r+="\n",r=r.replaLine truncated
},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'<p>Creates UML diagrams from plain text description.</p>\n\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="textarea-umldiagram-flowchart-options">Flow charts options (JSON)\n </label>\n <div class="col-sm-7">\n <textarea id="textarea-umldiagram-flowchart-options" class="form-control"></textarea>\n </div>\n </div>\n</div>\n<br>\n<p>Sequence diagrams:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence\nAlice->Bob: Hello Bob, how are you?\nBob-->Alice: I am good thanks!\n```</code>\n</pre>\n\n<p>Flow charts:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a></div><code>```flow\nst=>start: Start\ne=>end\nop=>operation: My Operation\ncond=>condition: Yes or No?\nst->op->cond\ncond(yes)->e\ncond(no)->op\n```</code>\n</pre>\n<blockquote>\n <p><b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.</p>\n</blockquote>\n'}),function(t){var e,n,r="0.4.2",i="hasOwnProperty",a=/[\.\/]/,o="*",s=function(){},l=function(t,e){return t-e},c={n:{}},u=function(t,r){t=String(t);var i,a=n,o=Array.prototype.slice.call(arguments,2),s=u.listeners(t),c=0,h=[],f={},d=[],p=e;e=t,n=0;for(var g=0,m=s.length;m>g;g++)"zIndex"in s[g]&&(h.push(s[g].zIndex),s[g].zIndex<0&&(f[s[g].zIndex]=s[g]));for(h.sort(l);h[c]<0;)if(i=f[h[c++]],d.push(i.apply(r,o)),n)return n=a,d;for(g=0;m>g;g++)if(i=s[g],"zIndex"in i)if(i.zIndex==h[c]){if(d.push(i.apply(r,o)),n)break;do if(c++,i=f[h[c]],i&&d.push(i.apply(r,o)),n)break;while(i)}else f[i.zIndex]=i;else if(d.push(i.apply(r,o)),n)break;return n=a,e=p,d.length?d:null};u._events=c,u.listeners=function(t){var e,n,r,i,s,l,u,h,f=t.split(a),d=c,p=[d],g=[];for(i=0,s=f.length;s>i;i++){for(h=[],l=0,u=p.length;u>l;l++)for(d=p[l].n,n=[d[f[i]],d[o]],r=2;r--;)e=n[r],e&&(h.push(e),g=g.concat(e.f||[]));p=h}return g},u.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(a),r=c,i=0,o=n.length;o>i;i++)r=r.n,r=r.hasOwnProperty(n[i])&&r[n[i]]||(r[n[i]]={n:{}});for(r.f=r.f||[],i=0,o=r.f.length;o>i;i++)if(r.f[i]==e)return s;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.f=function(t){var e=[].slice.call(arguments,1);return function(){u.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.nts=function(){return e.split(a)},u.off=u.unbind=function(t,e){if(!t)return void(u._events=c={n:{}});var n,r,s,l,h,f,d,p=t.split(a),g=[c];for(l=0,h=p.length;h>l;l++)for(f=0;f<g.length;f+=s.length-2){if(s=[f,1],n=g[f].n,p[l]!=o)n[p[l]]&&s.push(n[p[l]]);else for(r in n)n[i](r)&&s.push(n[r]);g.splice.apply(g,s)}for(l=0,h=g.length;h>l;l++)for(n=g[l];n.n;){if(e){if(n.f){for(f=0,d=n.f.length;d>f;f++)if(n.f[f]==e){n.f.splice(f,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n[r].f){var m=n.n[r].f;for(f=0,d=m.length;d>f;f++)if(m[f]==e){m.splice(f,1);break}!m.length&&delete n.n[r].f}}else{delete n.f;for(r in n.n)n.n[i](r)&&n.n[r].f&&delete n.n[r].f}n=n.n}},u.once=function(t,e){var n=function(){return u.unbind(t,n),e.apply(this,arguments)};return u.on(t,n)},u.version=r,u.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=u:"undefined"!=typeof define?define("eve",[],function(){return u}):t.eve=u}(this),function(t,e){"function"==typeof define&&define.amd?define("raphael",["eve"],function(n){return e(t,n)}):e(t,t.eve)}(this,function(t,e){function n(t){if(n.is(t,"function"))return b?t():e.on("raphael.DOMload",t);if(n.is(t,X))return n._engine.create[N](n,t.splice(0,3+n.is(t[0],z))).add(t);var r=Array.prototype.slice.call(arguments,0);if(n.is(r[r.length-1],"function")){var i=r.pop();return b?i.call(n._engine.creaLine truncated
},n._toback=function(t,e){e.bottom!==t&&(Pe(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pe(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pe(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Te(t),r={_:{transform:M},getBBox:function(){return n}};return je(r,e),r.matrix}),je=(n.transformPath=function(t,e){return ve(t,Be(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,x=r[h],b=x.length,w=O(x[0]).toLowerCase(),_=x[0]!=w,S=_?u.invert():0;"t"==w&&3==b?_?(d=S.x(0,0),g=S.y(0,0),m=S.x(x[1],x[2]),v=S.y(x[1],x[2]),u.translate(m-d,v-g)):u.translate(x[1],x[2]):"r"==w?2==b?(y=y||t.getBBox(1),u.rotate(x[1],y.x+y.width/2,y.y+y.height/2),i+=x[1]):4==b&&(_?(m=S.x(x[2],x[3]),v=S.y(x[2],x[3]),u.rotate(x[1],m,v)):u.rotate(x[1],x[2],x[3]),i+=x[1]):"s"==w?2==b||3==b?(y=y||t.getBBox(1),u.scale(x[1],x[b-1],y.x+y.width/2,y.y+y.height/2),s*=x[1],l*=x[b-1]):5==b&&(_?(m=S.x(x[3],x[4]),v=S.y(x[3],x[4]),u.scale(x[1],x[2],m,v)):u.scale(x[1],x[2],x[3],x[4]),s*=x[1],l*=x[2]):"m"==w&&7==b&&u.add(x[1],x[2],x[3],x[4],x[5],x[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),$e=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},He=n._equaliseTransform=function(t,e){e=O(e).replace(/\.{3}|\u2026/g,t),t=n.parseTransformString(t)||[],e=n.parseTransformString(e)||[];for(var r,i,a,o,s=$(t.length,e.length),l=[],c=[],u=0;s>u;u++){if(a=t[u]||$e(e[u]),o=e[u]||$e(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],r=0,i=$(a.length,o.length);i>r;r++)r in a&&(l[u][r]=a[r]),r in o&&(c[u][r]=o[r])}return{from:l,to:c}};n._getContainer=function(t,e,r,i){var a;return a=null!=i||n.is(t,"object")?t:k.doc.getElementById(t),null!=a?a.tagName?null==e?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:e,height:r}:{container:1,x:t,y:e,width:r,height:i}:void 0},n.pathToRelative=Ne,n._engine={},n.path2curve=Fe,n.matrix=function(t,e,n,r,i,a){return new p(t,e,n,r,i,a)},function(t){function e(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var n=j.sqrt(e(t));t[0]&&(t[0]/=n),t[1]&&(t[1]/=n)}t.add=function(t,e,n,r,i,a){var o,s,l,c,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof p&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=h[o][l]*f[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new p(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,r){t=n.rad(t),e=e||0,r=r||0;var i=+j.cos(t).toFixed(9),a=+j.sin(t).toFixed(9);this.add(i,a,-a,i,e,r),this.add(1,0,0,1,-e,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[O.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return n.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=j.sqrt(e(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=j.sqrt(e(i[1])),r(i[1]),t.shear/=t.scaley;var a=-i[0][1],o=i[1][1];return 0>o?(t.rotate=n.deg(j.acos(o)),0>a&&(t.rotate=360-t.rotate)):t.rotate=n.deg(j.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[D]();return e.isSimpleLine truncated
break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=n.getRGB(g),l.setAttribute(p,M.hex),"stroke"==p&&M[t]("opacity")&&m(l,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),L&&(O=L.getElementsByTagName("stop"),m(O[O.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var D=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[D]=g,r._.dirty=1,l.setAttribute(p,g)}}C(r,a),l.style.visibility=f},S=1.2,C=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,l=s.firstChild?i(n._g.doc.defaultView.getComputedStyle(s.firstChild,h).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=e(a.text).split("\n"),f=[],d=0,p=u.length;p>d;d++)c=m("tspan"),d&&m(c,{dy:l*S,x:o.x}),c.appendChild(n._g.doc.createTextNode(u[d])),s.appendChild(c),f[d]=c}else for(f=s.getElementsByTagName("tspan"),d=0,p=f.length;p>d;d++)d?m(f[d],{dy:l*S,x:o.x}):m(f[0],{dy:0});m(s,{x:o.x,y:o.y}),r._.dirty=1;var g=r._getBBox(),v=o.y-(g.y+g.height/2);v&&n.is(v,"finite")&&m(f[0],{dy:v})}},E=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.matrix=n.matrix(),this.realPath=null,this.paper=e,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},k=n.el;E.prototype=k,k.constructor=E,n._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new E(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},k.rotate=function(t,n,i){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,n,i]])),this},k.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3])),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this},k.translate=function(t,n){return this.removed?this:(t=e(t).split(c),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this.transform(this._.transform.concat([["t",t,n]])),this)},k.transform=function(e){var r=this._;if(null==e)return r.transform;if(n._extractTransform(this,e),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[t]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},k.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},k.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},k.remove=function(){if(!this.removed&&this.node.parentNode){var t=this.paper;t.__set__&&t.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&t.defs.removeChild(this.gradient),n._tear(this,t),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var e in this)this[e]="function"==typeof this[e]?n._removeLine truncated
this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,x,b,w,_,S,C={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var E="";S=[];for(b in o[v])this.terminals_[b]&&b>h&&S.push("'"+this.terminals_[b]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:S})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexer.yytext),a.push(this.lexer.yylloc),r.push(y[1]),g=null,m?(g=m,m=null):(c=this.lexer.yyleng,s=this.lexer.yytext,l=this.lexer.yylineno,d=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[y[1]][1],C.$=i[i.length-w],C._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},p&&(C._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),x=this.performAction.call(C,s,c,l,this.yy,y[1],i,a),"undefined"!=typeof x)return x;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),r.push(this.productions_[y[1]][0]),i.push(C.$),a.push(C._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylinLine truncated
else a=this.leftEnd&&x?r(this.chart,c,[{x:c.x,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,_=p.x;else a=r(this.chart,l,g,e),this.rightStart=!0,t.leftEnd=!0,_=g.x;else a=r(this.chart,c,d,e),this.bottomStart=!0,t.topEnd=!0,_=c.x;if(a){for(var k=0,T=this.chart.lines.length;T>k;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),A=a.attr("path"),M=0,L=R.length-1;L>M;M++){var O=[];O.push(["M",R[M][1],R[M][2]]),O.push(["L",R[M+1][1],R[M+1][2]]);for(var D=O[0][1],F=O[0][2],P=O[1][1],B=O[1][2],j=0,$=A.length-1;$>j;j++){var H=[];H.push(["M",A[j][1],A[j][2]]),H.push(["L",A[j+1][1],A[j+1][2]]);var U=H[0][1],q=H[0][2],G=H[1][1],z=H[1][2],W=i(D,F,P,B,U,q,G,z);if(W.onLine1&&W.onLine2){var X;q===z?U>G?(X=["L",W.x+2*C,q],A.splice(j+1,0,X),X=["C",W.x+2*C,q,W.x,q-4*C,W.x-2*C,q],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",W.x-2*C,q],A.splice(j+1,0,X),X=["C",W.x-2*C,q,W.x,q-4*C,W.x+2*C,q],A.splice(j+2,0,X),a.attr("path",A)):q>z?(X=["L",U,W.y+2*C],A.splice(j+1,0,X),X=["C",U,W.y+2*C,U+4*C,W.y,U,W.y-2*C],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",U,W.y-2*C],A.splice(j+1,0,X),X=["C",U,W.y-2*C,U+4*C,W.y,U,W.y+2*C],A.splice(j+2,0,X),a.attr("path",A)),j+=2,I+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&_>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=_)},m.inherits(s,o),m.inherits(l,o),m.inherits(c,o),m.inherits(u,o),m.inherits(h,o),h.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.textMargin;return{x:e,y:t}},h.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width-this.textMargin;return{x:e,y:t}},m.inherits(f,o),f.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var e=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(e.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var n=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(n.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var r=this;!function i(){for(var e,n=!1,a=0,o=r.chart.symbols.length;o>a;a++){e=r.chart.symbols[a];var s=Math.abs(e.getCenter().x-r.right_symbol.getCenter().x);if(e.getCenter().y>r.right_symbol.getCenter().y&&s<=r.right_symbol.width/2){n=!0;break}}n&&(r.right_symbol.setX(e.getX()+e.width+t),i())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},f.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=d,p}),define("extensions/umlDiagrams",["underscore","utils","logger","classes/Extension","text!html/umlDiagramsSettingsBlock.html","crel","Diagram","flow-chart"],function(t,e,n,r,i,a,o,s){var l=new r("umlDiagrams","UML Diagrams",!0);return l.settingsBlock=i,l.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")},l.onLoadSettings=function(){e.setInputValue("#textarea-umldiagram-flowchart-options",l.config.flowchartOptions)},l.onSaveSettings=function(t,n){t.flowchartOptions=e.getInputJSONValue("#textarea-umldiagram-flowchart-options",n)},l.onPagedownConfigure=function(e){var n=document.getElementById("preview-contents");e.hooks.chain("onPreviewRefresh",function(){t.each(n.querySelectorAll(".prettyprint > .language-sequence"),function(t){try{var e=o.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"sequence-diagram"});n.parentNode.replaceChild(r,n),e.drawSVG(r,{theme:"simple"})}catch(i){}}),t.each(n.querySelectorAll(".prettyprint > .language-flow"),function(t){try{var e=s.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"flow-chart"});n.parentNode.replaceChild(r,n),e.drawSVG(r,JSON.parse(l.config.flowchartOptions))}catch(i){}})})},l}),define("text!html/tocSettingsBlock.html",[],function(){return'<p>Generates a table of contents when a [TOC] marker is found.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-toc-marker">Marker\nLine truncated
},h.postMessage(JSON.stringify({language:u.language,code:u.code}))}else u.highlightedCode=e.highlight(u.code,u.grammar,u.language),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(r),e.hooks.run("after-highlight",u)}}},highlight:function(t,r,i){return n.stringify(e.tokenize(t,r),i)},tokenize:function(t,n){var r=e.Token,i=[t],a=n.rest;if(a){for(var o in a)n[o]=a[o];delete n.rest}t:for(var o in n)if(n.hasOwnProperty(o)&&n[o]){var s=n[o],l=s.inside,c=!!s.lookbehind,u=0;s=s.pattern||s;for(var h=0;h<i.length;h++){var f=i[h];if(i.length>t.length)break t;if(!(f instanceof r)){s.lastIndex=0;var d=s.exec(f);if(d){c&&(u=d[1].length);var p=d.index-1+u,d=d[0].slice(u),g=d.length,m=p+g,v=f.slice(0,p+1),y=f.slice(m+1),x=[h,1];v&&x.push(v);var b=new r(o,l?e.tokenize(d,l):d);x.push(b),y&&x.push(y),Array.prototype.splice.apply(i,x)}}}}return i},hooks:{all:{},add:function(t,n){var r=e.hooks.all;r[t]=r[t]||[],r[t].push(n)},run:function(t,n){var r=e.hooks.all[t];if(r&&r.length)for(var i,a=0;i=r[a++];)i(n)}}},n=e.Token=function(t,e){this.type=t,this.content=e};if(n.stringify=function(t,r,i){if("string"==typeof t)return t;if("[object Array]"==Object.prototype.toString.call(t))return t.map(function(e){return n.stringify(e,r,t)}).join("");var a={type:t.type,content:n.stringify(t.content,r,i),tag:"span",classes:["token",t.type],attributes:{},language:r,parent:i};"comment"==a.type&&(a.attributes.spellcheck="true"),e.hooks.run("wrap",a);var o="";for(var s in a.attributes)o+=s+'="'+(a.attributes[s]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+"</"+a.tag+">"},!self.document)return void self.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(e.tokenize(i,e.languages[r]))),self.close()},!1);var r=document.getElementsByTagName("script");r=r[r.length-1],r&&(e.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",e.highlightAll))}(),define("prism-core",function(t){return function(){var e;return e||t.Prism}}(this));var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,o=this.diff_commonPrefix(t,e),s=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=this.diff_commonSuffix(t,e);var l=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var c=this.diff_compute_(t,e,a,i);return s&&c.unshift([DIFF_EQUAL,s]),l&&c.push([DIFF_EQUAL,l]),this.diff_cleanupMerge(c),c},diff_match_patch.prototype.diff_compute_=function(t,e,n,r){var i;if(!t)return[[DIFF_INSERT,e]];if(!e)return[[DIFF_DELETE,t]];var a=t.length>e.length?t:e,o=t.length>e.length?e:t,s=a.indexOf(o);if(-1!=s)return i=[[DIFF_INSERT,a.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,a.substring(s+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o<a.length;){switch(a[o][0]){case DIFF_INSERT:l++,u+=a[o][1];break;case DIFF_DELETE:s++,c+=a[o][1];break;case DIFF_EQUAL:if(s>=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),o=a,s=2*a,l=new Array(s),c=new Array(s),u=0;s>u;u++)l[u]=-1,c[u]=-1;l[o+1]=0,c[o+1]=0;for(var h=r-i,f=h%2!=0,d=0,p=0,g=0,m=0,v=0;a>v&&!((new Date).getTime()>n);v++){for(var y=-v+d;v-p>=y;y+=2){var x,b=o+y;x=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1;for(var w=x-y;r>x&&i>w&&t.charAt(x)==e.charAt(w);)x++,w++;if(l[b]=x,x>r)p+=2;else if(w>i)d+=2;else if(f){var _=o+h-y;if(_>=0&&s>_&&-1!=c[_]){var S=r-c[_];if(x>=S)return this.diff_bisectSplit_(t,e,x,w,n)}}}for(var C=-v+g;v-m>=C;C+=2){var S,_=o+C;S=C==-v||C!=v&&c[_-1]<c[_+1]?c[_+1]:c[_-1]+1;for(var E=S-C;r>S&&i>E&&t.charAt(r-S-1)==e.charAt(i-E-1);)S++,E++;if(c[_]=S,S>r)m+=2;else if(E>i)g+=2;else if(!f){var b=o+h-C;if(b>=0&&s>b&&-1!=l[b]){var x=l[b],w=o+x-b;if(S=r-S,x>=S)return this.diff_bisectSplit_(t,e,x,w,n)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,e]]},diff_match_patch.prototype.diff_bisectSplit_=function(Line truncated
};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(i-1),s}return t[r][i-1]>t[r-1][i]?a(t,e,n,r,i-1,o):a(t,e,n,r-1,i,o)},o=function(t,e,n,o){o=o||{};var s=i(t,e,n||r,o),l=a(s,t,e,t.length,e.length,o);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};n.get=o},{}],12:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;n>i;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};o.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n;for(e in t.left)n=new r(t.left[e],t.right[e]),t.push(n,e);for(e in t.right)"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var u=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new a(t.delta[e]),t.push(n,e);t.exit()}};u.filterName="objects";var h=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;n>i;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};h.filterName="collectChildren",n.collectChildrenDiffFilter=o,n.objectsDiffFilter=s,n.patchFilter=l,n.collectChildrenPatchFilter=c,n.reverseFilter=u,n.collectChildrenReverseFilter=h},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5}],13:[function(t,e,n){var r=2,i=60,a=null,o=function(){if(!a){var e;if("undefined"!=typeof diff_match_patch)e=new diff_match_patch;else if("function"==typeof t){var n=t("../../external/diff_match_patch_uncompressed");e=new n.diff_match_patch}if(!e){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}a={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;i<r[1].length;i++)if(!r[1][i]){var a=new Error("text patch failed");a.textPatchFailed=!0}return r[0]}}}return a},s=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||i;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var n=o().diff;t.setResult([n(t.left,t.right),0,r]).exit()}};s.filterName="texts";var l=function(t){if(!t.nested&&t.delta[2]===r){var e=o().patch;t.setResult(e(t.left,t.delta[0])).exit()}};l.filterName="texts";var c=function(t){var e,n,r,i,a,o,s,l,c=null,u=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(r=t.split("\n"),e=0,n=r.length;n>e;e++){i=r[e];var h=i.slice(0,1);"@"===h?(c=u.exec(i),o=e,s=null,l=null,r[o]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===h?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(a=r[e],r[e]=r[e-1],r[e-1]=a)):"-"===h&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},u=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};u.filterName="texts",n.diffFilter=s,n.patchFilter=l,n.reverseFilter=u},{}],14:[function(t,e,n){var r="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},i=function(t){if(t.left===t.right)return void t.setResult(void 0).exit();if("undefined"==typeof t.left){if("function"==typeof t.right)throw new Error("functions are not supported");return void t.setResult([t.right]).exit()}if("undefined"==typeof t.right)return void t.setResult([t.left,0,0]).exit();if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");return t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType!==t.rightType?void t.setResult([t.left,t.right]).exit():"boolean"===t.leftType||"number"===t.leftType?void t.setResult([t.left,t.right]).exit():("object"===t.leftType&&(t.leftIsArray=r(t.left)),"object"===t.rightType&&(t.rightIsArray=r(t.right)),t.leftIsArray!==t.rightIsArray?void t.setResult([t.left,t.right]).exit():void 0)};i.filterName="trivial";var Line truncated
R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.max(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(void 0,t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0});var r=!1;R.on("keydown",function(t){if(17!==t.which&&91!==t.which&&18!==t.which&&16!==t.which){W.saveSelectionState(),h();var e=t.metaKey||t.ctrlKey;switch(t.which){case 9:e||(i("indent",{inverse:t.shiftKey}),t.preventDefault());break;case 13:i("newline"),t.preventDefault()}13!==t.which&&(r=!1)}}).on("compositionstart",function(){j++}).on("compositionend",function(){setTimeout(function(){j--},0)}).on("mouseup",t.bind(W.saveSelectionState,W,!0,!1)).on("paste",function(t){Y.currentMode="paste",t.preventDefault();var e,n=(t.originalEvent||t).clipboardData;n?e=n.getData("text/plain"):(n=window.clipboardData,e=n&&n.getData("Text")),e&&(d(W.selectionStart,W.selectionEnd,e),h())}).on("cut",function(){Y.currentMode="cut",h()}).on("focus",function(){W.hasFocus=!0}).on("blur",function(){W.hasFocus=!1});var i=function(t,e){var n=v(),r=Math.min(W.selectionStart,W.selectionEnd),i=Math.max(W.selectionStart,W.selectionEnd),a={selectionStart:r,selectionEnd:i,before:n.slice(0,r),after:n.slice(i),selection:n.slice(r,i)};o[t](a,e||{}),f(a.before+a.selection+a.after),W.setSelectionStartEnd(a.selectionStart,a.selectionEnd),W.updateSelectionRange()},a=/^ {0,3}>[ ]*|^[ \t]*(?:[*+\-]|(\d+)\.)[ \t]|^\s+/,o={indent:function(t,e){function n(t,e,n,r){return n=+n||0,r=r||"",t.slice(0,e)+r+t.slice(e+n)}var r=t.before.lastIndexOf("\n")+1;if(e.inverse)/\s/.test(t.before.charAt(r))&&(t.before=n(t.before,r,1),t.selectionStart--,t.selectionEnd--),t.selection=t.selection.replace(/^[ \t]/gm,"");else{var i=t.before.slice(r);if(!t.selection&&!i.match(a))return t.before+=" ",t.selectionStart++,void t.selectionEnd++;t.before=n(t.before,r,0," "),t.selection=t.selection.replace(/\r?\n(?=[\s\S])/g,"\n "),t.selectionStart++,t.selectionEnd++}t.selectionEnd=t.selectionStart+t.selection.length},newline:function(t){var e=t.before.lastIndexOf("\n")+1;if(r)return t.before=t.before.substring(0,e),t.selection="",t.selectionStart=e,t.selectionEnd=e,void(r=!1);r=!1;var n=t.before.slice(e),i=n.match(a),o=(i||[""])[0];if(i&&i[1]){var s=parseInt(i[1],10);o=o.replace(/\d+/,s+1)}o.length&&(r=!0),Y.currentMode="newlines",t.before+="\n"+o,t.selection="",t.selectionStart+=o.length+1,t.selectionEnd=t.selectionStart}};V!==!1&&F.setContent(V)};var Q,K=[],Z=[],te=[],ee=function(){var t={"&":"&amp;","<":"&lt;"," ":" "};return function(e){return e.replace(/[&<\u00a0]/g,function(e){return t[e]})}}();return r.onEditorCreated(F),F}),function(){function t(){}function e(t){this.buttonBar=h.getElementById("wmd-button-bar"+t),this.preview=h.getElementById("wmd-preview"+t),this.input=h.getElementById("wmd-input"+t)}function n(t,e){var n,i,a,o=this,s=[],c=0,u="none",h=function(t,e){u!=t&&(u=t,e||d()),g.isIE&&"moving"==u?a=null:i=setTimeout(f,1)},f=function(t){a=new r(e,t),i=void 0};this.setCommandMode=function(){u="command",d(),i=setTimeout(f,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return s[c+1]?!0:!1},this.undo=function(){o.canUndo()&&(n?(n.restore(),n=null):(s[c]=new r(e),s[--c].restore(),t&&t())),u="none",e.input.focus(),f()},this.redo=function(){o.canRedo()&&(s[++c].restore(),t&&t()),u="none",e.input.focus(),f()};var d=function(){var i=a||new r(e);return i?"moving"==u?void(n||(n=i)):(n&&(s[c-1].text!=n.text&&(s[c++]=n),n=null),s[c++]=i,s[c+1]=null,void(t&&t())):!1},p=function(t){if(!t.ctrlKey&&!t.metaKey){var e=t.keyCode;e>=33&&40>=e||e>=63232&&63235>=e?h("moving"):8==e||46==e||127==e?h("deleting"):13==e?h("newlines"):27==e?h("escape"):(16>e||e>20)&&91!=e&&h("typing")}},m=function(){l.addEvent(e.input,"keypress",function(t){!t.ctrlKey&&!t.metaKey||t.altKey||89!=t.keyCode&&90!=t.keyCode||t.preventDefault()});var t=function(){(g.isIE||a&&a.text!=e.input.value)&&void 0==i&&(u="paste",d(),f())};l.addEvent(e.input,"keydown",p),l.addEvent(e.input,"mousedown",function(){h("moving")}),e.input.onpaste=t,e.input.ondrop=t},v=function(){m(),f(!0)};this.reinit=function(t,e,r,o){s=[],c=0,u="none",n=void 0,i=void 0,f(),a.text=t,a.start=e,a.end=r,a.scrollTop=o,a.setInputAreaSelection(),d()},this.setMode=h,v()}function r(e){var n=this,r=e.input;this.init=function(){l.isVisible(r)&&(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value))},this.setInputAreaSelection=function(){l.isVisible(r)&&(r.focus(),r.selectionStart=n.start,r.selectionEnd=n.end)},this.setInputAreaSelLine truncated
for(var n,r,i,a=0,o=t.attributes.length;o>a;++a)if(n=t.attributes[a],i=n.name,"class"!=i){if(r=e.attributes.getNamedItem(i),n.specified!=r.specified)return!1;if(n.specified&&n.nodeValue!==r.nodeValue)return!1}return!0}function f(t,e){for(var n,r=0,i=t.attributes.length;i>r;++r)if(n=t.attributes[r].name,(!e||!k.arrayContains(e,n))&&t.attributes[r].specified&&"class"!=n)return!0;return!1}function d(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function p(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||N(t)&&!N(t.parentNode))}function g(t){return(N(t)||1!=t.nodeType&&N(t.parentNode))&&!p(t)}function m(t){return t&&1==t.nodeType&&!R.test(E(t,"display"))}function v(t){if(0==t.data.length)return!0;if(A.test(t.data))return!1;var e=E(t.parentNode,"whiteSpace");switch(e){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return m(t.previousSibling)||m(t.nextSibling)}function y(t,e){return k.isCharacterDataNode(t)?0==e?!!t.previousSibling:e==t.length?!!t.nextSibling:!0:e>0&&e<t.childNodes.length}function x(t,n,r,i){var a,o=0==r;if(k.isAncestorOf(n,t))return t;if(k.isCharacterDataNode(n))if(0==r)r=k.getNodeIndex(n),n=n.parentNode;else{if(r!=n.length)throw e.createError("splitNodeAt should not be called with offset in the middle of a data node ("+r+" in "+n.data);r=k.getNodeIndex(n)+1,n=n.parentNode}if(y(n,r)){if(!a){a=n.cloneNode(!1),a.id&&a.removeAttribute("id");for(var s;s=n.childNodes[r];)a.appendChild(s);k.insertAfter(a,n)}return n==t?a:x(t,a.parentNode,k.getNodeIndex(a),i)}if(t!=n){a=n.parentNode;var l=k.getNodeIndex(n);return o||l++,x(t,a,l,i)}return t}function b(t,e){return t.tagName==e.tagName&&s(t,e)&&h(t,e)}function w(t){var e=t?"nextSibling":"previousSibling";return function(n,r){var i=n.parentNode,a=n[e];if(a){if(a&&3==a.nodeType)return a}else if(r&&(a=i[e],a&&1==a.nodeType&&b(i,a)))return a[t?"firstChild":"lastChild"];return null}}function _(t){this.isElementMerge=1==t.nodeType,this.firstTextNode=this.isElementMerge?t.lastChild:t,this.textNodes=[this.firstTextNode]}function S(t,e,r){this.cssClass=t;var i,o,s,l,c=null;if("object"==typeof e&&null!==e){for(r=e.tagNames,c=e.elementProperties,o=0;l=O[o++];)e.hasOwnProperty(l)&&(this[l]=e[l]);i=e.normalize}else i=e;this.normalize="undefined"==typeof i?!0:i,this.attrExceptions=[];var u=document.createElement(this.elementTagName);this.elementProperties={};for(var h in c)c.hasOwnProperty(h)&&(D.hasOwnProperty(h)&&(h=D[h]),u[h]=c[h],this.elementProperties[h]=u[h],this.attrExceptions.push(h));this.elementSortedClassName=this.elementProperties.hasOwnProperty("className")?a(this.elementProperties.className+" "+t):t,this.applyToAnyTagName=!1;var f=typeof r;if("string"==f)"*"==r?this.applyToAnyTagName=!0:this.tagNames=n(r.toLowerCase()).split(/\s*,\s*/);else if("object"==f&&"number"==typeof r.length)for(this.tagNames=[],o=0,s=r.length;s>o;++o)"*"==r[o]?this.applyToAnyTagName=!0:this.tagNames.push(r[o].toLowerCase());else this.tagNames=[this.elementTagName]}function C(t,e,n){return new S(t,e,n)}t.requireModules(["WrappedSelection","WrappedRange"]);var E,k=t.dom,T="span",I=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){e.className&&(e.className=e.className.replace(new RegExp("(?:^|\\s)"+n+"(?:\\s|$)"),t))}}();"undefined"!=typeof window.getComputedStyle?E=function(t,e){return k.getWindow(t).getComputedStyle(t,null)[e]}:"undefined"!=typeof document.documentElement.currentStyle?E=function(t,e){return t.currentStyle[e]}:e.fail("No means of obtaining computed style properties found");var N;!function(){var t=document.createElement("div");N="boolean"==typeof t.isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return t&&1==t.nodeType&&"false"!=t.contentEditable?"true"==t.contentEditable||N(t.parentNode):!1}}();var R=/^inline(-block|-table)?$/i,A=/[^\r\n\t\f \u200B]/,M=w(!1),L=w(!0);_.prototype={doMerge:function(){for(var t,e,n,r=[],i=0,a=this.textNodes.length;a>i;++i)t=this.textNodes[i],e=t.parentNode,r[i]=t.data,i&&(e.removeChild(t),e.hasChildNodes()||e.parentNode.removeChild(e));return this.firstTextNode.data=n=r.join(""),n},getLength:function(){for(var t=this.textNodes.length,e=0;t--;)e+=this.textNodes[t].length;return e},toString:function(){for(var t=[],e=0,n=this.textNodes.length;n>e;++e)t[e]="'"+this.textNodes[e].data+"'";return"[Merge("+t.join(",")+")]"}};var O=["elementTagName","ignoreWhiteSpace","applyToEditableOnly"],D={"class":"className"};S.prototype={elementTagName:T,elementProperties:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,hasClass:function(t){return 1==t.nodeType&&k.arrayContains(this.tagNames,t.tagName.toLowerCase())&&r(t,this.cssClass)},getSelfOrAncestorWithClass:function(t){for(;t;){if(this.hasClass(t,this.cssClass))return t;t=t.parentNode}return null},isModifiable:function(t){return!this.applyToEditableOnly||g(t)},isIgnorableWhiteSpaceNode:function(t){return this.ignoreWhiteSpaLine truncated
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&x(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),b.initialized=!0,b.supported=!1}function o(t){var e="Rangy warning: "+t;b.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!b.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&x(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),b.initialized=!0,b.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](b)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=S.length;n>e;++e)S[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),x=r(n),b={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:x,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};b.fail=a,b.warn=o,{}.hasOwnProperty?b.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];b.init=s,b.addInitListener=function(t){b.initialized?t(b):w.push(t)};var S=[];b.addCreateMissingNativeApiListener=function(t){S.push(t)},b.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){b.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},b.createModule=function(t,e){var n=new c(t);b.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},b.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=b.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var C=!1,E=function(){C||(C=!0,b.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),b)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}function i(t){for(var e=0;t=t.previousSibling;)e++;return e}function a(t){var e;return c(t)?t.length:(e=t.childNodes)?e.length:0}function o(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(N(r,n))return n;return null}function s(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function l(t,e,n){for(var r,i=n?t:t.parentNode;i;){if(r=i.parentNode,r===e)return i;i=r}return null}function c(t){var e=t.nodeType;return 3==e||4==e||8==e}function u(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function h(t,e){var n=t.cloneNode(!1);return n.deleteData(0,e),t.deleteData(e,t.length-e),u(n,t),n}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=E)return t.ownerDocument;if(typeof t.document!=E)return t.document;if(t.parentNode)return f(t.parentNode);throw new Error("getDocument: no document fouLine truncated
if(e._ranges.length=0,"None"==e.docSelection.type)o(e);else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=C.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,x,b="boolean",w="_rangySelection",_=t.dom,S=t.util,C=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=S.areHostObjects(M,["anchorNode","focusNode"]&&S.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=S.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;S.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&S.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),S.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,x=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;S.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelection=i,e.refresh(t)):(e=new p(n,i,t),t[w]=e),e},t.getIframeSelection=function(e){return t.getSelection(_.getIframeWindow(e))};var q=p.prototype;if(!A&&D&&S.areHostMethods(M,["removeAllRanges","addRange"])){q.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),o(this)};var G=function(e,n){var r=C.getRangeDocument(n),i=t.createRange(r);i.collapseToPoint(n.endContainer,n.endOffset),e.nativeSelection.addRange(s(i)),e.nativeSelection.extend(n.startContainer,n.startOffset),e.refresh()};q.addRange=P?function(e,n){if(H&&R&&this.docSelection.type==I)d(this,e);else if(n&&F)G(this,e);else{var r;if(B?r=this.rangeCount:(this.removeAllRanges(),r=0),this.nativeSelection.addRange(s(e)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=U(this.nativeSelection,this.rangeCount-1);a&&!CLine truncated
}function r(t,r){if(!m.isRegExp(t))throw new TypeError("Type RegExp expected");var i=b.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=b.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return b.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=b.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(b.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r<e.length;++r)if(!A[e.charAt(r)])throw new SyntaxError("Unknown regex flag "+e.charAt(r));return{pattern:t,flags:e}}function u(t){return t=t||{},s(t,"String")&&(t=m.forEach(t,/[^\s,]+/,function(t){this[t]=!0},{})),t}function h(t){if(!/^[\w$]$/.test(t))throw new Error("Flag must be a single character A-Za-z0-9_$");A[t]=!0}function f(t,e,n,r,i){for(var a,o,s=C.length,l=null;s--;)if(o=C[s],(o.scope===r||"all"===o.scope)&&(!o.flag||e.indexOf(o.flag)>-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),x.astral=t}function p(t){RegExp.prototype.exec=(t?w:b).exec,RegExp.prototype.test=(t?w:b).test,String.prototype.match=(t?w:b).match,String.prototype.replace=(t?w:b).replace,String.prototype.split=(t?w:b).split,x.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",x={astral:!1,natives:!1},b={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},S={},C=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=b.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!S[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d<n.length;){do a=f(n,i,d,u,l),a&&a.reparse&&(n=n.slice(0,d)+a.output+n.slice(d+a.matchLength));while(a&&a.reparse);a?(h+=a.output,d+=a.matchLength||1):(o=m.exec(n,T[u],d,"sticky")[0],h+=o,d+=o.length,"["===o&&u===E?u=k:"]"===o&&u===k&&(u=E))}S[s]={pattern:b.replace.call(h,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:b.replace.call(i,/[^gimy]+/g,""),captures:l.hasNamedCapture?l.captureNames:null}}return s=S[s],e(new RegExp(s.pattern,s.flags),s.captures,!0)},m.prototype=new RegExp,m.version="3.0.0-pre",m.addToken=function(t,e,n){n=n||{};var i,a=n.optionalFlags;if(n.flag&&h(n.flag),a)for(a=b.split.call(a,""),i=0;i<a.length;++i)h(a[i]);C.push({regex:r(t,{add:"g"+(R?"y":"")}),handler:e,scope:n.scope||E,flag:n.flag,reparse:n.reparse}),m.cache.flush("patterns")},m.cache=function(t,e){var n=t+"***"+(e||"");return _[n]||(_[n]=m(t,e))},m.cache.flush=function(t){"patterns"===t?S={}:_={}},m.escape=function(t){return b.replace.call(g(t),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},m.exec=function(t,e,n,a){var o,s,l="g";return R&&(a||e.sticky&&a!==!1)&&(l+="y"),e[y]=e[y]||i(),s=e[y][l]||(e[y][l]=r(e,{add:l,remove:a===!1?"y":""})),s.lastIndex=n=n||0,o=w.exec.call(s,t),a&&o&&o.index!==n&&(o=null),e.global&&(e.lastIndex=o?s.lastIndex:0),o},m.forEach=function(t,e,n,r){for(var i,a=0,o=-1;i=m.exec(t,e,a);)n.call(r,i,++o,t,e),a=i.index+(i[0].length||1);return r},m.globalize=function(t){return r(t,{add:"g",addProto:!0})},m.install=function(t){t=u(t),!x.astral&&t.astral&&d(!0),!x.natives&&t.natives&&p(!0)},m.isInstalled=function(t){return!!x[t]},m.isRegExp=function(t){return"[object RegExp]"===M.call(t)},m.match=function(t,e,n){var a,o,s=e.global&&"one"!==n||"all"===n,l=(s?"g":"")+(e.sticky?"y":"");return e[y]=e[y]||i(),o=e[y][l||"noGY"]||(e[y][l||"noGY"]=r(e,{add:l,remove:"one"===n?"g":""})),a=b.match.call(g(t),o),e.global&&(e.lastIndex="one"===n&&a?a.index+a[0].length:0),s?a||[]:a&&a[0]},m.matchChain=function(t,e){return function n(t,r){var i,a=e[r].regex?e[r]:{regex:e[r]},o=[],s=function(t){if(a.backref){if(!(t.hasOwnProperty(a.backref)||+a.backref<t.length))throw new ReferenceError("Backreference to undefined Line truncated
name:"Nd",alias:"Decimal_Number",bmp:"0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9",astral:"�[�-��-��-��-�]|�[�-�]|�[�-�]|�[�-�]"},{name:"Nl",alias:"Letter_Number",bmp:"ᛮ-ᛰⅠ-ↂↅ-ↈ〇〡-〩〸-〺ꛦ-ꛯ",astral:"�[�-����-�]|�[�-�]"},{name:"No",alias:"Other_Number",bmp:"²³¹¼-¾৴-৹୲-୷௰-௲౸-౾൰-൵༪-༳፩-፼៰-៹᧚⁰⁴-⁹₀-₉⅐-⅟↉①-⒛⓪-⓿❶-➓⳽㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꠰-꠵",astral:"�[�-��-��-����-��-�]|�[�-�]|�[�-�]|�[�-��-���-�]|�[�-�]|�[�-�]"},{name:"P",alias:"Punctuation",bmp:"!-#%-\\x2A,-/:;\\x3F@\\x5B-\\x5D_\\x7B}¡§«¶·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔༺-༽྅࿐-࿔࿙࿚၊-၏჻፠-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰-⸻、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・",astral:"�[�-�]|�[����-���-�]|�[�-���]|�[�-����-��-��-�]"},{name:"Pc",alias:"Connector_Punctuation",bmp:"_‿⁀⁔︳︴﹍-﹏_"},{name:"Pd",alias:"Dash_Punctuation",bmp:"\\x2D֊־᐀᠆‐-―⸗⸚⸺⸻〜〰゠︱︲﹘﹣-"},{name:"Pe",alias:"Close_Punctuation",bmp:"\\x29\\x5D}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶︸︺︼︾﹀﹂﹄﹈﹚﹜﹞)]}⦆」"},{name:"Pf",alias:"Final_Punctuation",bmp:"»’”›⸃⸅⸊⸍⸝⸡"},{name:"Pi",alias:"Initial_Punctuation",bmp:"«‘‛“‟‹⸂⸄⸉⸌⸜⸠"},{name:"Po",alias:"Other_Punctuation",bmp:"!-#%-'\\x2A,\\x2E/:;\\x3F@\\x5C¡§¶·¿;·՚-՟։׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰૰෴๏๚๛༄-༒༔྅࿐-࿔࿙࿚၊-၏჻፠-፨᙭᙮᛫-᛭᜵᜶។-៖៘-៚᠀-᠅᠇-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳀-᳇᳓‖‗†-‧‰-‸※-‾⁁-⁃⁇-⁑⁓⁕-⁞⳹-⳼⳾⳿⵰⸀⸁⸆-⸈⸋⸎-⸖⸘⸙⸛⸞⸟⸪-⸮⸰-⸹、-〃〽・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꫰꫱꯫︐-︖︙︰﹅﹆﹉-﹌﹐-﹒﹔-﹗﹟-﹡﹨﹪﹫!-#%-'*,./:;?@\。、・",astral:"�[�-�]|�[����-���-�]|�[�-���]|�[�-����-��-��-�]"},{name:"Ps",alias:"Open_Punctuation",bmp:"\\x28\\x5B\\x7B༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵︷︹︻︽︿﹁﹃﹇﹙﹛﹝([{⦅「"},{name:"S",alias:"Symbol",bmp:"\\x24\\x2B<->\\x5E`\\x7C~¢-¦¨©¬®-±´¸×÷˂-˅˒-˟˥-˫˭˯-˿͵΄΅϶҂֏؆-؈؋؎؏۞۩۽۾߶৲৳৺৻૱୰௳-௺౿൹฿༁-༃༓༕-༗༚-༟༴༶༸྾-࿅࿇-࿌࿎࿏࿕-࿘႞႟᎐-᎙៛᥀᧞-᧿᭡-᭪᭴-᭼᾽᾿-῁῍-῏῝-῟῭-`´῾⁄⁒⁺-⁼₊-₌₠-₺℀℁℃-℆℈℉℔№-℘℞-℣℥℧℩℮℺℻⅀-⅄⅊-⅍⅏←-⌨⌫-⏳␀-␦⑀-⑊⒜-ⓩ─-⛿✁-❧➔-⟄⟇-⟥⟰-⦂⦙-⧗⧜-⧻⧾-⭌⭐-⭙⳥-⳪⺀-⺙⺛-⻳⼀-⿕⿰-⿻〄〒〓〠〶〷〾〿゛゜㆐㆑㆖-㆟㇀-㇣㈀-㈞㈪-㉇㉐㉠-㉿㊊-㊰㋀-㋾㌀-㏿䷀-䷿꒐-꓆꜀-꜖꜠꜡꞉꞊꠨-꠫꠶-꠹꩷-꩹﬩﮲-﯁﷼﷽﹢﹤-﹦﹩$+<->^`|~¢-₩│-○�",astral:"�[�-���-��-��-��-��-��-��-��-��-�]|�[����������]|�[�-��-��-��-��-��-��-��-��-��-��-��-����-��-��-��-��-��-��-�]|�[�-��-��-��-����-��-��-���-�]|�[�-��-��-��-�]|�[��]"},{name:"Sc",alias:"Currency_Symbol",bmp:"\\x24¢-¥֏؋৲৳৻૱௹฿៛₠-₺꠸﷼﹩$¢£¥₩"},{name:"Sk",alias:"Modifier_Symbol",bmp:"\\x5E`¨¯´¸˂-˅˒-˟˥-˫˭˯-˿͵΄΅᾽᾿-῁῍-῏῝-῟῭-`´῾゛゜꜀-꜖꜠꜡꞉꞊﮲-﯁^` ̄"},{name:"Sm",alias:"Math_Symbol",bmp:"\\x2B<->\\x7C~¬±×÷϶؆-؈⁄⁒⁺-⁼₊-₌℘⅀-⅄⅋←-↔↚↛↠↣↦↮⇎⇏⇒⇔⇴-⋿⌈-⌋⌠⌡⍼⎛-⎳⏜-⏡▷◁◸-◿♯⟀-⟄⟇-⟥⟰-⟿⤀-⦂⦙-⧗⧜-⧻⧾-⫿⬰-⭄⭇-⭌﬩﹢﹤-﹦+<->|~¬←-↓",astral:"�[��]|�[��Line truncated
return utils.crc32=function(t){var e=0,n=-1;return t.split("").forEach(function(t){e=255&(n^t.charCodeAt(0)),n=n>>>8^mHash[e]}),n=-1^n,0>n&&(n=4294967295+n+1),n.toString(16)},window.perfTest=function(t){for(var e=Date.now(),n=0;1e4>n;n++)t();console.log("Run 10,000 times in "+(Date.now()-e)+"ms")},utils}),define("constants",[],function(){var t={};return t.VERSION="4.5.0",t.MAIN_URL="https://stackedit.io/",t.GOOGLE_ANALYTICS_ACCOUNT_ID="UA-39556145-1",t.GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",t.GOOGLE_DRIVE_APP_ID="241271498917",t.DROPBOX_APP_KEY="lq6mwopab8wskas",t.DROPBOX_APP_SECRET="851fgnucpezy84t",t.DROPBOX_RESTRICTED_APP_KEY="sw0hlixhr8q1xk0",t.DROPBOX_RESTRICTED_APP_SECRET="1r808p2xygs6lbg",t.BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",t.DEFAULT_FILE_TITLE="Title",t.DEFAULT_FOLDER_NAME="New folder",t.GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",t.EDITOR_DEFAULT_PADDING=35,t.CHECK_ONLINE_PERIOD=12e4,t.AJAX_TIMEOUT=3e4,t.ASYNC_TASK_DEFAULT_TIMEOUT=6e4,t.ASYNC_TASK_LONG_TIMEOUT=18e4,t.USER_IDLE_THRESHOLD=3e5,t.IMPORT_FILE_MAX_CONTENT_SIZE=1e5,t.IMPORT_IMG_MAX_CONTENT_SIZE=1e7,t.COUCHDB_PAGE_SIZE=25,t.TEMPORARY_FILE_INDEX="file.tempIndex",t.WELCOME_DOCUMENT_TITLE="Hello!",t.DOWNLOAD_IMPORT_URL="/downloadImport",t.PICASA_IMPORT_IMG_URL="/picasaImportImg",t.SSH_PUBLISH_URL="/sshPublish",t.PDF_EXPORT_URL="/pdfExport",t.COUCHDB_URL="https://stackedit.couchappy.com/documents",t.BASE_URL="http://localhost/",t.GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="e47fef6055344579799d",t.GATEKEEPER_URL="https://stackedit-gatekeeper-localhost.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy-local.herokuapp.com/",t.WORDPRESS_CLIENT_ID="23361",t.WORDPRESS_PROXY_URL="https://stackedit-io-wordpress-proxy.herokuapp.com/",0===location.hostname.indexOf("stackedit.io")?(t.BASE_URL=t.MAIN_URL,t.GOOGLE_CLIENT_ID="241271498917-t4t7d07qis7oc0ahaskbif3ft6tk63cd.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="710fc67886ab1ae8fee6",t.GATEKEEPER_URL="https://stackedit-io-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-io-tumblr-proxy.herokuapp.com/"):0===location.hostname.indexOf("benweet.github.io")?(t.BASE_URL="http://benweet.github.io/stackedit/",t.GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="fa0d09514da8377ee32e",t.GATEKEEPER_URL="https://stackedit-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy.herokuapp.com/",t.WORDPRESS_CLIENT_ID="3185",t.WORDPRESS_PROXY_URL="https://stackedit-wordpress-proxy.herokuapp.com/"):0===location.hostname.indexOf("stackedit-beta.herokuapp.com")?(t.BASE_URL="https://stackedit-beta.herokuapp.com/",t.GOOGLE_CLIENT_ID="241271498917-9bbplknkt0ljv5gaudhoiogp13hd18be.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="e9034ae191c3a8a1c5ed",t.GATEKEEPER_URL="https://stackedit-beta-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-beta-tumblr-proxy.herokuapp.com/",t.WORDPRESS_CLIENT_ID="34786",t.WORDPRESS_PROXY_URL="https://stackedit-beta-wordpress-proxy.herokuapp.com/"):0===location.hostname.indexOf("benweet.insomnia247.nl")&&(t.BASE_URL="http://benweet.insomnia247.nl/stackedit/",t.GOOGLE_CLIENT_ID="241271498917-52hae7a08hv7ltenv7km8h7lghno9sk3.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="d2943d6074b2d9c4a830",t.GATEKEEPER_URL="https://stackedit-gatekeeper-insomnia.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy-beta.herokuapp.com/"),t.THEME_LIST={blue:"Blue","default":"Default",gray:"Gray",night:"Night",school:"School","solarized-light":"Solarized Light","solarized-dark":"Solarized Dark"},t}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1.0">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="'+e.MAIN_URL+'res-min/themes/base.css" />','<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>",'<body><div class="container"><%= documentHTML %></div></body>',"</html>"].join("\n"),pdfTemplate:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />','<script type="text/x-mathjax-config">','MathJax.Hub.Config({ messageStyle: "none" });',"</script>",'<script type="text/javascript" src="http://localhost/res/b Line truncated
dump:function(t,e,n){null==e&&(e=0),null==n&&(n=0);var r,a="",o=n?this.strRepeat(" ",n):"";if(this.numSpacesForIndentation||(this.numSpacesForIndentation=2),0>=e||!this.isObject(t)||this.isEmpty(t))r=new i,a+=o+r.dump(t);else{var s,l=!this.arrayEquals(this.getKeys(t),this.range(0,t.length-1));for(var c in t)t.hasOwnProperty(c)&&(s=0>=e-1||!this.isObject(t[c])||this.isEmpty(t[c]),l&&(r=new i),a+=o+""+(l?r.dump(c)+":":"-")+(s?" ":"\n")+this.dump(t[c],e-1,s?0:n+this.numSpacesForIndentation)+(s?"\n":""))}return a},strRepeat:function(t,e){var n,r="";for(n=0;e>n;n++)r+=t;return r},isObject:function(t){return this.isDefined(t)&&"object"==typeof t},isEmpty:function(t){var e=void 0==t||null==t||""==t||0==t||"0"==t||0==t;if(!(e||"object"!=typeof t||t instanceof Array)){var n=0;for(var r in t)t.hasOwnProperty(r)&&n++;e=!n}return e},isDefined:function(t){return void 0!=t&&null!=t},getKeys:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},range:function(t,e){if(t>e)return[];for(var n=[],r=t;e>=r;r++)n.push(r);return n},arrayEquals:function(t,e){if(t.length!=e.length)return!1;for(var n=t.length,r=0;n>r;r++)if(t[r]!=e[r])return!1;return!0}}}(),define("yaml-js",function(t){return function(){var e;return e||t.YAML}}(this)),define("extensions/yamlFrontMatterParser",["underscore","classes/Extension","yaml-js"],function(t,e,n){function r(e,r){if(e===o){var i=s.exec(r),a=i[1],l=i[2];if(l){if(!o.frontMatter||o.frontMatter._frontMatter!=a){o.frontMatter=void 0;try{o.frontMatter=n.parse(l),t.isObject(o.frontMatter)||(o.frontMatter=void 0),o.frontMatter._yaml=l,o.frontMatter._frontMatter=a}catch(c){}}}else o.frontMatter=void 0}}var i,a=new e("yamlFrontMatterParser","YAML front matter");a.onEventMgrCreated=function(t){i=t};var o;a.onFileSelected=function(t){o=t};var s=/^(\s*-{3}\s*\n([\w\W]+?)\n\s*-{3}\s*?\n)?([\w\W]*)$/;return a.onFileOpen=r,a.onContentChanged=r,a}),define("text",["module"],function(t){var e,n,r,i,a,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],s=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,u=c&&location.protocol&&location.protocol.replace(/\:/,""),h=c&&location.hostname,f=c&&(location.port||void 0),d={},p=t.config&&t.config()||{};return e={version:"2.0.13",strip:function(t){if(t){t=t.replace(s,"");var e=t.match(l);e&&(t=e[1])}else t="";return t},jsEscape:function(t){return t.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var t,e,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(e=0;3>e;e+=1){n=o[e];try{t=new ActiveXObject(n)}catch(r){}if(t){o=[n];break}}return t},parseName:function(t){var e,n,r,i=!1,a=t.lastIndexOf("."),o=0===t.indexOf("./")||0===t.indexOf("../");return-1!==a&&(!o||a>1)?(e=t.substring(0,a),n=t.substring(a+1)):e=t,r=n||e,a=r.indexOf("!"),-1!==a&&(i="strip"===r.substring(a+1),r=r.substring(0,a),n?n=r:e=r),{moduleName:e,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(t,n,r,i){var a,o,s,l=e.xdRegExp.exec(t);return l?(a=l[2],o=l[3],o=o.split(":"),s=o[1],o=o[0],!(a&&a!==n||o&&o.toLowerCase()!==r.toLowerCase()||(s||o)&&s!==i)):!0},finishLoad:function(t,n,r,i){r=n?e.strip(r):r,p.isBuild&&(d[t]=r),i(r)},load:function(t,n,r,i){if(i&&i.isBuild&&!i.inlineText)return void r();p.isBuild=i&&i.isBuild;var a=e.parseName(t),o=a.moduleName+(a.ext?"."+a.ext:""),s=n.toUrl(o),l=p.useXhr||e.useXhr;return 0===s.indexOf("empty:")?void r():void(!c||l(s,u,h,f)?e.get(s,function(n){e.finishLoad(t,a.strip,n,r)},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");"\ufeff"===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"Line truncated
return t=t.replace(/~E(\d+)E/g,function(t,e){var n=parseInt(e);return String.fromCharCode(n)})}function I(t){return t=t.replace(/^(\t|[ ]{1,4})/gm,"~0"),t=t.replace(/~0/g,"")}function N(t){if(!/\t/.test(t))return t;var e,n=[" "," "," "," "],r=0;return t.replace(/[\n\t]/g,function(t,i){return"\n"===t?(r=i+1,t):(e=(i-r)%4,r=i+1,n[e])})}function R(t){return t?(t.length,t.replace(z,function(t){return"~D"==t?"%24":":"==t?":":"%"+t.charCodeAt(0).toString(16)})):""}function A(t,e,n){var r="(["+e.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return t=t.replace(i,M)}function M(t,e){var n=e.charCodeAt(0);return"~E"+n+"E"}var L={};this.setOptions=function(t){L=t};var O=this.hooks=new n;O.addNoop("plainLinkText"),O.addNoop("preConversion"),O.addNoop("postNormalization"),O.addNoop("preBlockGamut"),O.addNoop("postBlockGamut"),O.addNoop("preSpanGamut"),O.addNoop("postSpanGamut"),O.addNoop("postConversion");var D,F,P,B;this.makeHtml=function(n){if(D)throw new Error("Recursive call to converter.makeHtml");return D=new r,F=new r,P=[],B=0,n=O.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=N(n),n=n.replace(/^[ \t]+$/gm,""),n=O.postNormalization(n),n=e(n),n=t(n),n=a(n),n=T(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=O.postConversion(n),P=F=D=null,n};var j=function(t){return a(t)},$={ol:"\\d+[.]",ul:"[*+-]"},H="[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",U="[-A-Z0-9+&@#/%=~_|[\\])]",q=new RegExp('(="|<)?\\b(https?|ftp)(://'+H+"*"+U+")(?=$|\\W)","gi"),G=new RegExp(U,"i"),z=/(?:["'*()[\]:]|~D)/g}}(),define("libs/Markdown.Converter",function(){}),function(){function t(t){return t.replace(/^\s+|\s+$/g,"")}function e(t){return t.replace(/\s+$/g,"")}function n(t){return t.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function r(t,e){return-1!=t.indexOf(e)}function i(t,e){return t.replace(/<[^>]*>?/gi,function(t){return t.match(e)?t:""})}function a(t,e){for(var n={},r=0;r<t.length;r++)n[t[r]]=t[r];for(r=0;r<e.length;r++)n[e[r]]=e[r];var i=[];for(var a in n)n.hasOwnProperty(a)&&i.push(n[a]);return i}function o(t){return""!=t.charAt(0)&&(t=""+t),""!=t.charAt(t.length-1)&&(t+=""),t}function s(t){return""==t.charAt(0)&&(t=t.substr(1)),""==t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),t}function l(t,e){return i(c(t,e),g)}function c(t,e){var n=e.blockGamutHookCallback(t);return n=f(n),n=n.replace(/~D/g,"$$").replace(/~T/g,"~"),n=e.previousPostConversion(n)}function u(t){return t.replace(/\\\|/g,"~I").replace(/\\:/g,"~i")}function h(t){return t.replace(/~I/g,"|").replace(/~i/g,":")}function f(t){return t=t.replace(/~E(\d+)E/g,function(t,e){var n=parseInt(e);return String.fromCharCode(n)})}function d(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function p(t,e){var n=e;return n=n.replace(/&\#8220;/g,'"'),n=n.replace(/&\#8221;/g,'"'),n=n.replace(/&\#8216;/g,"'"),n=n.replace(/&\#8217;/g,"'"),n=n.replace(/&\#8212;/g,"---"),n=n.replace(/&\#8211;/g,"--"),n=n.replace(/&\#8230;/g,"...")}var g=new RegExp(["^(<\\/?(a|abbr|acronym|applet|area|b|basefont|","bdo|big|button|cite|code|del|dfn|em|figcaption|","font|i|iframe|img|input|ins|kbd|label|map|","mark|meter|object|param|progress|q|ruby|rp|rt|s|","samp|script|select|small|span|strike|strong|","sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e]==t)return e;return-1}),Markdown.Extra=function(){this.converter=null,this.hashBlocks=[],this.footnotes={},this.usedFootnotes=[],this.attributeBlocks=!1,this.googleCodePrettify=!1,this.highlightJs=!1,this.tableClass="",this.tabWidth=4},Markdown.Extra.init=function(t,e){var n=new Markdown.Extra,i=[],a=[],o=[],s=["unHashExtraBlocks"];return e=e||{},e.extensions=e.extensions||["all"],r(e.extensions,"all")&&(e.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]),a.push("wrapHeaders"),r(e.extensions,"attr_list")&&(i.push("hashFcbAttributeBlocks"),a.push("hashHeaderAttributeBlocks"),s.push("applyAttributeBlocks"),n.attributeBlocks=!0),r(e.extensions,"fenced_code_gfm")&&(a.push("fencedCodeBlocks"),i.push("fencedCodeBlocks")),r(e.extensions,"tables")&&a.push("tables"),r(e.extensions,"def_list")&&a.push("definitionLists"),r(e.extensions,"footnotes")&&(i.push("stripFootnoteDefinitions"),a.push("doFootnotes"),s.push("printFootnotes")),r(e.extensions,"smartypants")&&s.push("runSmartyPants"),r(e.extensions,"strikethrough")&&o.push("strikethrough"),r(e.extensions,"newlines")&&o.push("newlines"),t.hooks.chain("postNormalization",function(t){return n.doTransform(i,t)+"\n"}),t.hooks.chain("preBlockGamut",function(t,e){return n.blockGamutHookCallback=e,t=u(t),t=n.doTransform(a,t)+"\n",t=h(t)}),t.hooks.chain("postSpanGamut",function(t){return n.doTransform(o,t)}),n.previousPostConversion=t.hooLine truncated
t(this).data("jGrowl.pause",!0),t(this).animate(i.animateClose,i.closeDuration,i.easing,function(){t.isFunction(i.close)?i.close.apply(e,[e,r,i,n.element])!==!1&&t(this).remove():t(this).remove()})}).trigger("jGrowl.beforeOpen"),""!=i.corners&&void 0!=t.fn.corner&&t(e).corner(i.corners),t("div.jGrowl-notification:parent",n.element).size()>1&&0==t("div.jGrowl-closer",n.element).size()&&this.defaults.closer!==!1&&t(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){t(this).siblings().trigger("jGrowl.beforeClose"),t.isFunction(n.defaults.closer)&&n.defaults.closer.apply(t(this).parent()[0],[t(this).parent()[0]])})},update:function(){t(this.element).find("div.jGrowl-notification:parent").each(function(){void 0!=t(this).data("jGrowl")&&void 0!==t(this).data("jGrowl").created&&t(this).data("jGrowl").created.getTime()+parseInt(t(this).data("jGrowl").life)<(new Date).getTime()&&t(this).data("jGrowl").sticky!==!0&&(void 0==t(this).data("jGrowl.pause")||t(this).data("jGrowl.pause")!==!0)&&t(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0==this.defaults.pool||t(this.element).find("div.jGrowl-notification:parent").size()<this.defaults.pool)&&this.render(this.notifications.shift()),t(this.element).find("div.jGrowl-notification:parent").size()<2&&t(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){t(this).remove()})},startup:function(n){this.element=t(n).addClass("jGrowl").append('<div class="jGrowl-notification"></div>'),this.interval=setInterval(function(){t(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),e&&t(this.element).addClass("ie6")},shutdown:function(){t(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty(),clearInterval(this.interval)},close:function(){t(this.element).find("div.jGrowl-notification").each(function(){t(this).trigger("jGrowl.beforeClose")})}}),t.jGrowl.defaults=t.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",function(t){return function(){var e;return e||t.jQuery.jGrowl}}(this)),define("text!html/notificationsSettingsBlock.html",[],function(){return'<p>Shows notification messages in the bottom-right corner of the\n screen.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-notifications-timeout">Timeout</label>\n <div class="col-sm-7 form-inline">\n <input type="text" id="input-notifications-timeout"\n class="col-sm-5 form-control"> <span class="help-inline">ms</span>\n </div>\n </div>\n</div>'}),define("extensions/notifications",["underscore","utils","logger","classes/Extension","jgrowl","text!html/notificationsSettingsBlock.html"],function(t,e,n,r,i,a){function o(){f===!1&&(i.defaults.life=c.config.timeout,i.defaults.closer=!1,i.defaults.closeTemplate="",i.defaults.position="bottom-right",f=!0)}function s(e,r,a){if(n.info(e),o(),e){var s=e.indexOf("|");(-1===s||(e=e.substring(0,s)))&&(a=a||{},r=r||"icon-info-circled",i("<i class='icon-white "+r+"'></i> "+t.escape(e).replace(/\n/g,"<br/>"),a))}}function l(){d!==!1&&(u.toggleClass("hide",!p),h.toggleClass("hide",p))}var c=new r("notifications","Notifications");c.settingsBlock=a,c.defaultConfig={timeout:8e3},c.onLoadSettings=function(){e.setInputValue("#input-notifications-timeout",c.config.timeout)},c.onSaveSettings=function(t,n){t.timeout=e.getInputIntValue("#input-notifications-timeout",n,1,6e4)};var u,h,f=!1,d=!1;c.onReady=function(){d=!0,u=$(".navbar .offline-status"),h=$(".navbar .extension-buttons"),l()},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'<p>Creates UML diagrams from plain text description.</p>\n\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="textarea-umldiagramLine truncated
j.sin(G/180*i),(t-l)/2),v=(e-c)/2,y=m*m/(n*n)+v*v/(r*r);y>1&&(y=j.sqrt(y),n=y*n,r=y*r);var x=n*n,b=r*r,w=(o==s?-1:1)*j.sqrt(U((x*b-x*v*v-b*m*m)/(x*v*v+b*m*m))),_=w*n*v/r+(t+l)/2,S=w*-r*m/n+(e+c)/2,C=j.asin(((e-S)/r).toFixed(9)),E=j.asin(((c-S)/r).toFixed(9));C=_>t?G-C:C,E=_>l?G-E:E,0>C&&(C=2*G+C),0>E&&(E=2*G+E),s&&C>E&&(C-=2*G),!s&&E>C&&(E-=2*G)}var k=E-C;if(U(k)>f){var T=E,I=l,N=c;E=C+f*(s&&E>C?1:-1),l=_+n*j.cos(E),c=S+r*j.sin(E),p=Lt(l,c,n,r,i,0,s,I,N,[E,T,_,S])}k=E-C;var A=j.cos(C),M=j.sin(C),L=j.cos(E),O=j.sin(E),F=j.tan(k/4),P=4/3*n*F,B=4/3*r*F,$=[t,e],H=[t+P*M,e-B*A],q=[l+P*O,c-B*L],z=[l,c];if(H[0]=2*$[0]-H[0],H[1]=2*$[1]-H[1],u)return[H,q,z][R](p);p=[H,q,z][R](p).join()[D](",");for(var W=[],X=0,V=p.length;V>X;X++)W[X]=X%2?g(p[X-1],p[X],d).y:g(p[X],p[X+1],d).x;return W},Ot=function(t,e,n,r,i,a,o,s,l){var c=1-l;return{x:q(c,3)*t+3*q(c,2)*l*n+3*c*l*l*i+q(l,3)*o,y:q(c,3)*e+3*q(c,2)*l*r+3*c*l*l*a+q(l,3)*s}},Dt=a(function(t,e,n,r,i,a,o,s){var l,c=i-2*n+t-(o-2*i+n),u=2*(n-t)-2*(i-n),h=t-n,f=(-u+j.sqrt(u*u-4*c*h))/2/c,d=(-u-j.sqrt(u*u-4*c*h))/2/c,p=[e,s],g=[t,o];return U(f)>"1e12"&&(f=.5),U(d)>"1e12"&&(d=.5),f>0&&1>f&&(l=Ot(t,e,n,r,i,a,o,s,f),g.push(l.x),p.push(l.y)),d>0&&1>d&&(l=Ot(t,e,n,r,i,a,o,s,d),g.push(l.x),p.push(l.y)),c=a-2*r+e-(s-2*a+r),u=2*(r-e)-2*(a-r),h=e-r,f=(-u+j.sqrt(u*u-4*c*h))/2/c,d=(-u-j.sqrt(u*u-4*c*h))/2/c,U(f)>"1e12"&&(f=.5),U(d)>"1e12"&&(d=.5),f>0&&1>f&&(l=Ot(t,e,n,r,i,a,o,s,f),g.push(l.x),p.push(l.y)),d>0&&1>d&&(l=Ot(t,e,n,r,i,a,o,s,d),g.push(l.x),p.push(l.y)),{min:{x:H[N](0,g),y:H[N](0,p)},max:{x:$[N](0,g),y:$[N](0,p)}}}),Ft=n._path2curve=a(function(t,e){var n=!e&&kt(t);if(!e&&n.curve)return It(n.curve);for(var r=Rt(t),i=e&&Rt(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=(function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][R](Lt[N](0,[e.x,e.y][R](t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i][R](t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][R](Mt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][R](Mt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][R](At(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][R](At(e.x,e.y,t[1],e.y));break;case"V":t=["C"][R](At(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][R](At(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)t.splice(e++,0,["C"][R](n.splice(0,6)));t.splice(e,1),h=$(r.length,i&&i.length||0)}},c=function(t,e,n,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=t[o][1],n.y=t[o][2],h=$(r.length,i&&i.length||0))},u=0,h=$(r.length,i&&i.length||0);h>u;u++){r[u]=s(r[u],a),l(r,u),i&&(i[u]=s(i[u],o)),i&&l(i,u),c(r,i,a,o,u),c(i,r,o,a,u);var f=r[u],d=i&&i[u],p=f.length,g=i&&d.length;a.x=f[p-2],a.y=f[p-1],a.bx=Z(f[p-4])||a.x,a.by=Z(f[p-3])||a.y,o.bx=i&&(Z(d[g-4])||o.x),o.by=i&&(Z(d[g-3])||o.y),o.x=i&&d[g-2],o.y=i&&d[g-1]}return i||(n.curve=It(r)),i?[r,i]:r},null,It),Pt=(n._parseDots=a(function(t){for(var e=[],r=0,i=t.length;i>r;r++){var a={},o=t[r].match(/^([^:]*):?([\d\.]*)/);if(a.color=n.getRGB(o[1]),a.color.error)return null;a.color=a.color.hex,o[2]&&(a.offset=o[2]+"%"),e.push(a)}for(r=1,i=e.length-1;i>r;r++)if(!e[r].offset){for(var s=Z(e[r-1].offset||0),l=0,c=r+1;i>c;c++)if(e[c].offset){l=e[c].offset;break}l||(l=100,c=i),l=Z(l);for(var u=(l-s)/(c-r+1);c>r;r++)s+=u,e[r].offset=s+"%"}return e}),n._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),Bt=(n._tofront=function(t,e){e.top!==t&&(Pt(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},n._toback=function(t,e){e.bottom!==t&&(Pt(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pt(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pt(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Tt(t),r={_:{transform:M},getBBox:function(){return n}};return jt(r,e),r.matrix}),jt=(n.transformPath=function(t,e){return vt(t,Bt(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,x=r[h],b=x.length,w=O(x[0]).toLowerCase(),_=x[0]!=w,S=_?u.invert():0;"t"==w&&3==b?_?(d=S.x(0,0),g=S.y(0,0),m=S.x(x[1],x[2]),v=S.y(x[1],x[2]),u.translate(m-d,v-g)):u.translate(x[1],x[2]):"r"==w?2==b?(y=y||t.getBBox(1),u.rotate(x[1],y.x+y.width/2,y.y+y.height/2),i+=x[1]):4==b&&(_?(m=S.x(x[2],x[3]),v=S.y(x[2],x[3]),u.rotate(x[1],m,v)):u.rotate(x[1],x[2],x[3]),i+=x[1]):"s"==w?2==b||3==b?(y=y||t.getBBox(1),u.scale(x[1],x[bLine truncated
"stroke-linecap":"round",d:p[_],id:k})),g[k]=1);var I,N=n._g.doc.getElementById(T);N?(g[T]++,I=N.getElementsByTagName("use")[0]):(N=m(m("marker"),{id:T,markerHeight:C,markerWidth:S,orient:"auto",refX:c,refY:C/2}),I=m(m("use"),{"xlink:href":"#"+k,transform:(a?"rotate(180 "+S/2+" "+C/2+") ":h)+"scale("+S/E+","+C/E+")","stroke-width":(1/((S/E+C/E)/2)).toFixed(4)}),N.appendChild(I),d.defs.appendChild(N),g[T]=1),m(I,u);var R=l*("diamond"!=_&&"oval"!=_);a?(o=r._.arrows.startdx*b||0,s=n.getTotalLength(x.path)-R*b):(o=R*b,s=n.getTotalLength(x.path)-(r._.arrows.enddx*b||0)),u={},u["marker-"+v]="url(#"+T+")",(s||o)&&(u.d=n.getSubpath(x.path,o,s)),m(y,u),r._.arrows[v+"Path"]=k,r._.arrows[v+"Marker"]=T,r._.arrows[v+"dx"]=R,r._.arrows[v+"Type"]=_,r._.arrows[v+"String"]=i}else a?(o=r._.arrows.startdx*b||0,s=n.getTotalLength(x.path)-o):(o=0,s=n.getTotalLength(x.path)-(r._.arrows.enddx*b||0)),r._.arrows[v+"Path"]&&m(y,{d:n.getSubpath(x.path,o,s)}),delete r._.arrows[v+"Path"],delete r._.arrows[v+"Marker"],delete r._.arrows[v+"dx"],delete r._.arrows[v+"Type"],delete r._.arrows[v+"String"];for(u in g)if(g[t](u)&&!g[u]){var A=n._g.doc.getElementById(u);A&&A.parentNode.removeChild(A)}}},b={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(t,n,r){if(n=b[e(n).toLowerCase()]){for(var i=t.attrs["stroke-width"]||"1",a={round:i,square:i,butt:0}[t.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,o=[],s=n.length;s--;)o[s]=n[s]*i+(s%2?1:-1)*a;m(t.node,{"stroke-dasharray":o.join(",")})}},_=function(r,a){var l=r.node,u=r.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var p in a)if(a[t](p)){if(!n._availableAttrs[t](p))continue;var g=a[p];switch(u[p]=g,p){case"blur":r.blur(g);break;case"href":case"title":var b=m("title"),_=n._g.doc.createTextNode(g);b.appendChild(_),l.appendChild(b);break;case"target":var S=l.parentNode;if("a"!=S.tagName.toLowerCase()){var b=m("a");S.insertBefore(b,l),b.appendChild(l),S=b}"target"==p?S.setAttributeNS(d,"show","blank"==g?"new":g):S.setAttributeNS(d,p,g);break;case"cursor":l.style.cursor=g;break;case"transform":r.transform(g);break;case"arrow-start":x(r,g);break;case"arrow-end":x(r,g,1);break;case"clip-rect":var E=e(g).split(c);if(4==E.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var k=m("clipPath"),T=m("rect");k.id=n.createUUID(),m(T,{x:E[0],y:E[1],width:E[2],height:E[3]}),k.appendChild(T),r.paper.defs.appendChild(k),m(l,{"clip-path":"url(#"+k.id+")"}),r.clip=T}if(!g){var I=l.getAttribute("clip-path");if(I){var N=n._g.doc.getElementById(I.replace(/(^url\(#|\)$)/g,h));N&&N.parentNode.removeChild(N),m(l,{"clip-path":h}),delete r.clip}}break;case"path":"path"==r.type&&(m(l,{d:g?u.path=n._pathToAbsolute(g):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1)));break;case"width":if(l.setAttribute(p,g),r._.dirty=1,!u.fx)break;p="x",g=u.x;case"x":u.fx&&(g=-u.x-(u.width||0));case"rx":if("rx"==p&&"rect"==r.type)break;case"cx":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"height":if(l.setAttribute(p,g),r._.dirty=1,!u.fy)break;p="y",g=u.y;case"y":u.fy&&(g=-u.y-(u.height||0));case"ry":if("ry"==p&&"rect"==r.type)break;case"cy":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"r":"rect"==r.type?m(l,{rx:g,ry:g}):l.setAttribute(p,g),r._.dirty=1;break;case"src":"image"==r.type&&l.setAttributeNS(d,"href",g);break;case"stroke-width":(1!=r._.sx||1!=r._.sy)&&(g/=o(s(r._.sx),s(r._.sy))||1),r.paper._vbSize&&(g*=r.paper._vbSize),l.setAttribute(p,g),u["stroke-dasharray"]&&w(r,u["stroke-dasharray"],a),r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fillLine truncated
n[t].apply(n,e)})}}(L))}}(),T.was?k.win.Raphael=n:Raphael=n,n}),function(){function t(){this.title=void 0,this.actors=[],this.signals=[]}function e(t,e){_.extend(this,e),this.name="ParseError",this.message=t||""}t.prototype.getActor=function(e){var n=/^(.+) as (\S+)$/i.exec(e.trim());n?(name=n[1].trim(),e=n[2].trim()):name=e.trim(),name=name.replace(/\\n/gm,"\n");var r,i=this.actors;for(r in i)if(i[r].alias==e)return i[r];return r=i.push(new t.Actor(e,name,i.length)),i[r-1]},t.prototype.setTitle=function(t){this.title=t},t.prototype.addSignal=function(t){this.signals.push(t)},t.Actor=function(t,e,n){this.alias=t,this.name=e,this.index=n},t.Signal=function(t,e,n,r){this.type="Signal",this.actorA=t,this.actorB=n,this.linetype=3&e,this.arrowtype=e>>2&3,this.message=r},t.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index},t.Note=function(t,e,n){if(this.type="Note",this.actor=t,this.placement=e,this.message=n,this.hasManyActors()&&t[0]==t[1])throw new Error("Note should be over two different actors")},t.Note.prototype.hasManyActors=function(){return _.isArray(this.actor)},t.LINETYPE={SOLID:0,DOTTED:1},t.ARROWTYPE={FILLED:0,OPEN:1},t.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var n=function(){function e(){this.yy={}}var n={trace:function(){},yy:{},symbols_:{error:2,start:3,document:4,EOF:5,line:6,statement:7,NL:8,participant:9,actor:10,signal:11,note_statement:12,title:13,message:14,note:15,placement:16,over:17,actor_pair:18,",":19,left_of:20,right_of:21,signaltype:22,ACTOR:23,linetype:24,arrowtype:25,LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(e,n,r,i,a,o){var s=o.length-1;switch(a){case 1:return i;case 4:break;case 6:o[s];break;case 7:i.addSignal(o[s]);break;case 8:i.addSignal(o[s]);break;case 9:i.setTitle(o[s]);break;case 10:this.$=new t.Note(o[s-1],o[s-2],o[s]);break;case 11:this.$=new t.Note(o[s-1],t.PLACEMENT.OVER,o[s]);break;case 12:this.$=o[s];break;case 13:this.$=[o[s-2],o[s]];break;case 14:this.$=t.PLACEMENT.LEFTOF;break;case 15:this.$=t.PLACEMENT.RIGHTOF;break;case 16:this.$=new t.Signal(o[s-3],o[s-2],o[s-1],o[s]);break;case 17:this.$=i.getActor(o[s]);break;case 18:this.$=o[s-1]|o[s]<<2;break;case 19:this.$=o[s];break;case 20:this.$=t.LINETYPE.SOLID;break;case 21:this.$=t.LINETYPE.DOTTED;break;case 22:this.$=t.ARROWTYPE.FILLED;break;case 23:this.$=t.ARROWTYPE.OPEN;break;case 24:this.$=o[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,x,b,w,_,S,C={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof yLine truncated
r=0,i=this.symbols.length;i>r;r++){t=this.symbols[r];var s=t.getX()+t.width,l=t.getY()+t.height;s>a&&(a=s),l>o&&(o=l)}this.paper.setSize(a+this.options["line-width"],o+this.options["line-width"])},a.prototype.clean=function(){if(this.paper){var t=this.paper.canvas;t.parentNode.removeChild(t)}},o.prototype.getAttr=function(t){if(!this.chart)return void 0;var e,n=this.chart.options?this.chart.options[t]:void 0,r=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(e=this.chart.options.flowstate[this.flowstate][t]),e||r||n},o.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},o.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},o.prototype.getX=function(){return this.group.getBBox().x},o.prototype.getY=function(){return this.group.getBBox().y},o.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},o.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},o.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},o.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},o.prototype.getTop=function(){var t=this.getY(),e=this.getX()+this.width/2;return{x:e,y:t}},o.prototype.getBottom=function(){var t=this.getY()+this.height,e=this.getX()+this.width/2;return{x:e,y:t}},o.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX();return{x:e,y:t}},o.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width;return{x:e,y:t}},o.prototype.render=function(){if(this.next){var t=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();if(this.next.getLeft(),!this.next.isPositioned){this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+t);var n=this;!function i(){for(var e,r=!1,a=0,o=n.chart.symbols.length;o>a;a++){e=n.chart.symbols[a];var s=Math.abs(e.getCenter().x-n.next.getCenter().x);if(e.getCenter().y>n.next.getCenter().y&&s<=n.next.width/2){r=!0;break}}r&&(n.next.setX(e.getX()+e.width+t),i())}(),this.next.isPositioned=!0,this.next.render()}}else{var r=this.getBottom();this.next.getTop(),this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+t),this.next.setX(r.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},o.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,"",this.next_direction):this.drawLineTo(this.next))},o.prototype.drawLineTo=function(t,e,n){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var a,o=this.getCenter().x,s=this.getCenter().y,l=(this.getTop(),this.getRight()),c=this.getBottom(),u=this.getLeft(),h=t.getCenter().x,f=t.getCenter().y,d=t.getTop(),p=t.getRight(),g=(t.getBottom(),t.getLeft()),m=o===h,v=s===f,y=f>s,x=s>f,b=o>h,w=h>o,_=0,S=this.getAttr("line-length"),C=this.getAttr("line-width");if(n&&"bottom"!==n||!m||!y)if(n&&"right"!==n||!v||!w)if(n&&"left"!==n||!v||!b)if(n&&"right"!==n||!m||!x)if(n&&"right"!==n||!m||!y)if(n&&"bottom"!==n||!b)if(n&&"bottom"!==n||!w)if(n&&"right"===n&&b)a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else if(n&&"right"===n&&w)a=r(this.chart,l,[{x:d.x,y:l.y},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else if(n&&"bottom"===n&&m&&x)a=r(this.chart,c,[{x:c.x,y:c.y+S/2},{x:l.x+S/2,y:c.y+S/2},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+S/2;else if("left"===n&&m&&x){var E=u.x-S/2;g.x<u.x&&(E=g.x-S/2),a=r(this.chart,u,[{x:E,y:u.y},{x:E,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.leftStart=!0,t.topEnd=!0,_=u.x}else"left"===n&&(a=r(this.chart,u,[{x:d.x+(u.x-d.x)/2,y:u.y},{x:d.x+(u.x-d.x)/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.leftStart=!0,t.topEnd=!0,_=u.x);else a=r(this.chart,c,[{x:c.x,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=this.leftEnd&&x?r(this.chart,c,[{x:c.x,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,_=p.x;else a=r(this.chart,l,g,e),this.rightStaLine truncated
}catch(n){console.error("No event listener called "+t)}},l("onInit")(),u.onLoadSettings=function(){i.log("onLoadSettings"),t.each(h,function(t){var e=!t.isOptional||void 0===t.config.enabled||t.config.enabled===!0;r.setInputChecked("#input-enable-extension-"+t.extensionId,e),"markdownExtra"==t.extensionId?r.setInputChecked("#input-settings-markdown-extra",e):"mathJax"==t.extensionId&&r.setInputChecked("#input-settings-mathjax",e);var n=t.onLoadSettings;n&&n()})},u.onSaveSettings=function(e,n){i.log("onSaveSettings"),t.each(h,function(i){var a=t.extend({},i.defaultConfig);a.enabled=r.getInputChecked("#input-enable-extension-"+i.extensionId);var o;"markdownExtra"==i.extensionId?(o=r.getInputChecked("#input-settings-markdown-extra"),o!=i.enabled&&(a.enabled=o)):"mathJax"==i.extensionId&&(o=r.getInputChecked("#input-settings-mathjax"),o!=i.enabled&&(a.enabled=o));var s=i.onSaveSettings;s&&s(a,n),e[i.extensionId]=a})},c("onMessage"),c("onError"),c("onOfflineChanged"),c("onUserActive"),c("onAsyncRunning"),c("onPeriodicRun"),c("onEditorCreated"),c("onFileMgrCreated"),c("onSynchronizerCreated"),c("onPublisherCreated"),c("onSharingCreated"),c("onEventMgrCreated"),c("onFileCreated"),c("onFileDeleted"),c("onFileSelected"),c("onFileOpen"),c("onFileClosed"),c("onContentChanged"),c("onTitleChanged"),c("onFoldersChanged"),c("onSyncRunning"),c("onSyncSuccess"),c("onSyncImportSuccess"),c("onSyncExportSuccess"),c("onSyncRemoved"),c("onPublishRunning"),c("onPublishSuccess"),c("onNewPublishSuccess"),c("onPublishRemoved"),c("onLayoutCreated"),c("onLayoutResize"),c("onExtensionButtonResize"),c("onPagedownConfigure"),c("onSectionsCreated"),c("onCursorCoordinates"),c("onEditorPopover"),c("onDiscussionCreated"),c("onDiscussionRemoved"),c("onCommentsChanged"),c("onTweet");var p,g,m=l("onPreviewFinished"),v=s("onAsyncPreview");u.onAsyncPreview=function(){function e(n){var i=n.length?n.shift():function(){setTimeout(function(){var e="";t.each(p.children,function(t){e+=t.innerHTML});var n=r.trim(e),i=n.replace(/ <span class="comment label label-danger">.*?<\/span> /g,"");m(n,i)},10)};i(function(){e(n)})}i.log("onAsyncPreview"),e(v.concat([function(t){g.waitForImages(t)}]))};var y=l("onReady");return u.onReady=function(){p=document.getElementById("preview-contents"),g=$(p);var r=function(n){var r=e("div",{"class":"btn-group"}),i=n();return t.isString(i)?r.innerHTML=i:t.isElement(i)&&r.appendChild(i),r};window.viewerMode===!1,i.log("onCreatePreviewButton");var a=s("onCreatePreviewButton"),o=document.createDocumentFragment();t.each(a,function(t){o.appendChild(r(t))});var l=document.querySelector(".extension-preview-buttons");l&&l.appendChild(o),n.bind("escape",function(){u.onEditorPopover()}),y()},u.onEventMgrCreated(u),u}),function(){var t=/\blang(?:uage)?-(?!\*)(\w+)\b/i,e=self.Prism={util:{type:function(t){return Object.prototype.toString.call(t).match(/\[object (\w+)\]/)[1]},clone:function(t){var n=e.util.type(t);switch(n){case"Object":var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e.util.clone(t[i]));return r;case"Array":return t.slice()}return t}},languages:{extend:function(t,n){var r=e.util.clone(e.languages[t]);for(var i in n)r[i]=n[i];return r},insertBefore:function(t,n,r,i){i=i||e.languages;var a=i[t],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==n)for(var l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);o[s]=a[s]}return i[t]=o},DFS:function(t,n){for(var r in t)n.call(t,r,t[r]),"Object"===e.util.type(t)&&e.languages.DFS(t[r],n)}},highlightAll:function(t,n){for(var r,i=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0;r=i[a++];)e.highlightElement(r,t===!0,n)},highlightElement:function(r,i,a){for(var o,s,l=r;l&&!t.test(l.className);)l=l.parentNode;if(l&&(o=(l.className.match(t)||[,""])[1],s=e.languages[o]),s){r.className=r.className.replace(t,"").replace(/\s+/g," ")+" language-"+o,l=r.parentNode,/pre/i.test(l.nodeName)&&(l.className=l.className.replace(t,"").replace(/\s+/g," ")+" language-"+o);var c=r.textContent;if(c){c=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var u={element:r,language:o,grammar:s,code:c};if(e.hooks.run("before-highlight",u),i&&self.Worker){var h=new Worker(e.filename);h.onmessage=function(t){u.highlightedCode=n.stringify(JSON.parse(t.data),o),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(u.element),e.hooks.run("after-highlight",u)},h.postMessage(JSON.stringify({language:u.language,code:u.code}))}else u.highlightedCode=e.highlight(u.code,u.grammar,u.language),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(r),e.hooks.run("after-highlight",u)}}},highlight:function(t,r,i){return n.stringify(e.tokenize(t,r),i)},tokenize:function(t,n){var r=e.Token,i=[t],a=n.rest;if(a){for(var o in a)n[o]=a[o];delete n.rest}t:for(var o in n)if(n.hasOwnProperty(o)&&n[o]){var s=n[o],l=s.inside,c=!!s.lookbehind,u=0;s=s.pattern||s;for(var h=0;h<i.length;h++){var f=i[h];iLine truncated
}],9:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=t("./lcs"),s=3,l="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},c="function"==typeof Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=t.length,r=0;n>r;r++)if(t[r]===e)return r;return-1},u=function(t){if(t.leftIsArray){for(var e,n,i,a,l=t.options&&t.options.objectHash,u=function(t,e,n,r,i){var a=t[n],o=e[r];if(a===o)return!0;if("object"!=typeof a||"object"!=typeof o)return!1;if(!l)return!1;var s,c;return"number"==typeof n?(i.hashCache1=i.hashCache1||[],s=i.hashCache1[n],"undefined"==typeof s&&(i.hashCache1[n]=s=l(a,n))):s=l(a),"undefined"==typeof s?!1:("number"==typeof r?(i.hashCache2=i.hashCache2||[],c=i.hashCache2[r],"undefined"==typeof c&&(i.hashCache2[r]=c=l(o,r))):c=l(o),"undefined"==typeof c?!1:s===c)},h={},f=0,d=0,p=t.left,g=t.right,m=p.length,v=g.length;m>f&&v>f&&u(p,g,f,f,h);)e=f,a=new r(t.left[e],t.right[e]),t.push(a,e),f++;for(;m>d+f&&v>d+f&&u(p,g,m-1-d,v-1-d,h);)n=m-1-d,i=v-1-d,a=new r(t.left[n],t.right[i]),t.push(a,i),d++;var y;if(f+d===m){if(m===v)return void t.setResult(void 0).exit();for(y=y||{_t:"a"},e=f;v-d>e;e++)y[e]=[g[e]];return void t.setResult(y).exit()}if(f+d===v){for(y=y||{_t:"a"},e=f;m-d>e;e++)y["_"+e]=[p[e],0,0];return void t.setResult(y).exit()}h={};var x=p.slice(f,m-d),b=g.slice(f,v-d),w=o.get(x,b,u,h),_=[];for(y=y||{_t:"a"},e=f;m-d>e;e++)c(w.indices1,e-f)<0&&(y["_"+e]=[p[e],0,0],_.push(e));var S=!0;t.options&&t.options.arrays&&t.options.arrays.detectMove===!1&&(S=!1);var C=!1;t.options&&t.options.arrays&&t.options.arrays.includeValueOnMove&&(C=!0);var E=_.length;for(e=f;v-d>e;e++){var k=c(w.indices2,e-f);if(0>k){var T=!1;if(S&&E>0)for(n=0;E>n;n++)if(u(x,b,_[n]-f,e-f,h)){y["_"+_[n]].splice(1,2,e,s),C||(y["_"+_[n]][0]=""),n=_[n],i=e,a=new r(t.left[n],t.right[i]),t.push(a,i),_.splice(n,1),T=!0;break}T||(y[e]=[g[e]])}else n=w.indices1[k]+f,i=w.indices2[k]+f,a=new r(t.left[n],t.right[i]),t.push(a,i)}t.setResult(y).exit()}};u.filterName="arrays";var h={numerically:function(t,e){return t-e},numericallyBy:function(t){return function(e,n){return e[t]-n[t]}}},f=function(t){if(t.nested&&"a"===t.delta._t){var e,n,r=t.delta,a=t.left,o=[],l=[],c=[];for(e in r)if("_t"!==e)if("_"===e[0]){if(0!==r[e][2]&&r[e][2]!==s)throw new Error("only removal or move can be applied at original array indices, invalid diff type: "+r[e][2]);o.push(parseInt(e.slice(1),10))}else 1===r[e].length?l.push({index:parseInt(e,10),value:r[e][0]}):c.push({index:parseInt(e,10),delta:r[e]});for(o=o.sort(h.numerically),e=o.length-1;e>=0;e--){n=o[e];var u=r["_"+n],f=a.splice(n,1)[0];u[2]===s&&l.push({index:u[1],value:f})}l=l.sort(h.numericallyBy("index"));var d=l.length;for(e=0;d>e;e++){var p=l[e];a.splice(p.index,0,p.value)}var g,m=c.length;if(m>0)for(e=0;m>e;e++){var v=c[e];g=new i(t.left[v.index],v.delta),t.push(g,v.index)}return t.children?void t.exit():void t.setResult(t.left).exit()}};f.filterName="arrays";var d=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]=e.result;t.setResult(t.left).exit()}};d.filterName="arraysCollectChildren";var p=function(t){if(!t.nested)return void(t.delta[2]===s&&(t.newName="_"+t.delta[1],t.setResult([t.delta[0],parseInt(t.childName.substr(1),10),s]).exit()));if("a"===t.delta._t){var e,n;for(e in t.delta)"_t"!==e&&(n=new a(t.delta[e]),t.push(n,e));t.exit()}};p.filterName="arrays";var g=function(t,e,n){var r=e;if("string"==typeof e&&"_"===e[0])r=parseInt(e.substr(1),10);else{var i="_"+e;if(l(n)&&0===n[2])r=i;else for(var a in t){var o=t[a];l(o)&&o[2]===s&&o[1].toString()===e&&(r=a.substr(1))}}return r},m=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r={_t:"a"},i=0;n>i;i++){e=t.children[i];var a=e.newName;"undefined"==typeof a&&(a=g(t.delta,e.childName,e.result)),r[a]!==e.result&&(r[a]=e.result)}t.setResult(r).exit()}};m.filterName="arraysCollectChildren",n.diffFilter=u,n.patchFilter=f,n.collectChildrenPatchFilter=d,n.reverseFilter=p,n.collectChildrenReverseFilter=m},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5,"./lcs":11}],10:[function(t,e,n){var r=function(t){t.left instanceof Date?(t.setResult(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?[t.left,t.right]:void 0:[t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sLine truncated
var i=_(X,e,n);X=e,i===!0&&(H.discussionList=H.discussionList),H.content=X,W.saveSelectionState(),r.onContentChanged(H,X),i&&r.onCommentsChanged(H),Y.saveState(),J()}else X=e,H.content=X,W.setSelectionStartEnd(H.editorStart,H.editorEnd),W.updateSelectionRange(),W.updateCursorCoordinates(),Y.saveSelectionState(),r.onFileOpen(H,X),L.scrollTop=H.previewScrollTop,P=H.editorScrollTop,T.scrollTop=P,U=!1}function _(t,e,n){if(n.length){var r=G.diff_main(t,e),i=!1,a=0;return r.forEach(function(t){var e=t[0],r=t[1];if(0===e)return void(a+=r.length);var o=a,s=r.length;-1===e&&(o+=s,s=-s),n.forEach(function(t){t.selectionEnd>o?(t.selectionEnd+=s,t.discussionIndex&&(i=!0)):t.selectionEnd>a&&(t.selectionEnd=a,t.discussionIndex&&(i=!0)),t.selectionStart>=o?(t.selectionStart+=s,t.discussionIndex&&(i=!0)):t.selectionStart>a&&(t.selectionStart=a,t.discussionIndex&&(i=!0))}),1===e&&(a+=r.length)}),i}}function S(e){if(tt=[],Z=[],Q=void 0,U===!0)return Z=K,K=e,void(tt=e);var n=K.length;t.some(K,function(t,r){var i=e[r];return r>=e.length||t.textWithFrontMatter!=i.textWithFrontMatter||t.elt.parentNode!==N||t.elt.textContent!=i.textWithFrontMatter?(n=r,!0):void 0});var r=-K.length;t.some(K.slice().reverse(),function(t,n){var i=e[e.length-n-1];return n>=e.length||t.textWithFrontMatter!=i.textWithFrontMatter||t.elt.parentNode!==N||t.elt.textContent!=i.textWithFrontMatter?(r=-n,!0):void 0}),n-r>K.length&&(r=n-K.length);var i=K.slice(0,n);tt=e.slice(n,e.length+r);var a=K.slice(K.length+r,K.length);Q=t.first(a),Z=K.slice(n,K.length+r),K=i.concat(tt).concat(a)}function C(){var t=document.createDocumentFragment();tt.forEach(function(e){k(e),t.appendChild(e.elt)}),q.noWatch(function(){if(U===!0)N.innerHTML="",N.appendChild(t);else{Z.forEach(function(t){t.elt.parentNode===N&&N.removeChild(t.elt),t.elt.generated=!1}),void 0!==Q?N.insertBefore(t,Q.elt):N.appendChild(t);for(var e=N.firstChild;e;){var n=e.nextSibling;e.generated||N.removeChild(e),e=n}}E(),W.updateSelectionRange(),W.updateCursorCoordinates()})}function E(){D=s("span",{"class":"token lf"}),D.textContent="\n",N.appendChild(D)}function k(t){var e=et(t.text);window.viewerMode||(e=i.highlight(e,i.languages.md));var n=t.textWithFrontMatter.substring(0,t.textWithFrontMatter.length-t.text.length);n.length&&(n=et(n),n=n.replace(/\n/g,'<span class="token lf">\n</span>'),e='<span class="token md">'+n+"</span>"+e);var r=s("span",{id:"wmd-input-section-"+t.id,"class":"wmd-input-section"});r.generated=!0,r.innerHTML=e,t.elt=r}var T,I,N,R,A,M,L,O,D,F={},P=0,B=function(){var e,r=0,i=function(){var t=Date.now();O.refreshPreview(),r=Date.now()-t};return n.lazyRendering===!0?t.debounce(i,500):function(){clearTimeout(e),e=setTimeout(i,2e3>r?r:2e3)}}();r.addListener("onPagedownConfigure",function(t){O=t});var j=0;r.addListener("onSectionsCreated",function(t){j||(S(t),C()),U===!0?O.refreshPreview():B()});var H,U=!0;r.addListener("onFileSelected",function(t){U=!0,H=t});var q=new c;F.watcher=q;var G=new a,z=o.create({objectHash:function(t){return JSON.stringify(t)},arrays:{detectMove:!1},textDiff:{minLength:9999999}}),W=new u;F.selectionMgr=W,$(document).on("selectionchange",".editor-content",t.bind(W.saveSelectionState,W,!0,!1)),F.adjustCursorPosition=h;var X;F.setValue=f,F.onResize=function(){r.onLayoutResize()};var V=!1;F.setContent=function(t){H||(H={content:t}),N?(H={content:t},N.textContent=t,r.onFileSelected(H),w(),V=!1):V=t},window.we=F,F.replace=d,F.replaceAll=p,F.replacePreviousText=g,F.setValueNoWatch=m,F.getValue=v,F.getContent=v,F.focus=y;var Y=new x;F.undoMgr=Y,r.addListener("onDiscussionCreated",b),r.addListener("onDiscussionRemoved",b),r.addListener("onCommentsChanged",b);var J=t.debounce(function(){var t=window.getSelection();W.hasFocus&&!j&&W.selectionStart===W.selectionEnd&&t.modify&&(W.selectionStart?(t.modify("move","backward","character"),t.modify("move","forward","character")):(t.modify("move","forward","character"),t.modify("move","backward","character")))},10);F.adjustCommentOffsets=_,F.init=function(){if(T=document.getElementById("wmd-input"),I=$(T),N=T.querySelector(".editor-content"),R=$(N),A=T.querySelector(".editor-margin"),M=$(A),L=document.querySelector(".preview-container"),I.addClass(n.editorFontClass),q.startWatching(),$(T).scroll(function(){P=T.scrollTop,U===!1&&(H.editorScrollTop=P)}),$(L).scroll(function(){U===!1&&(H.previewScrollTop=L.scrollTop)}),/AppleWebKit\/([\d.]+)/.exec(navigator.userAgent)){var e=$('<input style="width:1px;height:1px;border:none;margin:0;padding:0;" tabIndex="-1">').appendTo("html");R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.maxLine truncated
$("#wmd-quote-button").append($('<i class="fa fa-quote-left">')).appendTo(r),$("#wmd-code-button").append($('<i class="fa fa-code">')).appendTo(r),$("#wmd-image-button").append($('<i class="fa fa-picture-o">')).appendTo(r),r=$(".wmd-button-group3"),$("#wmd-olist-button").append($('<i class="fa fa-list-ol">')).appendTo(r),$("#wmd-ulist-button").append($('<i class="fa fa-list-ul">')).appendTo(r),$("#wmd-heading-button").append($('<i class="fa fa-header">')).appendTo(r),$("#wmd-hr-button").append($('<i class="fa fa-ellipsis-h">')).appendTo(r),r=$(".wmd-button-group5"),$("#wmd-undo-button").append($('<i class="fa fa-undo">')).appendTo(r),$("#wmd-redo-button").append($('<i class="fa fa-repeat">')).appendTo(r),$("#wmd-help-button").show()},c.initEditor=function(t){return void 0!==h&&s.onFileClosed(h),h=t,void 0!==u?(n.undoMgr.init(),u.uiManager.setUndoRedoButtonStates()):(c.initEditorFirst(),void n.undoMgr.init())},c.onReady=function(){document.body.className+=" "+o.editMode,i.init(),$(document).mousemove(l).keypress(l),s.onReady(),c.initEditorFirst(),n.init()},s.addListener("onReady",function(){$(document.body).on("shown.bs.modal",".modal",function(){var t=$(this);setTimeout(function(){t.find(".btn:first").focus(),t.find("button:first").focus(),t.find("input:enabled:visible:first").focus()},50)}).on("hidden.bs.modal",".modal",function(){n.focus()}).on("keypress",".modal",function(t){13!=t.which||$(t.target).is("textarea")||$(this).find(".modal-footer a:last").click()}),$(".action-insert-link").click(function(t){var e=i.getInputTextValue($("#input-insert-link"),t);void 0!==e&&(c.insertLinkCallback(e),c.insertLinkCallback=void 0)}),$(".action-insert-image").click(function(){var t=document.mdImageManager.mdGetImgSrc();t&&(c.insertLinkCallback(t),c.insertLinkCallback=void 0)}),$(".modal-insert-link, .modal-insert-image").on("hidden.bs.modal",function(){void 0!==c.insertLinkCallback&&(c.insertLinkCallback(null),c.insertLinkCallback=void 0)}),$("div.dropdown-menu").click(function(t){t.stopPropagation()}),$("#wmd-help-button").click(function(){window.open("http://leanote.com/blog/view/531b263bdfeb2c0ea9000002")}),t.each(document.querySelectorAll("img"),function(t){var e=$(t),n=e.data("stackeditSrc");n&&e.attr("src",window.baseDir+"/img/"+n)})}),c}),define("css/css",[],function(){if("undefined"==typeof window)return{load:function(t,e,n){n()}};var t=document.getElementsByTagName("head")[0],e=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)/)||0,n=!1,r=!0;e[1]||e[7]?n=parseInt(e[1])<6||parseInt(e[7])<=9:e[2]?r=!1:e[4]&&(n=parseInt(e[4])<18);var i={};i.pluginBuilder="./css-builder";var a,o,s,l=function(){a=document.createElement("style"),t.appendChild(a),o=a.styleSheet||a.sheet},c=0,u=[],h=function(t){c++,32==c&&(l(),c=0),o.addImport(t),a.onload=function(){f()}},f=function(){s();var t=u.shift();return t?(s=t[1],void h(t[0])):void(s=null)},d=function(t,e){if(o&&o.addImport||l(),o&&o.addImport)s?u.push([t,e]):(h(t),s=e);else{a.textContent='@import "'+t+'";';var n=setInterval(function(){try{a.sheet.cssRules,clearInterval(n),e()}catch(t){}},10)}},p=function(e,n){var i=document.createElement("link");if(i.type="text/css",i.rel="stylesheet",r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var a=setInterval(function(){for(var t=0;t<document.styleSheets.length;t++){var e=document.styleSheets[t];if(e.href==i.href)return clearInterval(a),n()}},10);i.href=e,t.appendChild(i)};return i.normalize=function(t,e){return".css"==t.substr(t.length-4,4)&&(t=t.substr(0,t.length-4)),e(t)},i.load=function(t,e,r){(n?d:p)(e.toUrl(t+".css"),r)},i}),define("css",["css/css"],function(t){return t}),rangy.createModule("CssClassApplier",function(t,e){function n(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(t,e){return t.className&&new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(t.className)}function i(t,e){t.className?r(t,e)||(t.className+=" "+e):t.className=e}function a(t){return t.split(/\s+/).sort().join(" ")}function o(t){return a(t.className)}function s(t,e){return o(t)==o(e)}function l(t){for(var e=t.parentNode;t.hasChildNodes();)e.insertBefore(t.firstChild,t);e.removeChild(t)}function c(t,e){var n=t.cloneRange();n.selectNodeContents(e);var r=n.intersection(t),i=r?r.toString():"";return n.detach(),""!=i}function u(t){return t.getNodes([3],function(e){return c(t,e)})}function h(t,e){if(t.attributes.length!=e.attributes.length)return!1;for(var n,r,i,a=0,o=t.attributes.length;o>a;++a)if(n=t.attributes[a],i=n.name,"class"!=i){if(r=e.attributes.getNamedItem(i),n.specified!=r.specified)return!1;if(n.specified&&n.nodeValue!==r.nodeValue)return!1}return!0}function f(t,e){for(var n,r=0,i=t.attributes.length;i>r;++r)if(n=t.attributes[r].name,(!e||!k.arrayContains(e,n))&&t.attributes[r].specified&&"class"!=n)return!0;return!1}function d(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function p(t){var e;return t&&1=Line truncated
+1 -1
View File
@@ -1 +1 @@
!function(t){t(jQuery)}(function(t,e){var i=0,n=Array.prototype.slice,s=t.cleanData;t.cleanData=function(e){for(var i,n=0;null!=(i=e[n]);n++)try{t(i).triggerHandler("remove")}catch(o){}s(e)},t.widget=function(e,i,n){var s,o,a,r,u={},d=e.split(".")[0];e=e.split(".")[1],s=d+"-"+e,n||(n=i,i=t.Widget),t.expr[":"][s.toLowerCase()]=function(e){return!!t.data(e,s)},t[d]=t[d]||{},o=t[d][e],a=t[d][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new a(t,e)},t.extend(a,o,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(n,function(e,n){return t.isFunction(n)?void(u[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},s=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=s,e=n.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(u[e]=n)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix:e},u,{constructor:a,namespace:d,widgetName:e,widgetFullName:s}),o?(t.each(o._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a)},t.widget.extend=function(i){for(var s,o,a=n.call(arguments,1),r=0,u=a.length;u>r;r++)for(s in a[r])o=a[r][s],a[r].hasOwnProperty(s)&&o!==e&&(i[s]=t.isPlainObject(o)?t.isPlainObject(i[s])?t.widget.extend({},i[s],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,u=n.call(arguments,1),d=this;return a=!r&&u.length?t.widget.extend.apply(null,[a].concat(u)):a,this.each(r?function(){var n,s=t.data(this,o);return s?t.isFunction(s[a])&&"_"!==a.charAt(0)?(n=s[a].apply(s,u),n!==s&&n!==e?(d=n&&n.jquery?d.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}:function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new s(a,this))}),d}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,n){var s,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},s=i.split("."),i=s.shift(),s.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;a<s.length-1;a++)o[s[a]]=o[s[a]]||{},o=o[s[a]];if(i=s.pop(),n===e)return o[i]===e?null:o[i];o[i]=n}else{if(n===e)return this.options[i]===e?null:this.options[i];r[i]=n}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,i,n){var s,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=s=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),t.each(n,function(n,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var u=n.match(/^(\w+)\s*(.*)$/),d=u[1]+o.eventNamespace,h=u[2];h?s.delegate(h,d,r):i.bind(d,r)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamLine truncated
!function(t){t(jQuery)}(function(t,e){var i=0,n=Array.prototype.slice,s=t.cleanData;t.cleanData=function(e){for(var i,n=0;null!=(i=e[n]);n++)try{t(i).triggerHandler("remove")}catch(o){}s(e)},t.widget=function(e,i,n){var s,o,a,r,u={},d=e.split(".")[0];e=e.split(".")[1],s=d+"-"+e,n||(n=i,i=t.Widget),t.expr[":"][s.toLowerCase()]=function(e){return!!t.data(e,s)},t[d]=t[d]||{},o=t[d][e],a=t[d][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new a(t,e)},t.extend(a,o,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(n,function(e,n){return t.isFunction(n)?void(u[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},s=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=s,e=n.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(u[e]=n)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix:e},u,{constructor:a,namespace:d,widgetName:e,widgetFullName:s}),o?(t.each(o._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a)},t.widget.extend=function(i){for(var s,o,a=n.call(arguments,1),r=0,u=a.length;u>r;r++)for(s in a[r])o=a[r][s],a[r].hasOwnProperty(s)&&o!==e&&(t.isPlainObject(o)?i[s]=t.isPlainObject(i[s])?t.widget.extend({},i[s],o):t.widget.extend({},o):i[s]=o);return i},t.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,u=n.call(arguments,1),d=this;return a=!r&&u.length?t.widget.extend.apply(null,[a].concat(u)):a,r?this.each(function(){var n,s=t.data(this,o);return s?t.isFunction(s[a])&&"_"!==a.charAt(0)?(n=s[a].apply(s,u),n!==s&&n!==e?(d=n&&n.jquery?d.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new s(a,this))}),d}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,n){var s,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},s=i.split("."),i=s.shift(),s.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;a<s.length-1;a++)o[s[a]]=o[s[a]]||{},o=o[s[a]];if(i=s.pop(),n===e)return o[i]===e?null:o[i];o[i]=n}else{if(n===e)return this.options[i]===e?null:this.options[i];r[i]=n}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,i,n){var s,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=s=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),t.each(n,function(n,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var u=n.match(/^(\w+)\s*(.*)$/),d=u[1]+o.eventNamespace,h=u[2];h?s.delegate(h,d,r):i.bind(d,r)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" Line truncated
+3 -3
View File
@@ -1,6 +1,6 @@
define("note_info",[],function(){var t=["<table>","<tr><th>"+getMsg("Create Time")+'</th><td id="noteInfoCreatedTime"></td></tr>',"<tr><th>"+getMsg("Update Time")+'</th><td id="noteInfoUpdatedTime"></td></tr>','<tr class="post-url-tr">',"<th>"+getMsg("Post Url")+"</th>","<td>",'<div class="post-url-wrap">','<span class="post-url-base">http://blog.leanote.com/life/post/</span><span><span class="post-url-text">life-life-life-a-leanote</span>','<input type="text" class="form-control">',"</span>",' <a class="post-url-pencil" title="'+getMsg("update")+'"><i class="fa fa-pencil"></i></a>',"</div>","</td>","</tr>","</table>"].join(""),e=$(t),n=e.find("#noteInfoCreatedTime"),o=e.find("#noteInfoUpdatedTime"),i=(e.find("#noteInfoPostUrl"),e.find(".post-url-tr")),r=e.find(".post-url-wrap"),l=e.find("input"),d=e.find(".post-url-base"),s=e.find(".post-url-text"),a={$noteInfo:$("#noteInfo"),note:null,bind:function(){var t=this;$("#noteInfoDropdown").click(function(){t.render()}),e.find(".post-url-pencil").click(function(){r.addClass("post-url-edit"),l.val(decodeURI(t.note.UrlTitle)),l.focus()}),l.keydown(function(t){13===t.keyCode&&l.blur()}),l.blur(function(){r.removeClass("post-url-edit");var e=l.val();e&&ajaxPost("/member/blog/updateBlogUrlTitle",{noteId:t.note.NoteId,urlTitle:e},function(e){if(reIsOk(e)){var n=encodeURI(e.Item);t.note.UrlTitle=n,s.text(decodeURI(t.note.UrlTitle))}else alert(e.Msg||"error")})}),LEA.on("noteChanged",function(e){t.render(e)})},getPostUrl:function(){return""},rendered:!1,render:function(t){var r=this;t||(t=Note.getCurNote()),t&&(r.note=t,n.html(goNowToDatetime(t.CreatedTime)),o.html(goNowToDatetime(t.UpdatedTime)),t.IsBlog?(i.removeClass("hide"),d.text(UserInfo.PostUrl+"/"),s.text(decodeURI(t.UrlTitle))):i.addClass("hide"),r.rendered||(r.$noteInfo.html(e),r.rendered=!0))},init:function(){this.bind()}};a.init()});
define("note_info",[],function(){var t=["<table>","<tr><th>"+getMsg("Create Time")+'</th><td id="noteInfoCreatedTime"></td></tr>',"<tr><th>"+getMsg("Update Time")+'</th><td id="noteInfoUpdatedTime"></td></tr>','<tr class="post-url-tr">',"<th>"+getMsg("Post Url")+"</th>","<td>",'<div class="post-url-wrap">','<span class="post-url-base">http://blog.leanote.com/life/post/</span><span><span class="post-url-text">life-life-life-a-leanote</span>','<input type="text" class="form-control">',"</span>",' <a class="post-url-pencil" title="'+getMsg("update")+'"><i class="fa fa-pencil"></i></a>',"</div>","</td>","</tr>","</table>"].join(""),e=$(t),n=e.find("#noteInfoCreatedTime"),o=e.find("#noteInfoUpdatedTime"),i=(e.find("#noteInfoPostUrl"),e.find(".post-url-tr")),r=e.find(".post-url-wrap"),l=e.find("input"),d=e.find(".post-url-base"),s=e.find(".post-url-text"),a={$noteInfo:$("#noteInfo"),note:null,bind:function(){var t=this;$("#noteInfoDropdown").click(function(){t.render()}),e.find(".post-url-pencil").click(function(){r.addClass("post-url-edit"),l.val(decodeURI(t.note.UrlTitle)),l.focus()}),l.keydown(function(t){13===t.keyCode&&l.blur()}),l.blur(function(){r.removeClass("post-url-edit");var e=l.val();e&&ajaxPost("/member/blog/updateBlogUrlTitle",{noteId:t.note.NoteId,urlTitle:e},function(e){if(reIsOk(e)){var n=encodeURI(e.Item);t.note.UrlTitle=n,s.text(decodeURI(t.note.UrlTitle))}else alert(e.Msg||"error")})}),LEA.on("noteChanged",function(e){t.render(e)})},getPostUrl:function(t){return""},rendered:!1,render:function(t){var r=this;t||(t=Note.getCurNote()),t&&(r.note=t,n.html(goNowToDatetime(t.CreatedTime)),o.html(goNowToDatetime(t.UpdatedTime)),t.IsBlog?(i.removeClass("hide"),d.text(UserInfo.PostUrl+"/"),s.text(decodeURI(t.UrlTitle))):i.addClass("hide"),r.rendered||(r.$noteInfo.html(e),r.rendered=!0))},init:function(){this.bind()}};a.init()});
define("tips",[],function(){var d=['<div class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">','<div class="modal-dialog modal-sm">','<div class="modal-content">','<div class="modal-header">','<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>','<h4 class="modal-title" class="modalTitle">'+getMsg("editorTips")+"</h4>","</div>",'<div class="modal-body">'+getMsg("editorTipsInfo")+"</div>",'<div class="modal-footer">','<button type="button" class="btn btn-default" data-dismiss="modal">'+getMsg("close")+"</button>","</div>","</div>","</div>","</div>"].join(""),a=$(d),i={init:function(){$("#tipsBtn").click(function(){a.modal({show:!0})})}};i.init()});
define("history",[],function(){var t=['<div class="modal fade history-modal" tabindex="-1" role="dialog" aria-hidden="true">','<div class="modal-dialog modal-lg ">','<div class="modal-content">','<div class="modal-header">','<h4 class="modal-title" class="modalTitle">NaN',"</div>",'<div class="modal-body clearfix">','<div class="history-list-wrap pull-left">','<div class="history-list-header">'+getMsg("history")+' (<span class="history-num"></span>)</div>','<div class="history-list list-group"></div>',"</div>",'<div class="history-content-wrap pull-left">','<div class="history-content-header">','<a class="btn btn-primary back">'+getMsg("restoreFromThisVersion")+"</a>",'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>',"</div>",'<div class="history-content"></div>',"</div>","</div>",'<div class="modal-footer hide">','<button type="button" class="btn btn-default" data-dismiss="modal">'+getMsg("close")+"</button>","</div>","</div>","</div>","</div>"].join(""),i=$(t),s=i.find(".history-content"),e=i.find(".history-list"),o=i.find(".history-num"),n={note:null,list:[],curIndex:0,renderContent:function(t){var i=this.list[t].Content;this.curIndex=t;var o="<div>",n="</div>";this.note.IsMarkdown&&(o="<pre>",n="</pre>"),s.html(o+i+n);var a=e.find("a");a.removeClass("active"),a.eq(t).addClass("active")},render:function(t){var s="";if(this.list=t,t)for(var n=0;n<t.length;++n){var a=t[n];s+='<a class="list-group-item" data-index="'+n+'"><span class="badge">#'+(n+1)+"</span>"+goNowToDatetime(a.UpdatedTime)+"</a>"}e.html(s),this.renderContent(0),o.html(t.length),i.modal({show:!0})},bind:function(){var t=this;$("#contentHistory").click(function(){t.getHistories()}),e.on("click","a",function(){var i=$(this).data("index");t.renderContent(i)}),i.find(".back").click(function(){confirm(getMsg("confirmBackup"))&&(Note.curChangedSaveIt(!0),note=Note.cache[Note.curNoteId],setEditorContent(t.list[t.curIndex].Content,note.IsMarkdown),i.modal("hide"),Note.curChangedSaveIt(!0))})},getHistories:function(){var t=this,i=Note.getCurNote();t.note=i,ajaxGet("/noteContentHistory/listHistories",{noteId:Note.curNoteId},function(i){return isArray(i)?void t.render(i):void alert(getMsg("noHistories"))})},init:function(){this.bind()}};n.init()});
var urlPrefix=UrlPrefix;define("attachment_upload",["jquery.ui.widget","fileupload"],function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function t(e,t){var a=$(e);$(t).bind("dragover",function(e){e.preventDefault();var t=window.dropZoneTimeoutAttach;t&&clearTimeout(t);var i=!1,o=e.target;do{if(o===a[0]){i=!0;break}o=o.parentNode}while(null!=o);i?a.addClass("hover"):a.removeClass("hover"),window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null,a.removeClass("in hover")},100)})}t("#dropAttach","#uploadAttach");var a=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var t=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(){return[{name:"noteId",value:Note.curNoteId}]},add:function(a,i){var o=Note.getCurNote();if(!o||o.IsNew)return void alert("This note hasn't saved, please save it firstly!");var n=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');n.append(i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small>"),t.html(n),i.context=t;var r=i.files[0].size,l=+GlobalConfigs.uploadAttachSize||100;if("number"==typeof r&&r>1048576*l)return n.find("img").remove(),n.removeClass("alert-info").addClass("alert-danger"),n.append(" Warning: File size is bigger than "+l+"M"),void setTimeout(function(e){return function(){e.remove()}}(n),3e3);var s;setTimeout(function(){s=i.submit()},10)},done:function(t,a){if(1==a.result.Ok)a.context.html(""),Attach.addAttach(a.result.Item);else{{a.result}a.context.html("");var i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.result.Msg),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(t,a){a.context.html("");var i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.errorThrown),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3),$("#uploadAttachMsg").scrollTop(1e3)}})};a()});
var urlPrefix=UrlPrefix;define("editor_drop_paste",["jquery.ui.widget","fileupload"],function(){function e(e){var i="__mcenew"+(new Date).getTime(),t='<div contenteditable="false" id="'+i+'" class="leanote-image-container"><img class="loader" src="/images/ajax-loader.gif"><div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">0%</div></div></div>';this.containerStr=t,e.insertContent(t);var o=$("#"+i);this.container=o,this.id=i,this.processBar=o.find(".progress-bar")}function i(e,i){function t(e,t){o.parentNode.removeChild(o),i({width:e,height:t})}var o=document.createElement("img");o.onload=function(){t(o.clientWidth,o.clientHeight)},o.onerror=function(){t()},o.src=e;var a=o.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(o)}function t(e){var t=tinymce.activeEditor,a=t.dom,r=function(t){function r(){a.setAttrib(n,"src",t.src),t.title&&a.setAttrib(n,"title",t.title),a.setAttrib(n,"id",null)}var n,s={};s.id="__mcenew"+o++,s.src="http://leanote.com/images/loading-24.gif",n=a.createHTML("img",s),tinymce.activeEditor.insertContent(n),n=a.get(s.id),i(e.src,r)},n="";if(fileIds=e.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(n=fileIds[1]),n){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(e){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:n,toUserId:s.UserId},function(i){if(reIsOk(i)&&i.Id){var t=window.location.protocol+"//"+window.location.host;e.src=t+"/file/outputImage?fileId="+i.Id}r(e)})}(e):r(e)}else r(e)}e.prototype.update=function(e){var i=this;e=Math.ceil(100*e),e>=100&&(e=99),e+="%",$("#"+i.id+" .progress-bar").html(e).css("width",e)},e.prototype.replace=function(e){var t=this;i(e,function(){$("#"+t.id).replaceWith('<img src="'+e+'" />')})},e.prototype.remove=function(){var e=this;$("#"+e.id).remove()};var o=1,a=function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function i(){$("#upload").css("z-index",12);var e=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",e-8),$("#upload").show()}function o(){$("#upload").css("z-index",0).css("top","auto").hide()}var a=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(){return[{name:"albumId",value:""}]},add:function(i,t){var o=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append(t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small>"),t.context=o.appendTo(a);t.submit()},done:function(i,o){if(1==o.result.Ok){o.context.remove();var a={src:urlPrefix+"/file/outputImage?fileId="+o.result.Id};t(a)}else{o.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>Error:</b> "+o.files[0].name+" <small>[<i>"+e(o.files[0].size)+"</i>]</small> "+o.result.Msg),o.context.append(r),setTimeout(function(e){return function(){e.remove()}}(r),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(i,t){t.context.empty();var o=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append("<b>Error:</b> "+t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small> "+t.errorThrown),t.context.append(o),setTimeout(function(e){return function(){e.remove()}}(o),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(e){e.preventDefault()}),$(document).bind("dragover",function(e){var t=$("#drop"),a=window.dropZoneTimeout;a?clearTimeout(a):(t.addClass("in"),i());var r=!1,n=e.target;do{if(n===t[0]){r=!0;break}n=n.parentNode}while(null!=n);r?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover"),o()},100)})},r=0,n=function(){var i,t;$("#editorContent, #wmd-input .editor-content").fileupload({dataType:"json",pasteZone:$("#editorContent, #wmd-input .editor-content"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(e,t){i&&!i.IsMarkdown&&t.process.update(t.loaded/t.total)},add:function(o,a){var n=(new Date).getTime();if(console.log(n-r),!(500>n-r)){r=n;var s=Note.getCurNote();if(i=s,!s||s.IsNew)return void alert("This note hasn't saved, please save it firstly!");if(t=tinymce.EditorManager.activeEditor,!s.IsMarkdown)var l=new e(t);a.process=l;{a.submit()}}},done:function(e,t){if(1==t.result.Ok){varLine truncated
var urlPrefix=UrlPrefix;define("attachment_upload",["jquery.ui.widget","fileupload"],function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function t(e,t){var a=$(e);$(t).bind("dragover",function(e){e.preventDefault();var t=window.dropZoneTimeoutAttach;t&&clearTimeout(t);var i=!1,o=e.target;do{if(o===a[0]){i=!0;break}o=o.parentNode}while(null!=o);i?a.addClass("hover"):a.removeClass("hover"),window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null,a.removeClass("in hover")},100)})}t("#dropAttach","#uploadAttach");var a=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var t=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(e){return[{name:"noteId",value:Note.curNoteId}]},add:function(a,i){var o=Note.getCurNote();if(!o||o.IsNew)return void alert("This note hasn't saved, please save it firstly!");var n=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');n.append(i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small>"),t.html(n),i.context=t;var r=i.files[0].size,l=+GlobalConfigs.uploadAttachSize||100;if("number"==typeof r&&r>1048576*l)return n.find("img").remove(),n.removeClass("alert-info").addClass("alert-danger"),n.append(" Warning: File size is bigger than "+l+"M"),void setTimeout(function(e){return function(){e.remove()}}(n),3e3);var s;setTimeout(function(){s=i.submit()},10)},done:function(t,a){if(1==a.result.Ok)a.context.html(""),Attach.addAttach(a.result.Item);else{a.result;a.context.html("");var i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.result.Msg),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(t,a){a.context.html("");var i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.errorThrown),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3),$("#uploadAttachMsg").scrollTop(1e3)}})};a()});
var urlPrefix=UrlPrefix;define("editor_drop_paste",["jquery.ui.widget","fileupload"],function(){function e(e){var i="__mcenew"+(new Date).getTime(),t='<div contenteditable="false" id="'+i+'" class="leanote-image-container"><img class="loader" src="/images/ajax-loader.gif"><div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">0%</div></div></div>';this.containerStr=t,e.insertContent(t);var o=$("#"+i);this.container=o,this.id=i,this.processBar=o.find(".progress-bar")}function i(e,i){function t(e,t){o.parentNode.removeChild(o),i({width:e,height:t})}var o=document.createElement("img");o.onload=function(){t(o.clientWidth,o.clientHeight)},o.onerror=function(){t()},o.src=e;var a=o.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(o)}function t(e){var t=tinymce.activeEditor,a=t.dom,r=function(t){function r(e){a.setAttrib(n,"src",t.src),t.title&&a.setAttrib(n,"title",t.title),a.setAttrib(n,"id",null)}var n,s={};s.id="__mcenew"+o++,s.src="http://leanote.com/images/loading-24.gif",n=a.createHTML("img",s),tinymce.activeEditor.insertContent(n),n=a.get(s.id),i(e.src,r)},n="";if(fileIds=e.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(n=fileIds[1]),n){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(e){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:n,toUserId:s.UserId},function(i){if(reIsOk(i)&&i.Id){var t=window.location.protocol+"//"+window.location.host;e.src=t+"/file/outputImage?fileId="+i.Id}r(e)})}(e):r(e)}else r(e)}e.prototype.update=function(e){var i=this;e=Math.ceil(100*e),e>=100&&(e=99),e+="%",$("#"+i.id+" .progress-bar").html(e).css("width",e)},e.prototype.replace=function(e){var t=this;i(e,function(){$("#"+t.id).replaceWith('<img src="'+e+'" />')})},e.prototype.remove=function(){var e=this;$("#"+e.id).remove()};var o=1,a=function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function i(){$("#upload").css("z-index",12);var e=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",e-8),$("#upload").show()}function o(){$("#upload").css("z-index",0).css("top","auto").hide()}var a=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(e){return[{name:"albumId",value:""}]},add:function(i,t){var o=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append(t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small>"),t.context=o.appendTo(a);t.submit()},done:function(i,o){if(1==o.result.Ok){o.context.remove();var a={src:urlPrefix+"/file/outputImage?fileId="+o.result.Id};t(a)}else{o.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>Error:</b> "+o.files[0].name+" <small>[<i>"+e(o.files[0].size)+"</i>]</small> "+o.result.Msg),o.context.append(r),setTimeout(function(e){return function(){e.remove()}}(r),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(i,t){t.context.empty();var o=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append("<b>Error:</b> "+t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small> "+t.errorThrown),t.context.append(o),setTimeout(function(e){return function(){e.remove()}}(o),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(e){e.preventDefault()}),$(document).bind("dragover",function(e){var t=$("#drop"),a=window.dropZoneTimeout;a?clearTimeout(a):(t.addClass("in"),i());var r=!1,n=e.target;do{if(n===t[0]){r=!0;break}n=n.parentNode}while(null!=n);r?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover"),o()},100)})},r=0,n=function(){var i,t;$("#editorContent, #wmd-input .editor-content").fileupload({dataType:"json",pasteZone:$("#editorContent, #wmd-input .editor-content"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(e){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(e,t){i&&!i.IsMarkdown&&t.process.update(t.loaded/t.total)},add:function(o,a){var n=(new Date).getTime();if(console.log(n-r),!(500>n-r)){r=n;var s=Note.getCurNote();if(i=s,!s||s.IsNew)return void alert("This note hasn't saved, please save it firstly!");if(t=tinymce.EditorManager.activeEditor,!s.IsMarkdown)var l=new e(t);a.process=l;a.submit()}},done:function(e,t){if(1==t.result.Ok){vaLine truncated
requirejs.config({paths:{editor_drop_paste:"js/plugins/editor_drop_paste",attachment_upload:"js/plugins/attachment_upload","jquery.ui.widget":"js/plugins/libs-min/jquery.ui.widget",fileupload:"js/plugins/libs-min/jquery.fileupload","iframe-transport":"js/plugins/libs-min/jquery.iframe-transport",note_info:"js/plugins/note_info",tips:"js/plugins/tips",history:"js/plugins/history"},shim:{fileupload:{deps:["jquery.ui.widget","iframe-transport"]}}}),setTimeout(function(){require(["editor_drop_paste","attachment_upload"]),require(["note_info"]),setTimeout(function(){require(["tips"]),require(["history"])},10)});