diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js
index 91e04ce80..612a5a44b 100644
--- a/public/javascripts/educoder/edu_application.js
+++ b/public/javascripts/educoder/edu_application.js
@@ -1,1288 +1,1288 @@
-document.write("");
-
-/*!
- * JavaScript Cookie v2.2.0
- * https://github.com/js-cookie/js-cookie
- *
- * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
- * Released under the MIT license
- */
-!function(e) {
- var n;
- if ("function" == typeof define && define.amd && (define(e),
- n = !0),
- "object" == typeof exports && (module.exports = e(),
- n = !0),
- !n) {
- var t = window.Cookies
- , o = window.Cookies = e();
- o.noConflict = function() {
- return window.Cookies = t,
- o
- }
- }
-}(function() {
- function e() {
- for (var e = 0, n = {}; e < arguments.length; e++) {
- var t = arguments[e];
- for (var o in t)
- n[o] = t[o]
- }
- return n
- }
- function n(e) {
- return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
- }
- return function t(o) {
- function r() {}
- function i(n, t, i) {
- if ("undefined" != typeof document) {
- "number" == typeof (i = e({
- path: "/"
- }, r.defaults, i)).expires && (i.expires = new Date(1 * new Date + 864e5 * i.expires)),
- i.expires = i.expires ? i.expires.toUTCString() : "";
- try {
- var c = JSON.stringify(t);
- /^[\{\[]/.test(c) && (t = c)
- } catch (e) {}
- t = o.write ? o.write(t, n) : encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent),
- n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
- var f = "";
- for (var u in i)
- i[u] && (f += "; " + u,
- !0 !== i[u] && (f += "=" + i[u].split(";")[0]));
- return document.cookie = n + "=" + t + f
- }
- }
- function c(e, t) {
- if ("undefined" != typeof document) {
- for (var r = {}, i = document.cookie ? document.cookie.split("; ") : [], c = 0; c < i.length; c++) {
- var f = i[c].split("=")
- , u = f.slice(1).join("=");
- t || '"' !== u.charAt(0) || (u = u.slice(1, -1));
- try {
- var a = n(f[0]);
- if (u = (o.read || o)(u, a) || n(u),
- t)
- try {
- u = JSON.parse(u)
- } catch (e) {}
- if (r[a] = u,
- e === a)
- break
- } catch (e) {}
- }
- return e ? r[e] : r
- }
- }
- return r.set = i,
- r.get = function(e) {
- return c(e, !1)
- }
- ,
- r.getJSON = function(e) {
- return c(e, !0)
- }
- ,
- r.remove = function(n, t) {
- i(n, "", e(t, {
- expires: -1
- }))
- }
- ,
- r.defaults = {},
- r.withConverter = t,
- r
- }(function() {})
-});
-
-$(function() {
- var result = location.search.match(/\?search=(\w*)&?/i)
- if (result && result[1]) {
- var searchText = result[1]
- $('#search-input').val(searchText)
- }
- // 未报名用户登录时弹框
- // console.log(Cookies.get('enroll_status'));
- // if(Cookies.get('enroll_status') == 0){
- // Cookies.remove('enroll_status');
- // var html='
'+
- // '
'+
- // '
'+
- // '
'+
- // '
立即报名'+
- // '
';
- // $(".newContainer").append(html);
- // }
-});
-
-function CloseBox() {
- $(".CompetitionEnrollBox").remove();
-}
-
-//根据页面大小决定侧边栏的位置
-$(window).resize(function() {
- rightSlider();
-});
-function rightSlider() {
- var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 60;
- // console.log(parseInt($(window).width())+" "+poi);
- if (poi > 0) {
- $(".-task-sidebar").css("right", poi);
- } else {
- $(".-task-sidebar").css("right", "0px");
- }
- $(".-task-sidebar").show();
-}
-function open_course(id, allowVisit) {
- if (allowVisit) {
- window.open("/courses/" + id);
- }
-}
-function open_project(id, allowVisit) {
- if (allowVisit) {
- window.open("/projects/" + id);
- }
-}
-
-function conver_size(limit) {
- var size = "";
- if (limit < 1024) {
- //如果小于1KB转化成B
- size = limit.toFixed(2) + "B";
- } else if (limit < 1024 * 1024) {
- //如果小于1MB转化成KB
- size = (limit / 1024).toFixed(2) + "KB";
- } else if (limit < 1024 * 1024 * 1024) {
- //如果小于1GB转化成MB
- size = (limit / (1024 * 1024)).toFixed(2) + "MB";
- } else {
- //其他转化成GB
- size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB";
- }
-
- var sizestr = size + "";
- var len = sizestr.indexOf("\.");
- var dec = sizestr.substr(len + 1, 2);
- if (dec == "00") {
- //当小数点后为00时 去掉小数部分
- return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
- }
- return sizestr;
-}
-
-function _initSider() {
- var $descSide = $("").appendTo("body");
- $(".-task-sidebar>div").hover(function() {
- //移入显示二维码
- if ($(this).hasClass("scan")) {
- $(".scan_ewm").show().css({
- right: "75px",
- opacity: 0
- }).stop().animate({
- right: "45px",
- opacity: 1
- })
- return;
- }
- var $tool = $(this).attr("tooltips");
- $descSide.html($tool + "");
- $descSide.data('_dom', this)
- $descSide.show().css({
- left: $(this).offset().left - $descSide.width() - 30,
- opacity: 0,
- top: $(this).offset().top
- }).stop().animate({
- left: $(this).offset().left - $descSide.width() - 5,
- opacity: 1
- }, 400);
- }, function() {
- if ($(this).hasClass("scan")) {
- $(".scan_ewm").stop().animate({
- right: "75px",
- opacity: 0
- }, 200).hide();
- }
- $descSide.stop().animate({
- left: $(this).offset().left - $descSide.width() - 30,
- opacity: 0
- }, 200).hide();
- });
- rightSlider();
-
- $(window).scroll(function() {
- if ($descSide.height()) {
- var hoverIcon = $descSide.data('_dom')
- $descSide.css('top', $(hoverIcon).offset().top)
- }
- })
-}
-$(function() {
- loadHeader();
- _initSider();
-
- $(window).scroll(function() {
- if ($(".gotop").length > 0) {
- if ($(document).scrollTop() > 0) {
- $(".-task-sidebar .gotop").show();
- $(".gotop").click(function() {
- $("html,body").scrollTop(0);
- });
- }
- if ($(document).scrollTop() == 0) {
- $(".-task-sidebar .gotop").hide();
- }
- }
- });
-
- // 翻页的GO
- $(".page_GO").live("keydown", function(event) {
- var code;
- if (!event) {
- event = window.event;
- //针对ie浏览器
- code = event.keyCode;
- } else {
- code = event.keyCode;
- }
- if (code == 13) {
- var prev = $(this).prev().find("a").html().trim();
- var page = $(this).val().trim();
- if (parseInt(prev) >= parseInt(page)) {
- if (typeof ($(this).prev().children("a").attr("href")) == "undefined") {
- var href = $(this).parent().find("li:first-child").children("a").attr("href");
- } else {
- var href = $(this).prev().children("a").attr("href");
- }
- var new_href = href.replace(/page=(\d*)/, 'page=' + page);
- console.log(new_href);
- $.get(new_href);
- return false;
- }
- }
- });
-
- // 试用申请弹框
- $("#apply_trail_submit_btn").live('click', function() {
- if ($("#apply_reason").val().trim() == "") {
- $("#hint_message").show();
- } else {
- $("#hint_message").hide();
- $("#apply_trail_form").submit();
- hideModal();
- }
- });
-
-});
-
-// editor 存在了jquery对象上,应用不需要自己写md_rec_data方法了
-function md_rec_data(k, mdu, id) {
- if (window.sessionStorage.getItem(k + mdu) !== null) {
- editor = $("#e_tips_" + id).data('editor');
- editor.setValue(window.sessionStorage.getItem(k + mdu));
-
- md_clear_data(k, mdu, id);
- }
-}
-// markdown的自动保存
-function md_elocalStorage(editor, mdu, id) {
- if (window.sessionStorage) {
- var oc = window.sessionStorage.getItem('content' + mdu);
- if (oc !== null) {
- $("#e_tips_" + id).data('editor', editor);
- var h = '您上次有已保存的数据,是否恢复 ? / 不恢复';
- $("#e_tips_" + id).html(h);
- }
- setInterval(function() {
- d = new Date();
- var h = d.getHours();
- var m = d.getMinutes();
- var s = d.getSeconds();
- h = h < 10 ? '0' + h : h;
- m = m < 10 ? '0' + m : m;
- s = s < 10 ? '0' + s : s;
- if (editor.getValue().trim() != "") {
- md_add_data("content", mdu, editor.getValue());
- var id1 = "#e_tip_" + id;
- var id2 = "#e_tips_" + id;
- $(id1).html(" 数据已于 " + h + ':' + m + ':' + s + " 保存 ");
- $(id2).html("");
- }
- }, 10000);
-
- } else {
- $("#e_tip_" + id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!');
- }
-}
-// 保存数据
-function md_add_data(k, mdu, d) {
- window.sessionStorage.setItem(k + mdu, d);
-}
-// 恢复数据
-//function md_rec_data(k,mdu,id, editor){
-// if(window.sessionStorage.getItem(k+mdu) !== null){
-// editor.setValue(window.sessionStorage.getItem(k+mdu));
-// md_clear_data(k,mdu,id);
-// }
-//}
-// 清空保存的数据
-function md_clear_data(k, mdu, id) {
- window.sessionStorage.removeItem(k + mdu);
- var id1 = "#e_tip_" + id;
- var id2 = "#e_tips_" + id;
- if (k == 'content') {
- $(id2).html("");
- } else {
- $(id1).html("");
- }
-}
-
-// editorMD to create
-/**
- *
- * @param id 渲染DOM的id
- * @param width 宽度
- * @param high 高度
- * @param placeholder
- * @param imageUrl 上传图片的url
- * @returns {*} 返回一个editorMD实例
- */
-function create_editorMD(id, width, high, placeholder, imageUrl, readonly) {
- var readonly = readonly == undefined ? false : readonly;
- var editorName = editormd(id, {
- width: width,
- height: high,
- syncScrolling: "single",
- //你的lib目录的路径,我这边用JSP做测试的
- path: "/editormd/lib/",
- tex: true,
- tocm: true,
- emoji: true,
- taskList: true,
- codeFold: true,
- searchReplace: true,
- htmlDecode: "style,script,iframe",
- sequenceDiagram: true,
- autoFocus: false,
- readonly: readonly,
- toolbarIcons: function() {
- // Or return editormd.toolbarModes[name]; // full, simple, mini
- // Using "||" set icons align right.
- return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
- },
- toolbarCustomIcons: {
- testIcon: "",
- testIcon1: ""
- },
- //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
- saveHTMLToTextarea: true,
- // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
- dialogMaskOpacity: 0.6,
- placeholder: placeholder,
- imageUpload: true,
- imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
- imageUploadURL: imageUrl,
- //url
- onload: function(cMirror) {
- $("#" + id + " [type=\"latex\"]").bind("click", function() {
- editorName.cm.replaceSelection("```latex");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("```");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line - 1, 0);
- });
-
- $("#" + id + " [type=\"inline\"]").bind("click", function() {
- editorName.cm.replaceSelection("$$$$");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
- editorName.cm.focus();
- });
- $("[type=\"inline\"]").attr("title", "行内公式");
- $("[type=\"latex\"]").attr("title", "多行公式");
- setTimeout(function() {
- editorName.resize();
- editorName.cm.refresh();
- window.new_md = editorName;
- }, 300);
- }
- });
- return editorName;
-}
-
-// editormd to html
-/**
- *
- * @param id 渲染的id
- * @param callback onload回調 暫時未用
- */
-function editormd_to_html(id, callback) {
- editormd.loadKaTeX(function() {
- editormd.markdownToHTML(id, {
- htmlDecode: "style,script,iframe",
- // you can filter tags decode
- onload: function() {
- callback && callback()
- },
- taskList: true,
- tex: true,
- // 默认不解析
- flowChart: true,
- // 默认不解析
- sequenceDiagram: true// 默认不解析
- });
- });
-}
-
-function loadHeader() {
- //头部导航条的----------显示搜索框
- $("#search-open").on("click", function(e) {
- $(this).hide();
- // $("#header-nav").animate({opacity:"0"},1000);
- $(".posi-search").show()
- // .animate({opacity:"1"},1000);
- $("#header-nav").css("z-index", "2");
- $(".posi-search").css("z-index", "3");
- // $(".search-input").val(""); // 不清空
- $(".search-input").focus();
- $(".search-all .search-content").hide();
- e.stopPropagation();
- //阻止冒泡
- });
- $(".search-input").on("click", function(e) {
- e.stopPropagation();
- //阻止冒泡
- });
- //搜索框输入内容
- $(".search-input").on("input", function(e) {
- if ($(".search-input").val() == "") {
- $(".search-all .search-content").hide();
- } else {
- $(".search-all .search-content").show();
- }
- e.stopPropagation();
- //阻止冒泡
- });
- //搜索
- $("#header_keyword_search").on("click", header_search);
- $("input[name='search_keyword']").on("keydown", function(event) {
- var code;
- if (!event) {
- event = window.event;
- //针对ie浏览器
- code = event.keyCode;
- } else {
- code = event.keyCode;
- }
- if (code == 13) {
- header_search();
- return false;
- }
- });
- $(".search-clear").click(function(e) {
- e.stopPropagation();
- });
- //切换搜索条件
- $("#searchkey li").click(function(e) {
- var key = $($(this).children("a")[0]).html();
- switch (key) {
- case '实训':
- $("#search_type").val('1');
- break;
- case '课堂':
- $("#search_type").val('2');
- break;
- case '用户':
- $("#search_type").val('3');
- break;
- }
- $("#searchkey").siblings(".searchkey").html(key);
- // $("#searchkey").hide();
- e.stopPropagation();
- //阻止冒泡
- });
- //切换选择导航条
- $("#header-nav li").click(function() {
- $("#header-nav li").removeClass("active");
- $(this).addClass("active");
- });
- //点击页面其它(与搜索框无关的地方)都会将搜索框隐藏,所以与搜索框有关的地方需要阻止冒泡
- $("body").on("click", function() {
- closeSearch();
- });
-
- $(".search_history").on("click", function() {
- $("input[name='search_keyword']").val($(this).html());
- header_search();
- });
-}
-
-function header_search() {
- var keyword = $("input[name='search_keyword']").val();
- // 搜索关键字
- var index = $("#search_type").val();
- // 搜索课程/项目
- keyword = encodeURIComponent(keyword);
- // $.get('/users/search_shixuns_or_course',
- // { search: keyword,
- // index: index});
- window.location.href = "/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
- //e.stopPropagation();//阻止冒泡
-}
-
-//头部导航条的隐藏
-function closeSearch() {
- $('#posi-search').hide();
- $("#search-open").show();
- // $(".posi-search").animate({opacity:"0"},800);
- $("#header-nav").animate({
- opacity: "1"
- }, 1000);
- $(".posi-search").css("z-index", "2");
- $("#header-nav").css("z-index", "3");
-}
-(function($) {
- $.fn.drag = function(options) {
- var x, drag = this, isMove = false, defaults = {};
- var options = $.extend(defaults, options);
- //添加背景,文字,滑块
- var html = '' + '请拖住滑块,拖动到最右边
' + '';
- this.append(html);
-
- var handler = drag.find('.handler');
- var drag_bg = drag.find('.drag_bg');
- var text = drag.find('.drag_text');
- var maxWidth = text.width() - handler.width();
- //能滑动的最大间距
- //鼠标按下时候的x轴的位置
- handler.mousedown(function(e) {
- isMove = true;
- x = e.pageX - parseInt(handler.css('left'), 10);
- });
-
- //鼠标指针在上下文移动时,移动距离大于0小于最大间距,滑块x轴位置等于鼠标移动距离
- $(document).mousemove(function(e) {
- var _x = e.pageX - x;
- var handler_offset = handler.offset();
- var lastX = e.clientX - x;
- lastX = Math.max(0, Math.min(maxWidth, lastX));
- if (isMove) {
- if (_x > 0 && _x <= maxWidth) {
- handler.css({
- 'left': lastX
- });
- drag_bg.css({
- 'width': lastX
- });
- } else if (lastX > maxWidth - 5 && lastX < maxWidth + 5) {
- //鼠标指针移动距离达到最大时清空事件
- dragOk();
- }
- }
- });
- handler.mouseup(function(e) {
- isMove = false;
- var _x = e.pageX - x;
- if (_x < maxWidth) {
- //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
- handler.css({
- 'left': 0
- });
- drag_bg.css({
- 'width': 0
- });
- }
- });
-
- //清空事件
- function dragOk() {
- var kuaiwidth = drag.width() - handler.width();
- handler.removeClass('handler_bg').addClass('handler_ok_bg');
- handler.css({
- 'left': kuaiwidth + 'px'
- })
- text.css({
- 'width': kuaiwidth + 'px'
- });
- text.text('验证通过');
- drag.css({
- 'color': '#fff'
- });
- drag_bg.css({
- 'width': kuaiwidth + 'px'
- })
- handler.unbind('mousedown');
- $(document).unbind('mousemove');
- $(document).unbind('mouseup');
- handler.parent().next().find("p").html("").hide();
- }
- }
- ;
-}
-)(jQuery);
-
-//判断是手机端还是电脑端
-function IsPC() {
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- var flag = true;
- for (var v = 0; v < Agents.length; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
-}
-
-//Dom:绑定事件的节点对象,ChangeDOM:操作的相关节点,
-function LeaveTitle(Dom, ChangeDom) {
- ChangeDom.html("").hide();
- ChangeDom.parent().css({
- opacity: 0,
- left: 0,
- top: 0
- }).hide();
-}
-
-$(function() {
- //平台tip的样式优化js
- var $desc = $("" + "
" + "
" + "
" + "
" + "
").appendTo("body");
- //Dom:绑定事件的节点对象,ChangeDOM:操作的相关节点,
- function LeaveTitle(Dom, ChangeDom) {
- Dom.live("mouseleave", function() {
- ChangeDom.html("").hide();
- $desc.css({
- opacity: 0,
- left: 0,
- top: 0
- }).hide();
- })
- }
- LeaveTitle($("[data-tip-top]"), $(".data-tip-top"));
- LeaveTitle($("[data-tip-down]"), $(".data-tip-down"));
- LeaveTitle($("[data-tip-right]"), $(".data-tip-left"));
- LeaveTitle($("[data-tip-left]"), $(".data-tip-right"));
- $("[data-tip-top]").live("mouseenter", function() {
- var $tool = $(this).attr("data-tip-top");
- if ($tool != "") {
- $(".data-tip-top").show().html($tool);
- $desc.show().css({
- left: $(this).offset().left - ($desc.width() - $(this).outerWidth()) / 2,
- opacity: 1,
- top: $(this).offset().top - 30
- });
- }
- });
- $("[data-tip-down]").live("mouseenter", function() {
- var $tool = $(this).attr("data-tip-down");
- if ($tool != "") {
- $(".data-tip-down").show().html($tool);
- $desc.show().css({
- left: $(this).offset().left - ($desc.width() - $(this).outerWidth()) / 2,
- opacity: 1,
- top: $(this).offset().top + $(this).height() + 6
- });
- }
- });
- $("[data-tip-right]").live("mouseenter", function() {
- var $tool = $(this).attr("data-tip-right");
- if ($tool != "") {
- console.log($(this).offset().left + " " + $(this).width());
- $(".data-tip-left").show().html($tool);
- $desc.show().css({
- left: $(this).offset().left + $(this).outerWidth() + 6,
- opacity: 1,
- top: $(this).offset().top - ($desc.height() - $(this).height()) / 2
- });
- }
- });
- $("[data-tip-left]").live("mouseenter", function() {
- var $tool = $(this).attr("data-tip-left");
- if ($tool != "") {
- $(".data-tip-right").show().html($tool);
- $desc.show().css({
- left: $(this).offset().left - $desc.width() - 6,
- opacity: 1,
- top: $(this).offset().top - ($desc.height() - $(this).height()) / 2
- });
- }
- });
- unitDownOption();
-});
-
-function unitDownOption() {
- //下拉框
- $("[select-for]").append("");
- $("[select-for]").hover(function() {
- $(this).find(".down-select").show();
- }, function() {
- $(this).find(".down-select").hide();
- })
- $("[select-for] .down-select p").bind("click", function() {
- //alert($(this).attr("data-shixun-value"));
- if ($(this).attr("id") == "diy_script") {
- return;
- // 实训新建-选择自定义脚本diy
- }
- $(this).parents(".down-select").siblings("input[type=hidden]").attr("value", $(this).attr("data-shixun-value"));
-
- $(this).parents(".down-select").siblings("input[type=text]").val($(this).html().trim());
- $(this).parents(".down-select").hide();
- })
-}
-
-//初始化省份
-function showprovince(id) {
- var arrary = ["北京", "上海", "广东", "江苏", "浙江", "重庆", "安徽", "福建", "甘肃", "广西", "贵州", "海南", "河北", "黑龙江", "河南", "湖北", "湖南", "江西", "吉林", "辽宁", "内蒙古", "宁夏", "青海", "山东", "山西", "陕西", "四川", "天津", "新疆", "西藏", "云南", "香港特别行政区", "澳门特别行政区", "台湾", "海外"];
- var html = ""
- for (var i = 0; i < arrary.length; i++) {
- var item = arrary[i];
- html += "";
- }
- $("#" + id).html(html);
-}
-
-//省市下拉框
-function showcity(province, cityField) {
- switch (province) {
- case "北京":
- var cityOptions = new Array("东城","西城","朝阳","丰台","石景山","海淀","门头沟","房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆");
- break;
- case "上海":
- var cityOptions = new Array("崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行","宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤");
- break;
- case "广东":
- var cityOptions = new Array("广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名","梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆");
- break;
- case "江苏":
- var cityOptions = new Array("南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通","启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城","扬州","宜兴","仪征","张家港","镇江","周庄");
- break;
- case "重庆":
- var cityOptions = new Array("万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛","双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山","梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪","石柱","秀山","酉阳","彭水","江津","合川","永川","南川");
- break;
- case "安徽":
- var cityOptions = new Array("合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南","黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城");
- break;
- case "福建":
- var cityOptions = new Array("福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
- break;
- case "甘肃":
- var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","武都","武威","西峰","张掖");
- break;
- case "广西":
- var cityOptions = new Array("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
- break;
- case "贵州":
- var cityOptions = new Array("贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义");
- break;
- case "海南":
- var cityOptions = new Array("海口","儋县","陵水","琼海","三亚","通什","万宁");
- break;
- case "河北":
- var cityOptions = new Array("石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛","唐山","新城","邢台","张家口");
- break;
- case "黑龙江":
- var cityOptions = new Array("哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔","七台河","双鸭山","绥化","伊春");
- break;
- case "河南":
- var cityOptions = new Array("郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山","濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店");
- break;
- case "香港":
- var cityOptions = new Array("香港","九龙","新界");
- break;
- case "湖北":
- var cityOptions = new Array("武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴","仙桃","咸宁","襄阳","襄樊","孝感","宜昌");
- break;
- case "湖南":
- var cityOptions = new Array("长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳","永州","张家界","株洲");
- break;
- case "江西":
- var cityOptions = new Array("南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡","上饶","新余","宜春","鹰潭");
- break;
- case "吉林":
- var cityOptions = new Array("长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉");
- break;
- case "辽宁":
- var cityOptions = new Array("沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州","辽阳","盘锦","铁岭","营口");
- break;
- case "澳门":
- var cityOptions = new Array("澳门");
- break;
- case "内蒙古":
- var cityOptions = new Array("呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海","乌兰浩特","锡林浩特");
- break;
- case "宁夏":
- var cityOptions = new Array("银川","固源","石嘴山","吴忠");
- break;
- case "青海":
- var cityOptions = new Array("西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树");
- break;
- case "山东":
- var cityOptions = new Array("济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂","蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博");
- break;
- case "山西":
- var cityOptions = new Array("太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州","阳泉","榆次","运城");
- break;
- case "陕西":
- var cityOptions = new Array("西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林");
- break;
- case "四川":
- var cityOptions = new Array("成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟","康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁","汶川","西昌","雅安","宜宾","自贡","资阳");
- break;
- case "台湾":
- var cityOptions = new Array("台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗","嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖");
- break;
- case "天津":
- var cityOptions = new Array("天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢","塘沽","汉沽","大港","宁河","静海","宝坻","蓟县");
- break;
- case "新疆":
- var cityOptions = new Array("乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什","克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁");
- break;
- case "西藏":
- var cityOptions = new Array("拉萨","阿里","昌都","林芝","那曲","日喀则","山南");
- break;
- case "云南":
- var cityOptions = new Array("昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江","六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通");
- break;
- case "浙江":
- var cityOptions = new Array("杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安","临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州","台州","温岭","温州","余姚","舟山");
- break;
- case "海外":
- var cityOptions = new Array("美国","日本","英国","法国","德国","其他");
- break;
- default:
- var cityOptions = new Array("请选择所在城市");
- break;
- }
-
- cityField.options.length = 0;
- for (var i = 0; i < cityOptions.length; i++) {
- cityField.options[i] = new Option(cityOptions[i],cityOptions[i]);
- /*
- if (cityField.options[i].value==city)
- {
- //alert("here put City ok!");
- document.oblogform["city"].selectedIndex = i;
- }*/
- }
-}
-
-/*弹框*/
-// 公共弹框样式
-// 建议左右栏的:Width:460,Height:190
-// 建议宽屏对应值:Width:760,Height:500
-function pop_box_new(value, Width, Height, close) {
-
- if ($("#popupAll").length > 0) {
- $("#popupAll").remove();
- }
- w = ($(window).width() - Width) / 2;
- h = ($(window).height() - Height) / 2;
- var html = "";
- if (close) {
- value = "" + value;
- }
- $(document.body).append(html);
- $("#popupWrap").html(value);
- $('#popupWrap').css({
- "top": h + "px",
- "left": w + "px",
- "padding": "0",
- "border": "none",
- "position": "fixed",
- "z-index": "99999",
- "background-color": "#fff",
- "border-radius": "10px"
- });
- if (close) {
- $('#closeIcon').css({
- "top": "-26px",
- "left": Width + "px",
- "z-index": "100000"
- });
- }
-
- $("#popupWrap").parent().parent().show();
- $('#popupAll').find("#closeIcon").click(function() {
- $("#popupAll").hide();
- });
- $('#popupAll').find("a[class*='pop_close']").click(function() {
- $("#popupAll").hide();
- });
- // w = ($(window).width() - Width)/2;
- // h = ($(window).height() - Height)/2;
- // $("#ajax-modal").html(value);
- // showModal('ajax-modal', Width + 'px');
- // $('#ajax-modal').siblings().remove();
- // $('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
- // $('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
- // $('#ajax-modal').css({"padding":"0","overflow":"hidden"});
- // $('#ajax-modal').parent().attr("id","popupWrap");
-
- //拖拽
- function Drag(id) {
- this.div = document.getElementById(id);
- if (this.div) {
- this.div.style.cursor = "move";
- this.div.style.position = "fixed";
- }
- this.disX = 0;
- this.disY = 0;
- var _this = this;
- this.div.onmousedown = function(evt) {
- _this.getDistance(evt);
- document.onmousemove = function(evt) {
- _this.setPosition(evt);
- }
- ;
- _this.div.onmouseup = function() {
- _this.clearEvent();
- }
- }
- }
- Drag.prototype.getDistance = function(evt) {
- var oEvent = evt || event;
- this.disX = oEvent.clientX - this.div.offsetLeft;
- this.disY = oEvent.clientY - this.div.offsetTop;
- }
- ;
- Drag.prototype.setPosition = function(evt) {
- var oEvent = evt || event;
- var l = oEvent.clientX - this.disX;
- var t = oEvent.clientY - this.disY;
- if (l <= 0) {
- l = 0;
- } else if (l >= document.documentElement.clientWidth - this.div.offsetWidth) {
- l = document.documentElement.clientWidth - this.div.offsetWidth;
- }
- if (t <= 0) {
- t = 0;
- } else if (t >= document.documentElement.clientHeight - this.div.offsetHeight) {
- t = document.documentElement.clientHeight - this.div.offsetHeight;
- }
- this.div.style.left = l + "px";
- this.div.style.top = t + "px";
- }
- ;
- Drag.prototype.clearEvent = function() {
- this.div.onmouseup = null;
- document.onmousemove = null;
- }
- ;
-
- new Drag("popupWrap");
-
- $("#popupAll input, #popupAll textarea, #popupAll select, #popupAll ul, #popupAll a,#shixun_search_form_div").mousedown(function(event) {
- event.stopPropagation();
- new Drag("popupWrap");
- });
-
-}
-
-function hideModal(el) {
- if ($("#popupAll").length > 0) {
- $("#popupAll").remove();
- } else {
- var modal;
- if (el) {
- modal = $(el).parents('.ui-dialog-content');
- } else {
- modal = $('#ajax-modal');
- }
- modal.dialog("close");
- }
-}
-
-//提示框:只有一个确定按钮,点击跳转
-//
-function notice_box_redirect(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-//按钮内容自定义(自定义按钮需要remote=true,且有取消按钮)
-function notice_operation_box(url, str, btnstr) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-//点击删除时的确认弹框: 不走destroy方法
-function delete_confirm_box(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-//点击删除时的确认弹框: 走destroy方法,remote为true
-function delete_confirm_box_2(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-
-// 点击确定的时候ajax请求,两个按钮 点击确认跳转, 提示信息可以多行
-function op_confirm_box_remote(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 578, 205);
-}
-
-//点击删除时的确认弹框: post,remote为true
-function post_confirm_box(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-
-//提示框:只有一个确定按钮,点击关闭弹框
-//
-function notice_box(str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-
-//点击删除时的确认弹框: 走destroy方法
-function delete_confirm_box_3(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 160);
-}
-
-//取消和确定,确定会调用自定义方法
-function op_confirm_tip(str, func) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 500, 205);
-}
-
-//取消和确定,确定会调用自定义方法(带参数)
-function op_confirm_tip_1(str, func) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 500, 205);
-}
-
-function op_confirm_box_loading(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 578, 205);
-}
-
-// 两个按钮 点击确认跳转, 提示信息有两行
-function s_op_confirm_box(url, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, 480, 205);
-}
-
-function suofang() {
- var html = '可能会影响某些功能的正常使用
' + '- 1.请尝试调整浏览器缩放比例为100%(快捷键ctrl+0)
' + '- 2.请尝试调整系统显示比例为100%(控制面板/显示 设置)
' + '
';
- sure_confirm_box("页面缩放比例不正确", 600, 310, html);
-}
-
-//一个“知道了”按钮,title和宽度都作为参数
-function sure_confirm_box(title, width, height, str) {
- var htmlvalue = '';
- pop_box_new(htmlvalue, width, height);
-}
-
-function throttle(method, context, e) {
- clearTimeout(method.tId);
- method.tId = setTimeout(function() {
- method.call(context, e);
- }, 500);
-}
-
-function apply_publish_shixun(url) {
- if ($("#apply_publish_shixun").attr("data-option") == '1') {
- $("#apply_publish_shixun").attr("data-option", 0);
- $("#apply_publish_shixun").addClass("disabled-grey-bg");
- $.ajax({
- url: url,
- type: 'get'
- });
- }
-}
-
-var autoTextarea = function(elem, extra, maxHeight) {
- extra = extra || 0;
- var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX'in window
- , isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera')
- , addEvent = function(type, callback) {
- elem.addEventListener ? elem.addEventListener(type, callback, false) : elem.attachEvent('on' + type, callback);
- }
- , getStyle = elem.currentStyle ? function(name) {
- var val = elem.currentStyle[name];
-
- if (name === 'height' && val.search(/px/i) !== 1) {
- var rect = elem.getBoundingClientRect();
- return rect.bottom - rect.top - parseFloat(getStyle('paddingTop')) - parseFloat(getStyle('paddingBottom')) + 'px';
- }
- ;
- return val;
- }
- : function(name) {
- return getComputedStyle(elem, null)[name];
- }
- , minHeight = parseFloat(getStyle('height'));
-
- elem.style.resize = 'none';
-
- var change = function() {
- var scrollTop, height, padding = 0, style = elem.style;
-
- if (elem._length === elem.value.length)
- return;
- elem._length = elem.value.length;
-
- if (!isFirefox && !isOpera) {
- padding = parseInt(getStyle('paddingTop')) + parseInt(getStyle('paddingBottom'));
- }
- ;scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
-
- elem.style.height = minHeight + 'px';
- if (elem.scrollHeight > minHeight) {
- if (maxHeight && elem.scrollHeight > maxHeight) {
- height = maxHeight - padding;
- style.overflowY = 'auto';
- } else {
- height = elem.scrollHeight - padding + 10;
- style.overflowY = 'hidden';
- }
- ;style.height = height + extra + 'px';
- scrollTop += parseInt(style.height) - elem.currHeight;
- //document.body.scrollTop = scrollTop;
- //document.documentElement.scrollTop = scrollTop;
- elem.currHeight = parseInt(style.height);
- }
- ;
- };
-
- addEvent('propertychange', change);
- addEvent('input', change);
- addEvent('focus', change);
- change();
-};
-
-// 点击按钮复制功能
-function jsCopy() {
- var e = document.getElementById("copy_rep_content");
- e.select();
- document.execCommand("Copy");
-}
-
-// 使用resize事件监听窗口的zoom,如果zoom变化了,弹框提示;初始化时也检查zoom是否是100%。
-function _initZoomCheck() {
- if (!IsPC()) {
- // 手机端不需要提示
- return;
- }
- var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100
- if (!isNormalZoom) {
- suofang();
- }
-
- $(window).resize(function() {
- var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100
- if (!isNormalZoom) {
- suofang();
- } else {
- $('.task-btn.task-btn-orange:visible').click()
- }
- })
-
-}
-
-var win_resize = function() {
- var _w = $(window).width() - 1200;
- if (_w < 0) {
- $('.newHeader>.educontent').width('auto')
- } else {
- $('.newHeader>.educontent').width('1200px')
- }
-};
-
-function initWindowResize() {
- if (location.pathname === '/login') {
- // 登录页不需要
- return;
- }
-
- $(function() {
- setTimeout(function() {
- win_resize();
- }, 1000)
- })
-
- $(window).resize(function() {
- win_resize()
- })
-}
-initWindowResize();
-
-// 登录刷新 https://stackoverflow.com/questions/28230845/communication-between-tabs-or-windows
-if (window['BroadcastChannel']) {
- var bc = new BroadcastChannel('ec_reload');
- bc.onmessage = function(ev) {
- if (window['ec_reload_msg_send_window']) {
- window['ec_reload_msg_send_window'] = false;
- } else {
- location.reload();
- }
- }
-}
-function _sendReloadMsg() {
- var bc = new BroadcastChannel('ec_reload');
- window['ec_reload_msg_send_window'] = true;
- // 消息发出的窗口,不需要处理该消息
- bc.postMessage('ec_reload');
- /* send */
-}
-// IE11 没有 startsWith
-if (!String.prototype.startsWith) {
- String.prototype.startsWith = function(searchString, position) {
- position = position || 0;
- return this.substr(position, searchString.length) === searchString;
- }
- ;
- String.prototype.endsWith = function(search, this_len) {
- if (this_len === undefined || this_len > this.length) {
- this_len = this.length;
- }
- return this.substring(this_len - search.length, this_len) === search;
- }
- ;
-}
-
-function clickNewsubscript() {
- $(".newsubscript").hide();
- $(".newedbox").addClass("newminheight");
- $(".newedbox").removeClass("newedboxheight");
-}
-
-/** tpm实训开启按钮,不允许多次点击 START */
-//点击模拟实战或者开启实战等,按钮变灰内容变成“开启中”
-var operationItem = null;
-var operationButtonOldValue = null;
-function opClickString(item) {
- var value = $(item).html();
- $(item).css({
- 'background': 'gray',
- 'border': '1px solid grey',
- 'pointer-events': 'none'
- });
- $(item).html('开启中');
-
- operationButtonOldValue = value
- operationItem = item
- // setTimeout(function(){ $(item).css('background', '#4CACFF');$(item).html(value); }, 4000)
-}
-//
-// var isOperationSending = false;
-$(document).bind('ajaxStop', function(event, xhr, settings) {
- if (settings && settings.url && (settings.url.match(/operation\?/))) {
- if (operationItem) {
- $(operationItem).css('background', '#4CACFF').css('pointer-events', 'inherit');
- $(operationItem).html(operationButtonOldValue);
- }
- }
-});
-$(document).bind('ajaxError', function(event, xhr, settings) {
- if (settings && settings.url && (settings.url.match(/operation\?/))) {
- if (operationItem) {
- $(operationItem).css('background', '#4CACFF').css('pointer-events', 'inherit');
- $(operationItem).html(operationButtonOldValue);
- }
- }
-});
-/** tpm实训开启按钮,不允许多次点击 END */
+document.write("");
+
+/*!
+ * JavaScript Cookie v2.2.0
+ * https://github.com/js-cookie/js-cookie
+ *
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
+ * Released under the MIT license
+ */
+!function(e) {
+ var n;
+ if ("function" == typeof define && define.amd && (define(e),
+ n = !0),
+ "object" == typeof exports && (module.exports = e(),
+ n = !0),
+ !n) {
+ var t = window.Cookies
+ , o = window.Cookies = e();
+ o.noConflict = function() {
+ return window.Cookies = t,
+ o
+ }
+ }
+}(function() {
+ function e() {
+ for (var e = 0, n = {}; e < arguments.length; e++) {
+ var t = arguments[e];
+ for (var o in t)
+ n[o] = t[o]
+ }
+ return n
+ }
+ function n(e) {
+ return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent)
+ }
+ return function t(o) {
+ function r() {}
+ function i(n, t, i) {
+ if ("undefined" != typeof document) {
+ "number" == typeof (i = e({
+ path: "/"
+ }, r.defaults, i)).expires && (i.expires = new Date(1 * new Date + 864e5 * i.expires)),
+ i.expires = i.expires ? i.expires.toUTCString() : "";
+ try {
+ var c = JSON.stringify(t);
+ /^[\{\[]/.test(c) && (t = c)
+ } catch (e) {}
+ t = o.write ? o.write(t, n) : encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent),
+ n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
+ var f = "";
+ for (var u in i)
+ i[u] && (f += "; " + u,
+ !0 !== i[u] && (f += "=" + i[u].split(";")[0]));
+ return document.cookie = n + "=" + t + f
+ }
+ }
+ function c(e, t) {
+ if ("undefined" != typeof document) {
+ for (var r = {}, i = document.cookie ? document.cookie.split("; ") : [], c = 0; c < i.length; c++) {
+ var f = i[c].split("=")
+ , u = f.slice(1).join("=");
+ t || '"' !== u.charAt(0) || (u = u.slice(1, -1));
+ try {
+ var a = n(f[0]);
+ if (u = (o.read || o)(u, a) || n(u),
+ t)
+ try {
+ u = JSON.parse(u)
+ } catch (e) {}
+ if (r[a] = u,
+ e === a)
+ break
+ } catch (e) {}
+ }
+ return e ? r[e] : r
+ }
+ }
+ return r.set = i,
+ r.get = function(e) {
+ return c(e, !1)
+ }
+ ,
+ r.getJSON = function(e) {
+ return c(e, !0)
+ }
+ ,
+ r.remove = function(n, t) {
+ i(n, "", e(t, {
+ expires: -1
+ }))
+ }
+ ,
+ r.defaults = {},
+ r.withConverter = t,
+ r
+ }(function() {})
+});
+
+$(function() {
+ var result = location.search.match(/\?search=(\w*)&?/i)
+ if (result && result[1]) {
+ var searchText = result[1]
+ $('#search-input').val(searchText)
+ }
+ // 未报名用户登录时弹框
+ // console.log(Cookies.get('enroll_status'));
+ // if(Cookies.get('enroll_status') == 0){
+ // Cookies.remove('enroll_status');
+ // var html=''+
+ // '
'+
+ // '
'+
+ // '
'+
+ // '
立即报名'+
+ // '
';
+ // $(".newContainer").append(html);
+ // }
+});
+
+function CloseBox() {
+ $(".CompetitionEnrollBox").remove();
+}
+
+//根据页面大小决定侧边栏的位置
+$(window).resize(function() {
+ rightSlider();
+});
+function rightSlider() {
+ var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 81;
+ // console.log(parseInt($(window).width())+" "+poi);
+ if (poi > 0) {
+ $(".-task-sidebar").css("right", poi);
+ } else {
+ $(".-task-sidebar").css("right", "0px");
+ }
+ $(".-task-sidebar").show();
+}
+function open_course(id, allowVisit) {
+ if (allowVisit) {
+ window.open("/courses/" + id);
+ }
+}
+function open_project(id, allowVisit) {
+ if (allowVisit) {
+ window.open("/projects/" + id);
+ }
+}
+
+function conver_size(limit) {
+ var size = "";
+ if (limit < 1024) {
+ //如果小于1KB转化成B
+ size = limit.toFixed(2) + "B";
+ } else if (limit < 1024 * 1024) {
+ //如果小于1MB转化成KB
+ size = (limit / 1024).toFixed(2) + "KB";
+ } else if (limit < 1024 * 1024 * 1024) {
+ //如果小于1GB转化成MB
+ size = (limit / (1024 * 1024)).toFixed(2) + "MB";
+ } else {
+ //其他转化成GB
+ size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB";
+ }
+
+ var sizestr = size + "";
+ var len = sizestr.indexOf("\.");
+ var dec = sizestr.substr(len + 1, 2);
+ if (dec == "00") {
+ //当小数点后为00时 去掉小数部分
+ return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
+ }
+ return sizestr;
+}
+
+function _initSider() {
+ var $descSide = $("").appendTo("body");
+ $(".-task-sidebar>div").hover(function() {
+ //移入显示二维码
+ if ($(this).hasClass("scan")) {
+ $(".scan_ewm").show().css({
+ right: "75px",
+ opacity: 0
+ }).stop().animate({
+ right: "45px",
+ opacity: 1
+ })
+ return;
+ }
+ var $tool = $(this).attr("tooltips");
+ $descSide.html($tool + "");
+ $descSide.data('_dom', this)
+ $descSide.show().css({
+ left: $(this).offset().left - $descSide.width() - 30,
+ opacity: 0,
+ top: $(this).offset().top
+ }).stop().animate({
+ left: $(this).offset().left - $descSide.width() - 5,
+ opacity: 1
+ }, 400);
+ }, function() {
+ if ($(this).hasClass("scan")) {
+ $(".scan_ewm").stop().animate({
+ right: "75px",
+ opacity: 0
+ }, 200).hide();
+ }
+ $descSide.stop().animate({
+ left: $(this).offset().left - $descSide.width() - 30,
+ opacity: 0
+ }, 200).hide();
+ });
+ rightSlider();
+
+ $(window).scroll(function() {
+ if ($descSide.height()) {
+ var hoverIcon = $descSide.data('_dom')
+ $descSide.css('top', $(hoverIcon).offset().top)
+ }
+ })
+}
+$(function() {
+ loadHeader();
+ _initSider();
+
+ $(window).scroll(function() {
+ if ($(".gotop").length > 0) {
+ if ($(document).scrollTop() > 0) {
+ $(".-task-sidebar .gotop").show();
+ $(".gotop").click(function() {
+ $("html,body").scrollTop(0);
+ });
+ }
+ if ($(document).scrollTop() == 0) {
+ $(".-task-sidebar .gotop").hide();
+ }
+ }
+ });
+
+ // 翻页的GO
+ $(".page_GO").live("keydown", function(event) {
+ var code;
+ if (!event) {
+ event = window.event;
+ //针对ie浏览器
+ code = event.keyCode;
+ } else {
+ code = event.keyCode;
+ }
+ if (code == 13) {
+ var prev = $(this).prev().find("a").html().trim();
+ var page = $(this).val().trim();
+ if (parseInt(prev) >= parseInt(page)) {
+ if (typeof ($(this).prev().children("a").attr("href")) == "undefined") {
+ var href = $(this).parent().find("li:first-child").children("a").attr("href");
+ } else {
+ var href = $(this).prev().children("a").attr("href");
+ }
+ var new_href = href.replace(/page=(\d*)/, 'page=' + page);
+ console.log(new_href);
+ $.get(new_href);
+ return false;
+ }
+ }
+ });
+
+ // 试用申请弹框
+ $("#apply_trail_submit_btn").live('click', function() {
+ if ($("#apply_reason").val().trim() == "") {
+ $("#hint_message").show();
+ } else {
+ $("#hint_message").hide();
+ $("#apply_trail_form").submit();
+ hideModal();
+ }
+ });
+
+});
+
+// editor 存在了jquery对象上,应用不需要自己写md_rec_data方法了
+function md_rec_data(k, mdu, id) {
+ if (window.sessionStorage.getItem(k + mdu) !== null) {
+ editor = $("#e_tips_" + id).data('editor');
+ editor.setValue(window.sessionStorage.getItem(k + mdu));
+
+ md_clear_data(k, mdu, id);
+ }
+}
+// markdown的自动保存
+function md_elocalStorage(editor, mdu, id) {
+ if (window.sessionStorage) {
+ var oc = window.sessionStorage.getItem('content' + mdu);
+ if (oc !== null) {
+ $("#e_tips_" + id).data('editor', editor);
+ var h = '您上次有已保存的数据,是否恢复 ? / 不恢复';
+ $("#e_tips_" + id).html(h);
+ }
+ setInterval(function() {
+ d = new Date();
+ var h = d.getHours();
+ var m = d.getMinutes();
+ var s = d.getSeconds();
+ h = h < 10 ? '0' + h : h;
+ m = m < 10 ? '0' + m : m;
+ s = s < 10 ? '0' + s : s;
+ if (editor.getValue().trim() != "") {
+ md_add_data("content", mdu, editor.getValue());
+ var id1 = "#e_tip_" + id;
+ var id2 = "#e_tips_" + id;
+ $(id1).html(" 数据已于 " + h + ':' + m + ':' + s + " 保存 ");
+ $(id2).html("");
+ }
+ }, 10000);
+
+ } else {
+ $("#e_tip_" + id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!');
+ }
+}
+// 保存数据
+function md_add_data(k, mdu, d) {
+ window.sessionStorage.setItem(k + mdu, d);
+}
+// 恢复数据
+//function md_rec_data(k,mdu,id, editor){
+// if(window.sessionStorage.getItem(k+mdu) !== null){
+// editor.setValue(window.sessionStorage.getItem(k+mdu));
+// md_clear_data(k,mdu,id);
+// }
+//}
+// 清空保存的数据
+function md_clear_data(k, mdu, id) {
+ window.sessionStorage.removeItem(k + mdu);
+ var id1 = "#e_tip_" + id;
+ var id2 = "#e_tips_" + id;
+ if (k == 'content') {
+ $(id2).html("");
+ } else {
+ $(id1).html("");
+ }
+}
+
+// editorMD to create
+/**
+ *
+ * @param id 渲染DOM的id
+ * @param width 宽度
+ * @param high 高度
+ * @param placeholder
+ * @param imageUrl 上传图片的url
+ * @returns {*} 返回一个editorMD实例
+ */
+function create_editorMD(id, width, high, placeholder, imageUrl, readonly) {
+ var readonly = readonly == undefined ? false : readonly;
+ var editorName = editormd(id, {
+ width: width,
+ height: high,
+ syncScrolling: "single",
+ //你的lib目录的路径,我这边用JSP做测试的
+ path: "/editormd/lib/",
+ tex: true,
+ tocm: true,
+ emoji: true,
+ taskList: true,
+ codeFold: true,
+ searchReplace: true,
+ htmlDecode: "style,script,iframe",
+ sequenceDiagram: true,
+ autoFocus: false,
+ readonly: readonly,
+ toolbarIcons: function() {
+ // Or return editormd.toolbarModes[name]; // full, simple, mini
+ // Using "||" set icons align right.
+ return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
+ },
+ toolbarCustomIcons: {
+ testIcon: "",
+ testIcon1: ""
+ },
+ //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
+ saveHTMLToTextarea: true,
+ // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
+ dialogMaskOpacity: 0.6,
+ placeholder: placeholder,
+ imageUpload: true,
+ imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
+ imageUploadURL: imageUrl,
+ //url
+ onload: function(cMirror) {
+ $("#" + id + " [type=\"latex\"]").bind("click", function() {
+ editorName.cm.replaceSelection("```latex");
+ editorName.cm.replaceSelection("\n");
+ editorName.cm.replaceSelection("\n");
+ editorName.cm.replaceSelection("```");
+ var __Cursor = editorName.cm.getDoc().getCursor();
+ editorName.cm.setCursor(__Cursor.line - 1, 0);
+ });
+
+ $("#" + id + " [type=\"inline\"]").bind("click", function() {
+ editorName.cm.replaceSelection("$$$$");
+ var __Cursor = editorName.cm.getDoc().getCursor();
+ editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
+ editorName.cm.focus();
+ });
+ $("[type=\"inline\"]").attr("title", "行内公式");
+ $("[type=\"latex\"]").attr("title", "多行公式");
+ setTimeout(function() {
+ editorName.resize();
+ editorName.cm.refresh();
+ window.new_md = editorName;
+ }, 300);
+ }
+ });
+ return editorName;
+}
+
+// editormd to html
+/**
+ *
+ * @param id 渲染的id
+ * @param callback onload回調 暫時未用
+ */
+function editormd_to_html(id, callback) {
+ editormd.loadKaTeX(function() {
+ editormd.markdownToHTML(id, {
+ htmlDecode: "style,script,iframe",
+ // you can filter tags decode
+ onload: function() {
+ callback && callback()
+ },
+ taskList: true,
+ tex: true,
+ // 默认不解析
+ flowChart: true,
+ // 默认不解析
+ sequenceDiagram: true// 默认不解析
+ });
+ });
+}
+
+function loadHeader() {
+ //头部导航条的----------显示搜索框
+ $("#search-open").on("click", function(e) {
+ $(this).hide();
+ // $("#header-nav").animate({opacity:"0"},1000);
+ $(".posi-search").show()
+ // .animate({opacity:"1"},1000);
+ $("#header-nav").css("z-index", "2");
+ $(".posi-search").css("z-index", "3");
+ // $(".search-input").val(""); // 不清空
+ $(".search-input").focus();
+ $(".search-all .search-content").hide();
+ e.stopPropagation();
+ //阻止冒泡
+ });
+ $(".search-input").on("click", function(e) {
+ e.stopPropagation();
+ //阻止冒泡
+ });
+ //搜索框输入内容
+ $(".search-input").on("input", function(e) {
+ if ($(".search-input").val() == "") {
+ $(".search-all .search-content").hide();
+ } else {
+ $(".search-all .search-content").show();
+ }
+ e.stopPropagation();
+ //阻止冒泡
+ });
+ //搜索
+ $("#header_keyword_search").on("click", header_search);
+ $("input[name='search_keyword']").on("keydown", function(event) {
+ var code;
+ if (!event) {
+ event = window.event;
+ //针对ie浏览器
+ code = event.keyCode;
+ } else {
+ code = event.keyCode;
+ }
+ if (code == 13) {
+ header_search();
+ return false;
+ }
+ });
+ $(".search-clear").click(function(e) {
+ e.stopPropagation();
+ });
+ //切换搜索条件
+ $("#searchkey li").click(function(e) {
+ var key = $($(this).children("a")[0]).html();
+ switch (key) {
+ case '实训':
+ $("#search_type").val('1');
+ break;
+ case '课堂':
+ $("#search_type").val('2');
+ break;
+ case '用户':
+ $("#search_type").val('3');
+ break;
+ }
+ $("#searchkey").siblings(".searchkey").html(key);
+ // $("#searchkey").hide();
+ e.stopPropagation();
+ //阻止冒泡
+ });
+ //切换选择导航条
+ $("#header-nav li").click(function() {
+ $("#header-nav li").removeClass("active");
+ $(this).addClass("active");
+ });
+ //点击页面其它(与搜索框无关的地方)都会将搜索框隐藏,所以与搜索框有关的地方需要阻止冒泡
+ $("body").on("click", function() {
+ closeSearch();
+ });
+
+ $(".search_history").on("click", function() {
+ $("input[name='search_keyword']").val($(this).html());
+ header_search();
+ });
+}
+
+function header_search() {
+ var keyword = $("input[name='search_keyword']").val();
+ // 搜索关键字
+ var index = $("#search_type").val();
+ // 搜索课程/项目
+ keyword = encodeURIComponent(keyword);
+ // $.get('/users/search_shixuns_or_course',
+ // { search: keyword,
+ // index: index});
+ window.location.href = "/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
+ //e.stopPropagation();//阻止冒泡
+}
+
+//头部导航条的隐藏
+function closeSearch() {
+ $('#posi-search').hide();
+ $("#search-open").show();
+ // $(".posi-search").animate({opacity:"0"},800);
+ $("#header-nav").animate({
+ opacity: "1"
+ }, 1000);
+ $(".posi-search").css("z-index", "2");
+ $("#header-nav").css("z-index", "3");
+}
+(function($) {
+ $.fn.drag = function(options) {
+ var x, drag = this, isMove = false, defaults = {};
+ var options = $.extend(defaults, options);
+ //添加背景,文字,滑块
+ var html = '' + '请拖住滑块,拖动到最右边
' + '';
+ this.append(html);
+
+ var handler = drag.find('.handler');
+ var drag_bg = drag.find('.drag_bg');
+ var text = drag.find('.drag_text');
+ var maxWidth = text.width() - handler.width();
+ //能滑动的最大间距
+ //鼠标按下时候的x轴的位置
+ handler.mousedown(function(e) {
+ isMove = true;
+ x = e.pageX - parseInt(handler.css('left'), 10);
+ });
+
+ //鼠标指针在上下文移动时,移动距离大于0小于最大间距,滑块x轴位置等于鼠标移动距离
+ $(document).mousemove(function(e) {
+ var _x = e.pageX - x;
+ var handler_offset = handler.offset();
+ var lastX = e.clientX - x;
+ lastX = Math.max(0, Math.min(maxWidth, lastX));
+ if (isMove) {
+ if (_x > 0 && _x <= maxWidth) {
+ handler.css({
+ 'left': lastX
+ });
+ drag_bg.css({
+ 'width': lastX
+ });
+ } else if (lastX > maxWidth - 5 && lastX < maxWidth + 5) {
+ //鼠标指针移动距离达到最大时清空事件
+ dragOk();
+ }
+ }
+ });
+ handler.mouseup(function(e) {
+ isMove = false;
+ var _x = e.pageX - x;
+ if (_x < maxWidth) {
+ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
+ handler.css({
+ 'left': 0
+ });
+ drag_bg.css({
+ 'width': 0
+ });
+ }
+ });
+
+ //清空事件
+ function dragOk() {
+ var kuaiwidth = drag.width() - handler.width();
+ handler.removeClass('handler_bg').addClass('handler_ok_bg');
+ handler.css({
+ 'left': kuaiwidth + 'px'
+ })
+ text.css({
+ 'width': kuaiwidth + 'px'
+ });
+ text.text('验证通过');
+ drag.css({
+ 'color': '#fff'
+ });
+ drag_bg.css({
+ 'width': kuaiwidth + 'px'
+ })
+ handler.unbind('mousedown');
+ $(document).unbind('mousemove');
+ $(document).unbind('mouseup');
+ handler.parent().next().find("p").html("").hide();
+ }
+ }
+ ;
+}
+)(jQuery);
+
+//判断是手机端还是电脑端
+function IsPC() {
+ var userAgentInfo = navigator.userAgent;
+ var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
+ var flag = true;
+ for (var v = 0; v < Agents.length; v++) {
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
+ flag = false;
+ break;
+ }
+ }
+ return flag;
+}
+
+//Dom:绑定事件的节点对象,ChangeDOM:操作的相关节点,
+function LeaveTitle(Dom, ChangeDom) {
+ ChangeDom.html("").hide();
+ ChangeDom.parent().css({
+ opacity: 0,
+ left: 0,
+ top: 0
+ }).hide();
+}
+
+$(function() {
+ //平台tip的样式优化js
+ var $desc = $("" + "
" + "
" + "
" + "
" + "
").appendTo("body");
+ //Dom:绑定事件的节点对象,ChangeDOM:操作的相关节点,
+ function LeaveTitle(Dom, ChangeDom) {
+ Dom.live("mouseleave", function() {
+ ChangeDom.html("").hide();
+ $desc.css({
+ opacity: 0,
+ left: 0,
+ top: 0
+ }).hide();
+ })
+ }
+ LeaveTitle($("[data-tip-top]"), $(".data-tip-top"));
+ LeaveTitle($("[data-tip-down]"), $(".data-tip-down"));
+ LeaveTitle($("[data-tip-right]"), $(".data-tip-left"));
+ LeaveTitle($("[data-tip-left]"), $(".data-tip-right"));
+ $("[data-tip-top]").live("mouseenter", function() {
+ var $tool = $(this).attr("data-tip-top");
+ if ($tool != "") {
+ $(".data-tip-top").show().html($tool);
+ $desc.show().css({
+ left: $(this).offset().left - ($desc.width() - $(this).outerWidth()) / 2,
+ opacity: 1,
+ top: $(this).offset().top - 30
+ });
+ }
+ });
+ $("[data-tip-down]").live("mouseenter", function() {
+ var $tool = $(this).attr("data-tip-down");
+ if ($tool != "") {
+ $(".data-tip-down").show().html($tool);
+ $desc.show().css({
+ left: $(this).offset().left - ($desc.width() - $(this).outerWidth()) / 2,
+ opacity: 1,
+ top: $(this).offset().top + $(this).height() + 6
+ });
+ }
+ });
+ $("[data-tip-right]").live("mouseenter", function() {
+ var $tool = $(this).attr("data-tip-right");
+ if ($tool != "") {
+ console.log($(this).offset().left + " " + $(this).width());
+ $(".data-tip-left").show().html($tool);
+ $desc.show().css({
+ left: $(this).offset().left + $(this).outerWidth() + 6,
+ opacity: 1,
+ top: $(this).offset().top - ($desc.height() - $(this).height()) / 2
+ });
+ }
+ });
+ $("[data-tip-left]").live("mouseenter", function() {
+ var $tool = $(this).attr("data-tip-left");
+ if ($tool != "") {
+ $(".data-tip-right").show().html($tool);
+ $desc.show().css({
+ left: $(this).offset().left - $desc.width() - 6,
+ opacity: 1,
+ top: $(this).offset().top - ($desc.height() - $(this).height()) / 2
+ });
+ }
+ });
+ unitDownOption();
+});
+
+function unitDownOption() {
+ //下拉框
+ $("[select-for]").append("");
+ $("[select-for]").hover(function() {
+ $(this).find(".down-select").show();
+ }, function() {
+ $(this).find(".down-select").hide();
+ })
+ $("[select-for] .down-select p").bind("click", function() {
+ //alert($(this).attr("data-shixun-value"));
+ if ($(this).attr("id") == "diy_script") {
+ return;
+ // 实训新建-选择自定义脚本diy
+ }
+ $(this).parents(".down-select").siblings("input[type=hidden]").attr("value", $(this).attr("data-shixun-value"));
+
+ $(this).parents(".down-select").siblings("input[type=text]").val($(this).html().trim());
+ $(this).parents(".down-select").hide();
+ })
+}
+
+//初始化省份
+function showprovince(id) {
+ var arrary = ["北京", "上海", "广东", "江苏", "浙江", "重庆", "安徽", "福建", "甘肃", "广西", "贵州", "海南", "河北", "黑龙江", "河南", "湖北", "湖南", "江西", "吉林", "辽宁", "内蒙古", "宁夏", "青海", "山东", "山西", "陕西", "四川", "天津", "新疆", "西藏", "云南", "香港特别行政区", "澳门特别行政区", "台湾", "海外"];
+ var html = ""
+ for (var i = 0; i < arrary.length; i++) {
+ var item = arrary[i];
+ html += "";
+ }
+ $("#" + id).html(html);
+}
+
+//省市下拉框
+function showcity(province, cityField) {
+ switch (province) {
+ case "北京":
+ var cityOptions = new Array("东城","西城","朝阳","丰台","石景山","海淀","门头沟","房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆");
+ break;
+ case "上海":
+ var cityOptions = new Array("崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行","宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤");
+ break;
+ case "广东":
+ var cityOptions = new Array("广州","深圳","珠海","东莞","中山","佛山","惠州","河源","潮州","江门","揭阳","茂名","梅州","清远","汕头","汕尾","韶关","顺德","阳江","云浮","湛江","肇庆");
+ break;
+ case "江苏":
+ var cityOptions = new Array("南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通","启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城","扬州","宜兴","仪征","张家港","镇江","周庄");
+ break;
+ case "重庆":
+ var cityOptions = new Array("万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛","双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山","梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪","石柱","秀山","酉阳","彭水","江津","合川","永川","南川");
+ break;
+ case "安徽":
+ var cityOptions = new Array("合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南","黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城");
+ break;
+ case "福建":
+ var cityOptions = new Array("福州","厦门","泉州","漳州","龙岩","南平","宁德","莆田","三明");
+ break;
+ case "甘肃":
+ var cityOptions = new Array("兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","武都","武威","西峰","张掖");
+ break;
+ case "广西":
+ var cityOptions = new Array("南宁","百色","北海","桂林","防城港","贵港","河池","贺州","柳州","钦州","梧州","玉林");
+ break;
+ case "贵州":
+ var cityOptions = new Array("贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义");
+ break;
+ case "海南":
+ var cityOptions = new Array("海口","儋县","陵水","琼海","三亚","通什","万宁");
+ break;
+ case "河北":
+ var cityOptions = new Array("石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛","唐山","新城","邢台","张家口");
+ break;
+ case "黑龙江":
+ var cityOptions = new Array("哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔","七台河","双鸭山","绥化","伊春");
+ break;
+ case "河南":
+ var cityOptions = new Array("郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山","濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店");
+ break;
+ case "香港":
+ var cityOptions = new Array("香港","九龙","新界");
+ break;
+ case "湖北":
+ var cityOptions = new Array("武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴","仙桃","咸宁","襄阳","襄樊","孝感","宜昌");
+ break;
+ case "湖南":
+ var cityOptions = new Array("长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳","永州","张家界","株洲");
+ break;
+ case "江西":
+ var cityOptions = new Array("南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡","上饶","新余","宜春","鹰潭");
+ break;
+ case "吉林":
+ var cityOptions = new Array("长春","吉林","白城","白山","珲春","辽源","梅河","四平","松原","通化","延吉");
+ break;
+ case "辽宁":
+ var cityOptions = new Array("沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州","辽阳","盘锦","铁岭","营口");
+ break;
+ case "澳门":
+ var cityOptions = new Array("澳门");
+ break;
+ case "内蒙古":
+ var cityOptions = new Array("呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海","乌兰浩特","锡林浩特");
+ break;
+ case "宁夏":
+ var cityOptions = new Array("银川","固源","石嘴山","吴忠");
+ break;
+ case "青海":
+ var cityOptions = new Array("西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树");
+ break;
+ case "山东":
+ var cityOptions = new Array("济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂","蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博");
+ break;
+ case "山西":
+ var cityOptions = new Array("太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州","阳泉","榆次","运城");
+ break;
+ case "陕西":
+ var cityOptions = new Array("西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林");
+ break;
+ case "四川":
+ var cityOptions = new Array("成都","巴中","达川","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟","康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁","汶川","西昌","雅安","宜宾","自贡","资阳");
+ break;
+ case "台湾":
+ var cityOptions = new Array("台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗","嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖");
+ break;
+ case "天津":
+ var cityOptions = new Array("天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢","塘沽","汉沽","大港","宁河","静海","宝坻","蓟县");
+ break;
+ case "新疆":
+ var cityOptions = new Array("乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什","克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁");
+ break;
+ case "西藏":
+ var cityOptions = new Array("拉萨","阿里","昌都","林芝","那曲","日喀则","山南");
+ break;
+ case "云南":
+ var cityOptions = new Array("昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江","六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通");
+ break;
+ case "浙江":
+ var cityOptions = new Array("杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安","临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州","台州","温岭","温州","余姚","舟山");
+ break;
+ case "海外":
+ var cityOptions = new Array("美国","日本","英国","法国","德国","其他");
+ break;
+ default:
+ var cityOptions = new Array("请选择所在城市");
+ break;
+ }
+
+ cityField.options.length = 0;
+ for (var i = 0; i < cityOptions.length; i++) {
+ cityField.options[i] = new Option(cityOptions[i],cityOptions[i]);
+ /*
+ if (cityField.options[i].value==city)
+ {
+ //alert("here put City ok!");
+ document.oblogform["city"].selectedIndex = i;
+ }*/
+ }
+}
+
+/*弹框*/
+// 公共弹框样式
+// 建议左右栏的:Width:460,Height:190
+// 建议宽屏对应值:Width:760,Height:500
+function pop_box_new(value, Width, Height, close) {
+
+ if ($("#popupAll").length > 0) {
+ $("#popupAll").remove();
+ }
+ w = ($(window).width() - Width) / 2;
+ h = ($(window).height() - Height) / 2;
+ var html = "";
+ if (close) {
+ value = "" + value;
+ }
+ $(document.body).append(html);
+ $("#popupWrap").html(value);
+ $('#popupWrap').css({
+ "top": h + "px",
+ "left": w + "px",
+ "padding": "0",
+ "border": "none",
+ "position": "fixed",
+ "z-index": "99999",
+ "background-color": "#fff",
+ "border-radius": "10px"
+ });
+ if (close) {
+ $('#closeIcon').css({
+ "top": "-26px",
+ "left": Width + "px",
+ "z-index": "100000"
+ });
+ }
+
+ $("#popupWrap").parent().parent().show();
+ $('#popupAll').find("#closeIcon").click(function() {
+ $("#popupAll").hide();
+ });
+ $('#popupAll').find("a[class*='pop_close']").click(function() {
+ $("#popupAll").hide();
+ });
+ // w = ($(window).width() - Width)/2;
+ // h = ($(window).height() - Height)/2;
+ // $("#ajax-modal").html(value);
+ // showModal('ajax-modal', Width + 'px');
+ // $('#ajax-modal').siblings().remove();
+ // $('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
+ // $('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
+ // $('#ajax-modal').css({"padding":"0","overflow":"hidden"});
+ // $('#ajax-modal').parent().attr("id","popupWrap");
+
+ //拖拽
+ function Drag(id) {
+ this.div = document.getElementById(id);
+ if (this.div) {
+ this.div.style.cursor = "move";
+ this.div.style.position = "fixed";
+ }
+ this.disX = 0;
+ this.disY = 0;
+ var _this = this;
+ this.div.onmousedown = function(evt) {
+ _this.getDistance(evt);
+ document.onmousemove = function(evt) {
+ _this.setPosition(evt);
+ }
+ ;
+ _this.div.onmouseup = function() {
+ _this.clearEvent();
+ }
+ }
+ }
+ Drag.prototype.getDistance = function(evt) {
+ var oEvent = evt || event;
+ this.disX = oEvent.clientX - this.div.offsetLeft;
+ this.disY = oEvent.clientY - this.div.offsetTop;
+ }
+ ;
+ Drag.prototype.setPosition = function(evt) {
+ var oEvent = evt || event;
+ var l = oEvent.clientX - this.disX;
+ var t = oEvent.clientY - this.disY;
+ if (l <= 0) {
+ l = 0;
+ } else if (l >= document.documentElement.clientWidth - this.div.offsetWidth) {
+ l = document.documentElement.clientWidth - this.div.offsetWidth;
+ }
+ if (t <= 0) {
+ t = 0;
+ } else if (t >= document.documentElement.clientHeight - this.div.offsetHeight) {
+ t = document.documentElement.clientHeight - this.div.offsetHeight;
+ }
+ this.div.style.left = l + "px";
+ this.div.style.top = t + "px";
+ }
+ ;
+ Drag.prototype.clearEvent = function() {
+ this.div.onmouseup = null;
+ document.onmousemove = null;
+ }
+ ;
+
+ new Drag("popupWrap");
+
+ $("#popupAll input, #popupAll textarea, #popupAll select, #popupAll ul, #popupAll a,#shixun_search_form_div").mousedown(function(event) {
+ event.stopPropagation();
+ new Drag("popupWrap");
+ });
+
+}
+
+function hideModal(el) {
+ if ($("#popupAll").length > 0) {
+ $("#popupAll").remove();
+ } else {
+ var modal;
+ if (el) {
+ modal = $(el).parents('.ui-dialog-content');
+ } else {
+ modal = $('#ajax-modal');
+ }
+ modal.dialog("close");
+ }
+}
+
+//提示框:只有一个确定按钮,点击跳转
+//
+function notice_box_redirect(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+//按钮内容自定义(自定义按钮需要remote=true,且有取消按钮)
+function notice_operation_box(url, str, btnstr) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+//点击删除时的确认弹框: 不走destroy方法
+function delete_confirm_box(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+//点击删除时的确认弹框: 走destroy方法,remote为true
+function delete_confirm_box_2(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+
+// 点击确定的时候ajax请求,两个按钮 点击确认跳转, 提示信息可以多行
+function op_confirm_box_remote(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 578, 205);
+}
+
+//点击删除时的确认弹框: post,remote为true
+function post_confirm_box(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+
+//提示框:只有一个确定按钮,点击关闭弹框
+//
+function notice_box(str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+
+//点击删除时的确认弹框: 走destroy方法
+function delete_confirm_box_3(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 160);
+}
+
+//取消和确定,确定会调用自定义方法
+function op_confirm_tip(str, func) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 500, 205);
+}
+
+//取消和确定,确定会调用自定义方法(带参数)
+function op_confirm_tip_1(str, func) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 500, 205);
+}
+
+function op_confirm_box_loading(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 578, 205);
+}
+
+// 两个按钮 点击确认跳转, 提示信息有两行
+function s_op_confirm_box(url, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, 480, 205);
+}
+
+function suofang() {
+ var html = '可能会影响某些功能的正常使用
' + '- 1.请尝试调整浏览器缩放比例为100%(快捷键ctrl+0)
' + '- 2.请尝试调整系统显示比例为100%(控制面板/显示 设置)
' + '
';
+ sure_confirm_box("页面缩放比例不正确", 600, 310, html);
+}
+
+//一个“知道了”按钮,title和宽度都作为参数
+function sure_confirm_box(title, width, height, str) {
+ var htmlvalue = '';
+ pop_box_new(htmlvalue, width, height);
+}
+
+function throttle(method, context, e) {
+ clearTimeout(method.tId);
+ method.tId = setTimeout(function() {
+ method.call(context, e);
+ }, 500);
+}
+
+function apply_publish_shixun(url) {
+ if ($("#apply_publish_shixun").attr("data-option") == '1') {
+ $("#apply_publish_shixun").attr("data-option", 0);
+ $("#apply_publish_shixun").addClass("disabled-grey-bg");
+ $.ajax({
+ url: url,
+ type: 'get'
+ });
+ }
+}
+
+var autoTextarea = function(elem, extra, maxHeight) {
+ extra = extra || 0;
+ var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX'in window
+ , isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera')
+ , addEvent = function(type, callback) {
+ elem.addEventListener ? elem.addEventListener(type, callback, false) : elem.attachEvent('on' + type, callback);
+ }
+ , getStyle = elem.currentStyle ? function(name) {
+ var val = elem.currentStyle[name];
+
+ if (name === 'height' && val.search(/px/i) !== 1) {
+ var rect = elem.getBoundingClientRect();
+ return rect.bottom - rect.top - parseFloat(getStyle('paddingTop')) - parseFloat(getStyle('paddingBottom')) + 'px';
+ }
+ ;
+ return val;
+ }
+ : function(name) {
+ return getComputedStyle(elem, null)[name];
+ }
+ , minHeight = parseFloat(getStyle('height'));
+
+ elem.style.resize = 'none';
+
+ var change = function() {
+ var scrollTop, height, padding = 0, style = elem.style;
+
+ if (elem._length === elem.value.length)
+ return;
+ elem._length = elem.value.length;
+
+ if (!isFirefox && !isOpera) {
+ padding = parseInt(getStyle('paddingTop')) + parseInt(getStyle('paddingBottom'));
+ }
+ ;scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
+
+ elem.style.height = minHeight + 'px';
+ if (elem.scrollHeight > minHeight) {
+ if (maxHeight && elem.scrollHeight > maxHeight) {
+ height = maxHeight - padding;
+ style.overflowY = 'auto';
+ } else {
+ height = elem.scrollHeight - padding + 10;
+ style.overflowY = 'hidden';
+ }
+ ;style.height = height + extra + 'px';
+ scrollTop += parseInt(style.height) - elem.currHeight;
+ //document.body.scrollTop = scrollTop;
+ //document.documentElement.scrollTop = scrollTop;
+ elem.currHeight = parseInt(style.height);
+ }
+ ;
+ };
+
+ addEvent('propertychange', change);
+ addEvent('input', change);
+ addEvent('focus', change);
+ change();
+};
+
+// 点击按钮复制功能
+function jsCopy() {
+ var e = document.getElementById("copy_rep_content");
+ e.select();
+ document.execCommand("Copy");
+}
+
+// 使用resize事件监听窗口的zoom,如果zoom变化了,弹框提示;初始化时也检查zoom是否是100%。
+function _initZoomCheck() {
+ if (!IsPC()) {
+ // 手机端不需要提示
+ return;
+ }
+ var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100
+ if (!isNormalZoom) {
+ suofang();
+ }
+
+ $(window).resize(function() {
+ var isNormalZoom = Math.round(window.devicePixelRatio * 100) === 100
+ if (!isNormalZoom) {
+ suofang();
+ } else {
+ $('.task-btn.task-btn-orange:visible').click()
+ }
+ })
+
+}
+
+var win_resize = function() {
+ var _w = $(window).width() - 1200;
+ if (_w < 0) {
+ $('.newHeader>.educontent').width('auto')
+ } else {
+ $('.newHeader>.educontent').width('1200px')
+ }
+};
+
+function initWindowResize() {
+ if (location.pathname === '/login') {
+ // 登录页不需要
+ return;
+ }
+
+ $(function() {
+ setTimeout(function() {
+ win_resize();
+ }, 1000)
+ })
+
+ $(window).resize(function() {
+ win_resize()
+ })
+}
+initWindowResize();
+
+// 登录刷新 https://stackoverflow.com/questions/28230845/communication-between-tabs-or-windows
+if (window['BroadcastChannel']) {
+ var bc = new BroadcastChannel('ec_reload');
+ bc.onmessage = function(ev) {
+ if (window['ec_reload_msg_send_window']) {
+ window['ec_reload_msg_send_window'] = false;
+ } else {
+ location.reload();
+ }
+ }
+}
+function _sendReloadMsg() {
+ var bc = new BroadcastChannel('ec_reload');
+ window['ec_reload_msg_send_window'] = true;
+ // 消息发出的窗口,不需要处理该消息
+ bc.postMessage('ec_reload');
+ /* send */
+}
+// IE11 没有 startsWith
+if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function(searchString, position) {
+ position = position || 0;
+ return this.substr(position, searchString.length) === searchString;
+ }
+ ;
+ String.prototype.endsWith = function(search, this_len) {
+ if (this_len === undefined || this_len > this.length) {
+ this_len = this.length;
+ }
+ return this.substring(this_len - search.length, this_len) === search;
+ }
+ ;
+}
+
+function clickNewsubscript() {
+ $(".newsubscript").hide();
+ $(".newedbox").addClass("newminheight");
+ $(".newedbox").removeClass("newedboxheight");
+}
+
+/** tpm实训开启按钮,不允许多次点击 START */
+//点击模拟实战或者开启实战等,按钮变灰内容变成“开启中”
+var operationItem = null;
+var operationButtonOldValue = null;
+function opClickString(item) {
+ var value = $(item).html();
+ $(item).css({
+ 'background': 'gray',
+ 'border': '1px solid grey',
+ 'pointer-events': 'none'
+ });
+ $(item).html('开启中');
+
+ operationButtonOldValue = value
+ operationItem = item
+ // setTimeout(function(){ $(item).css('background', '#4CACFF');$(item).html(value); }, 4000)
+}
+//
+// var isOperationSending = false;
+$(document).bind('ajaxStop', function(event, xhr, settings) {
+ if (settings && settings.url && (settings.url.match(/operation\?/))) {
+ if (operationItem) {
+ $(operationItem).css('background', '#4CACFF').css('pointer-events', 'inherit');
+ $(operationItem).html(operationButtonOldValue);
+ }
+ }
+});
+$(document).bind('ajaxError', function(event, xhr, settings) {
+ if (settings && settings.url && (settings.url.match(/operation\?/))) {
+ if (operationItem) {
+ $(operationItem).css('background', '#4CACFF').css('pointer-events', 'inherit');
+ $(operationItem).html(operationButtonOldValue);
+ }
+ }
+});
+/** tpm实训开启按钮,不允许多次点击 END */
diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js
index ceddbd81b..dfd54f38b 100644
--- a/public/react/config/webpack.config.dev.js
+++ b/public/react/config/webpack.config.dev.js
@@ -114,21 +114,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// 上线然后要注释回来
- // {
- // test: /\.(js|jsx|mjs)$/,
- // enforce: 'pre',
- // use: [
- // {
- // options: {
- // formatter: eslintFormatter,
- // eslintPath: require.resolve('eslint'),
- //
- // },
- // loader: require.resolve('eslint-loader'),
- // },
- // ],
- // include: paths.appSrc,
- // },
+ {
+ test: /\.(js|jsx|mjs)$/,
+ enforce: 'pre',
+ use: [
+ {
+ options: {
+ formatter: eslintFormatter,
+ eslintPath: require.resolve('eslint'),
+
+ },
+ loader: require.resolve('eslint-loader'),
+ },
+ ],
+ include: paths.appSrc,
+ },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js
index 92feea0a4..abeb58db9 100644
--- a/public/react/config/webpack.config.prod.js
+++ b/public/react/config/webpack.config.prod.js
@@ -56,8 +56,8 @@ module.exports = {
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
- // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
- devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
+ devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
+ // devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js
index bd63aebe6..79134fc55 100755
--- a/public/react/public/js/js_min_all.js
+++ b/public/react/public/js/js_min_all.js
@@ -91,17 +91,6 @@ function initEditormdPasteUpload(e,i,o){e.cm.getInputField().addEventListener("p
// at http://marijnhaverbeke.nl/blog/#cm-internals .
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,s=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),u=a&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(u||h&&(null==x||x<12.11)),S=r||l&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,k=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function O(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}g?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(E=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null};function B(e,t){for(var r=0;r=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var Y=[""];function _(e){for(;Y.length<=e;)Y.push($(Y)+" ");return Y[e]}function $(e){return e[e.length-1]}function q(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,r){for(;(r<0?t>0:t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?ge(r,se(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?ge(e.line,t):r<0?ge(e.line,0):e}(t,se(e,t.line).text.length)}function Se(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new ke(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?ve(u.to,r)>=0:ve(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?ve(u.from,n)<=0:ve(u.from,n)<0)))return!0}}}function Be(e){for(var t;t=Ie(e);)e=t.find(-1,!0).line;return e}function Ge(e,t){var r=se(e,t),n=Be(r);return r==n?t:he(n)}function Ue(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!Ve(e,n))return t;for(;r=ze(n);)n=r.find(1,!0).line;return he(n)+1}function Ve(e,t){var r=Te&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var _e=null;function $e(e,t,r){var n;_e=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:_e=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:_e=i)}return null!=n?n:_e}var qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,u){var c="ltr"==u?"L":"R";if(0==a.length||"ltr"==u&&!r.test(a))return!1;for(var h,f=a.length,d=[],p=0;pe.text.length?null:n}function Je(e,t,r){var n=Qe(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function et(e,t,r,n,i){if(e){var o=Ze(r,t.doc.direction);if(o){var l,s=i<0?$(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0){var u=Ar(t,r);l=i<0?r.text.length-1:0;var c=Dr(t,u,l).top;l=le(function(e){return Dr(t,u,e).top==c},i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=Qe(r,l,1))}else l=i<0?s.to:s.from;return new ge(n,l,a)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}function tt(e,t,r,n){var i=Ze(t,e.doc.direction);if(!i)return Je(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=$e(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from=l.from&&f>=c.begin)){var d=h?"before":"after";return new ge(r.line,f,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new ge(r.line,a(e,1),"before"):new ge(r.line,e,"after")};e>=0&&e0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u0?c.end:a(c.begin,-1);return null==v||n>0&&v==t.text.length||!(g=p(n>0?0:i.length-1,n,u(v)))?null:g}var rt=[],nt=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||rt).concat(r)}};function it(e,t){return e._handlers&&e._handlers[t]||rt}function ot(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function lt(e,t){var r=it(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function ct(e){e.prototype.on=function(e,t){nt(this,e,t)},e.prototype.off=function(e,t){ot(this,e,t)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ft(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function pt(e){ht(e),ft(e)}function gt(e){return e.target||e.srcElement}function vt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var mt,yt,bt=function(){if(l&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function wt(e){if(null==mt){var t=O("span","");N(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var r=mt?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function xt(e){if(null!=yt)return yt;var t=N(e,document.createTextNode("AخA")),r=T(t,0,1).getBoundingClientRect(),n=T(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(yt=n.right-r.right<3)}var Ct,St=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Lt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Tt="oncopy"in(Ct=O("div"))||(Ct.setAttribute("oncopy","return;"),"function"==typeof Ct.oncopy),kt=null;var Mt={},Nt={};function Ot(e){if("string"==typeof e&&Nt.hasOwnProperty(e))e=Nt[e];else if(e&&"string"==typeof e.name&&Nt.hasOwnProperty(e.name)){var t=Nt[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ot("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ot("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Wt(e,t){t=Ot(t);var r=Mt[t.name];if(!r)return Wt(e,"text/plain");var n=r(e,t);if(At.hasOwnProperty(t.name)){var i=At[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var At={};function Dt(e,t){I(t,At.hasOwnProperty(e)?At[e]:At[e]={})}function Ht(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Pt(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Et(e,t,r){return!e.startState||e.startState(t,r)}var Ft=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};function It(e,t,r,n){var i=[e.state.modeGen],o={};jt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=function(r){var n=e.state.overlays[r],l=1,s=0;jt(e,t.text,n.mode,!0,function(e,t){for(var r=l;se&&i.splice(l,1,e,i[l+1],o),l+=2,s=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength?Ht(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Rt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=se(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=z(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}(e,t,r),l=o>n.first&&se(n,o-1).stateAfter;return l=l?Ht(n.mode,l):Et(n.mode),n.iter(o,t,function(r){Bt(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function Vt(e,t,r,n){var i,o=function(e){return{start:h.start,end:h.pos,string:h.current(),type:i||null,state:e?Ht(l.mode,c):c}},l=e.doc,s=l.mode;t=Ce(l,t);var a,u=se(l,t.line),c=Rt(e,t.line,r),h=new Ft(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pose.options.maxHighlightLength?(s=!1,l&&Bt(e,t,n,h.pos),h.pos=t.length,a=null):a=Kt(Ut(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.post},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Xt=function(e,t,r){this.text=e,De(this,t),this.height=r?r(this):1};function Yt(e){e.parent=null,Ae(e)}Xt.prototype.lineNo=function(){return he(this)},ct(Xt);var _t={},$t={};function qt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$t:_t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=W("span",null,null,a?"padding-right: .1px":null),n={pre:W("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(l||a)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,s=void 0;n.pos=0,n.addToken=Jt,xt(e.display.measure)&&(s=Ze(o,e.doc.direction))&&(n.addToken=er(n.addToken,s)),n.map=[],rr(o,n,zt(e,o,t!=e.display.externalMeasured&&he(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(wt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return lt(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function Qt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,r,n,i,o,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&h.from<=u);f++);if(h.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,h.to-u),i,o,null,s,a),o=null,n=n.slice(h.to-u),u=h.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y=[],b=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||Ee(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S=d)break;for(var T=Math.min(d,m);;){if(v){var k=p+v.length;if(!f){var M=k>T?v.slice(0,T-p):v;t.addToken(t,M,l?l+a:a,c,p+M.length==m?u:"",h,s)}if(k>=T){v=v.slice(T-p),p=T;break}p=k,c=""}v=i.slice(o,o=r[g++]),l=qt(r[g++],t.cm.options)}}else for(var N=1;Nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Or(e,t,r,n){return Dr(e,Ar(e,t),r,n)}function Wr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Er(t.map,r,n),a=o.node,u=o.start,c=o.end,h=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;u>0&&(h=n="right"),i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Jr(e.display),top:p.top,bottom:p.bottom}:Pr}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function Ir(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l("before"==u?a-1:a,"before"==u);function c(e,t,r){return l(r?e-1:e,s[t].level%2!=0!=r)}var h=$e(s,a,u),f=_e,d=c(a,h,"before"==u);return null!=f&&(d.other=c(a,f,"before"!=u)),d}function Xr(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=Jr(e.display)*t.ch);var n=se(e.doc,t.line),i=je(n)+Cr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Yr(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function _r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Yr(n.first,0,null,!0,-1);var i=fe(n,r),o=n.first+n.size-1;if(i>o)return Yr(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=se(n,i);;){var s=Zr(e,l,i,t,r),a=ze(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=he(l=u.to.line)}}function $r(e,t,r,n){var i=function(n){return Ur(e,t,Dr(e,r,n),"line")},o=t.text.length,l=le(function(e){return i(e-1).bottom<=n},o,0);return{begin:l,end:o=le(function(e){return i(e).top>n},l,o)}}function qr(e,t,r,n){return $r(e,t,r,Ur(e,t,Dr(e,r,n),"line").top)}function Zr(e,t,r,n,i){i-=je(t);var o,l=0,s=t.text.length,a=Ar(e,t);if(Ze(t,e.doc.direction)){var u;if(e.options.lineWrapping)l=(u=$r(e,t,a,i)).begin,s=u.end;o=new ge(r,l);var c,h,f=jr(e,o,"line",t,a).left,d=fMath.abs(c)){if(p<0==c<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var g=le(function(r){var o=Ur(e,t,Dr(e,a,r),"line");return o.top>i?(s=Math.min(r,s),!0):!(o.bottom<=i)&&(o.left>n||!(o.rightv.right?1:0,o}function Qr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Hr){Hr=O("pre");for(var t=0;t<49;++t)Hr.appendChild(document.createTextNode("x")),Hr.appendChild(O("br"));Hr.appendChild(document.createTextNode("x"))}N(e.measure,Hr);var r=Hr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function Jr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("pre",[t]);N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function en(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:tn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function tn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function rn(e){var t=Qr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Jr(e.display)-3);return function(i){if(Ve(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().linet||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}(Ze(c,i.direction),r||0,null==n?h:n,function(e,t,i){var c,d,p,g=f(e,"left");if(e==t)c=g,d=p=g.left;else{if(c=f(t-1,"right"),"rtl"==i){var v=g;g=c,c=v}d=g.left,p=c.right}null==r&&0==e&&(d=s),c.top-g.top>3&&(u(d,g.top,null,g.bottom),d=s,g.bottoml.bottom||c.bottom==l.bottom&&c.right>l.right)&&(l=c),d0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function fn(e){e.state.focused||(e.display.input.focus(),dn(e))}function dn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(lt(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function pn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(lt(e,"blur",e,t),e.state.focused=!1,k(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function gn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=tn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l.001||c<-.001)&&(ce(i.line,o),yn(i.line),i.rest))for(var h=0;h=l&&(o=fe(t,je(se(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function wn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,r||oi(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),r&&oi(e),ei(e,100))}function xn(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,gn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}var Cn=0,Sn=null;function Ln(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Tn(e){var t=Ln(e);return t.x*=Sn,t.y*=Sn,t}function kn(e,t){var n=Ln(t),i=n.x,o=n.y,l=e.display,s=l.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&a)e:for(var f=t.target,d=l.view;f!=s;f=f.parentNode)for(var p=0;pe.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Nn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Nn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Nn.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Nn.prototype.enableZeroWidthBar=function(e,t){e.style.pointerEvents="auto",t.set(1e3,function r(){var n=e.getBoundingClientRect();document.elementFromPoint(n.left+1,n.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Nn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var On=function(){};function Wn(e,t){t||(t=Mn(e));var r=e.display.barWidth,n=e.display.barHeight;An(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&mn(e),An(e,Mn(e)),r=e.display.barWidth,n=e.display.barHeight}function An(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}On.prototype.update=function(){return{bottom:0,right:0}},On.prototype.setScrollLeft=function(){},On.prototype.setScrollTop=function(){},On.prototype.clear=function(){};var Dn={native:Nn,null:On};function Hn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Dn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),nt(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?xn(e,t):wn(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}function Pn(e,t){var r=e.display,n=Qr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Mr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sr(r),a=t.tops-n;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=kr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.leftf+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function En(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Fn(e){In(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?ge(t.line,t.ch-1):t,n=ge(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function In(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Xr(e,t.from),n=Xr(e,t.to),i=Pn(e,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-t.margin,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+t.margin});e.scrollTo(i.scrollLeft,i.scrollTop)}}var zn=0;function Rn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zn},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function Bn(e){!function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Un(e){var t=e.cm,r=t.display;e.updatedDisplay&&mn(t),e.barMeasure=Mn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Or(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function Vn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=O("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0);for(var o=0;o<5;o++){var l=!1,s=jr(e,t),a=r&&r!=t?jr(e,r):s,u=Pn(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(wn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(xn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;lt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Te&&Ge(e.doc,t)i.viewFrom?Zn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Zn(e);else if(t<=i.viewFrom){var o=Qn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Zn(e)}else if(r>=i.viewTo){var l=Qn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Zn(e)}else{var s=Qn(e,t,t,-1),a=Qn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(ir(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):Zn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[ln(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function Zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,r,n){var i,o=ln(e,t),l=e.display.view;if(!Te||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Ge(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Jn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ht(t.mode,Rt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=It(e,o,s?Ht(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&fr)return ei(e,e.options.workDelay),!0}),i.length&&jn(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Jn(e))return!1;vn(e)&&(Zn(e),t.dims=en(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Te&&(o=Ge(e.doc,o),l=Ue(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,ln(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=je(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=Jn(e);if(!s&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=D();return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,h=0;h-1&&(d=!1),ur(e,f,c,r)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(pe(e.options,c)))),l=f.node.nextSibling}else{var p=vr(e,f,c,r);o.insertBefore(p,l)}c+=f.size}for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,c&&D()!=c&&c.offsetHeight&&c.focus(),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ei(e,400)),r.updateLineNumbers=null,!0}function ii(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=kr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Mr(e),r.top)}),t.visible=bn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ni(e,t);n=!1){mn(e);var i=Mn(e);sn(e),Wn(e,i),si(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function oi(e,t){var r=new ri(e,t);if(ni(e,r)){mn(e),ii(e,r);var n=Mn(e);sn(e),Wn(e,n),si(e,n),r.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function si(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function ai(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ri.prototype.signal=function(e,t){ut(e,t)&&this.events.push(arguments)},ri.prototype.finish=function(){for(var e=0;e=0&&ve(e,n.to())<=0)return r}return-1};var hi=function(e,t){this.anchor=e,this.head=t};function fi(e,t){var r=e[t];e.sort(function(e,t){return ve(e.from(),t.from())}),t=B(e,r);for(var n=1;n=0){var l=we(o.from(),i.from()),s=be(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new hi(a?s:l,a?l:s))}}return new ci(e,t)}function di(e,t){return new ci([new hi(e,t||e)],0)}function pi(e){return e.text?ge(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function gi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return pi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=pi(t).ch-t.to.ch),ge(r,n)}function vi(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}sr(e,"change",e,t)}function Ci(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;ls-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Mi(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(i,i.lastOp==n)))l=$(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,l.to)?l.to=pi(t):o.changes.push(ki(e,t));else{var a=$(i.done);for(a&&a.ranges||Wi(e.sel,i.done),o={changes:[ki(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||lt(e,"historyAdded")}function Oi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,$(i.done),t))?i.done[i.done.length-1]=t:Wi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Mi(i.undone)}function Wi(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ai(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Di(e){if(!e)return null;for(var t,r=0;r-1&&($(s)[h]=u[h],delete u[h])}}}return n}function Ei(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=ve(r,i)<0;o!=ve(n,i)<0?(i=r,r=n):o!=ve(r,n)<0&&(r=n)}return new hi(i,r)}return new hi(n||r,r)}function Fi(e,t,r,n){Gi(e,new ci([Ei(e,e.sel.primary(),t,r)],0),n)}function Ii(e,t,r){for(var n=[],i=0;i=t.ch:s.to>t.ch))){if(i&&(lt(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=_i(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=ve(u,r))&&(n<0?c<0:c>0))return Xi(e,u,t,n,i)}var h=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(h=_i(e,h,n,h.line==t.line?o:null)),h?Xi(e,h,t,n,i):null}}return t}function Yi(e,t,r,n,i){var o=n||1,l=Xi(e,t,r,o,i)||!i&&Xi(e,t,r,o,!0)||Xi(e,t,r,-o,i)||!i&&Xi(e,t,r,-o,!0);return l||(e.cantEdit=!0,ge(e.first,0))}function _i(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:r>0&&t.ch==(n||se(e,t.line)).text.length?t.line0)){var c=[a,1],h=ve(u.from,s.from),f=ve(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Qi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Qi(e,t)}}function Qi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var r=vi(e,t);Ni(e,t,r,e.cm?e.cm.curOp.id:NaN),to(e,t,r,Oe(e,t));var n=[];Ci(e,function(e,r){r||-1!=B(n,e.history)||(oo(e.history,t),n.push(e.history)),to(e,t,null,Oe(e,t))})}}function Ji(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a=0;--f){var d=h(f);if(d)return d.v}}}}function eo(e,t){if(0!=t&&(e.first+=t,e.sel=new ci(q(e.sel.ranges,function(e){return new hi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){$n(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ge(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ae(e,t.from,t.to),r||(r=vi(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=he(Be(se(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0}));n.sel.contains(t.from,t.to)>-1&&at(e);xi(n,t,r,rn(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=Xe(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));n.frontier=Math.min(n.frontier,o.line),ei(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?$n(e):o.line!=l.line||1!=t.text.length||wi(e.doc,t)?$n(e,o.line,l.line+1,u):qn(e,o.line,"text");var c=ut(e,"changes"),h=ut(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&sr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):xi(e,t,n),Ui(e,r,V)}}function ro(e,t,r,n,i){if(n||(n=r),ve(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Zi(e,{from:r,to:n,text:t,origin:i})}function no(e,t,r,n){r1||!(this.children[0]instanceof so))){var s=[];this.collapse(s),this.children=[new so(s)],this.children[0].parent=this}},ao.prototype.collapse=function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,s=l;s10);e.parent.maybeSpill()}},ao.prototype.iterN=function(e,t,r){for(var n=0;n0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=W("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Re(e,t.line,t,r,o)||t.line!=r.line&&Re(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Te=!0}o.addToHistory&&Ni(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Be(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ce(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new ke(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Ve(e,t)&&ce(t,0)}),o.clearOnEnter&&nt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Le=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ho,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)$n(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)qn(u,c,"text");o.atomic&&Ki(u.doc),sr(u,"markerAdded",u,o)}return o}fo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Rn(e),ut(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&$n(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ki(e.doc)),e&&sr(e,"markerCleared",e,this,n,i),t&&Bn(e),this.parent&&this.parent.clear()}},fo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;a--)Zi(this,n[a]);s?Bi(this,s):this.cm&&Fn(this.cm)}),undo:_n(function(){Ji(this,"undo")}),redo:_n(function(){Ji(this,"redo")}),undoSelection:_n(function(){Ji(this,"undo",!0)}),redoSelection:_n(function(){Ji(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=Ce(this,e),t=Ce(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=o,++r}),Ce(this,ge(r,t))},indexFromPos:function(e){var t=(e=Ce(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Ui(t.doc,di(r,r)),h)for(var f=0;f=0;t--)ro(e.doc,"",n[t].from,n[t].to,"+delete");Fn(e)})}Ao.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ao.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ao.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ao.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ao.default=y?Ao.macDefault:Ao.pcDefault;var Ro={selectAll:$i,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return zo(e,function(t){if(t.empty()){var r=se(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new ge(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=se(e.doc,i.line-1).text;l&&(i=new ge(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ge(i.line-1,l.length-1),i,"+transpose"))}r.push(new hi(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return jn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ni-400&&0==ve(Yo.pos,r)?n="triple":Xo&&Xo.time>i-400&&0==ve(Xo.pos,r)?(n="double",Yo={time:i,pos:r}):(n="single",Xo={time:i,pos:r});var o,u=e.doc.sel,c=y?t.metaKey:t.ctrlKey;e.options.dragDrop&&bt&&!e.isReadOnly()&&"single"==n&&(o=u.contains(r))>-1&&(ve((o=u.ranges[o]).from(),r)<0||r.xRel>0)&&(ve(o.to(),r)>0||r.xRel<0)?function(e,t,r,n){var i=e.display,o=+new Date,u=Xn(e,function(c){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,ot(document,"mouseup",u),ot(i.scroller,"drop",u),Math.abs(t.clientX-c.clientX)+Math.abs(t.clientY-c.clientY)<10&&(ht(c),!n&&+new Date-200-1?c[a]:new hi(r,r)):(s=l.sel.primary(),a=l.sel.primIndex);if(b?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(s=new hi(r,r)),r=on(e,t,!0,!0),a=-1;else if("double"==n){var h=e.findWordAt(r);s=e.display.shift||l.extend?Ei(l,s,h.anchor,h.head):h}else if("triple"==n){var f=new hi(ge(r.line,0),Ce(l,ge(r.line+1,0)));s=e.display.shift||l.extend?Ei(l,s,f.anchor,f.head):f}else s=Ei(l,s,r);i?-1==a?(a=c.length,Gi(l,fi(c.concat([s]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"single"==n&&!t.shiftKey?(Gi(l,fi(c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),u=l.sel):zi(l,a,s,K):(a=0,Gi(l,new ci([s],0),K),u=l.sel);var d=r;var p=o.wrapper.getBoundingClientRect(),g=0;function v(t){var i=++g,c=on(e,t,!0,"rect"==n);if(c)if(0!=ve(c,d)){e.curOp.focus=D(),function(t){if(0==ve(d,t))return;if(d=t,"rect"==n){for(var i=[],o=e.options.tabSize,c=z(se(l,r.line).text,r.ch,o),h=z(se(l,t.line).text,t.ch,o),f=Math.min(c,h),p=Math.max(c,h),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=se(l,g).text,y=X(m,f,o);f==p?i.push(new hi(ge(g,y),ge(g,y))):m.length>y&&i.push(new hi(ge(g,y),ge(g,X(m,p,o))))}i.length||i.push(new hi(r,r)),Gi(l,fi(u.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=w.anchor,C=t;if("single"!=n)ve((b="double"==n?e.findWordAt(t):new hi(ge(t.line,0),Ce(l,ge(t.line+1,0)))).anchor,x)>0?(C=b.head,x=we(w.from(),b.anchor)):(C=b.anchor,x=be(w.to(),b.head));var S=u.ranges.slice(0);S[a]=new hi(Ce(l,x),C),Gi(l,fi(S,a),K)}}(c);var h=bn(o,l);(c.line>=h.to||c.linep.bottom?20:0;f&&setTimeout(Xn(e,function(){g==i&&(o.scroller.scrollTop+=f,v(t))}),50)}}function m(t){e.state.selectingText=!1,g=1/0,ht(t),o.input.focus(),ot(document,"mousemove",y),ot(document,"mouseup",w),l.history.lastSelOrigin=null}var y=Xn(e,function(e){vt(e)?v(e):m(e)}),w=Xn(e,m);e.state.selectingText=w,nt(document,"mousemove",y),nt(document,"mouseup",w)}(e,t,r,n,c)}(t,e,n):gt(e)==r.scroller&&ht(e);break;case 2:a&&(t.state.lastMiddleDown=+new Date),n&&Fi(t.doc,n),setTimeout(function(){return r.input.focus()},20),ht(e);break;case 3:S?tl(t,e):function(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,pn(e))},100)}(t)}}}function Jo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ht(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!ut(e,r))return dt(t);o-=s.top-l.viewOffset;for(var a=0;a=i)return lt(e,r,e,fe(e.doc,o),e.options.gutters[a],t),dt(t)}}function el(e,t){return Jo(e,t,"gutterClick",!0)}function tl(e,t){xr(e.display,t)||function(e,t){if(!ut(e,"gutterContextMenu"))return!1;return Jo(e,t,"gutterContextMenu",!1)}(e,t)||st(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rr(e)}var nl={toString:function(){return"CodeMirror.Init"}},il={},ol={};function ll(e){ai(e),$n(e),gn(e)}function sl(e,t,r){if(!t!=!(r&&r!=nl)){var n=e.display.dragFunctions,i=t?nt:ot;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function al(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(k(e.display.wrapper,"CodeMirror-wrap"),Ye(e)),nn(e),$n(e),Rr(e),setTimeout(function(){return Wn(e)},100)}function ul(e,t){var n=this;if(!(this instanceof ul))return new ul(e,t);this.options=t=t?I(t):{},I(il,t,!1),ui(t);var i=t.value;"string"==typeof i&&(i=new bo(i,t.mode,null,t.lineSeparator,t.direction)),this.doc=i;var o=new ul.inputStyles[t.inputStyle](this),u=this.display=new function(e,t,n){var i=this;this.input=n,i.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=W("div",null,"CodeMirror-code"),i.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=O("div",null,"CodeMirror-cursors"),i.measure=O("div",null,"CodeMirror-measure"),i.lineMeasure=O("div",null,"CodeMirror-measure"),i.lineSpace=W("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=W("div",[i.lineSpace],"CodeMirror-lines");i.mover=O("div",[o],null,"position: relative"),i.sizer=O("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=O("div",null,null,"position: absolute; height: "+G+"px; width: 1px;"),i.gutters=O("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=O("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=O("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),l&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),a||r&&m||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}(e,i,o);for(var c in u.wrapper.CodeMirror=this,ai(this),rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!m&&u.input.focus(),l&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;nt(t.scroller,"mousedown",Xn(e,Qo)),nt(t.scroller,"dblclick",l&&s<11?Xn(e,function(t){if(!st(e,t)){var r=on(e,t);if(r&&!el(e,t)&&!xr(e.display,t)){ht(t);var n=e.findWordAt(r);Fi(e.doc,n.anchor,n.head)}}}):function(t){return st(e,t)||ht(t)});S||nt(t.scroller,"contextmenu",function(t){return tl(e,t)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}nt(t.scroller,"touchstart",function(i){if(!st(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),nt(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),nt(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!xr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new hi(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new hi(ge(s.line,0),Ce(e.doc,ge(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),ht(r)}i()}),nt(t.scroller,"touchcancel",i),nt(t.scroller,"scroll",function(){t.scroller.clientHeight&&(wn(e,t.scroller.scrollTop),xn(e,t.scroller.scrollLeft,!0),lt(e,"scroll",e))}),nt(t.scroller,"mousewheel",function(t){return kn(e,t)}),nt(t.scroller,"DOMMouseScroll",function(t){return kn(e,t)}),nt(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){st(e,t)||pt(t)},over:function(t){st(e,t)||(!function(e,t){var r=on(e,t);if(r){var n=document.createDocumentFragment();un(e,r,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(e,t),pt(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-wo<100))pt(t);else if(!st(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),h&&r.parentNode.removeChild(r)}}(e,t)},drop:Xn(e,xo),leave:function(t){st(e,t)||Co(e)}};var a=t.input.getField();nt(a,"keyup",function(t){return qo.call(e,t)}),nt(a,"keydown",Xn(e,$o)),nt(a,"keypress",Xn(e,Zo)),nt(a,"focus",function(t){return dn(e,t)}),nt(a,"blur",function(t){return pn(e,t)})}(this),To(),Rn(this),this.curOp.forceUpdate=!0,Si(this,i),t.autofocus&&!m||this.hasFocus()?setTimeout(F(dn,this),20):pn(this),ol)ol.hasOwnProperty(c)&&ol[c](n,t[c],nl);vn(this),t.finishInit&&t.finishInit(this);for(var d=0;d150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?z(se(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f1)if(fl&&fl.text.join("\n")==t){if(n.ranges.length%fl.text.length==0){u=[];for(var c=0;c=0;h--){var f=n.ranges[h],d=f.from(),p=f.to();f.empty()&&(r&&r>0?d=ge(d.line,d.ch-r):e.state.overwrite&&!s?p=ge(p.line,Math.min(se(o,p.line).text.length,p.ch+$(a).length)):fl&&fl.lineWise&&fl.text.join("\n")==t&&(d=p=ge(d.line,0))),l=e.curOp.updateInput;var g={from:d,to:p,text:u?u[h%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};Zi(e.doc,g),sr(e,"inputRead",e,g)}t&&!s&&vl(e,t),Fn(e),e.curOp.updateInput=l,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function gl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||jn(t,function(){return pl(t,r,0,null,"paste")}),!0}function vl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s-1){l=hl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=hl(e,i.head.line,"smart"));l&&sr(e,"electricInput",e,i.head.line)}}}function ml(e){for(var t=[],r=[],n=0;n=e.first+e.size||(t=new ge(l,t.ch,t.sticky),!(s=se(e,l))))return!1;t=et(i,e.cm,s,t.line,r)}else t=o;return!0}if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,c="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||a(!f);f=!1){var d=s.text.charAt(t.ch)||"\n",p=te(d,h)?"w":c&&"\n"==d?"n":!c||/\s/.test(d)?null:"p";if(!c||f||p||(p="s"),u&&u!=p){r<0&&(r=1,a(),t.sticky="after");break}if(p&&(u=p),r>0&&!a(!f))break}var g=Yi(e,t,o,l,!0);return me(o,g)&&(g.hitSide=!0),g}function xl(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*Qr(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=_r(e,s,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var Cl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Sl(e,t){var r=Wr(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Nr(r,n,t.line),o=Ze(n,e.doc.direction),l="left";o&&(l=$e(o,t.ch)%2?"right":"left");var s=Er(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Ll(e,t){return t&&(e.bad=!0),e}function Tl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ll(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;in.firstLine()&&(l=ge(l.line-1,se(n.doc,l.line-1).length)),s.ch==se(n.doc,s.line).text.length&&s.linei.viewTo-1)return!1;l.line==i.viewFrom||0==(e=ln(n,l.line))?(t=he(i.view[0].line),r=i.view[0].node):(t=he(i.view[e].line),r=i.view[e-1].node.nextSibling);var a,u,c=ln(n,s.line);if(c==i.view.length-1?(a=i.viewTo-1,u=i.lineDiv.lastChild):(a=he(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator();function a(){l&&(o+=s,l=!1)}function u(e){e&&(a(),o+=e)}function c(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void u(r||t.textContent.replace(/\u200b/g,""));var o,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(ge(n,0),ge(i+1,0),(g=+h,function(e){return e.id==g}));return void(f.length&&(o=f[0].find())&&u(ae(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var d=/^(pre|div|p)$/i.test(t.nodeName);d&&a();for(var p=0;p1&&f.length>1;)if($(h)==$(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),t++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);dl.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=ge(t,d),C=ge(a,f.length?$(f).length-p:0);return h.length>1||h[0]||ve(x,C)?(ro(n.doc,h,x,C,"+input"),!0):void 0},Cl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Cl.prototype.reset=function(){this.forceCompositionEnd()},Cl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Cl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Cl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||jn(this.cm,function(){return $n(e.cm)})},Cl.prototype.setUneditable=function(e){e.contentEditable="false"},Cl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Xn(this.cm,pl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Cl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Cl.prototype.onContextMenu=function(){},Cl.prototype.resetPosition=function(){},Cl.prototype.needsContentAttribute=!0;var Ml=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Ml.prototype.init=function(e){var t=this,r=this,n=this.cm,i=this.wrapper=bl(),o=this.textarea=i.firstChild;function a(e){if(!st(n,e)){if(n.somethingSelected())dl({lineWise:!1,text:n.getSelections()}),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=fl.text.join("\n"),E(o));else{if(!n.options.lineWiseCopyCut)return;var t=ml(n);dl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,V):(r.prevInput="",o.value=t.text.join("\n"),E(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(i,e.wrapper.firstChild),g&&(o.style.width="0px"),nt(o,"input",function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),nt(o,"paste",function(e){st(n,e)||gl(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),nt(o,"cut",a),nt(o,"copy",a),nt(e.scroller,"paste",function(t){xr(e,t)||st(n,t)||(n.state.pasteIncoming=!0,r.focus())}),nt(e.lineSpace,"selectstart",function(t){xr(e,t)||ht(t)}),nt(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),nt(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Ml.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=an(e);if(e.options.moveInputWithCursor){var i=jr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},Ml.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ml.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary(),a=(t=Tt&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3))?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&E(this.textarea),l&&s>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Ml.prototype.getField=function(){return this.textarea},Ml.prototype.supportsTouch=function(){return!1},Ml.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ml.prototype.blur=function(){this.textarea.blur()},Ml.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ml.prototype.receivedFocus=function(){this.slowPoll()},Ml.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ml.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},Ml.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Lt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,i.length);a1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ml.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ml.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ml.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea,o=on(r,e),u=n.scroller.scrollTop;if(o&&!h){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Xn(r,Gi)(r.doc,di(o),V);var c=i.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d,p=t.wrapper.getBoundingClientRect();if(i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(d=window.scrollY),n.input.focus(),a&&window.scrollTo(null,d),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&s>=9&&v(),S){pt(e);var g=function(){ot(window,"mouseup",g),setTimeout(m,20)};nt(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function m(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=c,l&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart){(!l||l&&s<9)&&v();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Xn(r,$i)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Ml.prototype.readOnlyChanged=function(e){e||this.reset()},Ml.prototype.setUneditable=function(){},Ml.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=nl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=nl,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,yi(e)},!0),r("indentUnit",2,yi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){bi(e),Rr(e),$n(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(ge(n,o))}n++});for(var i=r.length-1;i>=0;i--)ro(e.doc,t,r[i],ge(r[i].line,r[i].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=nl&&e.refresh()}),r("specialCharPlaceholder",Qt,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){rl(e),ll(e)},!0),r("keyMap","default",function(e,t,r){var n=Io(t),i=r!=nl&&Io(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),r("extraKeys",null),r("lineWrapping",!1,al,!0),r("gutters",[],function(e){ui(e.options),ll(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?tn(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return Wn(e)},!0),r("scrollbarStyle","native",function(e){Hn(e),Wn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e){ui(e.options),ll(e)},!0),r("firstLineNumber",1,ll,!0),r("lineNumberFormatter",function(e){return e},ll,!0),r("showCursorWhenSelecting",!1,sn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("readOnly",!1,function(e,t){"nocursor"==t?(pn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,sl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,sn,!0),r("singleCursorHeightPerLine",!0,sn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,bi,!0),r("addModeClass",!1,bi,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,bi,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(ul),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Xn(this,t[e])(this,r,i),lt(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Io(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(hl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Fn(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a0&&zi(this.doc,n,new hi(o,u[n].to()),V)}}}),getTokenAt:function(e,t){return Vt(this,e,t)},getLineTokens:function(e,t){return Vt(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=zt(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]o&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Ur(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-je(n):0)},defaultTextHeight:function(){return Qr(this.display)},defaultCharWidth:function(){return Jr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,s,a=this.display,u=(e=jr(this,Ce(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var h=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Pn(o,l)).scrollTop&&wn(o,s.scrollTop),null!=s.scrollLeft&&xn(o,s.scrollLeft))},triggerOnKeyDown:Yn($o),triggerOnKeyPress:Yn(Zo),triggerOnKeyUp:qo,execCommand:function(e){if(Ro.hasOwnProperty(e))return Ro[e].call(null,this)},triggerElectric:Yn(function(e){vl(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),l=0;l0&&l(t.charAt(r-1));)--r;for(;n.5)&&nn(this),lt(this,"refresh",this)}),swapDoc:Yn(function(e){var t=this.doc;return t.cm=null,Si(this,e),Rr(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ct(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(ul);var Nl="iter insert remove copy getEditor constructor".split(" ");for(var Ol in bo.prototype)bo.prototype.hasOwnProperty(Ol)&&B(Nl,Ol)<0&&(ul.prototype[Ol]=function(e){return function(){return e.apply(this.doc,arguments)}}(bo.prototype[Ol]));return ct(bo),ul.inputStyles={textarea:Ml,contenteditable:Cl},ul.defineMode=function(e){ul.defaults.mode||"null"==e||(ul.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}.apply(this,arguments)},ul.defineMIME=function(e,t){Nt[e]=t},ul.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ul.defineMIME("text/plain","null"),ul.defineExtension=function(e,t){ul.prototype[e]=t},ul.defineDocExtension=function(e,t){bo.prototype[e]=t},ul.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(nt(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=ul(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=ot,e.on=nt,e.wheelEventPixels=Tn,e.Doc=bo,e.splitLines=St,e.countColumn=z,e.findColumn=X,e.isWordChar=ee,e.Pass=U,e.signal=lt,e.Line=Xt,e.changeEnd=pi,e.scrollbarModel=Dn,e.Pos=ge,e.cmpPos=ve,e.modes=Mt,e.mimeModes=Nt,e.resolveMode=Ot,e.getMode=Wt,e.modeExtensions=At,e.extendMode=Dt,e.copyState=Ht,e.startState=Et,e.innerMode=Pt,e.commands=Ro,e.keyMap=Ao,e.keyName=Fo,e.isModifierKey=Eo,e.lookupKey=Po,e.normalizeKeyMap=Ho,e.StringStream=Ft,e.SharedTextMarker=go,e.TextMarker=fo,e.LineWidget=uo,e.e_preventDefault=ht,e.e_stopPropagation=ft,e.e_stop=pt,e.addClass=H,e.contains=A,e.rmClass=k,e.keyNames=Mo}(ul),ul.version="5.25.0",ul});
-// ----------------------------- ----------------------------- active-line.js
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",i="CodeMirror-activeline-gutter";function r(e){for(var r=0;r!?|~^]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function v(e,t,r){return n=e,a=r,t}function m(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,a=!1;if(c&&"@"==e.peek()&&e.match(p))return t.tokenize=m,v("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||a);)a=!a&&"\\"==n;return a||(t.tokenize=m),v("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return v("number","number");if("."==n&&e.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&e.eat(">"))return v("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),v("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),v("number","number");if("/"==n)return e.eat("*")?(t.tokenize=y,y(e,t)):e.eat("/")?(e.skipToEnd(),v("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),v("regexp","string-2")):(e.eatWhile(d),v("operator","operator",e.current()));if("`"==n)return t.tokenize=b,b(e,t);if("#"==n)return e.skipToEnd(),v("error","error");if(d.test(n))return e.eatWhile(d),v("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var a=e.current(),i=s.propertyIsEnumerable(a)&&s[a];return i&&"."!=t.lastType?v(i.type,i.style,a):v("variable","variable",a)}}function y(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=m;break}n="*"==r}return v("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=m;break}n=!n&&"\\"==r}return v("quasi","string-2",e.current())}var k="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=k.indexOf(o);if(c>=0&&c<3){if(!n){++i;break}if(0==--n)break}else if(c>=3&&c<6)++n;else if(f.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}var h={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function g(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function w(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var j={state:null,column:null,marked:null,cc:null};function M(){for(var e=arguments.length-1;e>=0;e--)j.cc.push(arguments[e])}function V(){return M.apply(null,arguments),!0}function E(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=j.state;if(n.context){if(j.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}var I={name:"this",next:{name:"arguments"}};function z(){j.state.context={prev:j.state.context,vars:j.state.localVars},j.state.localVars=I}function T(){j.state.localVars=j.state.context.vars,j.state.context=j.state.context.prev}function A(e,t){var r=function(){var r=j.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new g(n,j.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function C(){var e=j.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function $(e){return function t(r){return r==e?V():";"==e?M():V(t)}}function q(e,t){return"var"==e?V(A("vardef",t.length),te,$(";"),C):"keyword a"==e?V(A("form"),O,q,C):"keyword b"==e?V(A("form"),q,C):"{"==e?V(A("}"),Z,C):";"==e?V():"if"==e?("else"==j.state.lexical.info&&j.state.cc[j.state.cc.length-1]==C&&j.state.cc.pop()(),V(A("form"),O,q,C,oe)):"function"==e?V(de):"for"==e?V(A("form"),ce,q,C):"variable"==e?V(A("stat"),J):"switch"==e?V(A("form"),O,A("}","switch"),$("{"),Z,C,C):"case"==e?V(O,$(":")):"default"==e?V($(":")):"catch"==e?V(A("form"),z,$("("),pe,$(")"),q,C,T):"module"==e?V(A("form"),z,ke,T,C):"class"==e?V(A("form"),ve,C):"export"==e?V(A("form"),xe,C):"import"==e?V(A("form"),he,C):M(A("stat"),O,$(";"),C)}function O(e){return S(e,!1)}function P(e){return S(e,!0)}function S(e,t){if(j.state.fatArrowAt==j.stream.start){var r=t?G:F;if("("==e)return V(z,A(")"),X(re,")"),C,$("=>"),r,T);if("variable"==e)return M(z,re,$("=>"),r,T)}var n=t?U:H;return h.hasOwnProperty(e)?V(n):"function"==e?V(de,n):"keyword c"==e?V(t?N:W):"("==e?V(A(")"),W,Ve,$(")"),C,n):"operator"==e||"spread"==e?V(t?P:O):"["==e?V(A("]"),je,C,n):"{"==e?Y(L,"}",null,n):"quasi"==e?M(B,n):V()}function W(e){return e.match(/[;\}\)\],]/)?M():M(O)}function N(e){return e.match(/[;\}\)\],]/)?M():M(P)}function H(e,t){return","==e?V(O):U(e,t,!1)}function U(e,t,r){var n=0==r?H:U,a=0==r?O:P;return"=>"==e?V(z,r?G:F,T):"operator"==e?/\+\+|--/.test(t)?V(n):"?"==t?V(O,$(":"),a):V(a):"quasi"==e?M(B,n):";"!=e?"("==e?Y(P,")","call",n):"."==e?V(K,n):"["==e?V(A("]"),W,$("]"),C,n):void 0:void 0}function B(e,t){return"quasi"!=e?M():"${"!=t.slice(t.length-2)?V(B):V(O,D)}function D(e){if("}"==e)return j.marked="string-2",j.state.tokenize=b,V(B)}function F(e){return x(j.stream,j.state),M("{"==e?q:O)}function G(e){return x(j.stream,j.state),M("{"==e?q:P)}function J(e){return":"==e?V(C,q):M(H,$(";"),C)}function K(e){if("variable"==e)return j.marked="property",V()}function L(e,t){return"variable"==e||"keyword"==j.style?(j.marked="property",V("get"==t||"set"==t?Q:R)):"number"==e||"string"==e?(j.marked=c?"property":j.style+" property",V(R)):"jsonld-keyword"==e?V(R):"["==e?V(O,$("]"),R):void 0}function Q(e){return"variable"!=e?M(R):(j.marked="property",V(de))}function R(e){return":"==e?V(P):"("==e?M(de):void 0}function X(e,t){function r(n){if(","==n){var a=j.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),V(e,r)}return n==t?V():V($(t))}return function(n){return n==t?V():M(e,r)}}function Y(e,t,r){for(var n=3;n=0;--l){var u=t.cc[l];if(u==C)c=c.prev;else if(u!=oe)break}"stat"==c.type&&"}"==a&&(c=c.prev),o&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var f=c.type,s=a==f;return"vardef"==f?c.indented+("operator"==t.lastType||","==t.lastType?c.info+1:0):"form"==f&&"{"==a?c.indented:"form"==f?c.indented+i:"stat"==f?c.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?o||i:0):"switch"!=c.info||s||0==r.doubleIndentSwitch?c.align?c.column+(s?0:1):c.indented+(s?0:i):c.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",lineComment:l?null:"//",fold:"brace",helperType:l?"json":"javascript",jsonldMode:c,jsonMode:l}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})});
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
@@ -530,16 +519,6 @@ function repository_extend_and_zoom(){
}
// end
-/*CodeMirror addon hint -----------------------------------------------Start*/
-/* https://github.com/farzher/fuzzysort */
-!function(e,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof module&&module.exports?module.exports=r():e.fuzzysort=r()}(this,function(){var e="undefined"!=typeof require&&"undefined"==typeof window,r=new Map,n=new Map,o=[];o.total=0;var t=[],i=[];function a(){r.clear(),n.clear(),t=[],i=[]}function l(e){for(var r=-9007199254740991,n=e.length-1;n>=0;--n){var o=e[n];if(null!==o){var t=o.score;t>r&&(r=t)}}return-9007199254740991===r?null:r}function f(e,r){var n=e[r];if(void 0!==n)return n;var o=r;Array.isArray(r)||(o=r.split("."));for(var t=o.length,i=-1;e&&++i>1]=e[n],t=1+(n<<1)}for(var a=n-1>>1;n>0&&o.score>1)e[n]=e[a];e[n]=o}return n.add=function(n){var o=r;e[r++]=n;for(var t=o-1>>1;o>0&&n.score>1)e[o]=e[t];e[o]=n},n.poll=function(){if(0!==r){var n=e[0];return e[0]=e[--r],o(),n}},n.peek=function(n){if(0!==r)return e[0]},n.replaceTop=function(r){e[0]=r,o()},n},p=s();return function d(c){var g={single:function(e,r,n){return e?(u(e)||(e=g.getPreparedSearch(e)),r?(u(r)||(r=g.getPrepared(r)),((n&&void 0!==n.allowTypo?n.allowTypo:!c||void 0===c.allowTypo||c.allowTypo)?g.algorithm:g.algorithmNoTypo)(e,r,e[0])):null):null},go:function(e,r,n){if(!e)return o;var t=(e=g.prepareSearch(e))[0],i=n&&n.threshold||c&&c.threshold||-9007199254740991,a=n&&n.limit||c&&c.limit||9007199254740991,s=(n&&void 0!==n.allowTypo?n.allowTypo:!c||void 0===c.allowTypo||c.allowTypo)?g.algorithm:g.algorithmNoTypo,d=0,v=0,h=r.length;if(n&&n.keys)for(var w=n.scoreFn||l,x=n.keys,y=x.length,m=h-1;m>=0;--m){for(var T=r[m],k=new Array(y),b=y-1;b>=0;--b)(_=f(T,B=x[b]))?(u(_)||(_=g.getPrepared(_)),k[b]=s(e,_,t)):k[b]=null;k.obj=T;var I=w(k);null!==I&&(Ip.peek().score&&p.replaceTop(k))))}else if(n&&n.key){var B=n.key;for(m=h-1;m>=0;--m)(_=f(T=r[m],B))&&(u(_)||(_=g.getPrepared(_)),null!==(C=s(e,_,t))&&(C.scorep.peek().score&&p.replaceTop(C)))))}else for(m=h-1;m>=0;--m){var _,C;(_=r[m])&&(u(_)||(_=g.getPrepared(_)),null!==(C=s(e,_,t))&&(C.scorep.peek().score&&p.replaceTop(C)))))}if(0===d)return o;var A=new Array(d);for(m=d-1;m>=0;--m)A[m]=p.poll();return A.total=d+v,A},goAsync:function(r,n,t){var i=!1,a=new Promise(function(a,p){if(!r)return a(o);var d=(r=g.prepareSearch(r))[0],v=s(),h=n.length-1,w=t&&t.threshold||c&&c.threshold||-9007199254740991,x=t&&t.limit||c&&c.limit||9007199254740991,y=(t&&void 0!==t.allowTypo?t.allowTypo:!c||void 0===c.allowTypo||c.allowTypo)?g.algorithm:g.algorithmNoTypo,m=0,T=0;function k(){if(i)return p("canceled");var s=Date.now();if(t&&t.keys)for(var c=t.scoreFn||l,b=t.keys,I=b.length;h>=0;--h){for(var B=n[h],_=new Array(I),C=I-1;C>=0;--C)(P=f(B,L=b[C]))?(u(P)||(P=g.getPrepared(P)),_[C]=y(r,P,d)):_[C]=null;_.obj=B;var A=c(_);if(null!==A&&!(Av.peek().score&&v.replaceTop(_)),h%1e3==0&&Date.now()-s>=10))return void(e?setImmediate(k):setTimeout(k))}else if(t&&t.key){for(var L=t.key;h>=0;--h)if((P=f(B=n[h],L))&&(u(P)||(P=g.getPrepared(P)),null!==(j=y(r,P,d))&&!(j.scorev.peek().score&&v.replaceTop(j)),h%1e3==0&&Date.now()-s>=10)))return void(e?setImmediate(k):setTimeout(k))}else for(;h>=0;--h){var P,j;if((P=n[h])&&(u(P)||(P=g.getPrepared(P)),null!==(j=y(r,P,d))&&!(j.scorev.peek().score&&v.replaceTop(j)),h%1e3==0&&Date.now()-s>=10)))return void(e?setImmediate(k):setTimeout(k))}if(0===m)return a(o);for(var N=new Array(m),S=m-1;S>=0;--S)N[S]=v.poll();N.total=m+T,a(N)}e?setImmediate(k):k()});return a.cancel=function(){i=!0},a},highlight:function(e,r,n){if(null===e)return null;void 0===r&&(r=""),void 0===n&&(n="");for(var o="",t=0,i=!1,a=e.target,l=a.length,f=e.indexes,u=0;u999)return g.prepare(e);var n=r.get(e);return void 0!==n?n:(n=g.prepare(e),r.set(e,n),n)},getPreparedSearch:function(e){if(e.length>999)return g.prepareSearch(e);var r=n.get(e);return void 0!==r?r:(r=g.prepareSearch(e),n.set(e,r),r)},algorithm:function(e,r,n){for(var o=r._targetLowerCodes,a=e.length,l=o.length,f=0,u=0,s=0,p=0;;){if(n===o[u]){if(t[p++]=u,++f===a)break;n=e[0===s?f:s===f?f+1:s===f-1?f-1:f]}if(++u>=l)for(;;){if(f<=1)return null;if(0===s){if(n===e[--f])continue;s=f}else{if(1===s)return null;if((n=e[1+(f=--s)])===e[f])continue}u=t[(p=f)-1]+1;break}}f=0;var d=0,c=!1,v=0,h=r._nextBeginningIndexes;null===h&&(h=r._nextBeginningIndexes=g.prepareNextBeginningIndexes(r.target));var w=u=0===t[0]?0:h[t[0]-1];if(u!==l)for(;;)if(u>=l){if(f<=0){if(++d>a-2)break;if(e[d]===e[d+1])continue;u=w;continue}--f,u=h[i[--v]]}else if(e[0===d?f:d===f?f+1:d===f-1?f-1:f]===o[u]){if(i[v++]=u,++f===a){c=!0;break}++u}else u=h[u];if(c)var x=i,y=v;else x=t,y=p;for(var m=0,T=-1,k=0;k=0;--k)r.indexes[k]=x[k];return r},algorithmNoTypo:function(e,r,n){for(var o=r._targetLowerCodes,a=e.length,l=o.length,f=0,u=0,s=0;;){if(n===o[u]){if(t[s++]=u,++f===a)break;n=e[f]}if(++u>=l)return null}f=0;var p=!1,d=0,c=r._nextBeginningIndexes;if(null===c&&(c=r._nextBeginningIndexes=g.prepareNextBeginningIndexes(r.target)),(u=0===t[0]?0:c[t[0]-1])!==l)for(;;)if(u>=l){if(f<=0)break;--f,u=c[i[--d]]}else if(e[f]===o[u]){if(i[d++]=u,++f===a){p=!0;break}++u}else u=c[u];if(p)var v=i,h=d;else v=t,h=s;for(var w=0,x=-1,y=0;y=0;--y)r.indexes[y]=v[y];return r},prepareLowerCodes:function(e){for(var r=e.length,n=[],o=e.toLowerCase(),t=0;t=65&&l<=90,u=f||l>=97&&l<=122||l>=48&&l<=57,s=f&&!t||!i||!u;t=f,i=u,s&&(n[o++]=a)}return n},prepareNextBeginningIndexes:function(e){for(var r=e.length,n=g.prepareBeginningIndexes(e),o=[],t=n[0],i=0,a=0;aa?o[a]=t:(t=n[++i],o[a]=void 0===t?r:t);return o},cleanup:a,new:d};return g}()});
-/* showHint */
-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var i="CodeMirror-hint",e="CodeMirror-hint-active";function n(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",function(i){i=function(t,i,e){var n=t.options.hintOptions,o={};for(var s in a)o[s]=a[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);o.hint.resolve&&(o.hint=o.hint.resolve(t,i));return o}(this,this.getCursor("start"),i);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!i.hint.supportsSelection)return;for(var o=0;ol.clientHeight+1,x=h.getScrollInfo();if(C>0){var A=k.bottom-k.top;if(m.top-(m.bottom-k.top)-A>0)l.style.top=(v=m.top-A)+"px",y=!1;else if(A>H){l.style.height=H-5+"px",l.style.top=(v=m.bottom-k.top)+"px";var S=h.getCursor();o.from.ch!=S.ch&&(m=h.cursorCoords(S),l.style.left=(g=m.left)+"px",k=l.getBoundingClientRect())}}var T,M=k.right-w;if(M>0&&(k.right-k.left>w&&(l.style.width=w-5+"px",M-=k.right-k.left-w),l.style.left=(g=m.left-M)+"px"),b)for(var E=l.firstChild;E;E=E.nextSibling)E.style.paddingRight=h.display.nativeBarWidth+"px";(h.addKeyMap(this.keyMap=function(t,i){var e={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(1-i.menuSize(),!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close},n=t.options.customKeys,o=n?{}:e;function s(t,n){var s;s="string"!=typeof n?function(t){return n(t,i)}:e.hasOwnProperty(n)?e[n]:n,o[t]=s}if(n)for(var c in n)n.hasOwnProperty(c)&&s(c,n[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&s(c,r[c]);return o}(n,{moveFocus:function(t,i){s.changeActive(s.selectedHint+t,i)},setFocus:function(t){s.changeActive(t)},menuSize:function(){return s.screenAmount()},length:a.length,close:function(){n.close()},pick:function(){s.pick()},data:o})),n.options.closeOnUnfocus)&&(h.on("blur",this.onBlur=function(){T=setTimeout(function(){n.close()},100)}),h.on("focus",this.onFocus=function(){clearTimeout(T)}));return h.on("scroll",this.onScroll=function(){var t=h.getScrollInfo(),i=h.getWrapperElement().getBoundingClientRect(),e=v+x.top-t.top,o=e-(window.pageYOffset||(document.documentElement||document.body).scrollTop);if(y||(o+=l.offsetHeight),o<=i.top||o>=i.bottom)return n.close();l.style.top=e+"px",l.style.left=g+x.left-t.left+"px"}),t.on(l,"dblclick",function(t){var i=r(l,t.target||t.srcElement);i&&null!=i.hintId&&(s.changeActive(i.hintId),s.pick())}),t.on(l,"click",function(t){var i=r(l,t.target||t.srcElement);i&&null!=i.hintId&&(s.changeActive(i.hintId),n.options.completeOnSingleClick&&s.pick())}),t.on(l,"mousedown",function(){setTimeout(function(){h.focus()},20)}),t.signal(o,"select",a[0],l.firstChild),!0}function l(t,i,e,n){if(t.async)t(i,n,e);else{var o=t(i,e);o&&o.then?o.then(n):n(o)}}n.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,e){var n=i.list[e];n.hint?n.hint(this.cm,i,n):this.cm.replaceRange(c(n),n.from||i.from,n.to||i.to,"complete"),t.signal(i,"pick",n),this.close()},cursorActivity:function(){this.debounce&&(s(this.debounce),this.debounce=0);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch0&&n.to.ch-n.from.ch!=o.to.ch-o.from.ch)))&&(this.data=i,i&&i.list.length))if(s&&1==i.list.length)this.pick(i,0);else{if(1==i.list.length&&i.to.ch-i.from.ch===i.list[0].length)return;this.widget=new h(this,i),t.signal(i,"shown")}}},h.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,n){if(i>=this.data.list.length?i=n?this.data.list.length-1:0:i<0&&(i=n?0:this.data.list.length-1),this.selectedHint!=i){var o=this.hints.childNodes[this.selectedHint];o.className=o.className.replace(" "+e,""),(o=this.hints.childNodes[this.selectedHint=i]).className+=" "+e,o.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:function(i,e){var n,o=i.getHelpers(e,"hint");if(o.length){var s=function(t,i,e){var n=function(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n0?i(t):o(s+1)})}(0)};return s.async=!0,s.supportsSelection=!0,s}if(n=i.getHelper(i.getCursor(),"hintWords")){t.signal(i,"hinting",n);var c=i.state.myhints,r=n.slice(0);return c&&c.forEach(function(t){-1===n.indexOf(t)&&r.push(t)}),function(i){return t.hint.fromList(i,{words:r})}}return t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}}),t.registerHelper("hint","fromList",function(i,e){var n=i.getCursor(),o=i.getTokenAt(n),s=t.Pos(n.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var c=o.string,r=t.Pos(n.line,o.start);else c="",r=s;var h=[];if(fuzzysort&&fuzzysort.go){var l=fuzzysort.go(c,e.words);l&&l.forEach(function(t){h.push(t.target)})}else for(var a=0;a,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)});
-/* javascript-hint 注释掉,使得show-hint.js 的resolveAutoHints方法进入这个判断:} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { */
-// !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;rf.ch&&(c.end=f.ch,c.string=c.string.slice(0,f.ch-c.start)):c={start:f.ch,end:f.ch,string:"",state:c.state,type:"."==c.string?"property":null};for(var p=c;"property"==p.type;){if("."!=(p=s(i,e(f.line,p.start))).string)return;if(p=s(i,e(f.line,p.start)),!l)var l=[];l.push(p)}t.signal(i,"hinting");var u=i.state.myhints;return i.state.needToClearJSHint&&(o=[],i.state.needToClearJSHint=!1),u&&u.forEach(function(t){n(o,t)||o.push(t)}),{list:function(t,e,i,o){var s=[],a=t.string,f=o&&o.globalScope||window;function c(t){if(fuzzysort&&fuzzysort.single){var e=fuzzysort.single(a,t);e&&e.score<=0&&!n(s,t)&&s.push(t)}else 0!=t.lastIndexOf(a,0)||n(s,t)||s.push(t)}if(e&&e.length){var p,l=e.pop();for(l.type&&0===l.type.indexOf("variable")?(o&&o.additionalContext&&(p=o.additionalContext[l.string]),o&&!1===o.useGlobalScope||(p=p||f[l.string])):"string"==l.type?p="":"atom"==l.type?p=1:"function"==l.type&&(null==f.jQuery||"$"!=l.string&&"jQuery"!=l.string||"function"!=typeof f.jQuery?null!=f._&&"_"==l.string&&"function"==typeof f._&&(p=f._()):p=f.jQuery());null!=p&&e.length;)p=p[e.pop().string];null!=p&&function(t){"string"==typeof t?r(stringProps,c):t instanceof Array?r(arrayProps,c):t instanceof Function&&r(funcProps,c);!function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,c)}(p)}else{var u=fuzzysort.go(a,i);u&&u.forEach(function(t){s.push(t.target)})}return s}(c,l,o,a),from:e(f.line,c.start),to:e(f.line,c.end)}}}function o(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",function(t,e){return i(t,s,function(t,e){return t.getTokenAt(e)},e)}),t.registerHelper("hint","coffeescript",function(t,e){return i(t,coffeescriptKeywords,o,e)});var s="double float int long short null true false enum super this void auto for register static const friend mutable explicit virtual template typename printf break continue return do while if else for instanceof switch case default try catch finally throw throws assert import package boolean byte char delete private inline struct union signed unsigned export extern namespace using operator sizeof typedef typeid and del from not as elif or with pass except print exec raise is def lambda private protected public abstract class extends final implements interface native new static strictfp synchronized transient main String string System println vector bool boolean FALSE TRUE function".split(" ")});
-/* anyword-hint */
-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var r=/[\w$]+/;e.registerHelper("hint","anyword",function(t,o){for(var i=o&&o.word||r,n=o&&o.range||500,f=t.getCursor(),s=t.getLine(f.line),a=f.ch,c=a;c&&i.test(s.charAt(c-1));)--c;for(var l=c!=a&&s.slice(c,a),d=o&&o.list||[],u={},p=new RegExp(i.source,"g"),g=-1;g<=1;g+=2)for(var h=f.line,m=Math.min(Math.max(h+g*n,t.firstLine()),t.lastLine())+g;h!=m;h+=g)for(var y,b=t.getLine(h);y=p.exec(b);)h==f.line&&y[0]===l||l&&0!=y[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(u,y[0])||(u[y[0]]=!0,d.push(y[0]));return{list:d,from:e.Pos(f.line,c),to:e.Pos(f.line,a)}})});
-/*CodeMirror addon hint -----------------------------------------------End*/
// 测评的扩大与缩小
function valuation_extend_and_zoom(){
@@ -1196,12 +1175,6 @@ function _triggerEvent(eventName, data, target) {
}
// --------------------- --------------------- --------------------- --------------------- END
-// CodeMirror python
-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i)),e.defineMode("python",function(a,s){for(var c="error",l=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],f=0;fr?_(t):i0&&z(e,t)&&(a+=" "+c),a}return v(e,t)}function v(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),e.match(/^[\d_]+\.\d*/)&&(r=!0),e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(y))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(t,n){return t.match(e)?(n.tokenize=o,r):t.match("{")?"punctuation":t.match("}")?(n.tokenize=o,"punctuation"):v(t,n)}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i,o.current()?r:(o.next(),"punctuation");if(o.match("}}"))return r;if(o.match("}"))return c;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return c;a.tokenize=t}return r}return o.isString=!0,o}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var t=1==e.length,n="string";function r(r,i){for(;!r.eol();)if(r.eatWhile(/[^'"\\]/),r.eat("\\")){if(r.next(),t&&r.eol())return n}else{if(r.match(e))return i.tokenize=x,n;r.eat(/['"]/)}if(t){if(s.singleLineStringErrors)return c;i.tokenize=x}return n}return r.isString=!0,r}(e.current()),t.tokenize(e,t));for(var o=0;o1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function w(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(b,!1)?"meta":h?"operator":c;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||_(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+p,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return c;t.indent=t.scopes.pop().offset-p}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=w(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+c:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?p:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");var a;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(a="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",a.split(" "))})});
-// CodeMirror c-like(java)
-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,o,a){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=o,this.prev=a}function n(e,n,r,o){var a=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(a=e.context.indented),e.context=new t(a,n,r,o,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function o(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function a(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function i(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/,L=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/;function D(e,t){var n,r=e.next();if(k[r]){var o=k[r](e,t);if(!1!==o)return o}if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){for(var r,o=!1,a=!1;null!=(r=e.next());){if(r==n&&!o){a=!0;break}o=!o&&"\\"==r}return(a||!o&&!w)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(C.test(r))return c=r,null;if(T.test(r)){if(e.backUp(1),e.match(M))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=z,z(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(P.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(P););return"operator"}if(e.eatWhile(L),S)for(;e.match(S);)e.eatWhile(L);var a=e.current();return l(m,a)?(l(g,a)&&(c="newstatement"),l(x,a)&&(u=!0),"keyword"):l(h,a)?"type":l(y,a)?(l(g,a)&&(c="newstatement"),"builtin"):l(b,a)?"atom":"variable"}function z(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function I(e,t){s.typeFirstDefinitions&&e.eol()&&a(t.context)&&(t.typeAtEndOfLine=o(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-d,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return I(e,t),null;c=u=null;var l=(t.tokenize||D)(e,t);if("comment"==l||"meta"==l)return l;if(null==i.align&&(i.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==c)n(t,e.column(),"}");else if("["==c)n(t,e.column(),"]");else if("("==c)n(t,e.column(),")");else if("}"==c){for(;"statement"==i.type;)i=r(t);for("}"==i.type&&(i=r(t));"statement"==i.type;)i=r(t)}else c==i.type?r(t):v&&(("}"==i.type||"top"==i.type)&&";"!=c||"statement"==i.type&&"newstatement"==c)&&n(t,e.column(),"statement",e.current());if("variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&o(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),k.token){var d=k.token(e,t,l);void 0!==d&&(l=d)}return"def"==l&&!1===s.styleDefs&&(l="variable"),t.startOfLine=!1,t.prevToken=u?"def":l||c,I(e,t),l},indent:function(t,n){if(t.tokenize!=D&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,o=n&&n.charAt(0);if("statement"==r.type&&"}"==o&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(k.indent){var a=k.indent(t,r,n);if("number"==typeof a)return a}var i=o==r.type,l=r.prev&&"switch"==r.prev.info;if(s.allmanIndentation&&/[{(]/.test(o)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==o?0:f):!r.align||p&&")"==r.type?")"!=r.type||i?r.indented+(i?0:d)+(i||!l||/^(?:case|default)\b/.test(n)?0:d):r.indented+f:r.column+(i?0:1)},electricInput:_?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var s="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",c="int long char short double float unsigned signed void size_t ptrdiff_t";function u(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=u;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function d(e,t){return"type"==t.prevToken&&"type"}function f(e){return e.eatWhile(/[\w\.']/),"number"}function p(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=h,h(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function m(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function h(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function y(t,n){"string"==typeof t&&(t=[t]);var r=[];function o(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}o(n.keywords),o(n.types),o(n.builtin),o(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var a=0;a!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(n,r){for(var o;o=n.next();){if("*"==o&&n.eat("/")){if(1==t){r.tokenize=null;break}return r.tokenize=e(t-1),r.tokenize(n,r)}if("/"==o&&n.eat("*"))return r.tokenize=e(t+1),r.tokenize(n,r)}return"comment"}}(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{triples:'"'}}}),y("text/x-kotlin",{name:"clike",keywords:i("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:i("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:i("catch class do else finally for if where try while enum"),defKeywords:i("class val var object interface fun"),atoms:i("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){var n;return t.tokenize=(n=e.match('""'),function(e,t){for(var r,o=!1,a=!1;!e.eol();){if(!n&&!o&&e.match('"')){a=!0;break}if(n&&e.match('"""')){a=!0;break}r=e.next(),!o&&"$"==r&&e.match("{")&&e.skipTo("}"),o=!o&&"\\"==r&&!n}return!a&&n||(t.tokenize=null),"string"}),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),y(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:i("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:i("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:i("for while do if else struct"),builtin:i("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:i("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":u},modeProps:{fold:["brace","include"]}}),y("text/x-nesc",{name:"clike",keywords:i(s+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:i(c),blockKeywords:i("case do else for if switch while struct"),atoms:i("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),y("text/x-objectivec",{name:"clike",keywords:i(s+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:i(c),atoms:i("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":u,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),y("text/x-squirrel",{name:"clike",keywords:i("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:i(c),blockKeywords:i("case catch class else for foreach if switch try while"),defKeywords:i("function local class"),typeFirstDefinitions:!0,atoms:i("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});var x=null;y("text/x-ceylon",{name:"clike",keywords:i("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:i("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:i("class dynamic function interface module object package value"),builtin:i("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:i("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(n,r){for(var o,a=!1,i=!1;!n.eol();){if(!a&&n.match('"')&&("single"==t||n.match('""'))){i=!0;break}if(!a&&n.match("``")){x=e(t),i=!0;break}o=n.next(),a="single"==t&&!a&&"\\"==o}return i&&(r.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!x||!e.match("`"))&&(t.tokenize=x,x=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})});
-// CodeMirror matchbrackets
-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(t,e,i){var c=t.getLineHandle(e.line),o=e.ch-1,l=i&&i.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var h=!l&&o>=0&&r[c.text.charAt(o)]||r[c.text.charAt(++o)];if(!h)return null;var s=">"==h.charAt(1)?1:-1;if(i&&i.strict&&s>0!=(o==e.ch))return null;var u=t.getTokenTypeAt(n(e.line,o+1)),f=a(t,n(e.line,o+(s>0?1:0)),s,u||null,i);return null==f?null:{from:n(e.line,o),to:f&&f.pos,match:f&&f.ch==h.charAt(0),forward:s>0}}function a(t,e,i,a,c){for(var o=c&&c.maxScanLineLength||1e4,l=c&&c.maxScanLines||1e3,h=[],s=c&&c.bracketRegex?c.bracketRegex:/[(){}[\]]/,u=i>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),f=e.line;f!=u;f+=i){var m=t.getLine(f);if(m){var g=i>0?0:m.length-1,d=i>0?m.length:-1;if(!(m.length>o))for(f==e.line&&(g=e.ch-(i<0?1:0));g!=d;g+=i){var k=m.charAt(g);if(s.test(k)&&(void 0===a||t.getTokenTypeAt(n(f,g+1))==a))if(">"==r[k].charAt(1)==i>0)h.push(k);else{if(!h.length)return{pos:n(f,g),ch:k};h.pop()}}}}return f-i!=(i>0?t.lastLine():t.firstLine())&&null}function c(t,r,a){for(var c=t.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=t.listSelections(),h=0;h=0===n})}function c(t){var e=Ot.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function u(t,e){return t.getElementsByTagName(e)[0]||t.appendChild(t.ownerDocument.createElement(e))}function h(t,e){if(1===e.nodeType&&V.hasData(t)){var n,r,i,o=V._data(t),s=V._data(e,o),a=o.events;if(a)for(n in delete s.handle,s.events={},a)for(r=0,i=a[n].length;r").appendTo(B.body),n=e.css("display");return e.remove(),"none"!==n&&""!==n||(Kt=B.body.appendChild(Kt||V.extend(B.createElement("iframe"),{frameBorder:0,width:0,height:0})),Zt&&Kt.createElement||((Zt=(Kt.contentWindow||Kt.contentDocument).document).write(""),Zt.close()),e=Zt.body.appendChild(Zt.createElement(t)),n=Yt(e,"display"),B.body.removeChild(Kt)),se[t]=n,n}function k(t,e,n,r){var i;if(V.isArray(e))V.each(e,function(e,i){n||de.test(t)?r(t,i):k(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==V.type(e))r(t,e);else for(i in e)k(t+"["+i+"]",e[i],n,r)}function C(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i,o=e.toLowerCase().split(G),s=0,a=o.length;if(V.isFunction(n))for(;s)[^>]*$|#([\w\-]*)$)/,Z=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Q=/^[\],:{}\s]*$/,J=/(?:^|:|,)(?:\s*\[)+/g,tt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,et=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,nt=/^-ms-/,rt=/-([\da-z])/gi,it=function(t,e){return(e+"").toUpperCase()},ot=function(){B.addEventListener?(B.removeEventListener("DOMContentLoaded",ot,!1),V.ready()):"complete"===B.readyState&&(B.detachEvent("onreadystatechange",ot),V.ready())},st={};V.fn=V.prototype={constructor:V,init:function(t,n,r){var i,o,s;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("string"==typeof t){if((i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:K.exec(t))&&(i[1]||!n)){if(i[1])return s=(n=n instanceof V?n[0]:n)&&n.nodeType?n.ownerDocument||n:B,t=V.parseHTML(i[1],s,!0),Z.test(i[1])&&V.isPlainObject(n)&&this.attr.call(t,n,!0),V.merge(this,t);if((o=B.getElementById(i[2]))&&o.parentNode){if(o.id!==i[2])return r.find(t);this.length=1,this[0]=o}return this.context=B,this.selector=t,this}return!n||n.jquery?(n||r).find(t):this.constructor(n).find(t)}return V.isFunction(t)?r.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),V.makeArray(t,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return R.call(this)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,n){var r=V.merge(this.constructor(),t);return r.prevObject=this,r.context=this.context,"find"===e?r.selector=this.selector+(this.selector?" ":"")+n:e&&(r.selector=this.selector+"."+e+"("+n+")"),r},each:function(t,e){return V.each(this,t,e)},ready:function(t){return V.ready.promise().done(t),this},eq:function(t){return-1===(t=+t)?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(t){return this.pushStack(V.map(this,function(e,n){return t.call(e,n,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:H,sort:[].sort,splice:[].splice},V.fn.init.prototype=V.fn,V.extend=V.fn.extend=function(){var t,n,r,i,o,s,a=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),"object"!=typeof a&&!V.isFunction(a)&&(a={}),c===l&&(a=this,--l);l0||(D.resolveWith(B,[V]),V.fn.trigger&&V(B).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===V.type(t)},isArray:Array.isArray||function(t){return"array"===V.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):st[z.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==V.type(t)||t.nodeType||V.isWindow(t))return!1;try{if(t.constructor&&!$.call(t,"constructor")&&!$.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}var n;for(n in t);return n===e||$.call(t,n)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw new Error(t)},parseHTML:function(t,e,n){var r;return t&&"string"==typeof t?("boolean"==typeof e&&(n=e,e=0),e=e||B,(r=Z.exec(t))?[e.createElement(r[1])]:(r=V.buildFragment([t],e,n?null:[]),V.merge([],(r.cacheable?V.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(e){return e&&"string"==typeof e?(e=V.trim(e),t.JSON&&t.JSON.parse?t.JSON.parse(e):Q.test(e.replace(tt,"@").replace(et,"]").replace(J,""))?new Function("return "+e)():void V.error("Invalid JSON: "+e)):null},parseXML:function(n){var r;if(!n||"string"!=typeof n)return null;try{t.DOMParser?r=(new DOMParser).parseFromString(n,"text/xml"):((r=new ActiveXObject("Microsoft.XMLDOM")).async="false",r.loadXML(n))}catch(t){r=e}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&V.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(e){e&&X.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(nt,"ms-").replace(rt,it)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,n,r){var i,o=0,s=t.length,a=s===e||V.isFunction(t);if(r)if(a){for(i in t)if(!1===n.apply(t[i],r))break}else for(;o0&&t[0]&&t[l-1]||0===l||V.isArray(t)))for(;a-1;)l.splice(n,1),i&&(n<=s&&s--,n<=a&&a--)}),this},has:function(t){return V.inArray(t,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=e,this},disabled:function(){return!l},lock:function(){return c=e,n||h.disable(),this},locked:function(){return!c},fireWith:function(t,e){return e=[t,(e=e||[]).slice?e.slice():e],l&&(!r||c)&&(i?c.push(e):u(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},V.extend({Deferred:function(t){var e=[["resolve","done",V.Callbacks("once memory"),"resolved"],["reject","fail",V.Callbacks("once memory"),"rejected"],["notify","progress",V.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return V.Deferred(function(n){V.each(e,function(e,r){var o=r[0],s=t[e];i[r[1]](V.isFunction(s)?function(){var t=s.apply(this,arguments);t&&V.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===i?n:this,[t])}:n[o])}),t=null}).promise()},promise:function(t){return null!=t?V.extend(t,r):r}},i={};return r.pipe=r.then,V.each(e,function(t,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[o[0]]=s.fire,i[o[0]+"With"]=s.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=R.call(arguments),s=o.length,a=1!==s||t&&V.isFunction(t.promise)?s:0,l=1===a?t:V.Deferred(),c=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?R.call(arguments):i,r===e?l.notifyWith(n,r):--a||l.resolveWith(n,r)}};if(s>1)for(e=new Array(s),n=new Array(s),r=new Array(s);ia",n=f.getElementsByTagName("*"),r=f.getElementsByTagName("a")[0],!n||!r||!n.length)return{};o=(i=B.createElement("select")).appendChild(B.createElement("option")),s=f.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",e={leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:"on"===s.value,optSelected:o.selected,getSetAttribute:"t"!==f.className,enctype:!!B.createElement("form").enctype,html5Clone:"<:nav>"!==B.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===B.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,e.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,e.optDisabled=!o.disabled;try{delete f.test}catch(t){e.deleteExpando=!1}if(!f.addEventListener&&f.attachEvent&&f.fireEvent&&(f.attachEvent("onclick",h=function(){e.noCloneEvent=!1}),f.cloneNode(!0).fireEvent("onclick"),f.detachEvent("onclick",h)),(s=B.createElement("input")).value="t",s.setAttribute("type","radio"),e.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),f.appendChild(s),(a=B.createDocumentFragment()).appendChild(f.lastChild),e.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,e.appendChecked=s.checked,a.removeChild(s),a.appendChild(f),f.attachEvent)for(c in{submit:!0,change:!0,focusin:!0})(u=(l="on"+c)in f)||(f.setAttribute(l,"return;"),u="function"==typeof f[l]),e[c+"Bubbles"]=u;return V(function(){var n,r,i,o,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=B.getElementsByTagName("body")[0];a&&((n=B.createElement("div")).style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=B.createElement("div"),n.appendChild(r),r.innerHTML="",(i=r.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",u=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",e.reliableHiddenOffsets=u&&0===i[0].offsetHeight,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",e.boxSizing=4===r.offsetWidth,e.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(r,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(r,null)||{width:"4px"}).width,(o=B.createElement("div")).style.cssText=r.style.cssText=s,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),e.reliableMarginRight=!parseFloat((t.getComputedStyle(o,null)||{}).marginRight)),void 0!==r.style.zoom&&(r.innerHTML="",r.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",e.inlineBlockNeedsLayout=3===r.offsetWidth,r.style.display="block",r.style.overflow="visible",r.innerHTML="",r.firstChild.style.width="5px",e.shrinkWrapBlocks=3!==r.offsetWidth,n.style.zoom=1),a.removeChild(n),n=r=i=o=null)}),a.removeChild(f),n=r=i=o=s=a=f=null,e}();var lt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,ct=/([A-Z])/g;V.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(V.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return!!(t=t.nodeType?V.cache[t[V.expando]]:t[V.expando])&&!r(t)},data:function(t,n,r,i){if(V.acceptData(t)){var o,s,a=V.expando,l="string"==typeof n,c=t.nodeType,u=c?V.cache:t,h=c?t[a]:t[a]&&a;if(h&&u[h]&&(i||u[h].data)||!l||r!==e)return h||(c?t[a]=h=V.deletedIds.pop()||V.guid++:h=a),u[h]||(u[h]={},c||(u[h].toJSON=V.noop)),"object"!=typeof n&&"function"!=typeof n||(i?u[h]=V.extend(u[h],n):u[h].data=V.extend(u[h].data,n)),o=u[h],i||(o.data||(o.data={}),o=o.data),r!==e&&(o[V.camelCase(n)]=r),l?null==(s=o[n])&&(s=o[V.camelCase(n)]):s=o,s}},removeData:function(t,e,n){if(V.acceptData(t)){var i,o,s,a=t.nodeType,l=a?V.cache:t,c=a?t[V.expando]:V.expando;if(l[c]){if(e&&(i=n?l[c]:l[c].data)){V.isArray(e)||(e in i?e=[e]:e=(e=V.camelCase(e))in i?[e]:e.split(" "));for(o=0,s=e.length;o1,null,!1))},removeData:function(t){return this.each(function(){V.removeData(this,t)})}}),V.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=V._data(t,e),n&&(!r||V.isArray(n)?r=V._data(t,e,V.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=V.queue(t,e),r=n.length,i=n.shift(),o=V._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){V.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return V._data(t,n)||V._data(t,n,{empty:V.Callbacks("once memory").add(function(){V.removeData(t,e+"queue",!0),V.removeData(t,n,!0)})})}}),V.fn.extend({queue:function(t,n){var r=2;return"string"!=typeof t&&(n=t,t="fx",r--),arguments.length1)},removeAttr:function(t){return this.each(function(){V.removeAttr(this,t)})},prop:function(t,e){return V.access(this,V.prop,t,e,arguments.length>1)},removeProp:function(t){return t=V.propFix[t]||t,this.each(function(){try{this[t]=e,delete this[t]}catch(t){}})},addClass:function(t){var e,n,r,i,o,s,a;if(V.isFunction(t))return this.each(function(e){V(this).addClass(t.call(this,e,this.className))});if(t&&"string"==typeof t)for(e=t.split(G),n=0,r=this.length;n=0;)r=r.replace(" "+n[o]+" "," ");i.className=t?V.trim(r):""}return this},toggleClass:function(t,e){var n=typeof t,r="boolean"==typeof e;return V.isFunction(t)?this.each(function(n){V(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var i,o=0,s=V(this),a=e,l=t.split(G);i=l[o++];)s[(a=r?a:!s.hasClass(i))?"addClass":"removeClass"](i);else"undefined"!==n&&"boolean"!==n||(this.className&&V._data(this,"__className__",this.className),this.className=this.className||!1===t?"":V._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;n=0)return!0;return!1},val:function(t){var n,r,i,o=this[0];return arguments.length?(i=V.isFunction(t),this.each(function(r){var o,s=V(this);1===this.nodeType&&(null==(o=i?t.call(this,r,s.val()):t)?o="":"number"==typeof o?o+="":V.isArray(o)&&(o=V.map(o,function(t){return null==t?"":t+""})),(n=V.valHooks[this.type]||V.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,o,"value")!==e||(this.value=o))})):o?(n=V.valHooks[o.type]||V.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(r=n.get(o,"value"))!==e?r:"string"==typeof(r=o.value)?r.replace(pt,""):null==r?"":r:void 0}}),V.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||i<0,s=o?null:[],a=o?i+1:r.length,l=i<0?a:o?i:0;l=0}),n.length||(t.selectedIndex=-1),n}}},attrFn:{},attr:function(t,n,r,i){var o,s,a,l=t.nodeType;if(t&&3!==l&&8!==l&&2!==l)return i&&V.isFunction(V.fn[n])?V(t)[n](r):void 0===t.getAttribute?V.prop(t,n,r):((a=1!==l||!V.isXMLDoc(t))&&(n=n.toLowerCase(),s=V.attrHooks[n]||(yt.test(n)?ht:ut)),r!==e?null===r?void V.removeAttr(t,n):s&&"set"in s&&a&&(o=s.set(t,r,n))!==e?o:(t.setAttribute(n,r+""),r):s&&"get"in s&&a&&null!==(o=s.get(t,n))?o:null===(o=t.getAttribute(n))?e:o)},removeAttr:function(t,e){var n,r,i,o,s=0;if(e&&1===t.nodeType)for(r=e.split(G);s=0}})});var bt=/^(?:textarea|input|select)$/i,wt=/^([^\.]*|)(?:\.(.+)|)$/,kt=/(?:^|\s)hover(\.\S+|)\b/,Ct=/^key/,_t=/^(?:mouse|contextmenu)|click/,St=/^(?:focusinfocus|focusoutblur)$/,Tt=function(t){return V.event.special.hover?t:t.replace(kt,"mouseenter$1 mouseleave$1")};V.event={add:function(t,n,r,i,o){var s,a,l,c,u,h,f,d,p,v,g;if(3!==t.nodeType&&8!==t.nodeType&&n&&r&&(s=V._data(t))){for(r.handler&&(r=(p=r).handler,o=p.selector),r.guid||(r.guid=V.guid++),(l=s.events)||(s.events=l={}),(a=s.handle)||(s.handle=a=function(t){return void 0===V||t&&V.event.triggered===t.type?e:V.event.dispatch.apply(a.elem,arguments)},a.elem=t),n=V.trim(Tt(n)).split(" "),c=0;c=0&&(g=g.slice(0,-1),a=!0),g.indexOf(".")>=0&&(g=(m=g.split(".")).shift(),m.sort()),(!i||V.event.customEvent[g])&&!V.event.global[g])return;if((n="object"==typeof n?n[V.expando]?n:new V.Event(g,n):new V.Event(g)).type=g,n.isTrigger=!0,n.exclusive=a,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=g.indexOf(":")<0?"on"+g:"",!i){for(l in s=V.cache)s[l].events&&s[l].events[g]&&V.event.trigger(n,r,s[l].handle.elem,!0);return}if(n.result=e,n.target||(n.target=i),(r=null!=r?V.makeArray(r):[]).unshift(n),(f=V.event.special[g]||{}).trigger&&!1===f.trigger.apply(i,r))return;if(p=[[i,f.bindType||g]],!o&&!f.noBubble&&!V.isWindow(i)){for(v=f.delegateType||g,c=St.test(v+g)?i:i.parentNode,u=i;c;c=c.parentNode)p.push([c,v]),u=c;u===(i.ownerDocument||B)&&p.push([u.defaultView||u.parentWindow||t,v])}for(l=0;l=0:V.find(h,this,null,[o]).length),a[h]&&c.push(u);c.length&&m.push({elem:o,matches:c})}for(f.length>d&&m.push({elem:this,matches:f.slice(d)}),r=0;r0?this.on(e,null,t,n):this.trigger(e)},Ct.test(e)&&(V.event.fixHooks[e]=V.event.keyHooks),_t.test(e)&&(V.event.fixHooks[e]=V.event.mouseHooks)}),function(t,e){function n(t,e,n,r){n=n||[];var i,o,s,a,l=(e=e||E).nodeType;if(!t||"string"!=typeof t)return n;if(1!==l&&9!==l)return[];if(!(s=b(e))&&!r&&(i=tt.exec(t)))if(a=i[1]){if(9===l){if(!(o=e.getElementById(a))||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&w(e,o)&&o.id===a)return n.push(o),n}else{if(i[2])return j.apply(n,P.call(e.getElementsByTagName(t),0)),n;if((a=i[3])&&ut&&e.getElementsByClassName)return j.apply(n,P.call(e.getElementsByClassName(a),0)),n}return p(t.replace(K,"$1"),e,n,r,s)}function r(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function i(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function o(t){return I(function(e){return e=+e,I(function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function s(t,e,n){if(t===e)return n;for(var r=t.nextSibling;r;){if(r===e)return-1;r=r.nextSibling}return 1}function a(t,e){var r,i,o,s,a,l,c,u=W[M][t+" "];if(u)return e?0:u.slice(0);for(a=t,l=[],c=y.preFilter;a;){for(s in r&&!(i=Z.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),r=!1,(i=Q.exec(a))&&(o.push(r=new A(i.shift())),a=a.slice(r.length),r.type=i[0].replace(K," ")),y.filter)(i=ot[s].exec(a))&&(!c[s]||(i=c[s](i)))&&(o.push(r=new A(i.shift())),a=a.slice(r.length),r.type=s,r.matches=i);if(!r)break}return e?a.length:a?n.error(t):W(t,l).slice(0)}function l(t,e,n){var r=e.dir,i=n&&"parentNode"===e.dir,o=D++;return e.first?function(e,n,o){for(;e=e[r];)if(i||1===e.nodeType)return t(e,n,o)}:function(e,n,s){if(s){for(;e=e[r];)if((i||1===e.nodeType)&&t(e,n,s))return e}else for(var a,l=O+" "+o+" ",c=l+g;e=e[r];)if(i||1===e.nodeType){if((a=e[M])===c)return e.sizset;if("string"==typeof a&&0===a.indexOf(l)){if(e.sizset)return e}else{if(e[M]=c,t(e,n,s))return e.sizset=!0,e;e.sizset=!1}}}}function c(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function u(t,e,n,r,i){for(var o,s=[],a=0,l=t.length,c=null!=e;a-1&&(s[h]=!(a[h]=d))}}else x=u(x===a?x.splice(g,x.length):x),o?o(null,a,x,c):j.apply(a,x)})}function f(t){for(var e,n,r,i=t.length,o=y.relative[t[0].type],s=o||y.relative[" "],a=o?1:0,u=l(function(t){return t===e},s,!0),d=l(function(t){return F.call(e,t)>-1},s,!0),p=[function(t,n,r){return!o&&(r||n!==S)||((e=n).nodeType?u(t,n,r):d(t,n,r))}];a1&&c(p),a>1&&t.slice(0,a-1).join("").replace(K,"$1"),n,a0,i=t.length>0,o=function(s,a,l,c,h){var f,d,p,v=[],m=0,x="0",b=s&&[],w=null!=h,k=S,C=s||i&&y.find.TAG("*",h&&a.parentNode||a),_=O+=null==k?1:Math.E;for(w&&(S=a!==E&&a,g=o.el);null!=(f=C[x]);x++){if(i&&f){for(d=0;p=t[d];d++)if(p(f,a,l)){c.push(f);break}w&&(O=_,g=++o.el)}r&&((f=!p&&f)&&m--,s&&b.push(f))}if(m+=x,r&&x!==m){for(d=0;p=e[d];d++)p(b,v,a,l);if(s){if(m>0)for(;x--;)!b[x]&&!v[x]&&(v[x]=B.call(c));v=u(v)}j.apply(c,v),w&&!s&&v.length>0&&m+e.length>1&&n.uniqueSort(c)}return w&&(O=_,S=k),b};return o.el=0,r?I(o):o}function p(t,e,n,r,i){var o,s,l,c,u,h=a(t);h.length;if(!r&&1===h.length){if((s=h[0]=h[0].slice(0)).length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&!i&&y.relative[s[1].type]){if(!(e=y.find.ID(l.matches[0].replace(it,""),e,i)[0]))return n;t=t.slice(s.shift().length)}for(o=ot.POS.test(t)?-1:s.length-1;o>=0&&(l=s[o],!y.relative[c=l.type]);o--)if((u=y.find[c])&&(r=u(l.matches[0].replace(it,""),et.test(s[0].type)&&e.parentNode||e,i))){if(s.splice(o,1),!(t=r.length&&s.join("")))return j.apply(n,P.call(r,0)),n;break}}return k(t,h)(r,e,i,n,et.test(t)),n}function v(){}var g,m,y,x,b,w,k,C,_,S,T,L="undefined",M=("sizcache"+Math.random()).replace(".",""),A=String,E=t.document,N=E.documentElement,O=0,D=0,B=[].pop,j=[].push,P=[].slice,F=[].indexOf||function(t){for(var e=0,n=this.length;ey.cacheLength&&delete t[e.shift()],t[n+" "]=r},t)},R=H(),W=H(),z=H(),$="[\\x20\\t\\r\\n\\f]",q="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",U=q.replace("w","w#"),X="\\["+$+"*("+q+")"+$+"*(?:([*^$|!~]?=)"+$+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+U+")|)|)"+$+"*\\]",G=":("+q+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+X+")|[^:]|\\\\.)*|.*))\\)|)",Y=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+$+"*((?:-\\d)?\\d*)"+$+"*\\)|)(?=[^-]|$)",K=new RegExp("^"+$+"+|((?:^|[^\\\\])(?:\\\\.)*)"+$+"+$","g"),Z=new RegExp("^"+$+"*,"+$+"*"),Q=new RegExp("^"+$+"*([\\x20\\t\\r\\n\\f>+~])"+$+"*"),J=new RegExp(G),tt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,et=/[\x20\t\r\n\f]*[+~]/,nt=/h\d/i,rt=/input|select|textarea|button/i,it=/\\(?!\\)/g,ot={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),NAME:new RegExp("^\\[name=['\"]?("+q+")['\"]?\\]"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+X),PSEUDO:new RegExp("^"+G),POS:new RegExp(Y,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+$+"*(even|odd|(([+-]|)(\\d*)n|)"+$+"*(?:([+-]|)"+$+"*(\\d+)|))"+$+"*\\)|)","i"),needsContext:new RegExp("^"+$+"*[>+~]|"+Y,"i")},st=function(t){var e=E.createElement("div");try{return t(e)}catch(t){return!1}finally{e=null}},at=st(function(t){return t.appendChild(E.createComment("")),!t.getElementsByTagName("*").length}),lt=st(function(t){return t.innerHTML="",t.firstChild&&typeof t.firstChild.getAttribute!==L&&"#"===t.firstChild.getAttribute("href")}),ct=st(function(t){t.innerHTML="";var e=typeof t.lastChild.getAttribute("multiple");return"boolean"!==e&&"string"!==e}),ut=st(function(t){return t.innerHTML="",!(!t.getElementsByClassName||!t.getElementsByClassName("e").length)&&(t.lastChild.className="e",2===t.getElementsByClassName("e").length)}),ht=st(function(t){t.id=M+0,t.innerHTML="",N.insertBefore(t,N.firstChild);var e=E.getElementsByName&&E.getElementsByName(M).length===2+E.getElementsByName(M+0).length;return m=!E.getElementById(M),N.removeChild(t),e});try{P.call(N.childNodes,0)[0].nodeType}catch(t){P=function(t){for(var e,n=[];e=this[t];t++)n.push(e);return n}}n.matches=function(t,e){return n(t,null,null,e)},n.matchesSelector=function(t,e){return n(e,null,null,[t]).length>0},x=n.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=x(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r];r++)n+=x(e);return n},b=n.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},w=n.contains=N.contains?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:N.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},n.attr=function(t,e){var n,r=b(t);return r||(e=e.toLowerCase()),(n=y.attrHandle[e])?n(t):r||ct?t.getAttribute(e):(n=t.getAttributeNode(e))?"boolean"==typeof t[e]?t[e]?e:null:n.specified?n.value:null:null},y=n.selectors={cacheLength:50,createPseudo:I,match:ot,attrHandle:lt?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:m?function(t,e,n){if(typeof e.getElementById!==L&&!n){var r=e.getElementById(t);return r&&r.parentNode?[r]:[]}}:function(t,e,n){if(typeof e.getElementById!==L&&!n){var r=e.getElementById(t);return r?r.id===t||typeof r.getAttributeNode!==L&&r.getAttributeNode("id").value===t?[r]:void 0:[]}},TAG:at?function(t,e){if(typeof e.getElementsByTagName!==L)return e.getElementsByTagName(t)}:function(t,e){var n=e.getElementsByTagName(t);if("*"===t){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:ht&&function(t,e){if(typeof e.getElementsByName!==L)return e.getElementsByName(name)},CLASS:ut&&function(t,e,n){if(typeof e.getElementsByClassName!==L&&!n)return e.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(it,""),t[3]=(t[4]||t[5]||"").replace(it,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||n.error(t[0]),t[3]=+(t[3]?t[4]+(t[5]||1):2*("even"===t[2]||"odd"===t[2])),t[4]=+(t[6]+t[7]||"odd"===t[2])):t[2]&&n.error(t[0]),t},PSEUDO:function(t){var e,n;return ot.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(J.test(e)&&(n=a(e,!0))&&(n=e.indexOf(")",e.length-n)-e.length)&&(e=e.slice(0,n),t[0]=t[0].slice(0,n)),t[2]=e),t.slice(0,3))}},filter:{ID:m?function(t){return t=t.replace(it,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(it,""),function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(it,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=R[M][t+" "];return e||(e=new RegExp("(^|"+$+")"+t+"("+$+"|$)"))&&R(t,function(t){return e.test(t.className||typeof t.getAttribute!==L&&t.getAttribute("class")||"")})},ATTR:function(t,e,r){return function(i,o){var s=n.attr(i,t);return null==s?"!="===e:!e||(s+="","="===e?s===r:"!="===e?s!==r:"^="===e?r&&0===s.indexOf(r):"*="===e?r&&s.indexOf(r)>-1:"$="===e?r&&s.substr(s.length-r.length)===r:"~="===e?(" "+s+" ").indexOf(r)>-1:"|="===e&&(s===r||s.substr(0,r.length+1)===r+"-"))}},CHILD:function(t,e,n,r){return"nth"===t?function(t){var e,i,o=t.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,e=o.firstChild;e&&(1!==e.nodeType||(i++,t!==e));e=e.nextSibling);return(i-=r)===n||i%n==0&&i/n>=0}:function(e){var n=e;switch(t){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===t)return!0;n=e;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(t,e){var r,i=y.pseudos[t]||y.setFilters[t.toLowerCase()]||n.error("unsupported pseudo: "+t);return i[M]?i(e):i.length>1?(r=[t,t,"",e],y.setFilters.hasOwnProperty(t.toLowerCase())?I(function(t,n){for(var r,o=i(t,e),s=o.length;s--;)t[r=F.call(t,o[s])]=!(n[r]=o[s])}):function(t){return i(t,0,r)}):i}},pseudos:{not:I(function(t){var e=[],n=[],r=k(t.replace(K,"$1"));return r[M]?I(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),!n.pop()}}),has:I(function(t){return function(e){return n(t,e).length>0}}),contains:I(function(t){return function(e){return(e.textContent||e.innerText||x(e)).indexOf(t)>-1}}),enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},parent:function(t){return!y.pseudos.empty(t)},empty:function(t){var e;for(t=t.firstChild;t;){if(t.nodeName>"@"||3===(e=t.nodeType)||4===e)return!1;t=t.nextSibling}return!0},header:function(t){return nt.test(t.nodeName)},text:function(t){var e,n;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(n=t.getAttribute("type"))||n.toLowerCase()===e)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return rt.test(t.nodeName)},focus:function(t){var e=t.ownerDocument;return t===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},active:function(t){return t===t.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(t,e){return[e-1]}),eq:o(function(t,e,n){return[n<0?n+e:n]}),even:o(function(t,e){for(var n=0;n=0;)t.push(r);return t}),gt:o(function(t,e,n){for(var r=n<0?n+e:n;++r",t.querySelectorAll("[selected]").length||o.push("\\["+$+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||o.push(":checked")}),st(function(t){t.innerHTML="",t.querySelectorAll("[test^='']").length&&o.push("[*^$]="+$+"*(?:\"\"|'')"),t.innerHTML="",t.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")}),o=new RegExp(o.join("|")),p=function(t,n,i,s,l){if(!s&&!l&&!o.test(t)){var c,u,h=!0,f=M,d=n,p=9===n.nodeType&&t;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(c=a(t),(h=n.getAttribute("id"))?f=h.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+c[u].join("");d=et.test(t)&&n.parentNode||n,p=c.join(",")}if(p)try{return j.apply(i,P.call(d.querySelectorAll(p),0)),i}catch(t){}finally{h||n.removeAttribute("id")}}return e(t,n,i,s,l)},l&&(st(function(e){t=l.call(e,"div");try{l.call(e,"[test!='']:sizzle"),s.push("!=",G)}catch(t){}}),s=new RegExp(s.join("|")),n.matchesSelector=function(e,r){if(r=r.replace(i,"='$1']"),!b(e)&&!s.test(r)&&!o.test(r))try{var a=l.call(e,r);if(a||t||e.document&&11!==e.document.nodeType)return a}catch(t){}return n(r,null,null,[e]).length>0})}(),y.pseudos.nth=y.pseudos.eq,y.filters=v.prototype=y.pseudos,y.setFilters=new v,n.attr=V.attr,V.find=n,V.expr=n.selectors,V.expr[":"]=V.expr.pseudos,V.unique=n.uniqueSort,V.text=n.getText,V.isXMLDoc=n.isXML,V.contains=n.contains}(t);var Lt=/Until$/,Mt=/^(?:parents|prev(?:Until|All))/,At=/^.[^:#\[\.,]*$/,Et=V.expr.match.needsContext,Nt={children:!0,contents:!0,next:!0,prev:!0};V.fn.extend({find:function(t){var e,n,r,i,o,s,a=this;if("string"!=typeof t)return V(t).filter(function(){for(e=0,n=a.length;e0)for(i=r;i=0:V.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){for(var n,r=0,i=this.length,o=[],s=Et.test(t)||"string"!=typeof t?V(t,e||this.context):0;r-1:V.find.matchesSelector(n,t)){o.push(n);break}n=n.parentNode}return o=o.length>1?V.unique(o):o,this.pushStack(o,"closest",t)},index:function(t){return t?"string"==typeof t?V.inArray(this[0],V(t)):V.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var n="string"==typeof t?V(t,e):V.makeArray(t&&t.nodeType?[t]:t),r=V.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:V.unique(r))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),V.fn.andSelf=V.fn.addBack,V.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return V.dir(t,"parentNode")},parentsUntil:function(t,e,n){return V.dir(t,"parentNode",n)},next:function(t){return a(t,"nextSibling")},prev:function(t){return a(t,"previousSibling")},nextAll:function(t){return V.dir(t,"nextSibling")},prevAll:function(t){return V.dir(t,"previousSibling")},nextUntil:function(t,e,n){return V.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return V.dir(t,"previousSibling",n)},siblings:function(t){return V.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return V.sibling(t.firstChild)},contents:function(t){return V.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:V.merge([],t.childNodes)}},function(t,e){V.fn[t]=function(n,r){var i=V.map(this,e,n);return Lt.test(t)||(r=n),r&&"string"==typeof r&&(i=V.filter(r,i)),i=this.length>1&&!Nt[t]?V.unique(i):i,this.length>1&&Mt.test(t)&&(i=i.reverse()),this.pushStack(i,t,R.call(arguments).join(","))}}),V.extend({filter:function(t,e,n){return n&&(t=":not("+t+")"),1===e.length?V.find.matchesSelector(e[0],t)?[e[0]]:[]:V.find.matches(t,e)},dir:function(t,n,r){for(var i=[],o=t[n];o&&9!==o.nodeType&&(r===e||1!==o.nodeType||!V(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});var Ot="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Dt=/ jQuery\d+="(?:null|\d+)"/g,Bt=/^\s+/,jt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Pt=/<([\w:]+)/,Ft=/]","i"),zt=/^(?:checkbox|radio)$/,$t=/checked\s*(?:[^=]|=\s*.checked.)/i,qt=/\/(java|ecma)script/i,Vt=/^\s*\s*$/g,Ut={option:[1,""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]},Xt=c(B),Gt=Xt.appendChild(B.createElement("div"));Ut.optgroup=Ut.option,Ut.tbody=Ut.tfoot=Ut.colgroup=Ut.caption=Ut.thead,Ut.th=Ut.td,V.support.htmlSerialize||(Ut._default=[1,"X","
"]),V.fn.extend({text:function(t){return V.access(this,function(t){return t===e?V.text(this):this.empty().append((this[0]&&this[0].ownerDocument||B).createTextNode(t))},null,t,arguments.length)},wrapAll:function(t){if(V.isFunction(t))return this.each(function(e){V(this).wrapAll(t.call(this,e))});if(this[0]){var e=V(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return V.isFunction(t)?this.each(function(e){V(this).wrapInner(t.call(this,e))}):this.each(function(){var e=V(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=V.isFunction(t);return this.each(function(n){V(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){V.nodeName(this,"body")||V(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.appendChild(t)})},prepend:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(t,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this)});if(arguments.length){var t=V.clean(arguments);return this.pushStack(V.merge(t,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this.nextSibling)});if(arguments.length){var t=V.clean(arguments);return this.pushStack(V.merge(this,t),"after",this.selector)}},remove:function(t,e){for(var n,r=0;null!=(n=this[r]);r++)t&&!V.filter(t,[n]).length||(!e&&1===n.nodeType&&(V.cleanData(n.getElementsByTagName("*")),V.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&V.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return V.clone(this,t,e)})},html:function(t){return V.access(this,function(t){var n=this[0]||{},r=0,i=this.length;if(t===e)return 1===n.nodeType?n.innerHTML.replace(Dt,""):e;if("string"==typeof t&&!Ht.test(t)&&(V.support.htmlSerialize||!Wt.test(t))&&(V.support.leadingWhitespace||!Bt.test(t))&&!Ut[(Pt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(jt,"<$1>$2>");try{for(;r1&&"string"==typeof c&&$t.test(c))return this.each(function(){V(this).domManip(t,n,r)});if(V.isFunction(c))return this.each(function(i){var o=V(this);t[0]=c.call(this,i,n?o.html():e),o.domManip(t,n,r)});if(this[0]){if(o=(s=(i=V.buildFragment(t,this,h)).fragment).firstChild,1===s.childNodes.length&&(s=o),o)for(n=n&&V.nodeName(o,"tr"),a=i.cacheable||f-1;l0?this.clone(!0):this).get(),V(s[i])[e](r),o=o.concat(r);return this.pushStack(o,t,s.selector)}}),V.extend({clone:function(t,e,n){var r,i,o,s;if(V.support.html5Clone||V.isXMLDoc(t)||!Wt.test("<"+t.nodeName+">")?s=t.cloneNode(!0):(Gt.innerHTML=t.outerHTML,Gt.removeChild(s=Gt.firstChild)),!(V.support.noCloneEvent&&V.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||V.isXMLDoc(t)))for(f(t,s),r=d(t),i=d(s),o=0;r[o];++o)i[o]&&f(r[o],i[o]);if(e&&(h(t,s),n))for(r=d(t),i=d(s),o=0;r[o];++o)h(r[o],i[o]);return r=i=null,s},clean:function(t,e,n,r){var i,o,s,a,l,u,h,f,d,v,g,m=e===B&&Xt,y=[];for(e&&void 0!==e.createDocumentFragment||(e=B),i=0;null!=(s=t[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(It.test(s)){for(m=m||c(e),h=e.createElement("div"),m.appendChild(h),s=s.replace(jt,"<$1>$2>"),a=(Pt.exec(s)||["",""])[1].toLowerCase(),u=(l=Ut[a]||Ut._default)[0],h.innerHTML=l[1]+s+l[2];u--;)h=h.lastChild;if(!V.support.tbody)for(f=Ft.test(s),o=(d="table"!==a||f?""!==l[1]||f?[]:h.childNodes:h.firstChild&&h.firstChild.childNodes).length-1;o>=0;--o)V.nodeName(d[o],"tbody")&&!d[o].childNodes.length&&d[o].parentNode.removeChild(d[o]);!V.support.leadingWhitespace&&Bt.test(s)&&h.insertBefore(e.createTextNode(Bt.exec(s)[0]),h.firstChild),s=h.childNodes,h.parentNode.removeChild(h)}else s=e.createTextNode(s);s.nodeType?y.push(s):V.merge(y,s)}if(h&&(s=h=m=null),!V.support.appendChecked)for(i=0;null!=(s=y[i]);i++)V.nodeName(s,"input")?p(s):void 0!==s.getElementsByTagName&&V.grep(s.getElementsByTagName("input"),p);if(n)for(v=function(t){if(!t.type||qt.test(t.type))return r?r.push(t.parentNode?t.parentNode.removeChild(t):t):n.appendChild(t)},i=0;null!=(s=y[i]);i++)V.nodeName(s,"script")&&v(s)||(n.appendChild(s),void 0!==s.getElementsByTagName&&(g=V.grep(V.merge([],s.getElementsByTagName("script")),v),y.splice.apply(y,[i+1,0].concat(g)),i+=g.length));return y},cleanData:function(t,e){for(var n,r,i,o,s=0,a=V.expando,l=V.cache,c=V.support.deleteExpando,u=V.event.special;null!=(i=t[s]);s++)if((e||V.acceptData(i))&&(n=(r=i[a])&&l[r])){if(n.events)for(o in n.events)u[o]?V.event.remove(i,o):V.removeEvent(i,o,n.handle);l[r]&&(delete l[r],c?delete i[a]:i.removeAttribute?i.removeAttribute(a):i[a]=null,V.deletedIds.push(r))}}}),function(){var t,e;V.uaMatch=function(t){t=t.toLowerCase();var e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},e={},(t=V.uaMatch(P.userAgent)).browser&&(e[t.browser]=!0,e.version=t.version),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0),V.browser=e,V.sub=function(){function t(e,n){return new t.fn.init(e,n)}V.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(n,r){return r&&r instanceof V&&!(r instanceof t)&&(r=t(r)),V.fn.init.call(this,n,r,e)},t.fn.init.prototype=t.fn;var e=t(B);return t}}();var Yt,Kt,Zt,Qt=/alpha\([^)]*\)/i,Jt=/opacity=([^)]*)/,te=/^(top|right|bottom|left)$/,ee=/^(none|table(?!-c[ea]).+)/,ne=/^margin/,re=new RegExp("^("+U+")(.*)$","i"),ie=new RegExp("^("+U+")(?!px)[a-z%]+$","i"),oe=new RegExp("^([-+])=("+U+")","i"),se={BODY:"block"},ae={position:"absolute",visibility:"hidden",display:"block"},le={letterSpacing:0,fontWeight:400},ce=["Top","Right","Bottom","Left"],ue=["Webkit","O","Moz","ms"],he=V.fn.toggle;V.fn.extend({css:function(t,n){return V.access(this,function(t,n,r){return r!==e?V.style(t,n,r):V.css(t,n)},t,n,arguments.length>1)},show:function(){return m(this,!0)},hide:function(){return m(this)},toggle:function(t,e){var n="boolean"==typeof t;return V.isFunction(t)&&V.isFunction(e)?he.apply(this,arguments):this.each(function(){(n?t:g(this))?V(this).show():V(this).hide()})}}),V.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Yt(t,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:V.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,n,r,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,s,a,l=V.camelCase(n),c=t.style;if(n=V.cssProps[l]||(V.cssProps[l]=v(c,l)),a=V.cssHooks[n]||V.cssHooks[l],r===e)return a&&"get"in a&&(o=a.get(t,!1,i))!==e?o:c[n];if("string"===(s=typeof r)&&(o=oe.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(V.css(t,n)),s="number"),!(null==r||"number"===s&&isNaN(r)||("number"===s&&!V.cssNumber[l]&&(r+="px"),a&&"set"in a&&(r=a.set(t,r,i))===e)))try{c[n]=r}catch(t){}}},css:function(t,n,r,i){var o,s,a,l=V.camelCase(n);return n=V.cssProps[l]||(V.cssProps[l]=v(t.style,l)),(a=V.cssHooks[n]||V.cssHooks[l])&&"get"in a&&(o=a.get(t,!0,i)),o===e&&(o=Yt(t,n)),"normal"===o&&n in le&&(o=le[n]),r||i!==e?(s=parseFloat(o),r||V.isNumeric(s)?s||0:o):o},swap:function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r}}),t.getComputedStyle?Yt=function(e,n){var r,i,o,s,a=t.getComputedStyle(e,null),l=e.style;return a&&(""===(r=a.getPropertyValue(n)||a[n])&&!V.contains(e.ownerDocument,e)&&(r=V.style(e,n)),ie.test(r)&&ne.test(n)&&(i=l.width,o=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=a.width,l.width=i,l.minWidth=o,l.maxWidth=s)),r}:B.documentElement.currentStyle&&(Yt=function(t,e){var n,r,i=t.currentStyle&&t.currentStyle[e],o=t.style;return null==i&&o&&o[e]&&(i=o[e]),ie.test(i)&&!te.test(e)&&(n=o.left,(r=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),o.left="fontSize"===e?"1em":i,i=o.pixelLeft+"px",o.left=n,r&&(t.runtimeStyle.left=r)),""===i?"auto":i}),V.each(["height","width"],function(t,e){V.cssHooks[e]={get:function(t,n,r){if(n)return 0===t.offsetWidth&&ee.test(Yt(t,"display"))?V.swap(t,ae,function(){return b(t,e,r)}):b(t,e,r)},set:function(t,n,r){return y(0,n,r?x(t,e,r,V.support.boxSizing&&"border-box"===V.css(t,"boxSizing")):0)}}}),V.support.opacity||(V.cssHooks.opacity={get:function(t,e){return Jt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,r=t.currentStyle,i=V.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,e>=1&&""===V.trim(o.replace(Qt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=Qt.test(o)?o.replace(Qt,i):o+" "+i)}}),V(function(){V.support.reliableMarginRight||(V.cssHooks.marginRight={get:function(t,e){return V.swap(t,{display:"inline-block"},function(){if(e)return Yt(t,"marginRight")})}}),!V.support.pixelPosition&&V.fn.position&&V.each(["top","left"],function(t,e){V.cssHooks[e]={get:function(t,n){if(n){var r=Yt(t,e);return ie.test(r)?V(t).position()[e]+"px":r}}}})}),V.expr&&V.expr.filters&&(V.expr.filters.hidden=function(t){return 0===t.offsetWidth&&0===t.offsetHeight||!V.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||Yt(t,"display"))},V.expr.filters.visible=function(t){return!V.expr.filters.hidden(t)}),V.each({margin:"",padding:"",border:"Width"},function(t,e){V.cssHooks[t+e]={expand:function(n){var r,i="string"==typeof n?n.split(" "):[n],o={};for(r=0;r<4;r++)o[t+ce[r]+e]=i[r]||i[r-2]||i[0];return o}},ne.test(t)||(V.cssHooks[t+e].set=y)});var fe=/%20/g,de=/\[\]$/,pe=/\r?\n/g,ve=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ge=/^(?:select|textarea)/i;V.fn.extend({serialize:function(){return V.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?V.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ge.test(this.nodeName)||ve.test(this.type))}).map(function(t,e){var n=V(this).val();return null==n?null:V.isArray(n)?V.map(n,function(t,n){return{name:e.name,value:t.replace(pe,"\r\n")}}):{name:e.name,value:n.replace(pe,"\r\n")}}).get()}}),V.param=function(t,n){var r,i=[],o=function(t,e){e=V.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(n===e&&(n=V.ajaxSettings&&V.ajaxSettings.traditional),V.isArray(t)||t.jquery&&!V.isPlainObject(t))V.each(t,function(){o(this.name,this.value)});else for(r in t)k(r,t[r],n,o);return i.join("&").replace(fe,"+")};var me,ye,xe=/#.*$/,be=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,we=/^(?:GET|HEAD)$/,ke=/^\/\//,Ce=/\?/,_e=/