forked from Gitlink/forgeplus
46 lines
1.4 MiB
46 lines
1.4 MiB
function createMDEditor(t,e){var n={height:600,path:"/editormd/lib/",syncScrolling:"single",tex:!0,tocm:!0,emoji:!0,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,toolbarIcons:function(){return["bold","italic","|","list-ul","list-ol","|","code","code-block","|","image","table","|","watch","clear"]},saveHTMLToTextarea:!0,dialogMaskOpacity:.6,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:"/api/attachments.json"},i=$.extend({},n,e);return editormd(t,i)}function ajaxErrorNotifyHandler(t){var e="";return e=500!==t.status?t.responseJSON.message:"\u7cfb\u7edf\u9519\u8bef",$.notify({message:e},{type:"danger"})}function resetFileInputFunc(t){t.after(t.clone().val("")),t.remove()}function customConfirm(t){var e={title:"\u63d0\u793a",buttons:{ok:{text:"\u786e\u8ba4",btnClass:"btn btn-primary",action:t.ok},cancel:{text:"\u53d6\u6d88",btnClass:"btn btn-secondary",action:t.cancel}}};return $.confirm($.extend({},e,t))}function customLoading(t){var e,n={content:t.ajax,contentLoaded:function(){setTimeout(function(){e.close()},200)}};return e=$.confirm($.extend({},n,t))}function show_success_flash(t){$.notify({message:t||"\u64cd\u4f5c\u6210\u529f"},{type:"success"})}function showSuccessFlash(t){$.notify({message:t||"\u64cd\u4f5c\u6210\u529f"},{type:"success"})}function showErrorNotify(t){$.notify({message:t||"\u64cd\u4f5c\u5931\u8d25"},{type:"danger"})}function addSponsor(t){var e='<div class="sponsor_label">\n <input type="hidden" value="school_id" />\n <span>caicai</span>\n <a href="javascript:void(0)" onclick="del_sponsor(this)">\xd7</a>\n </div>';$(t).parents(".sponsorPanel").append(e)}function del_sponsor(t){$(t).parents(".sponsor_label").remove()}function change_total(t){var e=parseInt($(t).val()),n=$(t).parents(".small_panel_item").attr("attr_line"),i=$(t).parents(".large_panel_part").attr("attr_line");console.log(i),console.log(n);var r=parseInt($("#task_Input_"+n).find(".task_Input_div").length),o="";if(r<e){for(var a=0;a<e-r;a++)o+='<div class="col-4 row task_Input_div"><span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a1'+(r+a+1)+'</span>\n<div class="col-6 no_padding">\n<input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n</div>\n</div>';$("#task_Input_"+n).append(o)}else{var s=r-e;console.log(r),console.log(e);var l=parseInt($("#task_Input_"+n).find(".task_Input_div:last").index());console.log(l);var u=l-s;console.log(u),0==e?$("#task_Input_"+n).empty():$("#task_Input_"+n).find(".task_Input_div:gt("+u+")").remove()}}function Del_tab(t){$(t).parents(".large_panel_part").remove()}function addNewTab(t){if(0<$(".new-stage-form").length)alert("\u8bf7\u5148\u4fdd\u5b58\u4e0a\u4e00\u4e2atab");else{var e=parseInt($("#large_panel").find(".large_panel_part").length)+1,n='<form class="stage-update-form new-stage-form flex-1" action="/cooperative/competitions/'+t+'/competition_stages" accept-charset="UTF-8" data-remote="true" method="post"><div class="large_panel_part" attr_line="'+e+'"><div class="row d-flex mt-3">\n <span class="col-1 mt-2">tab\u6807\u9898</span>\n <div class="col-2 no_padding">\n <input type="text" class="form-control" name="stage_name"/>\n </div>\n <span class="col-1 text-right mt-2 no_padding">\u603b\u6392\u884c\u699c\u5360\u6bd4:</span>\n <div class="col-1 no_padding">\n <input type="number" class="form-control" name="score_rate" value="100"/>\n </div><span class=" mt-2">%</span>\n <div class="flex-1">\n <a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add-task-sub">\u65b0\u589e\u5b50\u9636\u6bb5</a>\n </div>\n <a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">\u5220\u9664</a>\n <a href="javascript:void(0)" class="btn btn-outline-primary update-stage export-action ml20">\u4fdd\u5b58</a>\n </div>\n <div id="small_panel_'+e+'" class="small_panel">\n <div class="row d-flex small_panel_item" attr_line="sub_new_new" count="1">\n <span class="mt-2 subName mr10">\u7b2c1\u9636\u6bb5</span>\n <div class="flex-1">\n <div class="row">\n <div class="row col-6"><span class="mt-2 ml20 mr10">\u6709\u6548\u65f6\u95f4:</span>\n <div class="col-4 no_padding ">\n <input type="text" name="stage[][start_time]" id="stage__start_time" value="" autocomplete="off" class="section-start-time form-control" placeholder="\u6709\u6548\u5f00\u59cb\u65f6\u95f4">\n </div>\n <span class="mt-2">~</span>\n <div class="col-4 no_padding input_middle">\n <input type="text" name="stage[][end_time]" id="stage__end_time" value="" autocomplete="off" class="section-end-time form-control" placeholder="\u6709\u6548\u7ed3\u675f\u65f6\u95f4">\n </div></div>\n <div class="row col-3"><span class="col-4 text-right mt-2 no_padding mr10">\u603b\u4efb\u52a1\u6570:</span>\n <div class="col-6 no_padding ">\n <input type="number" class="form-control" onchange="change_total(this)" value="3" name="stage[][entry]">\n </div></div>\n <div class="row col-3"><span class="col-4 text-right mt-2 no_padding mr10">\u6210\u7ee9\u6765\u6e90:</span>\n <div class="col-6 no_padding ">\n <select class="form-control" name="stage[][score_source]">\n <option value="0">\u7ecf\u9a8c\u503c</option>\n <option value="1">\u9884\u6d4b\u51c6\u786e\u7387</option>\n </select>\n </div></div>\n </div>\n <div class="row mt-2" id="task_Input_sub_new_new">\n <div class="col-4 row task_Input_div">\n <span class="col-3 text-right mt-3 no_padding mr10">\u4efb\u52a11</span>\n <div class="col-8 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-3 text-right mt-3 no_padding mr10">\u4efb\u52a12</span>\n <div class="col-8 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-3 text-right no_padding mr10 mt-3">\u4efb\u52a13</span>\n <div class="col-8 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n </div>\n </div>\n <span>\n <a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">\u5220\u9664</a>\n </span>\n </div>\n</div></div></form>';$("#large_panel").append(n)}}(function(){var t=this;(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(t);var y=t.Rails;(function(){(function(){var e;e=null,y.loadCSPNonce=function(){var t;return e=null!=(t=document.querySelector("meta[name=csp-nonce]"))?t.content:void 0},y.cspNonce=function(){return null!=e?e:y.loadCSPNonce()}}).call(this),function(){var i,n;n=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,y.matches=function(t,e){return null!=e.exclude?n.call(t,e.selector)&&!n.call(t,e.exclude):n.call(t,e)},i="_ujsData",y.getData=function(t,e){var n;return null!=(n=t[i])?n[e]:void 0},y.setData=function(t,e,n){return null==t[i]&&(t[i]={}),t[i][e]=n},y.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}.call(this),function(){var n,i,r;n=y.$,r=y.csrfToken=function(){var t;return(t=document.querySelector("meta[name=csrf-token]"))&&t.content},i=y.csrfParam=function(){var t;return(t=document.querySelector("meta[name=csrf-param]"))&&t.content},y.CSRFProtection=function(t){var e;if(null!=(e=r()))return t.setRequestHeader("X-CSRF-Token",e)},y.refreshCSRFTokens=function(){var t,e;if(e=r(),t=i(),null!=e&&null!=t)return n('form input[name="'+t+'"]').forEach(function(t){return t.value=e})}}.call(this),function(){var r,e,o,n;o=y.matches,"function"!=typeof(r=window.CustomEvent)&&((r=function(t,e){var n;return(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype,n=r.prototype.preventDefault,r.prototype.preventDefault=function(){var t;return t=n.call(this),this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),t}),e=y.fire=function(t,e,n){var i;return i=new r(e,{bubbles:!0,cancelable:!0,detail:n}),t.dispatchEvent(i),!i.defaultPrevented},y.stopEverything=function(t){return e(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},y.delegate=function(t,n,e,i){return t.addEventListener(e,function(t){var e;for(e=t.target;e instanceof Element&&!o(e,n);)e=e.parentNode;if(e instanceof Element&&!1===i.call(e,t))return t.preventDefault(),t.stopPropagation()})}}.call(this),function(){var e,i,t,o,r,a;o=y.cspNonce,i=y.CSRFProtection,y.fire,e={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},y.ajax=function(n){var i;return n=r(n),i=t(n,function(){var t,e;return e=a(null!=(t=i.response)?t:i.responseText,i.getResponseHeader("Content-Type")),2===Math.floor(i.status/100)?"function"==typeof n.success&&n.success(e,i.statusText,i):"function"==typeof n.error&&n.error(e,i.statusText,i),"function"==typeof n.complete?n.complete(i,i.statusText):void 0}),!(null!=n.beforeSend&&!n.beforeSend(i,n))&&(i.readyState===XMLHttpRequest.OPENED?i.send(n.data):void 0)},r=function(t){return t.url=t.url||location.href,t.type=t.type.toUpperCase(),"GET"===t.type&&t.data&&(t.url.indexOf("?")<0?t.url+="?"+t.data:t.url+="&"+t.data),null==e[t.dataType]&&(t.dataType="*"),t.accept=e[t.dataType],"*"!==t.dataType&&(t.accept+=", */*; q=0.01"),t},t=function(t,e){var n;return(n=new XMLHttpRequest).open(t.type,t.url,!0),n.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||n.setRequestHeader("X-Requested-With","XMLHttpRequest"),i(n),n.withCredentials=!!t.withCredentials,n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE)return e(n)},n},a=function(t,e){var n,i;if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(r){}else if(e.match(/\b(?:java|ecma)script\b/))(i=document.createElement("script")).setAttribute("nonce",o()),i.text=t,document.head.appendChild(i).parentNode.removeChild(i);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(r){}}return t},y.href=function(t){return t.href},y.isCrossDomain=function(t){var e,n;(e=document.createElement("a")).href=location.href,n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(i){return i,!0}}}.call(this),function(){var r,o;r=y.matches,o=function(t){return Array.prototype.slice.call(t)},y.serializeElement=function(t,e){var n,i;return n=[t],r(t,"form")&&(n=o(t.elements)),i=[],n.forEach(function(e){if(e.name&&!e.disabled)return r(e,"select")?o(e.options).forEach(function(t){if(t.selected)return i.push({name:e.name,value:t.value})}):e.checked||-1===["radio","checkbox","submit"].indexOf(e.type)?i.push({name:e.name,value:e.value}):void 0}),e&&i.push(e),i.map(function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t}).join("&")},y.formElements=function(t,e){return r(t,"form")?o(t.elements).filter(function(t){return r(t,e)}):o(t.querySelectorAll(e))}}.call(this),function(){var e,o,n;o=y.fire,n=y.stopEverything,y.handleConfirm=function(t){if(!e(this))return n(t)},e=function(t){var e,n,i;if(!(i=t.getAttribute("data-confirm")))return!0;if(e=!1,o(t,"confirm")){try{e=confirm(i)}catch(r){}n=o(t,"confirm:complete",[e])}return e&&n}}.call(this),function(){var n,i,r,o,a,s,e,l,u,c,h;u=y.matches,l=y.getData,c=y.setData,h=y.stopEverything,e=y.formElements,y.handleDisabledElement=function(t){if(this.disabled)return h(t)},y.enableElement=function(t){var e;return e=t instanceof Event?t.target:t,u(e,y.linkDisableSelector)?s(e):u(e,y.buttonDisableSelector)||u(e,y.formEnableSelector)?o(e):u(e,y.formSubmitSelector)?a(e):void 0},y.disableElement=function(t){var e;return e=t instanceof Event?t.target:t,u(e,y.linkDisableSelector)?r(e):u(e,y.buttonDisableSelector)||u(e,y.formDisableSelector)?n(e):u(e,y.formSubmitSelector)?i(e):void 0},r=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(c(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",h),c(t,"ujs:disabled",!0)},s=function(t){var e;return null!=(e=l(t,"ujs:enable-with"))&&(t.innerHTML=e,c(t,"ujs:enable-with",null)),t.removeEventListener("click",h),c(t,"ujs:disabled",null)},i=function(t){return e(t,y.formDisableSelector).forEach(n)},n=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(u(t,"button")?(c(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(c(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,c(t,"ujs:disabled",!0)},a=function(t){return e(t,y.formEnableSelector).forEach(o)},o=function(t){var e;return null!=(e=l(t,"ujs:enable-with"))&&(u(t,"button")?t.innerHTML=e:t.value=e,c(t,"ujs:enable-with",null)),t.disabled=!1,c(t,"ujs:disabled",null)}}.call(this),function(){var l;l=y.stopEverything,y.handleMethod=function(t){var e,n,i,r,o,a,s;if(s=(a=this).getAttribute("data-method"))return o=y.href(a),n=y.csrfToken(),e=y.csrfParam(),i=document.createElement("form"),r="<input name='_method' value='"+s+"' type='hidden' />",null==e||null==n||y.isCrossDomain(o)||(r+="<input name='"+e+"' value='"+n+"' type='hidden' />"),r+='<input type="submit" />',i.method="post",i.action=o,i.target=a.target,i.innerHTML=r,i.style.display="none",document.body.appendChild(i),i.querySelector('[type="submit"]').click(),l(t)}}.call(this),function(){var l,u,c,h,d,f,p,g,m,v=[].slice;f=y.matches,c=y.getData,g=y.setData,u=y.fire,m=y.stopEverything,l=y.ajax,h=y.isCrossDomain,p=y.serializeElement,d=function(t){var e;return null!=(e=t.getAttribute("data-remote"))&&"false"!==e},y.handleRemote=function(t){var e,n,i,r,o,a,s;return!d(r=this)||(u(r,"ajax:before")?(s=r.getAttribute("data-with-credentials"),i=r.getAttribute("data-type")||"script",f(r,y.formSubmitSelector)?(e=c(r,"ujs:submit-button"),o=c(r,"ujs:submit-button-formmethod")||r.method,a=c(r,"ujs:submit-button-formaction")||r.getAttribute("action")||location.href,"GET"===o.toUpperCase()&&(a=a.replace(/\?.*$/,"")),"multipart/form-data"===r.enctype?(n=new FormData(r),null!=e&&n.append(e.name,e.value)):n=p(r,e),g(r,"ujs:submit-button",null),g(r,"ujs:submit-button-formmethod",null),g(r,"ujs:submit-button-formaction",null)):f(r,y.buttonClickSelector)||f(r,y.inputChangeSelector)?(o=r.getAttribute("data-method"),a=r.getAttribute("data-url"),n=p(r,r.getAttribute("data-params"))):(o=r.getAttribute("data-method"),a=y.href(r),n=r.getAttribute("data-params")),l({type:o||"GET",url:a,data:n,dataType:i,beforeSend:function(t,e){return u(r,"ajax:beforeSend",[t,e])?u(r,"ajax:send",[t]):(u(r,"ajax:stopped"),!1)},success:function(){var t;return t=1<=arguments.length?v.call(arguments,0):[],u(r,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?v.call(arguments,0):[],u(r,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?v.call(arguments,0):[],u(r,"ajax:complete",t)},crossDomain:h(a),withCredentials:null!=s&&"false"!==s}),m(t)):(u(r,"ajax:stopped"),!1))},y.formSubmitButtonClick=function(){var t,e;if(e=(t=this).form)return t.name&&g(e,"ujs:submit-button",{name:t.name,value:t.value}),g(e,"ujs:formnovalidate-button",t.formNoValidate),g(e,"ujs:submit-button-formaction",t.getAttribute("formaction")),g(e,"ujs:submit-button-formmethod",t.getAttribute("formmethod"))},y.preventInsignificantClick=function(t){var e,n,i,r;if(r=((i=this).getAttribute("data-method")||"GET").toUpperCase(),e=i.getAttribute("data-params"),n=(t.metaKey||t.ctrlKey)&&"GET"===r&&!e,null!=t.button&&0!==t.button||n)return t.stopImmediatePropagation()}}.call(this),function(){var t,i,e,n,r,o,a,s,l,u,c,h,d,f,p;if(o=y.fire,e=y.delegate,s=y.getData,t=y.$,p=y.refreshCSRFTokens,i=y.CSRFProtection,d=y.loadCSPNonce,r=y.enableElement,n=y.disableElement,u=y.handleDisabledElement,l=y.handleConfirm,f=y.preventInsignificantClick,h=y.handleRemote,a=y.formSubmitButtonClick,c=y.handleMethod,"undefined"!=typeof jQuery&&null!==jQuery&&null!=jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=y,jQuery.ajaxPrefilter(function(t,e,n){if(!t.crossDomain)return i(n)})}y.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){return t(y.formEnableSelector).forEach(function(t){if(s(t,"ujs:disabled"))return r(t)}),t(y.linkDisableSelector).forEach(function(t){if(s(t,"ujs:disabled"))return r(t)})}),e(document,y.linkDisableSelector,"ajax:complete",r),e(document,y.linkDisableSelector,"ajax:stopped",r),e(document,y.buttonDisableSelector,"ajax:complete",r),e(document,y.buttonDisableSelector,"ajax:stopped",r),e(document,y.linkClickSelector,"click",f),e(document,y.linkClickSelector,"click",u),e(document,y.linkClickSelector,"click",l),e(document,y.linkClickSelector,"click",n),e(document,y.linkClickSelector,"click",h),e(document,y.linkClickSelector,"click",c),e(document,y.buttonClickSelector,"click",f),e(document,y.buttonClickSelector,"click",u),e(document,y.buttonClickSelector,"click",l),e(document,y.buttonClickSelector,"click",n),e(document,y.buttonClickSelector,"click",h),e(document,y.inputChangeSelector,"change",u),e(document,y.inputChangeSelector,"change",l),e(document,y.inputChangeSelector,"change",h),e(document,y.formSubmitSelector,"submit",u),e(document,y.formSubmitSelector,"submit",l),e(document,y.formSubmitSelector,"submit",h),e(document,y.formSubmitSelector,"submit",function(t){return setTimeout(function(){return n(t)},13)}),e(document,y.formSubmitSelector,"ajax:send",n),e(document,y.formSubmitSelector,"ajax:complete",r),e(document,y.formInputClickSelector,"click",f),e(document,y.formInputClickSelector,"click",u),e(document,y.formInputClickSelector,"click",l),e(document,y.formInputClickSelector,"click",a),document.addEventListener("DOMContentLoaded",p),document.addEventListener("DOMContentLoaded",d),window._rails_loaded=!0},window.Rails===y&&o(document,"rails:attachBindings")&&y.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=y:"function"==typeof define&&define.amd&&define(y)}).call(this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.ActiveStorage={})}(this,function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}function a(t){var e=i(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}function r(t,e){return"string"==typeof t&&(e=t,t=document),o(t.querySelectorAll(e))}function i(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function l(t,e,n){var i=2<arguments.length&&n!==undefined?arguments[2]:{},r=t.disabled,o=i.bubbles,a=i.cancelable,s=i.detail,l=document.createEvent("Event");l.initEvent(e,o||!0,a||!0),l.detail=s||{};try{t.disabled=!1,t.dispatchEvent(l)}finally{t.disabled=r}return l}function o(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}function s(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,i=Array(2<n?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return t[e].apply(t,i)}}function n(){E||(E=!0,document.addEventListener("click",u,!0),document.addEventListener("submit",c),document.addEventListener("ajax:before",h))}function u(t){var e=t.target;"INPUT"!=e.tagName&&"BUTTON"!=e.tagName||"submit"!=e.type||!e.form||k.set(e.form,e)}function c(t){d(t)}function h(t){"FORM"==t.target.tagName&&d(t)}function d(t){var e=t.target;if(e.hasAttribute(I))t.preventDefault();else{var n=new M(e),i=n.inputs;i.length&&(t.preventDefault(),e.setAttribute(I,""),i.forEach(p),n.start(function(t){e.removeAttribute(I),t?i.forEach(g):f(e)}))}}function f(t){var e=k.get(t)||i(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);k["delete"](t)}function p(t){t.disabled=!0}function g(t){t.disabled=!1}function m(){window.ActiveStorage&&n()}var v=e(function(t){var e;e=function(c){function u(t,e){var n=t[0],i=t[1],r=t[2],o=t[3];i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[0]-680876936|0)<<7|n>>>25)+i|0)&i|~n&r)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&i)+e[2]+606105819|0)<<17|r>>>15)+o|0)&o|~r&n)+e[3]-1044525330|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[4]-176418897|0)<<7|n>>>25)+i|0)&i|~n&r)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&i)+e[6]-1473231341|0)<<17|r>>>15)+o|0)&o|~r&n)+e[7]-45705983|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[8]+1770035416|0)<<7|n>>>25)+i|0)&i|~n&r)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&i)+e[10]-42063|0)<<17|r>>>15)+o|0)&o|~r&n)+e[11]-1990404162|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[12]+1804603682|0)<<7|n>>>25)+i|0)&i|~n&r)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&i)+e[14]-1502002290|0)<<17|r>>>15)+o|0)&o|~r&n)+e[15]+1236535329|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[1]-165796510|0)<<5|n>>>27)+i|0)&r|i&~r)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&i|n&~i)+e[11]+643717713|0)<<14|r>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[5]-701558691|0)<<5|n>>>27)+i|0)&r|i&~r)+e[10]+38016083|0)<<9|o>>>23)+n|0)&i|n&~i)+e[15]-660478335|0)<<14|r>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[9]+568446438|0)<<5|n>>>27)+i|0)&r|i&~r)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&i|n&~i)+e[3]-187363961|0)<<14|r>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[13]-1444681467|0)<<5|n>>>27)+i|0)&r|i&~r)+e[2]-51403784|0)<<9|o>>>23)+n|0)&i|n&~i)+e[7]+1735328473|0)<<14|r>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[5]-378558|0)<<4|n>>>28)+i|0)^i^r)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^i)+e[11]+1839030562|0)<<16|r>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[1]-1530992060|0)<<4|n>>>28)+i|0)^i^r)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^i)+e[7]-155497632|0)<<16|r>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[13]+681279174|0)<<4|n>>>28)+i|0)^i^r)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^i)+e[3]-722521979|0)<<16|r>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[9]-640364487|0)<<4|n>>>28)+i|0)^i^r)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^i)+e[15]+530742520|0)<<16|r>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|i>>>9)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[0]-198630844|0)<<6|n>>>26)+i|0)|~r))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[14]-1416354905|0)<<15|r>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[12]+1700485571|0)<<6|n>>>26)+i|0)|~r))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[10]-1051523|0)<<15|r>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[8]+1873313359|0)<<6|n>>>26)+i|0)|~r))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[6]-1560198380|0)<<15|r>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[4]-145523070|0)<<6|n>>>26)+i|0)|~r))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[2]+718787259|0)<<15|r>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|i>>>11)+r|0,t[0]=n+t[0]|0,t[1]=i+t[1]|0,t[2]=r+t[2]|0,t[3]=o+t[3]|0}function h(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function d(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function i(t){var e,n,i,r,o,a,s=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=s;e+=64)u(l,h(t.substring(e-64,e)));for(n=(t=t.substring(e-64)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<n;e+=1)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),55<e)for(u(l,i),e=0;e<16;e+=1)i[e]=0;return r=(r=8*s).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),a=parseInt(r[1],16)||0,i[14]=o,i[15]=a,u(l,i),l}function r(t){var e,n,i,r,o,a,s=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=s;e+=64)u(l,d(t.subarray(e-64,e)));for(n=(t=e-64<s?t.subarray(e-64):new Uint8Array(0)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<n;e+=1)i[e>>2]|=t[e]<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),55<e)for(u(l,i),e=0;e<16;e+=1)i[e]=0;return r=(r=8*s).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),a=parseInt(r[1],16)||0,i[14]=o,i[15]=a,u(l,i),l}function n(t){var e,n="";for(e=0;e<4;e+=1)n+=g[t>>8*e+4&15]+g[t>>8*e&15];return n}function a(t){var e;for(e=0;e<t.length;e+=1)t[e]=n(t[e]);return t.join("")}function o(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function e(t,e){var n,i=t.length,r=new ArrayBuffer(i),o=new Uint8Array(r);for(n=0;n<i;n+=1)o[n]=t.charCodeAt(n);return e?o:r}function s(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function l(t,e,n){var i=new Uint8Array(t.byteLength+e.byteLength);return i.set(new Uint8Array(t)),i.set(new Uint8Array(e),t.byteLength),n?i:i.buffer}function f(t){var e,n=[],i=t.length;for(e=0;e<i-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}var g=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return a(i("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function u(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(t,e){var n,i,r,o,a=this.byteLength,s=u(t,a),l=a;return e!==c&&(l=u(e,a)),l<s?new ArrayBuffer(0):(n=l-s,i=new ArrayBuffer(n),r=new Uint8Array(i),o=new Uint8Array(this,s,n),r.set(o),i)}}(),p.prototype.append=function(t){return this.appendBinary(o(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,n=this._buff.length;for(e=64;e<=n;e+=64)u(this._hash,h(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,n,i=this._buff,r=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=i.charCodeAt(e)<<(e%4<<3);return this._finish(o,r),n=a(this._hash),t&&(n=f(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var n,i,r,o=e;if(t[o>>2]|=128<<(o%4<<3),55<o)for(u(this._hash,t),o=0;o<16;o+=1)t[o]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),r=parseInt(n[1],16)||0,t[14]=i,t[15]=r,u(this._hash,t)},p.hash=function(t,e){return p.hashBinary(o(t),e)},p.hashBinary=function(t,e){var n=a(i(t));return e?f(n):n},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,n=l(this._buff.buffer,t,!0),i=n.length;for(this._length+=t.byteLength,e=64;e<=i;e+=64)u(this._hash,d(n.subarray(e-64,e)));return this._buff=e-64<i?new Uint8Array(n.buffer.slice(e-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(t){var e,n,i=this._buff,r=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=i[e]<<(e%4<<3);return this._finish(o,r),n=a(this._hash),t&&(n=f(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);return t.buff=s(t.buff),t},p.ArrayBuffer.prototype.setState=function(t){return t.buff=e(t.buff,!0),p.prototype.setState.call(this,t)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(t,e){var n=a(r(new Uint8Array(t)));return e?f(n):n},p},t.exports=e()}),y=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},x=function(){function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),b=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,w=function(){function n(t){y(this,n),this.file=t,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}return x(n,null,[{key:"create",value:function i(t,e){new n(t).create(e)}}]),x(n,[{key:"create",value:function i(t){var e=this;this.callback=t,this.md5Buffer=new v.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",function(t){return e.fileReaderDidLoad(t)}),this.fileReader.addEventListener("error",function(t){return e.fileReaderDidError(t)}),this.readNextChunk()}},{key:"fileReaderDidLoad",value:function r(t){if(this.md5Buffer.append(t.target.result),!this.readNextChunk()){var e=this.md5Buffer.end(!0),n=btoa(e);this.callback(null,n)}}},{key:"fileReaderDidError",value:function t(){this.callback("Error reading "+this.file.name)}},{key:"readNextChunk",value:function o(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){var t=this.chunkIndex*this.chunkSize,e=Math.min(t+this.chunkSize,this.file.size),n=b.call(this.file,t,e);return this.fileReader.readAsArrayBuffer(n),
|
|
this.chunkIndex++,!0}return!1}}]),n}(),_=function(){function r(t,e,n){var i=this;y(this,r),this.file=t,this.attributes={filename:t.name,content_type:t.type,byte_size:t.size,checksum:e},this.xhr=new XMLHttpRequest,this.xhr.open("POST",n,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.xhr.setRequestHeader("X-CSRF-Token",a("csrf-token")),this.xhr.addEventListener("load",function(t){return i.requestDidLoad(t)}),this.xhr.addEventListener("error",function(t){return i.requestDidError(t)})}return x(r,[{key:"create",value:function e(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function i(t){if(200<=this.status&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function t(){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function n(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function o(){return this.xhr.status}},{key:"response",get:function o(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),r}(),S=function(){function a(t){var e=this;y(this,a),this.blob=t,this.file=t.file;var n=t.directUploadData,i=n.url,r=n.headers;for(var o in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",i,!0),this.xhr.responseType="text",r)this.xhr.setRequestHeader(o,r[o]);this.xhr.addEventListener("load",function(t){return e.requestDidLoad(t)}),this.xhr.addEventListener("error",function(t){return e.requestDidError(t)})}return x(a,[{key:"create",value:function e(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function r(t){var e=this.xhr,n=e.status,i=e.response;200<=n&&n<300?this.callback(null,i):this.requestDidError(t)}},{key:"requestDidError",value:function t(){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),a}(),C=0,T=function(){function i(t,e,n){y(this,i),this.id=++C,this.file=t,this.url=e,this.delegate=n}return x(i,[{key:"create",value:function t(i){var r=this;w.create(this.file,function(t,e){if(t)i(t);else{var n=new _(r.file,e,r.url);s(r.delegate,"directUploadWillCreateBlobWithXHR",n.xhr),n.create(function(t){if(t)i(t);else{var e=new S(n);s(r.delegate,"directUploadWillStoreFileWithXHR",e.xhr),e.create(function(t){t?i(t):i(null,n.toJSON())})}})}})}}]),i}(),A=function(){function n(t,e){y(this,n),this.input=t,this.file=e,this.directUpload=new T(this.file,this.url,this),this.dispatch("initialize")}return x(n,[{key:"start",value:function t(n){var i=this,r=document.createElement("input");r.type="hidden",r.name=this.input.name,this.input.insertAdjacentElement("beforebegin",r),this.dispatch("start"),this.directUpload.create(function(t,e){t?(r.parentNode.removeChild(r),i.dispatchError(t)):r.value=e.signed_id,i.dispatch("end"),n(t)})}},{key:"uploadRequestDidProgress",value:function i(t){var e=t.loaded/t.total*100;e&&this.dispatch("progress",{progress:e})}},{key:"dispatch",value:function r(t,e){var n=1<arguments.length&&e!==undefined?arguments[1]:{};return n.file=this.file,n.id=this.directUpload.id,l(this.input,"direct-upload:"+t,{detail:n})}},{key:"dispatchError",value:function e(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function o(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function a(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",function(t){return e.uploadRequestDidProgress(t)})}},{key:"url",get:function s(){return this.input.getAttribute("data-direct-upload-url")}}]),n}(),D="input[type=file][data-direct-upload-url]:not([disabled])",M=function(){function e(t){y(this,e),this.form=t,this.inputs=r(t,D).filter(function(t){return t.files.length})}return x(e,[{key:"start",value:function t(e){var n=this,i=this.createDirectUploadControllers(),r=function r(){var t=i.shift();t?t.start(function(t){t?(e(t),n.dispatch("end")):r()}):(e(),n.dispatch("end"))};this.dispatch("start"),r()}},{key:"createDirectUploadControllers",value:function n(){var i=[];return this.inputs.forEach(function(n){o(n.files).forEach(function(t){var e=new A(n,t);i.push(e)})}),i}},{key:"dispatch",value:function i(t,e){var n=1<arguments.length&&e!==undefined?arguments[1]:{};return l(this.form,"direct-uploads:"+t,{detail:n})}}]),e}(),I="data-direct-uploads-processing",k=new WeakMap,E=!1;setTimeout(m,1),t.start=n,t.DirectUpload=T,Object.defineProperty(t,"__esModule",{value:!0})}),function(){var t=this;(function(){(function(){this.Turbolinks={supported:null!=window.history.pushState&&null!=window.requestAnimationFrame&&null!=window.addEventListener,visit:function(t,e){return c.controller.visit(t,e)},clearCache:function(){return c.controller.clearCache()},setProgressBarDelay:function(t){return c.controller.setProgressBarDelay(t)}}}).call(this)}).call(t);var c=t.Turbolinks;(function(){(function(){var n,i,l,t,e,r,o,a,s,u=[].slice;c.copyObject=function(t){var e,n,i;for(e in n={},t)i=t[e],n[e]=i;return n},c.closest=function(t,e){return n.call(t,e)},n=null!=(s=document.documentElement.closest)?s:function(t){var e;for(e=this;e;){if(e.nodeType===Node.ELEMENT_NODE&&i.call(e,t))return e;e=e.parentNode}},c.defer=function(t){return setTimeout(t,1)},c.throttle=function(n){var i;return i=null,function(){var t,e;return t=1<=arguments.length?u.call(arguments,0):[],null!=i?i:i=requestAnimationFrame((e=this,function(){return i=null,n.apply(e,t)}))}},c.dispatch=function(t,e){var n,i,r,o,a,s;return s=(a=null!=e?e:{}).target,n=a.cancelable,i=a.data,(r=document.createEvent("Events")).initEvent(t,!0,!0===n),r.data=null!=i?i:{},r.cancelable&&!l&&(o=r.preventDefault,r.preventDefault=function(){return this.defaultPrevented||Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),o.call(this)}),(null!=s?s:document).dispatchEvent(r),r},(a=document.createEvent("Events")).initEvent("test",!0,!0),a.preventDefault(),l=a.defaultPrevented,c.match=function(t,e){return i.call(t,e)},i=null!=(e=null!=(r=null!=(o=(t=document.documentElement).matchesSelector)?o:t.webkitMatchesSelector)?r:t.msMatchesSelector)?e:t.mozMatchesSelector,c.uuid=function(){var t,e,n;for(n="",t=e=1;e<=36;t=++e)n+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return n}}).call(this),function(){c.Location=function(){function t(t){var e,n;null==t&&(t=""),(n=document.createElement("a")).href=t.toString(),this.absoluteURL=n.href,(e=n.hash.length)<2?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=n.hash.slice(1))}var e,n,i,r;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.requestURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=n(t),this.isEqualTo(t)||r(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},n=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return i(t,"/")?t:t+"/"},r=function(t,e){return t.slice(0,e.length)===e},i=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var i=function(t,e){return function(){return t.apply(e,arguments)}};c.HttpRequest=function(){function t(t,e,n){this.delegate=t,this.requestCanceled=i(this.requestCanceled,this),this.requestTimedOut=i(this.requestTimedOut,this),this.requestFailed=i(this.requestFailed,this),this.requestLoaded=i(this.requestLoaded,this),this.requestProgressed=i(this.requestProgressed,this),this.url=c.Location.wrap(e).requestURL,this.referrer=c.Location.wrap(n).absoluteURL,this.createXHR()}return t.NETWORK_FAILURE=0,t.TIMEOUT_FAILURE=-1,t.timeout=60,t.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},t.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},t.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},t.prototype.requestLoaded=function(){return this.endRequest((e=this,function(){var t;return 200<=(t=e.xhr.status)&&t<300?e.delegate.requestCompletedWithResponse(e.xhr.responseText,e.xhr.getResponseHeader("Turbolinks-Location")):(e.failed=!0,e.delegate.requestFailedWithStatusCode(e.xhr.status,e.xhr.responseText))}));var e},t.prototype.requestFailed=function(){return this.endRequest((t=this,function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}));var t},t.prototype.requestTimedOut=function(){return this.endRequest((t=this,function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}));var t},t.prototype.requestCanceled=function(){return this.endRequest()},t.prototype.notifyApplicationBeforeRequestStart=function(){return c.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},t.prototype.notifyApplicationAfterRequestEnd=function(){return c.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},t.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},t.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},t.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},t.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},t}()}.call(this),function(){var n=function(t,e){return function(){return t.apply(e,arguments)}};c.ProgressBar=function(){function t(){this.trickle=n(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var e;return e=300,t.defaultCSS=".turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width "+e+"ms ease-out, opacity "+e/2+"ms "+e/2+"ms ease-in;\n transform: translate3d(0, 0, 0);\n}",t.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},t.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement((t=this,function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}))):void 0;var t},t.prototype.setValue=function(t){return this.value=t,this.refresh()},t.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},t.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},t.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,1.5*e)},t.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},t.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,e)},t.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},t.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},t.prototype.refresh=function(){return requestAnimationFrame((t=this,function(){return t.progressElement.style.width=10+90*t.value+"%"}));var t},t.prototype.createStylesheetElement=function(){var t;return(t=document.createElement("style")).type="text/css",t.textContent=this.constructor.defaultCSS,t},t.prototype.createProgressElement=function(){var t;return(t=document.createElement("div")).className="turbolinks-progress-bar",t},t}()}.call(this),function(){var r=function(t,e){return function(){return t.apply(e,arguments)}};c.BrowserAdapter=function(){function t(t){this.controller=t,this.showProgressBar=r(this.showProgressBar,this),this.progressBar=new c.ProgressBar}var n,i,e;return e=c.HttpRequest,n=e.NETWORK_FAILURE,i=e.TIMEOUT_FAILURE,t.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},t.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},t.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},t.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},t.prototype.visitRequestCompleted=function(t){return t.loadResponse()},t.prototype.visitRequestFailedWithStatusCode=function(t,e){switch(e){case n:case i:return this.reload();default:return t.loadResponse()}},t.prototype.visitRequestFinished=function(){return this.hideProgressBar()},t.prototype.visitCompleted=function(t){return t.followRedirect()},t.prototype.pageInvalidated=function(){return this.reload()},t.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,this.controller.progressBarDelay)},t.prototype.showProgressBar=function(){return this.progressBar.show()},t.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},t.prototype.reload=function(){return window.location.reload()},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};c.History=function(){function t(t){this.delegate=t,this.onPageLoad=e(this.onPageLoad,this),this.onPopState=e(this.onPopState,this)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1):void 0},t.prototype.push=function(t,e){return t=c.Location.wrap(t),this.update("push",t,e)},t.prototype.replace=function(t,e){return t=c.Location.wrap(t),this.update("replace",t,e)},t.prototype.onPopState=function(t){var e,n,i,r;return this.shouldHandlePopState()&&(r=null!=(n=t.state)?n.turbolinks:void 0)?(e=c.Location.wrap(window.location),i=r.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(e,i)):void 0},t.prototype.onPageLoad=function(){return c.defer((t=this,function(){return t.pageLoaded=!0}));var t},t.prototype.shouldHandlePopState=function(){return this.pageIsLoaded()},t.prototype.pageIsLoaded=function(){return this.pageLoaded||"complete"===document.readyState},t.prototype.update=function(t,e,n){var i;return i={turbolinks:{restorationIdentifier:n}},history[t+"State"](i,null,e)},t}()}.call(this),function(){c.HeadDetails=function(){function t(t){var e,n,i,r,o;for(this.elements={},n=0,r=t.length;n<r;n++)(o=t[n]).nodeType===Node.ELEMENT_NODE&&(i=o.outerHTML,(null!=(e=this.elements)[i]?e[i]:e[i]={type:s(o),tracked:a(o),elements:[]}).elements.push(o))}var o,e,n,a,s;return t.fromHeadElement=function(t){var e;return new this(null!=(e=null!=t?t.childNodes:void 0)?e:[])},t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var n;return function(){var t,e;for(n in e=[],t=this.elements)t[n].tracked&&e.push(n);return e}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var n,i,r,o,a,s;for(i in a=[],r=this.elements)s=(o=r[i]).type,n=o.elements,s!==t||e.hasElementWithKey(i)||a.push(n[0]);return a},t.prototype.getProvisionalElements=function(){var t,e,n,i,r,o,a;for(e in n=[],i=this.elements)a=(r=i[e]).type,o=r.tracked,t=r.elements,null!=a||o?1<t.length&&n.push.apply(n,t.slice(1)):n.push.apply(n,t);return n},t.prototype.getMetaValue=function(t){var e;return null!=(e=this.findMetaElementByName(t))?e.getAttribute("content"):void 0},t.prototype.findMetaElementByName=function(t){var e,n,i,r;for(i in e=void 0,r=this.elements)n=r[i].elements,o(n[0],t)&&(e=n[0]);return e},s=function(t){return e(t)?"script":n(t)?"stylesheet":void 0},a=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},e=function(t){return"script"===t.tagName.toLowerCase()},n=function(t){var e;return"style"===(e=t.tagName.toLowerCase())||"link"===e&&"stylesheet"===t.getAttribute("rel")},o=function(t,e){return"meta"===t.tagName.toLowerCase()&&t.getAttribute("name")===e},t}()}.call(this),function(){c.Snapshot=function(){function t(t,e){this.headDetails=t,this.bodyElement=e}return t.wrap=function(t){return t instanceof this?t:"string"==typeof t?this.fromHTMLString(t):this.fromHTMLElement(t)},t.fromHTMLString=function(t){var e;return(e=document.createElement("html")).innerHTML=t,this.fromHTMLElement(e)},t.fromHTMLElement=function(t){var e,n,i;return n=t.querySelector("head"),e=null!=(i=t.querySelector("body"))?i:document.createElement("body"),new this(c.HeadDetails.fromHeadElement(n),e)},t.prototype.clone=function(){return new this.constructor(this.headDetails,this.bodyElement.cloneNode(!0))},t.prototype.getRootLocation=function(){var t,e;return e=null!=(t=this.getSetting("root"))?t:"/",new c.Location(e)},t.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},t.prototype.getElementForAnchor=function(t){try{return this.bodyElement.querySelector("[id='"+t+"'], a[name='"+t+"']")}catch(c){}},t.prototype.getPermanentElements=function(){return this.bodyElement.querySelectorAll("[id][data-turbolinks-permanent]")},t.prototype.getPermanentElementById=function(t){return this.bodyElement.querySelector("#"+t+"[data-turbolinks-permanent]")},t.prototype.getPermanentElementsPresentInSnapshot=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.getPermanentElements()).length;n<i;n++)e=r[n],t.getPermanentElementById(e.id)&&o.push(e);return o},t.prototype.findFirstAutofocusableElement=function(){return this.bodyElement.querySelector("[autofocus]")},t.prototype.hasAnchor=function(t){return null!=this.getElementForAnchor(t)},t.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},t.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},t.prototype.isVisitable=function(){return"reload"!==this.getSetting("visit-control")},t.prototype.getSetting=function(t){return this.headDetails.getMetaValue("turbolinks-"+t)},t}()}.call(this),function(){var o=[].slice;c.Renderer=function(){function t(){}var n;return t.render=function(t,e){var n,i,r;return i=t,n=e,(r=function(t,e,n){n.prototype=t.prototype;var i=new n,r=t.apply(i,e);return Object(r)===r?r:i}(this,3<=arguments.length?o.call(arguments,2):[],function(){})).delegate=i,r.render(n),r},t.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},t.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},t.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:((e=document.createElement("script")).textContent=t.textContent,e.async=!1,n(e,t),e)},n=function(t,e){var n,i,r,o,a,s,l;for(s=[],n=0,i=(o=e.attributes).length;n<i;n++)r=(a=o[n]).name,l=a.value,s.push(t.setAttribute(r,l));return s},t}()}.call(this),function(){var s,l,n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;c.SnapshotRenderer=function(t){function e(t,e,n){this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=n,this.currentHeadDetails=this.currentSnapshot.headDetails,this.newHeadDetails=this.newSnapshot.headDetails,this.currentBody=this.currentSnapshot.bodyElement,this.newBody=this.newSnapshot.bodyElement}return n(e,t),e.prototype.render=function(t){return this.shouldRender()?(this.mergeHead(),this.renderView((e=this,function(){return e.replaceBody(),e.isPreview||e.focusFirstAutofocusableElement(),t()}))):this.invalidateView();var e},e.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},e.prototype.replaceBody=function(){var t;return t=this.relocateCurrentBodyPermanentElements(),this.activateNewBodyScriptElements(),this.assignNewBody(),this.replacePlaceholderElementsWithClonedPermanentElements(t)},e.prototype.shouldRender=function(){return this.newSnapshot.isVisitable()&&this.trackedElementsAreIdentical()},e.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},e.prototype.copyNewHeadStylesheetElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadStylesheetElements()).length;e<n;e++)t=i[e],r.push(document.head.appendChild(t));return r},e.prototype.copyNewHeadScriptElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadScriptElements()).length;e<n;e++)t=i[e],r.push(document.head.appendChild(this.createScriptElement(t)));return r},e.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getCurrentHeadProvisionalElements()).length;e<n;e++)t=i[e],r.push(document.head.removeChild(t));return r},e.prototype.copyNewHeadProvisionalElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadProvisionalElements()).length;e<n;e++)t=i[e],r.push(document.head.appendChild(t));return r},e.prototype.relocateCurrentBodyPermanentElements=function(){var t,e,n,i,r,o,a;for(a=[],t=0,e=(o=this.getCurrentBodyPermanentElements()).length;t<e;t++)i=o[t],r=s(i),n=this.newSnapshot.getPermanentElementById(i.id),l(i,r.element),l(n,i),a.push(r);return a},e.prototype.replacePlaceholderElementsWithClonedPermanentElements=function(t){var e,n,i,r,o,a;for(a=[],i=0,r=t.length;i<r;i++)n=(o=t[i]).element,e=o.permanentElement.cloneNode(!0),a.push(l(n,e));return a},e.prototype.activateNewBodyScriptElements=function(){var t,e,n,i,r,o;for(o=[],e=0,i=(r=this.getNewBodyScriptElements()).length;e<i;e++)n=r[e],t=this.createScriptElement(n),o.push(l(n,t));return o},e.prototype.assignNewBody=function(){return document.body=this.newBody},e.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.newSnapshot.findFirstAutofocusableElement())?t.focus():void 0},e.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},e.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},e.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},e.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},e.prototype.getCurrentBodyPermanentElements=function(){return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot)},e.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},e}(c.Renderer),s=function(t){var e;return(e=document.createElement("meta")).setAttribute("name","turbolinks-permanent-placeholder"),e.setAttribute("content",t.id),{element:e,permanentElement:t}},l=function(t,e){var n;return(n=t.parentNode)?n.replaceChild(e,t):void 0}}.call(this),function(){var n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;c.ErrorRenderer=function(t){function e(t){var e;(e=document.createElement("html")).innerHTML=t,this.newHead=e.querySelector("head"),this.newBody=e.querySelector("body")}return n(e,t),e.prototype.render=function(t){return this.renderView((e=this,function(){return e.replaceHeadAndBody(),e.activateBodyScriptElements(),t()}));var e},e.prototype.replaceHeadAndBody=function(){var t,e;return e=document.head,t=document.body,e.parentNode.replaceChild(this.newHead,e),t.parentNode.replaceChild(this.newBody,t)},e.prototype.activateBodyScriptElements=function(){var t,e,n,i,r,o;for(o=[],e=0,n=(i=this.getScriptElements()).length;e<n;e++)r=i[e],t=this.createScriptElement(r),o.push(r.parentNode.replaceChild(t,r));return o},e.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},e}(c.Renderer)}.call(this),function(){c.View=function(){function t(t){this.delegate=t,this.htmlElement=document.documentElement}return t.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},t.prototype.getElementForAnchor=function(t){return this.getSnapshot().getElementForAnchor(t)},t.prototype.getSnapshot=function(){return c.Snapshot.fromHTMLElement(this.htmlElement)},t.prototype.render=function(t,e){var n,i,r;return r=t.snapshot,n=t.error,i=t.isPreview,this.markAsPreview(i),null!=r?this.renderSnapshot(r,i,e):this.renderError(n,e)},t.prototype.markAsPreview=function(t){return t?this.htmlElement.setAttribute("data-turbolinks-preview",""):this.htmlElement.removeAttribute("data-turbolinks-preview")},t.prototype.renderSnapshot=function(t,e,n){return c.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),c.Snapshot.wrap(t),e)},t.prototype.renderError=function(t,e){return c.ErrorRenderer.render(this.delegate,e,t)},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};c.ScrollManager=function(){function t(t){this.delegate=t,this.onScroll=e(this.onScroll,this),this.onScroll=c.throttle(this.onScroll)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},t.prototype.scrollToElement=function(t){return t.scrollIntoView()},t.prototype.scrollToPosition=function(t){var e,n;return e=t.x,n=t.y,window.scrollTo(e,n)},t.prototype.onScroll=function(){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},t.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},t}()}.call(this),function(){c.SnapshotCache=function(){function t(t){this.size=t,this.keys=[],this.snapshots={}}var i;return t.prototype.has=function(t){return i(t)in this.snapshots},t.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},t.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},t.prototype.read=function(t){var e;return e=i(t),this.snapshots[e]},t.prototype.write=function(t,e){var n;return n=i(t),this.snapshots[n]=e},t.prototype.touch=function(t){var e,n;return n=i(t),-1<(e=this.keys.indexOf(n))&&this.keys.splice(e,1),this.keys.unshift(n),this.trim()},t.prototype.trim=function(){var t,e,n,i,r;for(r=[],t=0,n=(i=this.keys.splice(this.size)).length;t<n;t++)e=i[t],r.push(delete this.snapshots[e]);return r},i=function(t){return c.Location.wrap(t).toCacheKey()},t}()}.call(this),function(){var i=function(t,e){return function(){return t.apply(e,arguments)}};c.Visit=function(){function t(t,e,n){this.controller=t,this.action=n,this.performScroll=i(this.performScroll,this),this.identifier=c.uuid(),this.location=c.Location.wrap(e),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var n;return t.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},t.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},t.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},t.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},t.prototype.changeHistory=function(){var t,e;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,e=n(t),this.controller[e](this.location,this.restorationIdentifier),this.historyChanged=!0)},t.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new c.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},t.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},t.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},t.prototype.loadCachedSnapshot=function(){var e,n;return(n=this.getCachedSnapshot())?(e=this.shouldIssueRequest(),this.render(function(){var t;return this.cacheSnapshot(),this.controller.render({snapshot:n,isPreview:e},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),e?void 0:this.complete()})):void 0},t.prototype.loadResponse=function(){return null!=this.response?this.render(function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())}):void 0},t.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},t.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},t.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},t.prototype.requestCompletedWithResponse=function(t,e){return this.response=t,null!=e&&(this.redirectedToLocation=c.Location.wrap(e)),this.adapter.visitRequestCompleted(this)},t.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,
|
|
this.adapter.visitRequestFailedWithStatusCode(this,t)},t.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},t.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},t.prototype.scrollToRestoredPosition=function(){var t,e;return null!=(t=null!=(e=this.restorationData)?e.scrollPosition:void 0)?(this.controller.scrollToPosition(t),!0):void 0},t.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},t.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},t.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},t.prototype.getTimingMetrics=function(){return c.copyObject(this.timingMetrics)},n=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},t.prototype.shouldIssueRequest=function(){return"restore"!==this.action||!this.hasCachedSnapshot()},t.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},t.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame((e=this,function(){return e.frame=null,t.call(e)}));var e},t.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};c.Controller=function(){function t(){this.clickBubbled=e(this.clickBubbled,this),this.clickCaptured=e(this.clickCaptured,this),this.pageLoaded=e(this.pageLoaded,this),this.history=new c.History(this),this.view=new c.View(this),this.scrollManager=new c.ScrollManager(this),this.restorationData={},this.clearCache(),this.setProgressBarDelay(500)}return t.prototype.start=function(){return c.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},t.prototype.disable=function(){return this.enabled=!1},t.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},t.prototype.clearCache=function(){return this.cache=new c.SnapshotCache(10)},t.prototype.visit=function(t,e){var n,i;return null==e&&(e={}),t=c.Location.wrap(t),this.applicationAllowsVisitingLocation(t)?this.locationIsVisitable(t)?(n=null!=(i=e.action)?i:"advance",this.adapter.visitProposedToLocationWithAction(t,n)):window.location=t:void 0},t.prototype.startVisitToLocationWithAction=function(t,e,n){var i;return c.supported?(i=this.getRestorationDataForIdentifier(n),this.startVisit(t,e,{restorationData:i})):window.location=t},t.prototype.setProgressBarDelay=function(t){return this.progressBarDelay=t},t.prototype.startHistory=function(){return this.location=c.Location.wrap(window.location),this.restorationIdentifier=c.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},t.prototype.stopHistory=function(){return this.history.stop()},t.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=c.Location.wrap(t),this.history.push(this.location,this.restorationIdentifier)},t.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=c.Location.wrap(t),this.history.replace(this.location,this.restorationIdentifier)},t.prototype.historyPoppedToLocationWithRestorationIdentifier=function(t,e){var n;return this.restorationIdentifier=e,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(t,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=c.Location.wrap(t)):this.adapter.pageInvalidated()},t.prototype.getCachedSnapshotForLocation=function(t){var e;return null!=(e=this.cache.get(t))?e.clone():void 0},t.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},t.prototype.cacheSnapshot=function(){var t,e,n;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),e=this.view.getSnapshot(),t=this.lastRenderedLocation,c.defer((n=this,function(){return n.cache.put(t,e.clone())}))):void 0},t.prototype.scrollToAnchor=function(t){var e;return(e=this.view.getElementForAnchor(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},t.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},t.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},t.prototype.scrollPositionChanged=function(t){return this.getCurrentRestorationData().scrollPosition=t},t.prototype.render=function(t,e){return this.view.render(t,e)},t.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},t.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},t.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},t.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},t.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},t.prototype.clickBubbled=function(t){var e,n,i;return this.enabled&&this.clickEventIsSignificant(t)&&(n=this.getVisitableLinkForNode(t.target))&&(i=this.getVisitableLocationForLink(n))&&this.applicationAllowsFollowingLinkToLocation(n,i)?(t.preventDefault(),e=this.getActionForLink(n),this.visit(i,{action:e})):void 0},t.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){return!this.notifyApplicationAfterClickingLinkToLocation(t,e).defaultPrevented},t.prototype.applicationAllowsVisitingLocation=function(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented},t.prototype.notifyApplicationAfterClickingLinkToLocation=function(t,e){return c.dispatch("turbolinks:click",{target:t,data:{url:e.absoluteURL},cancelable:!0})},t.prototype.notifyApplicationBeforeVisitingLocation=function(t){return c.dispatch("turbolinks:before-visit",{data:{url:t.absoluteURL},cancelable:!0})},t.prototype.notifyApplicationAfterVisitingLocation=function(t){return c.dispatch("turbolinks:visit",{data:{url:t.absoluteURL}})},t.prototype.notifyApplicationBeforeCachingSnapshot=function(){return c.dispatch("turbolinks:before-cache")},t.prototype.notifyApplicationBeforeRender=function(t){return c.dispatch("turbolinks:before-render",{data:{newBody:t}})},t.prototype.notifyApplicationAfterRender=function(){return c.dispatch("turbolinks:render")},t.prototype.notifyApplicationAfterPageLoad=function(t){return null==t&&(t={}),c.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:t}})},t.prototype.startVisit=function(t,e,n){var i;return null!=(i=this.currentVisit)&&i.cancel(),this.currentVisit=this.createVisit(t,e,n),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},t.prototype.createVisit=function(t,e,n){var i,r,o,a,s;return a=(r=null!=n?n:{}).restorationIdentifier,o=r.restorationData,i=r.historyChanged,(s=new c.Visit(this,t,e)).restorationIdentifier=null!=a?a:c.uuid(),s.restorationData=c.copyObject(o),s.historyChanged=i,s.referrer=this.location,s},t.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},t.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||1<t.which||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},t.prototype.getVisitableLinkForNode=function(t){return this.nodeIsVisitable(t)?c.closest(t,"a[href]:not([target]):not([download])"):void 0},t.prototype.getVisitableLocationForLink=function(t){var e;return e=new c.Location(t.getAttribute("href")),this.locationIsVisitable(e)?e:void 0},t.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},t.prototype.nodeIsVisitable=function(t){var e;return!(e=c.closest(t,"[data-turbolinks]"))||"false"!==e.getAttribute("data-turbolinks")},t.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},t.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},t.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},t}()}.call(this),function(){!function(){var t,e;if((t=e=document.currentScript)&&!e.hasAttribute("data-turbolinks-suppress-warning"))for(;t=t.parentNode;)if(t===document.body)return console.warn("You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!\n\nLoad your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\nFor more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements\n\n\u2014\u2014\nSuppress this warning by adding a `data-turbolinks-suppress-warning` attribute to: %s",e.outerHTML)}()}.call(this),function(){var t,e,n;c.start=function(){return e()?(null==c.controller&&(c.controller=t()),c.controller.start()):void 0},e=function(){return null==window.Turbolinks&&(window.Turbolinks=c),n()},t=function(){var t;return(t=new c.Controller).adapter=new c.BrowserAdapter(t),t},(n=function(){return window.Turbolinks===c})()&&c.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd&&define(c)}.call(this),function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(C,t){"use strict";function g(t,e,n){var i,r,o=(n=n||lt).createElement("script");if(o.text=t,e)for(i in _t)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function m(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?pt[gt.call(t)]||"object":typeof t}function s(t){var e=!!t&&"length"in t&&t.length,n=m(t);return!bt(t)&&!wt(t)&&("array"===n||0===e||"number"==typeof e&&0<e&&e-1 in t)}function u(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function e(t,n,i){return bt(n)?Ct.grep(t,function(t,e){return!!n.call(t,e,t)!==i}):n.nodeType?Ct.grep(t,function(t){return t===n!==i}):"string"!=typeof n?Ct.grep(t,function(t){return-1<ft.call(n,t)!==i}):Ct.filter(n,t,i)}function n(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function c(t){var n={};return Ct.each(t.match(Nt)||[],function(t,e){n[e]=!0}),n}function h(t){return t}function d(t){throw t}function l(t,e,n,i){var r;try{t&&bt(r=t.promise)?r.call(t).done(e).fail(n):t&&bt(r=t.then)?r.call(t,e,n):e.apply(undefined,[t].slice(i))}catch(t){n.apply(undefined,[t])}}function i(){lt.removeEventListener("DOMContentLoaded",i),C.removeEventListener("load",i),Ct.ready()}function r(t,e){return e.toUpperCase()}function f(t){return t.replace(Ht,"ms-").replace(Bt,r)}function o(){this.expando=Ct.expando+o.uid++}function a(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Ut.test(t)?JSON.parse(t):t)}function p(t,e,n){var i;if(n===undefined&&1===t.nodeType)if(i="data-"+e.replace($t,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=a(n)}catch(r){}Wt.set(t,e,n)}else n=undefined;return n}function v(t,e,n,i){var r,o,a=20,s=i?function(){return i.cur()}:function(){return Ct.css(t,e,"")},l=s(),u=n&&n[3]||(Ct.cssNumber[e]?"":"px"),c=t.nodeType&&(Ct.cssNumber[e]||"px"!==u&&+l)&&Gt.exec(Ct.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)Ct.style(t,e,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,Ct.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=r)),r}function y(t){var e,n=t.ownerDocument,i=t.nodeName,r=te[i];return r||(e=n.body.appendChild(n.createElement(i)),r=Ct.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),te[i]=r)}function x(t,e){for(var n,i,r=[],o=0,a=t.length;o<a;o++)(i=t[o]).style&&(n=i.style.display,e?("none"===n&&(r[o]=jt.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&Qt(i)&&(r[o]=y(i))):"none"!==n&&(r[o]="none",jt.set(i,"display",n)));for(o=0;o<a;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}function b(t,e){var n;return n="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],e===undefined||e&&u(t,e)?Ct.merge([t],n):n}function w(t,e){for(var n=0,i=t.length;n<i;n++)jt.set(t[n],"globalEval",!e||jt.get(e[n],"globalEval"))}function _(t,e,n,i,r){for(var o,a,s,l,u,c,h=e.createDocumentFragment(),d=[],f=0,p=t.length;f<p;f++)if((o=t[f])||0===o)if("object"===m(o))Ct.merge(d,o.nodeType?[o]:o);else if(se.test(o)){for(a=a||h.appendChild(e.createElement("div")),s=(ne.exec(o)||["",""])[1].toLowerCase(),l=re[s]||re._default,a.innerHTML=l[1]+Ct.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;Ct.merge(d,a.childNodes),(a=h.firstChild).textContent=""}else d.push(e.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(i&&-1<Ct.inArray(o,i))r&&r.push(o);else if(u=Xt(o),a=b(h.appendChild(o),"script"),u&&w(a),n)for(c=0;o=a[c++];)ie.test(o.type||"")&&n.push(o);return h}function S(){return!0}function T(){return!1}function A(t,e){return t===D()==("focus"===e)}function D(){try{return lt.activeElement}catch(t){}}function M(t,e,n,i,r,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(i=i||n,n=undefined),e)M(t,s,n,i,e[s],o);return t}if(null==i&&null==r?(r=n,i=n=undefined):null==r&&("string"==typeof n?(r=i,i=undefined):(r=i,i=n,n=undefined)),!1===r)r=T;else if(!r)return t;return 1===o&&(a=r,(r=function(t){return Ct().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=Ct.guid++)),t.each(function(){Ct.event.add(this,e,r,i,n)})}function I(t,r,o){o?(jt.set(t,r,!1),Ct.event.add(t,r,{namespace:!1,handler:function(t){var e,n,i=jt.get(this,r);if(1&t.isTrigger&&this[r]){if(i.length)(Ct.event.special[r]||{}).delegateType&&t.stopPropagation();else if(i=ct.call(arguments),jt.set(this,r,i),e=o(this,r),this[r](),i!==(n=jt.get(this,r))||e?jt.set(this,r,!1):n={},i!==n)return t.stopImmediatePropagation(),t.preventDefault(),n.value}else i.length&&(jt.set(this,r,{value:Ct.event.trigger(Ct.extend(i[0],Ct.Event.prototype),i.slice(1),this)}),t.stopImmediatePropagation())}})):jt.get(t,r)===undefined&&Ct.event.add(t,r,S)}function k(t,e){return u(t,"table")&&u(11!==e.nodeType?e:e.firstChild,"tr")&&Ct(t).children("tbody")[0]||t}function E(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function L(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function O(t,e){var n,i,r,o,a,s,l,u;if(1===e.nodeType){if(jt.hasData(t)&&(o=jt.access(t),a=jt.set(e,o),u=o.events))for(r in delete a.handle,a.events={},u)for(n=0,i=u[r].length;n<i;n++)Ct.event.add(e,r,u[r][n]);Wt.hasData(t)&&(s=Wt.access(t),l=Ct.extend({},s),Wt.set(e,l))}}function P(t,e){var n=e.nodeName.toLowerCase();"input"===n&&ee.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function N(n,i,r,o){i=ht.apply([],i);var t,e,a,s,l,u,c=0,h=n.length,d=h-1,f=i[0],p=bt(f);if(p||1<h&&"string"==typeof f&&!xt.checkClone&&fe.test(f))return n.each(function(t){var e=n.eq(t);p&&(i[0]=f.call(this,t,e.html())),N(e,i,r,o)});if(h&&(e=(t=_(i,n[0].ownerDocument,!1,n,o)).firstChild,1===t.childNodes.length&&(t=e),e||o)){for(s=(a=Ct.map(b(t,"script"),E)).length;c<h;c++)l=t,c!==d&&(l=Ct.clone(l,!0,!0),s&&Ct.merge(a,b(l,"script"))),r.call(n[c],l,c);if(s)for(u=a[a.length-1].ownerDocument,Ct.map(a,L),c=0;c<s;c++)l=a[c],ie.test(l.type||"")&&!jt.access(l,"globalEval")&&Ct.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?Ct._evalUrl&&!l.noModule&&Ct._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")}):g(l.textContent.replace(pe,""),l,u))}return n}function R(t,e,n){for(var i,r=e?Ct.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||Ct.cleanData(b(i)),i.parentNode&&(n&&Xt(i)&&w(b(i,"script")),i.parentNode.removeChild(i));return t}function F(t,e,n){var i,r,o,a,s=t.style;return(n=n||me(t))&&(""!==(a=n.getPropertyValue(e)||n[e])||Xt(t)||(a=Ct.style(t,e)),!xt.pixelBoxStyles()&&ge.test(a)&&ve.test(e)&&(i=s.width,r=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=i,s.minWidth=r,s.maxWidth=o)),a!==undefined?a+"":a}function z(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}function H(t){for(var e=t[0].toUpperCase()+t.slice(1),n=ye.length;n--;)if((t=ye[n]+e)in xe)return t}function B(t){var e=Ct.cssProps[t]||be[t];return e||(t in xe?t:be[t]=H(t)||t)}function V(t,e,n){var i=Gt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function j(t,e,n,i,r,o){var a="width"===e?1:0,s=0,l=0;if(n===(i?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=Ct.css(t,n+Yt[a],!0,r)),i?("content"===n&&(l-=Ct.css(t,"padding"+Yt[a],!0,r)),"margin"!==n&&(l-=Ct.css(t,"border"+Yt[a]+"Width",!0,r))):(l+=Ct.css(t,"padding"+Yt[a],!0,r),"padding"!==n?l+=Ct.css(t,"border"+Yt[a]+"Width",!0,r):s+=Ct.css(t,"border"+Yt[a]+"Width",!0,r));return!i&&0<=o&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l}function W(t,e,n){var i=me(t),r=(!xt.boxSizingReliable()||n)&&"border-box"===Ct.css(t,"boxSizing",!1,i),o=r,a=F(t,e,i),s="offset"+e[0].toUpperCase()+e.slice(1);if(ge.test(a)){if(!n)return a;a="auto"}return(!xt.boxSizingReliable()&&r||"auto"===a||!parseFloat(a)&&"inline"===Ct.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===Ct.css(t,"boxSizing",!1,i),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+j(t,e,n||(r?"border":"content"),o,i,a)+"px"}function U(t,e,n,i,r){return new U.prototype.init(t,e,n,i,r)}function $(){Ae&&(!1===lt.hidden&&C.requestAnimationFrame?C.requestAnimationFrame($):C.setTimeout($,Ct.fx.interval),Ct.fx.tick())}function q(){return C.setTimeout(function(){Te=undefined}),Te=Date.now()}function G(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=Yt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function Y(t,e,n){for(var i,r=(K.tweeners[e]||[]).concat(K.tweeners["*"]),o=0,a=r.length;o<a;o++)if(i=r[o].call(n,e,t))return i}function Z(t,e,n){var i,r,o,a,s,l,u,c,h="width"in e||"height"in e,d=this,f={},p=t.style,g=t.nodeType&&Qt(t),m=jt.get(t,"fxshow");for(i in n.queue||(null==(a=Ct._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,Ct.queue(t,"fx").length||a.empty.fire()})})),e)if(r=e[i],Ie.test(r)){if(delete e[i],o=o||"toggle"===r,r===(g?"hide":"show")){if("show"!==r||!m||m[i]===undefined)continue;g=!0}f[i]=m&&m[i]||Ct.style(t,i)}if((l=!Ct.isEmptyObject(e))||!Ct.isEmptyObject(f))for(i in h&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=m&&m.display)&&(u=jt.get(t,"display")),"none"===(c=Ct.css(t,"display"))&&(u?c=u:(x([t],!0),u=t.style.display||u,c=Ct.css(t,"display"),x([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===Ct.css(t,"float")&&(l||(d.done(function(){p.display=u}),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),l=!1,f)l||(m?"hidden"in m&&(g=m.hidden):m=jt.access(t,"fxshow",{display:u}),o&&(m.hidden=!g),g&&x([t],!0),d.done(function(){for(i in g||x([t]),jt.remove(t,"fxshow"),f)Ct.style(t,i,f[i])})),l=Y(g?m[i]:0,i,d),i in m||(m[i]=l.start,g&&(l.end=l.start,l.start=0))}function X(t,e){var n,i,r,o,a;for(n in t)if(r=e[i=f(n)],o=t[n],Array.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(a=Ct.cssHooks[i])&&"expand"in a)for(n in o=a.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}function K(o,t,e){var n,a,i=0,r=K.prefilters.length,s=Ct.Deferred().always(function(){delete l.elem}),l=function(){if(a)return!1;for(var t=Te||q(),e=Math.max(0,u.startTime+u.duration-t),n=1-(e/u.duration||0),i=0,r=u.tweens.length;i<r;i++)u.tweens[i].run(n);return s.notifyWith(o,[u,n,e]),n<1&&r?e:(r||s.notifyWith(o,[u,1,0]),s.resolveWith(o,[u]),!1)},u=s.promise({elem:o,props:Ct.extend({},t),opts:Ct.extend(!0,{specialEasing:{},easing:Ct.easing._default},e),originalProperties:t,originalOptions:e,startTime:Te||q(),duration:e.duration,tweens:[],createTween:function(t,e){var n=Ct.Tween(o,u.opts,t,e,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(n),n},stop:function(t){var e=0,n=t?u.tweens.length:0;if(a)return this;for(a=!0;e<n;e++)u.tweens[e].run(1);return t?(s.notifyWith(o,[u,1,0]),s.resolveWith(o,[u,t])):s.rejectWith(o,[u,t]),this}}),c=u.props;for(X(c,u.opts.specialEasing);i<r;i++)if(n=K.prefilters[i].call(u,o,c,u.opts))return bt(n.stop)&&(Ct._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return Ct.map(c,Y,u),bt(u.opts.start)&&u.opts.start.call(o,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),Ct.fx.timer(Ct.extend(l,{elem:o,anim:u,queue:u.opts.queue})),u}function Q(t){return(t.match(Nt)||[]).join(" ")}function J(t){return t.getAttribute&&t.getAttribute("class")||""}function tt(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(Nt)||[]}function et(n,t,i,r){var e;if(Array.isArray(t))Ct.each(t,function(t,e){i||Ve.test(n)?r(n,e):et(n+"["+("object"==typeof e&&null!=e?t:"")+"]",e,i,r)});else if(i||"object"!==m(t))r(n,t);else for(e in t)et(n+"["+e+"]",t[e],i,r)}function nt(o){return function(t,e){"string"!=typeof t&&(e=t,t="*");var n,i=0,r=t.toLowerCase().match(Nt)||[];if(bt(e))for(;n=r[i++];)"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(e)):(o[n]=o[n]||[]).push(e)}}function it(e,r,o,a){function s(t){var i;return l[t]=!0,Ct.each(e[t]||[],function(t,e){var n=e(r,o,a);return"string"!=typeof n||u||l[n]?u?!(i=n):void 0:(r.dataTypes.unshift(n),s(n),!1)}),i}var l={},u=e===Je;return s(r.dataTypes[0])||!l["*"]&&s("*")}function rt(t,e){var n,i,r=Ct.ajaxSettings.flatOptions||{};for(n in e)e[n]!==undefined&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&Ct.extend(!0,t,i),t}function ot(t,e,n){for(var i,r,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),i===undefined&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}function at(t,e,n,i){var r,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(h){return{state:"parsererror",error:a?h:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}var st=[],lt=C.document,ut=Object.getPrototypeOf,ct=st.slice,ht=st.concat,dt=st.push,ft=st.indexOf,pt={},gt=pt.toString,mt=pt.hasOwnProperty,vt=mt.toString,yt=vt.call(Object),xt={},bt=function bt(t){return"function"==typeof t&&"number"!=typeof t.nodeType},wt=function wt(t){return null!=t&&t===t.window},_t={type:!0,src:!0,nonce:!0,noModule:!0},St="3.4.1",Ct=function(t,e){return new Ct.fn.init(t,e)},Tt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;Ct.fn=Ct.prototype={jquery:St,constructor:Ct,length:0,toArray:function(){return ct.call(this)},get:function(t){return null==t?ct.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=Ct.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return Ct.each(this,t)},map:function(n){return this.pushStack(Ct.map(this,function(t,e){return n.call(t,e,t)}))},slice:function(){return this.pushStack(ct.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(0<=n&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:dt,sort:st.sort,splice:st.splice},Ct.extend=Ct.fn.extend=function(t){var e,n,i,r,o,a,s=t||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[l]||{},l++),"object"==typeof s||bt(s)||(s={}),l===u&&(s=this,l--);l<u;l++)if(null!=(e=arguments[l]))for(n in e)r=e[n],"__proto__"!==n&&s!==r&&(c&&r&&(Ct.isPlainObject(r)||(o=Array.isArray(r)))?(i=s[n],a=o&&!Array.isArray(i)?[]:o||Ct.isPlainObject(i)?i:{},o=!1,s[n]=Ct.extend(c,a,r)):r!==undefined&&(s[n]=r));return s},Ct.extend({expando:"jQuery"+(St+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==gt.call(t))&&(!(e=ut(t))||"function"==typeof(n=mt.call(e,"constructor")&&e.constructor)&&vt.call(n)===yt)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e){g(t,{nonce:e&&e.nonce})},each:function(t,e){var n,i=0;if(s(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},trim:function(t){return null==t?"":(t+"").replace(Tt,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(s(Object(t))?Ct.merge(n,"string"==typeof t?[t]:t):dt.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:ft.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,o=t.length,a=!n;r<o;r++)!e(t[r],r)!==a&&i.push(t[r]);return i},map:function(t,e,n){var i,r,o=0,a=[];if(s(t))for(i=t.length;o<i;o++)null!=(r=e(t[o],o,n))&&a.push(r);else for(o in t)null!=(r=e(t[o],o,n))&&a.push(r);return ht.apply([],a)},guid:1,support:xt}),"function"==typeof Symbol&&(Ct.fn[Symbol.iterator]=st[Symbol.iterator]),Ct.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){pt["[object "+e+"]"]=e.toLowerCase()});var At=function(n){function b(t,e,n,i){var r,o,a,s,l,u,c,h=e&&e.ownerDocument,d=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==d&&9!==d&&11!==d)return n;if(!i&&((e?e.ownerDocument||e:V)!==O&&L(e),e=e||O,N)){if(11!==d&&(l=xt.exec(t)))if(r=l[1]){if(9===d){if(!(a=e.getElementById(r)))return n;if(a.id===r)return n.push(a),n}else if(h&&(a=h.getElementById(r))&&H(e,a)&&a.id===r)return n.push(a),n}else{if(l[2])return J.apply(n,e.getElementsByTagName(t)),n;if((r=l[3])&&_.getElementsByClassName&&e.getElementsByClassName)return J.apply(n,e.getElementsByClassName(r)),n}if(_.qsa&&!G[t+" "]&&(!R||!R.test(t))&&(1!==d||"object"!==e.nodeName.toLowerCase())){if(c=t,h=e,1===d&&ht.test(t)){for((s=e.getAttribute("id"))?s=s.replace(St,Ct):e.setAttribute("id",s=B),o=(u=A(t)).length;o--;)u[o]="#"+s+" "+g(u[o]);c=u.join(","),h=bt.test(t)&&p(e.parentNode)||e}try{return J.apply(n,h.querySelectorAll(c)),n}catch(f){G(t,!0)}finally{s===B&&e.removeAttribute("id")}}}return M(t.replace(lt,"$1"),e,n,i)}function t(){function n(t,e){return i.push(t+" ")>S.cacheLength&&delete n[i.shift()],n[t+" "]=e}var i=[];return n}function l(t){return t[B]=!0,t}function r(t){var e=O.createElement("fieldset");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function e(t,e){for(var n=t.split("|"),i=n.length;i--;)S.attrHandle[n[i]]=e}function u(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function i(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function o(n){return function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&t.type===n}}function a(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&At(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function s(a){return l(function(o){return o=+o,l(function(t,e){for(var n,i=a([],t.length,o),r=i.length;r--;)t[n=i[r]]&&(t[n]=!(e[n]=t[n]))})})}function p(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function c(){}function g(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function h(s,t,e){var l=t.dir,u=t.next,c=u||l,h=e&&"parentNode"===c,d=W++;return t.first?function(t,e,n){for(;t=t[l];)if(1===t.nodeType||h)return s(t,e,n);return!1}:function(t,e,n){var i,r,o,a=[j,d];if(n){for(;t=t[l];)if((1===t.nodeType||h)&&s(t,e,n))return!0}else for(;t=t[l];)if(1===t.nodeType||h)if(r=(o=t[B]||(t[B]={}))[t.uniqueID]||(o[t.uniqueID]={}),u&&u===t.nodeName.toLowerCase())t=t[l]||t;else{if((i=r[c])&&i[0]===j&&i[1]===d)return a[2]=i[2];if((r[c]=a)[2]=s(t,e,n))return!0}return!1}}function d(r){return 1<r.length?function(t,e,n){for(var i=r.length;i--;)if(!r[i](t,e,n))return!1;return!0}:r[0]}function y(t,e,n){for(var i=0,r=e.length;i<r;i++)b(t,e[i],n);return n}function w(t,e,n,i,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s<l;s++)(o=t[s])&&(n&&!n(o,i,r)||(a.push(o),u&&e.push(s)));return a}function x(f,p,g,m,v,t){return m&&!m[B]&&(m=x(m)),v&&!v[B]&&(v=x(v,t)),l(function(t,e,n,i){var r,o,a,s=[],l=[],u=e.length,c=t||y(p||"*",n.nodeType?[n]:n,[]),h=!f||!t&&p?c:w(c,s,f,n,i),d=g?v||(t?f:u||m)?[]:e:h;if(g&&g(h,d,n,i),m)for(r=w(d,l),m(r,[],n,i),o=r.length;o--;)(a=r[o])&&(d[l[o]]=!(h[l[o]]=a));if(t){if(v||f){if(v){for(r=[],o=d.length;o--;)(a=d[o])&&r.push(h[o]=a);v(null,d=[],r,i)}for(o=d.length;o--;)(a=d[o])&&-1<(r=v?et(t,a):s[o])&&(t[r]=!(e[r]=a))}}else d=w(d===e?d.splice(u,d.length):d),v?v(null,e,d,i):J.apply(e,d)})}function f(t){for(var r,e,n,i=t.length,o=S.relative[t[0].type],a=o||S.relative[" "],s=o?1:0,l=h(function(t){return t===r},a,!0),u=h(function(t){return-1<et(r,t)},a,!0),c=[function(t,e,n){var i=!o&&(n||e!==I)||((r=e).nodeType?l(t,e,n):u(t,e,n));return r=null,i}];s<i;s++)if(e=S.relative[t[s].type])c=[h(d(c),e)];else{if((e=S.filter[t[s].type].apply(null,t[s].matches))[B]){for(n=++s;n<i&&!S.relative[t[n].type];n++);return x(1<s&&d(c),1<s&&g(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(lt,"$1"),e,s<n&&f(t.slice(s,n)),n<i&&f(t=t.slice(n)),n<i&&g(t))}c.push(e)}return d(c)}function m(m,v){var y=0<v.length,x=0<m.length,t=function(t,e,n,i,r){var o,a,s,l=0,u="0",c=t&&[],h=[],d=I,f=t||x&&S.find.TAG("*",r),p=j+=null==d?1:Math.random()||.1,g=f.length;for(r&&(I=e===O||e||r);u!==g&&null!=(o=f[u]);u++){if(x&&o){for(a=0,e||o.ownerDocument===O||(L(o),n=!N);s=m[a++];)if(s(o,e||O,n)){i.push(o);break}r&&(j=p)}y&&((o=!s&&o)&&l--,t&&c.push(o))}if(l+=u,y&&u!==l){for(a=0;s=v[a++];)s(c,h,e,n);if(t){if(0<l)for(;u--;)c[u]||h[u]||(h[u]=K.call(i));h=w(h)}J.apply(i,h),r&&!t&&0<h.length&&1<l+v.length&&b.uniqueSort(i)}return r&&(j=p,I=d),c};return y?l(t):t}var v,_,S,C,T,A,D,M,I,k,E,L,O,P,N,R,F,z,H,B="sizzle"+1*new Date,V=n.document,j=0,W=0,U=t(),$=t(),q=t(),G=t(),Y=function(t,e){return t===e&&(E=!0),0},Z={}.hasOwnProperty,X=[],K=X.pop,Q=X.push,J=X.push,tt=X.slice,et=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},nt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ot="\\["+it+"*("+rt+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+rt+"))|)"+it+"*\\]",at=":("+rt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",st=new RegExp(it+"+","g"),lt=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),ut=new RegExp("^"+it+"*,"+it+"*"),ct=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),ht=new RegExp(it+"|>"),dt=new RegExp(at),ft=new RegExp("^"+rt+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt+"|[*])"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp(
|
|
"^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},gt=/HTML$/i,mt=/^(?:input|select|textarea|button)$/i,vt=/^h\d$/i,yt=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,bt=/[+~]/,wt=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),_t=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},St=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ct=function(t,e){return e?"\0"===t?"\ufffd":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},Tt=function(){L()},At=h(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{J.apply(X=tt.call(V.childNodes),V.childNodes),X[V.childNodes.length].nodeType}catch(Dt){J={apply:X.length?function(t,e){Q.apply(t,tt.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}for(v in _=b.support={},T=b.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!gt.test(e||n&&n.nodeName||"HTML")},L=b.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:V;return i!==O&&9===i.nodeType&&i.documentElement&&(P=(O=i).documentElement,N=!T(O),V!==O&&(n=O.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Tt,!1):n.attachEvent&&n.attachEvent("onunload",Tt)),_.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),_.getElementsByTagName=r(function(t){return t.appendChild(O.createComment("")),!t.getElementsByTagName("*").length}),_.getElementsByClassName=yt.test(O.getElementsByClassName),_.getById=r(function(t){return P.appendChild(t).id=B,!O.getElementsByName||!O.getElementsByName(B).length}),_.getById?(S.filter.ID=function(t){var e=t.replace(wt,_t);return function(t){return t.getAttribute("id")===e}},S.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&N){var n=e.getElementById(t);return n?[n]:[]}}):(S.filter.ID=function(t){var n=t.replace(wt,_t);return function(t){var e="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return e&&e.value===n}},S.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&N){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),S.find.TAG=_.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):_.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"!==t)return o;for(;n=o[r++];)1===n.nodeType&&i.push(n);return i},S.find.CLASS=_.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&N)return e.getElementsByClassName(t)},F=[],R=[],(_.qsa=yt.test(O.querySelectorAll))&&(r(function(t){P.appendChild(t).innerHTML="<a id='"+B+"'></a><select id='"+B+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&R.push("[*^$]="+it+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||R.push("\\["+it+"*(?:value|"+nt+")"),t.querySelectorAll("[id~="+B+"-]").length||R.push("~="),t.querySelectorAll(":checked").length||R.push(":checked"),t.querySelectorAll("a#"+B+"+*").length||R.push(".#.+[+~]")}),r(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=O.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&R.push("name"+it+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&R.push(":enabled",":disabled"),P.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&R.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),R.push(",.*:")})),(_.matchesSelector=yt.test(z=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&r(function(t){_.disconnectedMatch=z.call(t,"*"),z.call(t,"[s!='']:x"),F.push("!=",at)}),R=R.length&&new RegExp(R.join("|")),F=F.length&&new RegExp(F.join("|")),e=yt.test(P.compareDocumentPosition),H=e||yt.test(P.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Y=e?function(t,e){if(t===e)return E=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!_.sortDetached&&e.compareDocumentPosition(t)===n?t===O||t.ownerDocument===V&&H(V,t)?-1:e===O||e.ownerDocument===V&&H(V,e)?1:k?et(k,t)-et(k,e):0:4&n?-1:1)}:function(t,e){if(t===e)return E=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!r||!o)return t===O?-1:e===O?1:r?-1:o?1:k?et(k,t)-et(k,e):0;if(r===o)return u(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[i]===s[i];)i++;return i?u(a[i],s[i]):a[i]===V?-1:s[i]===V?1:0}),O},b.matches=function(t,e){return b(t,null,null,e)},b.matchesSelector=function(t,e){if((t.ownerDocument||t)!==O&&L(t),_.matchesSelector&&N&&!G[e+" "]&&(!F||!F.test(e))&&(!R||!R.test(e)))try{var n=z.call(t,e);if(n||_.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(Dt){G(e,!0)}return 0<b(e,O,null,[t]).length},b.contains=function(t,e){return(t.ownerDocument||t)!==O&&L(t),H(t,e)},b.attr=function(t,e){(t.ownerDocument||t)!==O&&L(t);var n=S.attrHandle[e.toLowerCase()],i=n&&Z.call(S.attrHandle,e.toLowerCase())?n(t,e,!N):undefined;return i!==undefined?i:_.attributes||!N?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},b.escape=function(t){return(t+"").replace(St,Ct)},b.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},b.uniqueSort=function(t){var e,n=[],i=0,r=0;if(E=!_.detectDuplicates,k=!_.sortStable&&t.slice(0),t.sort(Y),E){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return k=null,t},C=b.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=C(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=C(e);return n},(S=b.selectors={cacheLength:50,createPseudo:l,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(wt,_t),t[3]=(t[3]||t[4]||t[5]||"").replace(wt,_t),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||b.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&b.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&dt.test(n)&&(e=A(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(wt,_t).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=U[t+" "];return e||(e=new RegExp("(^|"+it+")"+t+"("+it+"|$)"))&&U(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(n,i,r){return function(t){var e=b.attr(t,n);return null==e?"!="===i:!i||(e+="","="===i?e===r:"!="===i?e!==r:"^="===i?r&&0===e.indexOf(r):"*="===i?r&&-1<e.indexOf(r):"$="===i?r&&e.slice(-r.length)===r:"~="===i?-1<(" "+e.replace(st," ")+" ").indexOf(r):"|="===i&&(e===r||e.slice(0,r.length+1)===r+"-"))}},CHILD:function(p,t,e,g,m){var v="nth"!==p.slice(0,3),y="last"!==p.slice(-4),x="of-type"===t;return 1===g&&0===m?function(t){return!!t.parentNode}:function(t,e,n){var i,r,o,a,s,l,u=v!==y?"nextSibling":"previousSibling",c=t.parentNode,h=x&&t.nodeName.toLowerCase(),d=!n&&!x,f=!1;if(c){if(v){for(;u;){for(a=t;a=a[u];)if(x?a.nodeName.toLowerCase()===h:1===a.nodeType)return!1;l=u="only"===p&&!l&&"nextSibling"}return!0}if(l=[y?c.firstChild:c.lastChild],y&&d){for(f=(s=(i=(r=(o=(a=c)[B]||(a[B]={}))[a.uniqueID]||(o[a.uniqueID]={}))[p]||[])[0]===j&&i[1])&&i[2],a=s&&c.childNodes[s];a=++s&&a&&a[u]||(f=s=0)||l.pop();)if(1===a.nodeType&&++f&&a===t){r[p]=[j,s,f];break}}else if(d&&(f=s=(i=(r=(o=(a=t)[B]||(a[B]={}))[a.uniqueID]||(o[a.uniqueID]={}))[p]||[])[0]===j&&i[1]),!1===f)for(;(a=++s&&a&&a[u]||(f=s=0)||l.pop())&&((x?a.nodeName.toLowerCase()!==h:1!==a.nodeType)||!++f||(d&&((r=(o=a[B]||(a[B]={}))[a.uniqueID]||(o[a.uniqueID]={}))[p]=[j,f]),a!==t)););return(f-=m)===g||f%g==0&&0<=f/g}}},PSEUDO:function(t,o){var e,a=S.pseudos[t]||S.setFilters[t.toLowerCase()]||b.error("unsupported pseudo: "+t);return a[B]?a(o):1<a.length?(e=[t,t,"",o],S.setFilters.hasOwnProperty(t.toLowerCase())?l(function(t,e){for(var n,i=a(t,o),r=i.length;r--;)t[n=et(t,i[r])]=!(e[n]=i[r])}):function(t){return a(t,0,e)}):a}},pseudos:{not:l(function(t){var i=[],r=[],s=D(t.replace(lt,"$1"));return s[B]?l(function(t,e,n,i){for(var r,o=s(t,null,i,[]),a=t.length;a--;)(r=o[a])&&(t[a]=!(e[a]=r))}):function(t,e,n){return i[0]=t,s(i,null,n,r),i[0]=null,!r.pop()}}),has:l(function(e){return function(t){return 0<b(e,t).length}}),contains:l(function(e){return e=e.replace(wt,_t),function(t){return-1<(t.textContent||C(t)).indexOf(e)}}),lang:l(function(n){return ft.test(n||"")||b.error("unsupported lang: "+n),n=n.replace(wt,_t).toLowerCase(),function(t){var e;do{if(e=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(e=e.toLowerCase())===n||0===e.indexOf(n+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var e=n.location&&n.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===P},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:a(!1),disabled:a(!0),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},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!S.pseudos.empty(t)},header:function(t){return vt.test(t.nodeName)},input:function(t){return mt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:s(function(){return[0]}),last:s(function(t,e){return[e-1]}),eq:s(function(t,e,n){return[n<0?n+e:n]}),even:s(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:s(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:s(function(t,e,n){for(var i=n<0?n+e:e<n?e:n;0<=--i;)t.push(i);return t}),gt:s(function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t})}}).pseudos.nth=S.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})S.pseudos[v]=i(v);for(v in{submit:!0,reset:!0})S.pseudos[v]=o(v);return c.prototype=S.filters=S.pseudos,S.setFilters=new c,A=b.tokenize=function(t,e){var n,i,r,o,a,s,l,u=$[t+" "];if(u)return e?0:u.slice(0);for(a=t,s=[],l=S.preFilter;a;){for(o in n&&!(i=ut.exec(a))||(i&&(a=a.slice(i[0].length)||a),s.push(r=[])),n=!1,(i=ct.exec(a))&&(n=i.shift(),r.push({value:n,type:i[0].replace(lt," ")}),a=a.slice(n.length)),S.filter)!(i=pt[o].exec(a))||l[o]&&!(i=l[o](i))||(n=i.shift(),r.push({value:n,type:o,matches:i}),a=a.slice(n.length));if(!n)break}return e?a.length:a?b.error(t):$(t,s).slice(0)},D=b.compile=function(t,e){var n,i=[],r=[],o=q[t+" "];if(!o){for(e||(e=A(t)),n=e.length;n--;)(o=f(e[n]))[B]?i.push(o):r.push(o);(o=q(t,m(r,i))).selector=t}return o},M=b.select=function(t,e,n,i){var r,o,a,s,l,u="function"==typeof t&&t,c=!i&&A(t=u.selector||t);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===e.nodeType&&N&&S.relative[o[1].type]){if(!(e=(S.find.ID(a.matches[0].replace(wt,_t),e)||[])[0]))return n;u&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=pt.needsContext.test(t)?0:o.length;r--&&(a=o[r],!S.relative[s=a.type]);)if((l=S.find[s])&&(i=l(a.matches[0].replace(wt,_t),bt.test(o[0].type)&&p(e.parentNode)||e))){if(o.splice(r,1),!(t=i.length&&g(o)))return J.apply(n,i),n;break}}return(u||D(t,c))(i,e,!N,n,!e||bt.test(t)&&p(e.parentNode)||e),n},_.sortStable=B.split("").sort(Y).join("")===B,_.detectDuplicates=!!E,L(),_.sortDetached=r(function(t){return 1&t.compareDocumentPosition(O.createElement("fieldset"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||e("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),_.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||e("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||e(nt,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),b}(C);Ct.find=At,Ct.expr=At.selectors,Ct.expr[":"]=Ct.expr.pseudos,Ct.uniqueSort=Ct.unique=At.uniqueSort,Ct.text=At.getText,Ct.isXMLDoc=At.isXML,Ct.contains=At.contains,Ct.escapeSelector=At.escape;var Dt=function(t,e,n){for(var i=[],r=n!==undefined;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&Ct(t).is(n))break;i.push(t)}return i},Mt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},It=Ct.expr.match.needsContext,kt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;Ct.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?Ct.find.matchesSelector(i,t)?[i]:[]:Ct.find.matches(t,Ct.grep(e,function(t){return 1===t.nodeType}))},Ct.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(Ct(t).filter(function(){for(e=0;e<i;e++)if(Ct.contains(r[e],this))return!0}));for(n=this.pushStack([]),e=0;e<i;e++)Ct.find(t,r[e],n);return 1<i?Ct.uniqueSort(n):n},filter:function(t){return this.pushStack(e(this,t||[],!1))},not:function(t){return this.pushStack(e(this,t||[],!0))},is:function(t){return!!e(this,"string"==typeof t&&It.test(t)?Ct(t):t||[],!1).length}});var Et,Lt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(Ct.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||Et,"string"!=typeof t)return t.nodeType?(this[0]=t,this.length=1,this):bt(t)?n.ready!==undefined?n.ready(t):t(Ct):Ct.makeArray(t,this);if(!(i="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:Lt.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof Ct?e[0]:e,Ct.merge(this,Ct.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:lt,!0)),kt.test(i[1])&&Ct.isPlainObject(e))for(i in e)bt(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=lt.getElementById(i[2]))&&(this[0]=r,this.length=1),this}).prototype=Ct.fn,Et=Ct(lt);var Ot=/^(?:parents|prev(?:Until|All))/,Pt={children:!0,contents:!0,next:!0,prev:!0};Ct.fn.extend({has:function(t){var e=Ct(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(Ct.contains(this,e[t]))return!0})},closest:function(t,e){var n,i=0,r=this.length,o=[],a="string"!=typeof t&&Ct(t);if(!It.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&Ct.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(1<o.length?Ct.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?ft.call(Ct(t),this[0]):ft.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(Ct.uniqueSort(Ct.merge(this.get(),Ct(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),Ct.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Dt(t,"parentNode")},parentsUntil:function(t,e,n){return Dt(t,"parentNode",n)},next:function(t){return n(t,"nextSibling")},prev:function(t){return n(t,"previousSibling")},nextAll:function(t){return Dt(t,"nextSibling")},prevAll:function(t){return Dt(t,"previousSibling")},nextUntil:function(t,e,n){return Dt(t,"nextSibling",n)},prevUntil:function(t,e,n){return Dt(t,"previousSibling",n)},siblings:function(t){return Mt((t.parentNode||{}).firstChild,t)},children:function(t){return Mt(t.firstChild)},contents:function(t){return"undefined"!=typeof t.contentDocument?t.contentDocument:(u(t,"template")&&(t=t.content||t),Ct.merge([],t.childNodes))}},function(i,r){Ct.fn[i]=function(t,e){var n=Ct.map(this,r,t);return"Until"!==i.slice(-5)&&(e=t),e&&"string"==typeof e&&(n=Ct.filter(e,n)),1<this.length&&(Pt[i]||Ct.uniqueSort(n),Ot.test(i)&&n.reverse()),this.pushStack(n)}});var Nt=/[^\x20\t\r\n\f]+/g;Ct.Callbacks=function(i){i="string"==typeof i?c(i):Ct.extend({},i);var r,t,e,n,o=[],a=[],s=-1,l=function(){for(n=n||i.once,e=r=!0;a.length;s=-1)for(t=a.shift();++s<o.length;)!1===o[s].apply(t[0],t[1])&&i.stopOnFalse&&(s=o.length,t=!1);i.memory||(t=!1),r=!1,n&&(o=t?[]:"")},u={add:function(){return o&&(t&&!r&&(s=o.length-1,a.push(t)),function n(t){Ct.each(t,function(t,e){bt(e)?i.unique&&u.has(e)||o.push(e):e&&e.length&&"string"!==m(e)&&n(e)})}(arguments),t&&!r&&l()),this},remove:function(){return Ct.each(arguments,function(t,e){for(var n;-1<(n=Ct.inArray(e,o,n));)o.splice(n,1),n<=s&&s--}),this},has:function(t){return t?-1<Ct.inArray(t,o):0<o.length},empty:function(){return o&&(o=[]),this},disable:function(){return n=a=[],o=t="",this},disabled:function(){return!o},lock:function(){return n=a=[],t||r||(o=t=""),this},locked:function(){return!!n},fireWith:function(t,e){return n||(e=[t,(e=e||[]).slice?e.slice():e],a.push(e),r||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!e}};return u},Ct.extend({Deferred:function(t){var o=[["notify","progress",Ct.Callbacks("memory"),Ct.Callbacks("memory"),2],["resolve","done",Ct.Callbacks("once memory"),Ct.Callbacks("once memory"),0,"resolved"],["reject","fail",Ct.Callbacks("once memory"),Ct.Callbacks("once memory"),1,"rejected"]],r="pending",a={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(t){return a.then(null,t)},pipe:function(){var r=arguments;return Ct.Deferred(function(i){Ct.each(o,function(t,e){var n=bt(r[e[4]])&&r[e[4]];s[e[1]](function(){var t=n&&n.apply(this,arguments);t&&bt(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[e[0]+"With"](this,n?[t]:arguments)})}),r=null}).promise()},then:function(e,n,i){function u(o,a,s,l){return function(){var n=this,i=arguments,e=function(){var t,e;if(!(o<c)){if((t=s.apply(n,i))===a.promise())throw new TypeError("Thenable self-resolution");e=t&&("object"==typeof t||"function"==typeof t)&&t.then,bt(e)?l?e.call(t,u(c,a,h,l),u(c,a,d,l)):(c++,e.call(t,u(c,a,h,l),u(c,a,d,l),u(c,a,h,a.notifyWith))):(s!==h&&(n=undefined,i=[t]),(l||a.resolveWith)(n,i))}},r=l?e:function(){try{e()}catch(t){Ct.Deferred.exceptionHook&&Ct.Deferred.exceptionHook(t,r.stackTrace),c<=o+1&&(s!==d&&(n=undefined,i=[t]),a.rejectWith(n,i))}};o?r():(Ct.Deferred.getStackHook&&(r.stackTrace=Ct.Deferred.getStackHook()),C.setTimeout(r))}}var c=0;return Ct.Deferred(function(t){o[0][3].add(u(0,t,bt(i)?i:h,t.notifyWith)),o[1][3].add(u(0,t,bt(e)?e:h)),o[2][3].add(u(0,t,bt(n)?n:d))}).promise()},promise:function(t){return null!=t?Ct.extend(t,a):a}},s={};return Ct.each(o,function(t,e){var n=e[2],i=e[5];a[e[1]]=n.add,i&&n.add(function(){r=i},o[3-t][2].disable,o[3-t][3].disable,o[0][2].lock,o[0][3].lock),n.add(e[3].fire),s[e[0]]=function(){return s[e[0]+"With"](this===s?undefined:this,arguments),this},s[e[0]+"With"]=n.fireWith}),a.promise(s),t&&t.call(s,s),s},when:function(t){var n=arguments.length,e=n,i=Array(e),r=ct.call(arguments),o=Ct.Deferred(),a=function(e){return function(t){i[e]=this,r[e]=1<arguments.length?ct.call(arguments):t,--n||o.resolveWith(i,r)}};if(n<=1&&(l(t,o.done(a(e)).resolve,o.reject,!n),"pending"===o.state()||bt(r[e]&&r[e].then)))return o.then();for(;e--;)l(r[e],a(e),o.reject);return o.promise()}});var Rt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;Ct.Deferred.exceptionHook=function(t,e){C.console&&C.console.warn&&t&&Rt.test(t.name)&&C.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},Ct.readyException=function(t){C.setTimeout(function(){throw t})};var Ft=Ct.Deferred();Ct.fn.ready=function(t){return Ft.then(t)["catch"](function(t){Ct.readyException(t)}),this},Ct.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--Ct.readyWait:Ct.isReady)||(Ct.isReady=!0)!==t&&0<--Ct.readyWait||Ft.resolveWith(lt,[Ct])}}),Ct.ready.then=Ft.then,"complete"===lt.readyState||"loading"!==lt.readyState&&!lt.documentElement.doScroll?C.setTimeout(Ct.ready):(lt.addEventListener("DOMContentLoaded",i),C.addEventListener("load",i));var zt=function(t,e,n,i,r,o,a){var s=0,l=t.length,u=null==n;if("object"===m(n))for(s in r=!0,n)zt(t,e,s,n[s],!0,o,a);else if(i!==undefined&&(r=!0,bt(i)||(a=!0),u&&(a?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(Ct(t),n)})),e))for(;s<l;s++)e(t[s],n,a?i:i.call(t[s],s,e(t[s],n)));return r?t:u?e.call(t):l?e(t[0],n):o},Ht=/^-ms-/,Bt=/-([a-z])/g,Vt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};o.uid=1,o.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Vt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[f(e)]=n;else for(i in e)r[f(i)]=e[i];return r},get:function(t,e){return e===undefined?this.cache(t):t[this.expando]&&t[this.expando][f(e)]},access:function(t,e,n){return e===undefined||e&&"string"==typeof e&&n===undefined?this.get(t,e):(this.set(t,e,n),n!==undefined?n:e)},remove:function(t,e){var n,i=t[this.expando];if(i!==undefined){if(e!==undefined){n=(e=Array.isArray(e)?e.map(f):(e=f(e))in i?[e]:e.match(Nt)||[]).length;for(;n--;)delete i[e[n]]}(e===undefined||Ct.isEmptyObject(i))&&(t.nodeType?t[this.expando]=undefined:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return e!==undefined&&!Ct.isEmptyObject(e)}};var jt=new o,Wt=new o,Ut=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,$t=/[A-Z]/g;Ct.extend({hasData:function(t){return Wt.hasData(t)||jt.hasData(t)},data:function(t,e,n){return Wt.access(t,e,n)},removeData:function(t,e){Wt.remove(t,e)},_data:function(t,e,n){return jt.access(t,e,n)},_removeData:function(t,e){jt.remove(t,e)}}),Ct.fn.extend({data:function(n,t){var e,i,r,o=this[0],a=o&&o.attributes;if(n!==undefined)return"object"==typeof n?this.each(function(){Wt.set(this,n)}):zt(this,function(t){var e;if(o&&t===undefined)return(e=Wt.get(o,n))!==undefined?e:(e=p(o,n))!==undefined?e:void 0;this.each(function(){Wt.set(this,n,t)})},null,t,1<arguments.length,null,!0);if(this.length&&(r=Wt.get(o),1===o.nodeType&&!jt.get(o,"hasDataAttrs"))){for(e=a.length;e--;)a[e]&&0===(i=a[e].name).indexOf("data-")&&(i=f(i.slice(5)),p(o,i,r[i]));jt.set(o,"hasDataAttrs",!0)}return r},removeData:function(t){return this.each(function(){Wt.remove(this,t)})}}),Ct.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=jt.get(t,e),n&&(!i||Array.isArray(n)?i=jt.access(t,e,Ct.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=Ct.queue(t,e),i=n.length,r=n.shift(),o=Ct._queueHooks(t,e),a=function(){Ct.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,a,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return jt.get(t,n)||jt.access(t,n,{empty:Ct.Callbacks("once memory").add(function(){jt.remove(t,[e+"queue",n])})})}}),Ct.fn.extend({queue:function(e,n){var t=2;return"string"!=typeof e&&(n=e,e="fx",t--),arguments.length<t?Ct.queue(this[0],e):n===undefined?this:this.each(function(){var t=Ct.queue(this,e,n);Ct._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Ct.dequeue(this,e)})},dequeue:function(t){return this.each(function(){Ct.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=Ct.Deferred(),o=this,a=this.length,s=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=undefined),t=t||"fx";a--;)(n=jt.get(o[a],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(e)}});var qt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Gt=new RegExp("^(?:([+-])=|)("+qt+")([a-z%]*)$","i"),Yt=["Top","Right","Bottom","Left"],Zt=lt.documentElement,Xt=function(t){return Ct.contains(t.ownerDocument,t)},Kt={composed:!0};Zt.getRootNode&&(Xt=function(t){return Ct.contains(t.ownerDocument,t)||t.getRootNode(Kt)===t.ownerDocument});var Qt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&Xt(t)&&"none"===Ct.css(t,"display")},Jt=function(t,e,n,i){var r,o,a={};for(o in e)a[o]=t.style[o],t.style[o]=e[o];for(o in r=n.apply(t,i||[]),e)t.style[o]=a[o];return r},te={};Ct.fn.extend({show:function(){return x(this,!0)},hide:function(){return x(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Qt(this)?Ct(this).show():Ct(this).hide()})}});var ee=/^(?:checkbox|radio)$/i,ne=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ie=/^$|^module$|\/(?:java|ecma)script/i,re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};re.optgroup=re.option,re.tbody=re.tfoot=re.colgroup=re.caption=re.thead,re.th=re.td;var oe,ae,se=/<|&#?\w+;/;oe=lt.createDocumentFragment().appendChild(lt.createElement("div")),(ae=lt.createElement("input")).setAttribute("type","radio"),ae.setAttribute("checked","checked"),ae.setAttribute("name","t"),oe.appendChild(ae),xt.checkClone=oe.cloneNode(!0).cloneNode(!0).lastChild.checked,oe.innerHTML="<textarea>x</textarea>",xt.noCloneChecked=!!oe.cloneNode(!0).lastChild.defaultValue;var le=/^key/,ue=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ce=/^([^.]*)(?:\.(.+)|)/;Ct.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p,g,m=jt.get(e);if(m)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&Ct.find.matchesSelector(Zt,r),n.guid||(n.guid=Ct.guid++),(l=m.events)||(l=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==Ct&&Ct.event.triggered!==t.type?Ct.event.dispatch.apply(e,arguments):undefined}),u=(t=(t||"").match(Nt)||[""]).length;u--;)f=g=(s=ce.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f&&(h=Ct.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=Ct.event.special[f]||{},c=Ct.extend({type:f,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&Ct.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,a)||e.addEventListener&&e.addEventListener(f,a)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),Ct.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,a,s,l,u,c,h,d,f,p,g,m=jt.hasData(t)&&jt.get(t);if(m&&(l=m.events)){for(u=(e=(e||"").match(Nt)||[""]).length;u--;)if(f=g=(s=ce.exec(e[u])||[])[1],p=(s[2]||"").split(".").sort(),f){for(h=Ct.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,p,m.handle)||Ct.removeEvent(t,f,m.handle),delete l[f])}else for(f in l)Ct.event.remove(t,f+e[u],n,i,!0);Ct.isEmptyObject(l)&&jt.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,a,s=Ct.event.fix(t),l=new Array(arguments.length),u=(jt.get(this,"events")||{})[s.type]||[],c=Ct.event.special[s.type]||{};for(l[0]=s,e=1;e<arguments.length;e++)l[e]=arguments[e];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=Ct.event.handlers.call(this,s,u),e=0;(r=a[e++])&&!s.isPropagationStopped();)for(s.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,(i=((Ct.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,l))!==undefined&&!1===(s.result=i)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(t,e){var n,i,r,o,a,s=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&1<=t.button))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)a[r=(i=e[n]).selector+" "]===undefined&&(a[r]=i.needsContext?-1<Ct(r,this).index(u):Ct.find(r,this,null,[u]).length),a[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return u=this,l<e.length&&s.push({elem:u,handlers:e.slice(l)}),s},addProp:function(e,t){Object.defineProperty(Ct.Event.prototype,e,{enumerable:!0,configurable:!0,get:bt(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(t){return t[Ct.expando]?t:new Ct.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return ee.test(e.type)&&e.click&&u(e,"input")&&I(e,"click",S),!1},trigger:function(t){var e=this||t;return ee.test(e.type)&&e.click&&u(e,"input")&&I(e,"click"),!0},_default:function(t){var e=t.target;return ee.test(e.type)&&e.click&&u(e,"input")&&jt.get(e,"click")||u(e,"a")}},beforeunload:{postDispatch:function(t){t.result!==undefined&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},Ct.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},Ct.Event=function(t,e){if(!(this instanceof Ct.Event))return new Ct.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||t.defaultPrevented===undefined&&!1===t.returnValue?S:T,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&Ct.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[Ct.expando]=!0},Ct.Event.prototype={constructor:Ct.Event,isDefaultPrevented:T,isPropagationStopped:T,isImmediatePropagationStopped:T,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=S,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=S,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=S,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},Ct.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&le.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&e!==undefined&&ue.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},Ct.event.addProp),Ct.each({focus:"focusin",blur:"focusout"},function(t,e){Ct.event.special[t]={setup:function(){return I(this,t,A),!1},trigger:function(){return I(this,t),!0},delegateType:e}}),Ct.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,o){Ct.event.special[t]={delegateType:o,bindType:o,handle:function(t){var e,n=this,i=t.relatedTarget,r=t.handleObj;return i&&(i===n||Ct.contains(n,i))||(t.type=r.origType,e=r.handler.apply(this,arguments),t.type=o),e}}}),Ct.fn.extend({on:function(t,e,n,i){return M(this,t
|
|
,e,n,i)},one:function(t,e,n,i){return M(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,Ct(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"!=typeof t)return!1!==e&&"function"!=typeof e||(n=e,e=undefined),!1===n&&(n=T),this.each(function(){Ct.event.remove(this,t,n,e)});for(r in t)this.off(r,e,t[r]);return this}});var he=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,de=/<script|<style|<link/i,fe=/checked\s*(?:[^=]|=\s*.checked.)/i,pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;Ct.extend({htmlPrefilter:function(t){return t.replace(he,"<$1></$2>")},clone:function(t,e,n){var i,r,o,a,s=t.cloneNode(!0),l=Xt(t);if(!(xt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||Ct.isXMLDoc(t)))for(a=b(s),i=0,r=(o=b(t)).length;i<r;i++)P(o[i],a[i]);if(e)if(n)for(o=o||b(t),a=a||b(s),i=0,r=o.length;i<r;i++)O(o[i],a[i]);else O(t,s);return 0<(a=b(s,"script")).length&&w(a,!l&&b(t,"script")),s},cleanData:function(t){for(var e,n,i,r=Ct.event.special,o=0;(n=t[o])!==undefined;o++)if(Vt(n)){if(e=n[jt.expando]){if(e.events)for(i in e.events)r[i]?Ct.event.remove(n,i):Ct.removeEvent(n,i,e.handle);n[jt.expando]=undefined}n[Wt.expando]&&(n[Wt.expando]=undefined)}}}),Ct.fn.extend({detach:function(t){return R(this,t,!0)},remove:function(t){return R(this,t)},text:function(t){return zt(this,function(t){return t===undefined?Ct.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return N(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||k(this,t).appendChild(t)})},prepend:function(){return N(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=k(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return N(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return N(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(Ct.cleanData(b(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return Ct.clone(this,t,e)})},html:function(t){return zt(this,function(t){var e=this[0]||{},n=0,i=this.length;if(t===undefined&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!de.test(t)&&!re[(ne.exec(t)||["",""])[1].toLowerCase()]){t=Ct.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(Ct.cleanData(b(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var n=[];return N(this,arguments,function(t){var e=this.parentNode;Ct.inArray(this,n)<0&&(Ct.cleanData(b(this)),e&&e.replaceChild(t,this))},n)}}),Ct.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,a){Ct.fn[t]=function(t){for(var e,n=[],i=Ct(t),r=i.length-1,o=0;o<=r;o++)e=o===r?this:this.clone(!0),Ct(i[o])[a](e),dt.apply(n,e.get());return this.pushStack(n)}});var ge=new RegExp("^("+qt+")(?!px)[a-z%]+$","i"),me=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=C),e.getComputedStyle(t)},ve=new RegExp(Yt.join("|"),"i");!function(){function t(){if(l){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",Zt.appendChild(s).appendChild(l);var t=C.getComputedStyle(l);n="1%"!==t.top,a=12===e(t.marginLeft),l.style.right="60%",o=36===e(t.right),i=36===e(t.width),l.style.position="absolute",r=12===e(l.offsetWidth/3),Zt.removeChild(s),l=null}}function e(t){return Math.round(parseFloat(t))}var n,i,r,o,a,s=lt.createElement("div"),l=lt.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",xt.clearCloneStyle="content-box"===l.style.backgroundClip,Ct.extend(xt,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),a},scrollboxSize:function(){return t(),r}}))}();var ye=["Webkit","Moz","ms"],xe=lt.createElement("div").style,be={},we=/^(none|table(?!-c[ea]).+)/,_e=/^--/,Se={position:"absolute",visibility:"hidden",display:"block"},Ce={letterSpacing:"0",fontWeight:"400"};Ct.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=F(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=f(e),l=_e.test(e),u=t.style;if(l||(e=B(s)),a=Ct.cssHooks[e]||Ct.cssHooks[s],n===undefined)return a&&"get"in a&&(r=a.get(t,!1,i))!==undefined?r:u[e];"string"===(o=typeof n)&&(r=Gt.exec(n))&&r[1]&&(n=v(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(Ct.cssNumber[s]?"":"px")),xt.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&(n=a.set(t,n,i))===undefined||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,i){var r,o,a,s=f(e);return _e.test(e)||(e=B(s)),(a=Ct.cssHooks[e]||Ct.cssHooks[s])&&"get"in a&&(r=a.get(t,!0,n)),r===undefined&&(r=F(t,e,i)),"normal"===r&&e in Ce&&(r=Ce[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),Ct.each(["height","width"],function(t,l){Ct.cssHooks[l]={get:function(t,e,n){if(e)return!we.test(Ct.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?W(t,l,n):Jt(t,Se,function(){return W(t,l,n)})},set:function(t,e,n){var i,r=me(t),o=!xt.scrollboxSize()&&"absolute"===r.position,a=(o||n)&&"border-box"===Ct.css(t,"boxSizing",!1,r),s=n?j(t,l,n,a,r):0;return a&&o&&(s-=Math.ceil(t["offset"+l[0].toUpperCase()+l.slice(1)]-parseFloat(r[l])-j(t,l,"border",!1,r)-.5)),s&&(i=Gt.exec(e))&&"px"!==(i[3]||"px")&&(t.style[l]=e,e=Ct.css(t,l)),V(t,e,s)}}}),Ct.cssHooks.marginLeft=z(xt.reliableMarginLeft,function(t,e){if(e)return(parseFloat(F(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),Ct.each({margin:"",padding:"",border:"Width"},function(r,o){Ct.cssHooks[r+o]={expand:function(t){for(var e=0,n={},i="string"==typeof t?t.split(" "):[t];e<4;e++)n[r+Yt[e]+o]=i[e]||i[e-2]||i[0];return n}},"margin"!==r&&(Ct.cssHooks[r+o].set=V)}),Ct.fn.extend({css:function(t,e){return zt(this,function(t,e,n){var i,r,o={},a=0;if(Array.isArray(e)){for(i=me(t),r=e.length;a<r;a++)o[e[a]]=Ct.css(t,e[a],!1,i);return o}return n!==undefined?Ct.style(t,e,n):Ct.css(t,e)},t,e,1<arguments.length)}}),(Ct.Tween=U).prototype={constructor:U,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||Ct.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(Ct.cssNumber[n]?"":"px")},cur:function(){var t=U.propHooks[this.prop];return t&&t.get?t.get(this):U.propHooks._default.get(this)},run:function(t){var e,n=U.propHooks[this.prop];return this.options.duration?this.pos=e=Ct.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):U.propHooks._default.set(this),this}},U.prototype.init.prototype=U.prototype,U.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=Ct.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){Ct.fx.step[t.prop]?Ct.fx.step[t.prop](t):1!==t.elem.nodeType||!Ct.cssHooks[t.prop]&&null==t.elem.style[B(t.prop)]?t.elem[t.prop]=t.now:Ct.style(t.elem,t.prop,t.now+t.unit)}}},U.propHooks.scrollTop=U.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},Ct.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},Ct.fx=U.prototype.init,Ct.fx.step={};var Te,Ae,De,Me,Ie=/^(?:toggle|show|hide)$/,ke=/queueHooks$/;Ct.Animation=Ct.extend(K,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return v(n.elem,t,Gt.exec(e),n),n}]},tweener:function(t,e){bt(t)?(e=t,t=["*"]):t=t.match(Nt);for(var n,i=0,r=t.length;i<r;i++)n=t[i],K.tweeners[n]=K.tweeners[n]||[],K.tweeners[n].unshift(e)},prefilters:[Z],prefilter:function(t,e){e?K.prefilters.unshift(t):K.prefilters.push(t)}}),Ct.speed=function(t,e,n){var i=t&&"object"==typeof t?Ct.extend({},t):{complete:n||!n&&e||bt(t)&&t,duration:t,easing:n&&e||e&&!bt(e)&&e};return Ct.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in Ct.fx.speeds?i.duration=Ct.fx.speeds[i.duration]:i.duration=Ct.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){bt(i.old)&&i.old.call(this),i.queue&&Ct.dequeue(this,i.queue)},i},Ct.fn.extend({fadeTo:function(t,e,n,i){return this.filter(Qt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(e,t,n,i){var r=Ct.isEmptyObject(e),o=Ct.speed(t,n,i),a=function(){var t=K(this,Ct.extend({},e),o);(r||jt.get(this,"finish"))&&t.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(r,t,o){var a=function(t){var e=t.stop;delete t.stop,e(o)};return"string"!=typeof r&&(o=t,t=r,r=undefined),t&&!1!==r&&this.queue(r||"fx",[]),this.each(function(){var t=!0,e=null!=r&&r+"queueHooks",n=Ct.timers,i=jt.get(this);if(e)i[e]&&i[e].stop&&a(i[e]);else for(e in i)i[e]&&i[e].stop&&ke.test(e)&&a(i[e]);for(e=n.length;e--;)n[e].elem!==this||null!=r&&n[e].queue!==r||(n[e].anim.stop(o),t=!1,n.splice(e,1));!t&&o||Ct.dequeue(this,r)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var t,e=jt.get(this),n=e[a+"queue"],i=e[a+"queueHooks"],r=Ct.timers,o=n?n.length:0;for(e.finish=!0,Ct.queue(this,a,[]),i&&i.stop&&i.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===a&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<o;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete e.finish})}}),Ct.each(["toggle","show","hide"],function(t,i){var r=Ct.fn[i];Ct.fn[i]=function(t,e,n){return null==t||"boolean"==typeof t?r.apply(this,arguments):this.animate(G(i,!0),t,e,n)}}),Ct.each({slideDown:G("show"),slideUp:G("hide"),slideToggle:G("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,i){Ct.fn[t]=function(t,e,n){return this.animate(i,t,e,n)}}),Ct.timers=[],Ct.fx.tick=function(){var t,e=0,n=Ct.timers;for(Te=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||Ct.fx.stop(),Te=undefined},Ct.fx.timer=function(t){Ct.timers.push(t),Ct.fx.start()},Ct.fx.interval=13,Ct.fx.start=function(){Ae||(Ae=!0,$())},Ct.fx.stop=function(){Ae=null},Ct.fx.speeds={slow:600,fast:200,_default:400},Ct.fn.delay=function(i,t){return i=Ct.fx&&Ct.fx.speeds[i]||i,t=t||"fx",this.queue(t,function(t,e){var n=C.setTimeout(t,i);e.stop=function(){C.clearTimeout(n)}})},De=lt.createElement("input"),Me=lt.createElement("select").appendChild(lt.createElement("option")),De.type="checkbox",xt.checkOn=""!==De.value,xt.optSelected=Me.selected,(De=lt.createElement("input")).value="t",De.type="radio",xt.radioValue="t"===De.value;var Ee,Le=Ct.expr.attrHandle;Ct.fn.extend({attr:function(t,e){return zt(this,Ct.attr,t,e,1<arguments.length)},removeAttr:function(t){return this.each(function(){Ct.removeAttr(this,t)})}}),Ct.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?Ct.prop(t,e,n):(1===o&&Ct.isXMLDoc(t)||(r=Ct.attrHooks[e.toLowerCase()]||(Ct.expr.match.bool.test(e)?Ee:undefined)),n!==undefined?null===n?void Ct.removeAttr(t,e):r&&"set"in r&&(i=r.set(t,n,e))!==undefined?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=Ct.find.attr(t,e))?undefined:i)},attrHooks:{type:{set:function(t,e){if(!xt.radioValue&&"radio"===e&&u(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(Nt);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),Ee={set:function(t,e,n){return!1===e?Ct.removeAttr(t,n):t.setAttribute(n,n),n}},Ct.each(Ct.expr.match.bool.source.match(/\w+/g),function(t,e){var a=Le[e]||Ct.find.attr;Le[e]=function(t,e,n){var i,r,o=e.toLowerCase();return n||(r=Le[o],Le[o]=i,i=null!=a(t,e,n)?o:null,Le[o]=r),i}});var Oe=/^(?:input|select|textarea|button)$/i,Pe=/^(?:a|area)$/i;Ct.fn.extend({prop:function(t,e){return zt(this,Ct.prop,t,e,1<arguments.length)},removeProp:function(t){return this.each(function(){delete this[Ct.propFix[t]||t]})}}),Ct.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&Ct.isXMLDoc(t)||(e=Ct.propFix[e]||e,r=Ct.propHooks[e]),n!==undefined?r&&"set"in r&&(i=r.set(t,n,e))!==undefined?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=Ct.find.attr(t,"tabindex");return e?parseInt(e,10):Oe.test(t.nodeName)||Pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),xt.optSelected||(Ct.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),Ct.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Ct.propFix[this.toLowerCase()]=this}),Ct.fn.extend({addClass:function(e){var t,n,i,r,o,a,s,l=0;if(bt(e))return this.each(function(t){Ct(this).addClass(e.call(this,t,J(this)))});if((t=tt(e)).length)for(;n=this[l++];)if(r=J(n),i=1===n.nodeType&&" "+Q(r)+" "){for(a=0;o=t[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=Q(i))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,i,r,o,a,s,l=0;if(bt(e))return this.each(function(t){Ct(this).removeClass(e.call(this,t,J(this)))});if(!arguments.length)return this.attr("class","");if((t=tt(e)).length)for(;n=this[l++];)if(r=J(n),i=1===n.nodeType&&" "+Q(r)+" "){for(a=0;o=t[a++];)for(;-1<i.indexOf(" "+o+" ");)i=i.replace(" "+o+" "," ");r!==(s=Q(i))&&n.setAttribute("class",s)}return this},toggleClass:function(r,e){var o=typeof r,a="string"===o||Array.isArray(r);return"boolean"==typeof e&&a?e?this.addClass(r):this.removeClass(r):bt(r)?this.each(function(t){Ct(this).toggleClass(r.call(this,t,J(this),e),e)}):this.each(function(){var t,e,n,i;if(a)for(e=0,n=Ct(this),i=tt(r);t=i[e++];)n.hasClass(t)?n.removeClass(t):n.addClass(t);else r!==undefined&&"boolean"!==o||((t=J(this))&&jt.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===r?"":jt.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&-1<(" "+Q(J(n))+" ").indexOf(e))return!0;return!1}});var Ne=/\r/g;Ct.fn.extend({val:function(n){var i,t,r,e=this[0];return arguments.length?(r=bt(n),this.each(function(t){var e;1===this.nodeType&&(null==(e=r?n.call(this,t,Ct(this).val()):n)?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=Ct.map(e,function(t){return null==t?"":t+""})),(i=Ct.valHooks[this.type]||Ct.valHooks[this.nodeName.toLowerCase()])&&"set"in i&&i.set(this,e,"value")!==undefined||(this.value=e))})):e?(i=Ct.valHooks[e.type]||Ct.valHooks[e.nodeName.toLowerCase()])&&"get"in i&&(t=i.get(e,"value"))!==undefined?t:"string"==typeof(t=e.value)?t.replace(Ne,""):null==t?"":t:void 0}}),Ct.extend({valHooks:{option:{get:function(t){var e=Ct.find.attr(t,"value");return null!=e?e:Q(Ct.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:r.length;for(i=o<0?l:a?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!u(n.parentNode,"optgroup"))){if(e=Ct(n).val(),a)return e;s.push(e)}return s},set:function(t,e){for(var n,i,r=t.options,o=Ct.makeArray(e),a=r.length;a--;)((i=r[a]).selected=-1<Ct.inArray(Ct.valHooks.option.get(i),o))&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),Ct.each(["radio","checkbox"],function(){Ct.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=-1<Ct.inArray(Ct(t).val(),e)}},xt.checkOn||(Ct.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),xt.focusin="onfocusin"in C;var Re=/^(?:focusinfocus|focusoutblur)$/,Fe=function(t){t.stopPropagation()};Ct.extend(Ct.event,{trigger:function(t,e,n,i){var r,o,a,s,l,u,c,h,d=[n||lt],f=mt.call(t,"type")?t.type:t,p=mt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=a=n=n||lt,3!==n.nodeType&&8!==n.nodeType&&!Re.test(f+Ct.event.triggered)&&(-1<f.indexOf(".")&&(f=(p=f.split(".")).shift(),p.sort()),l=f.indexOf(":")<0&&"on"+f,(t=t[Ct.expando]?t:new Ct.Event(f,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=p.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=n),e=null==e?[t]:Ct.makeArray(e,[t]),c=Ct.event.special[f]||{},i||!c.trigger||!1!==c.trigger.apply(n,e))){if(!i&&!c.noBubble&&!wt(n)){for(s=c.delegateType||f,Re.test(s+f)||(o=o.parentNode);o;o=o.parentNode)d.push(o),a=o;a===(n.ownerDocument||lt)&&d.push(a.defaultView||a.parentWindow||C)}for(r=0;(o=d[r++])&&!t.isPropagationStopped();)h=o,t.type=1<r?s:c.bindType||f,(u=(jt.get(o,"events")||{})[t.type]&&jt.get(o,"handle"))&&u.apply(o,e),(u=l&&o[l])&&u.apply&&Vt(o)&&(t.result=u.apply(o,e),!1===t.result&&t.preventDefault());return t.type=f,i||t.isDefaultPrevented()||c._default&&!1!==c._default.apply(d.pop(),e)||!Vt(n)||l&&bt(n[f])&&!wt(n)&&((a=n[l])&&(n[l]=null),Ct.event.triggered=f,t.isPropagationStopped()&&h.addEventListener(f,Fe),n[f](),t.isPropagationStopped()&&h.removeEventListener(f,Fe),Ct.event.triggered=undefined,a&&(n[l]=a)),t.result}},simulate:function(t,e,n){var i=Ct.extend(new Ct.Event,n,{type:t,isSimulated:!0});Ct.event.trigger(i,null,e)}}),Ct.fn.extend({trigger:function(t,e){return this.each(function(){Ct.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return Ct.event.trigger(t,e,n,!0)}}),xt.focusin||Ct.each({focus:"focusin",blur:"focusout"},function(n,i){var r=function(t){Ct.event.simulate(i,t.target,Ct.event.fix(t))};Ct.event.special[i]={setup:function(){var t=this.ownerDocument||this,e=jt.access(t,i);e||t.addEventListener(n,r,!0),jt.access(t,i,(e||0)+1)},teardown:function(){var t=this.ownerDocument||this,e=jt.access(t,i)-1;e?jt.access(t,i,e):(t.removeEventListener(n,r,!0),jt.remove(t,i))}}});var ze=C.location,He=Date.now(),Be=/\?/;Ct.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new C.DOMParser).parseFromString(t,"text/xml")}catch(n){e=undefined}return e&&!e.getElementsByTagName("parsererror").length||Ct.error("Invalid XML: "+t),e};var Ve=/\[\]$/,je=/\r?\n/g,We=/^(?:submit|button|image|reset|file)$/i,Ue=/^(?:input|select|textarea|keygen)/i;Ct.param=function(t,e){var n,i=[],r=function(t,e){var n=bt(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!Ct.isPlainObject(t))Ct.each(t,function(){r(this.name,this.value)});else for(n in t)et(n,t[n],e,r);return i.join("&")},Ct.fn.extend({serialize:function(){return Ct.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=Ct.prop(this,"elements");return t?Ct.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!Ct(this).is(":disabled")&&Ue.test(this.nodeName)&&!We.test(t)&&(this.checked||!ee.test(t))}).map(function(t,e){var n=Ct(this).val();return null==n?null:Array.isArray(n)?Ct.map(n,function(t){return{name:e.name,value:t.replace(je,"\r\n")}}):{name:e.name,value:n.replace(je,"\r\n")}}).get()}});var $e=/%20/g,qe=/#.*$/,Ge=/([?&])_=[^&]*/,Ye=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ze=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Xe=/^(?:GET|HEAD)$/,Ke=/^\/\//,Qe={},Je={},tn="*/".concat("*"),en=lt.createElement("a");en.href=ze.href,Ct.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ze.href,type:"GET",isLocal:Ze.test(ze.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":Ct.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?rt(rt(t,Ct.ajaxSettings),e):rt(Ct.ajaxSettings,t)},ajaxPrefilter:nt(Qe),ajaxTransport:nt(Je),ajax:function(t,e){function n(t,e,n,i){var r,o,a,s,l,u=e;p||(p=!0,f&&C.clearTimeout(f),c=undefined,d=i||"",_.readyState=0<t?4:0,r=200<=t&&t<300||304===t,n&&(s=ot(m,_,n)),s=at(m,s,_,r),r?(m.ifModified&&((l=_.getResponseHeader("Last-Modified"))&&(Ct.lastModified[h]=l),(l=_.getResponseHeader("etag"))&&(Ct.etag[h]=l)),204===t||"HEAD"===m.type?u="nocontent":304===t?u="notmodified":(u=s.state,o=s.data,r=!(a=s.error))):(a=u,!t&&u||(u="error",t<0&&(t=0))),_.status=t,_.statusText=(e||u)+"",r?x.resolveWith(v,[o,u,_]):x.rejectWith(v,[_,u,a]),_.statusCode(w),w=undefined,g&&y.trigger(r?"ajaxSuccess":"ajaxError",[_,m,r?o:a]),b.fireWith(v,[_,u]),g&&(y.trigger("ajaxComplete",[_,m]),--Ct.active||Ct.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=undefined),e=e||{};var c,h,d,i,f,r,p,g,o,a,m=Ct.ajaxSetup({},e),v=m.context||m,y=m.context&&(v.nodeType||v.jquery)?Ct(v):Ct.event,x=Ct.Deferred(),b=Ct.Callbacks("once memory"),w=m.statusCode||{},s={},l={},u="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(p){if(!i)for(i={};e=Ye.exec(d);)i[e[1].toLowerCase()+" "]=(i[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=i[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return p?d:null},setRequestHeader:function(t,e){return null==p&&(t=l[t.toLowerCase()]=l[t.toLowerCase()]||t,s[t]=e),this},overrideMimeType:function(t){return null==p&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(p)_.always(t[_.status]);else for(e in t)w[e]=[w[e],t[e]];return this},abort:function(t){var e=t||u;return c&&c.abort(e),n(0,e),this}};if(x.promise(_),m.url=((t||m.url||ze.href)+"").replace(Ke,ze.protocol+"//"),m.type=e.method||e.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(Nt)||[""],null==m.crossDomain){r=lt.createElement("a");try{r.href=m.url,r.href=r.href,m.crossDomain=en.protocol+"//"+en.host!=r.protocol+"//"+r.host}catch(S){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=Ct.param(m.data,m.traditional)),it(Qe,m,e,_),p)return _;for(o in(g=Ct.event&&m.global)&&0==Ct.active++&&Ct.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Xe.test(m.type),h=m.url.replace(qe,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace($e,"+")):(a=m.url.slice(h.length),m.data&&(m.processData||"string"==typeof m.data)&&(h+=(Be.test(h)?"&":"?")+m.data,delete m.data),!1===m.cache&&(h=h.replace(Ge,"$1"),a=(Be.test(h)?"&":"?")+"_="+He+++a),m.url=h+a),m.ifModified&&(Ct.lastModified[h]&&_.setRequestHeader("If-Modified-Since",Ct.lastModified[h]),Ct.etag[h]&&_.setRequestHeader("If-None-Match",Ct.etag[h])),(m.data&&m.hasContent&&!1!==m.contentType||e.contentType)&&_.setRequestHeader("Content-Type",m.contentType),_.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tn+"; q=0.01":""):m.accepts["*"]),m.headers)_.setRequestHeader(o,m.headers[o]);if(m.beforeSend&&(!1===m.beforeSend.call(v,_,m)||p))return _.abort();if(u="abort",b.add(m.complete),_.done(m.success),_.fail(m.error),c=it(Je,m,e,_)){if(_.readyState=1,g&&y.trigger("ajaxSend",[_,m]),p)return _;m.async&&0<m.timeout&&(f=C.setTimeout(function(){_.abort("timeout")},m.timeout));try{p=!1,c.send(s,n)}catch(S){if(p)throw S;n(-1,S)}}else n(-1,"No Transport");return _},getJSON:function(t,e,n){return Ct.get(t,e,n,"json")},getScript:function(t,e){return Ct.get(t,undefined,e,"script")}}),Ct.each(["get","post"],function(t,r){Ct[r]=function(t,e,n,i){return bt(e)&&(i=i||n,n=e,e=undefined),Ct.ajax(Ct.extend({url:t,type:r,dataType:i,data:e,success:n},Ct.isPlainObject(t)&&t))}}),Ct._evalUrl=function(t,e){return Ct.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){Ct.globalEval(t,e)}})},Ct.fn.extend({wrapAll:function(t){var e;return this[0]&&(bt(t)&&(t=t.call(this[0])),e=Ct(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(n){return bt(n)?this.each(function(t){Ct(this).wrapInner(n.call(this,t))}):this.each(function(){var t=Ct(this),e=t.contents();e.length?e.wrapAll(n):t.append(n)})},wrap:function(e){var n=bt(e);return this.each(function(t){Ct(this).wrapAll(n?e.call(this,t):e)})},unwrap:function(t){return this.parent(t).not("body").each(function(){Ct(this).replaceWith(this.childNodes)}),this}}),Ct.expr.pseudos.hidden=function(t){return!Ct.expr.pseudos.visible(t)},Ct.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},Ct.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(t){}};var nn={0:200,1223:204},rn=Ct.ajaxSettings.xhr();xt.cors=!!rn&&"withCredentials"in rn,xt.ajax=rn=!!rn,Ct.ajaxTransport(function(o){var a,s;if(xt.cors||rn&&!o.crossDomain)return{send:function(t,e){var n,i=o.xhr();if(i.open(o.type,o.url,o.async,o.username,o.password),o.xhrFields)for(n in o.xhrFields)i[n]=o.xhrFields[n];for(n in o.mimeType&&i.overrideMimeType&&i.overrideMimeType(o.mimeType),o.crossDomain||t["X-Requested-With"]||(t["X-Requested-With"]="XMLHttpRequest"),t)i.setRequestHeader(n,t[n]);a=function(t){return function(){a&&(a=s=i.onload=i.onerror=i.onabort=i.ontimeout=i.onreadystatechange=null,"abort"===t?i.abort():"error"===t?"number"!=typeof i.status?e(0,"error"):e(i.status,i.statusText):e(nn[i.status]||i.status,i.statusText,"text"!==(i.responseType||"text")||"string"!=typeof i.responseText?{binary:i.response}:{text:i.responseText},i.getAllResponseHeaders()))}},i.onload=a(),s=i.onerror=i.ontimeout=a("error"),i.onabort!==undefined?i.onabort=s:i.onreadystatechange=function(){4===i.readyState&&C.setTimeout(function(){a&&s()})},a=a("abort");try{i.send(o.hasContent&&o.data||null)}catch(r){if(a)throw r}},abort:function(){a&&a()}}}),Ct.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),Ct.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return Ct.globalEval(t),t}}}),Ct.ajaxPrefilter("script",function(t){t.cache===undefined&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Ct.ajaxTransport("script",function(n){var i,r;if(n.crossDomain||n.scriptAttrs)return{send:function(t,e){i=Ct("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",r=function(t){i.remove(),r=null,t&&e("error"===t.type?404:200,t.type)}),lt.head.appendChild(i[0])},abort:function(){r&&r()}}});var on,an=[],sn=/(=)\?(?=&|$)|\?\?/;Ct.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=an.pop()||Ct.expando+"_"+He++;return this[t]=!0,t}}),Ct.ajaxPrefilter("json jsonp",function(t,e,n){var i,r,o,a=!1!==t.jsonp&&(sn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&sn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=bt(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(sn,"$1"+i):!1!==t.jsonp&&(t.url+=(Be.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||Ct.error(i+" was not called"),o[0]},t.dataTypes[0]="json",r=C[i],C[i]=function(){o=arguments},n.always(function(){r===undefined?Ct(C).removeProp(i):C[i]=r,t[i]&&(t.jsonpCallback=e.jsonpCallback,an.push(i)),o&&bt(r)&&r(o[0]),o=r=undefined}),"script"}),xt.createHTMLDocument=((on=lt.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===on.childNodes.length),Ct.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(xt.createHTMLDocument?((i=(e=lt.implementation.createHTMLDocument("")).createElement("base")).href=lt.location.href,e.head.appendChild(i)):e=lt),o=!n&&[],(r=kt.exec(t))?[e.createElement(r[1])]:(r=_([t],e,o),o&&o.length&&Ct(o).remove(),Ct.merge([],r.childNodes)));var i,r,o},Ct.fn.load=function(t,e,n){var i,r,o,a=this,s=t.indexOf(" ");return-1<s&&(i=Q(t.slice(s)),t=t.slice(0,s)),bt(e)?(n=e,e=undefined):e&&"object"==typeof e&&(r="POST"),0<a.length&&Ct.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){o=arguments,a.html(i?Ct("<div>").append(Ct.parseHTML(t)).find(i):t)}).always(n&&function(t,e){a.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},Ct.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){Ct.fn[e]=function(t){return this.on(e,t)}}),Ct.expr.pseudos.animated=function(e){return Ct.grep(Ct.timers,function(t){return e===t.elem}).length},Ct.offset={setOffset:function(t,e,n){var i,r,o,a,s,l,u=Ct.css(t,"position"),c=Ct(t),h={};"static"===u&&(t.style.position="relative"),s=c.offset(),o=Ct.css(t,"top"),l=Ct.css(t,"left"),("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(i=c.position()).top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),bt(e)&&(e=e.call(t,n,Ct.extend({},s))),null!=e.top&&(h.top=e.top-s.top+a),null!=e.left&&(h.left=e.left-s.left+r),"using"in e?e.using.call(t,h):c.css(h)}},Ct.fn.extend({offset:function(e){if(arguments.length)return e===undefined?this:this.each(function(t){Ct.offset.setOffset(this,e,t)});var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===Ct.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===Ct.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=Ct(t).offset()).top+=Ct.css(t,"borderTopWidth",!0),r.left+=Ct.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-Ct.css(i,"marginTop",!0),left:e.left-r.left-Ct.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===Ct.css(t,"position");)t=t.offsetParent;return t||Zt})}}),Ct.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,r){var o="pageYOffset"===r;Ct.fn[e]=function(t){return zt(this,function(t,e,n){var i;if(wt(t)?i=t:9===t.nodeType&&(i=t.defaultView),n===undefined)return i?i[r]:t[e];i?i.scrollTo(o?i.pageXOffset:n,o?n:i.pageYOffset):t[e]=n},e,t,arguments.length)}}),Ct.each(["top","left"],function(t,n){Ct.cssHooks[n]=z(xt.pixelPosition,function(t,e){if(e)return e=F(t,n),ge.test(e)?Ct(t).position()[n]+"px":e})}),Ct.each({Height:"height",Width:"width"},function(a,s){Ct.each({padding:"inner"+a,content:s,"":"outer"+a},function(i,o){Ct.fn[o]=function(t,e){var n=arguments.length&&(i||"boolean"!=typeof t),r=i||(!0===t||!0===e?"margin":"border");return zt(this,function(t,e,n){var i;return wt(t)?0===o.indexOf("outer")?t["inner"+a]:t.document.documentElement["client"+a]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+a],i["scroll"+a],t.body["offset"+a],i["offset"+a],i["client"+a])):n===undefined?Ct.css(t,e,r):Ct.style(t,e,n,r)},s,n?t:undefined,n)}})}),Ct.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,n){Ct.fn[n]=function(t,e){return 0<arguments.length?this.on(n,null,t,e):this.trigger(n)}}),Ct.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),Ct.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e
|
|
,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),Ct.proxy=function(t,e){var n,i,r;return"string"==typeof e&&(n=t[e],e=t,t=n),bt(t)?(i=ct.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(ct.call(arguments)))}).guid=t.guid=t.guid||Ct.guid++,r):undefined},Ct.holdReady=function(t){t?Ct.readyWait++:Ct.ready(!0)},Ct.isArray=Array.isArray,Ct.parseJSON=JSON.parse,Ct.nodeName=u,Ct.isFunction=bt,Ct.isWindow=wt,Ct.camelCase=f,Ct.type=m,Ct.now=Date.now,Ct.isNumeric=function(t){var e=Ct.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return Ct});var ln=C.jQuery,un=C.$;return Ct.noConflict=function(t){return C.$===Ct&&(C.$=un),t&&C.jQuery===Ct&&(C.jQuery=ln),Ct},t||(C.jQuery=C.$=Ct),Ct}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Popper=e()}(this,function(){"use strict";function s(t){return t&&"[object Function]"==={}.toString.call(t)}function b(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function p(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function g(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=b(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/(auto|scroll|overlay)/.test(n+r+i)?t:g(p(t))}function m(t){return t&&t.referenceNode?t.referenceNode:t}function v(t){return 11===t?rt:10===t?ot:rt||ot}function x(t){if(!t)return document.documentElement;for(var e=v(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===b(n,"position")?x(n):n:t?t.ownerDocument.documentElement:document.documentElement}function l(t){var e=t.nodeName;return"BODY"!==e&&("HTML"===e||x(t.firstElementChild)===t)}function u(t){return null===t.parentNode?t:u(t.parentNode)}function y(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,r=n?e:t,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var a=o.commonAncestorContainer;if(t!==a&&e!==a||i.contains(r))return l(a)?a:x(a);var s=u(t);return s.host?y(s.host,e):y(t,u(e).host)}function h(t,e){var n="top"===(1<arguments.length&&void 0!==e?arguments[1]:"top")?"scrollTop":"scrollLeft",i=t.nodeName;if("BODY"!==i&&"HTML"!==i)return t[n];var r=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||r)[n]}function w(t,e,n){var i=2<arguments.length&&void 0!==n&&arguments[2],r=h(e,"top"),o=h(e,"left"),a=i?-1:1;return t.top+=r*a,t.bottom+=r*a,t.left+=o*a,t.right+=o*a,t}function d(t,e){var n="x"===e?"Left":"Top",i="Left"==n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}function r(t,e,n,i){return tt(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],v(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function _(t){var e=t.body,n=t.documentElement,i=v(10)&&getComputedStyle(n);return{height:r("Height",e,n,i),width:r("Width",e,n,i)}}function S(t){return ut({},t,{right:t.left+t.width,bottom:t.top+t.height})}function C(t){var e={};try{if(v(10)){e=t.getBoundingClientRect();var n=h(t,"top"),i=h(t,"left");e.top+=n,e.left+=i,e.bottom+=n,e.right+=i}else e=t.getBoundingClientRect()}catch(b){}var r={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},o="HTML"===t.nodeName?_(t.ownerDocument):{},a=o.width||t.clientWidth||r.width,s=o.height||t.clientHeight||r.height,l=t.offsetWidth-a,u=t.offsetHeight-s;if(l||u){var c=b(t);l-=d(c,"x"),u-=d(c,"y"),r.width-=l,r.height-=u}return S(r)}function T(t,e,n){var i=2<arguments.length&&void 0!==n&&arguments[2],r=v(10),o="HTML"===e.nodeName,a=C(t),s=C(e),l=g(t),u=b(e),c=parseFloat(u.borderTopWidth,10),h=parseFloat(u.borderLeftWidth,10);i&&o&&(s.top=tt(s.top,0),s.left=tt(s.left,0));var d=S({top:a.top-s.top-c,left:a.left-s.left-h,width:a.width,height:a.height});if(d.marginTop=0,d.marginLeft=0,!r&&o){var f=parseFloat(u.marginTop,10),p=parseFloat(u.marginLeft,10);d.top-=c-f,d.bottom-=c-f,d.left-=h-p,d.right-=h-p,d.marginTop=f,d.marginLeft=p}return(r&&!i?e.contains(l):e===l&&"BODY"!==l.nodeName)&&(d=w(d,e)),d}function A(t,e){var n=1<arguments.length&&void 0!==e&&arguments[1],i=t.ownerDocument.documentElement,r=T(t,i),o=tt(i.clientWidth,window.innerWidth||0),a=tt(i.clientHeight,window.innerHeight||0),s=n?0:h(i),l=n?0:h(i,"left");return S({top:s-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:o,height:a})}function D(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===b(t,"position"))return!0;var n=p(t);return!!n&&D(n)}function M(t){if(!t||!t.parentElement||v())return document.documentElement;for(var e=t.parentElement;e&&"none"===b(e,"transform");)e=e.parentElement;return e||document.documentElement}function f(t,e,n,i,r){var o=4<arguments.length&&void 0!==r&&arguments[4],a={top:0,left:0},s=o?M(t):y(t,m(e));if("viewport"===i)a=A(s,o);else{var l;"scrollParent"===i?"BODY"===(l=g(p(e))).nodeName&&(l=t.ownerDocument.documentElement):l="window"===i?t.ownerDocument.documentElement:i;var u=T(l,s,o);if("HTML"!==l.nodeName||D(s))a=u;else{var c=_(t.ownerDocument),h=c.height,d=c.width;a.top+=u.top-u.marginTop,a.bottom=h+u.top,a.left+=u.left-u.marginLeft,a.right=d+u.left}}var f="number"==typeof(n=n||0);return a.left+=f?n:n.left||0,a.top+=f?n:n.top||0,a.right-=f?n:n.right||0,a.bottom-=f?n:n.bottom||0,a}function I(t){return t.width*t.height}function c(t,e,i,n,r,o){var a=5<arguments.length&&void 0!==o?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=f(i,n,a,r),l={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},u=Object.keys(l).map(function(t){return ut({key:t},l[t],{area:I(l[t])})}).sort(function(t,e){return e.area-t.area}),c=u.filter(function(t){var e=t.width,n=t.height;return e>=i.clientWidth&&n>=i.clientHeight}),h=0<c.length?c[0].key:u[0].key,d=t.split("-")[1];return h+(d?"-"+d:"")}function k(t,e,n,i){var r=3<arguments.length&&void 0!==i?arguments[3]:null;return T(n,r?M(e):y(e,m(n)),r)}function E(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function L(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function O(t,e,n){n=n.split("-")[0];var i=E(t),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",u=o?"width":"height";return r[a]=e[a]+e[l]/2-i[l]/2,r[s]=n===s?e[s]-i[u]:e[L(s)],r}function P(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function i(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var i=P(t,function(t){return t[e]===n});return t.indexOf(i)}function N(t,n,e){return(void 0===e?t:t.slice(0,i(t,"name",e))).forEach(function(t){t["function"]&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var e=t["function"]||t.fn;t.enabled&&s(e)&&(n.offsets.popper=S(n.offsets.popper),n.offsets.reference=S(n.offsets.reference),n=e(n,t))}),n}function t(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=k(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=c(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=O(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=N(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function e(t,n){return t.some(function(t){var e=t.name;return t.enabled&&e===n})}function R(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<e.length;i++){var r=e[i],o=r?""+r+n:t;if("undefined"!=typeof document.body.style[o])return o}return null}function n(){return this.state.isDestroyed=!0,e(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[R("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function o(t){var e=t.ownerDocument;return e?e.defaultView:window}function a(t,e,n,i){var r="BODY"===t.nodeName,o=r?t.ownerDocument.defaultView:t;o.addEventListener(e,n,{passive:!0}),r||a(g(o.parentNode),e,n,i),i.push(o)}function F(t,e,n,i){n.updateBound=i,o(t).addEventListener("resize",n.updateBound,{passive:!0});var r=g(t);return a(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function z(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function H(t,e){return o(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(t){t.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function B(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=H(this.reference,this.state))}function V(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function j(n,i){Object.keys(i).forEach(function(t){var e="";-1!==["width","height","top","right","bottom","left"].indexOf(t)&&V(i[t])&&(e="px"),n.style[t]=i[t]+e})}function W(e,n){Object.keys(n).forEach(function(t){!1===n[t]?e.removeAttribute(t):e.setAttribute(t,n[t])})}function U(t,e){var n=t.offsets,i=n.popper,r=n.reference,o=J,a=function(t){return t},s=o(r.width),l=o(i.width),u=-1!==["left","right"].indexOf(t.placement),c=-1!==t.placement.indexOf("-"),h=e?u||c||s%2==l%2?o:Q:a,d=e?o:a;return{left:h(1==s%2&&1==l%2&&!c&&e?i.left-1:i.left),top:d(i.top),bottom:d(i.bottom),right:h(i.right)}}function $(t,e,n){var i=P(t,function(t){return t.name===e}),r=!!i&&t.some(function(t){return t.name===n&&t.enabled&&t.order<i.order});if(!r){var o="`"+e+"`";console.warn("`"+n+"` modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return r}function q(t){return"end"===t?"start":"start"===t?"end":t}function G(t,e){var n=1<arguments.length&&void 0!==e&&arguments[1],i=dt.indexOf(t),r=dt.slice(i+1).concat(dt.slice(0,i));return n?r.reverse():r}function Y(t,e,n,i){var r,o=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+o[1],s=o[2];if(!a)return t;if(0!==s.indexOf("%"))return"vh"!==s&&"vw"!==s?a:("vh"===s?tt(document.documentElement.clientHeight,window.innerHeight||0):tt(document.documentElement.clientWidth,window.innerWidth||0))/100*a;switch(s){case"%p":r=n;break;case"%":case"%r":default:r=i}return S(r)[e]/100*a}function Z(t,r,o,e){var a=[0,0],s=-1!==["right","left"].indexOf(e),n=t.split(/(\+|\-)/).map(function(t){return t.trim()}),i=n.indexOf(P(n,function(t){return-1!==t.search(/,|\s/)}));n[i]&&-1===n[i].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1===i?[n]:[n.slice(0,i).concat([n[i].split(l)[0]]),[n[i].split(l)[1]].concat(n.slice(i+1))];return(u=u.map(function(t,e){var n=(1===e?!s:s)?"height":"width",i=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,i=!0,t):i?(t[t.length-1]+=e,i=!1,t):t.concat(e)},[]).map(function(t){return Y(t,n,r,o)})})).forEach(function(n,i){n.forEach(function(t,e){V(t)&&(a[i]+=t*("-"===n[e-1]?-1:1))})}),a}function X(t,e){var n,i=e.offset,r=t.placement,o=t.offsets,a=o.popper,s=o.reference,l=r.split("-")[0];return n=V(+i)?[+i,0]:Z(i,a,s,l),"left"===l?(a.top+=n[0],a.left-=n[1]):"right"===l?(a.top+=n[0],a.left+=n[1]):"top"===l?(a.left+=n[0],a.top-=n[1]):"bottom"===l&&(a.left+=n[0],a.top+=n[1]),t.popper=a,t}var K=Math.min,Q=Math.floor,J=Math.round,tt=Math.max,et="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,nt=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(et&&0<=navigator.userAgent.indexOf(t[e]))return 1;return 0}(),it=et&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},nt))}},rt=et&&!(!window.MSInputMethodContext||!document.documentMode),ot=et&&/MSIE 10/.test(navigator.userAgent),at=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},st=function(){function i(t,e){for(var n,i=0;i<e.length;i++)(n=e[i]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),lt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ut=Object.assign||function(t){for(var e,n=1;n<arguments.length;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ct=et&&/Firefox/i.test(navigator.userAgent),ht=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],dt=ht.slice(3),ft={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"},pt=function(){function a(t,e,n){var i=this,r=2<arguments.length&&void 0!==n?arguments[2]:{};at(this,a),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=it(this.update.bind(this)),this.options=ut({},a.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=e&&e.jquery?e[0]:e,this.options.modifiers={},Object.keys(ut({},a.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=ut({},a.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return ut({name:t},i.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&s(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return st(a,[{key:"update",value:function(){return t.call(this)}},{key:"destroy",value:function(){return n.call(this)}},{key:"enableEventListeners",value:function(){return z.call(this)}},{key:"disableEventListeners",value:function(){return B.call(this)}}]),a}();return pt.Utils=("undefined"==typeof window?global:window).PopperUtils,pt.placements=ht,pt.Defaults={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var r=t.offsets,o=r.reference,a=r.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:lt({},l,o[l]),end:lt({},l,o[l]+o[u]-a[u])};t.offsets.popper=ut({},a,c[i])}return t}},offset:{order:200,enabled:!0,fn:X,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,i){var e=i.boundariesElement||x(t.instance.popper);t.instance.reference===e&&(e=x(e));var n=R("transform"),r=t.instance.popper.style,o=r.top,a=r.left,s=r[n];r.top="",r.left="",r[n]="";var l=f(t.instance.popper,t.instance.reference,i.padding,e,t.positionFixed);r.top=o,r.left=a,r[n]=s,i.boundaries=l;var u=i.priority,c=t.offsets.popper,h={primary:function(t){var e=c[t];return c[t]<l[t]&&!i.escapeWithReference&&(e=tt(c[t],l[t])),lt({},t,e)},secondary:function(t){var e="right"===t?"left":"top",n=c[e];return c[t]>l[t]&&!i.escapeWithReference&&(n=K(c[e],l[t]-("right"===t?c.width:c.height))),lt({},e,n)}};return u.forEach(function(t){var e=-1===["left","top"].indexOf(t)?"secondary":"primary";c=ut({},c,h[e](t))}),t.offsets.popper=c,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,r=t.placement.split("-")[0],o=Q,a=-1!==["top","bottom"].indexOf(r),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]<o(i[l])&&(t.offsets.popper[l]=o(i[l])-n[u]),n[l]>o(i[s])&&(t.offsets.popper[l]=o(i[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!$(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],o=t.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(r),u=l?"height":"width",c=l?"Top":"Left",h=c.toLowerCase(),d=l?"left":"top",f=l?"bottom":"right",p=E(i)[u];s[f]-p<a[h]&&(t.offsets.popper[h]-=a[h]-(s[f]-p)),s[h]+p>a[f]&&(t.offsets.popper[h]+=s[h]+p-a[f]),t.offsets.popper=S(t.offsets.popper);var g=s[h]+s[u]/2-p/2,m=b(t.instance.popper),v=parseFloat(m["margin"+c],10),y=parseFloat(m["border"+c+"Width"],10),x=g-t.offsets.popper[h]-v-y;return x=tt(K(a[u]-p,x),0),t.arrowElement=i,t.offsets.arrow=(lt(n={},h,J(x)),lt(n,d,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(g,m){if(e(g.instance.modifiers,"inner"))return g;if(g.flipped&&g.placement===g.originalPlacement)return g;var v=f(g.instance.popper,g.instance.reference,m.padding,m.boundariesElement,g.positionFixed),y=g.placement.split("-")[0],x=L(y),b=g.placement.split("-")[1]||"",w=[];switch(m.behavior){case ft.FLIP:w=[y,x];break;case ft.CLOCKWISE:w=G(y);break;case ft.COUNTERCLOCKWISE:w=G(y,!0);break;default:w=m.behavior}return w.forEach(function(t,e){if(y!==t||w.length===e+1)return g;y=g.placement.split("-")[0],x=L(y);var n=g.offsets.popper,i=g.offsets.reference,r=Q,o="left"===y&&r(n.right)>r(i.left)||"right"===y&&r(n.left)<r(i.right)||"top"===y&&r(n.bottom)>r(i.top)||"bottom"===y&&r(n.top)<r(i.bottom),a=r(n.left)<r(v.left),s=r(n.right)>r(v.right),l=r(n.top)<r(v.top),u=r(n.bottom)>r(v.bottom),c="left"===y&&a||"right"===y&&s||"top"===y&&l||"bottom"===y&&u,h=-1!==["top","bottom"].indexOf(y),d=!!m.flipVariations&&(h&&"start"===b&&a||h&&"end"===b&&s||!h&&"start"===b&&l||!h&&"end"===b&&u),f=!!m.flipVariationsByContent&&(h&&"start"===b&&s||h&&"end"===b&&a||!h&&"start"===b&&u||!h&&"end"===b&&l),p=d||f;(o||c||p)&&(g.flipped=!0,(o||c)&&(y=w[e+1]),p&&(b=q(b)),g.placement=y+(b?"-"+b:""),g.offsets.popper=ut({},g.offsets.popper,O(g.instance.popper,g.offsets.reference,g.placement)),g=N(g.instance.modifiers,g,"flip"))}),g},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,r=i.popper,o=i.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=o[n]-(s?r[a?"width":"height"]:0),t.placement=L(e),t.offsets.popper=S(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!$(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=P(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var n=e.x,i=e.y,r=t.offsets.popper,o=P(t.instance.modifiers,function(t){return"applyStyle"===t.name}).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a,s,l=void 0===o?e.gpuAcceleration:o,u=x(t.instance.popper),c=C(u),h={position:r.position},d=U(t,window.devicePixelRatio<2||!ct),f="bottom"===n?"top":"bottom",p="right"===i?"left":"right",g=R("transform");if(s="bottom"==f?"HTML"===u.nodeName?-u.clientHeight+d.bottom:-c.height+d.bottom:d.top,a="right"==p?"HTML"===u.nodeName?-u.clientWidth+d.right:-c.width+d.right:d.left,l&&g)h[g]="translate3d("+a+"px, "+s+"px, 0)",h[f]=0,h[p]=0,h.willChange="transform";else{var m="bottom"==f?-1:1,v="right"==p?-1:1;h[f]=s*m,h[p]=a*v,h.willChange=f+", "+p}var y={"x-placement":t.placement};return t.attributes=ut({},y,t.attributes),t.styles=ut({},h,t.styles),t.arrowStyles=ut({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){return j(t.instance.popper,t.styles),W(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&j(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,n,i,r){var o=k(r,e,t,n.positionFixed),a=c(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",a),j(e,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},pt}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t=t||self).Util=e(t.jQuery)}(this,function(o){"use strict";function s(t){return{}.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase()}function t(){return{bindType:i,delegateType:i,handle:function e(t){return o(t.target).is(this)?t.handleObj.handler.apply(this,arguments):undefined}}}function e(t){var e=this,n=!1;return o(this).one(l.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||l.triggerTransitionEnd(e)},t),this}function n(){o.fn.emulateTransitionEnd=e,o.event.special[l.TRANSITION_END]=t()}o=o&&o.hasOwnProperty("default")?o["default"]:o;var i="transitionend",r=1e6,a=1e3,l={TRANSITION_END:"bsTransitionEnd",getUID:function u(t){for(;t+=~~(Math.random()*r),document.getElementById(t););return t},getSelectorFromElement:function c(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(i){return null}},getTransitionDurationFromElement:function h(t){if(!t)return 0;var e=o(t).css("transition-duration"),n=o(t).css("transition-delay"),i=parseFloat(e),r=parseFloat(n);return i||r?(e=e.split(",")[0],n=n.split(",")[0],(parseFloat(e)+parseFloat(n))*a):0},reflow:function d(t){return t.offsetHeight},triggerTransitionEnd:function f(t){o(t).trigger(i)},supportsTransitionEnd:function p(){return Boolean(i)},isElement:function g(t){return(t[0]||t).nodeType},typeCheckConfig:function m(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i],o=e[i],a=o&&l.isElement(o)?"element":s(o);if(!new RegExp(r).test(a))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+a+'" but expected type "'+r+'".')}},findShadowRoot:function v(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?l.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};return n(),l}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Alert=e(t.jQuery,t.Util)}(this,function(h,d){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function f(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}h=h&&h.hasOwnProperty("default")?h["default"]:h,d=d&&d.hasOwnProperty("default")?d["default"]:d;var t="alert",p="4.3.1",g="bs.alert",e="."+g,n=".data-api",r=h.fn[t],o={DISMISS:'[data-dismiss="alert"]'},m={CLOSE:"close"+e,CLOSED:"closed"+e,CLICK_DATA_API:"click"+e+n},v={ALERT:"alert",FADE:"fade",SHOW:"show"},a=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function n(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function e(){h.removeData(this._element,g),this._element=null},t._getRootElement=function r(t){var e=d.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=h(t).closest("."+v.ALERT)[0]),n},t._triggerCloseEvent=function o(t){var e=h.Event(m.CLOSE);return h(t).trigger(e),e},t._removeElement=function a(e){var n=this;if(h(e).removeClass(v.SHOW),h(e).hasClass(v.FADE)){var t=d.getTransitionDurationFromElement(e);h(e).one(d.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function s(t){h(t).detach().trigger(m.CLOSED).remove()},i._jQueryInterface=function l(n){return this.each(function(){var t=h(this),e=t.data(g);e||(e=new i(this),t.data(g,e)),"close"===n&&e[n](this)})},i._handleDismiss=function u(e){return function(t){t&&t.preventDefault(),e.close(this)}},f(i,null,[{key:"VERSION",get:function c(){return p}}]),i}();return h(document).on(m.CLICK_DATA_API,o.DISMISS,a._handleDismiss(new a)),h.fn[t]=a._jQueryInterface,h.fn[t].Constructor=a,h.fn[t].noConflict=function(){return h.fn[t]=r,a._jQueryInterface},a}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t=t||self).Button=e(t.jQuery)}(this,function(a){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}a=a&&a.hasOwnProperty("default")?a["default"]:a;var t="button",l="4.3.1",u="bs.button",e="."+u,n=".data-api",r=a.fn[t],c={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},h={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:'input:not([type="hidden"])',ACTIVE:".active",BUTTON:".btn"},o={CLICK_DATA_API:"click"+e+n,FOCUS_BLUR_DATA_API:"focus"+e+n+" blur"+e+n},d=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function o(){var t=!0,e=!0,n=a(this._element).closest(h.DATA_TOGGLE)[0];if(n){var i=this._element.querySelector(h.INPUT);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(c.ACTIVE))t=!1;else{var r=n.querySelector(h.ACTIVE);r&&a(r).removeClass(c.ACTIVE)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(c.ACTIVE),a(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(c.ACTIVE)),t&&a(this._element).toggleClass(c.ACTIVE)},t.dispose=function e(){a.removeData(this._element,u),this._element=null},n._jQueryInterface=function i(e){return this.each(function(){var t=a(this).data(u);t||(t=new n(this),a(this).data(u,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function r(){return l}}]),n}();return a(document).on(o.CLICK_DATA_API,h.DATA_TOGGLE_CARROT,function(t){t.preventDefault();var e=t.target;a(e).hasClass(c.BUTTON)||(e=a(e).closest(h.BUTTON)),d._jQueryInterface.call(a(e),"toggle")}).on(o.FOCUS_BLUR_DATA_API,h.DATA_TOGGLE_CARROT,function(t){var e=a(t.target).closest(h.BUTTON)[0];a(e).toggleClass(c.FOCUS,/^focus(in)?$/.test(t.type))}),a.fn[t]=d._jQueryInterface,a.fn[t].Constructor=d,a.fn[t].noConflict=function(){return a.fn[t]=r,d._jQueryInterface},d}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Carousel=e(t.jQuery,t.Util)}(this,function(_,S){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function C(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}_=_&&_.hasOwnProperty("default")?_["default"]:_,S=S&&S.hasOwnProperty("default")?S["default"]:S;var A="carousel",D="4.3.1",M="bs.carousel",I="."+M,t=".data-api",e=_.fn[A],k=37,E=39,L=500,O=40,P={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},N={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},R={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},F={SLIDE:"slide"+I,SLID:"slid"+I,KEYDOWN:"keydown"+I,MOUSEENTER:"mouseenter"+I,MOUSELEAVE:"mouseleave"+I,TOUCHSTART:"touchstart"+I,TOUCHMOVE:"touchmove"+I,TOUCHEND:"touchend"+I,POINTERDOWN:"pointerdown"+I,POINTERUP:"pointerup"+I,DRAG_START:"dragstart"+I,LOAD_DATA_API:"load"+I+t,CLICK_DATA_API:"click"+I+t},z={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item",POINTER_EVENT:"pointer-event"},H={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",ITEM_IMG:".carousel-item img",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},B={TOUCH:"touch",PEN:"pen"},o=function(){function o(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(H.INDICATORS),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=o.prototype;return t.next=function e(){this._isSliding||this._slide(R.NEXT)},t.nextWhenVisible=function n(){!document.hidden&&_(this._element).is(":visible")&&"hidden"!==_(this._element).css("visibility")&&this.next()},t.prev=function i(){this._isSliding||this._slide(R.PREV)},t.pause=function r(t){t||(this._isPaused=!0),this._element.querySelector(H.NEXT_PREV)&&(S.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function a(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function s(t){var e=this;this._activeElement=this._element.querySelector(H.ACTIVE_ITEM);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)_(this._element).one(F.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?R.NEXT:R.PREV;this._slide(i,this._items[t])}},t.dispose=function l(){_(this._element).off(I),_.removeData(this._element,M),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function u(t){return t=T({},P,t),S.typeCheckConfig(A,t,N),t},t._handleSwipe=function c(){var t=Math.abs(this.touchDeltaX);if(!(t<=O)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function h(){var e=this;this._config.keyboard&&_(this._element).on(F.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&_(this._element).on(F.MOUSEENTER,function(t){return e.pause(t)}).on(
|
|
F.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function d(){var e=this;if(this._touchSupported){var n=function n(t){e._pointerEvent&&B[t.originalEvent.pointerType.toUpperCase()]?e.touchStartX=t.originalEvent.clientX:e._pointerEvent||(e.touchStartX=t.originalEvent.touches[0].clientX)},i=function i(t){t.originalEvent.touches&&1<t.originalEvent.touches.length?e.touchDeltaX=0:e.touchDeltaX=t.originalEvent.touches[0].clientX-e.touchStartX},r=function r(t){e._pointerEvent&&B[t.originalEvent.pointerType.toUpperCase()]&&(e.touchDeltaX=t.originalEvent.clientX-e.touchStartX),e._handleSwipe(),"hover"===e._config.pause&&(e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},L+e._config.interval))};_(this._element.querySelectorAll(H.ITEM_IMG)).on(F.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(_(this._element).on(F.POINTERDOWN,function(t){return n(t)}),_(this._element).on(F.POINTERUP,function(t){return r(t)}),this._element.classList.add(z.POINTER_EVENT)):(_(this._element).on(F.TOUCHSTART,function(t){return n(t)}),_(this._element).on(F.TOUCHMOVE,function(t){return i(t)}),_(this._element).on(F.TOUCHEND,function(t){return r(t)}))}},t._keydown=function f(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case k:t.preventDefault(),this.prev();break;case E:t.preventDefault(),this.next()}},t._getItemIndex=function p(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(H.ITEM)):[],this._items.indexOf(t)},t._getItemByDirection=function g(t,e){var n=t===R.NEXT,i=t===R.PREV,r=this._getItemIndex(e),o=this._items.length-1;if((i&&0===r||n&&r===o)&&!this._config.wrap)return e;var a=(r+(t===R.PREV?-1:1))%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},t._triggerSlideEvent=function m(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(H.ACTIVE_ITEM)),r=_.Event(F.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return _(this._element).trigger(r),r},t._setActiveIndicatorElement=function v(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(H.ACTIVE));_(e).removeClass(z.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&_(n).addClass(z.ACTIVE)}},t._slide=function y(t,e){var n,i,r,o=this,a=this._element.querySelector(H.ACTIVE_ITEM),s=this._getItemIndex(a),l=e||a&&this._getItemByDirection(t,a),u=this._getItemIndex(l),c=Boolean(this._interval);if(t===R.NEXT?(n=z.LEFT,i=z.NEXT,r=R.LEFT):(n=z.RIGHT,i=z.PREV,r=R.RIGHT),l&&_(l).hasClass(z.ACTIVE))this._isSliding=!1;else if(!this._triggerSlideEvent(l,r).isDefaultPrevented()&&a&&l){this._isSliding=!0,c&&this.pause(),this._setActiveIndicatorElement(l);var h=_.Event(F.SLID,{relatedTarget:l,direction:r,from:s,to:u});if(_(this._element).hasClass(z.SLIDE)){_(l).addClass(i),S.reflow(l),_(a).addClass(n),_(l).addClass(n);var d=parseInt(l.getAttribute("data-interval"),10);d?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=d):this._config.interval=this._config.defaultInterval||this._config.interval;var f=S.getTransitionDurationFromElement(a);_(a).one(S.TRANSITION_END,function(){_(l).removeClass(n+" "+i).addClass(z.ACTIVE),_(a).removeClass(z.ACTIVE+" "+i+" "+n),o._isSliding=!1,setTimeout(function(){return _(o._element).trigger(h)},0)}).emulateTransitionEnd(f)}else _(a).removeClass(z.ACTIVE),_(l).addClass(z.ACTIVE),this._isSliding=!1,_(this._element).trigger(h);c&&this.cycle()}},o._jQueryInterface=function x(i){return this.each(function(){var t=_(this).data(M),e=T({},P,_(this).data());"object"==typeof i&&(e=T({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new o(this,e),_(this).data(M,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},o._dataApiClickHandler=function b(t){var e=S.getSelectorFromElement(this);if(e){var n=_(e)[0];if(n&&_(n).hasClass(z.CAROUSEL)){var i=T({},_(n).data(),_(this).data()),r=this.getAttribute("data-slide-to");r&&(i.interval=!1),o._jQueryInterface.call(_(n),i),r&&_(n).data(M).to(r),t.preventDefault()}}},C(o,null,[{key:"VERSION",get:function w(){return D}},{key:"Default",get:function w(){return P}}]),o}();return _(document).on(F.CLICK_DATA_API,H.DATA_SLIDE,o._dataApiClickHandler),_(window).on(F.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(H.DATA_RIDE)),e=0,n=t.length;e<n;e++){var i=_(t[e]);o._jQueryInterface.call(i,i.data())}}),_.fn[A]=o._jQueryInterface,_.fn[A].Constructor=o,_.fn[A].noConflict=function(){return _.fn[A]=e,o._jQueryInterface},o}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Collapse=e(t.jQuery,t.Util)}(this,function(p,g){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function m(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}p=p&&p.hasOwnProperty("default")?p["default"]:p,g=g&&g.hasOwnProperty("default")?g["default"]:g;var y="collapse",x="4.3.1",b="bs.collapse",t="."+b,e=".data-api",n=p.fn[y],w={toggle:!0,parent:""},_={toggle:"boolean",parent:"(string|element)"},S={SHOW:"show"+t,SHOWN:"shown"+t,HIDE:"hide"+t,HIDDEN:"hidden"+t,CLICK_DATA_API:"click"+t+e},C={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},T={WIDTH:"width",HEIGHT:"height"},A={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},o=function(){function l(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(A.DATA_TOGGLE)),i=0,r=n.length;i<r;i++){var o=n[i],a=g.getSelectorFromElement(o),s=[].slice.call(document.querySelectorAll(a)).filter(function(t){return t===e});null!==a&&0<s.length&&(this._selector=a,this._triggerArray.push(o))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=l.prototype;return t.toggle=function e(){p(this._element).hasClass(C.SHOW)?this.hide():this.show()},t.show=function u(){var t,e,n=this;if(!this._isTransitioning&&!p(this._element).hasClass(C.SHOW)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(A.ACTIVES)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(C.COLLAPSE)})).length&&(t=null),!(t&&(e=p(t).not(this._selector).data(b))&&e._isTransitioning))){var i=p.Event(S.SHOW);if(p(this._element).trigger(i),!i.isDefaultPrevented()){t&&(l._jQueryInterface.call(p(t).not(this._selector),"hide"),e||p(t).data(b,null));var r=this._getDimension();p(this._element).removeClass(C.COLLAPSE).addClass(C.COLLAPSING),this._element.style[r]=0,this._triggerArray.length&&p(this._triggerArray).removeClass(C.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var o=function o(){p(n._element).removeClass(C.COLLAPSING).addClass(C.COLLAPSE).addClass(C.SHOW),n._element.style[r]="",n.setTransitioning(!1),p(n._element).trigger(S.SHOWN)},a="scroll"+(r[0].toUpperCase()+r.slice(1)),s=g.getTransitionDurationFromElement(this._element);p(this._element).one(g.TRANSITION_END,o).emulateTransitionEnd(s),this._element.style[r]=this._element[a]+"px"}}},t.hide=function c(){var t=this;if(!this._isTransitioning&&p(this._element).hasClass(C.SHOW)){var e=p.Event(S.HIDE);if(p(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",g.reflow(this._element),p(this._element).addClass(C.COLLAPSING).removeClass(C.COLLAPSE).removeClass(C.SHOW);var i=this._triggerArray.length;if(0<i)for(var r=0;r<i;r++){var o=this._triggerArray[r],a=g.getSelectorFromElement(o);if(null!==a)p([].slice.call(document.querySelectorAll(a))).hasClass(C.SHOW)||p(o).addClass(C.COLLAPSED).attr("aria-expanded",!1)}this.setTransitioning(!0);var s=function s(){t.setTransitioning(!1),p(t._element).removeClass(C.COLLAPSING).addClass(C.COLLAPSE).trigger(S.HIDDEN)};this._element.style[n]="";var l=g.getTransitionDurationFromElement(this._element);p(this._element).one(g.TRANSITION_END,s).emulateTransitionEnd(l)}}},t.setTransitioning=function n(t){this._isTransitioning=t},t.dispose=function i(){p.removeData(this._element,b),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function r(t){return(t=v({},w,t)).toggle=Boolean(t.toggle),g.typeCheckConfig(y,t,_),t},t._getDimension=function o(){return p(this._element).hasClass(T.WIDTH)?T.WIDTH:T.HEIGHT},t._getParent=function a(){var t,n=this;g.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return p(i).each(function(t,e){n._addAriaAndCollapsedClass(l._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function s(t,e){var n=p(t).hasClass(C.SHOW);e.length&&p(e).toggleClass(C.COLLAPSED,!n).attr("aria-expanded",n)},l._getTargetFromElement=function h(t){var e=g.getSelectorFromElement(t);return e?document.querySelector(e):null},l._jQueryInterface=function d(i){return this.each(function(){var t=p(this),e=t.data(b),n=v({},w,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new l(this,n),t.data(b,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method named "'+i+'"');e[i]()}})},m(l,null,[{key:"VERSION",get:function f(){return x}},{key:"Default",get:function f(){return w}}]),l}();return p(document).on(S.CLICK_DATA_API,A.DATA_TOGGLE,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=p(this),e=g.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));p(i).each(function(){var t=p(this),e=t.data(b)?"toggle":n.data();o._jQueryInterface.call(t,e)})}),p.fn[y]=o._jQueryInterface,p.fn[y].Constructor=o,p.fn[y].noConflict=function(){return p.fn[y]=n,o._jQueryInterface},o}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("popper.js"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","popper.js","./util.js"],e):(t=t||self).Dropdown=e(t.jQuery,t.Popper,t.Util)}(this,function(x,b,w){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}x=x&&x.hasOwnProperty("default")?x["default"]:x,b=b&&b.hasOwnProperty("default")?b["default"]:b,w=w&&w.hasOwnProperty("default")?w["default"]:w;var C="dropdown",T="4.3.1",A="bs.dropdown",D="."+A,t=".data-api",e=x.fn[C],M=27,I=32,k=9,E=38,L=40,O=3,P=new RegExp(E+"|"+L+"|"+M),N={HIDE:"hide"+D,HIDDEN:"hidden"+D,SHOW:"show"+D,SHOWN:"shown"+D,CLICK:"click"+D,CLICK_DATA_API:"click"+D+t,KEYDOWN_DATA_API:"keydown"+D+t,KEYUP_DATA_API:"keyup"+D+t},R={DISABLED:"disabled",SHOW:"show",DROPUP:"dropup",DROPRIGHT:"dropright",DROPLEFT:"dropleft",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",POSITION_STATIC:"position-static"},F={DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",MENU:".dropdown-menu",NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)"},z={TOP:"top-start",TOPEND:"top-end",BOTTOM:"bottom-start",BOTTOMEND:"bottom-end",RIGHT:"right-start",RIGHTEND:"right-end",LEFT:"left-start",LEFTEND:"left-end"},H={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},B={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},n=function(){function u(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=u.prototype;return t.toggle=function o(){if(!this._element.disabled&&!x(this._element).hasClass(R.DISABLED)){var t=u._getParentFromElement(this._element),e=x(this._menu).hasClass(R.SHOW);if(u._clearMenus(),!e){var n={relatedTarget:this._element},i=x.Event(N.SHOW,n);if(x(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if(void 0===b)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var r=this._element;"parent"===this._config.reference?r=t:w.isElement(this._config.reference)&&(r=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(r=this._config.reference[0])),"scrollParent"!==this._config.boundary&&x(t).addClass(R.POSITION_STATIC),this._popper=new b(r,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===x(t).closest(F.NAVBAR_NAV).length&&x(document.body).children().on("mouseover",null,x.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),x(this._menu).toggleClass(R.SHOW),x(t).toggleClass(R.SHOW).trigger(x.Event(N.SHOWN,n))}}}},t.show=function i(){if(!(this._element.disabled||x(this._element).hasClass(R.DISABLED)||x(this._menu).hasClass(R.SHOW))){var t={relatedTarget:this._element},e=x.Event(N.SHOW,t),n=u._getParentFromElement(this._element);x(n).trigger(e),e.isDefaultPrevented()||(x(this._menu).toggleClass(R.SHOW),x(n).toggleClass(R.SHOW).trigger(x.Event(N.SHOWN,t)))}},t.hide=function r(){if(!this._element.disabled&&!x(this._element).hasClass(R.DISABLED)&&x(this._menu).hasClass(R.SHOW)){var t={relatedTarget:this._element},e=x.Event(N.HIDE,t),n=u._getParentFromElement(this._element);x(n).trigger(e),e.isDefaultPrevented()||(x(this._menu).toggleClass(R.SHOW),x(n).toggleClass(R.SHOW).trigger(x.Event(N.HIDDEN,t)))}},t.dispose=function e(){x.removeData(this._element,A),x(this._element).off(D),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function n(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function a(){var e=this;x(this._element).on(N.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function s(t){return t=S({},this.constructor.Default,x(this._element).data(),t),w.typeCheckConfig(C,t,this.constructor.DefaultType),t},t._getMenuElement=function l(){if(!this._menu){var t=u._getParentFromElement(this._element);t&&(this._menu=t.querySelector(F.MENU))}return this._menu},t._getPlacement=function c(){var t=x(this._element.parentNode),e=z.BOTTOM;return t.hasClass(R.DROPUP)?(e=z.TOP,x(this._menu).hasClass(R.MENURIGHT)&&(e=z.TOPEND)):t.hasClass(R.DROPRIGHT)?e=z.RIGHT:t.hasClass(R.DROPLEFT)?e=z.LEFT:x(this._menu).hasClass(R.MENURIGHT)&&(e=z.BOTTOMEND),e},t._detectNavbar=function h(){return 0<x(this._element).closest(".navbar").length},t._getOffset=function d(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=S({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function f(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},u._jQueryInterface=function p(e){return this.each(function(){var t=x(this).data(A);if(t||(t=new u(this,"object"==typeof e?e:null),x(this).data(A,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},u._clearMenus=function g(t){if(!t||t.which!==O&&("keyup"!==t.type||t.which===k))for(var e=[].slice.call(document.querySelectorAll(F.DATA_TOGGLE)),n=0,i=e.length;n<i;n++){var r=u._getParentFromElement(e[n]),o=x(e[n]).data(A),a={relatedTarget:e[n]};if(t&&"click"===t.type&&(a.clickEvent=t),o){var s=o._menu;if(x(r).hasClass(R.SHOW)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&t.which===k)&&x.contains(r,t.target))){var l=x.Event(N.HIDE,a);x(r).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&x(document.body).children().off("mouseover",null,x.noop),e[n].setAttribute("aria-expanded","false"),x(s).removeClass(R.SHOW),x(r).removeClass(R.SHOW).trigger(x.Event(N.HIDDEN,a)))}}}},u._getParentFromElement=function m(t){var e,n=w.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},u._dataApiKeydownHandler=function v(t){if((/input|textarea/i.test(t.target.tagName)?!(t.which===I||t.which!==M&&(t.which!==L&&t.which!==E||x(t.target).closest(F.MENU).length)):P.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!x(this).hasClass(R.DISABLED))){var e=u._getParentFromElement(this),n=x(e).hasClass(R.SHOW);if(n&&(!n||t.which!==M&&t.which!==I)){var i=[].slice.call(e.querySelectorAll(F.VISIBLE_ITEMS));if(0!==i.length){var r=i.indexOf(t.target);t.which===E&&0<r&&r--,t.which===L&&r<i.length-1&&r++,r<0&&(r=0),i[r].focus()}}else{if(t.which===M){var o=e.querySelector(F.DATA_TOGGLE);x(o).trigger("focus")}x(this).trigger("click")}}},_(u,null,[{key:"VERSION",get:function y(){return T}},{key:"Default",get:function y(){return H}},{key:"DefaultType",get:function y(){return B}}]),u}();return x(document).on(N.KEYDOWN_DATA_API,F.DATA_TOGGLE,n._dataApiKeydownHandler).on(N.KEYDOWN_DATA_API,F.MENU,n._dataApiKeydownHandler).on(N.CLICK_DATA_API+" "+N.KEYUP_DATA_API,n._clearMenus).on(N.CLICK_DATA_API,F.DATA_TOGGLE,function(t){t.preventDefault(),t.stopPropagation(),n._jQueryInterface.call(x(this),"toggle")}).on(N.CLICK_DATA_API,F.FORM_CHILD,function(t){t.stopPropagation()}),x.fn[C]=n._jQueryInterface,x.fn[C].Constructor=n,x.fn[C].noConflict=function(){return x.fn[C]=e,n._jQueryInterface},n}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Modal=e(t.jQuery,t.Util)}(this,function(S,C){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function T(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}S=S&&S.hasOwnProperty("default")?S["default"]:S,C=C&&C.hasOwnProperty("default")?C["default"]:C;var D="modal",M="4.3.1",I="bs.modal",k="."+I,t=".data-api",e=S.fn[D],E=27,L={backdrop:!0,keyboard:!0,focus:!0,show:!0},O={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},P={HIDE:"hide"+k,HIDDEN:"hidden"+k,SHOW:"show"+k,SHOWN:"shown"+k,FOCUSIN:"focusin"+k,RESIZE:"resize"+k,CLICK_DISMISS:"click.dismiss"+k,KEYDOWN_DISMISS:"keydown.dismiss"+k,MOUSEUP_DISMISS:"mouseup.dismiss"+k,MOUSEDOWN_DISMISS:"mousedown.dismiss"+k,CLICK_DATA_API:"click"+k+t},N={SCROLLABLE:"modal-dialog-scrollable",SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},R={DIALOG:".modal-dialog",MODAL_BODY:".modal-body",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top"},a=function(){function r(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(R.DIALOG),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=r.prototype;return t.toggle=function e(t){return this._isShown?this.hide():this.show(t)},t.show=function i(t){var e=this;if(!this._isShown&&!this._isTransitioning){S(this._element).hasClass(N.FADE)&&(this._isTransitioning=!0);var n=S.Event(P.SHOW,{relatedTarget:t});S(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),S(this._element).on(P.CLICK_DISMISS,R.DATA_DISMISS,function(t){return e.hide(t)}),S(this._dialog).on(P.MOUSEDOWN_DISMISS,function(){S(e._element).one(P.MOUSEUP_DISMISS,function(t){S(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function o(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=S.Event(P.HIDE);if(S(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=S(this._element).hasClass(N.FADE);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),S(document).off(P.FOCUSIN),S(this._element).removeClass(N.SHOW),S(this._element).off(P.CLICK_DISMISS),S(this._dialog).off(P.MOUSEDOWN_DISMISS),i){var r=C.getTransitionDurationFromElement(this._element);S(this._element).one(C.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(r)}else this._hideModal()}}},t.dispose=function n(){[window,this._element,this._dialog].forEach(function(t){return S(t).off(k)}),S(document).off(P.FOCUSIN),S.removeData(this._element,I),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function a(){this._adjustDialog()},t._getConfig=function s(t){return t=A({},L,t),C.typeCheckConfig(D,t,O),t},t._showElement=function l(t){var e=this,n=S(this._element).hasClass(N.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),S(this._dialog).hasClass(N.SCROLLABLE)?this._dialog.querySelector(R.MODAL_BODY).scrollTop=0:this._element.scrollTop=0,n&&C.reflow(this._element),S(this._element).addClass(N.SHOW),this._config.focus&&this._enforceFocus();var i=S.Event(P.SHOWN,{relatedTarget:t}),r=function r(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,S(e._element).trigger(i)};if(n){var o=C.getTransitionDurationFromElement(this._dialog);S(this._dialog).one(C.TRANSITION_END,r).emulateTransitionEnd(o)}else r()},t._enforceFocus=function u(){var e=this;S(document).off(P.FOCUSIN).on(P.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===S(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function c(){var e=this;this._isShown&&this._config.keyboard?S(this._element).on(P.KEYDOWN_DISMISS,function(t){t.which===E&&(t.preventDefault(),e.hide())}):this._isShown||S(this._element).off(P.KEYDOWN_DISMISS)},t._setResizeEvent=function h(){var e=this;this._isShown?S(window).on(P.RESIZE,function(t){return e.handleUpdate(t)}):S(window).off(P.RESIZE)},t._hideModal=function d(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){S(document.body).removeClass(N.OPEN),t._resetAdjustments(),t._resetScrollbar(),S(t._element).trigger(P.HIDDEN)})},t._removeBackdrop=function f(){this._backdrop&&(S(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function p(t){var e=this,n=S(this._element).hasClass(N.FADE)?N.FADE:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=N.BACKDROP,n&&this._backdrop.classList.add(n),S(this._backdrop).appendTo(document.body),S(this._element).on(P.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&C.reflow(this._backdrop),S(this._backdrop).addClass(N.SHOW),!t)return;if(!n)return void t();var i=C.getTransitionDurationFromElement(this._backdrop);S(this._backdrop).one(C.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){S(this._backdrop).removeClass(N.SHOW);var r=function r(){e._removeBackdrop(),t&&t()};if(S(this._element).hasClass(N.FADE)){var o=C.getTransitionDurationFromElement(this._backdrop);S(this._backdrop).one(C.TRANSITION_END,r).emulateTransitionEnd(o)}else r()}else t&&t()},t._adjustDialog=function g(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function m(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function v(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function y(){var r=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(R.FIXED_CONTENT)),e=[].slice.call(document.querySelectorAll(R.STICKY_CONTENT));S(t).each(function(t,e){var n=e.style.paddingRight,i=S(e).css("padding-right");S(e).data("padding-right",n).css("padding-right",parseFloat(i)+r._scrollbarWidth+"px")}),S(e).each(function(t,e){var n=e.style.marginRight,i=S(e).css("margin-right");S(e).data("margin-right",n).css("margin-right",parseFloat(i)-r._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=S(document.body).css("padding-right");S(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}S(document.body).addClass(N.OPEN)},t._resetScrollbar=function x(){var t=[].slice.call(document.querySelectorAll(R.FIXED_CONTENT));S(t).each(function(t,e){var n=S(e).data("padding-right");S(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+R.STICKY_CONTENT));S(e).each(function(t,e){var n=S(e).data("margin-right");void 0!==n&&S(e).css("margin-right",n).removeData("margin-right")});var n=S(document.body).data("padding-right");S(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function b(){var t=document.createElement("div");t.className=N.SCROLLBAR_MEASURER,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},r._jQueryInterface=function w(n,i){return this.each(function(){var t=S(this).data(I),e=A({},L,S(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new r(this,e),S(this).data(I,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n](i)}else e.show&&t.show(i)})},T(r,null,[{key:"VERSION",get:function _(){return M}},{key:"Default",get:function _(){return L}}]),r}();return S(document).on(P.CLICK_DATA_API,R.DATA_TOGGLE,function(t){var e,n=this,i=C.getSelectorFromElement(this);i&&(e=document.querySelector(i));var r=S(e).data(I)?"toggle":A({},S(e).data(),S(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var o=S(e).one(P.SHOW,function(t){t.isDefaultPrevented()||o.one(P.HIDDEN,function(){S(n).is(":visible")&&n.focus()})});a._jQueryInterface.call(S(e),r,this)}),S.fn[D]=a._jQueryInterface,S.fn[D].Constructor=a,S.fn[D].noConflict=function(){return S.fn[D]=e,a._jQueryInterface},a}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("popper.js"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","popper.js","./util.js"],e):(t=t||self).Tooltip=e(t.jQuery,t.Popper,t.Util)}(this,function(E,L,O){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function P(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function u(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===a.indexOf(n)||Boolean(t.nodeValue.match(s)||t.nodeValue.match(l));for(var i=e.filter(function(t){return t instanceof RegExp}),r=0,o=i.length;r<o;r++)if(n.match(i[r]))return!0;return!1}function R(t,o,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(o),s=[].slice.call(n.body.querySelectorAll("*")),l=function l(t){var e=s[t],n=e.nodeName.toLowerCase();if(-1===a.indexOf(e.nodeName.toLowerCase()))return e.parentNode.removeChild(e),"continue";var i=[].slice.call(e.attributes),r=[].concat(o["*"]||[],o[n]||[]);i.forEach(function(t){u(t,r)||e.removeAttribute(t.nodeName)})},i=0,r=s.length;i<r;i++)l(i,r);return n.body.innerHTML}E=E&&E.hasOwnProperty("default")?E["default"]:E,L=L&&L.hasOwnProperty("default")?L["default"]:L,O=O&&O.hasOwnProperty("default")?O["default"]:O;var a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},s=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i,F="tooltip",z="4.3.1",H="bs.tooltip",B="."+H,e=E.fn[F],V="bs-tooltip",j=new RegExp("(^|\\s)"+V+"\\S+","g"),W=["sanitize","whiteList","sanitizeFn"],U={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},$={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},q={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:t},G={SHOW:"show",OUT:"out"},Y={HIDE:"hide"+B,HIDDEN:"hidden"+B,SHOW:"show"+B,SHOWN:"shown"+B,INSERTED:"inserted"+B,CLICK:"click"+B,FOCUSIN:"focusin"+B,
|
|
FOCUSOUT:"focusout"+B,MOUSEENTER:"mouseenter"+B,MOUSELEAVE:"mouseleave"+B},Z={FADE:"fade",SHOW:"show"},X={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner",ARROW:".arrow"},K={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},n=function(){function i(t,e){if(void 0===L)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function e(){this._isEnabled=!0},t.disable=function n(){this._isEnabled=!1},t.toggleEnabled=function r(){this._isEnabled=!this._isEnabled},t.toggle=function o(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=E(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),E(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(E(this.getTipElement()).hasClass(Z.SHOW))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function a(){clearTimeout(this._timeout),E.removeData(this.element,this.constructor.DATA_KEY),E(this.element).off(this.constructor.EVENT_KEY),E(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&E(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function f(){var e=this;if("none"===E(this.element).css("display"))throw new Error("Please use show on visible elements");var t=E.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){E(this.element).trigger(t);var n=O.findShadowRoot(this.element),i=E.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var r=this.getTipElement(),o=O.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&E(r).addClass(Z.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,s=this._getAttachment(a);this.addAttachmentClass(s);var l=this._getContainer();E(r).data(this.constructor.DATA_KEY,this),E.contains(this.element.ownerDocument.documentElement,this.tip)||E(r).appendTo(l),E(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new L(this.element,r,{placement:s,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:X.ARROW},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function h(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function d(t){return e._handlePopperPlacementChange(t)}}),E(r).addClass(Z.SHOW),"ontouchstart"in document.documentElement&&E(document.body).children().on("mouseover",null,E.noop);var u=function u(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,E(e.element).trigger(e.constructor.Event.SHOWN),t===G.OUT&&e._leave(null,e)};if(E(this.tip).hasClass(Z.FADE)){var c=O.getTransitionDurationFromElement(this.tip);E(this.tip).one(O.TRANSITION_END,u).emulateTransitionEnd(c)}else u()}},t.hide=function s(t){var e=this,n=this.getTipElement(),i=E.Event(this.constructor.Event.HIDE),r=function r(){e._hoverState!==G.SHOW&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),E(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(E(this.element).trigger(i),!i.isDefaultPrevented()){if(E(n).removeClass(Z.SHOW),"ontouchstart"in document.documentElement&&E(document.body).children().off("mouseover",null,E.noop),this._activeTrigger[K.CLICK]=!1,this._activeTrigger[K.FOCUS]=!1,this._activeTrigger[K.HOVER]=!1,E(this.tip).hasClass(Z.FADE)){var o=O.getTransitionDurationFromElement(n);E(n).one(O.TRANSITION_END,r).emulateTransitionEnd(o)}else r();this._hoverState=""}},t.update=function l(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function u(){return Boolean(this.getTitle())},t.addAttachmentClass=function c(t){E(this.getTipElement()).addClass(V+"-"+t)},t.getTipElement=function h(){return this.tip=this.tip||E(this.config.template)[0],this.tip},t.setContent=function d(){var t=this.getTipElement();this.setElementContent(E(t.querySelectorAll(X.TOOLTIP_INNER)),this.getTitle()),E(t).removeClass(Z.FADE+" "+Z.SHOW)},t.setElementContent=function p(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=R(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?E(e).parent().is(t)||t.empty().append(e):t.text(E(e).text())},t.getTitle=function g(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function m(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=N({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function v(){return!1===this.config.container?document.body:O.isElement(this.config.container)?E(this.config.container):E(document).find(this.config.container)},t._getAttachment=function y(t){return $[t.toUpperCase()]},t._setListeners=function x(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)E(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==K.MANUAL){var e=t===K.HOVER?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===K.HOVER?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;E(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),E(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=N({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function b(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function w(t,e){var n=this.constructor.DATA_KEY;(e=e||E(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),E(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?K.FOCUS:K.HOVER]=!0),E(e.getTipElement()).hasClass(Z.SHOW)||e._hoverState===G.SHOW?e._hoverState=G.SHOW:(clearTimeout(e._timeout),e._hoverState=G.SHOW,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===G.SHOW&&e.show()},e.config.delay.show):e.show())},t._leave=function _(t,e){var n=this.constructor.DATA_KEY;(e=e||E(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),E(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?K.FOCUS:K.HOVER]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=G.OUT,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===G.OUT&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function S(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function C(t){var e=E(this.element).data();return Object.keys(e).forEach(function(t){-1!==W.indexOf(t)&&delete e[t]}),"number"==typeof(t=N({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),O.typeCheckConfig(F,t,this.constructor.DefaultType),t.sanitize&&(t.template=R(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function T(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function A(){var t=E(this.getTipElement()),e=t.attr("class").match(j);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function D(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function M(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(E(t).removeClass(Z.FADE),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function I(n){return this.each(function(){var t=E(this).data(H),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),E(this).data(H,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},P(i,null,[{key:"VERSION",get:function k(){return z}},{key:"Default",get:function k(){return q}},{key:"NAME",get:function k(){return F}},{key:"DATA_KEY",get:function k(){return H}},{key:"Event",get:function k(){return Y}},{key:"EVENT_KEY",get:function k(){return B}},{key:"DefaultType",get:function k(){return U}}]),i}();return E.fn[F]=n._jQueryInterface,E.fn[F].Constructor=n,E.fn[F].noConflict=function(){return E.fn[F]=e,n._jQueryInterface},n}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./tooltip.js")):"function"==typeof define&&define.amd?define(["jquery","./tooltip.js"],e):(t=t||self).Popover=e(t.jQuery,t.Tooltip)}(this,function(h,t){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function d(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function f(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}h=h&&h.hasOwnProperty("default")?h["default"]:h,t=t&&t.hasOwnProperty("default")?t["default"]:t;var p="popover",g="4.3.1",m="bs.popover",v="."+m,n=h.fn[p],y="bs-popover",x=new RegExp("(^|\\s)"+y+"\\S+","g"),b=e({},t.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),w=e({},t.DefaultType,{content:"(string|element|function)"}),_={FADE:"fade",SHOW:"show"},S={TITLE:".popover-header",CONTENT:".popover-body"},C={HIDE:"hide"+v,HIDDEN:"hidden"+v,SHOW:"show"+v,SHOWN:"shown"+v,INSERTED:"inserted"+v,CLICK:"click"+v,FOCUSIN:"focusin"+v,FOCUSOUT:"focusout"+v,MOUSEENTER:"mouseenter"+v,MOUSELEAVE:"mouseleave"+v},o=function(t){function i(){return t.apply(this,arguments)||this}f(i,t);var e=i.prototype;return e.isWithContent=function n(){return this.getTitle()||this._getContent()},e.addAttachmentClass=function r(t){h(this.getTipElement()).addClass(y+"-"+t)},e.getTipElement=function o(){return this.tip=this.tip||h(this.config.template)[0],this.tip},e.setContent=function a(){var t=h(this.getTipElement());this.setElementContent(t.find(S.TITLE),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(S.CONTENT),e),t.removeClass(_.FADE+" "+_.SHOW)},e._getContent=function s(){return this.element.getAttribute("data-content")||this.config.content},e._cleanTipClass=function l(){var t=h(this.getTipElement()),e=t.attr("class").match(x);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function u(n){return this.each(function(){var t=h(this).data(m),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),h(this).data(m,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},d(i,null,[{key:"VERSION",get:function c(){return g}},{key:"Default",get:function c(){return b}},{key:"NAME",get:function c(){return p}},{key:"DATA_KEY",get:function c(){return m}},{key:"Event",get:function c(){return C}},{key:"EVENT_KEY",get:function c(){return v}},{key:"DefaultType",get:function c(){return w}}]),i}(t);return h.fn[p]=o._jQueryInterface,h.fn[p].Constructor=o,h.fn[p].noConflict=function(){return h.fn[p]=n,o._jQueryInterface},o}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).ScrollSpy=e(t.jQuery,t.Util)}(this,function(f,p){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function g(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}f=f&&f.hasOwnProperty("default")?f["default"]:f,p=p&&p.hasOwnProperty("default")?p["default"]:p;var v="scrollspy",y="4.3.1",x="bs.scrollspy",b="."+x,t=".data-api",e=f.fn[v],w={offset:10,method:"auto",target:""},_={offset:"number",method:"string",target:"(string|element)"},S={ACTIVATE:"activate"+b,SCROLL:"scroll"+b,LOAD_DATA_API:"load"+b+t},C={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active"},T={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},A={OFFSET:"offset",POSITION:"position"},o=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+T.NAV_LINKS+","+this._config.target+" "+T.LIST_ITEMS+","+this._config.target+" "+T.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,f(this._scrollElement).on(S.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function i(){var e=this,t=this._scrollElement===this._scrollElement.window?A.OFFSET:A.POSITION,r="auto"===this._config.method?t:this._config.method,o=r===A.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=p.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[f(e)[r]().top+o,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function e(){f.removeData(this._element,x),f(this._scrollElement).off(b),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function r(t){if("string"!=typeof(t=m({},w,"object"==typeof t&&t?t:{})).target){var e=f(t.target).attr("id");e||(e=p.getUID(v),f(t.target).attr("id",e)),t.target="#"+e}return p.typeCheckConfig(v,t,_),t},t._getScrollTop=function o(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function a(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function s(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function l(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;){this._activeTarget!==this._targets[r]&&t>=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||t<this._offsets[r+1])&&this._activate(this._targets[r])}}},t._activate=function u(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=f([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(C.DROPDOWN_ITEM)?(n.closest(T.DROPDOWN).find(T.DROPDOWN_TOGGLE).addClass(C.ACTIVE),n.addClass(C.ACTIVE)):(n.addClass(C.ACTIVE),n.parents(T.NAV_LIST_GROUP).prev(T.NAV_LINKS+", "+T.LIST_ITEMS).addClass(C.ACTIVE),n.parents(T.NAV_LIST_GROUP).prev(T.NAV_ITEMS).children(T.NAV_LINKS).addClass(C.ACTIVE)),f(this._scrollElement).trigger(S.ACTIVATE,{relatedTarget:e})},t._clear=function c(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(C.ACTIVE)}).forEach(function(t){return t.classList.remove(C.ACTIVE)})},n._jQueryInterface=function h(e){return this.each(function(){var t=f(this).data(x);if(t||(t=new n(this,"object"==typeof e&&e),f(this).data(x,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},g(n,null,[{key:"VERSION",get:function d(){return y}},{key:"Default",get:function d(){return w}}]),n}();return f(window).on(S.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(T.DATA_SPY)),e=t.length;e--;){var n=f(t[e]);o._jQueryInterface.call(n,n.data())}}),f.fn[v]=o._jQueryInterface,f.fn[v].Constructor=o,f.fn[v].noConflict=function(){return f.fn[v]=e,o._jQueryInterface},o}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Tab=e(t.jQuery,t.Util)}(this,function(c,h){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}c=c&&c.hasOwnProperty("default")?c["default"]:c,h=h&&h.hasOwnProperty("default")?h["default"]:h;var t="tab",s="4.3.1",d="bs.tab",e="."+d,n=".data-api",r=c.fn[t],f={HIDE:"hide"+e,HIDDEN:"hidden"+e,SHOW:"show"+e,SHOWN:"shown"+e,CLICK_DATA_API:"click"+e+n},p={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},g={DROPDOWN:".dropdown",NAV_LIST_GROUP:".nav, .list-group",ACTIVE:".active",ACTIVE_UL:"> li > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},a=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function u(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&c(this._element).hasClass(p.ACTIVE)||c(this._element).hasClass(p.DISABLED))){var t,i,e=c(this._element).closest(g.NAV_LIST_GROUP)[0],r=h.getSelectorFromElement(this._element);if(e){var o="UL"===e.nodeName||"OL"===e.nodeName?g.ACTIVE_UL:g.ACTIVE;i=(i=c.makeArray(c(e).find(o)))[i.length-1]}var a=c.Event(f.HIDE,{relatedTarget:this._element}),s=c.Event(f.SHOW,{relatedTarget:i});if(i&&c(i).trigger(a),c(this._element).trigger(s),!s.isDefaultPrevented()&&!a.isDefaultPrevented()){r&&(t=document.querySelector(r)),this._activate(this._element,e);var l=function l(){var t=c.Event(f.HIDDEN,{relatedTarget:n._element}),e=c.Event(f.SHOWN,{relatedTarget:i});c(i).trigger(t),c(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function e(){c.removeData(this._element,d),this._element=null},t._activate=function l(t,e,n){var i=this,r=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?c(e).children(g.ACTIVE):c(e).find(g.ACTIVE_UL))[0],o=n&&r&&c(r).hasClass(p.FADE),a=function a(){return i._transitionComplete(t,r,n)};if(r&&o){var s=h.getTransitionDurationFromElement(r);c(r).removeClass(p.SHOW).one(h.TRANSITION_END,a).emulateTransitionEnd(s)}else a()},t._transitionComplete=function a(t,e,n){if(e){c(e).removeClass(p.ACTIVE);var i=c(e.parentNode).find(g.DROPDOWN_ACTIVE_CHILD)[0];i&&c(i).removeClass(p.ACTIVE),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(c(t).addClass(p.ACTIVE),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),h.reflow(t),t.classList.contains(p.FADE)&&t.classList.add(p.SHOW),t.parentNode&&c(t.parentNode).hasClass(p.DROPDOWN_MENU)){var r=c(t).closest(g.DROPDOWN)[0];if(r){var o=[].slice.call(r.querySelectorAll(g.DROPDOWN_TOGGLE));c(o).addClass(p.ACTIVE)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function r(n){return this.each(function(){var t=c(this),e=t.data(d);if(e||(e=new i(this),t.data(d,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},o(i,null,[{key:"VERSION",get:function n(){return s}}]),i}();return c(document).on(f.CLICK_DATA_API,g.DATA_TOGGLE,function(t){t.preventDefault(),a._jQueryInterface.call(c(this),"show")}),c.fn[t]=a._jQueryInterface,c.fn[t].Constructor=a,c.fn[t].noConflict=function(){return c.fn[t]=r,a._jQueryInterface},a}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],e):(t=t||self).Toast=e(t.jQuery,t.Util)}(this,function(c,h){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function d(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}c=c&&c.hasOwnProperty("default")?c["default"]:c,h=h&&h.hasOwnProperty("default")?h["default"]:h;var p="toast",g="4.3.1",m="bs.toast",t="."+m,e=c.fn[p],v={CLICK_DISMISS:"click.dismiss"+t,HIDE:"hide"+t,HIDDEN:"hidden"+t,SHOW:"show"+t,SHOWN:"shown"+t},y={FADE:"fade",HIDE:"hide",SHOW:"show",SHOWING:"showing"},x={animation:"boolean",autohide:"boolean",delay:"number"},b={animation:!0,autohide:!0,delay:500},w={DATA_DISMISS:'[data-dismiss="toast"]'},n=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function r(){var t=this;c(this._element).trigger(v.SHOW),this._config.animation&&this._element.classList.add(y.FADE);var e=function e(){t._element.classList.remove(y.SHOWING),t._element.classList.add(y.SHOW),c(t._element).trigger(v.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove(y.HIDE),this._element.classList.add(y.SHOWING),this._config.animation){var n=h.getTransitionDurationFromElement(this._element);c(this._element).one(h.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function n(t){var e=this;this._element.classList.contains(y.SHOW)&&(c(this._element).trigger(v.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function e(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(y.SHOW)&&this._element.classList.remove(y.SHOW),c(this._element).off(v.CLICK_DISMISS),c.removeData(this._element,m),this._element=null,this._config=null},t._getConfig=function o(t){return t=f({},b,c(this._element).data(),"object"==typeof t&&t?t:{}),h.typeCheckConfig(p,t,this.constructor.DefaultType),t},t._setListeners=function a(){var t=this;c(this._element).on(v.CLICK_DISMISS,w.DATA_DISMISS,function(){return t.hide(!0)})},t._close=function s(){var t=this,e=function e(){t._element.classList.add(y.HIDE),c(t._element).trigger(v.HIDDEN)};if(this._element.classList.remove(y.SHOW),this._config.animation){var n=h.getTransitionDurationFromElement(this._element);c(this._element).one(h.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function l(n){return this.each(function(){var t=c(this),e=t.data(m);if(e||(e=new i(this,"object"==typeof n&&n),t.data(m,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},d(i,null,[{key:"VERSION",get:function u(){return g}},{key:"DefaultType",get:function u(){return x}},{key:"Default",get:function u(){return b}}]),i}();return c.fn[p]=n._jQueryInterface,c.fn[p].Constructor=n,c.fn[p].noConflict=function(){return c.fn[p]=e,n._jQueryInterface},n}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(h){var n;h.extend(h.fn,{validate:function(t){if(this.length){var i=h.data(this[0],"validator");return i||(this.attr("novalidate","novalidate"),i=new h.validator(t,this[0]),h.data(this[0],"validator",i),i.settings.onsubmit&&(this.on("click.validate",":submit",function(t){i.submitButton=t.currentTarget,h(this).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==h(this).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.on("submit.validate",function(n){function t(){var t,e;return i.submitButton&&(i.settings.submitHandler||i.formSubmitted)&&(t=h("<input type='hidden'/>").attr("name",i.submitButton.name).val(h(i.submitButton).val()).appendTo(i.currentForm)),!(i.settings.submitHandler&&!i.settings.debug)||(e=i.settings.submitHandler.call(i,i.currentForm,n),t&&t.remove(),void 0!==e&&e)}return i.settings.debug&&n.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,t()):i.form()?i.pendingRequest?!(i.formSubmitted=!0):t():(i.focusInvalid(),!1)})),i)}t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.")},valid:function(){var t,e,n;return h(this[0]).is("form")?t=this.validate().form():(n=[],t=!0,e=h(this[0].form).validate(),this.each(function(){(t=e.element(this)&&t)||(n=n.concat(e.errorList))}),e.errorList=n),t},rules:function(t,e){var n,i,r,o,a,s,l=this[0],u=void 0!==this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=l&&(!l.form&&u&&(l.form=this.closest("form")[0],l.name=this.attr("name")),null!=l.form)){if(t)switch(n=h.data(l.form,"validator").settings,i=n.rules,r=h.validator.staticRules(l),t){case"add":h.extend(r,h.validator.normalizeRule(e)),delete r.messages,i[l.name]=r,e.messages&&(n.messages[l.name]=h.extend(n.messages[l.name],e.messages));break;case"remove":return e?(s={},h.each(e.split(/\s/),function(t,e){s[e]=r[e],delete r[e]}),s):(delete i[l.name],r)}return(o=h.validator.normalizeRules(h.extend({},h.validator.classRules(l),h.validator.attributeRules(l),h.validator.dataRules(l),h.validator.staticRules(l)),l)).required&&(a=o.required,delete o.required,o=h.extend({required:a},o)),o.remote&&(a=o.remote,delete o.remote,o=h.extend(o,{remote:a})),o}}}),h.extend(h.expr.pseudos||h.expr[":"],{blank:function(t){return!h.trim(""+h(t).val())},filled:function(t){var e=h(t).val();return null!==e&&!!h.trim(""+e)},unchecked:function(t){return!h(t).prop("checked")}}),h.validator=function(t,e){this.settings=h.extend(!0,{},h.validator.defaults,t),this.currentForm=e,this.init()},h.validator.format=function(n,t){return 1===arguments.length?function(){var t=h.makeArray(arguments);return t.unshift(n),h.validator.format.apply(this,t)}:(void 0===t||(2<arguments.length&&t.constructor!==Array&&(t=h.makeArray(arguments).slice(1)),t.constructor!==Array&&(t=[t]),h.each(t,function(t,e){n=n.replace(new RegExp("\\{"+t+"\\}","g"),function(){return e})})),n)},h.extend(h.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:h([]),errorLabelContainer:h([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(t)))},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){var n=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===e.which&&""===this.elementValue(t)||-1!==h.inArray(e.keyCode,n)||(t.name in this.submitted||t.name in this.invalid)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(t,e,n){"radio"===t.type?this.findByName(t.name).addClass(e).removeClass(n):h(t).addClass(e).removeClass(n)},unhighlight:function(t,e,n){"radio"===t.type?this.findByName(t.name).removeClass(e).addClass(n):h(t).removeClass(e).addClass(n)}},setDefaults:function(t){h.extend(h.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:h.validator.format("Please enter no more than {0} characters."),minlength:h.validator.format("Please enter at least {0} characters."),rangelength:h.validator.format("Please enter a value between {0} and {1} characters long."),range:h.validator.format("Please enter a value between {0} and {1}."),max:h.validator.format("Please enter a value less than or equal to {0}."),min:h.validator.format("Please enter a value greater than or equal to {0}."),step:h.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function t(t){var e=void 0!==h(this).attr("contenteditable")&&"false"!==h(this).attr("contenteditable");if(!this.form&&e&&(this.form=h(this).closest("form")[0],this.name=h(this).attr("name")),o===this.form){var n=h.data(this.form,"validator"),i="on"+t.type.replace(/^validate/,""),r=n.settings;r[i]&&!h(this).is(r.ignore)&&r[i].call(n,this,t)}}this.labelContainer=h(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||h(this.currentForm),this.containers=h(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var n,o=this.currentForm,i=this.groups={};h.each(this.settings.groups,function(n,t){"string"==typeof t&&(t=t.split(/\s/)),h.each(t,function(t,e){i[e]=n})}),n=this.settings.rules,h.each(n,function(t,e){n[t]=h.validator.normalizeRule(e)}),h(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",t).on("click.validate","select, option, [type='radio'], [type='checkbox']",t),this.settings.invalidHandler&&h(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),h.extend(this.submitted,this.errorMap),this.invalid=h.extend({},this.errorMap),this.valid()||h(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(t
|
|
){var e,n,i=this.clean(t),r=this.validationTargetFor(i),o=this,a=!0;return void 0===r?delete this.invalid[i.name]:(this.prepareElement(r),this.currentElements=h(r),(n=this.groups[r.name])&&h.each(this.groups,function(t,e){e===n&&t!==r.name&&((i=o.validationTargetFor(o.clean(o.findByName(t))))&&i.name in o.invalid&&(o.currentElements.push(i),a=o.check(i)&&a))}),e=!1!==this.check(r),a=a&&e,this.invalid[r.name]=!e,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),h(t).attr("aria-invalid",!e)),a},showErrors:function(e){if(e){var n=this;h.extend(this.errorMap,e),this.errorList=h.map(this.errorMap,function(t,e){return{message:t,element:n.findByName(e)[0]}}),this.successList=h.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){h.fn.resetForm&&h(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var t=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(t)},resetElements:function(t){var e;if(this.settings.unhighlight)for(e=0;t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,""),this.findByName(t[e].name).removeClass(this.settings.validClass);else t.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e,n=0;for(e in t)void 0!==t[e]&&null!==t[e]&&!1!==t[e]&&n++;return n},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(t){t.not(this.containers).text(""),this.addWrapper(t).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{h(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(i){}},findLastActive:function(){var e=this.lastActive;return e&&1===h.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var n=this,i={};return h(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var t=this.name||h(this).attr("name"),e=void 0!==h(this).attr("contenteditable")&&"false"!==h(this).attr("contenteditable");return!t&&n.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=h(this).closest("form")[0],this.name=t),!(this.form!==n.currentForm||t in i||!n.objectLength(h(this).rules())||(i[t]=!0,0))})},clean:function(t){return h(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return h(this.settings.errorElement+"."+t,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=h([]),this.toHide=h([])},reset:function(){this.resetInternals(),this.currentElements=h([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(t){var e,n,i=h(t),r=t.type,o=void 0!==i.attr("contenteditable")&&"false"!==i.attr("contenteditable");return"radio"===r||"checkbox"===r?this.findByName(t.name).filter(":checked").val():"number"===r&&"undefined"!=typeof t.validity?t.validity.badInput?"NaN":i.val():(e=o?i.text():i.val(),"file"===r?"C:\\fakepath\\"===e.substr(0,12)?e.substr(12):0<=(n=e.lastIndexOf("/"))?e.substr(n+1):0<=(n=e.lastIndexOf("\\"))?e.substr(n+1):e:"string"==typeof e?e.replace(/\r/g,""):e)},check:function(t){t=this.validationTargetFor(this.clean(t));var e,n,i,r,o=h(t).rules(),a=h.map(o,function(t,e){return e}).length,s=!1,l=this.elementValue(t);for(n in"function"==typeof o.normalizer?r=o.normalizer:"function"==typeof this.settings.normalizer&&(r=this.settings.normalizer),r&&(l=r.call(t,l),delete o.normalizer),o){i={method:n,parameters:o[n]};try{if("dependency-mismatch"===(e=h.validator.methods[n].call(this,l,t,i.parameters))&&1===a){s=!0;continue}if(s=!1,"pending"===e)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!e)return this.formatAndAdd(t,i),!1}catch(u){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+t.id+", check the '"+i.method+"' method.",u),u instanceof TypeError&&(u.message+=". Exception occurred when checking element "+t.id+", check the '"+i.method+"' method."),u}}if(!s)return this.objectLength(o)&&this.successList.push(t),!0},customDataMessage:function(t,e){return h(t).data("msg"+e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())||h(t).data("msg")},customMessage:function(t,e){var n=this.settings.messages[t];return n&&(n.constructor===String?n:n[e])},findDefined:function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]},defaultMessage:function(t,e){"string"==typeof e&&(e={method:e});var n=this.findDefined(this.customMessage(t.name,e.method),this.customDataMessage(t,e.method),!this.settings.ignoreTitle&&t.title||void 0,h.validator.messages[e.method],"<strong>Warning: No message defined for "+t.name+"</strong>"),i=/\$?\{(\d+)\}/g;return"function"==typeof n?n=n.call(this,e.parameters,t):i.test(n)&&(n=h.validator.format(n.replace(i,"{$1}"),e.parameters)),n},formatAndAdd:function(t,e){var n=this.defaultMessage(t,e);this.errorList.push({message:n,element:t,method:e.method}),this.errorMap[t.name]=n,this.submitted[t.name]=n},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e,n;for(t=0;this.errorList[t];t++)n=this.errorList[t],this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return h(this.errorList).map(function(){return this.element})},showLabel:function(t,e){var n,i,r,o,a=this.errorsFor(t),s=this.idOrName(t),l=h(t).attr("aria-describedby");a.length?(a.removeClass(this.settings.validClass).addClass(this.settings.errorClass),a.html(e)):(n=a=h("<"+this.settings.errorElement+">").attr("id",s+"-error").addClass(this.settings.errorClass).html(e||""),this.settings.wrapper&&(n=a.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(n):this.settings.errorPlacement?this.settings.errorPlacement.call(this,n,h(t)):n.insertAfter(t),a.is("label")?a.attr("for",s):0===a.parents("label[for='"+this.escapeCssMeta(s)+"']").length&&(r=a.attr("id"),l?l.match(new RegExp("\\b"+this.escapeCssMeta(r)+"\\b"))||(l+=" "+r):l=r,h(t).attr("aria-describedby",l),(i=this.groups[t.name])&&(o=this,h.each(o.groups,function(t,e){e===i&&h("[name='"+o.escapeCssMeta(t)+"']",o.currentForm).attr("aria-describedby",a.attr("id"))})))),!e&&this.settings.success&&(a.text(""),"string"==typeof this.settings.success?a.addClass(this.settings.success):this.settings.success(a,t)),this.toShow=this.toShow.add(a)},errorsFor:function(t){var e=this.escapeCssMeta(this.idOrName(t)),n=h(t).attr("aria-describedby"),i="label[for='"+e+"'], label[for='"+e+"'] *";return n&&(i=i+", #"+this.escapeCssMeta(n).replace(/\s+/g,", #")),this.errors().filter(i)},escapeCssMeta:function(t){return t.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),h(t).not(this.settings.ignore)[0]},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(t){return h(this.currentForm).find("[name='"+this.escapeCssMeta(t)+"']")},getLength:function(t,e){switch(e.nodeName.toLowerCase()){case"select":return h("option:selected",e).length;case"input":if(this.checkable(e))return this.findByName(e.name).filter(":checked").length}return t.length},depend:function(t,e){return!this.dependTypes[typeof t]||this.dependTypes[typeof t](t,e)},dependTypes:{"boolean":function(t){return t},string:function(t,e){return!!h(t,e.form).length},"function":function(t,e){return t(e)}},optional:function(t){var e=this.elementValue(t);return!h.validator.methods.required.call(this,e,t)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,h(t).addClass(this.settings.pendingClass),this.pending[t.name]=!0)},stopRequest:function(t,e){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],h(t).removeClass(this.settings.pendingClass),e&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(h(this.currentForm).submit(),this.submitButton&&h("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!e&&0===this.pendingRequest&&this.formSubmitted&&(h(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t,e){return e="string"==typeof e&&e||"remote",h.data(t,"previousValue")||h.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,{method:e})})},destroy:function(){this.resetForm(),h(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,e){t.constructor===String?this.classRuleSettings[t]=e:h.extend(this.classRuleSettings,t)},classRules:function(t){var e={},n=h(t).attr("class");return n&&h.each(n.split(" "),function(){this in h.validator.classRuleSettings&&h.extend(e,h.validator.classRuleSettings[this])}),e},normalizeAttributeRule:function(t,e,n,i){/min|max|step/.test(n)&&(null===e||/number|range|text/.test(e))&&(i=Number(i),isNaN(i)&&(i=void 0)),i||0===i?t[n]=i:e===n&&"range"!==e&&(t[n]=!0)},attributeRules:function(t){var e,n,i={},r=h(t),o=t.getAttribute("type");for(e in h.validator.methods)"required"===e?(""===(n=t.getAttribute(e))&&(n=!0),n=!!n):n=r.attr(e),this.normalizeAttributeRule(i,o,e,n);return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(t){var e,n,i={},r=h(t),o=t.getAttribute("type");for(e in h.validator.methods)""===(n=r.data("rule"+e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))&&(n=!0),this.normalizeAttributeRule(i,o,e,n);return i},staticRules:function(t){var e={},n=h.data(t.form,"validator");return n.settings.rules&&(e=h.validator.normalizeRule(n.settings.rules[t.name])||{}),e},normalizeRules:function(i,r){return h.each(i,function(t,e){if(!1!==e){if(e.param||e.depends){var n=!0;switch(typeof e.depends){case"string":n=!!h(e.depends,r.form).length;break;case"function":n=e.depends.call(r,r)}n?i[t]=void 0===e.param||e.param:(h.data(r.form,"validator").resetElements(h(r)),delete i[t])}}else delete i[t]}),h.each(i,function(t,e){i[t]=h.isFunction(e)&&"normalizer"!==t?e(r):e}),h.each(["minlength","maxlength"],function(){i[this]&&(i[this]=Number(i[this]))}),h.each(["rangelength","range"],function(){var t;i[this]&&(h.isArray(i[this])?i[this]=[Number(i[this][0]),Number(i[this][1])]:"string"==typeof i[this]&&(t=i[this].replace(/[\[\]]/g,"").split(/[\s,]+/),i[this]=[Number(t[0]),Number(t[1])]))}),h.validator.autoCreateRanges&&(null!=i.min&&null!=i.max&&(i.range=[i.min,i.max],delete i.min,delete i.max),null!=i.minlength&&null!=i.maxlength&&(i.rangelength=[i.minlength,i.maxlength],delete i.minlength,delete i.maxlength)),i},normalizeRule:function(t){if("string"==typeof t){var e={};h.each(t.split(/\s/),function(){e[this]=!0}),t=e}return t},addMethod:function(t,e,n){h.validator.methods[t]=e,h.validator.messages[t]=void 0!==n?n:h.validator.messages[t],e.length<3&&h.validator.addClassRules(t,h.validator.normalizeRule(t))},methods:{required:function(t,e,n){if(!this.depend(n,e))return"dependency-mismatch";if("select"!==e.nodeName.toLowerCase())return this.checkable(e)?0<this.getLength(t,e):null!=t&&0<t.length;var i=h(e).val();return i&&0<i.length},email:function(t,e){return this.optional(e)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)},url:function(t,e){return this.optional(e)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(t)},date:(n=!1,function(t,e){return n||(n=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(e)||!/Invalid|NaN/.test(new Date(t).toString())}),dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t)},number:function(t,e){return this.optional(e)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},minlength:function(t,e,n){var i=h.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||n<=i},maxlength:function(t,e,n){var i=h.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||i<=n},rangelength:function(t,e,n){var i=h.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||i>=n[0]&&i<=n[1]},min:function(t,e,n){return this.optional(e)||n<=t},max:function(t,e,n){return this.optional(e)||t<=n},range:function(t,e,n){return this.optional(e)||t>=n[0]&&t<=n[1]},step:function(t,e,n){var i,r=h(e).attr("type"),o="Step attribute on input type "+r+" is not supported.",a=["text","number","range"],s=new RegExp("\\b"+r+"\\b"),l=function(t){var e=(""+t).match(/(?:\.(\d+))?$/);return e&&e[1]?e[1].length:0},u=function(t){return Math.round(t*Math.pow(10,i))},c=!0;if(r&&!s.test(a.join()))throw new Error(o);return i=l(n),(l(t)>i||u(t)%u(n)!=0)&&(c=!1),this.optional(e)||c},equalTo:function(t,e,n){var i=h(n);return this.settings.onfocusout&&i.not(".validate-equalTo-blur").length&&i.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){h(e).valid()}),t===i.val()},remote:function(o,a,t,s){if(this.optional(a))return"dependency-mismatch";s="string"==typeof s&&s||"remote";var l,e,n,u=this.previousValue(a,s);return this.settings.messages[a.name]||(this.settings.messages[a.name]={}),u.originalMessage=u.originalMessage||this.settings.messages[a.name][s],this.settings.messages[a.name][s]=u.message,t="string"==typeof t&&{url:t}||t,n=h.param(h.extend({data:o},t.data)),u.old===n?u.valid:(u.old=n,(l=this).startRequest(a),(e={})[a.name]=o,h.ajax(h.extend(!0,{mode:"abort",port:"validate"+a.name,dataType:"json",data:e,context:l.currentForm,success:function(t){var e,n,i,r=!0===t||"true"===t;l.settings.messages[a.name][s]=u.originalMessage,r?(i=l.formSubmitted,l.resetInternals(),l.toHide=l.errorsFor(a),l.formSubmitted=i,l.successList.push(a),l.invalid[a.name]=!1,l.showErrors()):(e={},n=t||l.defaultMessage(a,{method:s,parameters:o}),e[a.name]=u.message=n,l.invalid[a.name]=!0,l.showErrors(e)),u.valid=r,l.stopRequest(a,r)}},t)),"pending")}}});var i,r={};return h.ajaxPrefilter?h.ajaxPrefilter(function(t,e,n){var i=t.port;"abort"===t.mode&&(r[i]&&r[i].abort(),r[i]=n)}):(i=h.ajax,h.ajax=function(t){var e=("mode"in t?t:h.ajaxSettings).mode,n=("port"in t?t:h.ajaxSettings).port;return"abort"===e?(r[n]&&r[n].abort(),r[n]=i.apply(this,arguments),r[n]):i.apply(this,arguments)}),h}),function(t){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){return function(){function o(t){return t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-\u201c\u201d\u2019]*/g,"")}l.validator.addMethod("maxWords",function(t,e,n){return this.optional(e)||o(t).match(/\b\w+\b/g).length<=n},l.validator.format("Please enter {0} words or less.")),l.validator.addMethod("minWords",function(t,e,n){return this.optional(e)||o(t).match(/\b\w+\b/g).length>=n},l.validator.format("Please enter at least {0} words.")),l.validator.addMethod("rangeWords",function(t,e,n){var i=o(t),r=/\b\w+\b/g;return this.optional(e)||i.match(r).length>=n[0]&&i.match(r).length<=n[1]},l.validator.format("Please enter between {0} and {1} words."))}(),l.validator.addMethod("abaRoutingNumber",function(t){var e=0,n=t.split(""),i=n.length;if(9!==i)return!1;for(var r=0;r<i;r+=3)e+=3*parseInt(n[r],10)+7*parseInt(n[r+1],10)+parseInt(n[r+2],10);return 0!==e&&e%10==0},"Please enter a valid routing number."),l.validator.addMethod("accept",function(t,e,n){var i,r,o="string"==typeof n?n.replace(/\s/g,""):"image/*",a=this.optional(e);if(a)return a;if("file"===l(e).attr("type")&&(o=o.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),e.files&&e.files.length))for(r=new RegExp(".?("+o+")$","i"),i=0;i<e.files.length;i++)if(!e.files[i].type.match(r))return!1;return!0},l.validator.format("Please enter a value with a valid mimetype.")),l.validator.addMethod("alphanumeric",function(t,e){return this.optional(e)||/^\w+$/i.test(t)},"Letters, numbers, and underscores only please"),l.validator.addMethod("bankaccountNL",function(t,e){if(this.optional(e))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(t))return!1;var n,i=t.replace(/ /g,""),r=0,o=i.length;for(n=0;n<o;n++)r+=(o-n)*i.substring(n,n+1);return r%11==0},"Please specify a valid bank account number"),l.validator.addMethod("bankorgiroaccountNL",function(t,e){return this.optional(e)||l.validator.methods.bankaccountNL.call(this,t,e)||l.validator.methods.giroaccountNL.call(this,t,e)},"Please specify a valid bank or giro account number"),l.validator.addMethod("bic",function(t,e){return this.optional(e)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(t.toUpperCase())},"Please specify a valid BIC code"),l.validator.addMethod("cifES",function(t,e){"use strict";function n(t){return t%2==0}if(this.optional(e))return!0;var i,r,o,a,s=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),l=t.substring(0,1),u=t.substring(1,8),c=t.substring(8,9),h=0,d=0;if(9!==t.length||!s.test(t))return!1;for(i=0;i<u.length;i++)r=parseInt(u[i],10),n(i)?d+=(r*=2)<10?r:r-9:h+=r;return o=(10-(h+d).toString().substr(-1)).toString(),o=9<parseInt(o,10)?"0":o,a="JABCDEFGHI".substr(o,1).toString(),l.match(/[ABEH]/)?c===o:l.match(/[KPQS]/)?c===a:c===o||c===a},"Please specify a valid CIF number."),l.validator.addMethod("cnhBR",function(t){if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var e,n,i,r,o,a=0,s=0;if(e=t.charAt(0),new Array(12).join(e)===t)return!1;for(o=9,r=0;r<9;++r,--o)a+=+t.charAt(r)*o;for(10<=(n=a%11)&&(n=0,s=2),o=1,r=a=0;r<9;++r,++o)a+=+t.charAt(r)*o;return 10<=(i=a%11)?i=0:i-=s,String(n).concat(i)===t.substr(-2)},"Please specify a valid CNH number"),l.validator.addMethod("cnpjBR",function(t,e){"use strict";if(this.optional(e))return!0;if(14!==(t=t.replace(/[^\d]+/g,"")).length)return!1;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;for(var n=t.length-2,i=t.substring(0,n),r=t.substring(n),o=0,a=n-7,s=n;1<=s;s--)o+=i.charAt(n-s)*a--,a<2&&(a=9);var l=o%11<2?0:11-o%11;if(l!==parseInt(r.charAt(0),10))return!1;n+=1,i=t.substring(0,n),o=0,a=n-7;for(var u=n;1<=u;u--)o+=i.charAt(n-u)*a--,a<2&&(a=9);return(l=o%11<2?0:11-o%11)===parseInt(r.charAt(1),10)},"Please specify a CNPJ value number"),l.validator.addMethod("cpfBR",function(t,e){"use strict";if(this.optional(e))return!0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var n,i,r,o,a=0;if(n=parseInt(t.substring(9,10),10),i=parseInt(t.substring(10,11),10),r=function(t,e){var n=10*t%11;return 10!==n&&11!==n||(n=0),n===e},""===t||"00000000000"===t||"11111111111"===t||"22222222222"===t||"33333333333"===t||"44444444444"===t||"55555555555"===t||"66666666666"===t||"77777777777"===t||"88888888888"===t||"99999999999"===t)return!1;for(o=1;o<=9;o++)a+=parseInt(t.substring(o-1,o),10)*(11-o);if(r(a,n)){for(a=0,o=1;o<=10;o++)a+=parseInt(t.substring(o-1,o),10)*(12-o);return r(a,i)}return!1},"Please specify a valid CPF number"),l.validator.addMethod("creditcard",function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var n,i,r=0,o=0,a=!1;if((t=t.replace(/\D/g,"")).length<13||19<t.length)return!1;for(n=t.length-1;0<=n;n--)i=t.charAt(n),o=parseInt(i,10),a&&9<(o*=2)&&(o-=9),r+=o,a=!a;return r%10==0},"Please enter a valid credit card number."),l.validator.addMethod("creditcardtypes",function(t,e,n){if(/[^0-9\-]+/.test(t))return!1;t=t.replace(/\D/g,"");var i=0;return n.mastercard&&(i|=1),n.visa&&(i|=2),n.amex&&(i|=4),n.dinersclub&&(i|=8),n.enroute&&(i|=16),n.discover&&(i|=32),n.jcb&&(i|=64),n.unknown&&(i|=128),n.all&&(i=255),1&i&&(/^(5[12345])/.test(t)||/^(2[234567])/.test(t))?16===t.length:2&i&&/^(4)/.test(t)?16===t.length:4&i&&/^(3[47])/.test(t)?15===t.length:8&i&&/^(3(0[012345]|[68]))/.test(t)?14===t.length:16&i&&/^(2(014|149))/.test(t)?15===t.length:32&i&&/^(6011)/.test(t)?16===t.length:64&i&&/^(3)/.test(t)?16===t.length:64&i&&/^(2131|1800)/.test(t)?15===t.length:!!(128&i)},"Please enter a valid credit card number."),l.validator.addMethod("currency",function(t,e,n){var i,r="string"==typeof n,o=r?n:n[0],a=!!r||n[1];return o=o.replace(/,/g,""),i="^["+(o=a?o+"]":o+"]?")+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",i=new RegExp(i),this.optional(e)||i.test(t)},"Please specify a valid currency"),l.validator.addMethod("dateFA",function(t,e){return this.optional(e)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(t)},l.validator.messages.date),l.validator.addMethod("dateITA",function(t,e){var n,i,r,o,a,s=!1;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(t)?(n=t.split("/"),i=parseInt(n[0],10),r=parseInt(n[1],10),o=parseInt(n[2],10),s=(a=new Date(Date.UTC(o,r-1,i,12,0,0,0))).getUTCFullYear()===o&&a.getUTCMonth()===r-1&&a.getUTCDate()===i):s=!1,this.optional(e)||s},l.validator.messages.date),l.validator.addMethod("dateNL",function(t,e){return this.optional(e)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(t)},l.validator.messages.date),l.validator.addMethod("extension",function(t,e,n){return n="string"==typeof n?n.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(e)||t.match(new RegExp("\\.("+n+")$","i"))},l.validator.format("Please enter a value with a valid extension.")),l.validator.addMethod("giroaccountNL",function(t,e){return this.optional(e)||/^[0-9]{1,7}$/.test(t)},"Please specify a valid giro account number"),l.validator.addMethod("greaterThan",function(t,e,n){var i=l(n);return this.settings.onfocusout&&i.not(".validate-greaterThan-blur").length&&i.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan",function(){l(e).valid()}),t>i.val()},"Please enter a greater value."),l.validator.addMethod("greaterThanEqual",function(t,e,n){var i=l(n);return this.settings.onfocusout&&i.not(".validate-greaterThanEqual-blur").length&&i.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual",function(){l(e).valid()}),t>=i.val()},"Please enter a greater value."),l.validator.addMethod("iban",function(t,e){if(this.optional(e))return!0;var n,i,r,o,a,s=t.replace(/ /g,"").toUpperCase(),l="",u=!0,c="",h=5;if(s.length<h)return!1;if(void 0!==(r={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"}[s.substring(0,2)])&&!new RegExp("^[A-Z]{2}\\d{2}"+r+"$","").test(s))return!1;for(n=s.substring(4,s.length)+s.substring(0,4),o=0;o<n.length;o++)"0"!==(i=n.charAt(o))&&(u=!1),u||(l+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(i));for(a=0;a<l.length;a++)c=(""+c+l.charAt(a))%97;return 1===c},"Please specify a valid IBAN"),l.validator.addMethod("integer",function(t,e){return this.optional(e)||/^-?\d+$/.test(t)},"A positive or negative non-decimal number please"),l.validator.addMethod("ipv4",function(t,e){return this.optional(e)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(t)},"Please enter a valid IP v4 address."),l.validator.addMethod("ipv6",function(t,e){return this.optional(e)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(t)},"Please enter a valid IP v6 address."),l.validator.addMethod("lessThan",function(t,e,n){var i=l(n);return this.settings.onfocusout&&i.not(".validate-lessThan-blur").length&&i.addClass("validate-lessThan-blur").on("blur.validate-lessThan",function(){l(e).valid()}),t<i.val()},"Please enter a lesser value."),l.validator.addMethod("lessThanEqual",function(t,e,n){var i=l(n);return this.settings.onfocusout&&i.not(".validate-lessThanEqual-blur").length&&i.addClass("validate-lessThanEqual-blur").on("blur.validate-lessThanEqual",function(){l(e).valid()}),t<=i.val()},"Please enter a lesser value."),l.validator.addMethod("lettersonly",function(t,e){return this.optional(e)||/^[a-z]+$/i.test(t)},"Letters only please"),l.validator.addMethod("letterswithbasicpunc",function(t,e){return this.optional(e)||/^[a-z\-.,()'"\s]+$/i.test(t)},"Letters or punctuation only please"),l.validator.addMethod("maxfiles",function(t,e,n){return!!this.optional(e)||!("file"===l(e).attr("type")&&e.files&&e.files.length>n)},l.validator.format("Please select no more than {0} files.")),l.validator.addMethod("maxsize",function(t,e,n){if(this.optional(e))return!0;if("file"===l(e).attr("type")&&e.files&&e.files.length)for(var i=0;i<e.files.length;i++)if(e.files[i].size>n)return!1;return!0},l.validator.format("File size must not exceed {0} bytes each.")),l.validator.addMethod("maxsizetotal",function(t,e,n){if(this.optional(e))return!0;if("file"===l(e).attr("type")&&e.files&&e.files.length)for(var i=0,r=0;r<e.files.length;r++)if(n<(i+=e.files[r].size))return!1;return!0},l.validator.format("Total size of all files must not exceed {0} bytes.")),l.validator.addMethod("mobileNL",function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(t)},"Please specify a valid mobile number"),l.validator.addMethod("mobileRU",function(t,e){var n=t.replace(/\(|\)|\s+|-/g,"");return this.optional(e)||9<n.length&&/^((\+7|7|8)+([0-9]){10})$/.test(n)},"Please specify a valid mobile number"),l.validator.addMethod("mobileUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||9<t.length&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),l.validator.addMethod("netmask",function(t,e){return this.optional(e)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(t)},"Please enter a valid netmask."),l.validator.addMethod("nieES",function(t,e){"use strict";if(this.optional(e))return!0;var n,i=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),r="TRWAGMYFPDXBNJZSQVHLCKET",o=t.substr(t.length-1).toUpperCase();return!(10<(t=t.toString().toUpperCase()).length||t.length<9||!i.test(t))&&(n=9===(t=t.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2")).length?t.substr(0,8):t.substr(0,9),r.charAt(parseInt(n,10)%23)===o)},"Please specify a valid NIE number."),l.validator.addMethod("nifES",function(t,e){"use strict";return!!this.optional(e)||!!(t=t.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(t)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,0)%23)===t.charAt(8):!!/^[KLM]{1}/.test(t)&&t[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,1)%23))},"Please specify a valid NIF number."),l.validator.addMethod("nipPL",function(t){"use strict";if(10!==(t=t.replace(/[^0-9]/g,"")).length)return!1;for(var e=[6,5,7,2,3,4,5,6,7],n=0,i=0;i<9;i++)n+=e[i]*t[i];var r=n%11;return(10===r?0:r)===parseInt(t[9],10)},"Please specify a valid NIP number."),l.validator.addMethod("nisBR",function(t){var e,n,i,r,o,a=0;if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;for(n=parseInt(t.substring(10,11),10),e=parseInt(t.substring(0,10),10),r=2;r<12;r++)10===(o=r)&&(o=2),11===r&&(o=3),a+=e%10*o,e=parseInt(e/10,10);return n===(i=1<(i=a%11)?11-i:0)},"Please specify a valid NIS/PIS number"),l.validator.addMethod("notEqualTo",function(t,e,n){return this.optional(e)||!l.validator.methods.equalTo.call(this,t,e,n)},"Please enter a different value, values must not be the same."),l.validator.addMethod("nowhitespace",function(t,e){return this.optional(e)||/^\S+$/i.test(t)},"No white space please"),l.validator.addMethod("pattern",function(t,e,n){return!!this.optional(e)||("string"==typeof n&&(n=new RegExp("^(?:"+n+")$")),n.test(t))},"Invalid format."),l.validator.addMethod("phoneNL",function(t,e
|
|
){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(t)},"Please specify a valid phone number."),l.validator.addMethod("phonePL",function(t,e){t=t.replace(/\s+/g,"");var n=/^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;return this.optional(e)||n.test(t)},"Please specify a valid phone number"),l.validator.addMethod("phonesUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||9<t.length&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),l.validator.addMethod("phoneUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||9<t.length&&t.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),l.validator.addMethod("phoneUS",function(t,e){return t=t.replace(/\s+/g,""),this.optional(e)||9<t.length&&t.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number"),l.validator.addMethod("postalcodeBR",function(t,e){return this.optional(e)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(t)},"Informe um CEP v\xe1lido."),l.validator.addMethod("postalCodeCA",function(t,e){return this.optional(e)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(t)},"Please specify a valid postal code"),l.validator.addMethod("postalcodeIT",function(t,e){return this.optional(e)||/^\d{5}$/.test(t)},"Please specify a valid postal code"),l.validator.addMethod("postalcodeNL",function(t,e){return this.optional(e)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(t)},"Please specify a valid postal code"),l.validator.addMethod("postcodeUK",function(t,e){return this.optional(e)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(t)},"Please specify a valid UK postcode"),l.validator.addMethod("require_from_group",function(t,e,n){var i=l(n[1],e.form),r=i.eq(0),o=r.data("valid_req_grp")?r.data("valid_req_grp"):l.extend({},this),a=i.filter(function(){return o.elementValue(this)}).length>=n[0];return r.data("valid_req_grp",o),l(e).data("being_validated")||(i.data("being_validated",!0),i.each(function(){o.element(this)}),i.data("being_validated",!1)),a},l.validator.format("Please fill at least {0} of these fields.")),l.validator.addMethod("skip_or_fill_minimum",function(t,e,n){var i=l(n[1],e.form),r=i.eq(0),o=r.data("valid_skip")?r.data("valid_skip"):l.extend({},this),a=i.filter(function(){return o.elementValue(this)}).length,s=0===a||a>=n[0];return r.data("valid_skip",o),l(e).data("being_validated")||(i.data("being_validated",!0),i.each(function(){o.element(this)}),i.data("being_validated",!1)),s},l.validator.format("Please either skip these fields or fill at least {0} of them.")),l.validator.addMethod("stateUS",function(t,e,n){var i,r=void 0===n,o=!r&&"undefined"!=typeof n.caseSensitive&&n.caseSensitive,a=!r&&"undefined"!=typeof n.includeTerritories&&n.includeTerritories,s=!r&&"undefined"!=typeof n.includeMilitary&&n.includeMilitary;return i=a||s?a&&s?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":a?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",i=o?new RegExp(i):new RegExp(i,"i"),this.optional(e)||i.test(t)},"Please specify a valid state"),l.validator.addMethod("strippedminlength",function(t,e,n){return l(t).text().length>=n},l.validator.format("Please enter at least {0} characters")),l.validator.addMethod("time",function(t,e){return this.optional(e)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(t)},"Please enter a valid time, between 00:00 and 23:59"),l.validator.addMethod("time12h",function(t,e){return this.optional(e)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(t)},"Please enter a valid time in 12-hour am/pm format"),l.validator.addMethod("url2",function(t,e){return this.optional(e)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},l.validator.messages.url),l.validator.addMethod("vinUS",function(t){if(17!==t.length)return!1;var e,n,i,r,o,a,s=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],l=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],u=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],c=0;for(e=0;e<17;e++){if(r=u[e],i=t.slice(e,e+1),8===e&&(a=i),isNaN(i)){for(n=0;n<s.length;n++)if(i.toUpperCase()===s[n]){i=l[n],i*=r,isNaN(a)&&8===n&&(a=s[n]);break}}else i*=r;c+=i}return 10===(o=c%11)&&(o="X"),o===a},"The specified vehicle identification number (VIN) is invalid."),l.validator.addMethod("zipcodeUS",function(t,e){return this.optional(e)||/^\d{5}(-\d{4})?$/.test(t)},"The specified US ZIP Code is invalid"),l.validator.addMethod("ziprange",function(t,e){return this.optional(e)||/^90[2-5]\d\{2\}-\d{4}$/.test(t)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"),l}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(o){function n(t,e,n){e={content:{message:"object"==typeof e?e.message:e,title:e.title?e.title:"",icon:e.icon?e.icon:"",url:e.url?e.url:"#",target:e.target?e.target:"-"}};n=o.extend(!0,{},e,n),this.settings=o.extend(!0,{},i,n),this._defaults=i,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var i={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:1e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:'<div data-notify="container" class="col-xs-4 col-sm-2 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'};String.format=function(t){for(var e=t,n=1;n<arguments.length;n++)e=e.replace(RegExp("\\{"+(n-1)+"\\}","gm"),arguments[n]);return e},o.extend(n.prototype,{init:function(){var a=this;this.buildNotify(),this.settings.content.icon&&this.setIcon(),"#"!=this.settings.content.url&&this.styleURL(),this.placement(),this.bind(),this.notify={$ele:this.$ele,update:function(t,e){var n={};for(var t in"string"==typeof t?n[t]=e:n=t,n)switch(t){case"type":this.$ele.removeClass("alert-"+a.settings.type),this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass("progress-bar-"+a.settings.type),a.settings.type=n[t],this.$ele.addClass("alert-"+n[t]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+n[t]);break;case"icon":var i=this.$ele.find('[data-notify="icon"]');"class"==a.settings.icon_type.toLowerCase()?i.removeClass(a.settings.content.icon).addClass(n[t]):(i.is("img")||i.find("img"),i.attr("src",n[t]));break;case"progress":var r=a.settings.delay-a.settings.delay*(n[t]/100);this.$ele.data("notify-delay",r),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",n[t]).css("width",n[t]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",n[t]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",n[t]);break;default:this.$ele.find('[data-notify="'+t+'"]').html(n[t])}var o=this.$ele.outerHeight()+parseInt(a.settings.spacing)+parseInt(a.settings.offset.y);a.reposition(o)},close:function(){a.close()}}},buildNotify:function(){var t=this.settings.content;this.$ele=o(String.format(this.settings.template,this.settings.type,t.title,t.message,t.url,t.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('<img src="'+this.settings.content.icon+'" alt="Notify Icon" />')},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1}),this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},placement:function(){var n=this,t=this.settings.offset.y,e={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},i=!1,r=this.settings;switch(o('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return t=Math.max(t,parseInt(o(this).css(r.placement.from))+parseInt(o(this).outerHeight())+parseInt(r.spacing))}),1==this.settings.newest_on_top&&(t=this.settings.offset.y),e[this.settings.placement.from]=t+"px",this.settings.placement.align){case"left":case"right":e[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":e.left=0,e.right=0}this.$ele.css(e).addClass(this.settings.animate.enter),o.each(Array("webkit","moz","o","ms",""),function(t,e){n.$ele[0].style[e+"AnimationIterationCount"]=1}),o(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(t=parseInt(t)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(t)),o.isFunction(n.settings.onShow)&&n.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){o.isFunction(n.settings.onShown)&&n.settings.onShown.call(this)}),setTimeout(function(){i||o.isFunction(n.settings.onShown)&&n.settings.onShown.call(this)},600)},bind:function(){var n=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){n.close()}),this.$ele.mouseover(function(){o(this).data("data-hover","true")}).mouseout(function(){o(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),0<this.settings.delay){n.$ele.data("notify-delay",n.settings.delay);var i=setInterval(function(){var t=parseInt(n.$ele.data("notify-delay"))-n.settings.timer;if("false"===n.$ele.data("data-hover")&&"pause"==n.settings.mouse_over||"pause"!=n.settings.mouse_over){var e=(n.settings.delay-t)/n.settings.delay*100;n.$ele.data("notify-delay",t),n.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",e).css("width",e+"%")}t<=-n.settings.timer&&(clearInterval(i),n.close())},n.settings.timer)}},close:function(){var t=this,e=parseInt(this.$ele.css(this.settings.placement.from)),n=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),t.reposition(e),o.isFunction(t.settings.onClose)&&t.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){o(this).remove(),o.isFunction(t.settings.onClosed)&&t.settings.onClosed.call(this)}),setTimeout(function(){n||(t.$ele.remove(),t.settings.onClosed&&t.settings.onClosed(t.$ele))},600)},reposition:function(t){var e=this,n='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',i=this.$ele.nextAll(n);1==this.settings.newest_on_top&&(i=this.$ele.prevAll(n)),i.each(function(){o(this).css(e.settings.placement.from,t),t=parseInt(t)+parseInt(e.settings.spacing)+o(this).outerHeight()})}}),o.notify=function(t,e){return new n(this,t,e).notify},o.notifyDefaults=function(t){return i=o.extend(!0,{},i,t)},o.notifyClose=function(t){void 0===t||"all"==t?o("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):o('[data-notify-position="'+t+'"]').find('[data-notify="dismiss"]').trigger("click")}}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(d){function f(t){return v.raw?t:encodeURIComponent(t)}function p(t){return v.raw?t:decodeURIComponent(t)}function g(t){return f(v.json?JSON.stringify(t):String(t))}function i(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(e," ")),v.json?JSON.parse(t):t}catch(f){}}function m(t,e){var n=v.raw?t:i(t);return d.isFunction(e)?e(n):n}var e=/\+/g,v=d.cookie=function(t,e,n){if(void 0!==e&&!d.isFunction(e)){if("number"==typeof(n=d.extend({},v.defaults,n)).expires){var i=n.expires,r=n.expires=new Date;r.setTime(+r+864e5*i)}return document.cookie=[f(t),"=",g(e),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}for(var o=t?void 0:{},a=document.cookie?document.cookie.split("; "):[],s=0,l=a.length;s<l;s++){var u=a[s].split("="),c=p(u.shift()),h=u.join("=");if(t&&t===c){o=m(h,e);break}t||void 0===(h=m(h))||(o[c]=h)}return o};v.defaults={},d.removeCookie=function(t,e){return void 0!==d.cookie(t)&&(d.cookie(t,"",d.extend({},e,{expires:-1})),!d.cookie(t))}}),function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(t,e){return e===undefined&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(e),e}:n(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var r,c,h;return t&&t.requirejs||(t?c=t:t={},function(f){function p(t,e){return n.call(t,e)}function a(t,e){var n,i,r,o,a,s,l,u,c,h,d,f=e&&e.split("/"),p=S.map,g=p&&p["*"]||{};if(t){for(a=(t=t.split("/")).length-1,S.nodeIdCompat&&T.test(t[a])&&(t[a]=t[a].replace(T,"")),"."===t[0].charAt(0)&&f&&(t=f.slice(0,f.length-1).concat(t)),c=0;c<t.length;c++)if("."===(d=t[c]))t.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===t[2]||".."===t[c-1])continue;0<c&&(t.splice(c-1,2),c-=2)}t=t.join("/")}if((f||g)&&p){for(c=(n=t.split("/")).length;0<c;c-=1){if(i=n.slice(0,c).join("/"),f)for(h=f.length;0<h;h-=1)if((r=p[f.slice(0,h).join("/")])&&(r=r[i])){o=r,s=c;break}if(o)break;!l&&g&&g[i]&&(l=g[i],u=c)}!o&&l&&(o=l,s=u),o&&(n.splice(0,s,o),t=n.join("/"))}return t}function g(e,n){return function(){var t=i.call(arguments,0);return"string"!=typeof t[0]&&1===t.length&&t.push(null),u.apply(f,t.concat([e,n]))}}function s(e){return function(t){return a(t,e)}}function m(e){return function(t){w[e]=t}}function v(t){if(p(_,t)){var e=_[t];delete _[t],C[t]=!0,o.apply(f,e)}if(!p(w,t)&&!p(C,t))throw new Error("No "+t);return w[t]}function l(t){var e,n=t?t.indexOf("!"):-1;return-1<n&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function y(t){return t?l(t):[]}function e(t){return function(){return S&&S.config&&S.config[t]||{}}}var o,u,x,b,w={},_={},S={},C={},n=Object.prototype.hasOwnProperty,i=[].slice,T=/\.js$/;x=function(t,e){var n,i=l(t),r=i[0],o=e[1];return t=i[1],r&&(n=v(r=a(r,o))),r?t=n&&n.normalize?n.normalize(t,s(o)):a(t,o):(r=(i=l(t=a(t,o)))[0],t=i[1],r&&(n=v(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:n}},b={require:function(t){return g(t)},exports:function(t){var e=w[t];return void 0!==e?e:w[t]={}},module:function(t){return{id:t,uri:"",exports:w[t],config:e(t)}}},o=function(t,e,n,i){var r,o,a,s,l,u,c,h=[],d=typeof n;if(u=y(i=i||t),"undefined"===d||"function"===d){for(e=!e.length&&n.length?["require","exports","module"]:e,l=0;l<e.length;l+=1)if("require"===(o=(s=x(e[l],u)).f))h[l]=b.require(t);else if("exports"===o)h[l]=b.exports(t),c=!0;else if("module"===o)r=h[l]=b.module(t);else if(p(w,o)||p(_,o)||p(C,o))h[l]=v(o);else{if(!s.p)throw new Error(t+" missing "+o);s.p.load(s.n,g(i,!0),m(o),{}),h[l]=w[o]}a=n?n.apply(w[t],h):undefined,t&&(r&&r.exports!==f&&r.exports!==w[t]?w[t]=r.exports:a===f&&c||(w[t]=a))}else t&&(w[t]=n)},r=c=u=function(t,e,n,i,r){if("string"==typeof t)return b[t]?b[t](e):v(x(t,y(e)).f);if(!t.splice){if((S=t).deps&&u(S.deps,S.callback),!e)return;e.splice?(t=e,e=n,n=null):t=f}return e=e||function(){},"function"==typeof n&&(n=i,i=r),i?o(f,t,e,n):setTimeout(function(){o(f,t,e,n)},4),u},u.config=function(t){return u(t)},r._defined=w,(h=function(t,e,n){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(n=e,e=[]),p(w,t)||p(_,t)||(_[t]=[t,e,n])}).amd={jQuery:!0}}(),t.requirejs=r,t.require=c,t.define=h),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(o){function h(t){var e=t.prototype,n=[];for(var i in e){"function"==typeof e[i]&&("constructor"!==i&&n.push(i))}return n}var r={Extend:function(t,e){function n(){this.constructor=t}var i={}.hasOwnProperty;for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},Decorate:function(i,r){function o(){var t=Array.prototype.unshift,e=r.prototype.constructor.length,n=i.prototype.constructor;0<e&&(t.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}function t(){this.constructor=o}var e=h(r),n=h(i);r.displayName=i.displayName,o.prototype=new t;for(var a=0;a<n.length;a++){var s=n[a];o.prototype[s]=i.prototype[s]}for(var l=function(t){var e=function(){};t in o.prototype&&(e=o.prototype[t]);var n=r.prototype[t];return function(){return Array.prototype.unshift.call(arguments,e),n.apply(this,arguments)}},u=0;u<e.length;u++){var c=e[u];o.prototype[c]=l(c)}return o}},t=function(){this.listeners={}};t.prototype.on=function(t,e){this.listeners=this.listeners||{},t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e]},t.prototype.trigger=function(t){var e=Array.prototype.slice,n=e.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=t)in this.listeners&&this.invoke(this.listeners[t],e.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},t.prototype.invoke=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n].apply(this,e)},r.Observable=t,r.generateChars=function(t){for(var e="",n=0;n<t;n++){e+=Math.floor(36*Math.random()).toString(36)}return e},r.bind=function(t,e){return function(){t.apply(e,arguments)}},r._convertData=function(t){for(var e in t){var n=e.split("-"),i=t;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=t[e]),i=i[o]}delete t[e]}}return t},r.hasScroll=function(t,e){var n=o(e),i=e.style.overflowX,r=e.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||(n.innerHeight()<e.scrollHeight||n.innerWidth()<e.scrollWidth))},r.escapeMarkup=function(t){var e={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},r.appendMany=function(t,e){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(e,function(t){n=n.add(t)}),e=n}t.append(e)},r.__cache={};var n=0;return r.GetUniqueElementId=function(t){var e=t.getAttribute("data-select2-id");return null==e&&(t.id?(e=t.id,t.setAttribute("data-select2-id",e)):(t.setAttribute("data-select2-id",++n),e=n.toString())),e},r.StoreData=function(t,e,n){var i=r.GetUniqueElementId(t);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][e]=n},r.GetData=function(t,e){var n=r.GetUniqueElementId(t);return e?r.__cache[n]&&null!=r.__cache[n][e]?r.__cache[n][e]:o(t).data(e):r.__cache[n]},r.RemoveData=function(t){var e=r.GetUniqueElementId(t);null!=r.__cache[e]&&delete r.__cache[e]},r}),t.define("select2/results",["jquery","./utils"],function(f,p){function i(t,e,n){this.$element=t,this.data=n,this.options=e,i.__super__.constructor.call(this)}return p.Extend(i,p.Observable),i.prototype.render=function(){var t=f('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(t){var e=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=f('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(t.message);n.append(e(i(t.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(t){this.hideLoading();var e=[];if(null!=t.results&&0!==t.results.length){t.results=this.sort(t.results);for(var n=0;n<t.results.length;n++){var i=t.results[n],r=this.option(i);e.push(r)}this.$results.append(e)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(t,e){e.find(".select2-results").append(t)},i.prototype.sort=function(t){return this.options.get("sorter")(t)},i.prototype.highlightFirstItem=function(){var t=this.$results.find(".select2-results__option[aria-selected]"),e=t.filter("[aria-selected=true]");0<e.length?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var e=this;this.data.current(function(t){var i=f.map(t,function(t){return t.id.toString()});e.$results.find(".select2-results__option[aria-selected]").each(function(){var t=f(this),e=p.GetData(this,"data"),n=""+e.id;null!=e.element&&e.element.selected||null==e.element&&-1<f.inArray(n,i)?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},i.prototype.showLoading=function(t){this.hideLoading();var e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(t)},n=this.option(e);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(t){var e=document.createElement("li");e.className="select2-results__option";var n={role:"treeitem","aria-selected":"false"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var r in(null!=t.element&&i.call(t.element,":disabled")||null==t.element&&t.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==t.id&&delete n["aria-selected"],null!=t._resultId&&(e.id=t._resultId),t.title&&(e.title=t.title),t.children&&(n.role="group",n["aria-label"]=t.text,delete n["aria-selected"]),n){var o=n[r];e.setAttribute(r,o)}if(t.children){var a=f(e),s=document.createElement("strong");s.className="select2-results__group";f(s);this.template(t,s);for(var l=[],u=0;u<t.children.length;u++){var c=t.children[u],h=this.option(c);l.push(h)}var d=f("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});d.append(l),a.append(s),a.append(d)}else this.template(t,e);return p.StoreData(e,"data",t),e},i.prototype.bind=function(e){var l=this,t=e.id+"-results";this.$results.attr("id",t),e.on("results:all",function(t){l.clear(),l.append(t.data),e.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),e.on("results:append",function(t){l.append(t.data),e.isOpen()&&l.setClasses()}),e.on("query",function(t){l.hideMessages(),l.showLoading(t)}),e.on("select",function(){e.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),e.on("unselect",function(){e.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),e.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),e.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=l.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t=l.getHighlightedResults();if(0!==t.length){var e=p.GetData(t[0],"data");"true"==t.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:e})}}),e.on("results:previous",function(){var t=l.getHighlightedResults(),e=l.$results.find("[aria-selected]"),n=e.index(t);if(!(n<=0)){var i=n-1;0===t.length&&(i=0);var r=e.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,a=r.offset().top,s=l.$results.scrollTop()+(a-o);0===i?l.$results.scrollTop(0):a-o<0&&l.$results.scrollTop(s)}}),e.on("results:next",function(){var t=l.getHighlightedResults(),e=l.$results.find("[aria-selected]"),n=e.index(t)+1;if(!(n>=e.length)){var i=e.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),a=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):r<o&&l.$results.scrollTop(a)}}),e.on("results:focus",function(t){t.element.addClass("select2-results__option--highlighted")}),e.on("results:message",function(t){l.displayMessage(t)}),f.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-e+t.deltaY,i=0<t.deltaY&&e-t.deltaY<=0,r=t.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):r&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var e=f(this),n=p.GetData(this,"data");"true"!==e.attr("aria-selected")?l.trigger("select",{originalEvent:t,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:t,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var t=p.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:f(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]").index(t),n=this.$results.offset().top,i=t.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*t.outerHeight(!1),e<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(t,e){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(t,e);null==r?e.style.display="none":"string"==typeof r?e.innerHTML=i(r):f(e).append(r)},i}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(t,e){this.$element=t,this.options=e,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var t=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t},o.prototype.bind=function(t){var e=this,n=(t.id,t.id+"-results");this.container=t,this.$selection.on("focus",function(t){e.trigger("focus",t)}),this.$selection.on("blur",function(t){e._handleBlur(t)}),this.$selection.on("keydown",function(t){e.trigger("keypress",t),t.which===r.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){e.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){e.update(t.data)}),t.on("open",function(){e.$selection.attr("aria-expanded","true"),e.$selection.attr("aria-owns",n),e._attachCloseHandler(t)}),t.on("close",function(){e.$selection.attr("aria-expanded","false"),e.$selection.removeAttr("aria-activedescendant"),e.$selection.removeAttr("aria-owns"),e.$selection.trigger("focus"),e._detachCloseHandler(t)}),t.on("enable",function(){e.$selection.attr("tabindex",e._tabindex)}),t.on("disable",function(){e.$selection.attr("tabindex","-1")})},o.prototype._handleBlur=function(t){var e=this;window.setTimeout(function(){document.activeElement==e.$selection[0]||n.contains(e.$selection[0],document.activeElement)||e.trigger("blur",t)},1)},o.prototype._attachCloseHandler=function(t){n(document.body).on("mousedown.select2."+t.id,function(t){var e=n(t.target).closest(".select2");n(".select2.select2-container--open").each(function(){n(this);this!=e[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(t){n(document.body).off("mousedown.select2."+t.id)},o.prototype.position=function(t,e){e.find(".selection").append(t)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},o}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(t,e,n){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,e),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),t},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(t){
|
|
1===t.which&&n.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),t.on("focus",function(){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},r.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},r.prototype.selectionContainer=function(){return t("<span></span>")},r.prototype.update=function(t){if(0!==t.length){var e=t[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(e,n);n.empty().append(i),n.attr("title",e.title||e.text)}else this.clear()},r}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,t,s){function n(t,e){n.__super__.constructor.apply(this,arguments)}return s.Extend(n,t),n.prototype.render=function(){var t=n.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('<ul class="select2-selection__rendered"></ul>'),t},n.prototype.bind=function(t,e){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){i.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){if(!i.options.get("disabled")){var e=r(this).parent(),n=s.GetData(e[0],"data");i.trigger("unselect",{originalEvent:t,data:n})}})},n.prototype.clear=function(){var t=this.$selection.find(".select2-selection__rendered");t.empty(),t.removeAttr("title")},n.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},n.prototype.selectionContainer=function(){return r('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=this.selectionContainer(),o=this.display(i,r);r.append(o),r.attr("title",i.title||i.text),s.StoreData(r[0],"data",i),e.push(r)}var a=this.$selection.find(".select2-selection__rendered");s.appendMany(a,e)}},n}),t.define("select2/selection/placeholder",["../utils"],function(){function t(t,e,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n)}return t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.createPlaceholder=function(t,e){var n=this.selectionContainer();return n.html(this.display(e)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(t,e){var n=1==e.length&&e[0].id!=this.placeholder.id;if(1<e.length||n)return t.call(this,e);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(r,i,s){function t(){}return t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(t){i._handleClear(t)}),e.on("keypress",function(t){i._handleKeyboardClear(t,e)})},t.prototype._handleClear=function(t,e){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){e.stopPropagation();var i=s.GetData(n[0],"data"),r=this.$element.val();this.$element.val(this.placeholder.id);var o={data:i};if(this.trigger("clear",o),o.prevented)this.$element.val(r);else{for(var a=0;a<i.length;a++)if(o={data:i[a]},this.trigger("unselect",o),o.prevented)return void this.$element.val(r);this.$element.trigger("change"),this.trigger("toggle",{})}}}},t.prototype._handleKeyboardClear=function(t,e,n){n.isOpen()||e.which!=i.DELETE&&e.which!=i.BACKSPACE||this._handleClear(e)},t.prototype.update=function(t,e){if(t.call(this,e),!(0<this.$selection.find(".select2-selection__placeholder").length||0===e.length)){var n=this.options.get("translations").get("removeAllItems"),i=r('<span class="select2-selection__clear" title="'+n()+'">×</span>');s.StoreData(i[0],"data",e),this.$selection.find(".select2-selection__rendered").prepend(i)}},t}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,s){function t(t,e,n){t.call(this,e,n)}return t.prototype.render=function(t){var e=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=e,this.$search=e.find("input");var n=t.call(this);return this._transferTabIndex(),n},t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("open",function(){i.$search.trigger("focus")}),e.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),e.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),e.on("disable",function(){i.$search.prop("disabled",!0)}),e.on("focus",function(){i.$search.trigger("focus")}),e.on("results:focus",function(t){i.$search.attr("aria-activedescendant",t.id)}),this.$selection.on("focusin",".select2-search--inline",function(t){i.trigger("focus",t)}),this.$selection.on("focusout",".select2-search--inline",function(t){i._handleBlur(t)}),this.$selection.on("keydown",".select2-search--inline",function(t){if(t.stopPropagation(),i.trigger("keypress",t),i._keyUpPrevented=t.isDefaultPrevented(),t.which===s.BACKSPACE&&""===i.$search.val()){var e=i.$searchContainer.prev(".select2-selection__choice");if(0<e.length){var n=a.GetData(e[0],"data");i.searchRemoveChoice(n),t.preventDefault()}}});var r=document.documentMode,o=r&&r<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(){o?i.$selection.off("input.search input.searchcheck"):i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(t){if(o&&"input"===t.type)i.$selection.off("input.search input.searchcheck");else{var e=t.which;e!=s.SHIFT&&e!=s.CTRL&&e!=s.ALT&&e!=s.TAB&&i.handleSearch(t)}})},t.prototype._transferTabIndex=function(){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},t.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},t.prototype.update=function(t,e){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},t.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},t.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";""!==this.$search.attr("placeholder")?t=this.$selection.find(".select2-selection__rendered").innerWidth():t=.75*(this.$search.val().length+1)+"em";this.$search.css("width",t)},t}),t.define("select2/selection/eventRelay",["jquery"],function(a){function t(){}return t.prototype.bind=function(t,e,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];t.call(this,e,n),e.on("*",function(t,e){if(-1!==a.inArray(t,r)){e=e||{};var n=a.Event("select2:"+t,{params:e});i.$element.trigger(n),-1!==a.inArray(t,o)&&(e.prevented=n.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,n){function i(t){this.dict=t||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(t){return this.dict[t]},i.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},i._cache={},i.loadPath=function(t){if(!(t in i._cache)){var e=n(t);i._cache[t]=e}return new i(i._cache[t])},i}),t.define("select2/diacritics",[],function(){return{"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u0152":"OE","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u0153":"oe","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03ce":"\u03c9","\u03c2":"\u03c3","\u2019":"'"}}),t.define("select2/data/base",["../utils"],function(i){function t(){t.__super__.constructor.call(this)}return i.Extend(t,i.Observable),t.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,e){var n=t.id+"-result-";return n+=i.generateChars(4),null!=e.id?n+="-"+e.id.toString():n+="-"+i.generateChars(4),n},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(t,s,l){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return s.Extend(n,t),n.prototype.current=function(t){var n=[],i=this;this.$element.find(":selected").each(function(){var t=l(this),e=i.item(t);n.push(e)}),t(n)},n.prototype.select=function(r){var o=this;if(r.selected=!0,l(r.element).is("option"))return r.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(t){var e=[];(r=[r]).push.apply(r,t);for(var n=0;n<r.length;n++){var i=r[n].id;-1===l.inArray(i,e)&&e.push(i)}o.$element.val(e),o.$element.trigger("change")});else{var t=r.id;this.$element.val(t),this.$element.trigger("change")}},n.prototype.unselect=function(r){var o=this;if(this.$element.prop("multiple")){if(r.selected=!1,l(r.element).is("option"))return r.element.selected=!1,void this.$element.trigger("change");this.current(function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n].id;i!==r.id&&-1===l.inArray(i,e)&&e.push(i)}o.$element.val(e),o.$element.trigger("change")})}},n.prototype.bind=function(t){var e=this;(this.container=t).on("select",function(t){e.select(t.data)}),t.on("unselect",function(t){e.unselect(t.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){s.RemoveData(this)})},n.prototype.query=function(i,t){var r=[],o=this;this.$element.children().each(function(){var t=l(this);if(t.is("option")||t.is("optgroup")){var e=o.item(t),n=o.matches(i,e);null!==n&&r.push(n)}}),t({results:r})},n.prototype.addOptions=function(t){s.appendMany(this.$element,t)},n.prototype.option=function(t){var e;t.children?(e=document.createElement("optgroup")).label=t.text:(e=document.createElement("option")).textContent!==undefined?e.textContent=t.text:e.innerText=t.text,t.id!==undefined&&(e.value=t.id),t.disabled&&(e.disabled=!0),t.selected&&(e.selected=!0),t.title&&(e.title=t.title);var n=l(e),i=this._normalizeItem(t);return i.element=e,s.StoreData(e,"data",i),n},n.prototype.item=function(t){var e={};if(null!=(e=s.GetData(t[0],"data")))return e;if(t.is("option"))e={id:t.val(),text:t.text(),disabled:t.prop("disabled"),selected:t.prop("selected"),title:t.prop("title")};else if(t.is("optgroup")){e={text:t.prop("label"),children:[],title:t.prop("title")};for(var n=t.children("option"),i=[],r=0;r<n.length;r++){var o=l(n[r]),a=this.item(o);i.push(a)}e.children=i}return(e=this._normalizeItem(e)).element=t[0],s.StoreData(t[0],"data",e),e},n.prototype._normalizeItem=function(t){t!==Object(t)&&(t={id:t,text:t});var e={selected:!1,disabled:!1};return null!=(t=l.extend({},{text:""},t)).id&&(t.id=t.id.toString()),null!=t.text&&(t.text=t.text.toString()),null==t._resultId&&t.id&&null!=this.container&&(t._resultId=this.generateResultId(this.container,t)),l.extend({},e,t)},n.prototype.matches=function(t,e){return this.options.get("matcher")(t,e)},n}),t.define("select2/data/array",["./select","../utils","jquery"],function(t,p,g){function i(t,e){var n=e.get("data")||[];i.__super__.constructor.call(this,t,e),this.addOptions(this.convertToOptions(n))}return p.Extend(i,t),i.prototype.select=function(n){var t=this.$element.find("option").filter(function(t,e){return e.value==n.id.toString()});0===t.length&&(t=this.option(n),this.addOptions(t)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(t){function e(t){return function(){return g(this).val()==t.id}}for(var n=this,i=this.$element.find("option"),r=i.map(function(){return n.item(g(this)).id}).get(),o=[],a=0;a<t.length;a++){var s=this._normalizeItem(t[a]);if(0<=g.inArray(s.id,r)){var l=i.filter(e(s)),u=this.item(l),c=g.extend(!0,{},s,u),h=this.option(c);l.replaceWith(h)}else{var d=this.option(s);if(s.children){var f=this.convertToOptions(s.children);p.appendMany(d,f)}o.push(d)}}return o},i}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(t,e,o){function n(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,t,e)}return e.Extend(n,t),n.prototype._applyDefaults=function(t){var e={data:function(t){return o.extend({},t,{q:t.term})},transport:function(t,e,n){var i=o.ajax(t);return i.then(e),i.fail(n),i}};return o.extend({},e,t,!0)},n.prototype.processResults=function(t){return t},n.prototype.query=function(n,i){function t(){var t=e.transport(e,function(t){var e=r.processResults(t,n);r.options.get("debug")&&window.console&&console.error&&(e&&e.results&&o.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(e)},function(){"status"in t&&(0===t.status||"0"===t.status)||r.trigger("results:message",{message:"errorLoading"})});r._request=t}var r=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var e=o.extend({type:"GET"},this.ajaxOptions);"function"==typeof e.url&&(e.url=e.url.call(this.$element,n)),"function"==typeof e.data&&(e.data=e.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(t,this.ajaxOptions.delay)):t()},n}),t.define("select2/data/tags",["jquery"],function(c){function t(t,e,n){var i=n.get("tags"),r=n.get("createTag");r!==undefined&&(this.createTag=r);var o=n.get("insertTag");if(o!==undefined&&(this.insertTag=o),t.call(this,e,n),c.isArray(i))for(var a=0;a<i.length;a++){var s=i[a],l=this._normalizeItem(s),u=this.option(l);this.$element.append(u)}}return t.prototype.query=function(t,l,u){function c(t,e){for(var n=t.results,i=0;i<n.length;i++){var r=n[i],o=null!=r.children&&!c({results:r.children},!0);if((r.text||"").toUpperCase()===(l.term||"").toUpperCase()||o)return!e&&(t.data=n,void u(t))}if(e)return!0;var a=h.createTag(l);if(null!=a){var s=h.option(a);s.attr("data-select2-tag",!0),h.addOptions([s]),h.insertTag(n,a)}t.results=n,u(t)}var h=this;this._removeOldTags(),null!=l.term&&null==l.page?t.call(this,l,c):t.call(this,l,u)},t.prototype.createTag=function(t,e){var n=c.trim(e.term);return""===n?null:{id:n,text:n}},t.prototype.insertTag=function(t,e,n){e.unshift(n)},t.prototype._removeOldTags=function(){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||c(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(h){function t(t,e,n){var i=n.get("tokenizer");i!==undefined&&(this.tokenizer=i),t.call(this,e,n)}return t.prototype.bind=function(t,e,n){t.call(this,e,n),this.$search=e.dropdown.$search||e.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,e,n){function i(t){var e=o._normalizeItem(t);if(!o.$element.find("option").filter(function(){return h(this).val()===e.id}).length){var n=o.option(e);n.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([n])}r(e)}function r(t){o.trigger("select",{data:t})}var o=this;e.term=e.term||"";var a=this.tokenizer(e,this.options,i);a.term!==e.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.trigger("focus")),e.term=a.term),t.call(this,e,n)},t.prototype.tokenizer=function(t,e,n,i){for(var r=n.get("tokenSeparators")||[],o=e.term,a=0,s=this.createTag||function(t){return{id:t.term,text:t.term}};a<o.length;){var l=o[a];if(-1!==h.inArray(l,r)){var u=o.substr(0,a),c=s(h.extend({},e,{term:u}));null!=c?(i(c),o=o.substr(a+1)||"",a=0):a++}else a++}return{term:o}},t}),t.define("select2/data/minimumInputLength",[],function(){function t(t,e,n){this.minimumInputLength=n.get("minimumInputLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){e.term=e.term||"",e.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:e.term,params:e}}):t.call(this,e,n)},t}),t.define("select2/data/maximumInputLength",[],function(){function t(t,e,n){this.maximumInputLength=n.get("maximumInputLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){e.term=e.term||"",0<this.maximumInputLength&&e.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):t.call(this,e,n)},t}),t.define("select2/data/maximumSelectionLength",[],function(){function t(t,e,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),t.call(this,e,n)}return t.prototype.query=function(n,i,r){var o=this;this.current(function(t){var e=null!=t?t.length:0;0<o.maximumSelectionLength&&e>=o.maximumSelectionLength?o.trigger("results:message",{message:"maximumSelected",args:{maximum:o.maximumSelectionLength}}):n.call(o,i,r)})},t}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t},n.prototype.bind=function(){},n.prototype.position=function(){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(r){function t(){}return t.prototype.render=function(t){var e=t.call(this),n=r('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),e.prepend(n),e},t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),this.$search.on("keydown",function(t){i.trigger("keypress",t),i._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(){r(this).off("keyup")}),this.$search.on("keyup input",function(t){i.handleSearch(t)}),e.on("open",function(){i.$search.attr("tabindex",0),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),e.on("close",function(){i.$search.attr("tabindex",-1),i.$search.val(""),i.$search.trigger("blur")}),e.on("focus",function(){e.isOpen()||i.$search.trigger("focus")}),e.on("results:all",function(t){null!=t.query.term&&""!==t.query.term||(i.showSearch(t)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))})},t.prototype.handleSearch=function(){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(){return!0},t}),t.define("select2/dropdown/hidePlaceholder",[],function(){function t(t,e,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n,i)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var n=e.slice(0),i=e.length-1;0<=i;i--){var r=e[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},t}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function t(t,e,n,i){this.lastParams={},t.call(this,e,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("query",function(t){i.lastParams=t,i.loading=!0}),e.on("query:append",function(t){i.lastParams=t,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&t){var e=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore()}},t.prototype.loadMore=function(){this.loading=!0;var t=n.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},t.prototype.createLoadingMore=function(){var t=n('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),e=this.options.get("translations").get("loadingMore");return t.html(e(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,s){function t(t,e,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),t.call(this,e,n)}return t.prototype.bind=function(t,e,n){var i=this,r=!1;t.call(this,e,n),e.on("open",function(){i._showDropdown(),i._attachPositioningHandler(e),r||(r=!0,
|
|
e.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),e.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},t.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},t.prototype.position=function(t,e,n){e.attr("class",n.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=n},t.prototype.render=function(t){var e=f("<span></span>"),n=t.call(this);return e.append(n),this.$dropdownContainer=e},t.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},t.prototype._attachPositioningHandler=function(t,e){var n=this,i="scroll.select2."+e.id,r="resize.select2."+e.id,o="orientationchange.select2."+e.id,a=this.$container.parents().filter(s.hasScroll);a.each(function(){s.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),a.on(i,function(){var t=s.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(){n._positionDropdown(),n._resizeDropdown()})},t.prototype._detachPositioningHandler=function(t,e){var n="scroll.select2."+e.id,i="resize.select2."+e.id,r="orientationchange.select2."+e.id;this.$container.parents().filter(s.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},t.prototype._positionDropdown=function(){var t=f(window),e=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var a={height:this.$dropdown.outerHeight(!1)},s={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},l=s.top<r.top-a.height,u=s.bottom>r.bottom+a.height,c={left:r.left,top:o.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var d=h.offset();c.top-=d.top,c.left-=d.left,e||n||(i="below"),u||!l||e?!l&&u&&e&&(i="below"):i="above",("above"==i||e&&"below"!==i)&&(c.top=o.top-d.top-a.height),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(c)},t.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},t.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},t}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function r(t){for(var e=0,n=0;n<t.length;n++){var i=t[n];i.children?e+=r(i.children):e++}return e}function t(t,e,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),t.call(this,e,n,i)}return t.prototype.showSearch=function(t,e){return!(r(e.data.results)<this.minimumResultsForSearch)&&t.call(this,e)},t}),t.define("select2/dropdown/selectOnClose",["../utils"],function(o){function t(){}return t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("close",function(t){i._handleSelectOnClose(t)})},t.prototype._handleSelectOnClose=function(t,e){if(e&&null!=e.originalSelect2Event){var n=e.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=o.GetData(i[0],"data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},t}),t.define("select2/dropdown/closeOnSelect",[],function(){function t(){}return t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("select",function(t){i._selectTriggered(t)}),e.on("unselect",function(t){i._selectTriggered(t)})},t.prototype._selectTriggered=function(t,e){var n=e.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:e})},t}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var e=t.input.length-t.maximum,n="Please delete "+e+" character";return 1!=e&&(n+="s"),n},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results\u2026"},maximumSelected:function(t){var e="You can only select "+t.maximum+" item";return 1!=t.maximum&&(e+="s"),e},noResults:function(){return"No results found"},searching:function(){return"Searching\u2026"},removeAllItems:function(){return"Remove all items"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(m,v,y,x,b,w,_,S,C,T,A,n,D,M,I,k,E,L,O,P,N,R,F,z,H,B,V,j,t){function e(){this.reset()}return e.prototype.apply=function(t){if(null==(t=m.extend(!0,{},this.defaults,t)).dataAdapter){if(null!=t.ajax?t.dataAdapter=I:null!=t.data?t.dataAdapter=M:t.dataAdapter=D,0<t.minimumInputLength&&(t.dataAdapter=T.Decorate(t.dataAdapter,L)),0<t.maximumInputLength&&(t.dataAdapter=T.Decorate(t.dataAdapter,O)),0<t.maximumSelectionLength&&(t.dataAdapter=T.Decorate(t.dataAdapter,P)),t.tags&&(t.dataAdapter=T.Decorate(t.dataAdapter,k)),null==t.tokenSeparators&&null==t.tokenizer||(t.dataAdapter=T.Decorate(t.dataAdapter,E)),null!=t.query){var e=v(t.amdBase+"compat/query");t.dataAdapter=T.Decorate(t.dataAdapter,e)}if(null!=t.initSelection){var n=v(t.amdBase+"compat/initSelection");t.dataAdapter=T.Decorate(t.dataAdapter,n)}}if(null==t.resultsAdapter&&(t.resultsAdapter=y,null!=t.ajax&&(t.resultsAdapter=T.Decorate(t.resultsAdapter,z)),null!=t.placeholder&&(t.resultsAdapter=T.Decorate(t.resultsAdapter,F)),t.selectOnClose&&(t.resultsAdapter=T.Decorate(t.resultsAdapter,V))),null==t.dropdownAdapter){if(t.multiple)t.dropdownAdapter=N;else{var i=T.Decorate(N,R);t.dropdownAdapter=i}if(0!==t.minimumResultsForSearch&&(t.dropdownAdapter=T.Decorate(t.dropdownAdapter,B)),t.closeOnSelect&&(t.dropdownAdapter=T.Decorate(t.dropdownAdapter,j)),null!=t.dropdownCssClass||null!=t.dropdownCss||null!=t.adaptDropdownCssClass){var r=v(t.amdBase+"compat/dropdownCss");t.dropdownAdapter=T.Decorate(t.dropdownAdapter,r)}t.dropdownAdapter=T.Decorate(t.dropdownAdapter,H)}if(null==t.selectionAdapter){if(t.multiple?t.selectionAdapter=b:t.selectionAdapter=x,null!=t.placeholder&&(t.selectionAdapter=T.Decorate(t.selectionAdapter,w)),t.allowClear&&(t.selectionAdapter=T.Decorate(t.selectionAdapter,_)),t.multiple&&(t.selectionAdapter=T.Decorate(t.selectionAdapter,S)),null!=t.containerCssClass||null!=t.containerCss||null!=t.adaptContainerCssClass){var o=v(t.amdBase+"compat/containerCss");t.selectionAdapter=T.Decorate(t.selectionAdapter,o)}t.selectionAdapter=T.Decorate(t.selectionAdapter,C)}if("string"==typeof t.language)if(0<t.language.indexOf("-")){var a=t.language.split("-")[0];t.language=[t.language,a]}else t.language=[t.language];if(m.isArray(t.language)){var s=new A;t.language.push("en");for(var l=t.language,u=0;u<l.length;u++){var c=l[u],h={};try{h=A.loadPath(c)}catch(p){try{c=this.defaults.amdLanguageBase+c,h=A.loadPath(c)}catch(g){t.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+c+'" could not be automatically loaded. A fallback will be used instead.');continue}}s.extend(h)}t.translations=s}else{var d=A.loadPath(this.defaults.amdLanguageBase+"en"),f=new A(t.language);f.extend(d),t.translations=f}return t},e.prototype.reset=function(){function a(t){function e(t){return n[t]||t}return t.replace(/[^\u0000-\u007E]/g,e)}function s(t,e){if(""===m.trim(t.term))return e;if(e.children&&0<e.children.length){for(var n=m.extend(!0,{},e),i=e.children.length-1;0<=i;i--){null==s(t,e.children[i])&&n.children.splice(i,1)}return 0<n.children.length?n:s(t,n)}var r=a(e.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:T.escapeMarkup,language:t,matcher:s,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},e.prototype.set=function(t,e){var n={};n[m.camelCase(t)]=e;var i=T._convertData(n);m.extend(!0,this.defaults,i)},new e}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(i,h,r,d){function t(t,e){if(this.options=t,null!=e&&this.fromElement(e),this.options=r.apply(this.options),e&&e.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,n)}}return t.prototype.fromElement=function(t){function e(t,e){return e.toUpperCase()}var n=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.language&&(t.prop("lang")?this.options.language=t.prop("lang").toLowerCase():t.closest("[lang]").prop("lang")&&(this.options.language=t.closest("[lang]").prop("lang"))),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),d.GetData(t[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(t[0],"data",d.GetData(t[0],"select2Tags")),d.StoreData(t[0],"tags",!0)),d.GetData(t[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",d.GetData(t[0],"ajaxUrl")),d.StoreData(t[0],"ajax-Url",d.GetData(t[0],"ajaxUrl")));for(var i={},r=0;r<t[0].attributes.length;r++){var o=t[0].attributes[r].name,a="data-";if(o.substr(0,a.length)==a){var s=o.substring(a.length),l=d.GetData(t[0],s);i[s.replace(/-([a-z])/g,e)]=l}}h.fn.jquery&&"1."==h.fn.jquery.substr(0,2)&&t[0].dataset&&(i=h.extend(!0,{},t[0].dataset,i));var u=h.extend(!0,{},d.GetData(t[0]),i);for(var c in u=d._convertData(u))-1<h.inArray(c,n)||(h.isPlainObject(this.options[c])?h.extend(this.options[c],u[c]):this.options[c]=u[c]);return this},t.prototype.get=function(t){return this.options[t]},t.prototype.set=function(t,e){this.options[t]=e},t}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(r,u,c,i){var h=function(t,e){null!=c.GetData(t[0],"select2")&&c.GetData(t[0],"select2").destroy(),this.$element=t,this.id=this._generateId(t),e=e||{},this.options=new u(e,t),h.__super__.constructor.call(this);var n=t.attr("tabindex")||0;c.StoreData(t[0],"old-tabindex",n),t.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(t,this.options);var r=this.render();this._placeContainer(r);var o=this.options.get("selectionAdapter");this.selection=new o(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var a=this.options.get("dropdownAdapter");this.dropdown=new a(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var s=this.options.get("resultsAdapter");this.results=new s(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){l.trigger("selection:update",{data:t})}),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(t[0],"select2",this),t.data("select2",this)};return c.Extend(h,c.Observable),h.prototype._generateId=function(t){return"select2-"+(null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+c.generateChars(2):c.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},h.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},h.prototype._resolveWidth=function(t,e){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var i=this._resolveWidth(t,"style");return null!=i?i:this._resolveWidth(t,"element")}if("element"==e){var r=t.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"!=e)return"computedstyle"!=e?e:window.getComputedStyle(t[0]).width;var o=t.attr("style");if("string"!=typeof o)return null;for(var a=o.split(";"),s=0,l=a.length;s<l;s+=1){var u=a[s].replace(/\s/g,"").match(n);if(null!==u&&1<=u.length)return u[1]}return null},h.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},h.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2",function(t){e.trigger("focus",t)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=t?(this._observer=new t(function(t){r.each(t,e._syncA),r.each(t,e._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},h.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(t,e){n.trigger(t,e)})},h.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(t){n.focus(t)}),this.selection.on("*",function(t,e){-1===r.inArray(t,i)&&n.trigger(t,e)})},h.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(t,e){n.trigger(t,e)})},h.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(t,e){n.trigger(t,e)})},h.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(e){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(e,function(t){n.trigger("results:all",{data:t,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(t){n.trigger("results:append",{data:t,query:e})})}),this.on("keypress",function(t){var e=t.which;n.isOpen()?e===i.ESC||e===i.TAB||e===i.UP&&t.altKey?(n.close(),t.preventDefault()):e===i.ENTER?(n.trigger("results:select",{}),t.preventDefault()):e===i.SPACE&&t.ctrlKey?(n.trigger("results:toggle",{}),t.preventDefault()):e===i.UP?(n.trigger("results:previous",{}),t.preventDefault()):e===i.DOWN&&(n.trigger("results:next",{}),t.preventDefault()):(e===i.ENTER||e===i.SPACE||e===i.DOWN&&t.altKey)&&(n.open(),t.preventDefault())})},h.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},h.prototype._syncSubtree=function(t,e){var n=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&0<e.addedNodes.length)for(var r=0;r<e.addedNodes.length;r++){e.addedNodes[r].selected&&(n=!0)}else e.removedNodes&&0<e.removedNodes.length&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(t){i.trigger("selection:update",{data:t})})}},h.prototype.trigger=function(t,e){var n=h.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(e===undefined&&(e={}),t in i){var r=i[t],o={prevented:!1,name:t,args:e};if(n.call(this,r,o),o.prevented)return void(e.prevented=!0)}n.call(this,t,e)},h.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},h.prototype.open=function(){this.isOpen()||this.trigger("query",{})},h.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},h.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},h.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},h.prototype.focus=function(){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},h.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=t&&0!==t.length||(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},h.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},h.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var e=t[0];r.isArray(e)&&(e=r.map(e,function(t){return t.toString()})),this.$element.val(e).trigger("change")},h.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},h.prototype.render=function(){var t=r('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(t[0],"element",this.$element),t},h}),t.define("jquery-mousewheel",["jquery"],function(t){return t}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,t,o,e,a){if(null==r.fn.select2){var s=["open","close","destroy"];r.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each(function(){var t=r.extend(!0,{},e);new o(r(this),t)}),this;if("string"!=typeof e)throw new Error("Invalid arguments for Select2: "+e);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=a.GetData(this,"select2");null==t&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),n=t[e].apply(t,i)}),-1<r.inArray(e,s)?this:n}}return null==r.fn.select2.defaults&&(r.fn.select2.defaults=e),o}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(window.jQuery||window.Zepto||window.$)}(function(f){var p=function(){for(var t,e,n,i=0,r=arguments.length;i<r;i++)p.isJquery(arguments[i])||p.isZepto(arguments[i])?t=arguments[i]:p.isElement(arguments[i])?t=f(arguments[i]):"function"==typeof arguments[i]?n=arguments[i]:"object"==typeof arguments[i]&&(e=arguments[i]);var o=new p.init(t,e);return"function"==typeof n&&n(o),o};p.isElement=function(t){return!(!t||"function"!=typeof HTMLElement&&"object"!=typeof HTMLElement||!(t instanceof HTMLElement))||!(!t||!t.nodeType||1!==t.nodeType)},p.isJquery=function(t){return!!(t&&t.length&&("function"==typeof jQuery||"object"==typeof jQuery)&&t instanceof jQuery)},p.isZepto=function(t){return!(!t||!t.length||"function"!=typeof Zepto&&"object"!=typeof Zepto||!Zepto.zepto.isZ(t))},p.getIndex=function(t,e){return e?t:t-1},p.getData=function(t,e){if("string"==typeof e&&e.length)for(var n=0,i=(e=e.split(".")).length;n<i;n++)t=t[e[n]];return t},p.init=function(t,e){var n=this;if(p.isJquery(t)||p.isZepto(t)){var i={dom:{box:t}};n.attach=p.attach.bind(i),n.detach=p.detach.bind(i),n.setOptions=p.setOptions.bind(i),n.clear=p.clear.bind(i),i.changeEvent=function(){p.selectChange.call(i,this.className)},i.settings=f.extend({},f.cxSelect.defaults,e,{url:i.dom.box.data("url"),emptyStyle:i.dom.box.data("emptyStyle"),required:i.dom.box.data("required"),firstTitle:i.dom.box.data("firstTitle"),firstValue:i.dom.box.data("firstValue"),jsonSpace:i.dom.box.data("jsonSpace"),jsonName:i.dom.box.data("jsonName"),jsonValue:i.dom.box.data("jsonValue"),jsonSub:i.dom.box.data("jsonSub")});var r=i.dom.box.data("selects");"string"==typeof r&&r.length&&(i.settings.selects=r.split(",")),n.setOptions(),n.attach(),i.settings.url||i.settings.data?f.isArray(i.settings.data)?p.start.call(i,i.settings.data):"string"==typeof i.settings.url&&i.settings.url.length&&f.getJSON(i.settings.url,function(t){p.start.call(i,t)}):p.start.apply(i)}},p.setOptions=function(t){var e=this;if(t&&f.extend(e.settings,t),(!f.isArray(e.selectArray)||!e.selectArray.length||t&&t.selects)&&(e.selectArray=[],f.isArray(e.settings.selects)&&e.settings.selects.length))for(var n,i=0,r=e.settings.selects.length;i<r&&((n=e.dom.box.find("select."+e.settings.selects[i]))&&n.length);i++)e.selectArray.push(n);t&&(!f.isArray(t.data)&&"string"==typeof t.url&&t.url.length?f.getJSON(e.settings.url,function(t){p.start.call(e,t)}):p.start.call(e,t.data))},p.attach=function(){var t=this;t.attachStatus||t.dom.box.on("change","select",t.changeEvent),"boolean"==typeof t.attachStatus&&p.start.call(t),t.attachStatus=!0},p.detach=function(){var t=this;t.dom.box.off("change","select",t.changeEvent),t.attachStatus=!1},p.clear=function(t){for(var e=this,n={display:"",visibility:""},i=t=isNaN(t)?0:t,r=e.selectArray.length;i<r;i++)e.selectArray[i].empty().prop("disabled",!0),"none"===e.settings.emptyStyle?n.display="none":"hidden"===e.settings.emptyStyle&&(n.visibility="hidden"),e.selectArray[i].css(n)},p.start=function(t){var e=this;if(f.isArray(t)&&(e.settings.data=p.getData(t,e.settings.jsonSpace)),e.selectArray.length){for(var n=0,i=e.selectArray.length;n<i;n++)"string"!=typeof e.selectArray[n].attr("data-value")&&e.selectArray[n][0].options.length&&e.selectArray[n].attr("data-value",e.selectArray[n].val());e.settings.data||"string"==typeof e.selectArray[0].data("url")&&e.selectArray[0].data("url").length?p.getOptionData.call(e,0):e.selectArray[0].prop("disabled",!1).css({display:"",visibility:""})}},p.getOptionData=function(e){var n=this;if(!("number"!=typeof e||isNaN(e)||e<0||e>=n.selectArray.length)){var i,t,r,o,a,s=n.selectArray[e],l=s.data("url"),u=void 0===s.data("jsonSpace")?n.settings.jsonSpace:s.data("jsonSpace"),c={};if(p.clear.call(n,e),"string"==typeof l&&l.length){if(0<e)for(var h=0,d=1;h<e;h++,d++)r=n.selectArray[d].data("queryName"),o=n.selectArray[h].attr("name"),a=n.selectArray[h].val(),"string"==typeof r&&r.length?c[r]=a:"string"==typeof o&&o.length&&(c[o]=a);f.getJSON(l,c,function(t){i=p.getData(t,u),p.buildOption.call(n,e,i)})}else if(n.settings.data&&"object"==typeof n.settings.data){i=n.settings.data;for(h=0;h<e;h++){if(t=p.getIndex(n.selectArray[h][0].selectedIndex,"boolean"==typeof n.selectArray[h].data("required")?n.selectArray[h].data("required"):n.settings.required),"object"!=typeof i[t]||!f.isArray(i[t][n.settings.jsonSub])||!i[t][n.settings.jsonSub].length){i=null;break}i=i[t][n.settings.jsonSub]}p.buildOption.call(n,e,i)}}},p.buildOption=function(t,e){var n=this,i=n.selectArray[t],r="boolean"==typeof i.data("required")?i.data("required"):n.settings.required,o=void 0===i.data("firstTitle")?n.settings.firstTitle:i.data("firstTitle"),a=void 0===i.data("firstValue")?n.settings.firstValue:i.data("firstValue"),s=void 0===i.data("jsonName")?n.settings.jsonName:i.data("jsonName"),l=void 0===i.data("jsonValue")?n.settings.jsonValue:i.data("jsonValue");if(f.isArray(e)){var u=r?"":'<option value="'+String(a)+'">'+String(o)+"</option>";if("string"==typeof s&&s.length){"string"==typeof l&&l.length||(l=s);for(var c=0,h=e.length;c<h;c++)u+='<option value="'+String(e[c][l])+'">'+String(e[c][s])+"</option>"}else for(c=0,h=e.length;c<h;c++)u+='<option value="'+String(e[c])+'">'+String(e[c])+"</option>";i.html(u).prop("disabled",!1).css({display:"",visibility:""}),"string"==typeof i.attr("data-value")&&(i.val(String(i.attr("data-value"))).removeAttr("data-value"),i[0].selectedIndex<0&&(i[0].options[0].selected=!0)),(r||0<i[0].selectedIndex)&&i.trigger("change")}},p.selectChange=function(t){var e=this;if("string"==typeof t&&t.length){var n;t=","+(t=t.replace(/\s+/g,","))+",";for(var i=0,r=e.selectArray.length;i<r;i++)if(-1<t.indexOf(","+e.settings.selects[i]+",")){n=i;break}"number"==typeof n&&-1<n&&(n+=1,p.getOptionData.call(e,n))}},f.cxSelect=function(){return p.apply(this,arguments)},f.cxSelect.defaults={selects:[],url:null,data:null,emptyStyle:null,required:!1,firstTitle:"\u8bf7\u9009\u62e9",firstValue:"",jsonSpace:"",jsonName:"n",jsonValue:"",jsonSub:"s"},f.fn.cxSelect=function(t,e){return this.each(function(){f.cxSelect(this,t,e)}),this}}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(M,I){function k(){return new Date(Date.UTC.apply(Date,arguments))}function E(){var t=new Date;return k(t.getFullYear(),t.getMonth(),t.getDate())}function o(t,e){return t.getUTCFullYear()===e.getUTCFullYear()&&t.getUTCMonth()===e.getUTCMonth()&&t.getUTCDate()===e.getUTCDate()}function t(t,e){return function(){return e!==I&&M.fn.datepicker.deprecated(e),this[t].apply(this,arguments)}}function u(t){return t&&!isNaN(t.getTime())}function c(t,e){function n(t,e){return e.toLowerCase()}var i=M(t).data(),r={},o=new RegExp("^"+e.toLowerCase()+"([A-Z])");for(var a in e=new RegExp("^"+e.toLowerCase()),i)e.test(a)&&(r[a.replace(o,n)]=i[a]);return r}function h(t){var n={};if(L[t]||(t=t.split("-")[0],L[t])){var i=L[t];return M.each(a,function(t,e){e in i&&(n[e]=i[e])}),n}}var e,n=(e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),n=0,i=this.length;n<i;n++)if(0<=this[n].valueOf()-e&&this[n].valueOf()-e<864e5)return n;return-1},remove:function(t){this.splice(t,1)},replace:function(t){t&&(M.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.length=0},copy:function(){var t=new n;return t.replace(this),t}},function(){var t=[];return t.push.apply(t,arguments),M.extend(t,e),t}),_=function(t,e){M.data(t,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(e),this.dates=new n,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=M(t),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=M(O.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(t,e){return Number(e)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};_.prototype={constructor:_,_resolveViewName:function(n){return M.each(O.viewModes,function(t,e){if(n===t||-1!==M.inArray(n,e.names))return n=t,!1}),n},_resolveDaysOfWeek:function(t){return M.isArray(t)||(t=t.split(/[,\s]*/)),M.map(t,Number)},_check_template:function(t){try{return t!==I&&""!==t&&((t.match(/[<>]/g)||[]).length<=0||0<M(t).length)}catch(e){return!1}},_process_options:function(t){this._o=M.extend({},this._o,t);var e=this.o=M.extend({},this._o),n=e.language;L[n]||(n=n.split("-")[0],L[n]||(n=f.language)),e.language=n,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var i=O.parseFormat(e.format);e.startDate!==-Infinity&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=O.parseDate(e.startDate,i,e.language,e.assumeNearbyYear):e.startDate=-Infinity),e.endDate!==Infinity&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=O.parseDate(e.endDate,i,e.language,e.assumeNearbyYear):e.endDate=Infinity),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],M.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=M.map(e.datesDisabled,function(t){return O.parseDate(t,i,e.language,e.assumeNearbyYear)});var r=String(e.orientation).toLowerCase().split(/\s+/g),o=e.orientation.toLowerCase();if(r=M.grep(r,function(t){return/^auto|left|right|top|bottom$/.test(t)}),e.orientation={x:"auto",y:"auto"},o&&"auto"!==o)if(1===r.length)switch(r[0]){case"top":case"bottom":e.orientation.y=r[0];break;case"left":case"right":e.orientation.x=r[0]
|
|
}else o=M.grep(r,function(t){return/^left|right$/.test(t)}),e.orientation.x=o[0]||"auto",o=M.grep(r,function(t){return/^top|bottom$/.test(t)}),e.orientation.y=o[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=O.parseDate(e.defaultViewDate,i,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var a=e.defaultViewDate.year||(new Date).getFullYear(),s=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=k(a,s,l)}else e.defaultViewDate=E()},_applyEvents:function(t){for(var e,n,i,r=0;r<t.length;r++)e=t[r][0],2===t[r].length?(n=I,i=t[r][1]):3===t[r].length&&(n=t[r][1],i=t[r][2]),e.on(i,n)},_unapplyEvents:function(t){for(var e,n,i,r=0;r<t.length;r++)e=t[r][0],2===t[r].length?(i=I,n=t[r][1]):3===t[r].length&&(i=t[r][1],n=t[r][2]),e.off(n,i)},_buildEvents:function(){var t={keyup:M.proxy(function(t){-1===M.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:M.proxy(this.keydown,this),paste:M.proxy(this.paste,this)};!0===this.o.showOnFocus&&(t.focus=M.proxy(this.show,this)),this.isInput?this._events=[[this.element,t]]:this.component&&this.inputField.length?this._events=[[this.inputField,t],[this.component,{click:M.proxy(this.show,this)}]]:this._events=[[this.element,{click:M.proxy(this.show,this),keydown:M.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:M.proxy(function(t){this._focused_from=t.target},this)}],[this.element,{blur:M.proxy(function(t){this._focused_from=t.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":M.proxy(function(t){this.update(t.date)},this)}]),this._secondaryEvents=[[this.picker,{click:M.proxy(this.click,this)}],[this.picker,".prev, .next",{click:M.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:M.proxy(this.dayCellClick,this)}],[M(window),{resize:M.proxy(this.place,this)}],[M(document),{"mousedown touchstart":M.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,e){var n=e||this.dates.get(-1),i=this._utc_to_local(n);this.element.trigger({type:t,date:i,viewMode:this.viewMode,dates:M.map(this.dates,this._utc_to_local),format:M.proxy(function(t,e){0===arguments.length?(t=this.dates.length-1,e=this.o.format):"string"==typeof t&&(e=t,t=this.dates.length-1),e=e||this.o.format;var n=this.dates.get(t);return O.formatDate(n,e,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&M(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")||(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide")),this},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(t){var e;if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.types&&-1!==M.inArray("text/plain",t.originalEvent.clipboardData.types))e=t.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;e=window.clipboardData.getData("Text")}this.setDate(e),this.update(),t.preventDefault()},_utc_to_local:function(t){if(!t)return t;var e=new Date(t.getTime()+6e4*t.getTimezoneOffset());return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=new Date(t.getTime()+6e4*e.getTimezoneOffset())),e},_local_to_utc:function(t){return t&&new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return t&&new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return t&&k(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},getDates:function(){return M.map(this.dates,this._utc_to_local)},getUTCDates:function(){return M.map(this.dates,function(t){return new Date(t)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var t=this.dates.get(-1);return t!==I?new Date(t):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(t){var e=M.isArray(t)?t:arguments;return this.update.apply(this,e),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(t){var e=M.isArray(t)?t:arguments;return this.setDates.apply(this,M.map(e,this._utc_to_local)),this},setDate:t("setDates"),setUTCDate:t("setUTCDates"),remove:t("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var t=this.getFormattedDate();return this.inputField.val(t),this},getFormattedDate:function(e){e===I&&(e=this.o.format);var n=this.o.language;return M.map(this.dates,function(t){return O.formatDate(t,e,n)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(t){return this._process_options({startDate:t}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(t){return this._process_options({endDate:t}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(t){return this._process_options({daysOfWeekDisabled:t}),this.update(),this},setDaysOfWeekHighlighted:function(t){return this._process_options({daysOfWeekHighlighted:t}),this.update(),this},setDatesDisabled:function(t){return this._process_options({datesDisabled:t}),this.update(),this},place:function(){if(this.isInline)return this;var t=this.picker.outerWidth(),e=this.picker.outerHeight(),n=10,i=M(this.o.container),r=i.width(),o="body"===this.o.container?M(document).scrollTop():i.scrollTop(),a=i.offset(),s=[0];this.element.parents().each(function(){var t=M(this).css("z-index");"auto"!==t&&0!==Number(t)&&s.push(Number(t))});var l=Math.max.apply(Math,s)+this.o.zIndexOffset,u=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),h=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),d=u.left-a.left,f=u.top-a.top;"body"!==this.o.container&&(f+=o),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(d-=t-h)):u.left<0?(this.picker.addClass("datepicker-orient-left"),d-=u.left-n):r<d+t?(this.picker.addClass("datepicker-orient-right"),d+=h-t):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p=this.o.orientation.y;if("auto"===p&&(p=-o+f-e<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?f-=e+parseInt(this.picker.css("padding-top")):f+=c,this.o.rtl){var g=r-(d+h);this.picker.css({top:f,right:g,zIndex:l})}else this.picker.css({top:f,left:d,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var t=this.dates.copy(),n=[],e=!1;return arguments.length?(M.each(arguments,M.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),n.push(e)},this)),e=!0):(n=(n=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?n.split(this.o.multidateSeparator):[n],delete this.element.data().date),n=M.map(n,M.proxy(function(t){return O.parseDate(t,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),n=M.grep(n,M.proxy(function(t){return!this.dateWithinRange(t)||!t},this),!0),this.dates.replace(n),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),e?(this.setValue(),this.element.change()):this.dates.length&&String(t)!==String(this.dates)&&e&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&t.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var t=this.o.weekStart,e="<tr>";for(this.o.calendarWeeks&&(e+='<th class="cw"> </th>');t<this.o.weekStart+7;)e+='<th class="dow',-1!==M.inArray(t,this.o.daysOfWeekDisabled)&&(e+=" disabled"),e+='">'+L[this.o.language].daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datepicker-days thead").append(e)}},fillMonths:function(){for(var t=this._utc_to_local(this.viewDate),e="",n=0;n<12;n++)e+='<span class="month'+(t&&t.getMonth()===n?" focused":"")+'">'+L[this.o.language].monthsShort[n]+"</span>";this.picker.find(".datepicker-months td").html(e)},setRange:function(t){t&&t.length?this.range=M.map(t,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(t){var e=[],n=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),r=E();return t.getUTCFullYear()<n||t.getUTCFullYear()===n&&t.getUTCMonth()<i?e.push("old"):(t.getUTCFullYear()>n||t.getUTCFullYear()===n&&t.getUTCMonth()>i)&&e.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&e.push("focused"),this.o.todayHighlight&&o(t,r)&&e.push("today"),-1!==this.dates.contains(t)&&e.push("active"),this.dateWithinRange(t)||e.push("disabled"),this.dateIsDisabled(t)&&e.push("disabled","disabled-date"),-1!==M.inArray(t.getUTCDay(),this.o.daysOfWeekHighlighted)&&e.push("highlighted"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&e.push("range"),-1!==M.inArray(t.valueOf(),this.range)&&e.push("selected"),t.valueOf()===this.range[0]&&e.push("range-start"),t.valueOf()===this.range[this.range.length-1]&&e.push("range-end")),e},_fill_yearsView:function(t,e,n,i,r,o,a){for(var s,l,u,c="",h=n/10,d=this.picker.find(t),f=Math.floor(i/n)*n,p=f+9*h,g=Math.floor(this.viewDate.getFullYear()/h)*h,m=M.map(this.dates,function(t){return Math.floor(t.getUTCFullYear()/h)*h}),v=f-h;v<=p+h;v+=h)s=[e],l=null,v===f-h?s.push("old"):v===p+h&&s.push("new"),-1!==M.inArray(v,m)&&s.push("active"),(v<r||o<v)&&s.push("disabled"),v===g&&s.push("focused"),a!==M.noop&&((u=a(new Date(v,0,1)))===I?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u}),!1===u.enabled&&s.push("disabled"),u.classes&&(s=s.concat(u.classes.split(/\s+/))),u.tooltip&&(l=u.tooltip)),c+='<span class="'+s.join(" ")+'"'+(l?' title="'+l+'"':"")+">"+v+"</span>";d.find(".datepicker-switch").text(f+"-"+p),d.find("td").html(c)},fill:function(){var t,e,n=new Date(this.viewDate),r=n.getUTCFullYear(),i=n.getUTCMonth(),o=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,a=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,s=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,l=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,u=L[this.o.language].today||L.en.today||"",c=L[this.o.language].clear||L.en.clear||"",h=L[this.o.language].titleFormat||L.en.titleFormat,d=E(),f=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&d>=this.o.startDate&&d<=this.o.endDate&&!this.weekOfDateIsDisabled(d);if(!isNaN(r)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(O.formatDate(n,h,this.o.language)),this.picker.find("tfoot .today").text(u).css("display",f?"table-cell":"none"),this.picker.find("tfoot .clear").text(c).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var p=k(r,i,0),g=p.getUTCDate();p.setUTCDate(g-(p.getUTCDay()-this.o.weekStart+7)%7);var m=new Date(p);p.getUTCFullYear()<100&&m.setUTCFullYear(p.getUTCFullYear()),m.setUTCDate(m.getUTCDate()+42),m=m.valueOf();for(var v,y,x=[];p.valueOf()<m;){if((v=p.getUTCDay())===this.o.weekStart&&(x.push("<tr>"),this.o.calendarWeeks)){var b=new Date(+p+(this.o.weekStart-v-7)%7*864e5),w=new Date(Number(b)+(11-b.getUTCDay())%7*864e5),_=new Date(Number(_=k(w.getUTCFullYear(),0,1))+(11-_.getUTCDay())%7*864e5),S=(w-_)/864e5/7+1;x.push('<td class="cw">'+S+"</td>")}(y=this.getClassNames(p)).push("day");var C=p.getUTCDate();this.o.beforeShowDay!==M.noop&&((e=this.o.beforeShowDay(this._utc_to_local(p)))===I?e={}:"boolean"==typeof e?e={enabled:e}:"string"==typeof e&&(e={classes:e}),!1===e.enabled&&y.push("disabled"),e.classes&&(y=y.concat(e.classes.split(/\s+/))),e.tooltip&&(t=e.tooltip),e.content&&(C=e.content)),y=M.isFunction(M.uniqueSort)?M.uniqueSort(y):M.unique(y),x.push('<td class="'+y.join(" ")+'"'+(t?' title="'+t+'"':"")+' data-date="'+p.getTime().toString()+'">'+C+"</td>"),t=null,v===this.o.weekEnd&&x.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(x.join(""));var T=L[this.o.language].monthsTitle||L.en.monthsTitle||"Months",A=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?T:r).end().find("tbody span").removeClass("active");if(M.each(this.dates,function(t,e){e.getUTCFullYear()===r&&A.eq(e.getUTCMonth()).addClass("active")}),(r<o||s<r)&&A.addClass("disabled"),r===o&&A.slice(0,a).addClass("disabled"),r===s&&A.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==M.noop){var D=this;M.each(A,function(t,e){var n=new Date(r,t,1),i=D.o.beforeShowMonth(n);i===I?i={}:"boolean"==typeof i?i={enabled:i}:"string"==typeof i&&(i={classes:i}),!1!==i.enabled||M(e).hasClass("disabled")||M(e).addClass("disabled"),i.classes&&M(e).addClass(i.classes),i.tooltip&&M(e).prop("title",i.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,r,o,s,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,r,o,s,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,r,o,s,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var t,e,n=new Date(this.viewDate),i=n.getUTCFullYear(),r=n.getUTCMonth(),o=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,a=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,s=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,l=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,u=1;switch(this.viewMode){case 4:u*=10;case 3:u*=10;case 2:u*=10;case 1:t=Math.floor(i/u)*u<=o,e=Math.floor(i/u)*u+u>s;break;case 0:t=i<=o&&r<=a,e=s<=i&&l<=r}this.picker.find(".prev").toggleClass("disabled",t),this.picker.find(".next").toggleClass("disabled",e)}},click:function(t){var e,n,i,r;t.preventDefault(),t.stopPropagation(),(e=M(t.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(E(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),(n=1)===this.viewMode?(r=e.parent().find("span").index(e),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(r)):(r=0,i=Number(e.text()),this.viewDate.setUTCFullYear(i)),this._trigger(O.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(k(i,r,n)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(t){var e=M(t.currentTarget).data("date"),n=new Date(e);this.o.updateViewDate&&(n.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),n.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(n)},navArrowsClick:function(t){var e=M(t.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(e*=12*O.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,e),this._trigger(O.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),-1!==e?(!0===this.o.multidate||1<this.o.multidate||this.o.toggleActive)&&this.dates.remove(e):(!1===this.o.multidate&&this.dates.clear(),this.dates.push(t)),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),(!e&&this.o.updateViewDate||"view"===e)&&(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),e&&"view"===e||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||e&&"date"!==e||this.hide()},moveDay:function(t,e){var n=new Date(t);return n.setUTCDate(t.getUTCDate()+e),n},moveWeek:function(t,e){return this.moveDay(t,7*e)},moveMonth:function(t,e){if(!u(t))return this.o.defaultViewDate;if(!e)return t;var n,i,r=new Date(t.valueOf()),o=r.getUTCDate(),a=r.getUTCMonth(),s=Math.abs(e);if(e=0<e?1:-1,1===s)i=-1===e?function(){return r.getUTCMonth()===a}:function(){return r.getUTCMonth()!==n},n=a+e,r.setUTCMonth(n),n=(n+12)%12;else{for(var l=0;l<s;l++)r=this.moveMonth(r,e);n=r.getUTCMonth(),r.setUTCDate(o),i=function(){return n!==r.getUTCMonth()}}for(;i();)r.setUTCDate(--o),r.setUTCMonth(n);return r},moveYear:function(t,e){return this.moveMonth(t,12*e)},moveAvailableDate:function(t,e,n){do{if(t=this[n](t,e),!this.dateWithinRange(t))return!1;n="moveDay"}while(this.dateIsDisabled(t));return t},weekOfDateIsDisabled:function(t){return-1!==M.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(e){return this.weekOfDateIsDisabled(e)||0<M.grep(this.o.datesDisabled,function(t){return o(e,t)}).length},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":visible")){var e,n,i=!1,r=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault(),t.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;e=37===t.keyCode||38===t.keyCode?-1:1,0===this.viewMode?t.ctrlKey?(n=this.moveAvailableDate(r,e,"moveYear"))&&this._trigger("changeYear",this.viewDate):t.shiftKey?(n=this.moveAvailableDate(r,e,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===t.keyCode||39===t.keyCode?n=this.moveAvailableDate(r,e,"moveDay"):this.weekOfDateIsDisabled(r)||(n=this.moveAvailableDate(r,e,"moveWeek")):1===this.viewMode?(38!==t.keyCode&&40!==t.keyCode||(e*=4),n=this.moveAvailableDate(r,e,"moveMonth")):2===this.viewMode&&(38!==t.keyCode&&40!==t.keyCode||(e*=4),n=this.moveAvailableDate(r,e,"moveYear")),n&&(this.focusDate=this.viewDate=n,this.setValue(),this.fill(),t.preventDefault());break;case 13:if(!this.o.forceParse)break;r=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(r),i=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),t.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}i&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==t.keyCode&&27!==t.keyCode||(this.show(),t.stopPropagation())},setViewMode:function(t){this.viewMode=t,this.picker.children("div").hide().filter(".datepicker-"+O.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var d=function(t,e){M.data(t,"datepicker",this),this.element=M(t),this.inputs=M.map(e.inputs,function(t){return t.jquery?t[0]:t}),delete e.inputs,this.keepEmptyValues=e.keepEmptyValues,delete e.keepEmptyValues,r.call(M(this.inputs),e).on("changeDate",M.proxy(this.dateUpdated,this)),this.pickers=M.map(this.inputs,function(t){return M.data(t,"datepicker")}),this.updateDates()};d.prototype={updateDates:function(){this.dates=M.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var n=M.map(this.dates,function(t){return t.valueOf()});M.each(this.pickers,function(t,e){e.setRange(n)})},clearDates:function(){M.each(this.pickers,function(t,e){e.clearDates()})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var n=M.data(t.target,"datepicker");if(n!==I){var i=n.getUTCDate(),r=this.keepEmptyValues,e=M.inArray(t.target,this.inputs),o=e-1,a=e+1,s=this.inputs.length;if(-1!==e){if(M.each(this.pickers,function(t,e){e.getUTCDate()||e!==n&&r||e.setUTCDate(i)}),i<this.dates[o])for(;0<=o&&i<this.dates[o];)this.pickers[o--].setUTCDate(i);else if(i>this.dates[a])for(;a<s&&i>this.dates[a];)this.pickers[a++].setUTCDate(i);this.updateDates(),delete this.updating}}}},destroy:function(){M.map(this.pickers,function(t){t.destroy()}),M(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:t("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var i=M.fn.datepicker,r=function(a){var s,l=Array.apply(null,arguments);if(l.shift(),this.each(function(){var t=M(this),e=t.data("datepicker"),n="object"==typeof a&&a;if(!e){var i=c(this,"date"),r=h(M.extend({},f,i,n).language),o=M.extend({},f,r,i,n);t.hasClass("input-daterange")||o.inputs?(M.extend(o,{inputs:o.inputs||t.find("input").toArray()}),e=new d(this,o)):e=new _(this,o),t.data("datepicker",e)}"string"==typeof a&&"function"==typeof e[a]&&(s=e[a].apply(e,l))}),s===I||s instanceof _||s instanceof d)return this;if(1<this.length)throw new Error("Using only allowed for the collection of a single element ("+a+" function)");return s};M.fn.datepicker=r;var f=M.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:M.noop,beforeShowMonth:M.noop,beforeShowYear:M.noop,beforeShowDecade:M.noop,beforeShowCentury:M.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},a=M.fn.datepicker.locale_opts=["format","rtl","weekStart"];M.fn.datepicker.Constructor=_;var L=M.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},O={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(t){if("function"==typeof t.toValue&&"function"==typeof t.toDisplay)return t;var e=t.replace(this.validParts,"\0").split("\0"),n=t.match(this.validParts);if(!e||!e.length||!n||0===n.length)throw new Error("Invalid date format.");return{separators:e,parts:n}},parseDate:function(t,e,n,i){function r(t,e){return!0===e&&(e=10),t<100&&(t+=2e3)>(new Date).getFullYear()+e&&(t-=100),t}function o(){var t=this.slice(0,a[u].length),e=a[u].slice(0,t.length);return t.toLowerCase()===e.toLowerCase()}if(!t)return I;if(t instanceof Date)return t;if("string"==typeof e&&(e=O.parseFormat(e)),e.toValue)return e.toValue(t,e,n);var a,s,l,u,c,h={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},d={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(t in d&&(t=d[t]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(t)){for(a=t.match(/([\-+]\d+)([dmwy])/gi),t=new Date,u=0;u<a.length;u++)s=a[u].match(/([\-+]\d+)([dmwy])/i),l=Number(s[1]),c=h[s[2].toLowerCase()],t=_.prototype[c](t,l);return _.prototype._zero_utc_time(t)}a=t&&t.match(this.nonpunctuation)||[];var f,p,g={},m=["yyyy","yy","M","MM","m","mm","d","dd"],v={yyyy:function(t,e){return t.setUTCFullYear(i?r(e,i):e)},m:function(t,e){if(isNaN(t))return t;for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!==e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};v.yy=v.yyyy,v.M=v.MM=v.mm=v.m,v.dd=v.d,t=E();var y=e.parts.slice();if(a.length!==y.length&&(y=M(y).filter(function(t,e){return-1!==M.inArray(e,m)}).toArray()),a.length===y.length){var x,b,w;for(u=0,x=y.length;u<x;u++){if(f=parseInt(a[u],10),s=y[u],isNaN(f))switch(s){case"MM":p=M(L[n].months).filter(o),f=M.inArray(p[0],L[n].months)+1;break;case"M":p=M(L[n].monthsShort).filter(o),f=M.inArray(p[0],L[n].monthsShort)+1}g[s]=f}for(u=0;u<m.length;u++)(w=m[u])in g&&!isNaN(g[w])&&(b=new Date(t),v[w](b,g[w]),isNaN(b)||(t=b))}return t},formatDate:function(t,e,n){if(!t)return"";if("string"==typeof e&&(e=O.parseFormat(e)),e.toDisplay)return e.toDisplay(t,e,n);var i={d:t.getUTCDate(),D:L[n].daysShort[t.getUTCDay()],DD:L[n].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:L[n].monthsShort[t.getUTCMonth()],MM:L[n].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];for(var r=M.extend([],e.separators),o=0,a=e.parts.length;o<=a;o++)r.length&&t.push(r.shift()),t.push(i[e.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+f.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+f.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};O.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+O.headTemplate+"<tbody></tbody>"+O.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+O.headTemplate+O.contTemplate+O.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+O.headTemplate+O.contTemplate+O.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+O.headTemplate+O.contTemplate+O.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+O.headTemplate+O.contTemplate+O.footTemplate+"</table></div></div>",M.fn.datepicker.DPGlobal=O,M.fn.datepicker.noConflict=function(){return M.fn.datepicker=i,this},M.fn.datepicker.version="1.9.0",M.fn.datepicker.deprecated=function(t){var e=window.console;e&&e.warn&&e.warn("DEPRECATED: "+t)},M(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var e=M(this);e.data("datepicker")||(t.preventDefault(),r.call(e,"show"))}),M(function(){r.call(M('[data-provide="datepicker-inline"]'))})}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(D,a){function r(){var t,e,n,i,r;if((n=(null!=(r=(e=(new Date).toString()).split("(")[1])?r.slice(0,-1):0)||e.split(" "))instanceof Array){i=[];for(var o=0,a=n.length;o<a;o++)(t=null!==(r=n[o].match(/\b[A-Z]+\b/)))&&r[0]&&i.push(t);n=i.pop()}return n}function M(){return new Date(Date.UTC.apply(Date,arguments))}"indexOf"in Array.prototype||(Array.prototype.indexOf=function(t,e){e===a&&(e=0),e<0&&(e+=this.length),e<0&&(e=0);for(var n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1});var y=function(t,o){var e=this;this.element=D(t),this.container=o.container||"body",this.language=o.language||this.element.data("date-language")||"en",this.language=this.language in k?this.language:this.language.split("-")[0],this.language=this.language in k?this.language:"en",this.isRTL=k[this.language].rtl||!1,this.formatType=o.formatType||this.element.data("format-type")||"standard",this.format=E.parseFormat(o.format||this.element.data("date-format")||k[this.language].format||E.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.fontAwesome=o.fontAwesome||this.element.data("font-awesome")||!1,this.bootcssVer=o.bootcssVer||(this.isInput?this.element.is(".form-control")?3:2:this.bootcssVer=this.element.is(".input-group")?3:2),this.component=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o").parent():this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o").parent()),this.componentReset=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-remove, .input-group-addon .fa-times").parent():this.element.find(".add-on .icon-remove, .add-on .fa-times").parent()),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=o.linkField||this.element.data("link-field")||!1,this.linkFormat=E.parseFormat(o.linkFormat||this.element.data("link-format")||E.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=o.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=o.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=o.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=o.initialDate||new Date,this.zIndex=o.zIndex||this.element.data("z-index")||a,this.title="undefined"!=typeof o.title&&o.title,this.timezone=o.timezone||r(),this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":3===this.bootcssVer?"glyphicon-arrow-left":"icon-arrow-left",rightArrow:this.fontAwesome?"fa-arrow-right":3===this.bootcssVer?"glyphicon-arrow-right":"icon-arrow-right"},this.icontype=this.fontAwesome?"fa":"glyphicon",this._attachEvents(),this.clickedOutside=function(t){0===D(t.target).closest(".datetimepicker").length&&e.hide()},this.formatViewType="datetime","formatViewType"in o?this.formatViewType=o.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in o?this.minView=o.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=E.convertViewMode(this.minView),this.maxView=E.modes.length-1,"maxView"in o?this.maxView=o.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=E.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in o?this.wheelViewModeNavigation=o.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in o?this.wheelViewModeNavigationInverseDirection=o.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data(
|
|
"view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in o?this.wheelViewModeNavigationDelay=o.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in o?this.startViewMode=o.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=E.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in o?this.viewSelect=o.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=E.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in o?this.forceParse=o.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse"));for(var n=3===this.bootcssVer?E.templateV3:E.template;-1!==n.indexOf("{iconType}");)n=n.replace("{iconType}",this.icontype);for(;-1!==n.indexOf("{leftArrow}");)n=n.replace("{leftArrow}",this.icons.leftArrow);for(;-1!==n.indexOf("{rightArrow}");)n=n.replace("{rightArrow}",this.icons.rightArrow);if(this.picker=D(n).appendTo(this.isInline?this.element:this.container).on({click:D.proxy(this.click,this),mousedown:D.proxy(this.mousedown,this)}),this.wheelViewModeNavigation&&(D.fn.mousewheel?this.picker.on({mousewheel:D.proxy(this.mousewheel,this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL){this.picker.addClass("datetimepicker-rtl");var i=3===this.bootcssVer?".prev span, .next span":".prev i, .next i";this.picker.find(i).toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow)}D(document).on("mousedown touchend",this.clickedOutside),this.autoclose=!1,"autoclose"in o?this.autoclose=o.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in o?this.keyboardNavigation=o.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=o.todayBtn||this.element.data("date-today-btn")||!1,this.clearBtn=o.clearBtn||this.element.data("date-clear-btn")||!1,this.todayHighlight=o.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=0,"undefined"!=typeof o.weekStart?this.weekStart=o.weekStart:void 0!==this.element.data("date-weekstart")?this.weekStart=this.element.data("date-weekstart"):"undefined"!=typeof k[this.language].weekStart&&(this.weekStart=k[this.language].weekStart),this.weekStart=this.weekStart%7,this.weekEnd=(this.weekStart+6)%7,this.onRenderDay=function(t){var e=(o.onRenderDay||function(){return[]})(t);return"string"==typeof e&&(e=[e]),["day"].concat(e||[])},this.onRenderHour=function(t){var e=(o.onRenderHour||function(){return[]})(t);return"string"==typeof e&&(e=[e]),["hour"].concat(e||[])},this.onRenderMinute=function(t){var e=(o.onRenderMinute||function(){return[]})(t),n=["minute"];return"string"==typeof e&&(e=[e]),t<this.startDate||t>this.endDate?n.push("disabled"):Math.floor(this.date.getUTCMinutes()/this.minuteStep)===Math.floor(t.getUTCMinutes()/this.minuteStep)&&n.push("active"),n.concat(e||[])},this.onRenderYear=function(t){var e=(o.onRenderYear||function(){return[]})(t),n=["year"];"string"==typeof e&&(e=[e]),this.date.getUTCFullYear()===t.getUTCFullYear()&&n.push("active");var i=t.getUTCFullYear(),r=this.endDate.getUTCFullYear();return(t<this.startDate||r<i)&&n.push("disabled"),n.concat(e||[])},this.onRenderMonth=function(t){var e=(o.onRenderMonth||function(){return[]})(t);return"string"==typeof e&&(e=[e]),["month"].concat(e||[])},this.startDate=new Date(-8639968443048e3),this.endDate=new Date(8639968443048e3),this.datesDisabled=[],this.daysOfWeekDisabled=[],this.setStartDate(o.startDate||this.element.data("date-startdate")),this.setEndDate(o.endDate||this.element.data("date-enddate")),this.setDatesDisabled(o.datesDisabled||this.element.data("date-dates-disabled")),this.setDaysOfWeekDisabled(o.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.setMinutesDisabled(o.minutesDisabled||this.element.data("date-minute-disabled")),this.setHoursDisabled(o.hoursDisabled||this.element.data("date-hour-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};y.prototype={constructor:y,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:D.proxy(this.show,this),keyup:D.proxy(this.update,this),keydown:D.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:D.proxy(this.show,this),keyup:D.proxy(this.update,this),keydown:D.proxy(this.keydown,this)}],[this.component,{click:D.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:D.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:D.proxy(this.show,this)}]];for(var t,e,n=0;n<this._events.length;n++)t=this._events[n][0],e=this._events[n][1],t.on(e)},_detachEvents:function(){for(var t,e,n=0;n<this._events.length;n++)t=this._events[n][0],e=this._events[n][1],t.off(e);this._events=[]},show:function(t){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.forceParse&&this.update(),this.place(),D(window).on("resize",D.proxy(this.place,this)),t&&(t.stopPropagation(),t.preventDefault()),this.isVisible=!0,this.element.trigger({type:"show",date:this.date})},hide:function(){this.isVisible&&(this.isInline||(this.picker.hide(),D(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||D(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents(),D(document).off("mousedown",this.clickedOutside),this.picker.remove(),delete this.picker,delete this.element.data().datetimepicker},getDate:function(){var t=this.getUTCDate();return null===t?null:new Date(t.getTime()+6e4*t.getTimezoneOffset())},getUTCDate:function(){return this.date},getInitialDate:function(){return this.initialDate},setInitialDate:function(t){this.initialDate=t},setDate:function(t){this.setUTCDate(new Date(t.getTime()-6e4*t.getTimezoneOffset()))},setUTCDate:function(t){t>=this.startDate&&t<=this.endDate?(this.date=t,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:t,startDate:this.startDate,endDate:this.endDate})},setFormat:function(t){var e;this.format=E.parseFormat(t,this.formatType),this.isInput?e=this.element:this.component&&(e=this.element.find("input")),e&&e.val()&&this.setValue()},setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t):(this.component&&this.element.find("input").val(t),this.element.data("date",t)),this.linkField&&D("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(t){return t=t||this.format,E.formatDate(this.date,t,this.language,this.formatType,this.timezone)},setStartDate:function(t){this.startDate=t||this.startDate,8639968443048e3!==this.startDate.valueOf()&&(this.startDate=E.parseDate(this.startDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setEndDate:function(t){this.endDate=t||this.endDate,8639968443048e3!==this.endDate.valueOf()&&(this.endDate=E.parseDate(this.endDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setDatesDisabled:function(t){this.datesDisabled=t||[],D.isArray(this.datesDisabled)||(this.datesDisabled=this.datesDisabled.split(/,\s*/));var e=this;this.datesDisabled=D.map(this.datesDisabled,function(t){return E.parseDate(t,e.format,e.language,e.formatType,e.timezone).toDateString()}),this.update(),this.updateNavArrows()},setTitle:function(t,e){return this.picker.find(t).find("th:eq(1)").text(!1===this.title?e:this.title)},setDaysOfWeekDisabled:function(t){this.daysOfWeekDisabled=t||[],D.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=D.map(this.daysOfWeekDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},setMinutesDisabled:function(t){this.minutesDisabled=t||[],D.isArray(this.minutesDisabled)||(this.minutesDisabled=this.minutesDisabled.split(/,\s*/)),this.minutesDisabled=D.map(this.minutesDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},setHoursDisabled:function(t){this.hoursDisabled=t||[],D.isArray(this.hoursDisabled)||(this.hoursDisabled=this.hoursDisabled.split(/,\s*/)),this.hoursDisabled=D.map(this.hoursDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){if(!this.zIndex){var e=0;D("div").each(function(){var t=parseInt(D(this).css("zIndex"),10);e<t&&(e=t)}),this.zIndex=e+10}var t,n,i,r;r=this.container instanceof D?this.container.offset():D(this.container).offset(),this.component?(i=(t=this.component.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(i+=this.component.outerWidth()-this.picker.outerWidth())):(i=(t=this.element.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(i+=this.element.outerWidth()-this.picker.outerWidth()));var o=document.body.clientWidth||window.innerWidth;o<i+220&&(i=o-220),n="top-left"===this.pickerPosition||"top-right"===this.pickerPosition?t.top-this.picker.outerHeight():t.top+this.height,n-=r.top,i-=r.left,this.picker.css({top:n,left:i,zIndex:this.zIndex})}},hour_minute:"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]",update:function(t){var e,n=!1;arguments&&arguments.length&&("string"==typeof t||t instanceof Date)?(e=t,n=!0):"string"==typeof(e=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate)&&(e=e.replace(/^\s+|\s+$/g,"")),e||(e=new Date,n=!1),"string"==typeof e&&(new RegExp(this.hour_minute).test(e)||new RegExp(this.hour_minute+":[0-5][0-9]").test(e))&&(e=this.getDate()),this.date=E.parseDate(e,this.format,this.language,this.formatType,this.timezone),n&&this.setValue(),this.date<this.startDate?this.viewDate=new Date(this.startDate):this.date>this.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var t=this.weekStart,e="<tr>";t<this.weekStart+7;)e+='<th class="dow">'+k[this.language].daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datetimepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=new Date(this.viewDate),n=0;n<12;n++){e.setUTCMonth(n),t+='<span class="'+this.onRenderMonth(e).join(" ")+'">'+k[this.language].monthsShort[n]+"</span>"}this.picker.find(".datetimepicker-months td").html(t)},fill:function(){if(this.date&&this.viewDate){var t=new Date(this.viewDate),e=t.getUTCFullYear(),n=t.getUTCMonth(),i=t.getUTCDate(),r=t.getUTCHours(),o=this.startDate.getUTCFullYear(),a=this.startDate.getUTCMonth(),s=this.endDate.getUTCFullYear(),l=this.endDate.getUTCMonth()+1,u=new M(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),c=new Date;if(this.setTitle(".datetimepicker-days",k[this.language].months[n]+" "+e),"time"===this.formatViewType){var h=this.getFormattedDate();this.setTitle(".datetimepicker-hours",h),this.setTitle(".datetimepicker-minutes",h)}else this.setTitle(".datetimepicker-hours",i+" "+k[this.language].months[n]+" "+e),this.setTitle(".datetimepicker-minutes",i+" "+k[this.language].months[n]+" "+e);this.picker.find("tfoot th.today").text(k[this.language].today||k.en.today).toggle(!1!==this.todayBtn),this.picker.find("tfoot th.clear").text(k[this.language].clear||k.en.clear).toggle(!1!==this.clearBtn),this.updateNavArrows(),this.fillMonths();var d=M(e,n-1,28,0,0,0,0),f=E.getDaysInMonth(d.getUTCFullYear(),d.getUTCMonth());d.setUTCDate(f),d.setUTCDate(f-(d.getUTCDay()-this.weekStart+7)%7);var p=new Date(d);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();for(var g,m=[];d.valueOf()<p;)d.getUTCDay()===this.weekStart&&m.push("<tr>"),g=this.onRenderDay(d),d.getUTCFullYear()<e||d.getUTCFullYear()===e&&d.getUTCMonth()<n?g.push("old"):(d.getUTCFullYear()>e||d.getUTCFullYear()===e&&d.getUTCMonth()>n)&&g.push("new"),this.todayHighlight&&d.getUTCFullYear()===c.getFullYear()&&d.getUTCMonth()===c.getMonth()&&d.getUTCDate()===c.getDate()&&g.push("today"),d.valueOf()===u&&g.push("active"),(d.valueOf()+864e5<=this.startDate||d.valueOf()>this.endDate||-1!==D.inArray(d.getUTCDay(),this.daysOfWeekDisabled)||-1!==D.inArray(d.toDateString(),this.datesDisabled))&&g.push("disabled"),m.push('<td class="'+g.join(" ")+'">'+d.getUTCDate()+"</td>"),d.getUTCDay()===this.weekEnd&&m.push("</tr>"),d.setUTCDate(d.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(m.join("")),m=[];var v="",y="",x="",b=this.hoursDisabled||[];t=new Date(this.viewDate);for(var w=0;w<24;w++){t.setUTCHours(w),g=this.onRenderHour(t),-1!==b.indexOf(w)&&g.push("disabled");var _=M(e,n,i,w);_.valueOf()+36e5<=this.startDate||_.valueOf()>this.endDate?g.push("disabled"):r===w&&g.push("active"),this.showMeridian&&2===k[this.language].meridiem.length?((y=w<12?k[this.language].meridiem[0]:k[this.language].meridiem[1])!==x&&(""!==x&&m.push("</fieldset>"),m.push('<fieldset class="hour"><legend>'+y.toUpperCase()+"</legend>")),x=y,v=w%12?w%12:12,w<12?g.push("hour_am"):g.push("hour_pm"),m.push('<span class="'+g.join(" ")+'">'+v+"</span>"),23===w&&m.push("</fieldset>")):(v=w+":00",m.push('<span class="'+g.join(" ")+'">'+v+"</span>"))}this.picker.find(".datetimepicker-hours td").html(m.join("")),m=[],x=y=v="";var S=this.minutesDisabled||[];t=new Date(this.viewDate);for(w=0;w<60;w+=this.minuteStep)-1===S.indexOf(w)&&(t.setUTCMinutes(w),t.setUTCSeconds(0),g=this.onRenderMinute(t),this.showMeridian&&2===k[this.language].meridiem.length?((y=r<12?k[this.language].meridiem[0]:k[this.language].meridiem[1])!==x&&(""!==x&&m.push("</fieldset>"),m.push('<fieldset class="minute"><legend>'+y.toUpperCase()+"</legend>")),x=y,v=r%12?r%12:12,m.push('<span class="'+g.join(" ")+'">'+v+":"+(w<10?"0"+w:w)+"</span>"),59===w&&m.push("</fieldset>")):(v=w+":00",m.push('<span class="'+g.join(" ")+'">'+r+":"+(w<10?"0"+w:w)+"</span>")));this.picker.find(".datetimepicker-minutes td").html(m.join(""));var C=this.date.getUTCFullYear(),T=this.setTitle(".datetimepicker-months",e).end().find(".month").removeClass("active");C===e&&T.eq(this.date.getUTCMonth()).addClass("active"),(e<o||s<e)&&T.addClass("disabled"),e===o&&T.slice(0,a).addClass("disabled"),e===s&&T.slice(l).addClass("disabled"),m="",e=10*parseInt(e/10,10);var A=this.setTitle(".datetimepicker-years",e+"-"+(e+9)).end().find("td");e-=1,t=new Date(this.viewDate);for(w=-1;w<11;w++)t.setUTCFullYear(e),g=this.onRenderYear(t),-1!==w&&10!==w||g.push(I),m+='<span class="'+g.join(" ")+'">'+e+"</span>",e+=1;A.html(m),this.place()}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),n=t.getUTCMonth(),i=t.getUTCDate(),r=t.getUTCHours();switch(this.viewMode){case 0:e<=this.startDate.getUTCFullYear()&&n<=this.startDate.getUTCMonth()&&i<=this.startDate.getUTCDate()&&r<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),e>=this.endDate.getUTCFullYear()&&n>=this.endDate.getUTCMonth()&&i>=this.endDate.getUTCDate()&&r>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:e<=this.startDate.getUTCFullYear()&&n<=this.startDate.getUTCMonth()&&i<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),e>=this.endDate.getUTCFullYear()&&n>=this.endDate.getUTCMonth()&&i>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:e<=this.startDate.getUTCFullYear()&&n<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),e>=this.endDate.getUTCFullYear()&&n>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var e=t.originalEvent.wheelDelta,n=0<e?1:0===e?0:-1;this.wheelViewModeNavigationInverseDirection&&(n=-n),this.showMode(n),setTimeout(D.proxy(function(){this.wheelPause=!1},this),this.wheelViewModeNavigationDelay)}},click:function(t){t.stopPropagation(),t.preventDefault();var e=D(t.target).closest("span, td, th, legend");if(e.is("."+this.icontype)&&(e=D(e).parent().closest("span, td, th, legend")),1===e.length){if(e.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(e[0].nodeName.toLowerCase()){case"th":switch(e[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var n=E.modes[this.viewMode].navStep*("prev"===e[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,n);break;case 1:this.viewDate=this.moveDate(this.viewDate,n);break;case 2:this.viewDate=this.moveMonth(this.viewDate,n);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,n)}this.fill(),this.element.trigger({type:e[0].className+":"+this.convertViewModeText(this.viewMode),date:this.viewDate,startDate:this.startDate,endDate:this.endDate});break;case"clear":this.reset(),this.autoclose&&this.hide();break;case"today":var i=new Date;(i=M(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),0))<this.startDate?i=this.startDate:i>this.endDate&&(i=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(i),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!e.is(".disabled")){var r=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),a=this.viewDate.getUTCDate(),s=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(e.is(".month")?(this.viewDate.setUTCDate(1),o=e.parent().find("span").index(e),a=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(o),this.element.trigger({type:"changeMonth",date:this.viewDate}),3<=this.viewSelect&&this._setDate(M(r,o,a,s,l,u,0))):e.is(".year")?(this.viewDate.setUTCDate(1),r=parseInt(e.text(),10)||0,this.viewDate.setUTCFullYear(r),this.element.trigger({type:"changeYear",date:this.viewDate}),4<=this.viewSelect&&this._setDate(M(r,o,a,s,l,u,0))):e.is(".hour")?(s=parseInt(e.text(),10)||0,(e.hasClass("hour_am")||e.hasClass("hour_pm"))&&(12===s&&e.hasClass("hour_am")?s=0:12!==s&&e.hasClass("hour_pm")&&(s+=12)),this.viewDate.setUTCHours(s),this.element.trigger({type:"changeHour",date:this.viewDate}),1<=this.viewSelect&&this._setDate(M(r,o,a,s,l,u,0))):e.is(".minute")&&(l=parseInt(e.text().substr(e.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(l),this.element.trigger({type:"changeMinute",date:this.viewDate}),0<=this.viewSelect&&this._setDate(M(r,o,a,s,l,u,0))),0!==this.viewMode){var c=this.viewMode;this.showMode(-1),this.fill(),c===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(e.is(".day")&&!e.is(".disabled")){a=parseInt(e.text(),10)||1,r=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),s=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();e.is(".old")?0===o?(o=11,r-=1):o-=1:e.is(".new")&&(11===o?(o=0,r+=1):o+=1),this.viewDate.setUTCFullYear(r),this.viewDate.setUTCMonth(o,a),this.element.trigger({type:"changeDay",date:this.viewDate}),2<=this.viewSelect&&this._setDate(M(r,o,a,s,l,u,0))}c=this.viewMode;this.showMode(-1),this.fill(),c===this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(t,e){var n;e&&"date"!==e||(this.date=t),e&&"view"!==e||(this.viewDate=t),this.fill(),this.setValue(),this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.element.trigger({type:"changeDate",date:this.getDate()}),null===t&&(this.date=this.viewDate)},moveMinute:function(t,e){if(!e)return t;var n=new Date(t.valueOf());return n.setUTCMinutes(n.getUTCMinutes()+e*this.minuteStep),n},moveHour:function(t,e){if(!e)return t;var n=new Date(t.valueOf());return n.setUTCHours(n.getUTCHours()+e),n},moveDate:function(t,e){if(!e)return t;var n=new Date(t.valueOf());return n.setUTCDate(n.getUTCDate()+e),n},moveMonth:function(t,e){if(!e)return t;var n,i,r=new Date(t.valueOf()),o=r.getUTCDate(),a=r.getUTCMonth(),s=Math.abs(e);if(e=0<e?1:-1,1===s)i=-1===e?function(){return r.getUTCMonth()===a}:function(){return r.getUTCMonth()!==n},n=a+e,r.setUTCMonth(n),(n<0||11<n)&&(n=(n+12)%12);else{for(var l=0;l<s;l++)r=this.moveMonth(r,e);n=r.getUTCMonth(),r.setUTCDate(o),i=function(){return n!==r.getUTCMonth()}}for(;i();)r.setUTCDate(--o),r.setUTCMonth(n);return r},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.startDate&&t<=this.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))27===t.keyCode&&this.show();else{var e,n,i,r,o=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37===t.keyCode?-1:1;var a=this.viewMode;t.ctrlKey?a+=2:t.shiftKey&&(a+=1),4===a?(n=this.moveYear(this.date,e),i=this.moveYear(this.viewDate,e)):3===a?(n=this.moveMonth(this.date,e),i=this.moveMonth(this.viewDate,e)):2===a?(n=this.moveDate(this.date,e),i=this.moveDate(this.viewDate,e)):1===a?(n=this.moveHour(this.date,e),i=this.moveHour(this.viewDate,e)):0===a&&(n=this.moveMinute(this.date,e),i=this.moveMinute(this.viewDate,e)),this.dateWithinRange(n)&&(this.date=n,this.viewDate=i,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38===t.keyCode?-1:1,a=this.viewMode,t.ctrlKey?a+=2:t.shiftKey&&(a+=1),4===a?(n=this.moveYear(this.date,e),i=this.moveYear(this.viewDate,e)):3===a?(n=this.moveMonth(this.date,e),i=this.moveMonth(this.viewDate,e)):2===a?(n=this.moveDate(this.date,7*e),i=this.moveDate(this.viewDate,7*e)):1===a?this.showMeridian?(n=this.moveHour(this.date,6*e),i=this.moveHour(this.viewDate,6*e)):(n=this.moveHour(this.date,4*e),i=this.moveHour(this.viewDate,4*e)):0===a&&(n=this.moveMinute(this.date,4*e),i=this.moveMinute(this.viewDate,4*e)),this.dateWithinRange(n)&&(this.date=n,this.viewDate=i,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 13:if(0!==this.viewMode){var s=this.viewMode;this.showMode(-1),this.fill(),s===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();t.preventDefault();break;case 9:this.hide()}if(o)this.isInput?r=this.element:this.component&&(r=this.element.find("input")),r&&r.change(),this.element.trigger({type:"changeDate",date:this.getDate()})}},showMode:function(t){if(t){var e=Math.max(0,Math.min(E.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:e}),this.viewMode=e)}this.picker.find(">div").hide().filter(".datetimepicker-"+E.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(){this._setDate(null,"date")},convertViewModeText:function(t){switch(t){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};var I=D.fn.datetimepicker;D.fn.datetimepicker=function(i){var r,o=Array.apply(null,arguments);return o.shift(),this.each(function(){var t=D(this),e=t.data("datetimepicker"),n="object"==typeof i&&i;if(e||t.data("datetimepicker",e=new y(this,D.extend({},D.fn.datetimepicker.defaults,n))),"string"==typeof i&&"function"==typeof e[i]&&(r=e[i].apply(e,o))!==a)return!1}),r!==a?r:this},D.fn.datetimepicker.defaults={},D.fn.datetimepicker.Constructor=y;var k=D.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today",clear:"Clear"}},E={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},getDaysInMonth:function(t,e){return[31,E.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},getDefaultFormat:function(t,e){if("standard"===t)return"input"===e?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"===t)return"input"===e?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(t){if("standard"===t)return/t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"===t)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(t,e){var n=t.replace(this.validParts(e),"\0").split("\0"),i=t.match(this.validParts(e));if(!n||!n.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:n,parts:i}},parseDate:function(t,e,n,i,r){if(t instanceof Date){var o=new Date(t.valueOf()-6e4*t.getTimezoneOffset());return o.setMilliseconds(0),o}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)&&(e=this.parseFormat("yyyy-mm-dd",i)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)&&(e=this.parseFormat("yyyy-mm-dd hh:ii",i)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)&&(e=this.parseFormat("yyyy-mm-dd hh:ii:ss",i)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(t)){var a,s=/([-+]\d+)([dmwy])/,l=t.match(/([-+]\d+)([dmwy])/g);t=new Date;for(var u=0;u<l.length;u++)switch(d=s.exec(l[u]),a=parseInt(d[1]),d[2]){case"d":t.setUTCDate(t.getUTCDate()+a);break;case"m":t=y.prototype.moveMonth.call(y.prototype,t,a);break;case"w":t.setUTCDate(t.getUTCDate()+7*a);break;case"y":t=y.prototype.moveYear.call(y.prototype,t,a)}return M(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),0)}l=t&&t.toString().match(this.nonpunctuation)||[],t=new Date(0,0,0,0,0,0,0);var c,h,d,f={},p=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P","z","Z"],g={hh:function(t,e){return t.setUTCHours(e)},h:function(t,e){return t.setUTCHours(e)},HH:function(t,e){return t.setUTCHours(12===e?0:e)},H:function(t,e){return t.setUTCHours(12===e?0:e)},ii:function(t,e){return t.setUTCMinutes(e)},i:function(t,e){return t.setUTCMinutes(e)},ss:function(t,e){return t.setUTCSeconds(e)},s:function(t,e){return t.setUTCSeconds(e)},yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!==e;){if(isNaN(t.getUTCMonth()))return t;t.setUTCDate(t.getUTCDate()-1)}return t},d:function(t,e){return t.setUTCDate(e)},p:function(t,e){return t.setUTCHours(1===e?t.getUTCHours()+12:t.getUTCHours())},z:function(){return r}};if(g.M=g.MM=g.mm=g.m,g.dd=g.d,g.P=g.p,g.Z=g.z,t=M(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()),l.length===e.parts.length){u=0;for(var m=e.parts.length;u<m;u++){if(c=parseInt(l[u],10),d=e.parts[u],isNaN(c))switch(d){case"MM":h=D(k[n].months).filter(function(){var t=this.slice(0,l[u].length);return t===l[u].slice(0,t.length)}),c=D.inArray(h[0],k[n].months)+1;break;case"M":h=D(k[n].monthsShort).filter(function(){var t=this.slice(0,l[u].length),e=l[u].slice(0,t.length);return t.toLowerCase()===e.toLowerCase()}),c=D.inArray(h[0],k[n].monthsShort)+1;break;case"p":case"P":c=D.inArray(l[u].toLowerCase(),k[n].meridiem)}f[d]=c}var v;for(u=0;u<p.length;u++)(v=p[u])in f&&!isNaN(f[v])&&g[v](t,f[v])}return t},formatDate:function(t,e,n,i,r){if(null===t)return"";var o;if("standard"===i)o={t:t.getTime(),yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear(),m:t.getUTCMonth()+1,M:k[n].monthsShort[t.getUTCMonth()],MM:k[n].months[t.getUTCMonth()],d:t.getUTCDate(),D:k[n].daysShort[t.getUTCDay()],DD:k[n].days[t.getUTCDay()],p:2===k[n].meridiem.length?k[n].meridiem[t.getUTCHours()<12?0:1]:"",h:t.getUTCHours(),i:t.getUTCMinutes(),s:t.getUTCSeconds(),z:r},2===k[n].meridiem.length?o.H=o.h%12==0?12:o.h%12:o.H=o.h,o.HH=(o.H<10?"0":"")+o.H,o.P=o.p.toUpperCase(),o.Z=o.z,o.hh=(o.h<10?"0":"")+o.h,o.ii=(o.i<10?"0":"")+o.i,o.ss=(o.s<10?"0":"")+o.s,o.dd=(o.d<10?"0":"")+o.d,o.mm=(o.m<10?"0":"")+o.m;else{if("php"!==i)throw new Error("Invalid format type.");(o={y:t.getUTCFullYear().toString().substring(2),Y:t.getUTCFullYear(),F:k[n].months[t.getUTCMonth()],M:k[n].monthsShort[t.getUTCMonth()],n:t.getUTCMonth()+1,t:E.getDaysInMonth(t.getUTCFullYear(),t.getUTCMonth()),j:t.getUTCDate(),l:k[n].days[t.getUTCDay()],D:k[n].daysShort[t.getUTCDay()],w:t.getUTCDay(),N:0===t.getUTCDay()?7:t.getUTCDay(),S:t.getUTCDate()%10<=k[n].suffix.length?k[n].suffix[t.getUTCDate()%10-1]:"",a:2===k[n].meridiem.length?k[n].meridiem[t.getUTCHours()<12?0:1]:"",g:t.getUTCHours()%12==0?12:t.getUTCHours()%12,G:t.getUTCHours(),i:t.getUTCMinutes(),s:t.getUTCSeconds()}).m=(o.n<10?"0":"")+o.n,o.d=(o.j<10?"0":"")+o.j,o.A=o.a.toString().toUpperCase(),o.h=(o.g<10?"0":"")+o.g,o.H=(o.G<10?"0":"")+o.G,o.i=(o.i<10?"0":"")+o.i,o.s=(o.s<10?"0":"")+o.s}t=[];for(var a=D.extend([],e.separators),s=0,l=e.parts.length;s<l;s++)a.length&&t.push(a.shift()),t.push(o[e.parts[s]]);return a.length&&t.push(a.shift()),t.join("")},convertViewMode:function(t){switch(t){case 4:case"decade":t=4;break;case 3:case"year":t=3;break;case 2:case"month":t=2;break;case 1:case"day":t=1;break;case 0:case"hour":t=0}return t},headTemplate:'<thead><tr><th class="prev"><i class="{iconType} {leftArrow}"/></th><th colspan="5" class="switch"></th><th class="next"><i class="{iconType} {rightArrow}"/></th></tr></thead>',headTemplateV3:'<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"></span> </th><th colspan="5" class="switch"></th><th class="next"><span class="{iconType} {rightArrow}"></span> </th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};E.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+E.headTemplate+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+E.headTemplate+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+E.headTemplate+"<tbody></tbody>"+E.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+E.headTemplate+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+E.headTemplate+E.contTemplate+E.footTemplate+"</table></div></div>",
|
|
E.templateV3='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+E.headTemplateV3+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+E.headTemplateV3+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+E.headTemplateV3+"<tbody></tbody>"+E.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+E.headTemplateV3+E.contTemplate+E.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+E.headTemplateV3+E.contTemplate+E.footTemplate+"</table></div></div>",D.fn.datetimepicker.DPGlobal=E,D.fn.datetimepicker.noConflict=function(){return D.fn.datetimepicker=I,this},D(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(t){var e=D(this);e.data("datetimepicker")||(t.preventDefault(),e.datetimepicker("show"))}),D(function(){D('[data-provide="datetimepicker-inline"]').datetimepicker()})}),$.fn.bootstrapViewer=function(s){$(this).on("click",function(){var t=$.extend({},$.fn.bootstrapViewer.defaults,s),e=$('<div class="modal fade bs-example-modal-lg text-center" id="bootstrapViewer" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" >\n <div class="modal-dialog modal-lg" style="display: inline-block; width: auto;">\n <div class="modal-content">\n <img\t\t\t class="carousel-inner img-responsive img-rounded img-viewer" draggable="false"\n'+"\t\t\t onclick=\"/*$('#bootstrapViewer').modal('hide');setTimeout(function(){$('#bootstrapViewer').remove();},200);*/\"\n\t\t\t onmouseover=\"this.style.cursor='move';\" \n\t\t\t onmouseout=\"this.style.cursor='default'\" \n\t\t\t />\n </div>\n </div>\n </div>");if($("body").append(e),!$(this).attr(t.src))throw"\u56fe\u7247\u4e0d\u5b58\u5728";$("#bootstrapViewer").find(".img-viewer").attr("src",$(this).attr(t.src)),$("#bootstrapViewer").modal(),$("#bootstrapViewer").on("hidden.bs.modal",function(){$("#bootstrapViewer").remove()});var i=$("#bootstrapViewer .modal-dialog"),r=!1,o=i.offset().left,a=i.offset().top,n=function(t){if(r){var e=t.pageX-o,n=t.pageY-a;e<0&&(e=0),n<0&&(n=0),i.css({left:e,top:n})}};i.mousedown(function(t){i.css({left:i[0].offsetLeft,top:i[0].offsetTop,marginTop:0,position:"absolute"}),r=!0,o=t.pageX-i.offset().left,a=t.pageY-i.offset().top,$(document).mousemove(n)}).mouseup(function(){r=!1,$(document).unbind("mousemove",n)})}),$(this).on("mouseover",function(){$(this).css("cursor","zoom-in")})},$.fn.bootstrapViewer.defaults={src:"src"},function(n,i){"use strict";"object"==typeof module&&"object"==typeof module.exports&&i(require("jquery"),n),"function"==typeof define?define.cmd?define(function(t){var e=t("jquery");i(e,n)}):define(["jquery"],function(t){i(t,n)}):i(n.jQuery,n)}("undefined"!=typeof window?window:this,function(l,t){"use strict";function u(t,e){e=e||{},this.dom=t,this.options=l.extend(!0,{},u.defaultOptions,e),this.curtain=null,this.render().show()}if(l||(l=t.jQuery||null),!l)throw new TypeError("\u5fc5\u987b\u5f15\u5165jquery\u5e93\u65b9\u53ef\u6b63\u5e38\u4f7f\u7528\uff01");var e=Array.prototype.slice,n=function(t,e){var n=!0;for(var i in t)if(t[i]!==e[t]){n=!0;break}return n};u.prototype={constructor:u,initElement:function(){var t=this.dom,e=this.options,n=t.children(".mloading"),i=n.children(".mloading-body"),r=i.children(".mloading-bar"),o=r.children(".mloading-icon"),a=r.find(".mloading-text");if(0==n.length&&(n=l('<div class="mloading"></div>'),t.append(n)),0==i.length&&(i=l('<div class="mloading-body"></div>'),n.append(i)),0==r.length&&(r=l('<div class="mloading-bar"></div>'),i.append(r)),0==o.length){var s=document.createElement(e.iconTag);(o=l(s)).addClass("mloading-icon"),r.append(o)}return 0==a.length&&(a=l('<span class="mloading-text"></span>'),r.append(a)),this.curtainElement=n,this.bodyElement=i,this.barElement=r,this.iconElement=o,this.textElement=a,this},render:function(){var t=this.dom,e=this.options;return this.initElement(),t.is("html")||t.is("body")?this.curtainElement.addClass("mloading-full"):(this.curtainElement.removeClass("mloading-full"),t.hasClass("mloading-container")||t.addClass("mloading-container")),e.mask?this.curtainElement.addClass("mloading-mask"):this.curtainElement.removeClass("mloading-mask"),""!=e.content&&"undefined"!=typeof e.content?e.html?this.bodyElement.html(e.content):this.bodyElement.text(e.content):(this.iconElement.attr("src",e.icon),e.html?this.textElement.html(e.text):this.textElement.text(e.text)),this},setOptions:function(t){t=t||{};var e=this.options;this.options=l.extend(!0,{},this.options,t),n(e,this.options)||this.render()},show:function(){this.dom,this.options;var t=this.barElement;return this.curtainElement.addClass("active"),t.css({marginTop:"-"+t.outerHeight()/2+"px",marginLeft:"-"+t.outerWidth()/2+"px"}),this},hide:function(){var t=this.dom;this.options;return this.curtainElement.removeClass("active"),t.is("html")||t.is("body")||t.removeClass("mloading-container"),this},destroy:function(){var t=this.dom;this.options;return this.curtainElement.remove(),t.is("html")||t.is("body")||t.removeClass("mloading-container"),t.removeData(u.dataKey),this}},u.dataKey="MLoading",u.defaultOptions={text:"\u52a0\u8f7d\u4e2d...",iconTag:"img",icon:"data:image/gif;base64,R0lGODlhDwAPAKUAAEQ+PKSmpHx6fNTW1FxaXOzu7ExOTIyOjGRmZMTCxPz6/ERGROTi5Pz29JyanGxubMzKzIyKjGReXPT29FxWVGxmZExGROzq7ERCRLy6vISChNze3FxeXPTy9FROTJSSlMTGxPz+/OTm5JyenNTOzGxqbExKTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBgAhACwAAAAADwAPAAAGd8CQcEgsChuTZMNIDFgsC1Nn9GEwDwDAoqMBWEDFiweA2YoiZevwA9BkDAUhW0MkADYhiEJYwJj2QhYGTBwAE0MUGGp5IR1+RBEAEUMVDg4AAkQMJhgfFyEIWRgDRSALABKgWQ+HRQwaCCEVC7R0TEITHbmtt0xBACH5BAkGACYALAAAAAAPAA8AhUQ+PKSmpHRydNTW1FxWVOzu7MTCxIyKjExKTOTi5LSytHx+fPz6/ERGROTe3GxqbNTS1JyWlFRSVKympNze3FxeXPT29MzKzFROTOzq7ISGhERCRHx6fNza3FxaXPTy9MTGxJSSlExOTOTm5LS2tISChPz+/ExGRJyenKyqrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ6QJNQeIkUhsjkp+EhMZLITKgBAGigQgiiCtiAKJdkBgNYgDYLhmDjQIbKwgfF9C4hPYC5KSMsbBBIJyJYFQAWQwQbI0J8Jh8nDUgHAAcmDA+LKAAcSAkIEhYTAAEoGxsdSSAKIyJcGyRYJiQbVRwDsVkPXrhDDCQBSUEAIfkECQYAEAAsAAAAAA8ADwCFRD48pKKkdHZ01NLUXFpc7OrsTE5MlJKU9Pb03N7cREZExMbEhIKEbGpsXFZUVFZU/P78tLa0fH583NrcZGJk9PL0VE5MnJ6c/Pb05ObkTEZEREJErKqsfHp81NbUXF5c7O7slJaU5OLkzMrMjIaEdG5sVFJU/Pr8TEpMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABndAiHA4DICISCIllBQWQgSNY6NJJAcoAMCw0XaQBQtAYj0ANgcE0SwZlgSe04hI2FiFAyEFRdQYmh8AakIOJhgQHhVCFQoaRAsVGSQWihAXAF9EHFkNEBUXGxsTSBxaGx9dGxFJGKgKAAoSEydNIwoFg01DF7oQQQAh+QQJBgAYACwAAAAADwAPAIVEPjykoqR0cnTU0tRUUlSMiozs6uxMSkx8fnzc3txcXlyUlpT09vRcWlxMRkS0trR8enzc2txcVlSUkpRUTkyMhoTk5uScnpz8/vxEQkR8dnTU1tRUVlSMjoz08vRMTkyEgoTk4uRkYmSclpT8+vy8urwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGc0CMcEgsGo9Gw6LhkHRCmICFODgAAJ8M4FDJTIUGCgCRwIQKV+9wMiaWtIAvRqOACiMKwucjJzFIJEN+gEQiHAQcJUMeBROCBFcLRBcAEESQAB0GGB4XGRkbghwCnxkiWhkPRRMMCSAfABkIoUhCDLW4Q0EAIfkECQYAGQAsAAAAAA8ADwCFRD48pKKkdHJ01NLU7OrsXFZUjIqMvLq8TEpM3N7c9Pb0lJaUxMbErK6sfH58bGpsVFJUTEZE3Nrc9PL0XF5clJKUxMLEVE5M5Obk/P78nJ6ctLa0hIaEREJE1NbU7O7sXFpcjI6MvL68TE5M5OLk/Pr8nJqczM7MtLK0hIKEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABnPAjHBILBqPRsICFCmESMcBAgAYdQAIi9HzSCUyJEOnAx0GBqUSsQJwYFAZyTiFGZZEgHGlJKACQBIZEwJXVR8iYwANE0MTAVMNGSISHAAhRSUYC2pCJFMhH4IaEAdGDGMdFFcdG0cJKSNYDoFIQgqctblBADs=",html:!1,content:"",mask:!0},l.fn.mLoading=function(t){var o={},a="",s=[];return"object"==typeof t?o=t:"string"==typeof t&&(a=t,s=e.call(arguments).splice(0,1)),this.each(function(t,e){var n=l(e),i=n.data(u.dataKey);if(i||(i=new u(n,o)),a){var r=i[a];"function"==typeof r&&r.apply(i,s)}})}}),function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(t,e){return e===undefined&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(e),e}:n(jQuery)}(function(l){var u=window;l.fn.confirm=function(o,t){return void 0===o&&(o={}),"string"==typeof o&&(o={content:o,title:t||!1}),l(this).each(function(){var r=l(this);r.attr("jc-attached")?console.warn("jConfirm has already been attached to this element ",r[0]):(r.on("click",function(t){t.preventDefault();var e=l.extend({},o);if(r.attr("data-title")&&(e.title=r.attr("data-title")),r.attr("data-content")&&(e.content=r.attr("data-content")),"undefined"==typeof e.buttons&&(e.buttons={}),(e.$target=r).attr("href")&&0===Object.keys(e.buttons).length){var n=l.extend(!0,{},u.jconfirm.pluginDefaults.defaultButtons,(u.jconfirm.defaults||{}).defaultButtons||{}),i=Object.keys(n)[0];e.buttons=n,e.buttons[i].action=function(){location.href=r.attr("href")}}e.closeIcon=!1;l.confirm(e)}),r.attr("jc-attached",!0))}),l(this)},l.confirm=function(t,e){void 0===t&&(t={}),"string"==typeof t&&(t={content:t,title:e||!1});var n=!(!1===t.buttons);if("object"!=typeof t.buttons&&(t.buttons={}),0===Object.keys(t.buttons).length&&n){var i=l.extend(!0,{},u.jconfirm.pluginDefaults.defaultButtons,(u.jconfirm.defaults||{}).defaultButtons||{});t.buttons=i}return u.jconfirm(t)},l.alert=function(t,e){void 0===t&&(t={}),"string"==typeof t&&(t={content:t,title:e||!1});var n=!(!1===t.buttons);if("object"!=typeof t.buttons&&(t.buttons={}),0===Object.keys(t.buttons).length&&n){var i=l.extend(!0,{},u.jconfirm.pluginDefaults.defaultButtons,(u.jconfirm.defaults||{}).defaultButtons||{}),r=Object.keys(i)[0];t.buttons[r]=i[r]}return u.jconfirm(t)},l.dialog=function(t,e){return void 0===t&&(t={}),"string"==typeof t&&(t={content:t,title:e||!1,closeIcon:function(){}}),t.buttons={},"undefined"==typeof t.closeIcon&&(t.closeIcon=function(){}),t.confirmKeys=[13],u.jconfirm(t)},u.jconfirm=function(t){void 0===t&&(t={});var e=l.extend(!0,{},u.jconfirm.pluginDefaults);u.jconfirm.defaults&&(e=l.extend(!0,e,u.jconfirm.defaults)),e=l.extend(!0,{},e,t);var n=new u.Jconfirm(e);return u.jconfirm.instances.push(n),n},u.Jconfirm=function(t){l.extend(this,t),this._init()},u.Jconfirm.prototype={_init:function(){var t=this;u.jconfirm.instances.length||(u.jconfirm.lastFocused=l("body").find(":focus")),this._id=Math.round(99999*Math.random()),this.contentParsed=l(document.createElement("div")),this.lazyOpen||setTimeout(function(){t.open()},0)},_buildHTML:function(){var t=this;this._parseAnimation(this.animation,"o"),this._parseAnimation(this.closeAnimation,"c"),this._parseBgDismissAnimation(this.backgroundDismissAnimation),this._parseColumnClass(this.columnClass),this._parseTheme(this.theme),this._parseType(this.type);var e=l(this.template);e.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed),this.typeAnimated&&e.find(".jconfirm-box").addClass("jconfirm-type-animated"),this.useBootstrap?(e.find(".jc-bs3-row").addClass(this.bootstrapClasses.row),e.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center"),e.find(".jconfirm-box-container").addClass(this.columnClassParsed),this.containerFluid?e.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid):e.find(".jc-bs3-container").addClass(this.bootstrapClasses.container)):e.find(".jconfirm-box").css("width",this.boxWidth),this.titleClass&&e.find(".jconfirm-title-c").addClass(this.titleClass),e.addClass(this.themeParsed);var n="jconfirm-box"+this._id;e.find(".jconfirm-box").attr("aria-labelledby",n).attr("tabindex",-1),e.find(".jconfirm-content").attr("id",n),null!==this.bgOpacity&&e.find(".jconfirm-bg").css("opacity",this.bgOpacity),this.rtl&&e.addClass("jconfirm-rtl"),this.$el=e.appendTo(this.container),this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container"),this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box"),this.$jconfirmBg=this.$el.find(".jconfirm-bg"),this.$title=this.$el.find(".jconfirm-title"),this.$titleContainer=this.$el.find(".jconfirm-title-c"),this.$content=this.$el.find("div.jconfirm-content"),this.$contentPane=this.$el.find(".jconfirm-content-pane"),this.$icon=this.$el.find(".jconfirm-icon-c"),this.$closeIcon=this.$el.find(".jconfirm-closeIcon"),this.$holder=this.$el.find(".jconfirm-holder"),this.$btnc=this.$el.find(".jconfirm-buttons"),this.$scrollPane=this.$el.find(".jconfirm-scrollpane"),t.setStartingPoint(),this._contentReady=l.Deferred(),this._modalReady=l.Deferred(),this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom}),this.setTitle(),this.setIcon(),this._setButtons(),this._parseContent(),this.initDraggable(),this.isAjax&&this.showLoading(!1),l.when(this._contentReady,this._modalReady).then(function(){t.isAjaxLoading?setTimeout(function(){t.isAjaxLoading=!1,t.setContent(),t.setTitle(),t.setIcon(),setTimeout(function(){t.hideLoading(!1),t._updateContentMaxHeight()},100),"function"==typeof t.onContentReady&&t.onContentReady()},50):(t._updateContentMaxHeight(),t.setTitle(),t.setIcon(),"function"==typeof t.onContentReady&&t.onContentReady()),t.autoClose&&t._startCountDown()}).then(function(){t._watchContent()}),"none"===this.animation&&(this.animationSpeed=1,this.animationBounce=1),this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce)),this.$contentPane.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1))},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(t){this.typeParsed=this._typePrefix+t},setType:function(t){var e=this.typeParsed;this._parseType(t),this.$jconfirmBox.removeClass(e).addClass(this.typeParsed)},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(t){var e=this.theme;this.theme=t||this.theme,this._parseTheme(this.theme),e&&this.$el.removeClass(e),this.$el.addClass(this.themeParsed),this.theme=t},_parseTheme:function(n){var i=this;n=n.split(","),l.each(n,function(t,e){-1===e.indexOf(i._themePrefix)&&(n[t]=i._themePrefix+l.trim(e))}),this.themeParsed=n.join(" ").toLowerCase()},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(t){var n=t.split(","),i=this;l.each(n,function(t,e){-1===e.indexOf(i._bgDismissPrefix)&&(n[t]=i._bgDismissPrefix+l.trim(e))}),this.backgroundDismissAnimationParsed=n.join(" ").toLowerCase()},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(t){this.animation=t||this.animation,this._parseAnimation(this.animation,"o")},_parseAnimation:function(t,e){e=e||"o";var n=t.split(","),i=this;l.each(n,function(t,e){-1===e.indexOf(i._animationPrefix)&&(n[t]=i._animationPrefix+l.trim(e))});var r=n.join(" ").toLowerCase();return"o"===e?this.animationParsed=r:this.closeAnimationParsed=r,r},setCloseAnimation:function(t){this.closeAnimation=t||this.closeAnimation,this._parseAnimation(this.closeAnimation,"c")},setAnimationSpeed:function(t){this.animationSpeed=t||this.animationSpeed},columnClassParsed:"",setColumnClass:function(t){this.useBootstrap?(this.columnClass=t||this.columnClass,this._parseColumnClass(this.columnClass),this.$jconfirmBoxContainer.addClass(this.columnClassParsed)):console.warn("cannot set columnClass, useBootstrap is set to false")},_updateContentMaxHeight:function(){var t=l(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":t+"px"})},setBoxWidth:function(t){this.useBootstrap?console.warn("cannot set boxWidth, useBootstrap is set to true"):(this.boxWidth=t,this.$jconfirmBox.css("width",t))},_parseColumnClass:function(t){var e;switch(t=t.toLowerCase()){case"xl":case"xlarge":e="col-md-12";break;case"l":case"large":e="col-md-8 col-md-offset-2";break;case"m":case"medium":e="col-md-6 col-md-offset-3";break;case"s":case"small":e="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":e="col-md-2 col-md-offset-5";break;default:e=t}this.columnClassParsed=e},initDraggable:function(){var e=this,n=this.$titleContainer;this.resetDrag(),this.draggable&&(n.on("mousedown",function(t){n.addClass("jconfirm-hand"),e.mouseX=t.clientX,e.mouseY=t.clientY,e.isDrag=!0}),l(window).on("mousemove."+this._id,function(t){e.isDrag&&(e.movingX=t.clientX-e.mouseX+e.initialX,e.movingY=t.clientY-e.mouseY+e.initialY,e.setDrag())}),l(window).on("mouseup."+this._id,function(){n.removeClass("jconfirm-hand"),e.isDrag&&(e.isDrag=!1,e.initialX=e.movingX,e.initialY=e.movingY)}))},resetDrag:function(){this.isDrag=!1,this.initialX=0,this.initialY=0,this.movingX=0,this.movingY=0,this.mouseX=0,this.mouseY=0,this.$jconfirmBoxContainer.css("transform","translate(0px, 0px)")},setDrag:function(){if(this.draggable){this.alignMiddle=!1;var t=this.$jconfirmBox.outerWidth(),e=this.$jconfirmBox.outerHeight(),n=l(window).width(),i=l(window).height(),r=this,o=1;if(r.movingX%o==0||r.movingY%o==0){if(r.dragWindowBorder){var a=n/2-t/2,s=i/2-e/2;s-=r.dragWindowGap,(a-=r.dragWindowGap)+r.movingX<0?r.movingX=-a:a-r.movingX<0&&(r.movingX=a),s+r.movingY<0?r.movingY=-s:s-r.movingY<0&&(r.movingY=s)}r.$jconfirmBoxContainer.css("transform","translate("+r.movingX+"px, "+r.movingY+"px)")}}},_scrollTop:function(){if("undefined"!=typeof pageYOffset)return pageYOffset;var t=document.body,e=document.documentElement;return(e=e.clientHeight?e:t).scrollTop},_watchContent:function(){var n=this;this._timer&&clearInterval(this._timer);var i=0;this._timer=setInterval(function(){if(n.smoothContent){var t=n.$content.outerHeight()||0;t!==i&&(i=t);var e=l(window).height();n.offsetTop+n.offsetBottom+n.$jconfirmBox.height()-n.$contentPane.height()+n.$content.height()<e?n.$contentPane.addClass("no-scroll"):n.$contentPane.removeClass("no-scroll")}},this.watchInterval)},_overflowClass:"jconfirm-overflow",_hilightAnimating:!1,highlight:function(){this.hiLightModal()},hiLightModal:function(){var t=this;if(!this._hilightAnimating){t.$body.addClass("hilight");var e=parseFloat(t.$body.css("animation-duration"))||2;this._hilightAnimating=!0,setTimeout(function(){t._hilightAnimating=!1,t.$body.removeClass("hilight")},1e3*e)}},_bindEvents:function(){var r=this;this.boxClicked=!1,this.$scrollPane.click(function(){if(!r.boxClicked){var t,e=!1,n=!1;if("string"==typeof(t="function"==typeof r.backgroundDismiss?r.backgroundDismiss():r.backgroundDismiss)&&"undefined"!=typeof r.buttons[t]?(e=t,n=!1):n=void 0===t||!0==!!t,e){var i=r.buttons[e].action.apply(r);n=void 0===i||!!i}n?r.close():r.hiLightModal()}r.boxClicked=!1}),this.$jconfirmBox.click(function(){r.boxClicked=!0});var e=!1;l(window).on("jcKeyDown."+r._id,function(){e||(e=!0)}),l(window).on("keyup."+r._id,function(t){e&&(r.reactOnKey(t),e=!1)}),l(window).on("resize."+this._id,function(){r._updateContentMaxHeight(),setTimeout(function(){r.resetDrag()},100)})},_cubic_bezier:"0.36, 0.55, 0.19",_getCSS:function(t,e){return{"-webkit-transition-duration":t/1e3+"s","transition-duration":t/1e3+"s","-webkit-transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+e+")","transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+e+")"}},_setButtons:function(){var o=this,i=0;if("object"!=typeof this.buttons&&(this.buttons={}),l.each(this.buttons,function(n,t){i+=1,"function"==typeof t&&(o.buttons[n]=t={action:t}),o.buttons[n].text=t.text||n,o.buttons[n].btnClass=t.btnClass||"btn-default",o.buttons[n].action=t.action||function(){},o.buttons[n].keys=t.keys||[],o.buttons[n].isHidden=t.isHidden||!1,o.buttons[n].isDisabled=t.isDisabled||!1,l.each(o.buttons[n].keys,function(t,e){o.buttons[n].keys[t]=e.toLowerCase()});var e=l('<button type="button" class="btn"></button>').html(o.buttons[n].text).addClass(o.buttons[n].btnClass).prop("disabled",o.buttons[n].isDisabled).css("display",o.buttons[n].isHidden?"none":"").click(function(t){t.preventDefault();var e=o.buttons[n].action.apply(o,[o.buttons[n]]);o.onAction.apply(o,[n,o.buttons[n]]),o._stopCountDown(),(void 0===e||e)&&o.close()});o.buttons[n].el=e,o.buttons[n].setText=function(t){e.html(t)},o.buttons[n].addClass=function(t){e.addClass(t)},o.buttons[n].removeClass=function(t){e.removeClass(t)},o.buttons[n].disable=function(){o.buttons[n].isDisabled=!0,e.prop("disabled",!0)},o.buttons[n].enable=function(){o.buttons[n].isDisabled=!1,e.prop("disabled",!1)},o.buttons[n].show=function(){o.buttons[n].isHidden=!1,e.css("display","")},o.buttons[n].hide=function(){o.buttons[n].isHidden=!0,e.css("display","none")},o["$_"+n]=o["$$"+n]=e,o.$btnc.append(e)}),0===i&&this.$btnc.hide(),null===this.closeIcon&&0===i&&(this.closeIcon=!0),this.closeIcon){if(this.closeIconClass){var t='<i class="'+this.closeIconClass+'"></i>';this.$closeIcon.html(t)}this.$closeIcon.click(function(t){t.preventDefault();var e,n=!1,i=!1;if("string"==typeof(e="function"==typeof o.closeIcon?o.closeIcon():o.closeIcon)&&"undefined"!=typeof o.buttons[e]?(n=e,i=!1):i=void 0===e||!0==!!e,n){var r=o.buttons[n].action.apply(o);i=void 0===r||!!r}i&&o.close()}),this.$closeIcon.show()}else this.$closeIcon.hide()},setTitle:function(t,e){if(e=e||!1,void 0!==t)if("string"==typeof t)this.title=t;else if("function"==typeof t){"function"==typeof t.promise&&console.error("Promise was returned from title function, this is not supported.");var n=t();this.title="string"==typeof n&&n}else this.title=!1;this.isAjaxLoading&&!e||(this.$title.html(this.title||""),this.updateTitleContainer())},setIcon:function(t,e){if(e=e||!1,void 0!==t)if("string"==typeof t)this.icon=t;else if("function"==typeof t){var n=t();this.icon="string"==typeof n&&n}else this.icon=!1;this.isAjaxLoading&&!e||(this.$icon.html(this.icon?'<i class="'+this.icon+'"></i>':""),this.updateTitleContainer())},updateTitleContainer:function(){this.title||this.icon?this.$titleContainer.show():this.$titleContainer.hide()},setContentPrepend:function(t){t&&this.contentParsed.prepend(t)},setContentAppend:function(t){t&&this.contentParsed.append(t)},setContent:function(t,e){e=!!e;var n=this;t&&this.contentParsed.html("").append(t),this.isAjaxLoading&&!e||(this.$content.html(""),this.$content.append(this.contentParsed),setTimeout(function(){n.$body.find("input[autofocus]:visible:first").focus()},100))},loadingSpinner:!1,showLoading:function(t){this.loadingSpinner=!0,this.$jconfirmBox.addClass("loading"),t&&this.$btnc.find("button").prop("disabled",!0)},hideLoading:function(t){this.loadingSpinner=!1,this.$jconfirmBox.removeClass("loading"),t&&this.$btnc.find("button").prop("disabled",!1)},ajaxResponse:!1,contentParsed:"",isAjax:!1,isAjaxLoading:!1,_parseContent:function(){var i=this,t=" ";if("function"==typeof this.content){var e=this.content.apply(this);"string"==typeof e?this.content=e:("object"==typeof e&&"function"==typeof e.always&&(this.isAjax=!0,this.isAjaxLoading=!0,e.always(function(t,e,n){i.ajaxResponse={data:t,status:e,xhr:n},i._contentReady.resolve(t,e,n),"function"==typeof i.contentLoaded&&i.contentLoaded(t,e,n)})),this.content=t)}if("string"==typeof this.content&&"url:"===this.content.substr(0,4).toLowerCase()){this.isAjax=!0,this.isAjaxLoading=!0;var n=this.content.substring(4,this.content.length);l.get(n).done(function(t){i.contentParsed.html(t)}).always(function(t,e,n){i.ajaxResponse={data:t,status:e,xhr:n},i._contentReady.resolve(t,e,n),"function"==typeof i.contentLoaded&&i.contentLoaded(t,e,n)})}this.content||(this.content=t),this.isAjax||(this.contentParsed.html(this.content),this.setContent(),i._contentReady.resolve())},_stopCountDown:function(){clearInterval(this.autoCloseInterval),this.$cd&&this.$cd.remove()},_startCountDown:function(){var t=this,e=this.autoClose.split("|");if(2!==e.length)return console.error("Invalid option for autoClose. example 'close|10000'"),!1;var n=e[0],i=parseInt(e[1]);if("undefined"==typeof this.buttons[n])return console.error("Invalid button key '"+n+"' for autoClose"),!1;var r=Math.ceil(i/1e3);this.$cd=l('<span class="countdown"> ('+r+")</span>").appendTo(this["$_"+n]),this.autoCloseInterval=setInterval(function(){t.$cd.html(" ("+(r-=1)+") "),r<=0&&(t["$$"+n].trigger("click"),t._stopCountDown())},1e3)},_getKey:function(t){switch(t){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space"}var e=String.fromCharCode(t);return!!/^[A-z0-9]+$/.test(e)&&e.toLowerCase()},reactOnKey:function(t){var n=this,e=l(".jconfirm");if(e.eq(e.length-1)[0]!==this.$el[0])return!1;var i=t.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(i))return!1;var r,o=this._getKey(i);"esc"===o&&this.escapeKey&&(!0===this.escapeKey?this.$scrollPane.trigger("click"):"string"!=typeof this.escapeKey&&"function"!=typeof this.escapeKey||(r="function"==typeof this.escapeKey?this.escapeKey():this.escapeKey)&&("undefined"==typeof this.buttons[r]?console.warn("Invalid escapeKey, no buttons found with key "+r):this["$_"+r].trigger("click")));l.each(this.buttons,function(t,e){-1!==e.keys.indexOf(o)&&n["$_"+t].trigger("click")})},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables")},_unwatchContent:function(){clearInterval(this._timer)},close:function(t){var a=this;return"function"==typeof this.onClose&&this.onClose(t),this._unwatchContent(),l(window).unbind("resize."+this._id),l(window).unbind("keyup."+this._id),l(window).unbind("jcKeyDown."+this._id),this.draggable&&(l(window).unbind("mousemove."+this._id),l(window).unbind("mouseup."+this._id),this.$titleContainer.unbind("mousedown")),a.$el.removeClass(a.loadedClass),l("body").removeClass("jconfirm-no-scroll-"+a._id),a.$jconfirmBoxContainer.removeClass("jconfirm-no-transition"),setTimeout(function(){a.$body.addClass(a.closeAnimationParsed),a.$jconfirmBg.addClass("jconfirm-bg-h");var t="none"===a.closeAnimation?1:a.animationSpeed;setTimeout(function(){a.$el.remove();u.jconfirm.instances;for(var t=u.jconfirm.instances.length-1;0<=t;t--)u.jconfirm.instances[t]._id===a._id&&u.jconfirm.instances.splice(t,1);if(!u.jconfirm.instances.length&&a.scrollToPreviousElement&&u.jconfirm.lastFocused&&u.jconfirm.lastFocused.length&&l.contains(document,u.jconfirm.lastFocused[0])){var e=u.jconfirm.lastFocused;if(a.scrollToPreviousElementAnimate){var n=l(window).scrollTop(),i=u.jconfirm.lastFocused.offset().top,r=l(window).height();if(n<i&&i<n+r)e.focus();else{var o=i-Math.round(r/3);l("html, body").animate({scrollTop:o},a.animationSpeed,"swing",function(){e.focus()})}}else e.focus();u.jconfirm.lastFocused=!1}"function"==typeof a.onDestroy&&a.onDestroy()},.4*t)},50),!0},open:function(){return!this.isOpen()&&(this._buildHTML(),this._bindEvents(),this._open(),!0)},setStartingPoint:function(){var t=!1;if(!0!==this.animateFromElement&&this.animateFromElement)t=this.animateFromElement,u.jconfirm.lastClicked=!1;else{if(!u.jconfirm.lastClicked||!0!==this.animateFromElement)return!1;t=u.jconfirm.lastClicked,u.jconfirm.lastClicked=!1}if(!t)return!1;var e=t.offset(),n=t.outerHeight()/2,i=t.outerWidth()/2;n-=this.$jconfirmBox.outerHeight()/2,i-=this.$jconfirmBox.outerWidth()/2;var r=e.top+n;r-=this._scrollTop();var o=e.left+i,a=l(window).height()/2,s=l(window).width()/2;if(r-=a-this.$jconfirmBox.outerHeight()/2,o-=s-this.$jconfirmBox.outerWidth()/2,Math.abs(r)>a||Math.abs(o)>s)return!1;this.$jconfirmBoxContainer.css("transform","translate("+o+"px, "+r+"px)")},_open:function(){var t=this;"function"==typeof t.onOpenBefore&&t.onOpenBefore(),this.$body.removeClass(this.animationParsed),this.$jconfirmBg.removeClass("jconfirm-bg-h"),this.$body.focus(),t.$jconfirmBoxContainer.css("transform","translate(0px, 0px)"),setTimeout(function(){t.$body.css(t._getCSS(t.animationSpeed,1)),t.$body.css({"transition-property":t.$body.css("transition-property")+", margin"}),t.$jconfirmBoxContainer.addClass("jconfirm-no-transition"),t._modalReady.resolve(),"function"==typeof t.onOpen&&t.onOpen(),t.$el.addClass(t.loadedClass)},this.animationSpeed)},loadedClass:"jconfirm-open",isClosed:function(){return!this.$el||0===this.$el.parent().length},isOpen:function(){return!this.isClosed()},toggle:function(){this.isOpen()?this.close():this.open()}},u.jconfirm.instances=[],u.jconfirm.lastFocused=!1;var n=!(u.jconfirm.pluginDefaults={template:'<div class="jconfirm"><div class="jconfirm-bg jconfirm-bg-h"></div><div class="jconfirm-scrollpane"><div class="jconfirm-row"><div class="jconfirm-cell"><div class="jconfirm-holder"><div class="jc-bs3-container"><div class="jc-bs3-row"><div class="jconfirm-box-container jconfirm-animated"><div class="jconfirm-box" role="dialog" aria-labelledby="labelled" tabindex="-1"><div class="jconfirm-closeIcon">×</div><div class="jconfirm-title-c"><span class="jconfirm-icon-c"></span><span class="jconfirm-title"></span></div><div class="jconfirm-content-pane"><div class="jconfirm-content"></div></div><div class="jconfirm-buttons"></div><div class="jconfirm-clear"></div></div></div></div></div></div></div></div></div></div>',title:"Hello",titleClass:"",type:"default",typeAnimated:!0,draggable:!0,dragWindowGap:15,dragWindowBorder:!0,animateFromElement:!0,alignMiddle:!0,smoothContent:!0,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:!1,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:!0,rtl:!1,container:"body",containerFluid:!1,backgroundDismiss:!1,backgroundDismissAnimation:"shake",autoClose:!1,closeIcon:null,closeIconClass:!1,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:!0,scrollToPreviousElementAnimate:!0,useBootstrap:!0,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}});l(window).on("keydown",function(t){if(!n){var e=!1;l(t.target).closest(".jconfirm-box").length&&(e=!0),e&&l(window).trigger("jcKeyDown"),n=!0}}),l(window).on("keyup",function(){n=!1}),u.jconfirm.lastClicked=!1,l(document).on("mousedown","button, a, [jc-source]",function(){u.jconfirm.lastClicked=l(this)})}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";function e(t){var e={},n={},i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);return i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),o&&(n.edge=!0,n.version=o[1]),a&&(n.weChat=!0),{browser:n,os:e,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!n.ie&&!n.edge,pointerEventsSupported:"onpointerdown"in window&&(n.edge||n.ie&&11<=n.version)}}function n(t,e){"createCanvas"===t&&(Bb=null),tw[t]=e}function L(t){if(null==t||"object"!=typeof t)return t;var e=t,n=Gb.call(t);if("[object Array]"===n){if(!M(t)){e=[];for(var i=0,r=t.length;i<r;i++)e[i]=L(t[i])}}else if(qb[n]){if(!M(t)){var o=t.constructor;if(t.constructor.from)e=o.from(t);else{e=new o(t.length);for(i=0,r=t.length;i<r;i++)e[i]=L(t[i])}}}else if(!$b[n]&&!M(t)&&!S(t))for(var a in e={},t)t.hasOwnProperty(a)&&(e[a]=L(t[a]));return e}function g(t,e,n){if(!b(e)||!b(t))return n?L(e):t;for(var i in e)if(e.hasOwnProperty(i)){var r=t[i],o=e[i];!b(o)||!b(r)||E(o)||E(r)||S(o)||S(r)||s(o)||s(r)||M(o)||M(r)?!n&&i in t||(t[i]=L(e[i],!0)):g(r,o,n)}return t}function c(t,e){for(var n=t[0],i=1,r=t.length;i<r;i++)n=g(n,t[i],e);return n}function O(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function D(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(n?null!=e[i]:null==t[i])&&(t[i]=e[i]);return t}function i(){return Bb||(Bb=ew().getContext("2d")),Bb}function x(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n}return-1}function o(t,e){function n(){}var i=t.prototype;for(var r in n.prototype=e.prototype,t.prototype=new n,i)t.prototype[r]=i[r];(t.prototype.constructor=t).superClass=e}function r(t,e,n){D(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,n)}function P(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function k(t,e,n){if(t&&e)if(
|
|
t.forEach&&t.forEach===Zb)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function A(t,e,n){if(t&&e){if(t.map&&t.map===Qb)return t.map(e,n);for(var i=[],r=0,o=t.length;r<o;r++)i.push(e.call(n,t[r],r,t));return i}}function p(t,e,n,i){if(t&&e){if(t.reduce&&t.reduce===Jb)return t.reduce(e,n,i);for(var r=0,o=t.length;r<o;r++)n=e.call(i,n,t[r],r,t);return n}}function f(t,e,n){if(t&&e){if(t.filter&&t.filter===Xb)return t.filter(e,n);for(var i=[],r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t)&&i.push(t[r]);return i}}function a(t,e,n){if(t&&e)for(var i=0,r=t.length;i<r;i++)if(e.call(n,t[i],i,t))return t[i]}function v(t,e){var n=Kb.call(arguments,2);return function(){return t.apply(e,n.concat(Kb.call(arguments)))}}function y(t){var e=Kb.call(arguments,1);return function(){return t.apply(this,e.concat(Kb.call(arguments)))}}function E(t){return"[object Array]"===Gb.call(t)}function m(t){return"function"==typeof t}function w(t){return"[object String]"===Gb.call(t)}function b(t){var e=typeof t;return"function"===e||!!t&&"object"==e}function s(t){return!!$b[Gb.call(t)]}function _(t){return!!qb[Gb.call(t)]}function S(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function C(t){return t!=t}function N(){for(var t=0,e=arguments.length;t<e;t++)if(null!=arguments[t])return arguments[t]}function R(t,e){return null!=t?t:e}function F(t,e,n){return null!=t?t:null!=e?e:n}function l(){return Function.call.apply(Kb,arguments)}function u(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function T(t,e){if(!t)throw new Error(e)}function h(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function d(t){t[nw]=!0}function M(t){return t[nw]}function I(t){function e(t,e){n?i.set(t,e):i.set(e,t)}var n=E(t),i=this;t instanceof I?t.each(e):t&&k(t,e)}function z(t){return new I(t)}function H(t,e){for(var n=new t.constructor(t.length+e.length),i=0;i<t.length;i++)n[i]=t[i];var r=t.length;for(i=0;i<e.length;i++)n[i+r]=e[i];return n}function B(){}function V(t,e){var n=new rw(2);return null==t&&(t=0),null==e&&(e=0),n[0]=t,n[1]=e,n}function j(t,e){return t[0]=e[0],t[1]=e[1],t}function W(t){var e=new rw(2);return e[0]=t[0],e[1]=t[1],e}function U(t,e,n){return t[0]=e,t[1]=n,t}function $(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function q(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t}function G(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function Y(t){return Math.sqrt(Z(t))}function Z(t){return t[0]*t[0]+t[1]*t[1]}function X(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function K(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function Q(t,e){return t[0]*e[0]+t[1]*e[1]}function J(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function tt(t,e){var n=Y(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t}function et(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function nt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function it(t,e){return t[0]=-e[0],t[1]=-e[1],t}function rt(t,e,n,i){return t[0]=e[0]+i*(n[0]-e[0]),t[1]=e[1]+i*(n[1]-e[1]),t}function ot(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function at(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function st(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function lt(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this),this.on("globalout",this._dragEnd,this)}function ut(t,e){return{target:t,topTarget:e&&e.topTarget}}function ct(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which}}function ht(){}function dt(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var i,r=t;r;){if(r.clipPath&&!r.clipPath.contain(e,n))return!1;r.silent&&(i=!0),r=r.parent}return!i||dw}return!1}function ft(){var t=new gw(6);return pt(t),t}function pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function mt(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function vt(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function yt(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],u=Math.sin(n),c=Math.cos(n);return t[0]=i*c+a*u,t[1]=-i*u+a*c,t[2]=r*c+s*u,t[3]=-r*u+c*s,t[4]=c*o+u*l,t[5]=c*l-u*o,t}function xt(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function bt(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function wt(t){var e=ft();return gt(e,t),e}function _t(t){return yw<t||t<-yw}function St(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function Ct(t){return(t=Math.round(t))<0?0:255<t?255:t}function Tt(t){return(t=Math.round(t))<0?0:360<t?360:t}function At(t){return t<0?0:1<t?1:t}function Dt(t){return t.length&&"%"===t.charAt(t.length-1)?Ct(parseFloat(t)/100*255):Ct(parseInt(t,10))}function Mt(t){return t.length&&"%"===t.charAt(t.length-1)?At(parseFloat(t)/100):At(parseFloat(t))}function It(t,e,n){return n<0?n+=1:1<n&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function kt(t,e,n){return t+(e-t)*n}function Et(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Ot(t,e){kw&&Lt(kw,e),kw=Iw.put(t,kw||e.slice())}function Pt(t,e){if(t){e=e||[];var n=Iw.get(t);if(n)return Lt(e,n);var i,r=(t+="").replace(/ /g,"").toLowerCase();if(r in Mw)return Lt(e,Mw[r]),Ot(t,e),e;if("#"===r.charAt(0))return 4===r.length?0<=(i=parseInt(r.substr(1),16))&&i<=4095?(Et(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),Ot(t,e),e):void Et(e,0,0,0,1):7===r.length?0<=(i=parseInt(r.substr(1),16))&&i<=16777215?(Et(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),Ot(t,e),e):void Et(e,0,0,0,1):void 0;var o=r.indexOf("("),a=r.indexOf(")");if(-1!==o&&a+1===r.length){var s=r.substr(0,o),l=r.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Et(e,0,0,0,1);u=Mt(l.pop());case"rgb":return 3!==l.length?void Et(e,0,0,0,1):(Et(e,Dt(l[0]),Dt(l[1]),Dt(l[2]),u),Ot(t,e),e);case"hsla":return 4!==l.length?void Et(e,0,0,0,1):(l[3]=Mt(l[3]),Nt(l,e),Ot(t,e),e);case"hsl":return 3!==l.length?void Et(e,0,0,0,1):(Nt(l,e),Ot(t,e),e);default:return}}Et(e,0,0,0,1)}}function Nt(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=Mt(t[1]),r=Mt(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return Et(e=e||[],Ct(255*It(a,o,n+1/3)),Ct(255*It(a,o,n)),Ct(255*It(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Rt(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)n=e=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+c-d:o===s&&(e=2/3+h-c),e<0&&(e+=1),1<e&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}function Ft(t,e){var n=Pt(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255<n[i]?n[i]=255:t[i]<0&&(n[i]=0);return Wt(n,4===n.length?"rgba":"rgb")}}function zt(t){var e=Pt(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ht(t,e,n){if(e&&e.length&&0<=t&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=Ct(kt(a[0],s[0],l)),n[1]=Ct(kt(a[1],s[1],l)),n[2]=Ct(kt(a[2],s[2],l)),n[3]=At(kt(a[3],s[3],l)),n}}function Bt(t,e,n){if(e&&e.length&&0<=t&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Pt(e[r]),s=Pt(e[o]),l=i-r,u=Wt([Ct(kt(a[0],s[0],l)),Ct(kt(a[1],s[1],l)),Ct(kt(a[2],s[2],l)),At(kt(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}function Vt(t,e,n,i){if(t=Pt(t))return t=Rt(t),null!=e&&(t[0]=Tt(e)),null!=n&&(t[1]=Mt(n)),null!=i&&(t[2]=Mt(i)),Wt(Nt(t),"rgba")}function jt(t,e){if((t=Pt(t))&&null!=e)return t[3]=At(e),Wt(t,"rgba")}function Wt(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Ut(t,e){return t[e]}function $t(t,e,n){t[e]=n}function qt(t,e,n){return(e-t)*n+t}function Gt(t,e,n){return.5<n?e:t}function Yt(t,e,n,i,r){var o=t.length;if(1==r)for(var a=0;a<o;a++)i[a]=qt(t[a],e[a],n);else{var s=o&&t[0].length;for(a=0;a<o;a++)for(var l=0;l<s;l++)i[a][l]=qt(t[a][l],e[a][l],n)}}function Zt(t,e,n){var i=t.length,r=e.length;if(i!==r)if(r<i)t.length=r;else for(var o=i;o<r;o++)t.push(1===n?e[o]:Pw.call(e[o]));var a=t[0]&&t[0].length;for(o=0;o<t.length;o++)if(1===n)isNaN(t[o])&&(t[o]=e[o]);else for(var s=0;s<a;s++)isNaN(t[o][s])&&(t[o][s]=e[o][s])}function Xt(t,e,n){if(t===e)return!0;var i=t.length;if(i!==e.length)return!1;if(1===n){for(var r=0;r<i;r++)if(t[r]!==e[r])return!1}else{var o=t[0].length;for(r=0;r<i;r++)for(var a=0;a<o;a++)if(t[r][a]!==e[r][a])return!1}return!0}function Kt(t,e,n,i,r,o,a,s,l){var u=t.length;if(1==l)for(var c=0;c<u;c++)s[c]=Qt(t[c],e[c],n[c],i[c],r,o,a);else{var h=t[0].length;for(c=0;c<u;c++)for(var d=0;d<h;d++)s[c][d]=Qt(t[c][d],e[c][d],n[c][d],i[c][d],r,o,a)}}function Qt(t,e,n,i,r,o,a){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*a+(-3*(e-n)-2*s-l)*o+s*r+e}function Jt(t){if(P(t)){var e=t.length;if(P(t[0])){for(var n=[],i=0;i<e;i++)n.push(Pw.call(t[i]));return n}return Pw.call(t)}return t}function te(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function ee(t){var e=t[t.length-1].value;return P(e&&e[0])?2:1}function ne(t,e,n,i,o,r){var a=t._getter,s=t._setter,l="spline"===e,u=i.length;if(u){var c,h=P(i[0].value),d=!1,f=!1,p=h?ee(i):0;i.sort(function(t,e){return t.time-e.time}),c=i[u-1].time;for(var g=[],m=[],v=i[0].value,y=!0,x=0;x<u;x++){g.push(i[x].time/c);var b=i[x].value;if(h&&Xt(b,v,p)||!h&&b===v||(y=!1),"string"==typeof(v=b)){var w=Pt(b);w?(b=w,d=!0):f=!0}m.push(b)}if(r||!y){var _=m[u-1];for(x=0;x<u-1;x++)h?Zt(m[x],_,p):!isNaN(m[x])||isNaN(_)||f||d||(m[x]=_);h&&Zt(a(t._target,o),_,p);var S,C,T,A,D,M=0,I=0;if(d)var k=[0,0,0,0];var E=function(t,e){var n;if(e<0)n=0;else if(e<I){for(n=Math.min(M+1,u-1);0<=n&&!(g[n]<=e);n--);n=Math.min(n,u-2)}else{for(n=M;n<u&&!(g[n]>e);n++);n=Math.min(n-1,u-2)}I=e;var i=g[(M=n)+1]-g[n];if(0!==i)if(S=(e-g[n])/i,l)if(T=m[n],C=m[0===n?n:n-1],A=m[u-2<n?u-1:n+1],D=m[u-3<n?u-1:n+2],h)Kt(C,T,A,D,S,S*S,S*S*S,a(t,o),p);else{if(d)r=Kt(C,T,A,D,S,S*S,S*S*S,k,1),r=te(k);else{if(f)return Gt(T,A,S);r=Qt(C,T,A,D,S,S*S,S*S*S)}s(t,o,r)}else if(h)Yt(m[n],m[n+1],S,a(t,o),p);else{var r;if(d)Yt(m[n],m[n+1],S,k,1),r=te(k);else{if(f)return Gt(m[n],m[n+1],S);r=qt(m[n],m[n+1],S)}s(t,o,r)}},L=new St({target:t._target,life:c,loop:t._loop,delay:t._delay,onframe:E,ondestroy:n});return e&&"spline"!==e&&(L.easing=e),L}}}function ie(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}function re(t){for(var e=0;Kw<=t;)e|=1&t,t>>=1;return t+e}function oe(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r<n&&i(t[r],t[r-1])<0;)r++;ae(t,e,r)}else for(;r<n&&0<=i(t[r],t[r-1]);)r++;return r-e}function ae(t,e,n){for(n--;e<n;){var i=t[e];t[e++]=t[n],t[n--]=i}}function se(t,e,n,i,r){for(i===e&&i++;i<n;i++){for(var o,a=t[i],s=e,l=i;s<l;)r(a,t[o=s+l>>>1])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0<u;)t[s+u]=t[s+u-1],u--}t[s]=a}}function le(t,e,n,i,r,o){var a=0,s=0,l=1;if(0<o(t,e[n+r])){for(s=i-r;l<s&&0<o(t,e[n+r+l]);)(l=1+((a=l)<<1))<=0&&(l=s);s<l&&(l=s),a+=r,l+=r}else{for(s=r+1;l<s&&o(t,e[n+r-l])<=0;)(l=1+((a=l)<<1))<=0&&(l=s);s<l&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a<l;){var c=a+(l-a>>>1);0<o(t,e[n+c])?a=c+1:l=c}return l}function ue(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){for(s=r+1;l<s&&o(t,e[n+r-l])<0;)(l=1+((a=l)<<1))<=0&&(l=s);s<l&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l<s&&0<=o(t,e[n+r+l]);)(l=1+((a=l)<<1))<=0&&(l=s);s<l&&(l=s),a+=r,l+=r}for(a++;a<l;){var c=a+(l-a>>>1);o(t,e[n+c])<0?l=c:a=c+1}return l}function ce(p,g){function t(t,e){l[c]=t,u[c]=e,c+=1}function e(){for(;1<c;){var t=c-2;if(1<=t&&u[t-1]<=u[t]+u[t+1]||2<=t&&u[t-2]<=u[t]+u[t-1])u[t-1]<u[t+1]&&t--;else if(u[t]>u[t+1])break;i(t)}}function n(){for(;1<c;){var t=c-2;0<t&&u[t-1]<u[t+1]&&t--,i(t)}}function i(t){var e=l[t],n=u[t],i=l[t+1],r=u[t+1];u[t]=n+r,t===c-3&&(l[t+1]=l[t+2],u[t+1]=u[t+2]),c--;var o=ue(p[i],p,e,n,0,g);e+=o,0!==(n-=o)&&0!==(r=le(p[e+n-1],p,i,r,r-1,g))&&(n<=r?a(e,n,i,r):s(e,n,i,r))}function a(t,e,n,i){var r=0;for(r=0;r<e;r++)v[r]=p[t+r];var o=0,a=n,s=t;if(p[s++]=p[a++],0!=--i)if(1!==e){for(var l,u,c,h=m;;){u=l=0,c=!1;do{if(g(p[a],v[o])<0){if(p[s++]=p[a++],u++,(l=0)==--i){c=!0;break}}else if(p[s++]=v[o++],l++,u=0,1==--e){c=!0;break}}while((l|u)<h);if(c)break;do{if(0!==(l=ue(p[a],v,o,e,0,g))){for(r=0;r<l;r++)p[s+r]=v[o+r];if(s+=l,o+=l,(e-=l)<=1){c=!0;break}}if(p[s++]=p[a++],0==--i){c=!0;break}if(0!==(u=le(v[o],p,a,i,0,g))){for(r=0;r<u;r++)p[s+r]=p[a+r];if(s+=u,a+=u,0===(i-=u)){c=!0;break}}if(p[s++]=v[o++],1==--e){c=!0;break}h--}while(Qw<=l||Qw<=u);if(c)break;h<0&&(h=0),h+=2}if((m=h)<1&&(m=1),1===e){for(r=0;r<i;r++)p[s+r]=p[a+r];p[s+i]=v[o]}else{if(0===e)throw new Error;for(r=0;r<e;r++)p[s+r]=v[o+r]}}else{for(r=0;r<i;r++)p[s+r]=p[a+r];p[s+i]=v[o]}else for(r=0;r<e;r++)p[s+r]=v[o+r]}function s(t,e,n,i){var r=0;for(r=0;r<i;r++)v[r]=p[n+r];var o=t+e-1,a=i-1,s=n+i-1,l=0,u=0;if(p[s--]=p[o--],0!=--e)if(1!==i){for(var c=m;;){var h=0,d=0,f=!1;do{if(g(v[a],p[o])<0){if(p[s--]=p[o--],h++,(d=0)==--e){f=!0;break}}else if(p[s--]=v[a--],d++,h=0,1==--i){f=!0;break}}while((h|d)<c);if(f)break;do{if(0!==(h=e-ue(v[a],p,t,e,e-1,g))){for(e-=h,u=(s-=h)+1,l=(o-=h)+1,r=h-1;0<=r;r--)p[u+r]=p[l+r];if(0===e){f=!0;break}}if(p[s--]=v[a--],1==--i){f=!0;break}if(0!==(d=i-le(p[o],v,0,i,i-1,g))){for(i-=d,u=(s-=d)+1,l=(a-=d)+1,r=0;r<d;r++)p[u+r]=v[l+r];if(i<=1){f=!0;break}}if(p[s--]=p[o--],0==--e){f=!0;break}c--}while(Qw<=h||Qw<=d);if(f)break;c<0&&(c=0),c+=2}if((m=c)<1&&(m=1),1===i){for(u=(s-=e)+1,l=(o-=e)+1,r=e-1;0<=r;r--)p[u+r]=p[l+r];p[s]=v[a]}else{if(0===i)throw new Error;for(l=s-(i-1),r=0;r<i;r++)p[l+r]=v[r]}}else{for(u=(s-=e)+1,l=(o-=e)+1,r=e-1;0<=r;r--)p[u+r]=p[l+r];p[s]=v[a]}else for(l=s-(i-1),r=0;r<i;r++)p[l+r]=v[r]}var l,u,m=Qw,c=0,v=[];l=[],u=[],this.mergeRuns=e,this.forceMergeRuns=n,this.pushRun=t}function he(t,e,n,i){n||(n=0),i||(i=t.length);var r=i-n;if(!(r<2)){var o=0;if(r<Kw)se(t,n,i,n+(o=oe(t,n,i,e)),e);else{var a=new ce(t,e),s=re(r);do{if((o=oe(t,n,i,e))<s){var l=r;s<l&&(l=s),se(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}function de(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function fe(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),i=isNaN(i)?0:i,r=isNaN(r)?1:r,o=isNaN(o)?0:o,a=isNaN(a)?0:a,t.createLinearGradient(i,o,r,a)}function pe(t,e,n){var i=n.width,r=n.height,o=Math.min(i,r),a=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(a=a*i+n.x,s=s*r+n.y,l*=o),t.createRadialGradient(a,s,0,a,s,l)}function ge(){return!1}function me(t,e,n){var i=ew(),r=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left=0,a.top=0,a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=o*n,i}function ve(t){if("string"!=typeof t)return t;var e=c_.get(t);return e&&e.image}function ye(t,e,n,i,r){if(t){if("string"!=typeof t)return t;if(e&&e.__zrImageSrc===t||!n)return e;var o=c_.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?!be(e=o.image)&&o.pending.push(a):(!e&&(e=new Image),e.onload=xe,c_.put(t,e.__cachedImgObj={image:e,pending:[a]}),e.src=e.__zrImageSrc=t),e}return e}function xe(){var t=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var n=t.pending[e],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}t.pending.length=0}function be(t){return t&&t.width&&t.height}function we(t,e){m_[t]=e}function _e(t,e){var n=t+":"+(e=e||g_);if(h_[n])return h_[n];for(var i=(t+"").split("\n"),r=0,o=0,a=i.length;o<a;o++)r=Math.max(Pe(i[o],e).width,r);return f_<d_&&(d_=0,h_={}),d_++,h_[n]=r}function Se(t,e,n,i,r,o,a){return o?Te(t,e,n,i,r,o,a):Ce(t,e,n,i,r,a)}function Ce(t,e,n,i,r,o){var a=Ne(t,e,r,o),s=_e(t,e);r&&(s+=r[1]+r[3]);var l=a.outerHeight,u=new ie(Ae(0,s,n),De(0,l,i),s,l);return u.lineHeight=a.lineHeight,u}function Te(t,e,n,i,r,o,a){var s=Re(t,{rich:o,truncate:a,font:e,textAlign:n,textPadding:r}),l=s.outerWidth,u=s.outerHeight;return new ie(Ae(0,l,n),De(0,u,i),l,u)}function Ae(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function De(t,e,n){return"middle"===n?t-=e/2:"bottom"===n&&(t-=e),t}function Me(t,e,n){var i=e.x,r=e.y,o=e.height,a=e.width,s=o/2,l="left",u="top";switch(t){case"left":i-=n,r+=s,l="right",u="middle";break;case"right":i+=n+a,r+=s,u="middle";break;case"top":i+=a/2,r-=n,l="center",u="bottom";break;case"bottom":i+=a/2,r+=o+n,l="center";break;case"inside":i+=a/2,r+=s,l="center",u="middle";break;case"insideLeft":i+=n,r+=s,u="middle";break;case"insideRight":i+=a-n,r+=s,l="right",u="middle";break;case"insideTop":i+=a/2,r+=n,l="center";break;case"insideBottom":i+=a/2,r+=o-n,l="center",u="bottom";break;case"insideTopLeft":i+=n,r+=n;break;case"insideTopRight":i+=a-n,r+=n,l="right";break;case"insideBottomLeft":i+=n,r+=o-n,u="bottom";break;case"insideBottomRight":i+=a-n,r+=o-n,l="right",u="bottom"}return{x:i,y:r,textAlign:l,textVerticalAlign:u}}function Ie(t,e,n,i,r){if(!e)return"";var o=(t+"").split("\n");r=ke(e,n,i,r);for(var a=0,s=o.length;a<s;a++)o[a]=Ee(o[a],r);return o.join("\n")}function ke(t,e,n,i){(i=O({},i)).font=e;n=R(n,"...");i.maxIterations=R(i.maxIterations,2);var r=i.minChar=R(i.minChar,0);i.cnCharWidth=_e("\u56fd",e);var o=i.ascCharWidth=_e("a",e);i.placeholder=R(i.placeholder,"");for(var a=t=Math.max(0,t-1),s=0;s<r&&o<=a;s++)a-=o;var l=_e(n);return a<l&&(n="",l=0),a=t-l,i.ellipsis=n,i.ellipsisWidth=l,i.contentWidth=a,i.containerWidth=t,i}function Ee(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var o=_e(t,i);if(o<=n)return t;for(var a=0;;a++){if(o<=r||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?Le(t,r,e.ascCharWidth,e.cnCharWidth):0<o?Math.floor(t.length*r/o):0;o=_e(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function Le(t,e,n,i){for(var r=0,o=0,a=t.length;o<a&&r<e;o++){var s=t.charCodeAt(o);r+=0<=s&&s<=127?n:i}return o}function Oe(t){return _e("\u56fd",t)}function Pe(t,e){return m_.measureText(t,e)}function Ne(t,e,n,i){null!=t&&(t+="");var r=Oe(e),o=t?t.split("\n"):[],a=o.length*r,s=a;if(n&&(s+=n[0]+n[2]),t&&i){var l=i.outerHeight,u=i.outerWidth;if(null!=l&&l<s)t="",o=[];else if(null!=u)for(var c=ke(u-(n?n[1]+n[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),h=0,d=o.length;h<d;h++)o[h]=Ee(o[h],c)}return{lines:o,height:a,outerHeight:s,lineHeight:r}}function Re(t,e){var n={lines:[],width:0,height:0};if(null!=t&&(t+=""),!t)return n;for(var i,r=p_.lastIndex=0;null!=(i=p_.exec(t));){var o=i.index;r<o&&Fe(n,t.substring(r,o)),Fe(n,i[2],i[1]),r=p_.lastIndex}r<t.length&&Fe(n,t.substring(r,t.length));var a=n.lines,s=0,l=0,u=[],c=e.textPadding,h=e.truncate,d=h&&h.outerWidth,f=h&&h.outerHeight;c&&(null!=d&&(d-=c[1]+c[3]),null!=f&&(f-=c[0]+c[2]));for(var p=0;p<a.length;p++){for(var g=a[p],m=0,v=0,y=0;y<g.tokens.length;y++){var x=(I=g.tokens[y]).styleName&&e.rich[I.styleName]||{},b=I.textPadding=x.textPadding,w=I.font=x.font||e.font,_=I.textHeight=R(x.textHeight,Oe(w));if(b&&(_+=b[0]+b[2]),I.height=_,I.lineHeight=F(x.textLineHeight,e.textLineHeight,_),I.textAlign=x&&x.textAlign||e.textAlign,I.textVerticalAlign=x&&x.textVerticalAlign||"middle",null!=f&&s+I.lineHeight>f)return{lines:[],width:0,height:0};I.textWidth=_e(I.text,w);var S=x.textWidth,C=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))I.percentWidth=S,u.push(I),S=0;else{if(C){S=I.textWidth;var T=x.textBackgroundColor,A=T&&T.image;A&&be(A=ve(A))&&(S=Math.max(S,A.width*_/A.height))}var D=b?b[1]+b[3]:0;S+=D;var M=null!=d?d-v:null;null!=M&&M<S&&(!C||M<D?(I.text="",I.textWidth=S=0):(I.text=Ie(I.text,M-D,w,h.ellipsis,{minChar:h.minChar}),I.textWidth=_e(I.text,w),S=I.textWidth+D))}v+=I.width=S,x&&(m=Math.max(m,I.lineHeight))}g.width=v,s+=g.lineHeight=m,l=Math.max(l,v)}n.outerWidth=n.width=R(e.textWidth,l),n.outerHeight=n.height=R(e.textHeight,s),c&&(n.outerWidth+=c[1]+c[3],n.outerHeight+=c[0]+c[2]);for(p=0;p<u.length;p++){var I,k=(I=u[p]).percentWidth;I.width=parseInt(k,10)/100*l}return n}function Fe(t,e,n){for(var i=""===e,r=e.split("\n"),o=t.lines,a=0;a<r.length;a++){var s=r[a],l={styleName:n,text:s,isLineHolder:!s&&!i};if(a)o.push({tokens:[l]});else{var u=(o[o.length-1]||(o[0]={tokens:[]})).tokens,c=u.length;1===c&&u[0].isLineHolder?u[0]=l:(s||!c||i)&&u.push(l)}}}function ze(t){var e=(t.fontSize||t.fontFamily)&&[t.fontStyle,t.fontWeight,(t.fontSize||12)+"px",t.fontFamily||"sans-serif"].join(" ");return e&&h(e)||t.textFont||t.font}function He(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,c=e.height,h=e.r;u<0&&(s+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof h?n=i=r=o=h:h instanceof Array?1===h.length?n=i=r=o=h[0]:2===h.length?(n=r=h[0],i=o=h[1]):3===h.length?(n=h[0],i=o=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],o=h[3]):n=i=r=o=0,u<n+i&&(n*=u/(a=n+i),i*=u/a),u<r+o&&(r*=u/(a=r+o),o*=u/a),c<i+r&&(i*=c/(a=i+r),r*=c/a),c<n+o&&(n*=c/(a=n+o),o*=c/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+c-r),0!==r&&t.arc(s+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(s+o,l+c),0!==o&&t.arc(s+o,l+c-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}function Be(t){return Ve(t),k(t.rich,Ve),t}function Ve(t){if(t){t.font=ze(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||v_[e]?e:"left";var n=t.textVerticalAlign||t.textBaseline;"center"===n&&(n="middle"),t.textVerticalAlign=null==n||y_[n]?n:"top",t.textPadding&&(t.textPadding=u(t.textPadding))}}function je(t,e,n,i,r){i.rich?Ue(t,e,n,i,r):We(t,e,n,i,r)}function We(t,e,n,i,r){var o=Qe(e,"font",i.font||g_),a=i.textPadding,s=t.__textCotentBlock;s&&!t.__dirty||(s=t.__textCotentBlock=Ne(n,o,a,i.truncate));var l=s.outerHeight,u=s.lines,c=s.lineHeight,h=Ke(l,i,r),d=h.baseX,f=h.baseY,p=h.textAlign,g=h.textVerticalAlign;qe(e,i,r,d,f);var m=De(f,l,g),v=d,y=m,x=Ye(i);if(x||a){var b=_e(n,o);a&&(b+=a[1]+a[3]);var w=Ae(d,b,p);x&&Ze(t,e,i,w,m,b,l),a&&(v=nn(d,p,a),y+=a[0])}Qe(e,"textAlign",p||"left"),Qe(e,"textBaseline","middle"),Qe(e,"shadowBlur",i.textShadowBlur||0),Qe(e,"shadowColor",i.textShadowColor||"transparent"),Qe(e,"shadowOffsetX",i.textShadowOffsetX||0),Qe(e,"shadowOffsetY",i.textShadowOffsetY||0),y+=c/2;var _=i.textStrokeWidth,S=Je(i.textStroke,_),C=tn(i.textFill);S&&(Qe(e,"lineWidth",_),Qe(e,"strokeStyle",S)),C&&Qe(e,"fillStyle",C);for(var T=0;T<u.length;T++)S&&e.strokeText(u[T],v,y),C&&e.fillText(u[T],v,y),y+=c}function Ue(t,e,n,i,r){var o=t.__textCotentBlock;o&&!t.__dirty||(o=t.__textCotentBlock=Re(n,i)),$e(t,e,o,i,r)}function $e(t,e,n,i,r){var o=n.width,a=n.outerWidth,s=n.outerHeight,l=i.textPadding,u=Ke(s,i,r),c=u.baseX,h=u.baseY,d=u.textAlign,f=u.textVerticalAlign;qe(e,i,r,c,h);var p=Ae(c,a,d),g=De(h,s,f),m=p,v=g;l&&(m+=l[3],v+=l[0]);var y=m+o;Ye(i)&&Ze(t,e,i,p,g,a,s);for(var x=0;x<n.lines.length;x++){for(var b,w=n.lines[x],_=w.tokens,S=_.length,C=w.lineHeight,T=w.width,A=0,D=m,M=y,I=S-1;A<S&&(!(b=_[A]).textAlign||"left"===b.textAlign);)Ge(t,e,b,i,C,v,D,"left"),T-=b.width,D+=b.width,A++;for(;0<=I&&"right"===(b=_[I]).textAlign;)Ge(t,e,b,i,C,v,M,"right"),T-=b.width,M-=b.width,I--;for(D+=(o-(D-m)-(y-M)-T)/2;A<=I;)Ge(t,e,b=_[A],i,C,v,D+b.width/2,"center"),D+=b.width,A++;v+=C}}function qe(t,e,n,i,r){if(n&&e.textRotation){var o=e.textOrigin;"center"===o?(i=n.width/2+n.x,r=n.height/2+n.y):o&&(i=o[0]+n.x,r=o[1]+n.y),t.translate(i,r),t.rotate(-e.textRotation),t.translate(-i,-r)}}function Ge(t,e,n,i,r,o,a,s){var l=i.rich[n.styleName]||{},u=n.textVerticalAlign,c=o+r/2;"top"===u?c=o+n.height/2:"bottom"===u&&(c=o+r-n.height/2),!n.isLineHolder&&Ye(l)&&Ze(t,e,l,"right"===s?a-n.width:"center"===s?a-n.width/2:a,c-n.height/2,n.width,n.height);var h=n.textPadding;h&&(a=nn(a,s,h),c-=n.height/2-h[2]-n.textHeight/2),Qe(e,"shadowBlur",F(l.textShadowBlur,i.textShadowBlur,0)),Qe(e,"shadowColor",l.textShadowColor||i.textShadowColor||"transparent"),Qe(e,"shadowOffsetX",F(l.textShadowOffsetX,i.textShadowOffsetX,0)),Qe(e,"shadowOffsetY",F(l.textShadowOffsetY,i.textShadowOffsetY,0)),Qe(e,"textAlign",s),Qe(e,"textBaseline","middle"),Qe(e,"font",n.font||g_);var d=Je(l.textStroke||i.textStroke,p),f=tn(l.textFill||i.textFill),p=R(l.textStrokeWidth,i.textStrokeWidth);d&&(Qe(e,"lineWidth",p),Qe(e,"strokeStyle",d),e.strokeText(n.text,a,c)),f&&(Qe(e,"fillStyle",f),e.fillText(n.text,a,c))}function Ye(t){return t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor}function Ze(t,e,n,i,r,o,a){var s=n.textBackgroundColor,l=n.textBorderWidth,u=n.textBorderColor,c=w(s);if(Qe(e,"shadowBlur",n.textBoxShadowBlur||0),Qe(e,"shadowColor",n.textBoxShadowColor||"transparent"),Qe(e,"shadowOffsetX",n.textBoxShadowOffsetX||0),Qe(e,"shadowOffsetY",n.textBoxShadowOffsetY||0),c||l&&u){e.beginPath();var h=n.textBorderRadius;h?He(e,{x:i,y:r,width:o,height:a,r:h}):e.rect(i,r,o,a),e.closePath()}if(c)Qe(e,"fillStyle",s),e.fill();else if(b(s)){var d=s.image;(d=ye(d,null,t,Xe,s))&&be(d)&&e.drawImage(d,i,r,o,a)}l&&u&&(Qe(e,"lineWidth",l),Qe(e,"strokeStyle",u),e.stroke())}function Xe(t,e){e.image=t}function Ke(t,e,n){var i=e.x||0,r=e.y||0,o=e.textAlign,a=e.textVerticalAlign;if(n){var s=e.textPosition;if(s instanceof Array)i=n.x+en(s[0],n.width),r=n.y+en(s[1],n.height);else{var l=Me(s,n,e.textDistance);i=l.x,r=l.y,o=o||l.textAlign,a=a||l.textVerticalAlign}var u=e.textOffset;u&&(i+=u[0],r+=u[1])}return{baseX:i,baseY:r,textAlign:o,textVerticalAlign:a}}function Qe(t,e,n){return t[e]=e_(t,e,n),t[e]}function Je(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function tn(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function en(t,e){return"string"==typeof t?0<=t.lastIndexOf("%")?parseFloat(t)/100*e:parseFloat(t):t}function nn(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function rn(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function on(t){for(var e in t=t||{},jw.call(this,t),t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new i_(t.style,this),this._rect=null,this.__clipPaths=[]}function an(t){on.call(this,t)}function sn(t){return parseInt(t,10)}function ln(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function un(t,e,n){return T_.copy(t.getBoundingRect()),t.transform&&T_.applyTransform(t.transform),A_.width=e,A_.height=n,!T_.intersect(A_)}function cn(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!0}function hn(t,e){for(var n=0;n<t.length;n++){var i=t[n];i.setTransform(e),e.beginPath(),i.buildPath(e,i.shape),e.clip(),i.restoreTransform(e)}}function dn(t,e){var n=document.createElement("div");return n.style.cssText=["position:relative","overflow:hidden","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}function fn(t){return t.getBoundingClientRect?t.getBoundingClientRect():{left:0,top:0}}function pn(t,e,n,i){return n=n||{},i||!Ub.canvasSupported?gn(t,e,n):Ub.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):gn(t,e,n),n}function gn(t,e,n){var i=fn(t);n.zrX=e.clientX-i.left,n.zrY=e.clientY-i.top}function mn(t,e,n){if(null!=(e=e||window.event).zrX)return e;var i=e.type;if(i&&0<=i.indexOf("touch")){var r="touchend"!=i?e.targetTouches[0]:e.changedTouches[0];r&&pn(t,r,e,n)}else pn(t,e,e,n),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var o=e.button;return null==e.which&&o!==undefined&&I_.test(e.type)&&(e.which=1&o?1:2&o?3:4&o?2:0),e}function vn(t,e,n){M_?t.addEventListener(e,n):t.attachEvent("on"+e,n)}function yn(t,e,n){M_?t.removeEventListener(e,n):t.detachEvent("on"+e,n)}function xn(t){return 1<t.which}function bn(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}function wn(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function _n(t){return"mousewheel"===t&&Ub.browser.firefox?"DOMMouseScroll":t}function Sn(t,e,n){var i=t._gestureMgr;"start"===n&&i.clear();var r=i.recognize(e,t.handler.findHover(e.zrX,e.zrY,null).target,t.dom);if("end"===n&&i.clear(),r){var o=r.type;e.gestureEvent=o,t.handler.dispatchToElement({target:r.target},o,r.event)}}function Cn(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function Tn(t){var e=t.pointerType;return"pen"===e||"touch"===e}function An(e){function n(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}k(R_,function(t){e._handlers[t]=v(H_[t],e)}),k(z_,function(t){e._handlers[t]=v(H_[t],e)}),k(N_,function(t){e._handlers[t]=n(H_[t],e)})}function Dn(n){function t(t,e){k(t,function(t){vn(n,_n(t),e._handlers[t])},e)}hw.call(this),this.dom=n,this._touching=!1,this._touchTimer,this._gestureMgr=new L_,this._handlers={},An(this),Ub.pointerEventsSupported?t(z_,this):(Ub.touchEventsSupported&&t(R_,this),t(N_,this))}function Mn(t,e){var n=new $_(Wb(),t,e);return W_[n.id]=n}function In(t){if(t)t.dispose();else{for(var e in W_)W_.hasOwnProperty(e)&&W_[e].dispose();W_={}}return this}function kn(t){return W_[t]}function En(t,e){j_[t]=e}function Ln(t){delete W_[t]}function On(t){return t instanceof Array?t:null==t?[]:[t]}function Pn(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,r=n.length;i<r;i++){var o=n[i];!t.emphasis[e].hasOwnProperty(o)&&t[e].hasOwnProperty(o)&&(t.emphasis[e][o]=t[e][o])}}}function Nn(t){return!Y_(t)||Z_(t)||t instanceof Date?t:t.value}function Rn(t){return Y_(t)&&!(t instanceof Array)}function Fn(t,r){r=(r||[]).slice();var o=A(t||[],function(t){return{exist:t}});return G_(r,function(t,e){if(Y_(t)){for(var n=0;n<o.length;n++)if(!o[n].option&&null!=t.id&&o[n].exist.id===t.id+"")return o[n].option=t,void(r[e]=null);for(n=0;n<o.length;n++){var i=o[n].exist;if(!(o[n].option||null!=i.id&&null!=t.id||null==t.name||Bn(t)||Bn(i)||i.name!==t.name+""))return o[n].option=t,void(r[e]=null)}}}),G_(r,function(t){if(Y_(t)){for(var e=0;e<o.length;e++){var n=o[e].exist;if(!o[e].option&&!Bn(n)&&null==t.id){o[e].option=t;break}}e>=o.length&&o.push({option:t})}}),o}function zn(t){var a=z();G_(t,function(t){var e=t.exist;e&&a.set(e.id,t)}),G_(t,function(t){var e=t.option;T(!e||null==e.id||!a.get(e.id)||a.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&a.set(e.id,t),!t.keyInfo&&(t.keyInfo={})}),G_(t,function(t,e){var n=t.exist,i=t.option,r=t.keyInfo;if(Y_(i)){if(r.name=null!=i.name?i.name+"":n?n.name:X_+e,n)r.id=n.id;else if(null!=i.id)r.id=i.id+"";else for(var o=0;r.id="\0"+r.name+"\0"+o++,a.get(r.id););a.set(r.id,t)}})}function Hn(t){var e=t.name;return!(!e||!e.indexOf(X_))}function Bn(t){return Y_(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Vn(t,e){function n(t,e,n){for(var i=0,r=t.length;i<r;i++)for(var o=t[i].seriesId,a=On(t[i].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(e[o]||(e[o]={}))[c]=1}}function o(t,e){var n=[];for(var i in t)if(t.hasOwnProperty(i)&&null!=t[i])if(e)n.push(+i);else{var r=o(t[i],!0);r.length&&n.push({seriesId:i,dataIndex:r})}return n}var i={},r={};return n(t||[],i),n(e||[],r,i),[o(i),o(r)]}function jn(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?E(t.dataIndex)?A(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?E(t.name)?A(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function Wn(){var e="__\0ec_inner_"+Q_+++"_"+Math.random().toFixed(5);return function(t){
|
|
return t[e]||(t[e]={})}}function Un(s,l,u){if(w(l)){var t={};t[l+"Index"]=0,l=t}var e=u&&u.defaultMainType;!e||$n(l,e+"Index")||$n(l,e+"Id")||$n(l,e+"Name")||(l[e+"Index"]=0);var c={};return G_(l,function(t,e){t=l[e];if("dataIndex"!==e&&"dataIndexInside"!==e){var n=e.match(/^(\w+)(Index|Id|Name)$/)||[],i=n[1],r=(n[2]||"").toLowerCase();if(!(!i||!r||null==t||"index"===r&&"none"===t||u&&u.includeMainTypes&&x(u.includeMainTypes,i)<0)){var o={mainType:i};"index"===r&&"all"===t||(o[r]=t);var a=s.queryComponents(o);c[i+"Models"]=a,c[i+"Model"]=a[0]}}else c[e]=t}),c}function $n(t,e){return t&&t.hasOwnProperty(e)}function qn(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}function Gn(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function Yn(t){var e={main:"",sub:""};return t&&(t=t.split(J_),e.main=t[0]||"",e.sub=t[1]||""),e}function Zn(t){T(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Xn(t,i){(t.$constructor=t).extend=function(e){Vb&&k(i,function(t){e[t]||console.warn("Method `"+t+"` should be implemented"+(e.type?" in "+e.type:"")+".")});var t=this,n=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return O(n.prototype,e),n.extend=this.extend,n.superCall=Qn,n.superApply=Jn,o(n,this),n.superClass=t,n}}function Kn(t){var e=["__\0is_clz",eS++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,Vb&&T(!t.isInstance,'The method "is" can not be defined.'),t.isInstance=function(t){return!(!t||!t[e])}}function Qn(t,e){var n=l(arguments,2);return this.superClass.prototype[e].apply(t,n)}function Jn(t,e,n){return this.superClass.prototype[e].apply(t,n)}function ti(n,t){function i(t){var e=r[t.main];return e&&e[tS]||((e=r[t.main]={})[tS]=!0),e}t=t||{};var r={};if(n.registerClass=function(t,e){if(e)if(Zn(e),(e=Yn(e)).sub){if(e.sub!==tS){i(e)[e.sub]=t}}else Vb&&r[e.main]&&console.warn(e.main+" exists."),r[e.main]=t;return t},n.getClass=function(t,e,n){var i=r[t];if(i&&i[tS]&&(i=e?i[e]:null),n&&!i)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return i},n.getClassesByMainType=function(t){t=Yn(t);var n=[],e=r[t.main];return e&&e[tS]?k(e,function(t,e){e!==tS&&n.push(t)}):n.push(e),n},n.hasClass=function(t){return t=Yn(t),!!r[t.main]},n.getAllClassMainTypes=function(){var n=[];return k(r,function(t,e){n.push(e)}),n},n.hasSubTypes=function(t){t=Yn(t);var e=r[t.main];return e&&e[tS]},n.parseClassType=Yn,t.registerWhenExtend){var o=n.extend;o&&(n.extend=function(t){var e=o.call(this,t);return n.registerClass(e,t.type)})}return n}function ei(t){return-uS<t&&t<uS}function ni(t){return uS<t||t<-uS}function ii(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function ri(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function oi(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,f=0;if(ei(c)&&ei(h)){if(ei(s))o[0]=0;else 0<=(C=-l/s)&&C<=1&&(o[f++]=C)}else{var p=h*h-4*c*d;if(ei(p)){var g=h/c,m=-g/2;0<=(C=-s/a+g)&&C<=1&&(o[f++]=C),0<=m&&m<=1&&(o[f++]=m)}else if(0<p){var v=lS(p),y=c*s+1.5*a*(-h+v),x=c*s+1.5*a*(-h-v);0<=(C=(-s-((y=y<0?-sS(-y,dS):sS(y,dS))+(x=x<0?-sS(-x,dS):sS(x,dS))))/(3*a))&&C<=1&&(o[f++]=C)}else{var b=(2*c*s-3*a*h)/(2*lS(c*c*c)),w=Math.acos(b)/3,_=lS(c),S=Math.cos(w),C=(-s-2*_*S)/(3*a),T=(m=(-s+_*(S+hS*Math.sin(w)))/(3*a),(-s+_*(S-hS*Math.sin(w)))/(3*a));0<=C&&C<=1&&(o[f++]=C),0<=m&&m<=1&&(o[f++]=m),0<=T&&T<=1&&(o[f++]=T)}}return f}function ai(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(ei(a)){if(ni(o))0<=(c=-s/o)&&c<=1&&(r[l++]=c)}else{var u=o*o-4*a*s;if(ei(u))r[0]=-o/(2*a);else if(0<u){var c,h=lS(u),d=(-o-h)/(2*a);0<=(c=(-o+h)/(2*a))&&c<=1&&(r[l++]=c),0<=d&&d<=1&&(r[l++]=d)}}return l}function si(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,c=(l-s)*r+s,h=(c-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function li(t,e,n,i,r,o,a,s,l,u,c){var h,d,f,p,g,m=.005,v=Infinity;fS[0]=l,fS[1]=u;for(var y=0;y<1;y+=.05)pS[0]=ii(t,n,r,a,y),pS[1]=ii(e,i,o,s,y),(p=lw(fS,pS))<v&&(h=y,v=p);v=Infinity;for(var x=0;x<32&&!(m<cS);x++)d=h-m,f=h+m,pS[0]=ii(t,n,r,a,d),pS[1]=ii(e,i,o,s,d),p=lw(pS,fS),0<=d&&p<v?(h=d,v=p):(gS[0]=ii(t,n,r,a,f),gS[1]=ii(e,i,o,s,f),g=lw(gS,fS),f<=1&&g<v?(h=f,v=g):m*=.5);return c&&(c[0]=ii(t,n,r,a,h),c[1]=ii(e,i,o,s,h)),lS(v)}function ui(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function ci(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function hi(t,e,n,i,r){var o=t-2*e+n,a=2*(e-t),s=t-i,l=0;if(ei(o)){if(ni(a))0<=(c=-s/a)&&c<=1&&(r[l++]=c)}else{var u=a*a-4*o*s;if(ei(u))0<=(c=-a/(2*o))&&c<=1&&(r[l++]=c);else if(0<u){var c,h=lS(u),d=(-a-h)/(2*o);0<=(c=(-a+h)/(2*o))&&c<=1&&(r[l++]=c),0<=d&&d<=1&&(r[l++]=d)}}return l}function di(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function fi(t,e,n,i,r){var o=(e-t)*i+t,a=(n-e)*i+e,s=(a-o)*i+o;r[0]=t,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}function pi(t,e,n,i,r,o,a,s,l){var u,c=.005,h=Infinity;fS[0]=a,fS[1]=s;for(var d=0;d<1;d+=.05){pS[0]=ui(t,n,r,d),pS[1]=ui(e,i,o,d),(m=lw(fS,pS))<h&&(u=d,h=m)}h=Infinity;for(var f=0;f<32&&!(c<cS);f++){var p=u-c,g=u+c;pS[0]=ui(t,n,r,p),pS[1]=ui(e,i,o,p);var m=lw(pS,fS);if(0<=p&&m<h)u=p,h=m;else{gS[0]=ui(t,n,r,g),gS[1]=ui(e,i,o,g);var v=lw(gS,fS);g<=1&&v<h?(u=g,h=v):c*=.5}}return l&&(l[0]=ui(t,n,r,u),l[1]=ui(e,i,o,u)),lS(h)}function gi(t,e,n){if(0!==t.length){var i,r=t[0],o=r[0],a=r[0],s=r[1],l=r[1];for(i=1;i<t.length;i++)r=t[i],o=mS(o,r[0]),a=vS(a,r[0]),s=mS(s,r[1]),l=vS(l,r[1]);e[0]=o,e[1]=s,n[0]=a,n[1]=l}}function mi(t,e,n,i,r,o){r[0]=mS(t,n),r[1]=mS(e,i),o[0]=vS(t,n),o[1]=vS(e,i)}function vi(t,e,n,i,r,o,a,s,l,u){var c,h=ai,d=ii,f=h(t,n,r,a,CS);for(l[0]=Infinity,l[1]=Infinity,u[0]=-Infinity,u[1]=-Infinity,c=0;c<f;c++){var p=d(t,n,r,a,CS[c]);l[0]=mS(p,l[0]),u[0]=vS(p,u[0])}for(f=h(e,i,o,s,TS),c=0;c<f;c++){var g=d(e,i,o,s,TS[c]);l[1]=mS(g,l[1]),u[1]=vS(g,u[1])}l[0]=mS(t,l[0]),u[0]=vS(t,u[0]),l[0]=mS(a,l[0]),u[0]=vS(a,u[0]),l[1]=mS(e,l[1]),u[1]=vS(e,u[1]),l[1]=mS(s,l[1]),u[1]=vS(s,u[1])}function yi(t,e,n,i,r,o,a,s){var l=di,u=ui,c=vS(mS(l(t,n,r),1),0),h=vS(mS(l(e,i,o),1),0),d=u(t,n,r,c),f=u(e,i,o,h);a[0]=mS(t,r,d),a[1]=mS(e,o,f),s[0]=vS(t,r,d),s[1]=vS(e,o,f)}function xi(t,e,n,i,r,o,a,s,l){var u=at,c=st,h=Math.abs(r-o);if(h%bS<1e-4&&1e-4<h)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(wS[0]=xS(r)*n+t,wS[1]=yS(r)*i+e,_S[0]=xS(o)*n+t,_S[1]=yS(o)*i+e,u(s,wS,_S),c(l,wS,_S),(r%=bS)<0&&(r+=bS),(o%=bS)<0&&(o+=bS),o<r&&!a?o+=bS:r<o&&a&&(r+=bS),a){var d=o;o=r,r=d}for(var f=0;f<o;f+=Math.PI/2)r<f&&(SS[0]=xS(f)*n+t,SS[1]=yS(f)*i+e,u(s,SS,s),c(l,SS,l))}function bi(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0;if(e+s<a&&i+s<a||a<e-s&&a<i-s||t+s<o&&n+s<o||o<t-s&&o<n-s)return!1;if(t===n)return Math.abs(o-t)<=s/2;var u=(l=(e-i)/(t-n))*o-a+(t*i-n*e)/(t-n);return u*u/(l*l+1)<=s/2*s/2}function wi(t,e,n,i,r,o,a,s,l,u,c){if(0===l)return!1;var h=l;return!(e+h<c&&i+h<c&&o+h<c&&s+h<c||c<e-h&&c<i-h&&c<o-h&&c<s-h||t+h<u&&n+h<u&&r+h<u&&a+h<u||u<t-h&&u<n-h&&u<r-h&&u<a-h)&&li(t,e,n,i,r,o,a,s,u,c,null)<=h/2}function _i(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var u=a;return!(e+u<l&&i+u<l&&o+u<l||l<e-u&&l<i-u&&l<o-u||t+u<s&&n+u<s&&r+u<s||s<t-u&&s<n-u&&s<r-u)&&pi(t,e,n,i,r,o,s,l,null)<=u/2}function Si(t){return(t%=HS)<0&&(t+=HS),t}function Ci(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var u=a;s-=t,l-=e;var c=Math.sqrt(s*s+l*l);if(n<c-u||c+u<n)return!1;if(Math.abs(i-r)%BS<1e-4)return!0;if(o){var h=i;i=Si(r),r=Si(h)}else i=Si(i),r=Si(r);r<i&&(r+=BS);var d=Math.atan2(l,s);return d<0&&(d+=BS),i<=d&&d<=r||i<=d+BS&&d+BS<=r}function Ti(t,e,n,i,r,o){if(e<o&&i<o||o<e&&o<i)return 0;if(i===e)return 0;var a=i<e?1:-1,s=(o-e)/(i-e);1!==s&&0!==s||(a=i<e?.5:-.5);var l=s*(n-t)+t;return l===r?Infinity:r<l?a:0}function Ai(t,e){return Math.abs(t-e)<WS}function Di(){var t=$S[0];$S[0]=$S[1],$S[1]=t}function Mi(t,e,n,i,r,o,a,s,l,u){if(e<u&&i<u&&o<u&&s<u||u<e&&u<i&&u<o&&u<s)return 0;var c=oi(e,i,o,s,u,US);if(0===c)return 0;for(var h,d,f=0,p=-1,g=0;g<c;g++){var m=US[g],v=0===m||1===m?.5:1;ii(t,n,r,a,m)<l||(p<0&&(p=ai(e,i,o,s,$S),$S[1]<$S[0]&&1<p&&Di(),h=ii(e,i,o,s,$S[0]),1<p&&(d=ii(e,i,o,s,$S[1]))),2==p?m<$S[0]?f+=h<e?v:-v:m<$S[1]?f+=d<h?v:-v:f+=s<d?v:-v:m<$S[0]?f+=h<e?v:-v:f+=s<h?v:-v)}return f}function Ii(t,e,n,i,r,o,a,s){if(e<s&&i<s&&o<s||s<e&&s<i&&s<o)return 0;var l=hi(e,i,o,s,US);if(0===l)return 0;var u=di(e,i,o);if(0<=u&&u<=1){for(var c=0,h=ui(e,i,o,u),d=0;d<l;d++){var f=0===US[d]||1===US[d]?.5:1;ui(t,n,r,US[d])<a||(US[d]<u?c+=h<e?f:-f:c+=o<h?f:-f)}return c}f=0===US[0]||1===US[0]?.5:1;return ui(t,n,r,US[0])<a?0:o<e?f:-f}function ki(t,e,n,i,r,o,a,s){if(n<(s-=e)||s<-n)return 0;var l=Math.sqrt(n*n-s*s);US[0]=-l,US[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u%jS<1e-4){r=jS;var c=o?1:-1;return a>=US[i=0]+t&&a<=US[1]+t?c:0}if(o){l=i;i=Si(r),r=Si(l)}else i=Si(i),r=Si(r);r<i&&(r+=jS);for(var h=0,d=0;d<2;d++){var f=US[d];if(a<f+t){var p=Math.atan2(s,f);c=o?1:-1;p<0&&(p=jS+p),(i<=p&&p<=r||i<=p+jS&&p+jS<=r)&&(p>Math.PI/2&&p<1.5*Math.PI&&(c=-c),h+=c)}}return h}function Ei(t,e,n,i,r){for(var o=0,a=0,s=0,l=0,u=0,c=0;c<t.length;){var h=t[c++];switch(h===VS.M&&1<c&&(n||(o+=Ti(a,s,l,u,i,r))),1==c&&(l=a=t[c],u=s=t[c+1]),h){case VS.M:a=l=t[c++],s=u=t[c++];break;case VS.L:if(n){if(bi(a,s,t[c],t[c+1],e,i,r))return!0}else o+=Ti(a,s,t[c],t[c+1],i,r)||0;a=t[c++],s=t[c++];break;case VS.C:if(n){if(wi(a,s,t[c++],t[c++],t[c++],t[c++],t[c],t[c+1],e,i,r))return!0}else o+=Mi(a,s,t[c++],t[c++],t[c++],t[c++],t[c],t[c+1],i,r)||0;a=t[c++],s=t[c++];break;case VS.Q:if(n){if(_i(a,s,t[c++],t[c++],t[c],t[c+1],e,i,r))return!0}else o+=Ii(a,s,t[c++],t[c++],t[c],t[c+1],i,r)||0;a=t[c++],s=t[c++];break;case VS.A:var d=t[c++],f=t[c++],p=t[c++],g=t[c++],m=t[c++],v=t[c++],y=(t[c++],1-t[c++]),x=Math.cos(m)*p+d,b=Math.sin(m)*g+f;1<c?o+=Ti(a,s,x,b,i,r):(l=x,u=b);var w=(i-d)*g/p+d;if(n){if(Ci(d,f,g,m,m+v,y,e,w,r))return!0}else o+=ki(d,f,g,m,m+v,y,w,r);a=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case VS.R:l=a=t[c++],u=s=t[c++];x=l+t[c++],b=u+t[c++];if(n){if(bi(l,u,x,u,e,i,r)||bi(x,u,x,b,e,i,r)||bi(x,b,l,b,e,i,r)||bi(l,b,l,u,e,i,r))return!0}else o+=Ti(x,u,x,b,i,r),o+=Ti(l,b,l,u,i,r);break;case VS.Z:if(n){if(bi(a,s,l,u,e,i,r))return!0}else o+=Ti(a,s,l,u,i,r);a=l,s=u}}return n||Ai(s,u)||(o+=Ti(a,s,l,u,i,r)||0),0!==o}function Li(t,e,n){return Ei(t,0,!1,e,n)}function Oi(t,e,n,i){return Ei(t,e,!0,n,i)}function Pi(t){on.call(this,t),this.path=null}function Ni(t,e,n,i,r,o,a,s,l,u,c){var h=l*(rC/180),d=iC(h)*(t-n)/2+nC(h)*(e-i)/2,f=-1*nC(h)*(t-n)/2+iC(h)*(e-i)/2,p=d*d/(a*a)+f*f/(s*s);1<p&&(a*=eC(p),s*=eC(p));var g=(r===o?-1:1)*eC((a*a*(s*s)-a*a*(f*f)-s*s*(d*d))/(a*a*(f*f)+s*s*(d*d)))||0,m=g*a*f/s,v=g*-s*d/a,y=(t+n)/2+iC(h)*m-nC(h)*v,x=(e+i)/2+nC(h)*m+iC(h)*v,b=sC([1,0],[(d-m)/a,(f-v)/s]),w=[(d-m)/a,(f-v)/s],_=[(-1*d-m)/a,(-1*f-v)/s],S=sC(w,_);aC(w,_)<=-1&&(S=rC),1<=aC(w,_)&&(S=0),0===o&&0<S&&(S-=2*rC),1===o&&S<0&&(S+=2*rC),c.addData(u,y,x,a,s,b,S,h,o)}function Ri(t){if(!t)return[];var e,n=t.replace(/-/g," -").replace(/ /g," ").replace(/ /g,",").replace(/,,/g,",");for(e=0;e<tC.length;e++)n=n.replace(new RegExp(tC[e],"g"),"|"+tC[e]);var i,r=n.split("|"),o=0,a=0,s=new zS,l=zS.CMD;for(e=1;e<r.length;e++){var u,c=r[e],h=c.charAt(0),d=0,f=c.slice(1).replace(/e,-/g,"e-").split(",");0<f.length&&""===f[0]&&f.shift();for(var p=0;p<f.length;p++)f[p]=parseFloat(f[p]);for(;d<f.length&&!isNaN(f[d])&&!isNaN(f[0]);){var g,m,v,y,x,b,w,_=o,S=a;switch(h){case"l":o+=f[d++],a+=f[d++],u=l.L,s.addData(u,o,a);break;case"L":o=f[d++],a=f[d++],u=l.L,s.addData(u,o,a);break;case"m":o+=f[d++],a+=f[d++],u=l.M,s.addData(u,o,a),h="l";break;case"M":o=f[d++],a=f[d++],u=l.M,s.addData(u,o,a),h="L";break;case"h":o+=f[d++],u=l.L,s.addData(u,o,a);break;case"H":o=f[d++],u=l.L,s.addData(u,o,a);break;case"v":a+=f[d++],u=l.L,s.addData(u,o,a);break;case"V":a=f[d++],u=l.L,s.addData(u,o,a);break;case"C":u=l.C,s.addData(u,f[d++],f[d++],f[d++],f[d++],f[d++],f[d++]),o=f[d-2],a=f[d-1];break;case"c":u=l.C,s.addData(u,f[d++]+o,f[d++]+a,f[d++]+o,f[d++]+a,f[d++]+o,f[d++]+a),o+=f[d-2],a+=f[d-1];break;case"S":g=o,m=a;var C=s.len(),T=s.data;i===l.C&&(g+=o-T[C-4],m+=a-T[C-3]),u=l.C,_=f[d++],S=f[d++],o=f[d++],a=f[d++],s.addData(u,g,m,_,S,o,a);break;case"s":g=o,m=a;C=s.len(),T=s.data;i===l.C&&(g+=o-T[C-4],m+=a-T[C-3]),u=l.C,_=o+f[d++],S=a+f[d++],o+=f[d++],a+=f[d++],s.addData(u,g,m,_,S,o,a);break;case"Q":_=f[d++],S=f[d++],o=f[d++],a=f[d++],u=l.Q,s.addData(u,_,S,o,a);break;case"q":_=f[d++]+o,S=f[d++]+a,o+=f[d++],a+=f[d++],u=l.Q,s.addData(u,_,S,o,a);break;case"T":g=o,m=a;C=s.len(),T=s.data;i===l.Q&&(g+=o-T[C-4],m+=a-T[C-3]),o=f[d++],a=f[d++],u=l.Q,s.addData(u,g,m,o,a);break;case"t":g=o,m=a;C=s.len(),T=s.data;i===l.Q&&(g+=o-T[C-4],m+=a-T[C-3]),o+=f[d++],a+=f[d++],u=l.Q,s.addData(u,g,m,o,a);break;case"A":v=f[d++],y=f[d++],x=f[d++],b=f[d++],w=f[d++],Ni(_=o,S=a,o=f[d++],a=f[d++],b,w,v,y,x,u=l.A,s);break;case"a":v=f[d++],y=f[d++],x=f[d++],b=f[d++],w=f[d++],Ni(_=o,S=a,o+=f[d++],a+=f[d++],b,w,v,y,x,u=l.A,s)}}"z"!==h&&"Z"!==h||(u=l.Z,s.addData(u)),i=u}return s.toStatic(),s}function Fi(t,e){var n=Ri(t);return(e=e||{}).buildPath=function(t){if(t.setData){t.setData(n.data),(e=t.getContext())&&t.rebuildPath(e)}else{var e=t;n.rebuildPath(e)}},e.applyTransform=function(t){JS(n,t),this.dirty(!0)},e}function zi(t,e){return new Pi(Fi(t,e))}function Hi(t,e){return Pi.extend(Fi(t,e))}function Bi(t,e){for(var n=[],i=t.length,r=0;r<i;r++){var o=t[r];o.path||o.createPathProxy(),o.__dirtyPath&&o.buildPath(o.path,o.shape,!0),n.push(o.path)}var a=new Pi(e);return a.createPathProxy(),a.buildPath=function(t){t.appendPath(n);var e=t.getContext();e&&t.rebuildPath(e)},a}function Vi(t,e,n,i,r,o,a){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*a+(-3*(e-n)-2*s-l)*o+s*r+e}function ji(t,e,n){var i=e.points,r=e.smooth;if(i&&2<=i.length){if(r&&"spline"!==r){var o=gC(i,r,n,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=i[(s+1)%a];t.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{"spline"===r&&(i=pC(i,n)),t.moveTo(i[0][0],i[0][1]);s=1;for(var h=i.length;s<h;s++)t.lineTo(i[s][0],i[s][1])}n&&t.closePath()}}function Wi(t,e,n){var i=t.cpx2,r=t.cpy2;return null===i||null===r?[(n?ri:ii)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?ri:ii)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?ci:ui)(t.x1,t.cpx1,t.x2,e),(n?ci:ui)(t.y1,t.cpy1,t.y2,e)]}function Ui(t){on.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}function $i(t){return Pi.extend(t)}function qi(t,e){return Hi(t,e)}function Gi(t,e,n,i){var r=zi(t,e),o=r.getBoundingRect();return n&&("center"===i&&(n=Zi(n,o)),Xi(r,n)),r}function Yi(t,n,i){var r=new an({style:{image:t,x:n.x,y:n.y,width:n.width,height:n.height},onload:function(t){if("center"===i){var e={width:t.width,height:t.height};r.setStyle(Zi(n,e))}}});return r}function Zi(t,e){var n,i=e.width/e.height,r=t.height*i;return n=r<=t.width?t.height:(r=t.width)/i,{x:t.x+t.width/2-r/2,y:t.y+t.height/2-n/2,width:r,height:n}}function Xi(t,e){if(t.applyTransform){var n=t.getBoundingRect().calculateTransform(e);t.applyTransform(n)}}function Ki(t){var e=t.shape,n=t.style.lineWidth;return MC(2*e.x1)===MC(2*e.x2)&&(e.x1=e.x2=Ji(e.x1,n,!0)),MC(2*e.y1)===MC(2*e.y2)&&(e.y1=e.y2=Ji(e.y1,n,!0)),t}function Qi(t){var e=t.shape,n=t.style.lineWidth,i=e.x,r=e.y,o=e.width,a=e.height;return e.x=Ji(e.x,n,!0),e.y=Ji(e.y,n,!0),e.width=Math.max(Ji(i+o,n,!1)-e.x,0===o?0:1),e.height=Math.max(Ji(r+a,n,!1)-e.y,0===a?0:1),t}function Ji(t,e,n){var i=MC(2*t);return(i+MC(e))%2==0?i/2:(i+(n?1:-1))/2}function tr(t){return null!=t&&"none"!=t}function er(t){return"string"==typeof t?Ft(t,-.1):t}function nr(t){if(t.__hoverStlDirty){var e=t.style.stroke,n=t.style.fill,i=t.__hoverStl;i.fill=i.fill||(tr(n)?er(n):null),i.stroke=i.stroke||(tr(e)?er(e):null);var r={};for(var o in i)null!=i[o]&&(r[o]=t.style[o]);t.__normalStl=r,t.__hoverStlDirty=!1}}function ir(t){if(!t.__isHover){if(nr(t),t.useHoverLayer)t.__zr&&t.__zr.addHover(t,t.__hoverStl);else{var e=t.style,n=e.insideRollbackOpt;n&&wr(e),e.extendFrom(t.__hoverStl),n&&(br(e,e.insideOriginalTextPosition,n),null==e.textFill&&(e.textFill=n.autoColor)),t.dirty(!1),t.z2+=1}t.__isHover=!0}}function rr(t){if(t.__isHover){var e=t.__normalStl;t.useHoverLayer?t.__zr&&t.__zr.removeHover(t):(e&&t.setStyle(e),t.z2-=1),t.__isHover=!1}}function or(t){"group"===t.type?t.traverse(function(t){"group"!==t.type&&ir(t)}):ir(t)}function ar(t){"group"===t.type?t.traverse(function(t){"group"!==t.type&&rr(t)}):rr(t)}function sr(t,e){t.__hoverStl=t.hoverStyle||e||{},t.__hoverStlDirty=!0,t.__isHover&&nr(t)}function lr(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasis&&or(this)}function ur(t){this.__hoverSilentOnTouch&&t.zrByTouch||!this.__isEmphasis&&ar(this)}function cr(){this.__isEmphasis=!0,or(this)}function hr(){this.__isEmphasis=!1,ar(this)}function dr(t,e,n){t.__hoverSilentOnTouch=n&&n.hoverSilentOnTouch,"group"===t.type?t.traverse(function(t){"group"!==t.type&&sr(t,e)}):sr(t,e),t.on("mouseover",lr).on("mouseout",ur),t.on("emphasis",cr).on("normal",hr)}function fr(t,e,n,i,r,o,a){var s,l=(r=r||EC).labelFetcher,u=r.labelDataIndex,c=r.labelDimIndex,h=n.getShallow("show"),d=i.getShallow("show");(h||d)&&(l&&(s=l.getFormattedLabel(u,"normal",null,c)),null==s&&(s=m(r.defaultText)?r.defaultText(u,r):r.defaultText));var f=h?s:null,p=d?R(l?l.getFormattedLabel(u,"emphasis",null,c):null,s):null;null==f&&null==p||(pr(t,n,o,r),pr(e,i,a,r,!0)),t.text=f,e.text=p}function pr(t,e,n,i,r){return mr(t,e,i,r),n&&O(t,n),t.host&&t.host.dirty&&t.host.dirty(!1),t}function gr(t,e,n){var i,r={isRectText:!0};!1===n?i=!0:r.autoColor=n,mr(t,e,r,i),t.host&&t.host.dirty&&t.host.dirty(!1)}function mr(t,e,n,i){if((n=n||EC).isRectText){var r=e.getShallow("position")||(i?null:"inside");"outside"===r&&(r="top"),t.textPosition=r,t.textOffset=e.getShallow("offset");var o=e.getShallow("rotate");null!=o&&(o*=Math.PI/180),t.textRotation=o,t.textDistance=R(e.getShallow("distance"),i?null:5)}var a,s=e.ecModel,l=s&&s.option.textStyle,u=vr(e);if(u)for(var c in a={},u)if(u.hasOwnProperty(c)){var h=e.getModel(["rich",c]);yr(a[c]={},h,l,n,i)}return t.rich=a,yr(t,e,l,n,i,!0),n.forceRich&&!n.textStyle&&(n.textStyle={}),t}function vr(t){for(var e;t&&t!==t.ecModel;){var n=(t.option||EC).rich;if(n)for(var i in e=e||{},n)n.hasOwnProperty(i)&&(e[i]=1);t=t.parentModel}return e}function yr(t,e,n,i,r,o){if(n=!r&&n||EC,t.textFill=xr(e.getShallow("color"),i)||n.color,t.textStroke=xr(e.getShallow("textBorderColor"),i)||n.textBorderColor,t.textStrokeWidth=R(e.getShallow("textBorderWidth"),n.textBorderWidth),!r){if(o){var a=t.textPosition;t.insideRollback=br(t,a,i),t.insideOriginalTextPosition=a,t.insideRollbackOpt=i}null==t.textFill&&(t.textFill=i.autoColor)}t.fontStyle=e.getShallow("fontStyle")||n.fontStyle,t.fontWeight=e.getShallow("fontWeight")||n.fontWeight,t.fontSize=e.getShallow("fontSize")||n.fontSize,t.fontFamily=e.getShallow("fontFamily")||n.fontFamily,t.textAlign=e.getShallow("align"),t.textVerticalAlign=e.getShallow("verticalAlign")||e.getShallow("baseline"),t.textLineHeight=e.getShallow("lineHeight"),t.textWidth=e.getShallow("width"),t.textHeight=e.getShallow("height"),t.textTag=e.getShallow("tag"),o&&i.disableBox||(t.textBackgroundColor=xr(e.getShallow("backgroundColor"),i),t.textPadding=e.getShallow("padding"),t.textBorderColor=xr(e.getShallow("borderColor"),i),t.textBorderWidth=e.getShallow("borderWidth"),t.textBorderRadius=e.getShallow("borderRadius"),t.textBoxShadowColor=e.getShallow("shadowColor"),t.textBoxShadowBlur=e.getShallow("shadowBlur"),t.textBoxShadowOffsetX=e.getShallow("shadowOffsetX"),t.textBoxShadowOffsetY=e.getShallow("shadowOffsetY")),t.textShadowColor=e.getShallow("textShadowColor")||n.textShadowColor,t.textShadowBlur=e.getShallow("textShadowBlur")||n.textShadowBlur,t.textShadowOffsetX=e.getShallow("textShadowOffsetX")||n.textShadowOffsetX,t.textShadowOffsetY=e.getShallow("textShadowOffsetY")||n.textShadowOffsetY}function xr(t,e){return"auto"!==t?t:e&&e.autoColor?e.autoColor:null}function br(t,e,n){var i,r=n.useInsideStyle;return null==t.textFill&&!1!==r&&(!0===r||n.isRectText&&e&&"string"==typeof e&&0<=e.indexOf("inside"))&&(i={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=n.autoColor,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),i}function wr(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth)}function _r(t,e){var n=e||e.getModel("textStyle");return h([t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}function Sr(t,e,n,i,r,o){if("function"==typeof r&&(o=r,r=null),i&&i.isAnimationEnabled()){var a=t?"Update":"",s=i.getShallow("animationDuration"+a),l=i.getShallow("animationEasing"+a),u=i.getShallow("animationDelay"+a);"function"==typeof u&&(u=u(r,i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null)),"function"==typeof s&&(s=s(r)),0<s?e.animateTo(n,s,u||0,l,o,!!o):(e.stopAnimation(),e.attr(n),o&&o())}else e.stopAnimation(),e.attr(n),o&&o()}function Cr(t,e,n,i,r){Sr(!0,t,e,n,i,r)}function Tr(t,e,n,i,r){Sr(!1,t,e,n,i,r)}function Ar(t,e){for(var n=pt([]);t&&t!==e;)mt(n,t.getLocalTransform(),n),t=t.parent;return n}function Dr(t,e,n){return e&&!P(e)&&(e=xw.getLocalTransform(e)),n&&(e=bt([],e)),ot([],t,e)}function Mr(t,e,n){var i=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),r=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),o=["left"===t?-i:"right"===t?i:0,"top"===t?-r:"bottom"===t?r:0];return o=Dr(o,e,n),Math.abs(o[0])>Math.abs(o[1])?0<o[0]?"right":"left":0<o[1]?"bottom":"top"}function Ir(t,e,i){function n(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}function r(t){var e={position:W(t.position),rotation:t.rotation};return t.shape&&(e.shape=O({},t.shape)),e}if(t&&e){var o=n(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=o[t.anid];if(e){var n=r(t);t.attr(r(e)),Cr(t,n,i,t.dataIndex)}}})}}function kr(t,i){return A(t,function(t){var e=t[0];e=IC(e,i.x),e=kC(e,i.x+i.width);var n=t[1];return n=IC(n,i.y),[e,n=kC(n,i.y+i.height)]})}function Er(t,e){var n=IC(t.x,e.x),i=kC(t.x+t.width,e.x+e.width),r=IC(t.y,e.y),o=kC(t.y+t.height,e.y+e.height);if(n<=i&&r<=o)return{x:n,y:r,width:i-n,height:o-r}}function Lr(t,e,n){var i=(e=O({rectHover:!0},e)).style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),D(i,n),new an(e)):Gi(t.replace("path://",""),e,n,"center")}function Or(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}function Pr(t,e,n){for(var i=0;i<e.length&&(!e[i]||null!=(t=t&&"object"==typeof t?t[e[i]]:null));i++);return null==t&&n&&(t=n.get(e)),t}function Nr(t,e){var n=HC(t).getParent;return n?n.call(t,e):t.parentModel}function Rr(t){return[t||"",BC++,Math.random().toFixed(5)].join("_")}function Fr(r){var o={};return r.registerSubTypeDefaulter=function(t,e){t=Yn(t),o[t.main]=e},r.determineSubType=function(t,e){var n=e.type;if(!n){var i=Yn(t).main;r.hasSubTypes(t)&&o[i]&&(n=o[i](e))}return n},r}function zr(t,a){function f(e){var r={},o=[];return k(e,function(n){var i=s(r,n),t=l(i.originalDeps=a(n),e);i.entryCount=t.length,0===i.entryCount&&o.push(n),k(t,function(t){x(i.predecessor,t)<0&&i.predecessor.push(t);var e=s(r,t);x(e.successor,t)<0&&e.successor.push(n)})}),{graph:r,noEntryList:o}}function s(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function l(t,e){var n=[];return k(t,function(t){0<=x(e,t)&&n.push(t)}),n}t.topologicalTravel=function(t,e,n,i){function r(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function o(t){u[t]=!0,r(t)}if(t.length){var a=f(e),s=a.graph,l=a.noEntryList,u={};for(k(t,function(t){u[t]=!0});l.length;){var c=l.pop(),h=s[c],d=!!u[c];d&&(n.call(i,c,h.originalDeps.slice()),delete u[c]),k(h.successor,d?o:r)}k(u,function(){throw new Error("Circle dependency may exists")})}}}function Hr(t){return t.replace(/^\s+/,"").replace(/\s+$/,"")}function Br(t,e,n,i){var r=e[1]-e[0],o=n[1]-n[0];if(0===r)return 0===o?n[0]:(n[0]+n[1])/2;if(i)if(0<r){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function Vr(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?Hr(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function jr(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function Wr(t){return t.sort(function(t,e){return t-e}),t}function Ur(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $r(t){var e=t.toString(),n=e.indexOf("e");if(0<n){var i=+e.slice(n+1);return i<0?-i:0}var r=e.indexOf(".");return r<0?0:e.length-1-r}function qr(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Gr(t,e,n){if(!t[e])return 0;var i=p(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===i)return 0;for(var r=Math.pow(10,n),o=A(t,function(t){return(isNaN(t)?0:t)/i*r*100}),a=100*r,s=A(o,function(t){return Math.floor(t)}),l=p(s,function(t,e){return t+e},0),u=A(o,function(t,e){return t-s[e]});l<a;){for(var c=Number.NEGATIVE_INFINITY,h=null,d=0,f=u.length;d<f;++d)u[d]>c&&(c=u[d],h=d);++s[h],u[h]=0,++l}return s[e]/r}function Yr(t){var e=2*Math.PI;return(t%e+e)%e}function Zr(t){return-VC<t&&t<VC}function Xr(t){if(t instanceof Date)return t;if("string"!=typeof t)return null==t?new Date(NaN):new Date(Math.round(t));var e=WC.exec(t);if(!e)return new Date(NaN);if(e[8]){var n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,+e[7]||0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,+e[7]||0)}function Kr(t){return Math.pow(10,Qr(t))}function Qr(t){return Math.floor(Math.log(t)/Math.LN10)}function Jr(t,e){var n=Qr(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,-20<=n?+t.toFixed(n<0?-n:0):t}function to(t){function i(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]==(n?-1:1)||!n&&i(t,e,1))}t.sort(function(t,e){return i(t,e,0)?-1:1});for(var e=-Infinity,n=1,r=0;r<t.length;){for(var o=t[r].interval,a=t[r].close,s=0;s<2;s++)o[s]<=e&&(o[s]=e,a[s]=s?1:1-n),e=o[s],n=a[s];o[0]===o[1]&&a[0]*a[1]!=1?t.splice(r,1):r++}return t}function eo(t){return 0<=t-parseFloat(t)}function no(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(1<t.length?"."+t[1]:"")}function io(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function ro(t){return null==t?"":(t+"").replace(qC,function(t,e){return GC[e]})}function oo(t,e,n){E(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o<r.length;o++){var a=YC[o];t=t.replace(ZC(a),ZC(a,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var u=e[s][r[l]];t=t.replace(ZC(YC[l],s),n?ro(u):u)}return t}function ao(n,t,i){return k(t,function(t,e){n=n.replace("{"+e+"}",i?ro(t):t)}),n}function so(t,e){var n=(t=w(t)?{color:t,extraCssText:e}:t||{}).color,i=t.type;e=t.extraCssText;return n?"subItem"===i?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+ro(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+ro(n)+";"+(e||"")+'"></span>':""}function lo(t,e){return t+="","0000".substr(0,e-t.length)+t}function uo(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Xr(e),r=n?"UTC":"",o=i["get"+r+"FullYear"](),a=i["get"+r+"Month"]()+1,s=i["get"+r+"Date"](),l=i["get"+r+"Hours"](),u=i["get"+r+"Minutes"](),c=i["get"+r+"Seconds"](),h=i["get"+r+"Milliseconds"]();return t=t.replace("MM",lo(a,2)).replace("M",a).replace("yyyy",o).replace("yy",o%100).replace("dd",lo(s,2)).replace("d",s).replace("hh",lo(l,2)).replace("h",l).replace("mm",lo(u,2)).replace("m",u).replace("ss",lo(c,2)).replace("s",c).replace("SSS",lo(h,3))}function co(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function ho(c,h,d,f,p){var g=0,m=0;null==f&&(f=Infinity),null==p&&(p=Infinity);var v=0;h.eachChild(function(t,e){var n,i,r=t.position,o=t.getBoundingRect(),a=h.childAt(e+1),s=a&&a.getBoundingRect();if("horizontal"===c){var l=o.width+(s?-s.x+o.x:0);f<(n=g+l)||t.newline?(g=0,n=l,m+=v+d,v=o.height):v=Math.max(v,o.height)}else{var u=o.height+(s?-s.y+o.y:0);p<(i=m+u)||t.newline?(g+=v+d,m=0,i=u,v=o.width):v=Math.max(v,o.width)}t.newline||(r[0]=g,r[1]=m,"horizontal"===c?g=n+d:m=i+d)})}function fo(t,e,n){var i=e.width,r=e.height,o=Vr(t.x,i),a=Vr(t.y,r),s=Vr(t.x2,i),l=Vr(t.y2,r);return(isNaN(o)||isNaN(parseFloat(t.x)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=i),(isNaN(a)||isNaN(parseFloat(t.y)))&&(a=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=r),n=$C(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}function po(t,e,n){n=$C(n||0);var i=e.width,r=e.height,o=Vr(t.left,i),a=Vr(t.top,r),s=Vr(t.right,i),l=Vr(t.bottom,r),u=Vr(t.width,i),c=Vr(t.height,r),h=n[2]+n[0],d=n[1]+n[3],f=t.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(c)&&(c=r-l-h-a),null!=f&&(isNaN(u)&&isNaN(c)&&(i/r<f?u=.8*i:c=.8*r),isNaN(u)&&(u=f*c),isNaN(c)&&(c=u/f)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-c-h),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d}switch(t.top||t.bottom){case"middle":case"center":a=r/2-c/2-n[0];break;case"bottom":a=r-c-h}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(c)&&(c=r-h-a-(l||0));var p=new ie(o+n[3],a+n[0],u,c);return p.margin=n,p}function go(t,e,n,i,r){var o=!r||!r.hv||r.hv[0],a=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(o||a){var l;if("raw"===s)l="group"===t.type?new ie(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(l=t.getBoundingRect(),t.needLocalTransform()){var u=t.getLocalTransform();(l=l.clone()).applyTransform(u)}e=po(D({width:l.width,height:l.height},e),n,i);var c=t.position,h=o?e.x-l.x:0,d=a?e.y-l.y:0;t.attr("position","raw"===s?[h,d]:[c[0]+h,c[1]+d])}}function mo(t,e){return null!=t[eT[e][0]]||null!=t[eT[e][1]]&&null!=t[eT[e][2]]}function vo(u,c,t){function e(t,e){var n={},i=0,r={},o=0,a=2;if(JC(t,function(t){r[t]=u[t]}),JC(t,function(t){h(c,t)&&(n[t]=r[t]=c[t]),d(n,t)&&i++,d(r,t)&&o++}),f[e])return d(c,t[1])?r[t[2]]=null:d(c,t[2])&&(r[t[1]]=null),r;if(o!==a&&i){if(a<=i)return n;for(var s=0;s<t.length;s++){var l=t[s];if(!h(n,l)&&h(u,l)){n[l]=u[l];break}}return n}return r}function h(t,e){return t.hasOwnProperty(e)}function d(t,e){return null!=t[e]&&"auto"!==t[e]}function n(t,e,n){JC(t,function(t){e[t]=n[t]})}!b(t)&&(t={});var f=t.ignoreSize;!E(f)&&(f=[f,f]);var i=e(eT[0],0),r=e(eT[1],1);n(eT[0],u,i),n(eT[1],u,r)}function yo(t){return xo({},t)}function xo(e,n){return n&&e&&JC(tT,function(t){n.hasOwnProperty(t)&&(e[t]=n[t])}),e}function bo(t){var e=[];return k(oT.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=A(e,function(t){return Yn(t).main}),"dataset"!==t&&x(e,"dataset")<=0&&e.unshift("dataset"),e}function wo(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].length>e)return t[i];return t[n-1]}function _o(t){var e=t.get("coordinateSystem"),n={coordSysName:e,coordSysDims:[],axisMap:z(),categoryAxisMap:z()},i=cT[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}function So(t){return"category"===t.get("type")}function Co(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===pT?{}:[]),this.sourceFormat=t.sourceFormat||gT,this.seriesLayoutBy=t.seriesLayoutBy||vT,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&z(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function To(t){var e=t.option.source,n=gT;if(_(e))n=mT;else if(E(e))for(var i=0,r=e.length;i<r;i++){var o=e[i];if(null!=o){if(E(o)){n=dT;break}if(b(o)){n=fT;break}}}else if(b(e)){for(var a in e)if(e.hasOwnProperty(a)&&P(e[a])){n=pT;break}}else if(null!=e)throw new Error("Invalid data");xT(t).sourceFormat=n}function Ao(t){return xT(t).source}function Do(t){xT(t).datasetMap=z()}function Mo(t){var e=t.option,n=e.data,i=_(n)?mT:hT,r=!1,o=e.seriesLayoutBy,a=e.sourceHeader,s=e.dimensions,l=Po(t);if(l){var u=l.option;n=u.source,i=xT(l).sourceFormat,r=!0,o=o||u.seriesLayoutBy,null==a&&(a=u.sourceHeader),s=s||u.dimensions}var c=Io(n,i,o,a,s),h=e.encode;!h&&l&&(h=Oo(t,l,n,i,o
|
|
,c)),xT(t).source=new Co({data:n,fromDataset:r,seriesLayoutBy:o,sourceFormat:i,dimensionsDefine:c.dimensionsDefine,startIndex:c.startIndex,dimensionsDetectCount:c.dimensionsDetectCount,encodeDefine:h})}function Io(t,e,n,i,r){if(!t)return{dimensionsDefine:ko(r)};var o,a,s,l;if(e===dT)"auto"===i||null==i?Eo(function(t){null!=t&&"-"!==t&&(w(t)?null==a&&(a=1):a=0)},n,t,10):a=i?1:0,r||1!==a||(r=[],Eo(function(t,e){r[e]=null!=t?t:""},n,t)),o=r?r.length:n===yT?t.length:t[0]?t[0].length:null;else if(e===fT)r||(r=Lo(t),s=!0);else if(e===pT)r||(r=[],s=!0,k(t,function(t,e){r.push(e)}));else if(e===hT){var u=Nn(t[0]);o=E(u)&&u.length||1}else e===mT&&Vb&&T(!!r,"dimensions must be given if data is TypedArray.");return s&&k(r,function(t,e){"name"===(b(t)?t.name:t)&&(l=e)}),{startIndex:a,dimensionsDefine:ko(r),dimensionsDetectCount:o,potentialNameDimIndex:l}}function ko(t){if(t){var n=z();return A(t,function(t){if(null==(t=O({},b(t)?t:{name:t})).name)return t;t.name+="",null==t.displayName&&(t.displayName=t.name);var e=n.get(t.name);return e?t.name+="-"+e.count++:n.set(t.name,{count:1}),t})}}function Eo(t,e,n,i){if(null==i&&(i=Infinity),e===yT)for(var r=0;r<n.length&&r<i;r++)t(n[r]?n[r][0]:null,r);else{var o=n[0]||[];for(r=0;r<o.length&&r<i;r++)t(o[r],r)}}function Lo(t){for(var e,n=0;n<t.length&&!(e=t[n++]););if(e){var i=[];return k(e,function(t,e){i.push(e)}),i}}function Oo(t,e,n,i,r,o){var a=_o(t),s={},l=[],u=[],c=t.subType,h=z(["pie","map","funnel"]),d=z(["line","bar","pictorialBar","scatter","effectScatter","candlestick","boxplot"]);if(a&&null!=d.get(c)){var f=t.ecModel,p=xT(f).datasetMap,g=e.uid+"_"+r,m=p.get(g)||p.set(g,{categoryWayDim:1,valueWayDim:0});k(a.coordSysDims,function(t){if(null==a.firstCategoryDimIndex){var e=m.valueWayDim++;s[t]=e,u.push(e)}else if(a.categoryAxisMap.get(t))s[t]=0,l.push(0);else{e=m.categoryWayDim++;s[t]=e,u.push(e)}})}else if(null!=h.get(c)){for(var v,y=0;y<5&&null==v;y++)Ro(n,i,r,o.dimensionsDefine,o.startIndex,y)||(v=y);if(null!=v){s.value=v;var x=o.potentialNameDimIndex||Math.max(v-1,0);u.push(x),l.push(x)}}return l.length&&(s.itemName=l),u.length&&(s.seriesName=u),s}function Po(t){var e=t.option;if(!e.data)return t.ecModel.getComponent("dataset",e.datasetIndex||0)}function No(t,e){return Ro(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function Ro(t,e,n,i,r,o){function a(t){return(null==t||!isFinite(t)||""===t)&&(!(!w(t)||"-"===t)||void 0)}var s,l,u=5;if(_(t))return!1;if(i&&(l=b(l=i[o])?l.name:l),e===dT)if(n===yT){for(var c=t[o],h=0;h<(c||[]).length&&h<u;h++)if(null!=(s=a(c[r+h])))return s}else for(h=0;h<t.length&&h<u;h++){var d=t[r+h];if(d&&null!=(s=a(d[o])))return s}else if(e===fT){if(!l)return;for(h=0;h<t.length&&h<u;h++){if((f=t[h])&&null!=(s=a(f[l])))return s}}else if(e===pT){if(!l)return;if(!(c=t[l])||_(c))return!1;for(h=0;h<c.length&&h<u;h++)if(null!=(s=a(c[h])))return s}else if(e===hT)for(h=0;h<t.length&&h<u;h++){var f,p=Nn(f=t[h]);if(!E(p))return!1;if(null!=(s=a(p[o])))return s}return!1}function Fo(t,e){if(e){var n=e.seiresIndex,i=e.seriesId,r=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=r&&t.name!==r}}function zo(n,t){var i=n.color&&!n.colorLayer;k(t,function(t,e){"colorLayer"===e&&i||oT.hasClass(e)||("object"==typeof t?n[e]=n[e]?g(n[e],t,!1):L(t):null==n[e]&&(n[e]=t))})}function Ho(t){t=t,this.option={},this.option[bT]=1,this._componentsMap=z({series:[]}),this._seriesIndices,this._seriesIndicesMap,zo(t,this._theme.option),g(t,sT,!1),this.mergeOption(t)}function Bo(e,t){E(t)||(t=t?[t]:[]);var n={};return k(t,function(t){n[t]=(e.get(t)||[]).slice()}),n}function Vo(t,e,n){return e.type?e.type:n?n.subType:oT.determineSubType(t,e)}function jo(t,e){t._seriesIndicesMap=z(t._seriesIndices=A(e,function(t){return t.componentIndex})||[])}function Wo(t,e){return e.hasOwnProperty("subType")?f(t,function(t){return t.subType===e.subType}):t}function Uo(t){if(Vb&&!t._seriesIndices)throw new Error("Option should contains series.")}function $o(e){k(_T,function(t){this[t]=v(e[t],e)},this)}function qo(){this._coordinateSystems=[]}function Go(t){this._api=t,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Yo(t,n,i){var e,r,o=[],a=[],s=t.timeline;if(t.baseOption&&(r=t.baseOption),(s||t.options)&&(r=r||{},o=(t.options||[]).slice()),t.media){r=r||{};var l=t.media;CT(l,function(t){t&&t.option&&(t.query?a.push(t):e||(e=t))})}return r||(r=t),r.timeline||(r.timeline=s),CT([r].concat(o).concat(A(a,function(t){return t.option})),function(e){CT(n,function(t){t(e,i)})}),{baseOption:r,timelineOptions:o,mediaDefault:e,mediaList:a}}function Zo(t,e,n){var o={width:e,height:n,aspectratio:e/n},a=!0;return k(t,function(t,e){var n=e.match(MT);if(n&&n[1]&&n[2]){var i=n[1],r=n[2].toLowerCase();Xo(o[r],t,i)||(a=!1)}}),a}function Xo(t,e,n){return"min"===n?e<=t:"max"===n?t<=e:t===e}function Ko(t,e){return t.join(",")===e.join(",")}function Qo(r,t){CT(t=t||{},function(t,e){if(null!=t){var n=r[e];if(oT.hasClass(e)){t=On(t);var i=Fn(n=On(n),t);r[e]=AT(i,function(t){return t.option&&t.exist?DT(t.exist,t.option,!0):t.exist||t.option})}else r[e]=DT(n,t,!0)}})}function Jo(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=ET.length;n<i;n++){var r=ET[n],o=e.normal,a=e.emphasis;o&&o[r]&&(t[r]=t[r]||{},t[r].normal?g(t[r].normal,o[r]):t[r].normal=o[r],o[r]=null),a&&a[r]&&(t[r]=t[r]||{},t[r].emphasis?g(t[r].emphasis,a[r]):t[r].emphasis=a[r],a[r]=null)}}function ta(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,r=t[e].emphasis;i&&(n?(t[e].normal=t[e].emphasis=null,D(t[e],i)):t[e]=i),r&&(t.emphasis=t.emphasis||{},t.emphasis[e]=r)}}function ea(t){ta(t,"itemStyle"),ta(t,"lineStyle"),ta(t,"areaStyle"),ta(t,"label"),ta(t,"labelLine"),ta(t,"upperLabel"),ta(t,"edgeLabel")}function na(t,e){var n=kT(t)&&t[e],i=kT(n)&&n.textStyle;if(i)for(var r=0,o=K_.length;r<o;r++){e=K_[r];i.hasOwnProperty(e)&&(n[e]=i[e])}}function ia(t){t&&(ea(t),na(t,"label"),t.emphasis&&na(t.emphasis,"label"))}function ra(t){if(kT(t)){Jo(t),ea(t),na(t,"label"),na(t,"upperLabel"),na(t,"edgeLabel"),t.emphasis&&(na(t.emphasis,"label"),na(t.emphasis,"upperLabel"),na(t.emphasis,"edgeLabel")),(n=t.markPoint)&&(Jo(n),ia(n)),(i=t.markLine)&&(Jo(i),ia(i));var e=t.markArea;e&&ia(e);var n,i,r=t.data;if("graph"===t.type){r=r||t.nodes;var o=t.links||t.edges;if(o&&!_(o))for(var a=0;a<o.length;a++)ia(o[a]);k(t.categories,function(t){ea(t)})}if(r&&!_(r))for(a=0;a<r.length;a++)ia(r[a]);if((n=t.markPoint)&&n.data){var s=n.data;for(a=0;a<s.length;a++)ia(s[a])}if((i=t.markLine)&&i.data){var l=i.data;for(a=0;a<l.length;a++)E(l[a])?(ia(l[a][0]),ia(l[a][1])):ia(l[a])}"gauge"===t.type?(na(t,"axisLabel"),na(t,"title"),na(t,"detail")):"treemap"===t.type?(ta(t.breadcrumb,"itemStyle"),k(t.levels,function(t){ea(t)})):"tree"===t.type&&ea(t.leaves)}}function oa(t){return E(t)?t:t?[t]:[]}function aa(t){return(E(t)?t[0]:t)||{}}function sa(t,e){e=e.split(",");for(var n=t,i=0;i<e.length&&null!=(n=n&&n[e[i]]);i++);return n}function la(t,e,n,i){e=e.split(",");for(var r,o=t,a=0;a<e.length-1;a++)null==o[r=e[a]]&&(o[r]={}),o=o[r];(i||null==o[e[a]])&&(o[e[a]]=n)}function ua(e){k(OT,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}function ca(m){k(m,function(c,h){var d=[],f=[NaN,NaN],t=[c.stackResultDimension,c.stackedOverDimension],p=c.data,g=c.isStackedByIndex,e=p.map(t,function(t,e,n){var i,r,o=p.get(c.stackedDimension,n);if(isNaN(o))return f;g?r=p.getRawIndex(n):i=p.get(c.stackedByDimension,n);for(var a=NaN,s=h-1;0<=s;s--){var l=m[s];if(g||(r=l.data.rawIndexOf(l.stackedByDimension,i)),0<=r){var u=l.data.getByRawIndex(l.stackResultDimension,r);if(0<=o&&0<u||o<=0&&u<0){o+=u,a=u;break}}}return d[0]=o,d[1]=a,d});p.hostModel.setData(e),c.data=e})}function ha(t,e){Co.isInstance(t)||(t=Co.seriesDataToSource(t)),this._source=t;var n=this._data=t.data,i=t.sourceFormat;if(i===mT){if(Vb&&null==e)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=e,this._data=n}var r=zT[i===dT?i+"_"+t.seriesLayoutBy:i];Vb&&T(r,"Invalide sourceFormat: "+i),O(this,r)}function da(){return this._data.length}function fa(t){return this._data[t]}function pa(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}function ga(t,e,n){return null!=n?t[n]:t}function ma(t,e,n,i){return va(t[i],this._dimensionInfos[e])}function va(t,e){var n=e&&e.type;if("ordinal"!==n)return"time"===n&&"number"!=typeof t&&null!=t&&"-"!==t&&(t=+Xr(t)),null==t||""===t?NaN:+t;var i=e&&e.ordinalMeta;return i?i.parseAndCollect(t):t}function ya(t,e,n){if(t){var i=t.getRawDataItem(e);if(null!=i){var r,o,a=t.getProvider().getSource().sourceFormat,s=t.getDimensionInfo(n);return s&&(r=s.name,o=s.index),HT[a](i,e,o,r)}}}function xa(t,e,n){if(t){var i=t.getProvider().getSource().sourceFormat;if(i===hT||i===fT){var r=t.getRawDataItem(e);return i!==hT||b(r)||(r=null),r?r[n]:void 0}}}function ba(t){return new wa(t)}function wa(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0,this.context}function _a(t,e,n,i,r,o){UT.reset(n,i,r,o),t._callingProgress=e,t._callingProgress({start:n,end:i,count:i-n,next:UT.next},t.context)}function Sa(t,e){var n,i;t._dueIndex=t._outputDueEnd=t._dueEnd=0,t._settedOutputEnd=null,!e&&t._reset&&((n=t._reset(t.context))&&n.progress&&(i=n.forceFirstProgress,n=n.progress),E(n)&&!n.length&&(n=null)),t._progress=n,t._modBy=t._modDataCount=null;var r=t._downstream;return r&&r.dirty(),i}function Ca(t){var e=t.name;Hn(t)||(t.name=Ta(t)||e)}function Ta(t){var n=t.getRawData(),e=n.mapDimension("seriesName",!0),i=[];return k(e,function(t){var e=n.getDimensionInfo(t);e.displayName&&i.push(e.displayName)}),i.join(" ")}function Aa(t){return t.model.getRawData().count()}function Da(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),Ma}function Ma(t,e){t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ia(e,n){k(e.CHANGABLE_METHODS,function(t){e.wrapMethod(t,y(ka,n))})}function ka(t){var e=Ea(t);e&&e.setOutputEnd(this.count())}function Ea(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}function La(){this.group=new Xw,this.uid=Rr("viewChart"),this.renderTask=ba({plan:Na,reset:Ra}),this.renderTask.context={view:this}}function Oa(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var n=0;n<t.childCount();n++)Oa(t.childAt(n),e)}function Pa(e,t,n){var i=jn(e,t);null!=i?k(On(i),function(t){Oa(e.getItemGraphicEl(t),n)}):e.eachItemGraphicEl(function(t){Oa(t,n)})}function Na(t){return KT(t.model)}function Ra(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=r&&XT(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,r),JT[l]}function Fa(t,n,i){function r(){h=(new Date).getTime(),d=null,t.apply(s,l||[])}var o,a,s,l,u,c=0,h=0,d=null;n=n||0;var e=function(){o=(new Date).getTime(),s=this,l=arguments;var t=u||n,e=u||i;u=null,a=o-(e?c:h)-t,clearTimeout(d),e?d=setTimeout(r,t):0<=a?r():d=setTimeout(r,-a),c=o};return e.clear=function(){d&&(clearTimeout(d),d=null)},e.debounceNextCall=function(t){u=t},e}function za(t,e,n,i){var r=t[e];if(r){var o=r[tA]||r,a=r[nA];if(r[eA]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=Fa(o,n,"debounce"===i))[tA]=o,r[nA]=i,r[eA]=n}return r}}function Ha(t,e){var n=t[e];n&&n[tA]&&(t[e]=n[tA])}function Ba(t,e,n,i){this.ecInstance=t,this.api=e,this.unfinished;n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice();this._allHandlers=n.concat(i),this._stageTaskMap=z()}function Va(s,t,l,u,c){function h(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}var d;c=c||{},k(t,function(n){if(!c.visualType||c.visualType===n.visualType){var t=s._stageTaskMap.get(n.uid),e=t.seriesTaskMap,i=t.overallTask;if(i){var r,o=i.agentStubMap;o.each(function(t){h(c,t)&&(t.dirty(),r=!0)}),r&&i.dirty(),uA(i,u);var a=s.getPerformArgs(i,c.block);o.each(function(t){t.perform(a)}),d|=i.perform(a)}else e&&e.each(function(t){h(c,t)&&t.dirty();var e=s.getPerformArgs(t,c.block);e.skip=!n.performRawSeries&&l.isSeriesFiltered(t.context.model),uA(t,u),d|=t.perform(e)})}}),s.unfinished|=d}function ja(i,r,t,o,a){function e(t){var e=t.uid,n=s.get(e)||s.set(e,ba({plan:Ya,reset:Za,count:Ka}));n.context={model:t,ecModel:o,api:a,useClearVisual:r.isVisual&&!r.isLayout,plan:r.plan,reset:r.reset,scheduler:i},Qa(i,t,n)}var s=t.seriesTaskMap||(t.seriesTaskMap=z()),n=r.seriesType,l=r.getTargetSeries;r.createOnAllSeries?o.eachRawSeries(e):n?o.eachRawSeriesByType(n,e):l&&l(o,a).each(e);var u=i._pipelineMap;s.each(function(t,e){u.get(e)||(t.dispose(),s.removeKey(e))})}function Wa(i,t,e,n,r){function o(t){var e=t.uid,n=s.get(e);n||(n=s.set(e,ba({reset:$a,onDirty:Ga})),a.dirty()),n.context={model:t,overallProgress:c,modifyOutputEnd:h},n.agent=a,n.__block=c,Qa(i,t,n)}var a=e.overallTask=e.overallTask||ba({reset:Ua});a.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:i};var s=a.agentStubMap=a.agentStubMap||z(),l=t.seriesType,u=t.getTargetSeries,c=!0,h=t.modifyOutputEnd;l?n.eachRawSeriesByType(l,o):u?u(n,r).each(o):(c=!1,k(n.getSeries(),o));var d=i._pipelineMap;s.each(function(t,e){d.get(e)||(t.dispose(),a.dirty(),s.removeKey(e))})}function Ua(t){t.overallReset(t.ecModel,t.api,t.payload)}function $a(t){return t.overallProgress&&qa}function qa(){this.agent.dirty(),this.getDownstream().dirty()}function Ga(){this.agent&&this.agent.dirty()}function Ya(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Za(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=On(t.reset(t.model,t.ecModel,t.api,t.payload));return 1<e.length?A(e,function(t,e){return Xa(e)}):cA}function Xa(o){return function(t,e){var n=e.data,i=e.resetDefines[o];if(i&&i.dataEach)for(var r=t.start;r<t.end;r++)i.dataEach(n,r);else i&&i.progress&&i.progress(t,n)}}function Ka(t){return t.data.count()}function Qa(t,e,n){var i=e.uid,r=t._pipelineMap.get(i);!r.head&&(r.head=n),r.tail&&r.tail.pipe(n),(r.tail=n).__idxInPipeline=r.count++,n.__pipeline=r}function Ja(t){hA=null;try{t(dA,fA)}catch(e){}return hA}function ts(t,e){for(var n in e.prototype)t[n]=B}function es(i){return function(t,e,n){t=t&&t.toLowerCase(),hw.prototype[i].call(this,t,e,n)}}function ns(){hw.call(this)}function is(t,e,n){function i(t,e){return t.__prio-e.__prio}n=n||{},"string"==typeof e&&(e=qA[e]),this.id,this.group,this._dom=t;var r="canvas";Vb&&(r=("undefined"==typeof window?global:window).__ECHARTS__DEFAULT__RENDERER__||r);var o=this._zr=Mn(t,{renderer:n.renderer||r,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=Fa(v(o.flush,o),17),(e=L(e))&&NT(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new qo;var a=this._api=ws(this);he($A,i),he(jA,i),this._scheduler=new Ba(this,a,jA,$A),hw.call(this),this._messageCenter=new ns,this._initEvents(),this.resize=v(this.resize,this),this._pendingActions=[],o.animation.on("frame",this._onframe,this),hs(o,this),d(this)}function rs(t,e,n){var i,r=this._model,o=this._coordSysMgr.getCoordinateSystems();e=Un(r,e);for(var a=0;a<o.length;a++){var s=o[a];if(s[t]&&null!=(i=s[t](r,e,n)))return i}Vb&&console.warn("No coordinate system that supports "+t+" found by the given finder.")}function os(t){var e=t._model,n=t._scheduler;n.restorePipelines(e),n.prepareStageTasks(),ds(t,"component",e,n),ds(t,"chart",e,n),n.plan()}function as(e,n,i,r,t){function o(t){t&&t.__alive&&t[n]&&t[n](t.__model,a,e._api,i)}var a=e._model;if(r){var s={};s[r+"Id"]=i[r+"Id"],s[r+"Index"]=i[r+"Index"],s[r+"Name"]=i[r+"Name"];var l={mainType:r,query:s};t&&(l.subType=t);var u=i.excludeSeriesId;null!=u&&(u=z(On(u))),a&&a.eachComponent(l,function(t){u&&null!=u.get(t.id)||o(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])},e)}else wA(e._componentsViews.concat(e._chartsViews),o)}function ss(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries(function(t){i.updateStreamModes(t,n[t.__viewId])})}function ls(e,t){var n=e.type,i=e.escapeConnect,r=BA[n],o=r.actionInfo,a=(o.update||"update").split(":"),s=a.pop();a=null!=a[0]&&CA(a[0]),this[PA]=!0;var l=[e],u=!1;e.batch&&(u=!0,l=A(e.batch,function(t){return(t=D(O({},t),e)).batch=null,t}));var c,h=[],d="highlight"===n||"downplay"===n;wA(l,function(t){(c=(c=r.action(t,this._model,this._api))||O({},t)).type=o.event||c.type,h.push(c),d?as(this,s,t,"series"):a&&as(this,s,t,a.main,a.sub)},this),"none"===s||d||a||(this[NA]?(os(this),zA.update.call(this,e),this[NA]=!1):zA[s].call(this,e)),c=u?{type:o.event||n,escapeConnect:i,batch:h}:h[0],this[PA]=!1,!t&&this._messageCenter.trigger(c.type,c)}function us(t){for(var e=this._pendingActions;e.length;){var n=e.shift();ls.call(this,n,t)}}function cs(t){!t&&this.trigger("updated")}function hs(t,e){t.on("rendered",function(){e.trigger("rendered"),!t.animation.isFinished()||e[NA]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")})}function ds(t,e,o,a){function n(t){var e="_ec_"+t.id+"_"+t.type,n=u[e];if(!n){var i=CA(t.type),r=s?GT.getClass(i.main,i.sub):La.getClass(i.sub);Vb&&bA(r,i.sub+" does not exist."),(n=new r).init(o,h),u[e]=n,l.push(n),c.add(n.group)}t.__viewId=n.__id=e,n.__alive=!0,n.__model=t,n.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!s&&a.prepareView(n,t,o,h)}for(var s="component"===e,l=s?t._componentsViews:t._chartsViews,u=s?t._componentsMap:t._chartsMap,c=t._zr,h=t._api,i=0;i<l.length;i++)l[i].__alive=!1;s?o.eachComponent(function(t,e){"series"!==t&&n(e)}):o.eachSeries(n);for(i=0;i<l.length;){var r=l[i];r.__alive?i++:(!s&&r.renderTask.dispose(),c.remove(r.group),r.dispose(o,h),l.splice(i,1),delete u[r.__id],r.__id=r.group.__ecComponentInfo=null)}}function fs(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function ps(t,e,n,i){gs(t,e,n,i),wA(t._chartsViews,function(t){t.__alive=!1}),ms(t,e,n,i),wA(t._chartsViews,function(t){t.__alive||t.remove(e,n)})}function gs(t,n,i,r,e){wA(e||t._componentsViews,function(t){var e=t.__model;t.render(e,n,i,r),bs(e,t)})}function ms(i,t,e,r,o){var a,s=i._scheduler;t.eachSeries(function(t){var e=i._chartsMap[t.__viewId];e.__alive=!0;var n=e.renderTask;s.updatePayload(n,r),o&&o.get(t.uid)&&n.dirty(),a|=n.perform(s.getPerformArgs(n)),e.group.silent=!!t.get("silent"),bs(t,e),xs(t,e)}),s.unfinished|=a,ys(i._zr,t),oA(i._zr.dom,t)}function vs(e,n){wA(UA,function(t){t(e,n)})}function ys(t,e){var n=t.storage,i=0;n.traverse(function(t){t.isGroup||i++}),i>e.get("hoverLayerThreshold")&&!Ub.node&&n.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function xs(t,e){var n=t.get("blendMode")||null;Vb&&!Ub.canvasSupported&&n&&"source-over"!==n&&console.warn("Only canvas support blendMode"),e.group.traverse(function(t){t.isGroup||t.style.blend!==n&&t.setStyle("blend",n),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",n)})})}function bs(t,e){var n=t.get("z"),i=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=i&&(t.zlevel=i))})}function ws(n){var t=n._coordSysMgr;return O(new $o(n),{getCoordinateSystems:v(t.getCoordinateSystems,t),getComponentByElement:function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}}})}function _s(i){function r(t,e){for(var n=0;n<t.length;n++){t[n][l]=e}}var o=0,a=1,s=2,l="__connectUpdateStatus";wA(VA,function(t,e){i._messageCenter.on(e,function(t){if(ZA[i.group]&&i[l]!==o){if(t&&t.escapeConnect)return;var e=i.makeActionFromEvent(t),n=[];wA(YA,function(t){t!==i&&t.group===i.group&&n.push(t)}),r(n,o),wA(n,function(t){t[l]!==a&&t.dispatchAction(e)}),r(n,s)}})})}function Ss(t,e,n){if(Vb){if(U_.replace(".","")-0<AA.zrender.replace(".","")-0)throw new Error("zrender/src "+U_+" is too old for ECharts "+TA+". Current version need ZRender "+AA.zrender+"+");if(!t)throw new Error("Initialize failed: invalid dom.")}var i=Ds(t);if(i)return Vb&&console.warn("There is a chart instance already initialized on the dom."),i;Vb&&(!S(t)||"CANVAS"===t.nodeName.toUpperCase()||(t.clientWidth||n&&null!=n.width)&&(t.clientHeight||n&&null!=n.height)||console.warn("Can't get dom width or height"));var r=new is(t,e,n);return r.id="ec_"+XA++,YA[r.id]=r,qn(t,QA,r.id),_s(r),r}function Cs(e){if(E(e)){var t=e;e=null,wA(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+KA++,wA(t,function(t){t.group=e})}return ZA[e]=!0,e}function Ts(t){ZA[t]=!1}function As(t){"string"==typeof t?t=YA[t]:t instanceof is||(t=Ds(t)),t instanceof is&&!t.isDisposed()&&t.dispose()}function Ds(t){return YA[Gn(t,QA)]}function Ms(t){return YA[t]}function Is(t,e){qA[t]=e}function ks(t){WA.push(t)}function Es(t,e){zs(jA,t,e,MA)}function Ls(t){UA.push(t)}function Os(t,e,n){"function"==typeof e&&(n=e,e="");var i=SA(t)?t.type:[t,t={event:e}][0];t.event=(t.event||i).toLowerCase(),e=t.event,bA(RA.test(i)&&RA.test(e)),BA[i]||(BA[i]={action:n,actionInfo:t}),VA[e]=i}function Ps(t,e){qo.register(t,e)}function Ns(t){var e=qo.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function Rs(t,e){zs($A,t,e,kA,"layout")}function Fs(t,e){zs($A,t,e,LA,"visual")}function zs(t,e,n,i,r){if((_A(e)||SA(e))&&(n=e,e=i),Vb){if(isNaN(e)||null==e)throw new Error("Illegal priority");wA(t,function(t){bA(t.__raw!==n)})}var o=Ba.wrapStageHandler(n,r);return o.__prio=e,o.__raw=n,t.push(o),o}function Hs(t,e){GA[t]=e}function Bs(t){return oT.extend(t)}function Vs(t){return GT.extend(t)}function js(t){return qT.extend(t)}function Ws(t){return La.extend(t)}function Us(t){n("createCanvas",t)}function $s(t,e,n){e.geoJson&&!e.features&&(n=e.specialAreas,e=e.geoJson),"string"==typeof e&&(e="undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")()),JA[t]={geoJson:e,specialAreas:n}}function qs(t){return JA[t]}function Gs(t){return t}function Ys(t,e,n,i,r){this._old=t,this._new=e,this._oldKeyGetter=n||Gs,this._newKeyGetter=i||Gs,this.context=r}function Zs(t,e,n,i,r){for(var o=0;o<t.length;o++){var a="_ec_"+r[i](t[o],o),s=e[a];null==s?(n.push(a),e[a]=o):(s.length||(e[a]=s=[s]),s.push(o))}}function Xs(i){var t={},o=t.encode={},a=z(),s=[],l=[];k(i.dimensions,function(t){var r=i.getDimensionInfo(t),e=r.coordDim;if(e){Vb&&T(null==nD.get(e));var n=o[e];o.hasOwnProperty(e)||(n=o[e]=[]),n[r.coordDimIndex]=t,r.isExtraCoord||(a.set(e,1),Qs(r.type)&&(s[0]=t)),r.defaultTooltip&&l.push(t)}nD.each(function(t,e){var n=o[e];o.hasOwnProperty(e)||(n=o[e]=[]);var i=r.otherDims[e];null!=i&&!1!==i&&(n[i]=r.name)})});var r=[],u={};a.each(function(t,e){var n=o[e];u[e]=n[0],r=r.concat(n)}),t.dataDimsOnCoord=r,t.encodeFirstDimNotExtra=u;var e=o.label;e&&e.length&&(s=e.slice());var n=o.tooltip;return n&&n.length?l=n.slice():l.length||(l=s.slice()),o.defaultedLabel=s,o.defaultedTooltip=l,t}function Ks(t){return"category"===t?"ordinal":"time"===t?"time":"float"}function Qs(t){return!("ordinal"===t||"time"===t)}function Js(t){return 65535<t._rawCount?sD:lD}function tl(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function el(e,n){k(uD.concat(n.__wrappedMethods||[]),function(t){n.hasOwnProperty(t)&&(e[t]=n[t])}),e.__wrappedMethods=n.__wrappedMethods,k(cD,function(t){e[t]=L(n[t])}),e._calculationInfo=O(n._calculationInfo)}function nl(r){var o=r._invertedIndicesMap;k(o,function(t,e){var n=r._dimensionInfos[e].ordinalMeta;if(n){t=o[e]=new sD(n.categories.length);for(var i=0;i<t.length;i++)t[i]=NaN;for(i=0;i<r._count;i++)t[r.get(e,i)]=i}})}function il(t,e,n){var i;if(null!=e){var r=t._chunkSize,o=Math.floor(n/r),a=n%r,s=t.dimensions[e],l=t._storage[s][o];if(l){i=l[a];var u=t._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(i=u.categories[i])}}return i}function rl(t){return t}function ol(t){return t<this._count&&0<=t?this._indices[t]:-1}function al(t,e){var n=t._idList[e];return null==n&&(n=il(t,t._idDimIdx,e)),null==n&&(n=oD+e),n}function sl(t){return E(t)||(t=[t]),t}function ll(t,e){for(var n=0;n<e.length;n++)t._dimensionInfos[e[n]]||console.error("Unkown dimension "+e[n])}function ul(t,e){var n=t.dimensions,i=new hD(A(n,t.getDimensionInfo,t),t.hostModel);el(i,t);for(var r=i._storage={},o=t._storage,a=0;a<n.length;a++){var s=n[a];o[s]&&(0<=x(e,s)?(r[s]=cl(o[s]),i._rawExtent[s]=hl(),i._extent[s]=null):r[s]=o[s])}return i}function cl(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=tl(t[n]);return e}function hl(){return[Infinity,-Infinity]}function dl(t,e,n){function l(t,e,n){null!=nD.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,o.set(e,!0))}Co.isInstance(e)||(e=Co.seriesDataToSource(e)),n=n||{},t=(t||[]).slice();for(var i=(n.dimsDef||[]).slice(),u=z(n.encodeDef),r=z(),o=z(),c=[],a=fl(e,t,i,n.dimCount),s=0;s<a;s++){var h=i[s]=O({},b(i[s])?i[s]:{name:i[s]}),d=h.name,f=c[s]={otherDims:{}};null!=d&&null==r.get(d)&&(f.name=f.displayName=d,r.set(d,s)),null!=h.type&&(f.type=h.type),null!=h.displayName&&(f.displayName=h.displayName)}u.each(function(t,n){t=On(t).slice();var i=u.set(n,[]);k(t,function(t,e){w(t)&&(t=r.get(t)),null!=t&&t<a&&(i[e]=t,l(c[t],n,e))})});var p=0;k(t,function(r){var o,a,s;if(w(r))o=r,r={};else{o=r.name;var t=r.ordinalMeta;r.ordinalMeta=null,(r=L(r)).ordinalMeta=t,a=r.dimsDef,s=r.otherDims,r.name=r.coordDim=r.coordDimIndex=r.dimsDef=r.otherDims=null}var e=On(u.get(o));if(!e.length)for(var n=0;n<(a&&a.length||1);n++){for(;p<c.length&&null!=c[p].coordDim;)p++;p<c.length&&e.push(p++)}k(e,function(t,e){var n=c[t];if(l(D(n,r),o,e),null==n.name&&a){var i=a[e];!b(i)&&(i={name:i}),n.name=n.displayName=i.name,n.defaultTooltip=i.defaultTooltip}s&&D(n.otherDims,s)})});var g=n.generateCoord,m=n.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y=g||"value",x=0;x<a;x++){null==(f=c[x]=c[x]||{}).coordDim&&(f.coordDim=pl(y,o,v),f.coordDimIndex=0,(!g||m<=0)&&(f.isExtraCoord=!0),m--),null==f.name&&(f.name=pl(f.coordDim,r)),null==f.type&&No(e,x,f.name)&&(f.type="ordinal")}return c}function fl(t,e,n,i){var r=Math.max(t.dimensionsDetectCount||1,e.length,n.length,i||0);return k(e,function(t){var e=t.dimsDef;e&&(r=Math.max(r,e.length))}),r}function pl(t,e,n){if(n||null!=e.get(t)){for(var i=0;null!=e.get(t+i);)i++;t+=i}return e.set(t,!0),t}function gl(t,n,e){var i,r,o,a,s=(e=e||{}).byIndex,l=e.stackedCoordDimension,u=!(!t||!t.get("stack"));if(k(n,function(t,e){w(t)&&(n[e]=t={name:t}),u&&!t.isExtraCoord&&(s||i||!t.ordinalMeta||(i=t),r||"ordinal"===t.type||"time"===t.type||l&&l!==t.coordDim||(r=t))}),!r||s||i||(s=!0),r){o="__\0ecstackresult",a="__\0ecstackedover",i&&(i.createInvertedIndices=!0);var c=r.coordDim,h=r.type,d=0;k(n,function(t){t.coordDim===c&&d++}),n.push({name:o,coordDim:c,coordDimIndex:d,type:h,isExtraCoord:!0,isCalculationCoord:!0}),d++,n.push({name:a,coordDim:a,coordDimIndex:d,type:h,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:r&&r.name,stackedByDimension:i&&i.name,isStackedByIndex:s,stackedOverDimension:a,stackResultDimension:o}}function ml(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function vl(t,e){return ml(t,e)?t.getCalculationInfo("stackResultDimension"):e}function yl(t,e,n){n=n||{},Co.isInstance(t)||(t=Co.seriesDataToSource(t));var i,r=e.get("coordinateSystem"),o=qo.get(r),a=_o(e);a&&(i=A(a.coordSysDims,function(t){var e={name:t},n=a.axisMap.get(t);if(n){var i=n.get("type");e.type=Ks(i)}return e})),i||(i=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]);var s,l,u=pD(t,{coordDimensions:i,generateCoord:n.generateCoord});a&&k(u,function(t,e){var n=t.coordDim,i=a.categoryAxisMap.get(n);i&&(null==s&&(s=e),t.ordinalMeta=i.getOrdinalMeta()),null!=t.otherDims.itemName&&(l=!0)}),l||null==s||(u[s].otherDims.itemName=0);var c=gl(e,u),h=new hD(u,e);h.setCalculationInfo(c);var d=null!=s&&xl(t)?function(t,e,n,i){return i===s?n:this.defaultDimValueGetter(t,e,n,i)}:null;return h.hasItemOption=!1,h.initData(t,null,d),h}function xl(t){if(t.sourceFormat===hT){var e=bl(t.data||[]);return null!=e&&!E(Nn(e))}}function bl(t){for(var e=0;e<t.length&&null==t[e];)e++;return t[e]}function wl(t){this._setting=t||{},this._extent=[Infinity,-Infinity],this._interval=0,this.init&&this.init.apply(this,arguments)}function _l(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}function Sl(t){return t._map||(t._map=z(t.categories))}function Cl(t){return b(t)&&null!=t.value?t.value:t+""}function Tl(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=Jr(o/e,!0);null!=n&&a<n&&(a=r.interval=n),null!=i&&i<a&&(a=r.interval=i);var s=r.intervalPrecision=Al(a);return Ml(r.niceTickExtent=[yD(Math.ceil(t[0]/a)*a,s),yD(Math.floor(t[1]/a)*a,s)],t),r}function Al(t){return $r(t)+2}function Dl(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function Ml(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Dl(t,0,e),Dl(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Il(t,e,n,i){var r=[];if(!t)return r;var o=1e4;e[0]<n[0]&&r.push(e[0]);for(var a=n[0];a<=n[1]&&(r.push(a),(a=yD(a+t,i))!==r[r.length-1]);)if(r.length>o)return[];return e[1]>(r.length?r[r.length-1]:n[1])&&r.push(e[1]),r}function kl(t){return t.get("stack")||wD+t.seriesIndex}function El(t){return t.dim+t.index}function Ll(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o<t.count;o++)e.push(D({bandWidth:r,axisKey:i,stackId:wD+o},t));var a=Nl(e),s=[];for(o=0;o<t.count;o++){var l=a[i][wD+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}function Ol(t,e){var n=[];return e.eachSeriesByType(t,function(t){zl(t)&&!Hl(t)&&n.push(t)}),n}function Pl(t){var u=[];return k(t,function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),i=n.getExtent(),r="category"===n.type?n.getBandWidth():Math.abs(i[1]-i[0])/e.count(),o=Vr(t.get("barWidth"),r),a=Vr(t.get("barMaxWidth"),r),s=t.get("barGap"),l=t.get("barCategoryGap");u.push({bandWidth:r,barWidth:o,barMaxWidth:a,barGap:s,barCategoryGap:l,axisKey:El(n),stackId:kl(t)})}),Nl(u)}function Nl(t){var c={};k(t,function(t){var e=t.axisKey,n=t.bandWidth,i=c[e]||{bandWidth:n,remainedWidth:n,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},r=i.stacks;c[e]=i;var o=t.stackId;r[o]||i.autoWidthCount++,r[o]=r[o]||{width:0,maxWidth:0};var a=t.barWidth;a&&!r[o].width&&(r[o].width=a,a=Math.min(i.remainedWidth,a),i.remainedWidth-=a);var s=t.barMaxWidth;s&&(r[o].maxWidth=s);var l=t.barGap;null!=l&&(i.gap=l);var u=t.barCategoryGap;null!=u&&(i.categoryGap=u)});var d={};return k(c,function(t,n){d[n]={};var e=t.stacks,i=t.bandWidth,r=Vr(t.categoryGap,i),o=Vr(t.gap,1),a=t.remainedWidth,s=t.autoWidthCount,l=(a-r)/(s+(s-1)*o);l=Math.max(l,0),k(e,function(t){var e=t.maxWidth;e&&e<l&&(e=Math.min(e,a),t.width&&(e=Math.min(e,t.width)),a-=e,t.width=e,s--)}),l=(a-r)/(s+(s-1)*o),l=Math.max(l,0);var u,c=0;k(e,function(t){t.width||(t.width=l),c+=(u=t).width*(1+o)}),u&&(c-=u.width*o);var h=-c/2;k(e,function(t,e){d[n][e]=d[n][e]||{offset:h,width:t.width},h+=t.width*(1+o)})}),d}function Rl(t,e,n){if(t&&e){var i=t[El(e)];return null!=i&&null!=n&&(i=i[kl(n)]),i}}function Fl(t,e){var n=Ol(t,e),A=Pl(n),D={};k(n,function(t){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=kl(t),o=A[El(i)][r],a=o.offset,s=o.width,l=n.getOtherAxis(i),u=t.get("barMinHeight")||0;D[r]=D[r]||[],e.setLayout({offset:a,size:s});for(var c=e.mapDimension(l.dim),h=e.mapDimension(i.dim),d=ml(e,c),f=l.isHorizontal(),p=Bl(i,l,d),g=0,m=e.count();g<m;g++){var v=e.get(c,g),y=e.get(h,g);if(!isNaN(v)){var x,b,w,_,S,C=0<=v?"p":"n",T=p;if(d&&(D[r][y]||(D[r][y]={p:p,n:p}),T=D[r][y][C]),f)x=T,b=(S=n.dataToPoint([v,y]))[1]+a,w=S[0]-p,_=s,Math.abs(w)<u&&(w=(w<0?-1:1)*u),d&&(D[r][y][C]+=w);else x=(S=n.dataToPoint([y,v]))[0]+a,b=T,w=s,_=S[1]-p,Math.abs(_)<u&&(_=(_<=0?-1:1)*u),d&&(D[r][y][C]+=_);e.setItemLayout(g,{x:x,y:b,width:w,height:_})}}},this)}function zl(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function Hl(t){return t.pipelineContext&&t.pipelineContext.large}function Bl(t,e,n){return 0<=x(t.getAxesOnZeroOf(),e)||n?e.toGlobalCoord(e.dataToCoord(0)):e.getGlobalExtent()[0]}function Vl(t,e){return zD(t,FD(e))}function jl(t,e){var n,i,r,o=t.type,a=e.getMin(),s=e.getMax(),l=null!=a,u=null!=s,c=t.getExtent();"ordinal"===o?n=e.getCategories().length:(E(i=e.get("boundaryGap"))||(i=[i||0,i||0]),"boolean"==typeof i[0]&&(Vb&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),i=[0,0]),i[0]=Vr(i[0],1),i[1]=Vr(i[1],1),r=c[1]-c[0]||Math.abs(c[0])),null==a&&(a="ordinal"===o?n?0:NaN:c[0]-i[0]*r),null==s&&(s="ordinal"===o?n?n-1:NaN:c[1]+i[1]*r),"dataMin"===a?a=c[0]:"function"==typeof a&&(a=a({min:c[0],max:c[1]})),"dataMax"===s?s=c[1]:"function"==typeof s&&(
|
|
s=s({min:c[0],max:c[1]})),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN),t.setBlank(C(a)||C(s)||"ordinal"===o&&!t.getOrdinalMeta().categories.length),e.getNeedCrossZero()&&(0<a&&0<s&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var h=e.ecModel;if(h&&"time"===o){var d,f=Ol("bar",h);if(k(f,function(t){d|=t.getBaseAxis()===e.axis}),d){var p=Pl(f),g=Wl(a,s,e,p);a=g.min,s=g.max}}return[a,s]}function Wl(t,e,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=Rl(i,n.axis);if(a===undefined)return{min:t,max:e};var s=Infinity;k(a,function(t){s=Math.min(t.offset,s)});var l=-Infinity;k(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-t,h=c/(1-(s+l)/o)-c;return{min:t-=h*(s/u),max:e+=h*(l/u)}}function Ul(t,e){var n=jl(t,e),i=null!=e.getMin(),r=null!=e.getMax(),o=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var a=t.type;t.setExtent(n[0],n[1]),t.niceExtent({splitNumber:o,fixMin:i,fixMax:r,minInterval:"interval"===a||"time"===a?e.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function $l(t,e){if(e=e||t.get("type"))switch(e){case"category":return new vD(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[Infinity,-Infinity]);case"value":return new bD;default:return(wl.getClass(e)||bD).create(t)}}function ql(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(0<n&&0<i||n<0&&i<0)}function Gl(n){var e,i=n.getLabelModel().get("formatter"),r="category"===n.type?n.scale.getExtent()[0]:null;return"string"==typeof i?(e=i,i=function(t){return e.replace("{value}",null!=t?t:"")}):"function"==typeof i?function(t,e){return null!=r&&(e=t-r),i(Yl(n,t),e)}:function(t){return n.scale.getLabel(t)}}function Yl(t,e){return"category"===t.type?t.scale.getLabel(e):e}function Zl(t){var e=t.model,n=t.scale;if(e.get("axisLabel.show")&&!n.isBlank()){var i,r,o="category"===t.type,a=n.getExtent();r=o?n.count():(i=n.getTicks()).length;var s,l=t.getLabelModel(),u=Gl(t),c=1;40<r&&(c=Math.ceil(r/40));for(var h=0;h<r;h+=c){var d=u(i?i[h]:a[0]+h),f=Xl(l.getTextRect(d),l.get("rotate")||0);s?s.union(f):s=f}return s}}function Xl(t,e){var n=e*Math.PI/180,i=t.plain(),r=i.width,o=i.height,a=r*Math.cos(n)+o*Math.sin(n),s=r*Math.sin(n)+o*Math.cos(n);return new ie(i.x,i.y,a,s)}function Kl(t,e){if("image"!==this.type){var n=this.style,i=this.shape;i&&"line"===i.symbolType?n.stroke=t:this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff"):(n.fill&&(n.fill=t),n.stroke&&(n.stroke=t)),this.dirty(!1)}}function Ql(t,e,n,i,r,o,a){var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?Yi(t.slice(8),new ie(e,n,i,r),a?"center":"cover"):0===t.indexOf("path://")?Gi(t.slice(7),{},new ie(e,n,i,r),a?"center":"cover"):new KD({shape:{symbolType:t,x:e,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=Kl,s.setColor(o),s}function Jl(t){return yl(t.getSource(),t)}function tu(t,e){var n=e;Or.isInstance(e)||r(n=new Or(e),UD);var i=$l(n);return i.setExtent(t[0],t[1]),Ul(i,n),i}function eu(t){r(t,UD)}function nu(t,e){return Math.abs(t-e)<tM}function iu(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;o<t.length;o++){var a=t[o];i+=Ti(r[0],r[1],a[0],a[1],e,n),r=a}var s=t[0];return nu(r[0],s[0])&&nu(r[1],s[1])||(i+=Ti(r[0],r[1],s[0],s[1],e,n)),0!==i}function ru(t,e,n){if(this.name=t,this.geometries=e,n)n=[n[0],n[1]];else{var i=this.getBoundingRect();n=[i.x+i.width/2,i.y+i.height/2]}this.center=n}function ou(t){if(!t.UTF8Encoding)return t;var e=t.UTF8Scale;null==e&&(e=1024);for(var n=t.features,i=0;i<n.length;i++)for(var r=n[i].geometry,o=r.coordinates,a=r.encodeOffsets,s=0;s<o.length;s++){var l=o[s];if("Polygon"===r.type)o[s]=au(l,a[s],e);else if("MultiPolygon"===r.type)for(var u=0;u<l.length;u++){var c=l[u];l[u]=au(c,a[s][u],e)}}return t.UTF8Encoding=!1,t}function au(t,e,n){for(var i=[],r=e[0],o=e[1],a=0;a<t.length;a+=2){var s=t.charCodeAt(a)-64,l=t.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),r=s+=r,o=l+=o,i.push([s/n,l/n])}return i}function su(t){return"category"===t.type?uu(t):du(t)}function lu(t,e){return"category"===t.type?hu(t,e):{ticks:t.scale.getTicks()}}function uu(t){var e=t.getLabelModel(),n=cu(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function cu(t,e){var n,i=fu(t,"labels"),r=wu(e),o=pu(i,r);return o||gu(i,r,{labels:m(r)?bu(t,r):xu(t,n="auto"===r?mu(t):r),labelCategoryInterval:n})}function hu(t,e){var n,i,r=fu(t,"ticks"),o=wu(e),a=pu(r,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),m(o))n=bu(t,o,!0);else if("auto"===o){var s=cu(t,t.getLabelModel());i=s.labelCategoryInterval,n=A(s.labels,function(t){return t.tickValue})}else n=xu(t,i=o,!0);return gu(r,o,{ticks:n,tickCategoryInterval:i})}function du(n){var t=n.scale.getTicks(),i=Gl(n);return{labels:A(t,function(t,e){return{formattedLabel:i(t,e),rawLabel:n.scale.getLabel(t),tickValue:t}})}}function fu(t,e){return nM(t)[e]||(nM(t)[e]=[])}function pu(t,e){for(var n=0;n<t.length;n++)if(t[n].key===e)return t[n].value}function gu(t,e,n){return t.push({key:e,value:n}),n}function mu(t){var e=nM(t).autoInterval;return null!=e?e:nM(t).autoInterval=t.calculateCategoryInterval()}function vu(t){var e=yu(t),n=Gl(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),a=r.count();if(o[1]-o[0]<1)return 0;var s=1;40<a&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),c=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),d=0,f=0;l<=o[1];l+=s){var p=0,g=0,m=Se(n(l),e.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/c,y=f/h;isNaN(v)&&(v=Infinity),isNaN(y)&&(y=Infinity);var x=Math.max(0,Math.floor(Math.min(v,y))),b=nM(t.model),w=b.lastAutoInterval,_=b.lastTickCount;return null!=w&&null!=_&&Math.abs(w-x)<=1&&Math.abs(_-a)<=1&&x<w?x=w:(b.lastTickCount=a,b.lastAutoInterval=x),x}function yu(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function xu(t,e,n){function i(t){l.push(n?t:{formattedLabel:r(t),rawLabel:o.getLabel(t),tickValue:t})}var r=Gl(t),o=t.scale,a=o.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),c=a[0],h=o.count();0!==c&&1<u&&2<h/u&&(c=Math.round(Math.ceil(c/u)*u));var d={min:s.get("showMinLabel"),max:s.get("showMaxLabel")};d.min&&c!==a[0]&&i(a[0]);for(var f=c;f<=a[1];f+=u)i(f);return d.max&&f!==a[1]&&i(a[1]),l}function bu(t,n,i){var r=t.scale,o=Gl(t),a=[];return k(r.getTicks(),function(t){var e=r.getLabel(t);n(t,e)&&a.push(i?t:{formattedLabel:o(t),rawLabel:e,tickValue:t})}),a}function wu(t){var e=t.get("interval");return null==e?"auto":e}function _u(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}function Su(t,e,n,i,r){function o(t,e){return c?e<t:t<e}var a=e.length;if(t.onBand&&!i&&a){var s,l=t.getExtent();if(1===a)e[0].coord=l[0],s=e[1]={coord:l[0]};else{var u=e[1].coord-e[0].coord;k(e,function(t){t.coord-=u/2;var e=e||0;0<e%2&&(t.coord-=u/(2*(e+1)))}),s={coord:e[a-1].coord+u},e.push(s)}var c=l[0]>l[1];o(e[0].coord,l[0])&&(r?e[0].coord=l[0]:e.shift()),r&&o(l[0],e[0].coord)&&e.unshift({coord:l[0]}),o(l[1],s.coord)&&(r?s.coord=l[1]:e.pop()),r&&o(s.coord,l[1])&&e.push({coord:l[1]})}}function Cu(t,e){var n=t.mapDimension("defaultedLabel",!0),i=n.length;if(1===i)return ya(t,e,n[0]);if(i){for(var r=[],o=0;o<n.length;o++){var a=ya(t,e,n[o]);r.push(a)}return r.join(" ")}}function Tu(t,e,n){Xw.call(this),this.updateData(t,e,n)}function Au(t){return[t[0]/2,t[1]/2]}function Du(t,e){this.parent.drift(t,e)}function Mu(t){this.group=new Xw,this._symbolCtor=t||Tu}function Iu(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function ku(t){return null==t||b(t)||(t={isIgnore:t}),t||{}}function Eu(t){var e=t.hostModel;return{itemStyle:e.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:e.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),labelModel:e.getModel("label"),hoverLabelModel:e.getModel("emphasis.label"),cursorStyle:e.get("cursor")}}function Lu(t,e,n){var i,r=t.getBaseAxis(),o=t.getOtherAxis(r),a=Ou(o,n),s=r.dim,l=o.dim,u=e.mapDimension(l),c=e.mapDimension(s),h="x"===l||"radius"===l?1:0,d=A(t.dimensions,function(t){return e.mapDimension(t)}),f=e.getCalculationInfo("stackResultDimension");return(i|=ml(e,d[0]))&&(d[0]=f),(i|=ml(e,d[1]))&&(d[1]=f),{dataDimsForPoint:d,valueStart:a,valueAxisDim:l,baseAxisDim:s,stacked:!!i,valueDim:u,baseDim:c,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Ou(t,e){var n=0,i=t.scale.getExtent();return"start"===e?n=i[0]:"end"===e?n=i[1]:0<i[0]?n=i[0]:i[1]<0&&(n=i[1]),n}function Pu(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}function Nu(t,e){var n=[];return e.diff(t).add(function(t){n.push({cmd:"+",idx:t})}).update(function(t,e){n.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){n.push({cmd:"-",idx:t})}).execute(),n}function Ru(t){return isNaN(t[0])||isNaN(t[1])}function Fu(t,e,n,i,r,o,a,s,l,u){return"none"!==u&&u?zu.apply(this,arguments):Hu.apply(this,arguments)}function zu(t,e,n,i,r,o,a,s,l,u,c){for(var h=0,d=n,f=0;f<i;f++){var p=e[d];if(r<=d||d<0)break;if(Ru(p)){if(c){d+=o;continue}break}if(d===n)t[0<o?"moveTo":"lineTo"](p[0],p[1]);else if(0<l){var g=e[h],m="y"===u?1:0,v=(p[m]-g[m])*l;yM(bM,g),bM[m]=g[m]+v,yM(wM,p),wM[m]=p[m]-v,t.bezierCurveTo(bM[0],bM[1],wM[0],wM[1],p[0],p[1])}else t.lineTo(p[0],p[1]);h=d,d+=o}return f}function Hu(t,e,n,i,r,o,a,s,l,u,c){for(var h=0,d=n,f=0;f<i;f++){var p=e[d];if(r<=d||d<0)break;if(Ru(p)){if(c){d+=o;continue}break}if(d===n)t[0<o?"moveTo":"lineTo"](p[0],p[1]),yM(bM,p);else if(0<l){var g=d+o,m=e[g];if(c)for(;m&&Ru(e[g]);)m=e[g+=o];var v=.5,y=e[h];if(!(m=e[g])||Ru(m))yM(wM,p);else{var x,b;if(Ru(m)&&!c&&(m=p),G(xM,m,y),"x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),b=Math.abs(p[w]-m[w])}else x=sw(p,y),b=sw(p,m);vM(wM,p,xM,-l*(1-(v=b/(b+x))))}gM(bM,bM,s),mM(bM,bM,a),gM(wM,wM,s),mM(wM,wM,a),t.bezierCurveTo(bM[0],bM[1],wM[0],wM[1],p[0],p[1]),vM(bM,p,xM,l*v)}else t.lineTo(p[0],p[1]);h=d,d+=o}return f}function Bu(t,e){var n=[Infinity,Infinity],i=[-Infinity,-Infinity];if(e)for(var r=0;r<t.length;r++){var o=t[r];o[0]<n[0]&&(n[0]=o[0]),o[1]<n[1]&&(n[1]=o[1]),o[0]>i[0]&&(i[0]=o[0]),o[1]>i[1]&&(i[1]=o[1])}return{min:e?n:i,max:e?i:n}}function Vu(t,e){if(t.length===e.length){for(var n=0;n<t.length;n++){var i=t[n],r=e[n];if(i[0]!==r[0]||i[1]!==r[1])return}return!0}}function ju(t){return"number"==typeof t?t:t?.5:0}function Wu(t){var e=t.getGlobalExtent();if(t.onBand){var n=t.getBandWidth()/2-1,i=e[1]>e[0]?1:-1;e[0]+=i*n,e[1]-=i*n}return e}function Uu(t,e,n){if(!n.valueDim)return[];for(var i=[],r=0,o=e.count();r<o;r++)i.push(Pu(n,t,e,r));return i}function $u(t,e,n,i){var r=Wu(t.getAxis("x")),o=Wu(t.getAxis("y")),a=t.getBaseAxis().isHorizontal(),s=Math.min(r[0],r[1]),l=Math.min(o[0],o[1]),u=Math.max(r[0],r[1])-s,c=Math.max(o[0],o[1])-l;if(n)s-=.5,u+=.5,l-=.5,c+=.5;else{var h=i.get("lineStyle.width")||2,d=i.get("clipOverflow")?h/2:Math.max(u,c);a?(l-=d,c+=2*d):(s-=d,u+=2*d)}var f=new yC({shape:{x:s,y:l,width:u,height:c}});return e&&(f.shape[a?"width":"height"]=0,Tr(f,{shape:{width:u,height:c}},i)),f}function qu(t,e,n,i){var r=t.getAngleAxis(),o=t.getRadiusAxis().getExtent().slice();o[0]>o[1]&&o.reverse();var a=r.getExtent(),s=Math.PI/180;n&&(o[0]-=.5,o[1]+=.5);var l=new dC({shape:{cx:jr(t.cx,1),cy:jr(t.cy,1),r0:jr(o[0],1),r:jr(o[1],1),startAngle:-a[0]*s,endAngle:-a[1]*s,clockwise:r.inverse}});return e&&(l.shape.endAngle=-a[0]*s,Tr(l,{shape:{endAngle:-a[1]*s}},i)),l}function Gu(t,e,n,i){return"polar"===t.type?qu(t,e,n,i):$u(t,e,n,i)}function Yu(t,e,n){for(var i=e.getBaseAxis(),r="x"===i.dim||"radius"===i.dim?0:1,o=[],a=0;a<t.length-1;a++){var s=t[a+1],l=t[a];o.push(l);var u=[];switch(n){case"end":u[r]=s[r],u[1-r]=l[1-r],o.push(u);break;case"middle":var c=(l[r]+s[r])/2,h=[];u[r]=h[r]=c,u[1-r]=l[1-r],h[1-r]=s[1-r],o.push(u),o.push(h);break;default:u[r]=l[r],u[1-r]=s[1-r],o.push(u)}}return t[a]&&o.push(t[a]),o}function Zu(t,e){var n=t.getVisual("visualMeta");if(n&&n.length&&t.count())if("cartesian2d"===e.type){for(var i,r,o=n.length-1;0<=o;o--){var a=n[o].dimension,s=t.dimensions[a],l=t.getDimensionInfo(s);if("x"===(i=l&&l.coordDim)||"y"===i){r=n[o];break}}if(r){var u=e.getAxis(i),c=A(r.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),h=c.length,d=r.outerColors.slice();h&&c[0].coord>c[h-1].coord&&(c.reverse(),d.reverse());var f=10,p=c[0].coord-f,g=c[h-1].coord+f,m=g-p;if(m<.001)return"transparent";k(c,function(t){t.offset=(t.coord-p)/m}),c.push({offset:h?c[h-1].offset:.5,color:d[1]||"transparent"}),c.unshift({offset:h?c[0].offset:.5,color:d[0]||"transparent"});var v=new TC(0,0,0,0,c,!0);return v[i]=p,v[i+"2"]=g,v}Vb&&console.warn("Visual map on line style only support x or y dimension.")}else Vb&&console.warn("Visual map on line style is only supported on cartesian2d.")}function Xu(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!Ku(o,e))){var a=e.mapDimension(o.dim),s={};return k(o.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function Ku(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;a<r;a+=o)if(1.5*Tu.getSymbolSize(e,a)[t.isHorizontal()?1:0]>i)return!1;return!0}function Qu(t){return this._axes[t]}function Ju(t){IM.call(this,t)}function tc(t,e){return e.type||(e.data?"category":"value")}function ec(t,e){return t.getCoordSysModel()===e}function nc(t,e,n){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,n),this.model=t}function ic(t,e,n){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,r=t[e],o=n.model,a=o.get("axisLine.onZero"),s=o.get("axisLine.onZeroAxisIndex");if(a)if(null==s){for(var l in r)if(r.hasOwnProperty(l)&&rc(r[l])){i=r[l];break}}else rc(r[s])&&(i=r[s])}function rc(t){return t&&"category"!==t.type&&"time"!==t.type&&ql(t)}function oc(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}function ac(n){return A(zM,function(t){var e=n.getReferringComponents(t)[0];if(Vb&&!e)throw new Error(t+' "'+N(n.get(t+"Index"),n.get(t+"Id"),0)+'" not found');return e})}function sc(t){return"cartesian2d"===t.get("coordinateSystem")}function lc(t){var e={componentType:t.mainType};return e[t.mainType+"Index"]=t.componentIndex,e}function uc(t,e,n,i){var r,o,a=Yr(n-t.rotation),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return Zr(a-HM/2)?(o=l?"bottom":"top",r="center"):Zr(a-1.5*HM)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*HM&&HM/2<a?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:r,textVerticalAlign:o}}function cc(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function hc(t,e,n){var i=t.get("axisLabel.showMinLabel"),r=t.get("axisLabel.showMaxLabel");n=n||[];var o=(e=e||[])[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===i?(dc(o),dc(u)):fc(o,a)&&(i?(dc(a),dc(c)):(dc(o),dc(u))),!1===r?(dc(s),dc(h)):fc(l,s)&&(r?(dc(l),dc(d)):(dc(s),dc(h)))}function dc(t){t&&(t.ignore=!0)}function fc(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=pt([]);return yt(r,r,-t.rotation),n.applyTransform(mt([],r,t.getLocalTransform())),i.applyTransform(mt([],r,e.getLocalTransform())),n.intersect(i)}}function pc(t){return"middle"===t||"center"===t}function gc(t,e,n){var i=e.axis;if(e.get("axisTick.show")&&!i.scale.isBlank()){for(var r=e.getModel("axisTick"),o=r.getModel("lineStyle"),a=r.get("length"),s=i.getTicksCoords(),l=[],u=[],c=t._transform,h=[],d=0;d<s.length;d++){var f=s[d].coord;l[0]=f,u[l[1]=0]=f,u[1]=n.tickDirection*a,c&&(ot(l,l,c),ot(u,u,c));var p=new xC(Ki({anid:"tick_"+s[d].tickValue,shape:{x1:l[0],y1:l[1],x2:u[0],y2:u[1]},style:D(o.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}),z2:2,silent:!0}));t.group.add(p),h.push(p)}return h}}function mc(u,c,h){var d=c.axis;if(N(h.axisLabelShow,c.get("axisLabel.show"))&&!d.scale.isBlank()){var f=c.getModel("axisLabel"),p=f.get("margin"),t=d.getViewLabels(),e=(N(h.labelRotate,f.get("rotate"))||0)*HM/180,g=jM(h.rotation,e,h.labelDirection),m=c.getCategories(!0),v=[],y=cc(c),x=c.get("triggerEvent");return k(t,function(t,e){var n=t.tickValue,i=t.formattedLabel,r=t.rawLabel,o=f;m&&m[n]&&m[n].textStyle&&(o=new Or(m[n].textStyle,f,c.ecModel));var a=o.getTextColor()||c.get("axisLine.lineStyle.color"),s=[d.dataToCoord(n),h.labelOffset+h.labelDirection*p],l=new lC({anid:"label_"+n,position:s,rotation:g.rotation,silent:y,z2:10});pr(l.style,o,{text:i,textAlign:o.getShallow("align",!0)||g.textAlign,textVerticalAlign:o.getShallow("verticalAlign",!0)||o.getShallow("baseline",!0)||g.textVerticalAlign,textFill:"function"==typeof a?a("category"===d.type?r:"value"===d.type?n+"":n,e):a}),x&&(l.eventData=lc(c),l.eventData.targetType="axisLabel",l.eventData.value=r),u._dumbGroup.add(l),l.updateTransform(),v.push(l),u.group.add(l),l.decomposeTransform()}),v}}function vc(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return yc(n,t,e),n.seriesInvolved&&bc(n,t),n}function yc(p,g,t){var o=g.getComponent("tooltip"),m=g.getComponent("axisPointer"),v=m.get("link",!0)||[],y=[];WM(t.getCoordinateSystems(),function(h){function t(t,e,n){var i=n.model.getModel("axisPointer",m),r=i.get("show");if(r&&("auto"!==r||t||Ac(i))){null==e&&(e=i.get("triggerTooltip"));var o=(i=t?xc(n,f,m,g,t,e):i).get("snap"),a=Dc(n.model),s=e||o||"category"===n.type,l=p.axesInfo[a]={key:a,axis:n,coordSys:h,axisPointerModel:i,triggerTooltip:e,involveSeries:s,snap:o,useHandle:Ac(i),seriesModels:[]};d[a]=l,p.seriesInvolved|=s;var u=wc(v,n);if(null!=u){var c=y[u]||(y[u]={axesInfo:{}});c.axesInfo[a]=l,c.mapper=v[u].mapper,l.linkGroup=c}}}if(h.axisPointerEnabled){var e=Dc(h.model),d=p.coordSysAxesInfo[e]={},f=(p.coordSysMap[e]=h).model.getModel("tooltip",o);if(WM(h.getAxes(),UM(t,!1,null)),h.getTooltipAxes&&o&&f.get("show")){var n="axis"===f.get("trigger"),i="cross"===f.get("axisPointer.type"),r=h.getTooltipAxes(f.get("axisPointer.axis"));(n||i)&&WM(r.baseAxes,UM(t,!i||"cross",n)),i&&WM(r.otherAxes,UM(t,"cross",!1))}}})}function xc(t,e,n,i,r,o){var a=e.getModel("axisPointer"),s={};WM(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){s[t]=L(a.get(t))}),s.snap="category"!==t.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=a.get("label.show");if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&D(l,c.textStyle)}}return t.model.getModel("axisPointer",new Or(s,n,i))}function bc(r,t){t.eachSeries(function(n){var i=n.coordinateSystem,t=n.get("tooltip.trigger",!0),e=n.get("tooltip.show",!0);i&&"none"!==t&&!1!==t&&"item"!==t&&!1!==e&&!1!==n.get("axisPointer.show",!0)&&WM(r.coordSysAxesInfo[Dc(i.model)],function(t){var e=t.axis;i.getAxis(e.dim)===e&&(t.seriesModels.push(n),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=n.getData().count())})},this)}function wc(t,e){for(var n=e.model,i=e.dim,r=0;r<t.length;r++){var o=t[r]||{};if(_c(o[i+"AxisId"],n.id)||_c(o[i+"AxisIndex"],n.componentIndex)||_c(o[i+"AxisName"],n.name))return r}}function _c(t,e){return"all"===t||E(t)&&0<=x(t,e)||t===e}function Sc(t){var e=Cc(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=Ac(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),r.value=a,s&&(r.status=e.axis.scale.isBlank()?"hide":"show")}}function Cc(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Dc(t)]}function Tc(t){var e=Cc(t);return e&&e.axisPointerModel}function Ac(t){return!!t.get("handle.show")}function Dc(t){return t.type+"||"+t.id}function Mc(t,e,n,i,r,o){var a=$M.getAxisPointerClass(t.axisPointerClass);if(a){var s=Tc(e);s?(t._axisPointer||(t._axisPointer=new a)).render(e,s,i,o):Ic(t,i)}}function Ic(t,e,n){var i=t._axisPointer;i&&i.dispose(e,n),t._axisPointer=null}function kc(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,c=i.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=e.get("offset")||0,p="x"===u?[h[2]-f,h[3]+f]:[h[0]-f,h[1]+f];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}o.position=["y"===u?p[d[l]]:h[0],"x"===u?p[d[l]]:h[3]],o.rotation=Math.PI/2*("x"===u?0:1);var m={top:-1,bottom:1,left:-1,right:1};o.labelDirection=o.tickDirection=o.nameDirection=m[s],o.labelOffset=a?p[d[s]]-p[d.onZero]:0,e.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),N(n.labelInside,e.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var v=e.get("axisLabel.rotate");return o.labelRotate="top"===l?-v:v,o.z2=1,o}function Ec(t,e,n,i,r,o){fr(t,e,n.getModel("label"),n.getModel("emphasis.label"),{labelFetcher:r,labelDataIndex:o,defaultText:Cu(r.getData(),o),isRectText:!0,autoColor:i}),Lc(t),Lc(e)}function Lc(t,e){"outside"===t.textPosition&&(t.textPosition=e)}function Oc(t,e,n){n.style.text=null,Cr(n,{shape:{width:0}},e,t,function(){n.parent&&n.parent.remove(n)})}function Pc(t,e,n){n.style.text=null,Cr(n,{shape:{r:n.shape.r0}},e,t,function(){n.parent&&n.parent.remove(n)})}function Nc(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"color"),u=e.getItemVisual(n,"opacity"),c=i.getModel("itemStyle"),h=i.getModel("emphasis.itemStyle").getBarItemStyle();s||t.setShape("r",c.get("barBorderRadius")||0),t.useStyle(D({fill:l,opacity:u},c.getBarItemStyle()));var d=i.getShallow("cursor");d&&t.attr("cursor",d);var f=a?0<r.height?"bottom":"top":0<r.width?"left":"right";s||Ec(t.style,h,i,l,o,n,f),dr(t,h)}function Rc(t,e){var n=t.get(JM)||0;return Math.min(n,Math.abs(e.width),Math.abs(e.height))}function Fc(t,e,n){var i=t.getData(),r=[],o=i.getLayout("valueAxisHorizontal")?1:0;r[1-o]=i.getLayout("valueAxisStart");var a=new nI({shape:{points:i.getLayout("largePoints")},incremental:!!n,__startPoint:r,__valueIdx:o});e.add(a),zc(a,t,i)}function zc(t,e,n){var i=n.getVisual("borderColor")||n.getVisual("color"),r=e.getModel("itemStyle").getItemStyle(["color","borderColor"]);t.useStyle(r),t.style.fill=null,t.style.stroke=i,t.style.lineWidth=n.getLayout("barWidth")}function Hc(t,e,n,i){var r=e.getData(),o=this.dataIndex,a=r.getName(o),s=e.get("selectedOffset");i.dispatchAction({type:"pieToggleSelect",from:t,name:a,seriesId:e.id}),r.each(function(t){Bc(r.getItemGraphicEl(t),r.getItemLayout(t),e.isSelected(r.getName(t)),s,n)})}function Bc(t,e,n,i,r){var o=(e.startAngle+e.endAngle)/2,a=n?i:0,s=[Math.cos(o)*a,Math.sin(o)*a];r?t.animate().when(200,{position:s}).start("bounceOut"):t.attr("position",s)}function Vc(t,e){function n(){o.ignore=o.hoverIgnore,a.ignore=a.hoverIgnore}function i(){o.ignore=o.normalIgnore,a.ignore=a.normalIgnore}Xw.call(this);var r=new dC({z2:2}),o=new vC,a=new lC;this.add(r),this.add(o),this.add(a),this.updateData(t,e,!0),this.on("emphasis",n).on("normal",i).on("mouseover",n).on("mouseout",i)}function jc(r,t,e,n,i,o,a){function s(t,e,n){for(var i=t;i<e;i++)if(r[i].y+=n,t<i&&i+1<e&&r[i+1].y>r[i].y+r[i].height)return void l(i,n/2);l(e-1,n/2)}function l(t,e){for(var n=t;0<=n&&(r[n].y-=e,!(0<n&&r[n].y>r[n-1].y+r[n-1].height));n--);}function u(t,e,n,i,r,o){for(var a=e?Number.MAX_VALUE:0,s=0,l=t.length;s<l;s++)if("center"!==t[s].position){var u=Math.abs(t[s].y-i),c=t[s].len,h=t[s].len2,d=u<r+c?Math.sqrt((r+c+h)*(r+c+h)-u*u):Math.abs(t[s].x-n);e&&a<=d&&(d=a-10),!e&&d<=a&&(d=a+10),t[s].x=n+d*o,a=d}}r.sort(function(t,e){return t.y-e.y});for(var c,h=0,d=r.length,f=[],p=[],g=0;g<d;g++)(c=r[g].y-h)<0&&s(g,d,-c,i),h=r[g].y+r[g].height;a-h<0&&l(d-1,h-a);for(g=0;g<d;g++)r[g].y>=e?p.push(r[g]):f.push(r[g]);u(f,!1,t,e,n,i),u(p,!0,t,e,n,i)}function Wc(t,e,n,i,r,o){for(var a=[],s=[],l=0;l<t.length;l++)t[l].x<e?a.push(t[l]):s.push(t[l]);jc(s,e,n,i,1,r,o),jc(a,e,n,i,-1,r,o);for(l=0;l<t.length;l++){var u=t[l].linePoints;if(u){var c=u[1][0]-u[2][0];t[l].x<e?u[2][0]=t[l].x+3:u[2][0]=t[l].x-3,u[1][1]=u[2][1]=t[l].y,u[1][0]=u[2][0]+c}}}function Uc(){this.group=new Xw}function $c(t,e,n){rM.call(this,t,e,n),this.type="value",this.angle=0,this.name="",this.model}function qc(t,e,n){this._model=t,this.dimensions=[],this._indicatorAxes=A(t.getIndicatorModels(),function(t,e){var n="indicator_"+e,i=new $c(n,new bD);return i.name=t.get("name"),(i.model=t).axis=i,this.dimensions.push(n),i},this),this.resize(t,n),this.cx,this.cy,this.r,this.startAngle}function Gc(t,e){return D({show:e},t)}function Yc(t){return E(t)||(t=[+t,+t]),t}function Zc(){xw.call(this)}function Xc(t){this.name=t,this.zoomLimit,xw.call(this),this._roamTransformable=new Zc,this._rawTransformable=new Zc,this._center,this._zoom}function Kc(t,e,n,i){var r=n.seriesModel,o=r?r.coordinateSystem:null;return o===this?o[t](i):null}function Qc(t,e,n,i,r){Xc.call(this,t),this.map=e,this._nameCoordMap=z(),this.loadGeoJson(n,i,r)}function Jc(t,e,n,i){var r=n.geoModel,o=n.seriesModel,a=r?r.coordinateSystem:o?o.coordinateSystem||(o.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return a===this?a[t](i):null}function th(t,e){var n=t.get("boundingCoords");if(null!=n){var i=n[0],r=n[1];isNaN(i[0])||isNaN(i[1])||isNaN(r[0])||isNaN(r[1])?Vb&&console.error("Invalid boundingCoords"):this.setBoundingRect(i[0],i[1],r[0]-i[0],r[1]-i[1])}var o,a=this.getBoundingRect(),s=t.get("layoutCenter"),l=t.get("layoutSize"),u=e.getWidth(),c=e.getHeight(),h=t.get("aspectScale")||.75,d=a.width/a.height*h,f=!1;if(s&&l&&(s=[Vr(s[0],u),Vr(s[1],c)],l=Vr(l,Math.min(u,c)),isNaN(s[0])||isNaN(s[1])||isNaN(l)?Vb&&console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):f=!0),f){var p={};1<d?(p.width=l,p.height=l/d):(p.height=l,p.width=l*d),p.y=s[1]-p.height/2,p.x=s[0]-p.width/2}else(o=t.getBoxLayoutParams()).aspect=d,p=po(o,{width:u,height:c});this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function eh(n,t){k(t.get("geoCoord"),function(t,e){n.addGeoCoord(e,t)})}function nh(t,e,n){oh(t)[e]=n}function ih(t,e,n){var i=oh(t);i[e]===n&&(i[e]=null)}function rh(t,e){return!!oh(t)[e]}function oh(t){return t[PI]||(t[PI]={})}function ah(n){this.pointerChecker,this._zr=n,this._opt={};var t=v,i=t(sh,this),r=t(lh,this),o=t(uh,this),a=t(ch,this),s=t(hh,this);hw.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(t,e){this.disable(),this._opt=D(L(e)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(n.on("mousedown",i),n.on("mousemove",r),n.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(n.on("mousewheel",a),n.on("pinch",s))},this.disable=function(){n.off("mousedown",i),n.off("mousemove",r),n.off("mouseup",o),n.off("mousewheel",a),n.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function sh(t){if(!(xn(t)||t.target&&t.target.draggable)){var e=t.offsetX,n=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,n)&&(this._x=e,this._y=n,this._dragging=!0)}}function lh(t){if(!xn(t)&&fh(this,"moveOnMouseMove",t)&&this._dragging&&"pinch"!==t.gestureEvent&&!rh(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,r=this._y,o=e-i,a=n-r;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&k_(t.event),this.trigger("pan",o,a,i,r,e,n)}}function uh(t){xn(t)||(this._dragging=!1)}function ch(t){if(fh(this,"zoomOnMouseWheel",t)&&0!==t.wheelDelta){var e=0<t.wheelDelta?1.1:1/1.1;dh.call(this,t,e,t.offsetX,t.offsetY)}}function hh(t){if(!rh(this._zr,"globalPan")){var e=1<t.pinchScale?1.1:1/1.1;dh.call(this,t,e,t.pinchX,t.pinchY)}}function dh(t,e,n,i){this.pointerChecker&&this.pointerChecker(t,n,i)&&(k_(t.event),this.trigger("zoom",e,n,i))}function fh(t,e,n){var i=t._opt[e];return i&&(!w(i)||n.event[i+"Key"])}function ph(t,e,n){var i=t.target,r=i.position;r[0]+=e,r[1]+=n,i.dirty()}function gh(t,e,n,i){var r=t.target,o=t.zoomLimit,a=r.position,s=r.scale,l=t.zoom=t.zoom||1;if(l*=e,o){var u=o.min||0,c=o.max||Infinity;l=Math.max(Math.min(c,l),u)}var h=l/t.zoom;t.zoom=l,a[0]-=(n-a[0])*(h-1),a[1]-=(i-a[1])*(h-1),s[0]*=h,s[1]*=h,r.dirty()}function mh(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!NI[i.mainType]&&r&&r.model!==n}function vh(t){var e=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(e.fill=n),e}function yh(i,r,o,a,s){o.off("click"),o.off("mousedown"),r.get("selectedMode")&&(o.on("mousedown",function(){i._mouseDownFlag=!0}),o.on("click",function(t){if(i._mouseDownFlag){i._mouseDownFlag=!1;for(var e=t.target;!e.__regions;)e=e.parent;if(e){var n={type:("geo"===r.mainType?"geo":"map")+"ToggleSelect",batch:A(e.__regions,function(t){return{name:t.name,from:s.uid}})};n[r.mainType+"Id"]=r.id,a.dispatchAction(n),xh(r,o)}}}))}function xh(n,t){t.eachChild(function(e){k(e.__regions,function(t){e.trigger(n.isSelected(t.name)?"emphasis":"normal")})})}function bh(t,e){var n=new Xw;this._controller=new ah(t.getZr()),this._controllerHost={target:e?n:null},this.group=n,this._updateGroup=e,this._mouseDownFlag}function wh(t,e,n){var i=t.getZoom(),r=t.getCenter(),o=e.zoom,a=t.dataToPoint(r);if(null!=e.dx&&null!=e.dy){a[0]-=e.dx,a[1]-=e.dy;r=t.pointToData(a);t.setCenter(r)}if(null!=o){if(n){var s=n.min||0,l=n.max||Infinity;o=Math.max(Math.min(i*o,l),s)/i}t.scale[0]*=o,t.scale[1]*=o;var u=t.position,c=(e.originX-u[0])*(o-1),h=(e.originY-u[1])*(o-1);u[0]-=c,u[1]-=h,t.updateTransform();r=t.pointToData(a);t.setCenter(r),t.setZoom(o*i)}return{center:t.getCenter(),zoom:t.getZoom()}}function _h(u,c){var h={};return k(u,function(i){i.each(i.mapDimension("value"),function(t,e){var n="ec-"+i.getName(e);h[n]=h[n]||[],isNaN(t)||h[n].push(t)})}),u[0].map(u[0].mapDimension("value"),function(t,e){for(var n,i="ec-"+u[0].getName(e),r=0,o=Infinity,a=-Infinity,s=h[i].length,l=0;l<s;l++)o=Math.min(o,h[i][l]),a=Math.max(a,h[i][l]),r+=h[i][l];return n="min"===c?o:"max"===c?a:"average"===c?r/s:r,0===s?NaN:n})}function Sh(n){var i=n.mainData,t=n.datas;t||(t={main:i},n.datasAttr={main:"data"}),n.datas=n.mainData=null,Ih(i,t,n),HI(t,function(e){HI(i.TRANSFERABLE_METHODS,function(t){e.wrapMethod(t,y(Ch,n))})}),i.wrapMethod("cloneShallow",y(Ah,n)),HI(i.CHANGABLE_METHODS,function(t){i.wrapMethod(t,y(Th,n))}),T(t[i.dataType]===i)}function Ch(t,e){if(Mh(this)){var n=O({},this[BI]);Ih(n[this.dataType]=e,n,t)}else kh(e,this.dataType,this[VI],t);return e}function Th(t,e){return t.struct&&t.struct.update(this),e}function Ah(n,i){return HI(i[BI],function(t,e){t!==i&&kh(t.cloneShallow(),e,i,n)}),i}function Dh(t){var e=this[VI];return null==t||null==e?e:e[BI][t]}function Mh(t){return t[VI]===t}function Ih(n,t,i){n[BI]={},HI(t,function(t,e){kh(t,e,n,i)})}function kh(t,e,n,i){(n[BI][e]=t)[VI]=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=Dh}function Eh(e,t,n){this.root,this.data,this._nodes=[],this.hostModel=e,this.levelModels=A(t||[],function(t){return new Or(t,e,e.ecModel)}),this.leavesModel=new Or(n||{},e,e.ecModel)}function Lh(t,e){var n=e.children;t.parentNode!==e&&(n.push(t),t.parentNode=e)}function Oh(t){t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e,n,i=[t];e=i.pop();)if(n=e.children,e.isExpand&&n.length)for(var r=n.length-1;0<=r;r--){var o=n[r];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},i.push(o)}}function Ph(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,r=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){Hh(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=Bh(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function Nh(t){
|
|
var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Rh(t){return arguments.length?t:$h}function Fh(t,e){var n={};return t-=Math.PI/2,n.x=e*Math.cos(t),n.y=e*Math.sin(t),n}function zh(t,e){return po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Hh(t){for(var e=t.children,n=e.length,i=0,r=0;0<=--n;){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}function Bh(t,e,n,i){if(e){for(var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,u=o.hierNode.modifier,c=a.hierNode.modifier,h=s.hierNode.modifier;s=Vh(s),o=jh(o),s&&o;){r=Vh(r),a=jh(a),r.hierNode.ancestor=t;var d=s.hierNode.prelim+h-o.hierNode.prelim-u+i(s,o);0<d&&(Uh(Wh(s,t,n),t,d),u+=d,l+=d),h+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=r.hierNode.modifier,c+=a.hierNode.modifier}s&&!Vh(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=h-l),o&&!jh(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-c,n=t)}return n}function Vh(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function jh(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function Wh(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function Uh(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function $h(t,e){return t.parentNode===e.parentNode?1:2}function qh(t,e){var n=t.getItemLayout(e);return n&&!isNaN(n.x)&&!isNaN(n.y)&&"none"!==t.getItemVisual(e,"symbol")}function Gh(t,e,n){return n.itemModel=e,n.itemStyle=e.getModel("itemStyle").getItemStyle(),n.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),n.lineStyle=e.getModel("lineStyle").getLineStyle(),n.labelModel=e.getModel("label"),n.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?n.symbolInnerColor=n.itemStyle.fill:n.symbolInnerColor="#fff",n}function Yh(t,e,n,i,r,o){var a=!n,s=t.tree.getNodeByDataIndex(e),l=(o=Gh(s,s.getModel(),o),t.tree.root),u=s.parentNode===l?s:s.parentNode||s,c=t.getItemGraphicEl(u.dataIndex),h=u.getLayout(),d=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:h,f=s.getLayout();a?(n=new Tu(t,e,o)).attr("position",[d.x,d.y]):n.updateData(t,e,o),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=f.rawX,n.__radialRawY=f.rawY,i.add(n),t.setItemGraphicEl(e,n),Cr(n,{position:[f.x,f.y]},r);var p=n.getSymbolPath();if("radial"===o.layout){var g,m,v=l.children[0],y=v.getLayout(),x=v.children.length;if(f.x===y.x&&!0===s.isExpand){var b={};b.x=(v.children[0].getLayout().x+v.children[x-1].getLayout().x)/2,b.y=(v.children[0].getLayout().y+v.children[x-1].getLayout().y)/2,(g=Math.atan2(b.y-y.y,b.x-y.x))<0&&(g=2*Math.PI+g),(m=b.x<y.x)&&(g-=Math.PI)}else(g=Math.atan2(f.y-y.y,f.x-y.x))<0&&(g=2*Math.PI+g),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(m=f.x<y.x)&&(g-=Math.PI):(m=f.x>y.x)||(g-=Math.PI);var w=m?"left":"right";p.setStyle({textPosition:w,textRotation:-g,textOrigin:"center",verticalAlign:"middle"})}if(s.parentNode&&s.parentNode!==l){var _=n.__edge;_||(_=n.__edge=new wC({shape:Xh(o,d,d),style:D({opacity:0},o.lineStyle)})),Cr(_,{shape:Xh(o,h,f),style:{opacity:1}},r),i.add(_)}}function Zh(t,e,n,i,r,o){for(var a,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,u=(o=Gh(s,s.getModel(),o),s.parentNode===l?s:s.parentNode||s);null==(a=u.getLayout());)u=u.parentNode===l?u:u.parentNode||u;Cr(n,{position:[a.x+1,a.y+1]},r,function(){i.remove(n),t.setItemGraphicEl(e,null)}),n.fadeOut(null,{keepLabel:!0});var c=n.__edge;c&&Cr(c,{shape:Xh(o,a,a),style:{opacity:0}},r,function(){i.remove(c)})}function Xh(t,e,n){var i,r,o,a,s=t.orient;if("radial"===t.layout){var l=e.rawX,u=e.rawY,c=n.rawX,h=n.rawY,d=Fh(l,u),f=Fh(l,u+(h-u)*t.curvature),p=Fh(c,h+(u-h)*t.curvature),g=Fh(c,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}l=e.x,u=e.y,c=n.x,h=n.y;return"LR"!==s&&"RL"!==s||(i=l+(c-l)*t.curvature,r=u,o=c+(l-c)*t.curvature,a=h),"TB"!==s&&"BT"!==s||(i=l,r=u+(h-u)*t.curvature,o=c,a=h+(u-h)*t.curvature),{x1:l,y1:u,x2:c,y2:h,cpx1:i,cpy1:r,cpx2:o,cpy2:a}}function Kh(t,e,n){for(var i,r=[t],o=[];i=r.pop();)if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s<a.length;s++)r.push(a[s])}for(;i=o.pop();)e(i,n)}function Qh(t,e){for(var n,i=[t];n=i.pop();)if(e(n),n.isExpand){var r=n.children;if(r.length)for(var o=r.length-1;0<=o;o--)i.push(r[o])}}function Jh(t,e){var n=zh(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=Rh(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(r=n.width,o=n.height,a=Rh());var s=t.getData().tree.root,l=s.children[0];if(l){Oh(s),Kh(l,Ph,a),s.hierNode.modifier=-l.hierNode.prelim,Qh(l,Nh);var u=l,c=l,h=l;Qh(l,function(t){var e=t.getLayout().x;e<u.getLayout().x&&(u=t),e>c.getLayout().x&&(c=t),t.depth>h.depth&&(h=t)});var d=u===c?1:a(u,c)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===i)p=r/(c.getLayout().x+d+f),g=o/(h.depth-1||1),Qh(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Fh(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)});else{var y=t.getOrient();"RL"===y||"LR"===y?(g=o/(c.getLayout().x+d+f),p=r/(h.depth-1||1),Qh(l,function(t){v=(t.getLayout().x+f)*g,m="LR"===y?(t.depth-1)*p:r-(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):"TB"!==y&&"BT"!==y||(p=r/(c.getLayout().x+d+f),g=o/(h.depth-1||1),Qh(l,function(t){m=(t.getLayout().x+f)*p,v="TB"===y?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))}}}function td(t,e,n){if(t&&0<=x(e,t.type)){var i=n.getData().tree.root,r=t.targetNode;if(r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function ed(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function nd(t,e){return 0<=x(ed(t),e)}function id(t,e){for(var n=[];t;){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}function rd(t){var n=0;k(t.children,function(t){rd(t);var e=t.value;E(e)&&(e=e[0]),n+=e});var e=t.value;E(e)&&(e=e[0]),(null==e||isNaN(e))&&(e=n),e<0&&(e=0),E(t.value)?t.value[0]=e:t.value=e}function od(t,e){var n=e.get("color");if(n){var i;if(k(t=t||[],function(t){var e=new Or(t),n=e.get("color");(e.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)}),!i)(t[0]||(t[0]={})).color=n.slice();return t}}function ad(t){this.group=new Xw,t.add(this.group)}function sd(t,e,n,i,r,o){var a=[[r?t:t-qI,e],[t+n,e],[t+n,e+i],[r?t:t-qI,e+i]];return!o&&a.splice(2,0,[t+n+qI,e+i/2]),!r&&a.push([t,e+i/2]),a}function ld(t,e,n){t.eventData={componentType:"series",componentSubType:"treemap",seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&id(n,e)}}function ud(){var o,a=[],s={};return{add:function(t,e,n,i,r){return w(i)&&(r=i,i=0),!s[t.id]&&(s[t.id]=1,a.push({el:t,target:e,time:n,delay:i,easing:r}),!0)},done:function(t){return o=t,this},start:function(){function t(){--e||(a.length=0,s={},o&&o())}for(var e=a.length,n=0,i=a.length;n<i;n++){var r=a[n];r.el.animateTo(r.target,r.time,r.delay,r.easing,t)}return this}}}function cd(){return{nodeGroup:[],background:[],content:[]}}function hd(d,a,s,l,u,n,f,t,e,i){function r(t,i,r){i.dataIndex=f.dataIndex,i.seriesIndex=d.seriesIndex,i.setShape({x:0,y:0,width:y,height:x});var o=f.getVisual("borderColor",!0),a=M.get("borderColor");c(i,function(){var t=ak(D);t.fill=o;var e=ok(M);if(e.fill=a,r){var n=y-2*b;h(t,e,o,n,T,{x:b,y:0,width:n,height:T})}else t.text=e.text=null;i.setStyle(t),dr(i,e)}),t.add(i)}function o(t,n){n.dataIndex=f.dataIndex,n.seriesIndex=d.seriesIndex;var i=Math.max(y-2*b,0),r=Math.max(x-2*b,0);n.culling=!0,n.setShape({x:b,y:b,width:i,height:r});var o=f.getVisual("color",!0);c(n,function(){var t=ak(D);t.fill=o;var e=ok(M);h(t,e,o,i,r),n.setStyle(t),dr(n,e)}),t.add(n)}function c(t,e){w?!t.invisible&&n.push(t):(e(),t.__tmWillVisible||(t.invisible=!1))}function h(t,e,n,i,r,o){var a=f.getModel(),s=N(d.getFormattedLabel(f.dataIndex,"normal",null,null,o?"upperLabel":"label"),a.get("name"));if(!o&&v.isLeafRoot){var l=d.get("drillDownIcon",!0);s=l?l+" "+s:s}var u=a.getModel(o?tk:QI),c=a.getModel(o?ek:JI),h=u.getShallow("show");fr(t,e,u,c,{defaultText:h?s:null,autoColor:n,isRectText:!0}),o&&(t.textRect=L(o)),t.truncate=h&&u.get("ellipsis")?{outerWidth:i,outerHeight:r,minChar:2}:null}function p(t,e,n,i){var r=null!=S&&s[t][S],o=u[t];return r?(s[t][S]=null,g(o,r,t)):w||((r=new e({z:dd(n,i)})).__tmDepth=n,r.__tmStorageName=t,m(o,r,t)),a[t][_]=r}function g(t,e,n){(t[_]={}).old="nodeGroup"===n?e.position.slice():O({},e.shape)}function m(t,e,n){var i=t[_]={},r=f.parentNode;if(r&&(!l||"drillDown"===l.direction)){var o=0,a=0,s=u.background[r.getRawIndex()];!l&&s&&s.old&&(o=s.old.width,a=s.old.height),i.old="nodeGroup"===n?[0,a]:{x:o,y:a,width:0,height:0}}i.fadein="nodeGroup"!==n}if(f){var v=f.getLayout();if(v&&v.isInView){var y=v.width,x=v.height,b=v.borderWidth,w=v.invisible,_=f.getRawIndex(),S=t&&t.getRawIndex(),C=f.viewChildren,T=v.upperHeight,A=C&&C.length,D=f.getModel("itemStyle"),M=f.getModel("emphasis.itemStyle"),I=p("nodeGroup",YI);if(I){if(e.add(I),I.attr("position",[v.x||0,v.y||0]),I.__tmNodeWidth=y,I.__tmNodeHeight=x,v.isAboveViewRoot)return I;var k=p("background",ZI,i,ik);if(k&&r(I,k,A&&v.upperHeight),!A){var E=p("content",ZI,i,rk);E&&o(I,E)}return I}}}}function dd(t,e){var n=t*nk+e;return(n-1)/n}function fd(n){var t=n.pieceList;n.hasSpecialVisual=!1,k(t,function(t,e){t.originIndex=e,null!=t.visual&&(n.hasSpecialVisual=!0)})}function pd(t){var e=t.categories,n=t.visual,i=t.categoryMap={};if(ck(e,function(t,e){i[t]=e}),!E(n)){var r=[];b(n)?ck(n,function(t,e){var n=i[e];r[null!=n?n:dk]=t}):r[dk]=n,n=Sd(t,r)}for(var o=e.length-1;0<=o;o--)null==n[o]&&(delete i[e[o]],e.pop())}function gd(t,e){var n=t.visual,i=[];b(n)?ck(n,function(t){i.push(t)}):null!=n&&i.push(n);var r={color:1,symbol:1};e||1!==i.length||r.hasOwnProperty(t.type)||(i[1]=i[0]),Sd(t,i)}function md(i){return{applyVisual:function(t,e,n){t=this.mapValueToVisual(t),n("color",i(e("color"),t))},_doMap:wd([0,1])}}function vd(t){var e=this.option.visual;return e[Math.round(Br(t,[0,1],[0,e.length-1],!0))]||{}}function yd(i){return function(t,e,n){n(i,this.mapValueToVisual(t))}}function xd(t){var e=this.option.visual;return e[this.option.loop&&t!==dk?t%e.length:t]}function bd(){return this.option.visual[0]}function wd(i){return{linear:function(t){return Br(t,i,this.option.visual,!0)},category:xd,piecewise:function(t,e){var n=_d.call(this,e);return null==n&&(n=Br(t,i,this.option.visual,!0)),n},fixed:bd}}function _d(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=n[fk.findPieceIndex(t,n)];if(i&&i.visual)return i.visual[this.type]}}function Sd(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=A(e,function(t){return Pt(t)})),e}function Cd(t,e,n){return t?e<=n:e<n}function Td(t,e,n,i,r,o){var a=t.getModel(),s=t.getLayout();if(s&&!s.invisible&&s.isInView){var l,u=t.getModel(vk),c=Ad(u,e,n[t.depth],i),h=u.get("borderColor"),d=u.get("borderColorSaturation");null!=d&&(h=Md(d,l=Dd(c,t))),t.setVisual("borderColor",h);var f=t.viewChildren;if(f&&f.length){var p=kd(t,a,s,u,c,f);k(f,function(t,e){(t.depth>=r.length||t===r[t.depth])&&Td(t,Ld(a,c,t,e,p,o),n,i,r,o)})}else l=Dd(c,t),t.setVisual("color",l)}}function Ad(n,i,r,o){var a=O({},i);return k(["color","colorAlpha","colorSaturation"],function(t){var e=n.get(t,!0);null==e&&r&&(e=r[t]),null==e&&(e=i[t]),null==e&&(e=o.get(t)),null!=e&&(a[t]=e)}),a}function Dd(t){var e=Id(t,"color");if(e){var n=Id(t,"colorAlpha"),i=Id(t,"colorSaturation");return i&&(e=Vt(e,null,null,i)),n&&(e=jt(e,n)),e}}function Md(t,e){return null!=e?Vt(e,null,null,t):null}function Id(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function kd(t,e,n,i,r,o){if(o&&o.length){var a=Ed(e,"color")||null!=r.color&&"none"!==r.color&&(Ed(e,"colorAlpha")||Ed(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:a.name,dataExtent:u,visual:a.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var d=new fk(h);return d.__drColorMappingBy=c,d}}}function Ed(t,e){var n=t.get(e);return mk(n)&&n.length?{name:e,range:n}:null}function Ld(t,e,n,i,r,o){var a=O({},e);if(r){var s=r.type,l="color"===s&&r.__drColorMappingBy,u="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(u)}return a}function Od(t,e,n,i){var r,o;if(!t.isRemoved()){var a=t.getLayout();r=a.width,o=a.height;var s=(f=t.getModel()).get(Sk),l=f.get(Ck)/2,u=Wd(f),c=Math.max(s,u),h=s-l,d=c-l,f=t.getModel();t.setLayout({borderWidth:s,upperHeight:c,upperLabelHeight:u},!0);var p=(r=xk(r-2*h,0))*(o=xk(o-h-d,0)),g=Pd(t,f,p,e,n,i);if(g.length){for(var m={x:h,y:d,width:r,height:o},v=bk(r,o),y=Infinity,x=[],b=x.area=0,w=g.length;b<w;){var _=g[b];x.push(_),x.area+=_.getLayout().area;var S=zd(x,v,e.squareRatio);S<=y?(b++,y=S):(x.area-=x.pop().getLayout().area,Hd(x,v,m,l,!1),v=bk(m.width,m.height),x.length=x.area=0,y=Infinity)}if(x.length&&Hd(x,v,m,l,!0),!n){var C=f.get("childrenVisibleMin");null!=C&&p<C&&(n=!0)}for(b=0,w=g.length;b<w;b++)Od(g[b],e,n,i+1)}}}function Pd(t,e,n,i,r,o){var a=t.children||[],s=i.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=i.leafDepth&&i.leafDepth<=o;if(r&&!l)return t.viewChildren=[];Rd(a=f(a,function(t){return!t.isRemoved()}),s);var u=Fd(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=Nd(e,n,u.sum,s,a),0===u.sum)return t.viewChildren=[];for(var c=0,h=a.length;c<h;c++){var d=a[c].getValue()/u.sum*n;a[c].setLayout({area:d})}return l&&(a.length&&t.setLayout({isLeafRoot:!0},!0),a.length=0),t.viewChildren=a,t.setLayout({dataExtent:u.dataExtent},!0),a}function Nd(t,e,n,i,r){if(!i)return n;for(var o=t.get("visibleMin"),a=r.length,s=a,l=a-1;0<=l;l--){var u=r["asc"===i?a-l-1:l].getValue();u/n*e<o&&(s=l,n-=u)}return"asc"===i?r.splice(0,a-s):r.splice(s,a-s),n}function Rd(t,i){return i&&t.sort(function(t,e){var n="asc"===i?t.getValue()-e.getValue():e.getValue()-t.getValue();return 0===n?"asc"===i?t.dataIndex-e.dataIndex:e.dataIndex-t.dataIndex:n}),t}function Fd(t,e,n){for(var i=0,r=0,o=e.length;r<o;r++)i+=e[r].getValue();var a=t.get("visualDimension");if(e&&e.length)if("value"===a&&n)s=[e[e.length-1].getValue(),e[0].getValue()],"asc"===n&&s.reverse();else{var s=[Infinity,-Infinity];_k(e,function(t){var e=t.getValue(a);e<s[0]&&(s[0]=e),e>s[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:i,dataExtent:s}}function zd(t,e,n){for(var i,r=0,o=Infinity,a=0,s=t.length;a<s;a++)(i=t[a].getLayout().area)&&(i<o&&(o=i),r<i&&(r=i));var l=t.area*t.area,u=e*e*n;return l?xk(u*r/l,l/(u*o)):Infinity}function Hd(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=e?t.area/e:0;(r||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,d=t.length;h<d;h++){var f=t[h],p={},g=c?f.getLayout().area/c:0,m=p[l[a]]=xk(c-2*i,0),v=n[s[o]]+n[l[o]]-u,y=h===d-1||v<g?v:g,x=p[l[o]]=xk(y-2*i,0);p[s[a]]=n[s[a]]+bk(i,m/2),p[s[o]]=u+bk(i,x/2),u+=y,f.setLayout(p,!0)}n[s[a]]+=c,n[l[a]]-=c}function Bd(t,e,n,i,r){var o,a=(e||{}).node,s=[i,r];if(!a||a===n)return s;for(var l=i*r,u=l*t.option.zoomToNodeRatio;o=a.parentNode;){for(var c=0,h=o.children,d=0,f=h.length;d<f;d++)c+=h[d].getValue();var p=a.getValue();if(0===p)return s;u*=c/p;var g=o.getModel(),m=g.get(Sk);u+=4*m*m+(3*m+Math.max(m,Wd(g,m)))*Math.pow(u,.5),jC<u&&(u=jC),a=o}u<l&&(u=l);var v=Math.pow(u/l,.5);return[i*v,r*v]}function Vd(t,e,n){if(e)return{x:e.x,y:e.y};var i={x:0,y:0};if(!n)return i;var r=n.node,o=r.getLayout();if(!o)return i;for(var a=[o.width/2,o.height/2],s=r;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:t.width/2-a[0],y:t.height/2-a[1]}}function jd(t,e,n,i,r){var o=t.getLayout(),a=n[r],s=a&&a===t;if(!(a&&!s||r===n.length&&t!==i)){t.setLayout({isInView:!0,invisible:!s&&!e.intersect(o),isAboveViewRoot:s},!0);var l=new ie(e.x-o.x,e.y-o.y,e.width,e.height);_k(t.viewChildren||[],function(t){jd(t,l,n,i,r+1)})}}function Wd(t){return t.get(Tk)?t.get(Ak):0}function Ud(t){return"_EC_"+t}function $d(t,e){this.id=null==t?"":t,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==e?-1:e}function qd(t,e,n){this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}function Gd(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}function Yd(t){return"_"+t+"Type"}function Zd(t,e,n){var i=e.getItemVisual(n,"color"),r=e.getItemVisual(n,t),o=e.getItemVisual(n,t+"Size");if(r&&"none"!==r){E(o)||(o=[o,o]);var a=Ql(r,-o[0]/2,-o[1]/2,o[0],o[1],i);return a.name=t,a}}function Xd(t){var e=new Nk({name:"line"});return Kd(e.shape,t),e}function Kd(t,e){var n=e[0],i=e[1],r=e[2];t.x1=n[0],t.y1=n[1],t.x2=i[0],t.y2=i[1],t.percent=1,r?(t.cpx1=r[0],t.cpy1=r[1]):(t.cpx1=NaN,t.cpy1=NaN)}function Qd(){var t=this,e=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),i=t.childOfName("label");if(e||n||!i.ignore){for(var r=1,o=this.parent;o;)o.scale&&(r/=o.scale[0]),o=o.parent;var a=t.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=G([],u,l);if(tt(c,c),e){e.attr("position",l);var h=a.tangentAt(0);e.attr("rotation",Math.PI/2-Math.atan2(h[1],h[0])),e.attr("scale",[r*s,r*s])}if(n){n.attr("position",u);h=a.tangentAt(1);n.attr("rotation",-Math.PI/2-Math.atan2(h[1],h[0])),n.attr("scale",[r*s,r*s])}if(!i.ignore){var d,f,p;i.attr("position",u);var g=5*r;if("end"===i.__position)d=[c[0]*g+u[0],c[1]*g+u[1]],f=.8<c[0]?"left":c[0]<-.8?"right":"center",p=.8<c[1]?"top":c[1]<-.8?"bottom":"middle";else if("middle"===i.__position){var m=s/2,v=[(h=a.tangentAt(m))[1],-h[0]],y=a.pointAt(m);0<v[1]&&(v[0]=-v[0],v[1]=-v[1]),d=[y[0]+v[0]*g,y[1]+v[1]*g],f="center",p="bottom";var x=-Math.atan2(h[1],h[0]);u[0]<l[0]&&(x=Math.PI+x),i.attr("rotation",x)}else d=[-c[0]*g+l[0],-c[1]*g+l[1]],f=.8<c[0]?"right":c[0]<-.8?"left":"center",p=.8<c[1]?"bottom":c[1]<-.8?"top":"middle";i.attr({style:{textVerticalAlign:i.__verticalAlign||p,textAlign:i.__textAlign||f},position:d,scale:[r,r]})}}}}function Jd(t,e,n){Xw.call(this),this._createLine(t,e,n)}function tf(t){this._ctor=t||Jd,this.group=new Xw}function ef(t,e,n,i){if(af(e.getItemLayout(n))){var r=new t._ctor(e,n,i);e.setItemGraphicEl(n,r),t.group.add(r)}}function nf(t,e,n,i,r,o){var a=e.getItemGraphicEl(i);af(n.getItemLayout(r))?(a?a.updateData(n,r,o):a=new t._ctor(n,r,o),n.setItemGraphicEl(r,a),t.group.add(a)):t.group.remove(a)}function rf(t){var e=t.hostModel;return{lineStyle:e.getModel("lineStyle").getLineStyle(),hoverLineStyle:e.getModel("emphasis.lineStyle").getLineStyle(),labelModel:e.getModel("label"),hoverLabelModel:e.getModel("emphasis.label")}}function of(t){return isNaN(t[0])||isNaN(t[1])}function af(t){return!of(t[0])&&!of(t[1])}function sf(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=Infinity,l=n*n,u=.1,c=.1;c<=.9;c+=.1){Hk[0]=jk(r[0],o[0],a[0],c),Hk[1]=jk(r[1],o[1],a[1],c),(f=Uk(Wk(Hk,e)-l))<s&&(s=f,i=c)}for(var h=0;h<32;h++){var d=i+u;Bk[0]=jk(r[0],o[0],a[0],i),Bk[1]=jk(r[1],o[1],a[1],i),Vk[0]=jk(r[0],o[0],a[0],d),Vk[1]=jk(r[1],o[1],a[1],d);var f=Wk(Bk,e)-l;if(Uk(f)<.01)break;var p=Wk(Vk,e)-l;u/=2,f<0?0<=p?i+=u:i-=u:0<=p?i-=u:i+=u}return i}function lf(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function uf(t,e,n){var i=t.getGraphicEl(),r=lf(t,e);null!=n&&(null==r&&(r=1),r*=n),i.downplay&&i.downplay(),i.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",r)})}function cf(t,e){var n=lf(t,e),i=t.getGraphicEl();i.highlight&&i.highlight(),i.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",n)})}function hf(t){return t instanceof Array||(t=[t,t]),t}function df(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=t.getGraph();n.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),ff(n)}}function ff(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,n=W(t.node1.getLayout()),i=W(t.node2.getLayout()),r=[n,i];+e&&r.push([(n[0]+i[0])/2-(n[1]-i[1])*e,(n[1]+i[1])/2-(i[0]-n[0])*e]),t.setLayout(r)})}function pf(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=e.getBoundingRect(),i=t.getData(),r=i.graph,o=0,a=i.getSum("value"),s=2*Math.PI/(a||i.count()),l=n.width/2+n.x,u=n.height/2+n.y,c=Math.min(n.width,n.height)/2;r.eachNode(function(t){var e=t.getValue("value");o+=s*(a?e:1)/2,t.setLayout([c*Math.cos(o)+l,c*Math.sin(o)+u]),o+=s*(a?e:1)/2}),i.setLayout({cx:l,cy:u}),r.eachEdge(function(t){var e,n=t.getModel().get("lineStyle.curveness")||0,i=W(t.node1.getLayout()),r=W(t.node2.getLayout()),o=(i[0]+r[0])/2,a=(i[1]+r[1])/2;+n&&(e=[l*(n*=3)+o*(1-n),u*n+a*(1-n)]),t.setLayout([i,r,e])})}}function gf(f,p,t){for(var e=t.rect,n=e.width,i=e.height,g=[e.x+n/2,e.y+i/2],m=null==t.gravity?.1:t.gravity,r=0;r<f.length;r++){var o=f[r];o.p||(o.p=V(n*(Math.random()-.5)+g[0],i*(Math.random()-.5)+g[1])),o.pp=W(o.p),o.edges=null}var v=.6;return{warmUp:function(){v=.5},setFixed:function(t){f[t].fixed=!0},setUnfixed:function(t){f[t].fixed=!1},step:function(t){for(var e=[],n=f.length,i=0;i<p.length;i++){var r=p[i],o=r.n1;G(e,(u=r.n2).p,o.p);var a=Y(e)-r.d,s=u.w/(o.w+u.w);isNaN(s)&&(s=0),tt(e,e),!o.fixed&&Qk(o.p,o.p,e,s*a*v),!u.fixed&&Qk(u.p,u.p,e,-(1-s)*a*v)}for(i=0;i<n;i++){(d=f[i]).fixed||(G(e,g,d.p),Qk(d.p,d.p,e,m*v))}for(i=0;i<n;i++){o=f[i];for(var l=i+1;l<n;l++){var u;G(e,(u=f[l]).p,o.p),0===(a=Y(e))&&(U(e,Math.random()-.5,Math.random()-.5),a=1);var c=(o.rep+u.rep)/a/a;!o.fixed&&Qk(o.pp,o.pp,e,c),!u.fixed&&Qk(u.pp,u.pp,e,-c)}}var h=[];for(i=0;i<n;i++){var d;(d=f[i]).fixed||(G(h,d.p,d.pp),Qk(d.p,d.p,h,v),j(d.pp,d.p))}v*=.992,t&&t(f,p,v<.01)}}}function mf(t,e,n){var i=t.getBoxLayoutParams();return i.aspect=n,po(i,{width:e.getWidth(),height:e.getHeight()})}function vf(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r);return{cx:Vr(n[0],e.getWidth()),cy:Vr(n[1],e.getHeight()),r:Vr(t.get("radius"),o/2)}}function yf(t,e){return e&&("string"==typeof e?t=e.replace("{value}",null!=t?t:""):"function"==typeof e&&(t=e(t))),t}function xf(t,e){function n(){o.ignore=o.hoverIgnore,a.ignore=a.hoverIgnore}function i(){o.ignore=o.normalIgnore,a.ignore=a.normalIgnore}Xw.call(this);var r=new mC,o=new vC,a=new lC;this.add(r),this.add(o),this.add(a),this.updateData(t,e,!0),this.on("emphasis",n).on("normal",i).on("mouseover",n).on("mouseout",i)}function bf(t,e){return po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function wf(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,function(t){return t}),r=[],o="ascending"===e,a=0,s=t.count();a<s;a++)r[a]=a;return"function"==typeof e?r.sort(e):"none"!==e&&r.sort(function(t,e){return o?i[t]-i[e]:i[e]-i[t]}),r}function _f(g){g.each(function(t){var e,n,i,r,o=g.getItemModel(t),a=o.getModel("label").get("position"),s=o.getModel("labelLine"),l=g.getItemLayout(t),u=l.points,c="inner"===a||"inside"===a||"center"===a;if(c)e="center",r=[[n=(u[0][0]+u[1][0]+u[2][0]+u[3][0])/4,i=(u[0][1]+u[1][1]+u[2][1]+u[3][1])/4],[n,i]];else{var h,d,f,p=s.get("length");"left"===a?(h=(u[3][0]+u[0][0])/2,d=(u[3][1]+u[0][1])/2,n=(f=h-p)-5,e="right"):(h=(u[1][0]+u[2][0])/2,d=(u[1][1]+u[2][1])/2,n=(f=h+p)+5,e="left");r=[[h,d],[f,d]],i=d}l.label={linePoints:r,x:n,y:i,verticalAlign:"middle",textAlign:e,inside:c}})}function Sf(t){if(!t.parallel){var e=!1;k(t.series,function(t){t&&"parallel"===t.type&&(e=!0)}),e&&(t.parallel=[{}])}}function Cf(i){k(On(i.parallelAxis),function(t){if(b(t)){var e=t.parallelIndex||0,n=On(i.parallel)[e];n&&n.parallelAxisDefault&&g(t,n.parallelAxisDefault,!1)}})}function Tf(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:0<n?-1:n<0?1:e?-1:1}}function Af(t,e){return Math.min(e[1],Math.max(e[0],t))}function Df(t,e,n){this._axesMap=z(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,n)}function Mf(t,e){return hE(dE(t,e[0]),e[1])}function If(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function kf(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,c=!1;return t<l[0]?(n=t*s,i=s):t<=l[1]?(n=e.axisExpandWindow0Pos+t*o-e.axisExpandWindow[0],u=o,c=!0):(n=r-(a-1-t)*s,i=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:i}}function Ef(i,r){var o=[];return i.eachComponent("parallel",function(t,e){var n=new Df(t,i,r);n.name="parallel_"+e,n.resize(t,r),(t.coordinateSystem=n).model=t,o.push(n)}),i.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=e.coordinateSystem}}),o}function Lf(t,e){return e.type||(e.data?"category":"value")}function Of(t){Vb&&T(t),hw.call(this),this._zr=t,this.group=new Xw,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,Vb&&this._mounted,this._uid="brushController_"+LE++,this._handlers={},bE(OE,function(t,e){this._handlers[e]=v(t,this)},this)}function Pf(t,e){var n=t._zr;t._enableGlobalPan||nh(n,ME,t._uid),bE(t._handlers,function(t,e){n.on(e,t)}),t._brushType=e.brushType,t._brushOption=g(L(EE),e,!0)}function Nf(t){var n=t._zr;ih(n,ME,t._uid),bE(t._handlers,function(t,e){n.off(e,t)}),t._brushType=t._brushOption=null}function Rf(t,e){var n=PE[e.brushType].createCover(t,e);return n.__brushOption=e,Hf(n,e),t.group.add(n),n}function Ff(t,e){var n=Vf(e);return n.endCreating&&(n.endCreating(t,e),Hf(e,e.__brushOption)),e}function zf(t,e){var n=e.__brushOption;Vf(e).updateCoverShape(t,e,n.range,n)}function Hf(t,e){var n=e.z;null==n&&(n=TE),t.traverse(function(t){t.z=n,t.z2=n})}function Bf(t,e){Vf(e).updateCommon(t,e),zf(t,e)}function Vf(t){return PE[t.__brushOption.brushType]}function jf(t,e,n){var i,r=t._panels;if(!r)return!0;var o=t._transform;return bE(r,function(t){t.isTargetByCursor(e,n,o)&&(i=t)}),i}function Wf(t,e){var n=t._panels;if(!n)return!0;var i=e.__brushOption.panelId;return null==i||n[i]}function Uf(e){var t=e._covers,n=t.length;return bE(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function $f(t,e){var n=wE(t._covers,function(t){var e=t.__brushOption,n=L(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",n,{isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function qf(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],r=n[0]-i[0],o=n[1]-i[1],a=CE(r*r+o*o,.5);return AE<a}function Gf(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Yf(e,n,t,i){var r=new Xw;return r.add(new yC({name:"main",style:Qf(t),silent:!0,draggable:!0,cursor:"move",drift:xE(e,n,r,"nswe"),ondragend:xE($f,n,{isEnd:!0})})),bE(i,function(t){r.add(new yC({name:t,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:xE(e,n,r,t),ondragend:xE($f,n,{isEnd:!0})}))}),r}function Zf(t,e,n,i){var r=i.brushStyle.lineWidth||0,o=SE(r,DE),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,c=n[0][1],h=n[1][1],d=c-o+r/2,f=h-o+r/2,p=c-a,g=h-s,m=p+r,v=g+r;Kf(t,e,"main",a,s,p,g),i.transformable&&(Kf(t,e,"w",l,u,o,v),Kf(t,e,"e",d,u,o,v),Kf(t,e,"n",l,u,m,o),Kf(t,e,"s",l,f,m,o),Kf(t,e,"nw",l,u,o,o),Kf(t,e,"ne",d,u,o,o),Kf(t,e,"sw",l,f,o,o),Kf(t,e,"se",d,f,o,o))}function Xf(i,r){var t=r.__brushOption,o=t.transformable,e=r.childAt(0);e.useStyle(Qf(t)),e.attr({silent:!o,cursor:o?"move":"default"}),bE(["w","e","n","s","se","sw","ne","nw"],function(t){var e=r.childOfName(t),n=ep(i,t);e&&e.attr({silent:!o,invisible:!o,cursor:o?kE[n]+"-resize":null})})}function Kf(t,e,n,i,r,o,a){var s=e.childOfName(n);s&&s.setShape(ap(op(t,e,[[i,r],[i+o,r+a]])))}function Qf(t){return D({strokeNoScale:!0},t.brushStyle)}function Jf(t,e,n,i){var r=[_E(t,n),_E(e,i)],o=[SE(t,n),SE(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function tp(t){return Ar(t.group)}function ep(t,e){var n;return 1<e.length?(("e"===(n=[ep(t,(e=e.split(""))[0]),ep(t,e[1])])[0]||"w"===n[0])&&n.reverse(),n.join("")):{left:"w",right:"e",top:"n",bottom:"s"}[n=Mr({w:"left",e:"right",n:"top",s:"bottom"}[e],tp(t))]}function np(t,e,n,i,r,o,a){var s=i.__brushOption,l=t(s.range),u=rp(n,o,a);bE(r.split(""),function(t){var e=IE[t];l[e[0]][e[1]]+=u[e[0]]}),s.range=e(Jf(l[0][0],l[1][0],l[0][1],l[1][1])),Bf(n,i),$f(n,{isEnd:!1})}function ip(t,e,n,i){var r=e.__brushOption.range,o=rp(t,n,i);bE(r,function(t){t[0]+=o[0],t[1]+=o[1]}),Bf(t,e),$f(t,{isEnd:!1})}function rp(t,e,n){var i=t.group,r=i.transformCoordToLocal(e,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function op(t,e,n){var i=Wf(t,e);return i&&!0!==i?i.clipPath(n,t._transform):L(n)}function ap(t){var e=_E(t[0][0],t[1][0]),n=_E(t[0][1],t[1][1]);return{x:e,y:n,width:SE(t[0][0],t[1][0])-e,height:SE(t[0][1],t[1][1])-n}}function sp(t,e,n){if(t._brushType){var i=t._zr,r=t._covers,o=jf(t,e,n);if(!t._dragging)for(var a=0;a<r.length;a++){var s=r[a].__brushOption;if(o&&(!0===o||s.panelId===o.panelId)&&PE[s.brushType].contain(r[a],n[0],n[1]))return}o&&i.setCursorStyle("crosshair")}}function lp(t){var e=t.event;e.preventDefault&&e.preventDefault()}function up(t,e,n){return t.childOfName("main").contain(e,n)}function cp(t,e,n,i){var r,o=t._creatingCover,a=t._creatingPanel,s=t._brushOption;if(t._track.push(n.slice()),qf(t)||o){if(a&&!o){"single"===s.brushMode&&Uf(t);var l=L(s);l.brushType=hp(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=t._creatingCover=Rf(t,l),t._covers.push(o)}if(o){var u=PE[hp(t._brushType,a)];o.__brushOption.range=u.getCreatingRange(op(t,o,t._track)),i&&(Ff(t,o),u.updateCommon(t,o)),zf(t,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&jf(t,e,n)&&Uf(t)&&(r={isEnd:i,removeOnClick:!0});return r}function hp(t,e){return"auto"===t?(Vb&&T(e&&e.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),e.defaultBrushType):t}function dp(t){if(this._dragging){lp(t);var e=cp(this,t,this.group.transformCoordToLocal(t.offsetX,t.offsetY),!0);this._dragging=!1,this._track=[],this._creatingCover=null,e&&$f(this,e)}}function fp(l){return{createCover:function(t,e){return Yf(xE(np,function(t){var e=[t,[0,100]];return l&&e.reverse(),e},function(t){return t[l]}),t,e,[["w","e"],["n","s"]][l])},getCreatingRange:function(t){var e=Gf(t);return[_E(e[0][l],e[1][l]),SE(e[0][l],e[1][l])]},updateCoverShape:function(t,e,n,i){var r,o=Wf(t,e);if(!0!==o&&o.getLinearBrushOtherExtent)r=o.getLinearBrushOtherExtent(l,t._transform);else{var a=t._zr;r=[0,[a.getWidth(),a.getHeight()][1-l]]}var s=[n,r];l&&s.reverse(),Zf(t,e,s,i)},updateCommon:Xf,contain:up}}function pp(e){return e=vp(e),function(t){return kr(t,e)}}function gp(r,o){return r=vp(r),function(t){var e=null!=o?o:t,n=e?r.width:r.height,i=e?r.x:r.y;return[i,i+(n||0)]}}function mp(n,i,r){return n=vp(n),function(t,e){return n.contain(e[0],e[1])&&!mh(t,i,r)}}function vp(t){return ie.create(t)}function yp(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}function xp(t){var e=t.axis;return A(t.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function bp(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}function wp(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}function _p(t,e){if(!t.encodeDefine){var n=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(n){var i=t.encodeDefine=z();k(n.dimensions,function(t){var e=Sp(t);i.set(t,e)})}}}function Sp(t){return+t.replace("dim","")}function Cp(t,e,n){var i=t.model,r=t.getRect(),o=new yC({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),a="horizontal"===i.get("layout")?"width":"height";return o.setShape(a,0),Tr(o,{shape:{width:r.width,height:r.height}},e,n),o}function Tp(t,e,n,i){for(var r=[],o=0;o<n.length;o++){var a=n[o],s=t.get(t.mapDimension(a),e);Ip(s,i.getAxis(a).type)||r.push(i.dataToPoint(s,a))}return r}function Ap(t,e,n,i,r){var o=Tp(t,n,i,r),a=new vC({shape:{points:o},silent:!0,z2:10});return e.add(a),t.setItemGraphicEl(n,a),a}function Dp(t){var e=t.get("smooth",!0);return!0===e&&(e=HE),{lineStyle:t.getModel("lineStyle").getLineStyle(),smooth:null!=e?e:HE}}function Mp(t,e,n,i){var r=i.lineStyle;e.hasItemOption&&(r=e.getItemModel(n).getModel("lineStyle").getLineStyle());t.useStyle(r);var o=t.style;o.fill=null,o.stroke=e.getItemVisual(n,"color"),o.opacity=e.getItemVisual(n,"opacity"),i.smooth&&(t.shape.smooth=i.smooth)}function Ip(t,e){return"category"===e?null==t:null==t||isNaN(t)}function kp(t,e,n){var i=new yC({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Tr(i,{
|
|
shape:{width:t.width+20,height:t.height+20}},e,n),i}function Ep(){function u(t,n){if(n>=c.length)return t;for(var e=-1,i=t.length,r=c[n++],o={},a={};++e<i;){var s=r(t[e]),l=a[s];l?l.push(t[e]):a[s]=[t[e]]}return k(a,function(t,e){o[e]=u(t,n)}),o}function o(t,n){if(n>=c.length)return t;var i=[],r=e[n++];return k(t,function(t,e){i.push({key:e,values:o(t,n)})}),r?i.sort(function(t,e){return r(t.key,e.key)}):i}var c=[],e=[];return{key:function(t){return c.push(t),this},sortKeys:function(t){return e[c.length-1]=t,this},entries:function(t){return o(u(t,0),0)}}}function Lp(t,e){return po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Op(t,e,n,i,r,o,a){Np(t,e,n,r),zp(t,e,o,i,a),$p(t)}function Pp(t){k(t,function(t){var e=Yp(t.outEdges,Qp),n=Yp(t.inEdges,Qp),i=Math.max(e,n);t.setLayout({value:i},!0)})}function Np(r,o,e,t){for(var a=[],s=[],n=[],l=[],i=0,u=0;u<o.length;u++)a[u]=1;for(u=0;u<r.length;u++)s[u]=r[u].inEdges.length,0===s[u]&&n.push(r[u]);for(;n.length;)k(n,function(t){t.setLayout({x:i},!0),t.setLayout({dx:e},!0),k(t.outEdges,function(t){var e=o.indexOf(t);a[e]=0;var n=t.node2,i=r.indexOf(n);0==--s[i]&&l.push(n)})}),++i,n=l,l=[];for(u=0;u<a.length;u++)if(Vb&&1===a[u])throw new Error("Sankey is a DAG, the original data has cycle!");Rp(r,i),Fp(r,(t-e)/(i-1))}function Rp(t,e){k(t,function(t){t.outEdges.length||t.setLayout({x:e-1},!0)})}function Fp(t,n){k(t,function(t){var e=t.getLayout().x*n;t.setLayout({x:e},!0)})}function zp(t,e,n,i,r){var o=Ep().key(function(t){return t.getLayout().x}).sortKeys(Kp).entries(t).map(function(t){return t.values});Hp(t,o,e,n,i),Bp(o,i,n);for(var a=1;0<r;r--)Vp(o,a*=.99),Bp(o,i,n),Wp(o,a),Bp(o,i,n)}function Hp(t,e,n,r,o){var a=[];k(e,function(t){var e=t.length,n=0;k(t,function(t){n+=t.getLayout().value});var i=(r-(e-1)*o)/n;a.push(i)}),a.sort(function(t,e){return t-e});var i=a[0];k(e,function(t){k(t,function(t,e){t.setLayout({y:e},!0);var n=t.getLayout().value*i;t.setLayout({dy:n},!0)})}),k(n,function(t){var e=+t.getValue()*i;t.setLayout({dy:e},!0)})}function Bp(t,s,l){k(t,function(t){var e,n,i,r=0,o=t.length;for(t.sort(Xp),i=0;i<o;i++){if(0<(n=r-(e=t[i]).getLayout().y)){var a=e.getLayout().y+n;e.setLayout({y:a},!0)}r=e.getLayout().y+e.getLayout().dy+s}if(0<(n=r-s-l)){a=e.getLayout().y-n;for(e.setLayout({y:a},!0),r=e.getLayout().y,i=o-2;0<=i;--i)0<(n=(e=t[i]).getLayout().y+e.getLayout().dy+s-r)&&(a=e.getLayout().y-n,e.setLayout({y:a},!0)),r=e.getLayout().y}})}function Vp(t,i){k(t.slice().reverse(),function(t){k(t,function(t){if(t.outEdges.length){var e=Yp(t.outEdges,jp)/Yp(t.outEdges,Qp),n=t.getLayout().y+(e-Zp(t))*i;t.setLayout({y:n},!0)}})})}function jp(t){return Zp(t.node2)*t.getValue()}function Wp(t,i){k(t,function(t){k(t,function(t){if(t.inEdges.length){var e=Yp(t.inEdges,Up)/Yp(t.inEdges,Qp),n=t.getLayout().y+(e-Zp(t))*i;t.setLayout({y:n},!0)}})})}function Up(t){return Zp(t.node1)*t.getValue()}function $p(t){k(t,function(t){t.outEdges.sort(qp),t.inEdges.sort(Gp)}),k(t,function(t){var e=0,n=0;k(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),k(t.inEdges,function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy})})}function qp(t,e){return t.node2.getLayout().y-e.node2.getLayout().y}function Gp(t,e){return t.node1.getLayout().y-e.node1.getLayout().y}function Yp(t,e){for(var n=0,i=t.length,r=-1;++r<i;){var o=+e.call(t,t[r],r);isNaN(o)||(n+=o)}return n}function Zp(t){return t.getLayout().y+t.getLayout().dy/2}function Xp(t,e){return t.getLayout().y-e.getLayout().y}function Kp(t,e){return t-e}function Qp(t){return t.getValue()}function Jp(t,e,n,i,r){var o=t.ends,a=new GE({shape:{points:r?eg(o,i,t):o}});return tg(t,a,e,n,r),a}function tg(t,e,n,i,r){var o=n.hostModel;(0,OC[r?"initProps":"updateProps"])(e,{shape:{points:t.ends}},o,i);var a=n.getItemModel(i),s=a.getModel($E),l=n.getItemVisual(i,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,e.useStyle(u),e.z2=100,dr(e,a.getModel(qE).getItemStyle())}function eg(t,e,n){return A(t,function(t){return(t=t.slice())[e]=n.initBaseline,t})}function ng(t){var i=[],r=[];return t.eachSeriesByType("boxplot",function(t){var e=t.getBaseAxis(),n=x(r,e);n<0&&(n=r.length,r[n]=e,i[n]={axis:e,seriesModels:[]}),i[n].seriesModels.push(t)}),i}function ig(t){var e,n,i=t.axis,r=t.seriesModels,o=r.length,a=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===i.type)n=i.getBandWidth();else{var u=0;ZE(r,function(t){u=Math.max(u,t.getData().count())}),e=i.getExtent(),Math.abs(e[1]-e[0])}ZE(r,function(t){var e=t.get("boxWidth");E(e)||(e=[e,e]),l.push([Vr(e[0],n)||0,Vr(e[1],n)||0])});var c=.8*n-2,h=c/o*.3,d=(c-h*(o-1))/o,f=d/2-c/2;ZE(r,function(t,e){s.push(f),f+=h+d,a.push(Math.min(Math.max(d,l[e][0]),l[e][1]))})}function rg(t,a,e){function n(t,e,n){var i,r=l.get(e,n),o=[];return o[u]=t,o[c]=r,isNaN(t)||isNaN(r)?i=[NaN,NaN]:(i=s.dataToPoint(o))[u]+=a,i}function i(t,e,n){var i=e.slice(),r=e.slice();i[u]+=o,r[u]-=o,n?t.push(i,r):t.push(r,i)}function r(t,e){var n=e.slice(),i=e.slice();n[u]-=o,i[u]+=o,t.push(n,i)}var s=t.coordinateSystem,l=t.getData(),o=e/2,u="horizontal"===t.get("layout")?0:1,c=1-u,h=["x","y"],d=l.mapDimension(h[u]),f=l.mapDimension(h[c],!0);if(!(null==d||f.length<5))for(var p=0;p<l.count();p++){var g=l.get(d,p),m=n(g,f[2],p),v=n(g,f[0],p),y=n(g,f[1],p),x=n(g,f[3],p),b=n(g,f[4],p),w=[];i(w,y,0),i(w,x,1),w.push(v,y,b,x),r(w,v),r(w,b),r(w,m),l.setItemLayout(p,{initBaseline:m[c],ends:w})}}function og(t,e,n){var i=t.ends;return new tL({shape:{points:n?sg(i,t):i},z2:100})}function ag(t,e,n,i){var r=e.getItemModel(n),o=r.getModel(KE),a=e.getItemVisual(n,"color"),s=e.getItemVisual(n,"borderColor")||a,l=o.getItemStyle(JE);t.useStyle(l),t.style.strokeNoScale=!0,t.style.fill=a,t.style.stroke=s,t.__simpleBox=i,dr(t,r.getModel(QE).getItemStyle())}function sg(t,e){return A(t,function(t){return(t=t.slice())[1]=e.initBaseline,t})}function lg(t,e,n){var i=t.getData(),r=i.getLayout("largePoints"),o=new eL({shape:{points:r},__sign:1});e.add(o);var a=new eL({shape:{points:r},__sign:-1});e.add(a),ug(1,o,t,i),ug(-1,a,t,i),n&&(o.incremental=!0,a.incremental=!0)}function ug(t,e,n,i){var r=0<t?"P":"N",o=i.getVisual("borderColor"+r)||i.getVisual("color"+r),a=n.getModel(KE).getItemStyle(JE);e.useStyle(a),e.style.fill=null,e.style.stroke=o}function cg(t,e,n,i,r){return i<n?-1:n<i?1:0<e?t.get(r,e-1)<=i?1:-1:1}function hg(t,e){var n,i=t.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=Vr(R(t.get("barMaxWidth"),r),r),a=Vr(R(t.get("barMinWidth"),1),r),s=t.get("barWidth");return null!=s?Vr(s,r):Math.max(Math.min(r/2,o),a)}function dg(t){return E(t)||(t=[+t,+t]),t}function fg(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function pg(t,e){Xw.call(this);var n=new Tu(t,e),i=new Xw;this.add(n),this.add(i),i.beforeUpdate=function(){this.attr(n.getScale())},this.updateData(t,e)}function gg(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(Vb&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),t.data=A(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),c([e,t[0],t[1]])}))}function mg(t,e,n){Xw.call(this),this.add(this.createLine(t,e,n)),this._updateEffectSymbol(t,e)}function vg(t,e,n){Xw.call(this),this._createPolyline(t,e,n)}function yg(t,e,n){mg.call(this,t,e,n),this._lastFrame=0,this._lastFramePercent=0}function xg(){this.group=new Xw}function bg(t){return t instanceof Array||(t=[t,t]),t}function wg(){var t=ew();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}function _g(e,i,r){var n=e[1]-e[0],o=(i=A(i,function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}})).length,a=0;return function(t){for(var e=a;e<o;e++){if((n=i[e].interval)[0]<=t&&t<=n[1]){a=e;break}}if(e===o)for(e=a-1;0<=e;e--){var n;if((n=i[e].interval)[0]<=t&&t<=n[1]){a=e;break}}return 0<=e&&e<o&&r[e]}}function Sg(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}function Cg(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}function Tg(t,e,n,i){var r=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),h={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:c?n:null,hoverAnimation:c&&n.get("hoverAnimation"),z2:n.getShallow("z",!0)||0};Ag(n,o,r,i,h),Mg(t,e,r,o,a,h.boundingLength,h.pxSign,u,i,h),Ig(n,h.symbolScale,l,i,h);var d=h.symbolSize,f=n.get("symbolOffset");return E(f)&&(f=[Vr(f[0],d[0]),Vr(f[1],d[1])]),kg(n,d,r,o,a,f,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function Ag(t,e,n,i,r){var o,a=i.valueDim,s=t.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[a.wh]<=0);if(E(s)){var h=[Dg(l,s[0])-u,Dg(l,s[1])-u];h[1]<h[0]&&h.reverse(),o=h[c]}else o=null!=s?Dg(l,s)-u:e?i.coordSysExtent[a.index][c]-u:n[a.wh];r.boundingLength=o,e&&(r.repeatCutLength=n[a.wh]),r.pxSign=0<o?1:o<0?-1:0}function Dg(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function Mg(t,e,n,i,r,o,a,s,l,u){var c=l.valueDim,h=l.categoryDim,d=Math.abs(n[h.wh]),f=t.getItemVisual(e,"symbolSize");E(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[h.index]=Vr(f[h.index],d),f[c.index]=Vr(f[c.index],i?d:Math.abs(o)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[c.index]*=(l.isHorizontal?-1:1)*a}function Ig(t,e,n,i,r){var o=t.get(TL)||0;o&&(DL.attr({scale:e.slice(),rotation:n}),DL.updateTransform(),o/=DL.getLineScale(),o*=e[i.valueDim.index]),r.valueLineWidth=o}function kg(t,e,n,i,r,o,a,s,l,u,c,h){var d=c.categoryDim,f=c.valueDim,p=h.pxSign,g=Math.max(e[f.index]+s,0),m=g;if(i){var v=Math.abs(l),y=N(t.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=Vr(y,e[f.index]);var b=Math.max(g+2*y,0),w=x?0:2*y,_=eo(i),S=_?i:Gg((v+w)/b);b=g+2*(y=(v-S*g)/2/(x?S:S-1)),w=x?0:2*y,_||"fixed"===i||(S=u?Gg((Math.abs(u)+w)/b):0),m=S*b-w,h.repeatTimes=S,h.symbolMargin=y}var C=p*(m/2),T=h.pathPosition=[];T[d.index]=n[d.wh]/2,T[f.index]="start"===a?C:"end"===a?l-C:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var A=h.bundlePosition=[];A[d.index]=n[d.xy],A[f.index]=n[f.xy];var D=h.barRectShape=O({},n);D[f.wh]=p*Math.max(Math.abs(n[f.wh]),Math.abs(T[f.index]+C)),D[d.wh]=n[d.wh];var M=h.clipShape={};M[d.xy]=-n[d.xy],M[d.wh]=c.ecSize[d.wh],M[f.xy]=0,M[f.wh]=n[f.wh]}function Eg(t){var e=t.symbolPatternSize,n=Ql(t.symbolType,-e/2,-e/2,e,e,t.color);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function Lg(t,e,r,n){function i(t){var e=c.slice(),n=r.pxSign,i=t;return("start"===r.symbolRepeatDirection?0<n:n<0)&&(i=d-1-t),e[h.index]=p*(i-d/2+.5)+c[h.index],{position:e,scale:r.symbolScale.slice(),rotation:r.rotation}}function o(){Ug(t,function(t){t.trigger("emphasis")})}function a(){Ug(t,function(t){t.trigger("normal")})}var s=t.__pictorialBundle,l=r.symbolSize,u=r.valueLineWidth,c=r.pathPosition,h=e.valueDim,d=r.repeatTimes||0,f=0,p=l[e.valueDim.index]+u+2*r.symbolMargin;for(Ug(t,function(t){t.__pictorialAnimationIndex=f,t.__pictorialRepeatTimes=d,f<d?$g(t,null,i(f),r,n):$g(t,null,{scale:[0,0]},r,n,function(){s.remove(t)}),Hg(t,r),f++});f<d;f++){var g=Eg(r);g.__pictorialAnimationIndex=f,g.__pictorialRepeatTimes=d,s.add(g);var m=i(f);$g(g,{position:m.position,scale:[0,0]},{scale:m.scale,rotation:m.rotation},r,n),g.on("mouseover",o).on("mouseout",a),Hg(g,r)}}function Og(t,e,n,i){function r(){this.trigger("emphasis")}function o(){this.trigger("normal")}var a=t.__pictorialBundle,s=t.__pictorialMainPath;s?$g(s,null,{position:n.pathPosition.slice(),scale:n.symbolScale.slice(),rotation:n.rotation},n,i):(s=t.__pictorialMainPath=Eg(n),a.add(s),$g(s,{position:n.pathPosition.slice(),scale:[0,0],rotation:n.rotation},{scale:n.symbolScale.slice()},n,i),s.on("mouseover",r).on("mouseout",o)),Hg(s,n)}function Pg(t,e,n){var i=O({},e.barRectShape),r=t.__pictorialBarRect;r?$g(r,null,{shape:i},e,n):(r=t.__pictorialBarRect=new yC({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),t.add(r))}function Ng(t,e,n,i){if(n.symbolClip){var r=t.__pictorialClipPath,o=O({},n.clipShape),a=e.valueDim,s=n.animationModel,l=n.dataIndex;if(r)Cr(r,{shape:o},s,l);else{o[a.wh]=0,r=new yC({shape:o}),t.__pictorialBundle.setClipPath(r),t.__pictorialClipPath=r;var u={};u[a.wh]=n.clipShape[a.wh],OC[i?"updateProps":"initProps"](r,{shape:u},s,l)}}}function Rg(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=Fg,n.isAnimationEnabled=zg,n}function Fg(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function zg(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Hg(t,e){t.off("emphasis").off("normal");var n=e.symbolScale.slice();e.hoverAnimation&&t.on("emphasis",function(){this.animateTo({scale:[1.1*n[0],1.1*n[1]]},400,"elasticOut")}).on("normal",function(){this.animateTo({scale:n.slice()},400,"elasticOut")})}function Bg(t,e,n,i){var r=new Xw,o=new Xw;return r.add(o),(r.__pictorialBundle=o).attr("position",n.bundlePosition.slice()),n.symbolRepeat?Lg(r,e,n):Og(r,e,n),Pg(r,n,i),Ng(r,e,n,i),r.__pictorialShapeStr=Wg(t,n),r.__pictorialSymbolMeta=n,r}function Vg(t,e,n){var i=n.animationModel,r=n.dataIndex;Cr(t.__pictorialBundle,{position:n.bundlePosition.slice()},i,r),n.symbolRepeat?Lg(t,e,n,!0):Og(t,e,n,!0),Pg(t,n,!0),Ng(t,e,n,!0)}function jg(t,e,n,i){var r=i.__pictorialBarRect;r&&(r.style.text=null);var o=[];Ug(i,function(t){o.push(t)}),i.__pictorialMainPath&&o.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),k(o,function(t){Cr(t,{scale:[0,0]},n,e,function(){i.parent&&i.parent.remove(i)})}),t.setItemGraphicEl(e,null)}function Wg(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function Ug(e,n,i){k(e.__pictorialBundle.children(),function(t){t!==e.__pictorialBarRect&&n.call(i,t)})}function $g(t,e,n,i,r,o){e&&t.attr(e),i.symbolClip&&!r?n&&t.attr(n):n&&OC[r?"updateProps":"initProps"](t,n,i.animationModel,i.dataIndex,o)}function qg(t,e,n){var i=n.color,r=n.dataIndex,o=n.itemModel,a=o.getModel("itemStyle").getItemStyle(["color"]),s=o.getModel("emphasis.itemStyle").getItemStyle(),l=o.getShallow("cursor");Ug(t,function(t){t.setColor(i),t.setStyle(D({fill:i,opacity:n.opacity},a)),dr(t,s),l&&(t.cursor=l),t.z2=n.z2});var u={},c=e.valueDim.posDesc[+(0<n.boundingLength)],h=t.__pictorialBarRect;Ec(h.style,u,o,i,e.seriesModel,r,c),dr(h,u)}function Gg(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}function Yg(t,e,n){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,n),this.model=t}function Zg(i,r){var o=[];return i.eachComponent("singleAxis",function(t,e){var n=new Yg(t,i,r);n.name="single_"+e,n.resize(t,r),t.coordinateSystem=n,o.push(n)}),i.eachSeries(function(t){if("singleAxis"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=e&&e.coordinateSystem}}),o}function Xg(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,r={},o=i.position,a=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];var c={horizontal:0,vertical:1};r.rotation=Math.PI/2*c[a];var h={top:-1,bottom:1,right:1,left:-1};r.labelDirection=r.tickDirection=r.nameDirection=h[o],t.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),N(e.labelInside,t.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var d=e.rotate;return null==d&&(d=t.get("axisLabel.rotate")),r.labelRotation="top"===o?-d:d,r.z2=1,r}function Kg(t,e){return e.type||(e.data?"category":"value")}function Qg(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=Jg(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&O(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s,r),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function Jg(s,t){var l=t.axis,u=l.dim,c=s,h=[],d=Number.MAX_VALUE,f=-1;return NL(t.seriesModels,function(e){var t,n,i=e.getData().mapDimension(u,!0);if(e.getAxisTooltipData){var r=e.getAxisTooltipData(i,s,l);n=r.dataIndices,t=r.nestestValue}else{if(!(n=e.getData().indicesOfNearest(i[0],s,"category"===l.type?.5:null)).length)return;t=e.getData().get(i[0],n[0])}if(null!=t&&isFinite(t)){var o=s-t,a=Math.abs(o);a<=d&&((a<d||0<=o&&f<0)&&(d=a,f=o,c=t,h.length=0),NL(n,function(t){h.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:h,snapToValue:c}}function tm(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function em(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=Dc(l),c=t.map[u];c||(c=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:r.slice()})}}function nm(r,t,e){var o=e.axesInfo=[];NL(t,function(t,e){var n=t.axisPointerModel.option,i=r[e];i?(!t.useHandle&&(n.status="show"),n.value=i.value,n.seriesDataIndices=(i.payloadBatch||[]).slice()):!t.useHandle&&(n.status="hide"),"show"===n.status&&o.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})})}function im(t,e,n,i){if(!sm(e)&&t.list.length){var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}function rm(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=FL(i)[r]||{},a=FL(i)[r]={};NL(t,function(t){var e=t.axisPointerModel.option;"show"===e.status&&NL(e.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var s=[],l=[];k(o,function(t,e){!a[e]&&l.push(t)}),k(a,function(t,e){!o[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}function om(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function am(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function sm(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function lm(t,e,n){if(!Ub.node){var i=e.getZr();HL(i).records||(HL(i).records={}),um(i,e),(HL(i).records[t]||(HL(i).records[t]={})).handler=n}}function um(r,o){function t(t,i){r.on(t,function(e){var n=fm(o);BL(HL(r).records,function(t){t&&i(t,e,n.dispatchAction)}),cm(n.pendings,o)})}HL(r).initialized||(HL(r).initialized=!0,t("click",y(dm,"click")),t("mousemove",y(dm,"mousemove")),t("globalout",hm))}function cm(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function hm(t,e,n){t.handler("leave",null,n)}function dm(t,e,n,i){e.handler(t,n,i)}function fm(n){var i={showTip:[],hideTip:[]},r=function(t){var e=i[t.type];e?e.push(t):(t.dispatchAction=r,n.dispatchAction(t))};return{dispatchAction:r,pendings:i}}function pm(t,e){if(!Ub.node){var n=e.getZr();(HL(n).records||{})[t]&&(HL(n).records[t]=null)}}function gm(){}function mm(t,e,n,i){vm(jL(n).lastProp,i)||(jL(n).lastProp=i,e?Cr(n,i,t):(n.stopAnimation(),n.attr(i)))}function vm(n,t){if(b(n)&&b(t)){var i=!0;return k(t,function(t,e){i=i&&vm(n[e],t)}),!!i}return n===t}function ym(t,e){t[e.get("label.show")?"show":"hide"]()}function xm(t){return{position:t.position.slice(),rotation:t.rotation||0}}function bm(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}function wm(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}function _m(t,e,n,i,r){var o=Cm(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get("label.precision"),formatter:n.get("label.formatter")}),a=n.getModel("label"),s=$C(a.get("padding")||0),l=a.getFont(),u=Se(o,l),c=r.position,h=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=r.align;"right"===f&&(c[0]-=h),"center"===f&&(c[0]-=h/2);var p=r.verticalAlign;"bottom"===p&&(c[1]-=d),"middle"===p&&(c[1]-=d/2),Sm(c,h,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:h,height:d,r:a.get("borderRadius")},position:c.slice(),style:{text:o,textFont:l,textFill:a.getTextColor(),textPosition:"inside",fill:g,stroke:a.get("borderColor")||"transparent",lineWidth:a.get("borderWidth")||0,shadowBlur:a.get("shadowBlur"),shadowColor:a.get("shadowColor"),shadowOffsetX:a.get("shadowOffsetX"),shadowOffsetY:a.get("shadowOffsetY")},z2:10}}function Sm(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Cm(t,e,r,n,i){t=e.scale.parse(t);var o=e.scale.getLabel(t,{precision:i.precision}),a=i.formatter;if(a){var s={value:Yl(e,t),seriesData:[]};k(n,function(t){var e=r.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,i=e&&e.getDataParams(n);i&&s.seriesData.push(i)}),w(a)?o=a.replace("{value}",o):m(a)&&(o=a(s))}return o}function Tm(t,e,n){var i=ft();return yt(i,i,n.rotation),vt(i,i,n.position),Dr([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function Am(t,e,n,i,r,o){var a=BM.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get("label.margin"),_m(e,i,r,o,{position:Tm(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function Dm(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function Mm(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function Im(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}function km(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}function Em(t){return"x"===t.dim?0:1}function Lm(t){return t.isHorizontal()?0:1}function Om(t,e){var n=t.getRect();return[n[GL[e]],n[GL[e]]+n[YL[e]]]}function Pm(t,e,n){var i=new yC({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Tr(i,{shape:{width:t.width+20,height:t.height+20}},e,n),i}function Nm(n,t,e){if(n.count())for(var i,r=t.coordinateSystem,o=t.getLayerSeries(),a=n.mapDimension("single"),s=n.mapDimension("value"),l=A(o,function(t){return A(t.indices,function(t){var e=r.dataToPoint(n.get(a,t));return e[1]=n.get(s,t),e})}),u=Rm(l),c=u.y0,h=e/u.max,d=o.length,f=o[0].indices.length,p=0;p<f;++p){i=c[p]*h,n.setItemLayout(o[0].indices[p],{layerIndex:0,x:l[0][p][0],y0:i,y:l[0][p][1]*h});for(var g=1;g<d;++g)i+=l[g-1][p][1]*h,n.setItemLayout(o[g].indices[p],{layerIndex:g,x:l[g][p][0],y0:i,y:l[g][p][1]*h})}}function Rm(t){for(var e=t.length,n=t[0].length,i=[],r=[],o=0,a={},s=0;s<n;++s){for(var l=0,u=0;l<e;++l)u+=t[l][s][1];o<u&&(o=u),i.push(u)}for(var c=0;c<n;++c)r[c]=(o-i[c])/2;for(var h=o=0;h<n;++h){var d=i[h]+r[h];o<d&&(o=d)}return a.y0=r,a.max=o,a}function Fm(t){var n=0;k(t.children,function(t){Fm(t);var e=t.value;E(e)&&(e=e[0]),n+=e});var e=t.value;E(e)&&(e=e[0]),(null==e||isNaN(e))&&(e=n),e<0&&(e=0),E(t.value)?t.value[0]=e:t.value=e}function zm(t,e,n){function i(){a.ignore=a.hoverIgnore}function r(){a.ignore=a.normalIgnore}Xw.call(this);var o=new dC({z2:eO});o.seriesIndex=e.seriesIndex;var a=new lC({z2:nO,silent:t.getModel("label").get("silent")});this.add(o),this.add(a),this.updateData(!0,t,"normal",e,n),this.on("emphasis",i).on("normal",r).on("mouseover",i).on("mouseout",r)}function Hm(t,e,n){var i=t.getVisual("color"),r=t.getVisual("visualMeta");r&&0!==r.length||(i=null);var o=t.getModel("itemStyle").get("color");if(o)return o;if(i)return i;if(0===t.depth)return n.option.color[0];var a=n.option.color.length;return o=n.option.color[Bm(t)%a]}function Bm(t){for(var e=t;1<e.depth;)e=e.parentNode;return x(t.getAncestors()[0].children,e)}function Vm(t,e,n){return n!==tO.NONE&&(n===tO.SELF?t===e:n===tO.ANCESTOR?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}function jm(t,e){var n=t.children||[];t.children=Wm(n,e),n.length&&k(t.children,function(t){jm(t,e)})}function Wm(t,e){if("function"==typeof e)return t.sort(e);var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function Um(o,a){return a=a||[0,0],A(["x","y"],function(t,e){var n=this.getAxis(t),i=a[e],r=o[e]/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))},this)}function $m(o,a){return a=a||[0,0],A([0,1],function(t){var e=a[t],n=o[t]/2,i=[],r=[];return i[t]=e-n,r[t]=e+n,i[1-t]=r[1-t]=a[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(r)[t])},this)}function qm(t,e){var n=this.getAxis(),i=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function Gm(s,l){return A(["Radius","Angle"],function(t,e){var n=this["get"+t+"Axis"](),i=l[e],r=s[e]/2,o="dataTo"+t,a="category"===n.type?n.getBandWidth():Math.abs(n[o](i-r)-n[o](i+r));return"Angle"===t&&(a=a*Math.PI/180),a},this)}function Ym(t){var e,n=t.type;if("path"===n){var i=t.shape;(e=Gi(i.pathData,null,{x:i.x||0,y:i.y||0,width:i.width||0,height:i.height||0},"center")).__customPathData=t.pathData}else if("image"===n)(e=new an({})).__customImagePath=t.style.image;else if("text"===n)(e=new lC({})).__customText=t.style.text;else{var r=OC[n.charAt(0).toUpperCase()+n.slice(1)];Vb&&T(r,'graphic type "'+n+'" can not be found.'),e=new r}return e.__customGraphicType=n,e.name=t.name,e}function Zm(e,t,n,i,r,o){var a={},s=n.style||{};if(n.shape&&(a.shape=L(n.shape)),n.position&&(a.position=n.position.slice()),n.scale&&(a.scale=n.scale.slice()),n.origin&&(a.origin=n.origin.slice()),n.rotation&&(a.rotation=n.rotation),"image"===e.type&&n.style){var l=a.style={};k(["x","y","width","height"],function(t){Xm(t,l,s,e.style,o)})}if("text"===e.type&&n.style){l=a.style={};k(["x","y"],function(t){Xm(t,l,s,e.style,o)}),!s.hasOwnProperty("textFill")&&s.fill&&(s.textFill=s.fill),!s.hasOwnProperty("textStroke")&&s.stroke&&(s.textStroke=s.stroke)}if("group"!==e.type&&(e.useStyle(s),o)){e.style.opacity=0;var u=s.opacity;null==u&&(u=1),Tr(e,{style:{opacity:u}},i,t)}o?e.attr(a):Cr(e,a,i,t),e.attr({z2:n.z2||0,silent:n.silent}),!1!==n.styleEmphasis&&dr(e,n.styleEmphasis)}function Xm(t,e,n,i,r){null==n[t]||r||(e[t]=n[t],n[t]=i[t])}function Km(r,o,e,n){function a(t){null==t&&(t=g),_&&(m=o.getItemModel(t),v=m.getModel(hO),y=m.getModel(dO),x=o.getItemVisual(t,"color"),_=!1)}function t(t,e){return null==e&&(e=g),o.get(o.getDimension(t||0),e)}function i(t,e){null==e&&(e=g),a(e);var n=m.getModel(uO).getItemStyle();null!=x&&(n.fill=x);var i=o.getItemVisual(e,"opacity");return null!=i&&(n.opacity=i),pr(n,v,null,{autoColor:x,isRectText:!0}),n.text=v.getShallow("show")?R(r.getFormattedLabel(e,"normal"),Cu(o,e)):null,t&&O(n,t),n}function s(t,e){null==e&&(e=g),a(e);var n=m.getModel(cO).getItemStyle();return pr(n,y,null,{isRectText:!0},!0),n.text=y.getShallow("show")?F(r.getFormattedLabel(e,"emphasis"),r.getFormattedLabel(e,"normal"),Cu(o,e)):null,t&&O(n,t),n}function l(t,e){return null==e&&(e=g),o.getItemVisual(e,t)}function u(t){if(f.getBaseAxis)return Ll(D({axis:f.getBaseAxis()},t),n)}function c(){return e.getCurrentSeriesIndices()}function h(t){return _r(t,e)}var d=r.get("renderItem"),f=r.coordinateSystem,p={};f&&(Vb&&(T(d,"series.render is required."),T(f.prepareCustoms||pO[f.type],"This coordSys does not support custom series.")),p=f.prepareCustoms?f.prepareCustoms():pO[f.type](f));var g,m,v,y,x,b=D({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:t,style:i,styleEmphasis:s,visual:l,barLayout:u,currentSeriesIndices:c,font:h},p.api||{}),w={context:{},seriesId:r.id,seriesName:r.name,seriesIndex:r.seriesIndex,coordSys:p.coordSys,dataInsideLength:o.count(),encode:Qm(r.getData())},_=!0;return function(t){return g=t,_=!0,d&&d(D({dataIndexInside:t,dataIndex:o.getRawIndex(t)},w),b)||{}}}function Qm(r){var o={};return k(r.dimensions,function(t,e){var n=r.getDimensionInfo(t);if(!n.isExtraCoord){var i=n.coordDim;(o[i]=o[i]||[])[n.coordDimIndex]=e}}),o}function Jm(t,e,n,i,r,o){return(t=tv(t,e,n,i,r,o))&&o.setItemGraphicEl(e,t),t}function tv(t,e,n,i,r,o){var a=n.type;if(!t||a===t.__customGraphicType||"path"===a&&n.pathData===t.__customPathData||"image"===a&&n.style.image===t.__customImagePath||"text"===a&&n.style.text===t.__customText||(r.remove(t),t=null),null!=a){var s=!t;if(!t&&(t=Ym(n)),Zm(t,e,n,i,o,s),"group"===a){var l=t.children()||[],u=n.children||[];if(n.diffChildrenByName)ev({oldChildren:l,newChildren:u,dataIndex:e,animatableModel:i,group:t,data:o});else{for(var c=0;c<u.length;c++)tv(t.childAt(c),e,u[c],i,t,o);for(;c<l.length;c++)l[c]&&t.remove(l[c])}}return r.add(t),t}}function ev(t){new Ys(t.oldChildren,t.newChildren,nv,nv,t).add(iv).update(iv).remove(rv).execute()}function nv(t,e){var n=t&&t.name;return null!=n?n:fO+e}function iv(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null;tv(null!=e?n.oldChildren[e]:null,n.dataIndex,i,n.animatableModel,n.group,n.data)}function rv(t){var e=this.context,n=e.oldChildren[t];n&&e.group.remove(n)}function ov(t,e,n,i){var r=n.type;Vb&&T(r,"graphic type MUST be set");var o=OC[r.charAt(0).toUpperCase()+r.slice(1)];Vb&&T(o,"graphic type can not be found");var a=new o(n);e.add(a),i.set(t,a),a.__ecGraphicId=t}function av(t,e){var n=t&&t.parent;n&&("group"===t.type&&t.traverse(function(t){av(t,e)}),e.removeKey(t.__ecGraphicId),n.remove(t))}function sv(e){return e=O({},e),k(["id","parentId","$action","hv","bounding"].concat(tT),function(t){delete e[t]}),e}function lv(e,t){var n;return k(t,function(t){null!=e[t]&&"auto"!==e[t]&&(n=!0)}),n}function uv(t,e){var n=t.exist;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}e.parentOption=null}function cv(t,e,n){var i=O({},n),r=t[e],o=n.$action||"merge";if("merge"===o)if(r){if(Vb){var a=n.type;T(!a||r.type===a,'Please set $action: "replace" to change `type`')}g(r,i,!0),vo(r,i,{ignoreSize:!0}),xo(n,r)}else t[e]=i;else"replace"===o?t[e]=i:"remove"===o&&r&&(t[e]=null)}function hv(t,e){t&&(t.hv=e.hv=[lv(e,["left","right"]),lv(e,["top","bottom"])],"group"===t.type&&(null==t.width&&(t.width=e.width=0),null==t.height&&(t.height=e.height=0)))}function dv(t,e,n){var r,o={},a="toggleSelected"===t;return n.eachComponent("legend",function(i){a&&null!=r?i[r?"select":"unSelect"](e.name):(i[t](e.name),r=i.isSelected(e.name)),k(i.getData(),function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);o.hasOwnProperty(e)?o[e]=o[e]&&n:o[e]=n}})}),{name:e.name,selected:o}}function fv(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=po(i,o,r);nT(e.get("orient"),t,e.get("itemGap"),a.width,a.height),go(t,i,o,r)}function pv(t,e){var n=$C(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new yC({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}function gv(t,e){e.dispatchAction({type:"legendToggleSelect",name:t})}function mv(t,e,n,i){var r=n.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||n.dispatchAction({type:"highlight",seriesName:t.name,name:e,excludeSeriesId:i})}function vv(t,e,n,i){var r=n.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||n.dispatchAction({type:"downplay",seriesName:t.name,name:e,excludeSeriesId:i})}function yv(t,e,n){var i=[1,1];i[t.getOrient().index]=0,vo(e,n,{type:"box",ignoreSize:i})}function xv(t){var e="cubic-bezier(0.23, 1, 0.32, 1)",n="left "+t+"s "+e+",top "+t+"s "+e;return A(MO,function(t){
|
|
return t+"transition:"+n}).join(";")}function bv(n){var i=[],t=n.get("fontSize"),e=n.getTextColor();return e&&i.push("color:"+e),i.push("font:"+n.getFont()),t&&i.push("line-height:"+Math.round(3*t/2)+"px"),AO(["decoration","align"],function(t){var e=n.get(t);e&&i.push("text-"+t+":"+e)}),i.join(";")}function wv(r){var o=[],t=r.get("transitionDuration"),e=r.get("backgroundColor"),n=r.getModel("textStyle"),i=r.get("padding");return t&&o.push(xv(t)),e&&(Ub.canvasSupported?o.push("background-Color:"+e):(o.push("background-Color:#"+zt(e)),o.push("filter:alpha(opacity=70)"))),AO(["width","color","radius"],function(t){var e="border-"+t,n=DO(e),i=r.get(n);null!=i&&o.push(e+":"+i+("color"===t?"":"px"))}),o.push(bv(n)),null!=i&&o.push("padding:"+$C(i).join("px ")+"px"),o.join(";")+";"}function _v(n,t){if(Ub.wxa)return null;var e=document.createElement("div"),i=this._zr=t.getZr();this.el=e,this._x=t.getWidth()/2,this._y=t.getHeight()/2,n.appendChild(e),this._container=n,this._show=!1,this._hideTimeout;var r=this;e.onmouseenter=function(){r._enterable&&(clearTimeout(r._hideTimeout),r._show=!0),r._inContent=!0},e.onmousemove=function(t){if(t=t||window.event,!r._enterable){var e=i.handler;mn(n,t,!0),e.dispatch("mousemove",t)}},e.onmouseleave=function(){r._enterable&&r._show&&r.hideLater(r._hideDelay),r._inContent=!1}}function Sv(t){for(var e=t.pop();t.length;){var n=t.pop();n&&(Or.isInstance(n)&&(n=n.get("tooltip",!0)),"string"==typeof n&&(n={formatter:n}),e=new Or(n,e,e.ecModel))}return e}function Cv(t,e){return t.dispatchAction||v(e.dispatchAction,e)}function Tv(t,e,n,i,r,o,a){var s=Dv(n),l=s.width,u=s.height;return null!=o&&(i<t+l+o?t-=l+o:t+=o),null!=a&&(r<e+u+a?e-=u+a:e+=a),[t,e]}function Av(t,e,n,i,r){var o=Dv(n),a=o.width,s=o.height;return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,[t=Math.max(t,0),e=Math.max(e,0)]}function Dv(t){var e=t.clientWidth,n=t.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(t);i&&(e+=parseInt(i.paddingLeft,10)+parseInt(i.paddingRight,10)+parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),n+=parseInt(i.paddingTop,10)+parseInt(i.paddingBottom,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:n}}function Mv(t,e,n){var i=n[0],r=n[1],o=5,a=0,s=0,l=e.width,u=e.height;switch(t){case"inside":a=e.x+l/2-i/2,s=e.y+u/2-r/2;break;case"top":a=e.x+l/2-i/2,s=e.y-r-o;break;case"bottom":a=e.x+l/2-i/2,s=e.y+u+o;break;case"left":a=e.x-i-o,s=e.y+u/2-r/2;break;case"right":a=e.x+l+o,s=e.y+u/2-r/2}return[a,s]}function Iv(t){return"center"===t||"middle"===t}function kv(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function Ev(t){return t.dim}function Lv(t,e,n){var L=n.getWidth(),O=n.getHeight(),P={},N=Ov(f(e.getSeriesByType(t),function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type}));e.eachSeriesByType(t,function(t){if("polar"===t.coordinateSystem.type){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=kv(t),o=N[Ev(i)][r],a=o.offset,s=o.width,l=n.getOtherAxis(i),u=t.get("center")||["50%","50%"],c=Vr(u[0],L),h=Vr(u[1],O),d=t.get("barMinHeight")||0,f=t.get("barMinAngle")||0;P[r]=P[r]||[];for(var p=e.mapDimension(l.dim),g=e.mapDimension(i.dim),m=ml(e,p),v=l.getExtent()[0],y=0,x=e.count();y<x;y++){var b=e.get(p,y),w=e.get(g,y);if(!isNaN(b)){var _,S,C,T,A=0<=b?"p":"n",D=v;if(m&&(P[r][w]||(P[r][w]={p:v,n:v}),D=P[r][w][A]),"radius"===l.dim){var M=l.dataToRadius(b)-v,I=i.dataToAngle(w);Math.abs(M)<d&&(M=(M<0?-1:1)*d),S=(_=D)+M,T=(C=I-a)-s,m&&(P[r][w][A]=S)}else{var k=l.dataToAngle(b,!0)-v,E=i.dataToRadius(w);Math.abs(k)<f&&(k=(k<0?-1:1)*f),S=(_=E+a)+s,T=(C=D)+k,m&&(P[r][w][A]=T)}e.setItemLayout(y,{cx:c,cy:h,r0:_,r:S,startAngle:-C*Math.PI/180,endAngle:-T*Math.PI/180})}}}},this)}function Ov(t){var d={};k(t,function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),i=n.getExtent(),r="category"===n.type?n.getBandWidth():Math.abs(i[1]-i[0])/e.count(),o=d[Ev(n)]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},a=o.stacks;d[Ev(n)]=o;var s=kv(t);a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=Vr(t.get("barWidth"),r),u=Vr(t.get("barMaxWidth"),r),c=t.get("barGap"),h=t.get("barCategoryGap");l&&!a[s].width&&(l=Math.min(o.remainedWidth,l),a[s].width=l,o.remainedWidth-=l),u&&(a[s].maxWidth=u),null!=c&&(o.gap=c),null!=h&&(o.categoryGap=h)});var f={};return k(d,function(t,n){f[n]={};var e=t.stacks,i=t.bandWidth,r=Vr(t.categoryGap,i),o=Vr(t.gap,1),a=t.remainedWidth,s=t.autoWidthCount,l=(a-r)/(s+(s-1)*o);l=Math.max(l,0),k(e,function(t){var e=t.maxWidth;e&&e<l&&(e=Math.min(e,a),t.width&&(e=Math.min(e,t.width)),a-=e,t.width=e,s--)}),l=(a-r)/(s+(s-1)*o),l=Math.max(l,0);var u,c=0;k(e,function(t){t.width||(t.width=l),c+=(u=t).width*(1+o)}),u&&(c-=u.width*o);var h=-c/2;k(e,function(t,e){f[n][e]=f[n][e]||{offset:h,width:t.width},h+=t.width*(1+o)})}),f}function Pv(t,e){rM.call(this,"radius",t,e),this.type="category"}function Nv(t,e){e=e||[0,360],rM.call(this,"angle",t,e),this.type="category"}function Rv(t,e){return e.type||(e.data?"category":"value")}function Fv(t,e,n){var i=e.get("center"),r=n.getWidth(),o=n.getHeight();t.cx=Vr(i[0],r),t.cy=Vr(i[1],o);var a=t.getRadiusAxis(),s=Math.min(r,o)/2,l=Vr(e.get("radius"),s);a.inverse?a.setExtent(l,0):a.setExtent(0,l)}function zv(t){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(Infinity,-Infinity),r.scale.setExtent(Infinity,-Infinity),t.eachSeries(function(t){if(t.coordinateSystem===n){var e=t.getData();k(e.mapDimension("radius",!0),function(t){r.scale.unionExtentFromData(e,vl(e,t))}),k(e.mapDimension("angle",!0),function(t){i.scale.unionExtentFromData(e,vl(e,t))})}}),Ul(i.scale,i.model),Ul(r.scale,r.model),"category"===i.type&&!i.onBand){var e=i.getExtent(),o=360/i.scale.count();i.inverse?e[1]+=o:e[1]-=o,i.setExtent(e[0],e[1])}}function Hv(t,e){if(t.type=e.get("type"),t.scale=$l(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var n=e.get("startAngle");t.setExtent(n,n+(t.inverse?-360:360))}(e.axis=t).model=e}function Bv(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),r=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function Vv(t){return t.getRadiusAxis().inverse?0:1}function jv(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}function Wv(t,e,n){return{position:[t.cx,t.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}function Uv(t,e,n,i,r){var o=e.axis,a=o.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=i.getRadiusAxis().getExtent();if("radius"===o.dim){var d=ft();yt(d,d,s),vt(d,d,[i.cx,i.cy]),l=Dr([a,-r],d);var f=e.getModel("axisLabel").get("rotate")||0,p=BM.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,c=p.textVerticalAlign}else{var g=h[1];l=i.coordToPoint([g+r,a]);var m=i.cx,v=i.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",c=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}function $v(i,t){t.update="updateView",Os(t,function(t,e){var n={};return e.eachComponent({mainType:"geo",query:t},function(e){e[i](t.name),k(e.coordinateSystem.regions,function(t){n[t.name]=e.isSelected(t.name)||!1})}),{selected:n,name:t.name}})}function qv(n){var e={};k(n,function(t){e[t]=1}),n.length=0,k(e,function(t,e){n.push(e)})}function Gv(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function Yv(t,e,o){function n(){var t=function(){};return t.prototype.__hidden=t.prototype,new t}var a={};return $O(e,function(i){var r=a[i]=n();$O(t[i],function(t,e){if(fk.isValidType(e)){var n={type:e,visual:t};o&&o(n,i),r[e]=new fk(n),"opacity"===e&&((n=L(n)).type="colorAlpha",r.__hidden.__alphaForOpacity=new fk(n))}})}),a}function Zv(e,n,t){var i;k(t,function(t){n.hasOwnProperty(t)&&Gv(n[t])&&(i=!0)}),i&&k(t,function(t){n.hasOwnProperty(t)&&Gv(n[t])?e[t]=L(n[t]):delete e[t]})}function Xv(t,u,c,h,d,f){function p(t){return c.getItemVisual(m,t)}function g(t,e){c.setItemVisual(m,t,e)}function e(t,e){m=null==f?t:e;var n=c.getRawDataItem(m);if(!n||!1!==n.visualMap)for(var i=h.call(d,t),r=u[i],o=v[i],a=0,s=o.length;a<s;a++){var l=o[a];r[l]&&r[l].applyVisual(t,p,g)}}var m,v={};k(t,function(t){var e=fk.prepareVisualTypes(u[t]);v[t]=e}),null==f?c.each(e):c.each([f],e)}function Kv(t,f,p,g){function e(t,n){function e(t){return n.getItemVisual(r,t)}function i(t,e){n.setItemVisual(r,t,e)}var r;for(null!=g&&(g=n.getDimension(g));null!=(r=t.next());){var o=n.getRawDataItem(r);if(o&&!1===o.visualMap)return;for(var a=null!=g?n.get(g,r,!0):r,s=p(a),l=f[s],u=m[s],c=0,h=u.length;c<h;c++){var d=u[c];l[d]&&l[d].applyVisual(a,e,i)}}}var m={};return k(t,function(t){var e=fk.prepareVisualTypes(f[t]);m[t]=e}),{progress:e}}function Qv(o){var a=["x","y"],s=["width","height"];return{point:function(t,e,n){if(t){var i=n.range;return Jv(t[o],i)}},rect:function(t,e,n){if(t){var i=n.range,r=[t[a[o]],t[a[o]]+t[s[o]]];return r[1]<r[0]&&r.reverse(),Jv(r[0],i)||Jv(r[1],i)||Jv(i[0],r)||Jv(i[1],r)}}}}function Jv(t,e){return e[0]<=t&&t<=e[1]}function ty(t,e,n,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(ey(t,e,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function ey(t,e,n,i,r,o,a,s){var l=iy(n-t,r-a,i-e,o-s);if(ny(l))return!1;var u=iy(r-t,r-a,o-e,o-s)/l;if(u<0||1<u)return!1;var c=iy(n-t,r-t,i-e,o-e)/l;return!(c<0||1<c)}function ny(t){return t<=1e-6&&-1e-6<=t}function iy(t,e,n,i){return t*i-e*n}function ry(t,e,n){var i=this._targetInfoList=[],r={},o=ay(e,t);GO(JO,function(t,e){(!n||!n.include||0<=YO(n.include,e))&&t(o,i,r)})}function oy(t){return t[0]>t[1]&&t.reverse(),t}function ay(t,e){return Un(t,e,{includeMainTypes:KO})}function sy(t,e,n,i){Vb&&T("cartesian2d"===n.type,"lineX/lineY brush is available only in cartesian2d.");var r=n.getAxis(["x","y"][t]),o=oy(A([0,1],function(t){return e?r.coordToData(r.toLocalCoord(i[t])):r.toGlobalCoord(r.dataToCoord(i[t]))})),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}function ly(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function uy(t,e){var n=cy(t),i=cy(e),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function cy(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function hy(t,e,n,i,r){if(r){var o=t.getZr();if(!o[aP])o[oP]||(o[oP]=dy),za(o,oP,n,e)(t,i)}}function dy(t,e){if(!t.isDisposed()){var n=t.getZr();n[aP]=!0,t.dispatchAction({type:"brushSelect",batch:e}),n[aP]=!1}}function fy(t,e,n,i){for(var r=0,o=e.length;r<o;r++){var a=e[r];if(t[a.brushType](i,n,a.selectors,a))return!0}}function py(t){var a=t.brushSelector;if(w(a)){var e=[];return k(qO,function(o,t){e[t]=function(t,e,n,i){var r=e.getItemLayout(t);return o[a](r,n,i)}}),e}if(m(a)){var n={};return k(qO,function(t,e){n[e]=a}),n}return a}function gy(t,e){var n=t.option.seriesIndex;return null!=n&&"all"!==n&&(E(n)?x(n,e)<0:e!==n)}function my(n){var i=n.selectors={};return k(qO[n.brushType],function(e,t){i[t]=function(t){return e(t,i,n)}}),n}function vy(t){return new ie(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}function yy(t,e){return g({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Or(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}function xy(t,e,n,i){(!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}function by(t,e){cP[t]=e}function wy(t){return cP[t]}function _y(t,e,n){this.model=t,this.ecModel=e,this.api=n,this._brushType,this._brushMode}function Sy(t){this._model=t}function Cy(t,e,n,i){var r=n.calendarModel,o=n.seriesModel,a=r?r.coordinateSystem:o?o.coordinateSystem:null;return a===this?a[t](i):null}function Ty(t,e){var n=t.cellSize;E(n)?1===n.length&&(n[1]=n[0]):n=t.cellSize=[n,n];var i=A([0,1],function(t){return mo(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]});vo(t,e,{type:"box",ignoreSize:i})}function Ay(t){return 0<=x(vP,t)}function Dy(t,a){var s=A(t=t.slice(),co),l=A(a=(a||[]).slice(),co);return function(r,o){k(t,function(t,e){for(var n={name:t,capital:s[e]},i=0;i<a.length;i++)n[a[i]]=t+l[i];r.call(o,n)})}}function My(r,o,a){function s(t,e){return 0<=x(e.nodes,t)}function l(t,n){var i=!1;return o(function(e){k(a(t,e)||[],function(t){n.records[e.name][t]&&(i=!0)})}),i}function u(t,n){n.nodes.push(t),o(function(e){k(a(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(t){function e(t){!s(t,i)&&l(t,i)&&(u(t,i),n=!0)}var n,i={nodes:[],records:{}};if(o(function(t){i.records[t.name]={}}),!t)return i;for(u(t,i);n=!1,r(e),n;);return i}}function Iy(t,e,n){var i=[Infinity,-Infinity];return xP(n,function(t){var n=t.getData();n&&xP(n.mapDimension(e,!0),function(t){var e=n.getApproximateExtent(t);e[0]<i[0]&&(i[0]=e[0]),e[1]>i[1]&&(i[1]=e[1])})}),i[1]<i[0]&&(i=[NaN,NaN]),ky(t,i),i}function ky(t,e){var n=t.getAxisModel(),i=n.getMin(!0),r="category"===n.get("type"),o=r&&n.getCategories().length;null!=i&&"dataMin"!==i&&"function"!=typeof i?e[0]=i:r&&(e[0]=0<o?0:NaN);var a=n.getMax(!0);return null!=a&&"dataMax"!==a&&"function"!=typeof a?e[1]=a:r&&(e[1]=0<o?o-1:NaN),n.get("scale",!0)||(0<e[0]&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function Ey(t,e){var n=t.getAxisModel(),i=t._percentWindow,r=t._valueWindow;if(i){var o=qr(r,[0,500]);o=Math.min(o,20);var a=e||0===i[0]&&100===i[1];n.setRange(a?null:+r[0].toFixed(o),a?null:+r[1].toFixed(o))}}function Ly(i){var r=i._minMaxSpan={},o=i._dataZoomModel;xP(["min","max"],function(t){r[t+"Span"]=o.get(t+"Span");var e=o.get(t+"ValueSpan");if(null!=e&&(r[t+"ValueSpan"]=e,null!=(e=i.getAxisModel().axis.scale.parse(e)))){var n=i._dataExtent;r[t+"Span"]=Br(n[0]+e,n,[0,100],!0)}})}function Oy(e){var n={};return _P(["start","end","startValue","endValue","throttle"],function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n}function Py(t,r){var o=t._rangePropMode,a=t.get("rangeMode");_P([["start","startValue"],["end","endValue"]],function(t,e){var n=null!=r[t[0]],i=null!=r[t[1]];n&&!i?o[e]="percent":!n&&i?o[e]="value":a?o[e]=a[e]:n&&(o[e]="percent")})}function Ny(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}function Ry(t){return"vertical"===t?"ns-resize":"ew-resize"}function Fy(t,n){var e=By(t),i=n.dataZoomId,r=n.coordId;k(e,function(t){var e=t.dataZoomInfos;e[i]&&x(n.allCoordIds,r)<0&&(delete e[i],t.count--)}),jy(e);var o=e[r];o||((o=e[r]={coordId:r,dataZoomInfos:{},count:0}).controller=Vy(t,o),o.dispatchAction=y(qy,t)),!o.dataZoomInfos[i]&&o.count++,o.dataZoomInfos[i]=n;var a=Gy(o.dataZoomInfos);o.controller.enable(a.controlType,a.opt),o.controller.setPointerChecker(n.containsPoint),za(o,"dispatchAction",n.throttleRate,"fixRate")}function zy(t,n){var e=By(t);k(e,function(t){t.controller.dispose();var e=t.dataZoomInfos;e[n]&&(delete e[n],t.count--)}),jy(e)}function Hy(t){return t.type+"\0_"+t.id}function By(t){var e=t.getZr();return e[BP]||(e[BP]={})}function Vy(t,e){var n=new ah(t.getZr());return n.on("pan",HP(Wy,e)),n.on("zoom",HP(Uy,e)),n}function jy(n){k(n,function(t,e){t.count||(t.controller.dispose(),delete n[e])})}function Wy(e,n,i,r,o,a,s){$y(e,function(t){return t.panGetRange(e.controller,n,i,r,o,a,s)})}function Uy(e,n,i,r){$y(e,function(t){return t.zoomGetRange(e.controller,n,i,r)})}function $y(t,n){var i=[];k(t.dataZoomInfos,function(t){var e=n(t);!t.disabled&&e&&i.push({dataZoomId:t.dataZoomId,start:e[0],end:e[1]})}),i.length&&t.dispatchAction(i)}function qy(t,e){t.dispatchAction({type:"dataZoom",batch:e})}function Gy(t){var n,i={},r="type_",o={type_true:2,type_move:1,type_false:0,type_undefined:-1};return k(t,function(t){var e=!t.disabled&&(!t.zoomLock||"move");o[r+e]>o[r+n]&&(n=e),O(i,t.roamControllerOpt)}),{controlType:n,opt:i}}function Yy(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Zy(t,e,n,i){function r(t){return l[t]}function o(t,e){l[t]=e}for(var a=e.targetVisuals[i],s=fk.prepareVisualTypes(a),l={color:t.getData().getVisual("color")},u=0,c=s.length;u<c;u++){var h=s[u],d=a["opacity"===h?"__alphaForOpacity":h];d&&d.applyVisual(n,r,o)}return l.color}function Xy(t,e,n){if(n[0]===n[1])return n.slice();for(var i=200,r=(n[1]-n[0])/i,o=n[0],a=[],s=0;s<=i&&o<n[1];s++)a.push(o),o+=r;return a.push(n[1]),a}function Ky(t,e,n){var i=t.option,r=i.align;if(null!=r&&"auto"!==r)return r;for(var o={width:e.getWidth(),height:e.getHeight()},a="horizontal"===i.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[a],u=[0,null,10],c={},h=0;h<3;h++)c[s[1-a][h]]=u[h],c[l[h]]=2===h?n[0]:i[l[h]];var d=[["x","width",3],["y","height",0]][a],f=po(c,o,i.padding);return l[(f.margin[d[2]]||0)+f[d[0]]+.5*f[d[1]]<.5*o[d[1]]?0:1]}function Qy(t){return k(t||[],function(){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null)}),t}function Jy(t,e,n,i){return new mC({shape:{points:t},draggable:!!n,cursor:e,drift:n,onmousemove:function(t){k_(t.event)},ondragend:i})}function tx(t,e){return 0===t?[[0,0],[e,0],[e,-e]]:[[0,0],[e,0],[e,e]]}function ex(t,e,n,i){return t?[[0,-sN(e,lN(n,0))],[cN,0],[0,sN(e,lN(i-n,0))]]:[[0,0],[5,-5],[5,5]]}function nx(t,e,n){var i=uN/2,r=t.get("hoverLinkDataSize");return r&&(i=oN(r,e,n,!0)/2),i}function ix(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function rx(t){return"vertical"===t?"ns-resize":"ew-resize"}function ox(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}function ax(t){Pn(t,"label",["show"])}function sx(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function lx(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}function ux(t,e,n,i,r,o){var a=[],s=ml(e,i)?e.getCalculationInfo("stackResultDimension"):i,l=gx(e,s,t),u=e.indicesOfNearest(s,l)[0];a[r]=e.get(n,u),a[o]=e.get(i,u);var c=Ur(e.get(i,u));return 0<=(c=Math.min(c,20))&&(a[o]=+a[o].toFixed(c)),a}function cx(t,e){var n=t.getData(),i=t.coordinateSystem;if(e&&!lx(e)&&!E(e.coord)&&i){var r=i.dimensions,o=hx(e,n,i,t);if((e=L(e)).type&&xN[e.type]&&o.baseAxis&&o.valueAxis){var a=vN(r,o.baseAxis.dim),s=vN(r,o.valueAxis.dim);e.coord=xN[e.type](n,o.baseDataDim,o.valueDataDim,a,s),e.value=e.coord[s]}else{for(var l=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],u=0;u<2;u++)xN[l[u]]&&(l[u]=gx(n,n.mapDimension(r[u]),l[u]));e.coord=l}}return e}function hx(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(dx(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function dx(t,e){var n=t.getData(),i=n.dimensions;e=n.getDimension(e);for(var r=0;r<i.length;r++){var o=n.getDimensionInfo(i[r]);if(o.name===e)return o.coordDim}}function fx(t,e){return!(t&&t.containData&&e.coord&&!sx(e))||t.containData(e.coord)}function px(t,e,n,i){return i<2?t.coord&&t.coord[i]:t.value}function gx(t,e,n){if("average"!==n)return"median"===n?t.getMedian(e):t.getDataExtent(e,!0)["max"===n?1:0];var i=0,r=0;return t.each(e,function(t){isNaN(t)||(i+=t,r++)}),i/r}function mx(s,l,u){var c=l.coordinateSystem;s.each(function(t){var e,n=s.getItemModel(t),i=Vr(n.get("x"),u.getWidth()),r=Vr(n.get("y"),u.getHeight());if(isNaN(i)||isNaN(r)){if(l.getMarkerPosition)e=l.getMarkerPosition(s.getValues(s.dimensions,t));else if(c){var o=s.get(c.dimensions[0],t),a=s.get(c.dimensions[1],t);e=c.dataToPoint([o,a])}}else e=[i,r];isNaN(i)||(e[0]=i),isNaN(r)||(e[1]=r),s.setItemLayout(t,e)})}function vx(t,e,n){var i;i=t?A(t&&t.dimensions,function(t){return D({name:t},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{})}):[{name:"value",type:"float"}];var r=new hD(i,n),o=A(n.get("data"),y(cx,e));return t&&(o=f(o,y(fx,t))),r.initData(o,null,t?px:function(t){return t.value}),r}function yx(t){return!isNaN(t)&&!isFinite(t)}function xx(t,e,n,i){var r=1-t,o=i.dimensions[t];return yx(e[r])&&yx(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function bx(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(xx(1,n,i,t)||xx(0,n,i,t)))return!0}return fx(t,e[0])&&fx(t,e[1])}function _x(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Vr(s.get("x"),r.getWidth()),u=Vr(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var c=a.dimensions,h=t.get(c[0],e),d=t.get(c[1],e);o=a.dataToPoint([h,d])}if("cartesian2d"===a.type){var f=a.getAxis("x"),p=a.getAxis("y");c=a.dimensions;yx(t.get(c[0],e))?o[0]=f.toGlobalCoord(f.getExtent()[n?0:1]):yx(t.get(c[1],e))&&(o[1]=p.toGlobalCoord(p.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}function Sx(t,e,n){var i;i=t?A(t&&t.dimensions,function(t){return D({name:t},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{})}):[{name:"value",type:"float"}];var r=new hD(i,n),o=new hD(i,n),a=new hD([],n),s=A(n.get("data"),y(wN,e,t,n));t&&(s=f(s,y(bx,t)));var l=t?px:function(t){return t.value};return r.initData(A(s,function(t){return t[0]}),null,l),o.initData(A(s,function(t){return t[1]}),null,l),a.initData(A(s,function(t){return t[2]})),a.hasItemOption=!0,{from:r,to:o,line:a}}function Cx(t){return!isNaN(t)&&!isFinite(t)}function Tx(t,e,n){var i=1-t;return Cx(e[i])&&Cx(n[i])}function Ax(t,e){var n=e.coord[0],i=e.coord[1];return!("cartesian2d"!==t.type||!n||!i||!Tx(1,n,i,t)&&!Tx(0,n,i,t))||(fx(t,{coord:n,x:e.x0,y:e.y0})||fx(t,{coord:i,x:e.x1,y:e.y1}))}function Dx(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Vr(s.get(n[0]),r.getWidth()),u=Vr(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(n,e));else{var c=[f=t.get(n[0],e),p=t.get(n[1],e)];a.clampData&&a.clampData(c,c),o=a.dataToPoint(c,!0)}if("cartesian2d"===a.type){var h=a.getAxis("x"),d=a.getAxis("y"),f=t.get(n[0],e),p=t.get(n[1],e);Cx(f)?o[0]=h.toGlobalCoord(h.getExtent()["x0"===n[0]?0:1]):Cx(p)&&(o[1]=d.toGlobalCoord(d.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}function Mx(t,n,e){var i,r,o=["x0","y0","x1","y1"];t?(i=A(t&&t.dimensions,function(t){var e=n.getData();return D({name:t},e.getDimensionInfo(e.mapDimension(t))||{})}),r=new hD(A(o,function(t,e){return{name:t,type:i[e%2].type}}),e)):r=new hD(i=[{name:"value",type:"float"}],e);var a=A(e.get("data"),y(_N,n,t,e));t&&(a=f(a,y(Ax,t)));var s=t?function(t,e,n,i){return t.coord[Math.floor(i/2)][i%2]}:function(t){return t.value};return r.initData(a,null,s),r.hasItemOption=!0,r}function Ix(t){var e=t.type,n={number:"value",time:"time"};if(n[e]&&(t.axisType=n[e],delete t.type),kx(t),Ex(t,"controlPosition")){var i=t.controlStyle||(t.controlStyle={});Ex(i,"position")||(i.position=t.controlPosition),"none"!==i.position||Ex(i,"show")||(i.show=!1,delete i.position),delete t.controlPosition}k(t.data||[],function(t){b(t)&&!E(t)&&(!Ex(t,"value")&&Ex(t,"name")&&(t.value=t.name),kx(t))})}function kx(t){var e=t.itemStyle||(t.itemStyle={}),n=e.emphasis||(e.emphasis={}),i=t.label||t.label||{},r=i.normal||(i.normal={}),o={normal:1,emphasis:1};k(i,function(t,e){o[e]||Ex(r,e)||(r[e]=t)}),n.label&&!Ex(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function Ex(t,e){return t.hasOwnProperty(e)}function Lx(t,e){return po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}function Ox(t,e,n,i){return Gi(t.get(e).replace(/^path:\/\//,""),L(i||{}),new ie(n[0],n[1],n[2],n[3]),"center")}function Px(t,e,n,i,r,o){var a=e.get("color");r?(r.setColor(a),n.add(r),o&&o.onUpdate(r)):((r=Ql(t.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(r),o&&o.onCreate(r));var s=e.getItemStyle(["color","symbol","symbolSize"]);r.setStyle(s),i=g({rectHover:!0,z2:100},i,!0);var l=t.get("symbolSize");(l=l instanceof Array?l.slice():[+l,+l])[0]/=2,l[1]/=2,i.scale=l;var u=t.get("symbolOffset");if(u){var c=i.position=i.position||[0,0];c[0]+=Vr(u[0],l[0]),c[1]+=Vr(u[1],l[1])}var h=t.get("symbolRotate");return i.rotation=(h||0)*Math.PI/180||0,r.attr(i),r.updateTransform(),r}function Nx(t,e,n,i,r){if(!t.dragging){var o=i.getModel("checkpointStyle"),a=n.dataToCoord(i.getData().get(["value"],e));r||!o.get("animation",!0)?t.attr({position:[a,0]}):(t.stopAnimation(!0),t.animateTo({position:[a,0]},o.get("animationDuration",!0),o.get("animationEasing",!0)))}}function Rx(t){return 0===t.indexOf("my")}function Fx(t){this.model=t}function zx(t){this.model=t}function Hx(t){var r={},o=[],a=[];return t.eachRawSeries(function(t){var e=t.coordinateSystem;if(!e||"cartesian2d"!==e.type&&"polar"!==e.type)o.push(t);else{var n=e.getBaseAxis();if("category"===n.type){var i=n.dim+"_"+n.index;r[i]||(r[i]={categoryAxis:n,valueAxis:e.getOtherAxis(n),series:[]},a.push({axisDim:n.dim,axisIndex:n.index})),r[i].series.push(t)}else o.push(t)}}),{seriesGroupByCategoryAxis:r,other:o,meta:a}}function Bx(t){var u=[];return k(t,function(t){var e=t.categoryAxis,n=t.valueAxis.dim,i=[" "].concat(A(t.series,function(t){return t.name})),r=[e.model.getCategories()];k(t.series,function(t){r.push(t.getRawData().mapArray(n,function(t){return t}))});for(var o=[i.join(HN)],a=0;a<r[0].length;a++){for(var s=[],l=0;l<r.length;l++)s.push(r[l][a]);o.push(s.join(HN))}u.push(o.join("\n"))}),u.join("\n\n"+zN+"\n\n")}function Vx(t){return A(t,function(t){var r=t.getRawData(),o=[t.name],a=[];return r.each(r.dimensions,function(){for(var t=arguments.length,e=arguments[t-1],n=r.getName(e),i=0;i<t-1;i++)a[i]=arguments[i];o.push((n?n+HN:"")+a.join(HN))}),o.join("\n")}).join("\n\n"+zN+"\n\n")}function jx(t){var e=Hx(t);return{value:f([Bx(e.seriesGroupByCategoryAxis),Vx(e.other)],function(t){return t.replace(/[\n\t\s]/g,"")}).join("\n\n"+zN+"\n\n"),meta:e.meta}}function Wx(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ux(t){if(0<=t.slice(0,t.indexOf("\n")).indexOf(HN))return!0}function $x(t){for(var e=t.split(/\n+/g),n=[],i=A(Wx(e.shift()).split(BN),function(t){return{name:t,data:[]}}),r=0;r<e.length;r++){var o=Wx(e[r]).split(BN);n.push(o.shift());for(var a=0;a<o.length;a++)i[a]&&(i[a].data[r]=o[a])}return{series:i,categories:n}}function qx(t){for(var e=t.split(/\n+/g),n=Wx(e.shift()),i=[],r=0;r<e.length;r++){var o,a=Wx(e[r]).split(BN),s="",l=!1;isNaN(a[0])?(l=!0,s=a[0],a=a.slice(1),i[r]={name:s,value:[]},o=i[r].value):o=i[r]=[];for(var u=0;u<a.length;u++)o.push(+a[u]);1===o.length&&(l?i[r].value=o[0]:i[r]=o[0])}return{name:n,data:i}}function Gx(t,o){var e=t.split(new RegExp("\n*"+zN+"\n*","g")),a={series:[]};return k(e,function(t,e){if(Ux(t)){var n=$x(t),i=o[e],r=i.axisDim+"Axis";i&&(a[r]=a[r]||[],a[r][i.axisIndex]={data:n.categories},a.series=a.series.concat(n.series))}else{n=qx(t);a.series.push(n)}}),a}function Yx(t){this._dom=null,this.model=t}function Zx(t,i){return A(t,function(t,e){var n=i&&i[e];return b(n)&&!E(n)?(b(t)&&!E(t)&&(t=t.value),D({value:t},n)):t})}function Xx(o,t){var a=tb(o);VN(t,function(t,e){for(var n=a.length-1;0<=n;n--){if(a[n][e])break}if(n<0){var i=o.queryComponents({mainType:"dataZoom",subType:"select",id:e})[0];if(i){var r=i.getPercentRange();a[0][e]={dataZoomId:e,start:r[0],end:r[1]}}}}),a.push(t)}function Kx(t){var i=tb(t),e=i[i.length-1];1<i.length&&i.pop();var r={};return VN(e,function(t,e){for(var n=i.length-1;0<=n;n--){if(t=i[n][e]){r[e]=t;break}}}),r}function Qx(t){t[jN]=null}function Jx(t){return tb(t).length}function tb(t){var e=t[jN];return e||(e=t[jN]=[{}]),e}function eb(t,e,n){(this._brushController=new Of(n.getZr())).on("brush",v(this._onBrush,this)).mount(),this._isZoomActive}function nb(e){var n={};return k(["xAxisIndex","yAxisIndex"],function(t){n[t]=e[t],null==n[t]&&(n[t]="all"),(!1===n[t]||"none"===n[t])&&(n[t]=[])}),n}function ib(t,e){t.setIconStatus("back",1<Jx(e)?"emphasis":"normal")}function rb(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new ry(nb(t.option),e,{include:["grid"]});n._brushController.setPanels(a.makePanelOpts(r,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!o&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}function ob(t){this.model=t}function ab(t){return ZN(t)}function sb(){if(!QN&&JN){QN=!0;var t=JN.styleSheets;t.length<31?JN.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}function lb(t){return parseInt(t,10)}function ub(t,e){sb(),this.root=t,this.storage=e;var n=document.createElement("div"),i=document.createElement("div");n.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",i.style.cssText="position:absolute;left:0;top:0;",t.appendChild(n),this._vmlRoot=i,this._vmlViewport=n,this.resize();var r=e.delFromStorage,o=e.addToStorage;e.delFromStorage=function(t){r.call(e,t),t&&t.onRemove&&t.onRemove(i)},e.addToStorage=function(t){t.onAdd&&t.onAdd(i),o.call(e,t)},this._firstPaint=!0}function cb(t){return function(){Bw('In IE8.0 VML mode painter not support method "'+t+'"')}}function hb(t){return document.createElementNS(jR,t)}function db(t){return qR(1e4*t)/1e4}function fb(t){return t<QR&&-QR<t}function pb(t,e){var n=e?t.textFill:t.fill;return null!=n&&n!==$R}function gb(t,e){var n=e?t.textStroke:t.stroke;return null!=n&&n!==$R}function mb(t,e){e&&vb(t,"transform","matrix("+UR.call(e,",")+")")}function vb(t,e,n){(!n||"linear"!==n.type&&"radial"!==n.type)&&("string"==typeof n&&-1<n.indexOf("NaN")&&console.log(n),t.setAttribute(e,n))}function yb(t,e,n){t.setAttributeNS("http://www.w3.org/1999/xlink",e,n)}function xb(t,e,n){if(pb(e,n)){var i=n?e.textFill:e.fill;i="transparent"===i?$R:i,"none"!==t.getAttribute("clip-path")&&i===$R&&(i="rgba(0, 0, 0, 0.002)"),vb(t,"fill",i),vb(t,"fill-opacity",e.opacity)}else vb(t,"fill",$R);if(gb(e,n)){var r=n?e.textStroke:e.stroke;vb(t,"stroke",r="transparent"===r?$R:r),vb(t,"stroke-width",(n?e.textStrokeWidth:e.lineWidth)/(!n&&e.strokeNoScale?e.host.getLineScale():1)),vb(t,"paint-order",n?"stroke":"fill"),vb(t,"stroke-opacity",e.opacity),e.lineDash?(vb(t,"stroke-dasharray",e.lineDash.join(",")),vb(t,"stroke-dashoffset",qR(e.lineDashOffset||0))):vb(t,"stroke-dasharray",""),e.lineCap&&vb(t,"stroke-linecap",e.lineCap),e.lineJoin&&vb(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&vb(t,"stroke-miterlimit",e.miterLimit)}else vb(t,"stroke",$R)}function bb(t){for(var e=[],n=t.data,i=t.len(),r=0;r<i;){var o="",a=0;switch(n[r++]){case WR.M:o="M",a=2;break;case WR.L:o="L",a=2;break;case WR.Q:o="Q",a=4;break;case WR.C:o="C",a=6;break;case WR.A:var s=n[r++],l=n[r++],u=n[r++],c=n[r++],h=n[r++],d=n[r++],f=n[r++],p=n[r++],g=Math.abs(d),m=fb(g-XR)&&!fb(g),v=!1;v=XR<=g||!fb(g)&&(-ZR<d&&d<0||ZR<d)==!!p;var y=db(s+u*YR(h)),x=db(l+c*GR(h));m&&(d=p?XR-1e-4:1e-4-XR,v=!0,9===r&&e.push("M",y,x));var b=db(s+u*YR(h+d)),w=db(l+c*GR(h+d));e.push("A",db(u),db(c),qR(f*KR),+v,+p,b,w);break;case WR.Z:o="Z";break;case WR.R:b=db(n[r++]),w=db(n[r++]);var _=db(n[r++]),S=db(n[r++]);e.push("M",b,w,"L",b+_,w,"L",b+_,w+S,"L",b,w+S,"L",b,w)}o&&e.push(o);for(var C=0;C<a;C++)e.push(db(n[r++]))}return e.join(" ")}function wb(t){return"middle"===t?"middle":"bottom"===t?"baseline":"hanging"}function _b(){}function Sb(t,e){for(var n=0,i=e.length,r=0,o=0;n<i;n++){var a=e[n];if(a.removed){for(s=[],l=o;l<o+a.count;l++)s.push(l);a.indices=s,o+=a.count}else{for(var s=[],l=r;l<r+a.count;l++)s.push(l);a.indices=s,r+=a.count,a.added||(o+=a.count)}}return e}function Cb(t){return{newPos:t.newPos,components:t.components.slice(0)}}function Tb(t,e,n,i,r){this._zrId=t,this._svgRoot=e,this._tagNames="string"==typeof n?[n]:n,this._markLabel=i,this._domName=r||"_dom",this.nextId=0}function Ab(t,e){Tb.call(this,t,e,["linearGradient","radialGradient"],"__gradient_in_use__")}function Db(t,e){Tb.call(this,t,e,"clipPath","__clippath_in_use__")}function Mb(t,e){Tb.call(this,t,e,["filter"],"__filter_in_use__","_shadowDom")}function Ib(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY||t.textShadowBlur||t.textShadowOffsetX||t.textShadowOffsetY)}function kb(t){return parseInt(t,10)}function Eb(t){return t instanceof Pi?JR:t instanceof an?tF:t instanceof lC?eF:JR}function Lb(t,e){return e&&t&&e.parentNode!==t}function Ob(t,e,n){if(Lb(t,e)&&n){var i=n.nextSibling;i?t.insertBefore(e,i):t.appendChild(e)}}function Pb(t,e){if(Lb(t,e)){var n=t.firstChild;n?t.insertBefore(e,n):t.appendChild(e)}}function Nb(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function Rb(t){
|
|
return t.__textSvgEl}function Fb(t){return t.__svgEl}function zb(t){return function(){Bw('In SVG mode painter not support method "'+t+'"')}}var Hb;"undefined"!=typeof window?Hb=window.__DEV__:"undefined"!=typeof global&&(Hb=global.__DEV__),void 0===Hb&&(Hb=!0);var Bb,Vb=Hb,jb=2311,Wb=function(){return jb++},Ub="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0}:e(navigator.userAgent),$b={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},qb={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},Gb=Object.prototype.toString,Yb=Array.prototype,Zb=Yb.forEach,Xb=Yb.filter,Kb=Yb.slice,Qb=Yb.map,Jb=Yb.reduce,tw={},ew=function(){return tw.createCanvas()};tw.createCanvas=function(){return document.createElement("canvas")};var nw="__ec_primitive__";I.prototype={constructor:I,get:function(t){return this.hasOwnProperty(t)?this[t]:null},set:function(t,e){return this[t]=e},each:function(t,e){for(var n in void 0!==e&&(t=v(t,e)),this)this.hasOwnProperty(n)&&t(this[n],n)},removeKey:function(t){delete this[t]}};var iw=(Object.freeze||Object)({$override:n,clone:L,merge:g,mergeAll:c,extend:O,defaults:D,createCanvas:ew,getContext:i,indexOf:x,inherits:o,mixin:r,isArrayLike:P,each:k,map:A,reduce:p,filter:f,find:a,bind:v,curry:y,isArray:E,isFunction:m,isString:w,isObject:b,isBuiltInObject:s,isTypedArray:_,isDom:S,eqNaN:C,retrieve:N,retrieve2:R,retrieve3:F,slice:l,normalizeCssArray:u,assert:T,trim:h,setAsPrimitive:d,isPrimitive:M,createHashMap:z,concatArray:H,noop:B}),rw="undefined"==typeof Float32Array?Array:Float32Array,ow=Y,aw=Z,sw=et,lw=nt,uw=(Object.freeze||Object)({create:V,copy:j,clone:W,set:U,add:$,scaleAndAdd:q,sub:G,len:Y,length:ow,lenSquare:Z,lengthSquare:aw,mul:X,div:K,dot:Q,scale:J,normalize:tt,distance:et,dist:sw,distanceSquare:nt,distSquare:lw,negate:it,lerp:rt,applyTransform:ot,min:at,max:st});lt.prototype={constructor:lt,_dragStart:function(t){var e=t.target;e&&e.draggable&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(ut(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var n=t.offsetX,i=t.offsetY,r=n-this._x,o=i-this._y;this._x=n,this._y=i,e.drift(r,o,t),this.dispatchToElement(ut(e,t),"drag",t.event);var a=this.findHover(n,i,e).target,s=this._dropTarget;e!==(this._dropTarget=a)&&(s&&a!==s&&this.dispatchToElement(ut(s,t),"dragleave",t.event),a&&a!==s&&this.dispatchToElement(ut(a,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(ut(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(ut(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var cw=Array.prototype.slice,hw=function(){this._$handlers={}};hw.prototype={constructor:hw,one:function(t,e,n){var i=this._$handlers;if(!e||!t)return this;i[t]||(i[t]=[]);for(var r=0;r<i[t].length;r++)if(i[t][r].h===e)return this;return i[t].push({h:e,one:!0,ctx:n||this}),this},on:function(t,e,n){var i=this._$handlers;if(!e||!t)return this;i[t]||(i[t]=[]);for(var r=0;r<i[t].length;r++)if(i[t][r].h===e)return this;return i[t].push({h:e,one:!1,ctx:n||this}),this},isSilent:function(t){var e=this._$handlers;return e[t]&&e[t].length},off:function(t,e){var n=this._$handlers;if(!t)return this._$handlers={},this;if(e){if(n[t]){for(var i=[],r=0,o=n[t].length;r<o;r++)n[t][r].h!=e&&i.push(n[t][r]);n[t]=i}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},trigger:function(t){if(this._$handlers[t]){var e=arguments,n=e.length;3<n&&(e=cw.call(e,1));for(var i=this._$handlers[t],r=i.length,o=0;o<r;){switch(n){case 1:i[o].h.call(i[o].ctx);break;case 2:i[o].h.call(i[o].ctx,e[1]);break;case 3:i[o].h.call(i[o].ctx,e[1],e[2]);break;default:i[o].h.apply(i[o].ctx,e)}i[o].one?(i.splice(o,1),r--):o++}}return this},triggerWithContext:function(t){if(this._$handlers[t]){var e=arguments,n=e.length;4<n&&(e=cw.call(e,1,e.length-1));for(var i=e[e.length-1],r=this._$handlers[t],o=r.length,a=0;a<o;){switch(n){case 1:r[a].h.call(i);break;case 2:r[a].h.call(i,e[1]);break;case 3:r[a].h.call(i,e[1],e[2]);break;default:r[a].h.apply(i,e)}r[a].one?(r.splice(a,1),o--):a++}}return this}};var dw="silent";ht.prototype.dispose=function(){};var fw=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pw=function(t,e,n,i){hw.call(this),this.storage=t,this.painter=e,this.painterRoot=i,n=n||new ht,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,lt.call(this),this.setHandlerProxy(n)};pw.prototype={constructor:pw,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(k(fw,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,n=t.zrY,i=this._hovered,r=i.target;r&&!r.__zr&&(r=(i=this.findHover(i.x,i.y)).target);var o=this._hovered=this.findHover(e,n),a=o.target,s=this.proxy;s.setCursor&&s.setCursor(a?a.cursor:"default"),r&&a!==r&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(o,"mousemove",t),a&&a!==r&&this.dispatchToElement(o,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);for(var e,n=t.toElement||t.relatedTarget;(n=n&&n.parentNode)&&9!=n.nodeType&&!(e=n===this.painterRoot););!e&&this.trigger("globalout",{event:t})},resize:function(){this._hovered={}},dispatch:function(t,e){var n=this[t];n&&n.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,o=ct(e,t,n);i&&(i[r]&&(o.cancelBubble=i[r].call(i,o)),i.trigger(e,o),i=i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)}))}},findHover:function(t,e,n){for(var i=this.storage.getDisplayList(),r={x:t,y:e},o=i.length-1;0<=o;o--){var a;if(i[o]!==n&&!i[o].ignore&&(a=dt(i[o],t,e))&&(!r.topTarget&&(r.topTarget=i[o]),a!==dw)){r.target=i[o];break}}return r}},k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(i){pw.prototype[i]=function(t){var e=this.findHover(t.zrX,t.zrY),n=e.target;if("mousedown"===i)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===i)this._upEl=n;else if("click"===i){if(this._downEl!==this._upEl||!this._downPoint||4<sw(this._downPoint,[t.zrX,t.zrY]))return;this._downPoint=null}this.dispatchToElement(e,i,t)}}),r(pw,hw),r(pw,lt);var gw="undefined"==typeof Float32Array?Array:Float32Array,mw=(Object.freeze||Object)({create:ft,identity:pt,copy:gt,mul:mt,translate:vt,rotate:yt,scale:xt,invert:bt,clone:wt}),vw=pt,yw=5e-5,xw=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},bw=xw.prototype;bw.transform=null,bw.needLocalTransform=function(){return _t(this.rotation)||_t(this.position[0])||_t(this.position[1])||_t(this.scale[0]-1)||_t(this.scale[1]-1)},bw.updateTransform=function(){var t=this.parent,e=t&&t.transform,n=this.needLocalTransform(),i=this.transform;n||e?(i=i||ft(),n?this.getLocalTransform(i):vw(i),e&&(n?mt(i,t.transform,i):gt(i,t.transform)),this.transform=i,this.invTransform=this.invTransform||ft(),bt(this.invTransform,i)):i&&vw(i)},bw.getLocalTransform=function(t){return xw.getLocalTransform(this,t)},bw.setTransform=function(t){var e=this.transform,n=t.dpr||1;e?t.setTransform(n*e[0],n*e[1],n*e[2],n*e[3],n*e[4],n*e[5]):t.setTransform(n,0,0,n,0,0)},bw.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var ww=[];bw.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(mt(ww,t.invTransform,e),e=ww);var n=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],r=this.position,o=this.scale;_t(n-1)&&(n=Math.sqrt(n)),_t(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(n=-n),e[3]<0&&(i=-i),r[0]=e[4],r[1]=e[5],o[0]=n,o[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/n)}},bw.getGlobalScale=function(){var t=this.transform;if(!t)return[1,1];var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),n=Math.sqrt(t[2]*t[2]+t[3]*t[3]);return t[0]<0&&(e=-e),t[3]<0&&(n=-n),[e,n]},bw.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&ot(n,n,i),n},bw.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&ot(n,n,i),n},xw.getLocalTransform=function(t,e){vw(e=e||[]);var n=t.origin,i=t.scale||[1,1],r=t.rotation||0,o=t.position||[0,0];return n&&(e[4]-=n[0],e[5]-=n[1]),xt(e,e,i),r&&yt(e,e,r),n&&(e[4]+=n[0],e[5]+=n[1]),e[4]+=o[0],e[5]+=o[1],e};var _w={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},elasticOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-_w.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*_w.bounceIn(2*t):.5*_w.bounceOut(2*t-1)+.5}};St.prototype={constructor:St,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var n=(t-this._startTime-this._pausedTime)/this._life;if(!(n<0)){n=Math.min(n,1);var i=this.easing,r="string"==typeof i?_w[i]:i,o="function"==typeof r?r(n):n;return this.fire("frame",o),1==n?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Sw=function(){this.head=null,this.tail=null,this._len=0},Cw=Sw.prototype;Cw.insert=function(t){var e=new Tw(t);return this.insertEntry(e),e},Cw.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},Cw.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},Cw.len=function(){return this._len},Cw.clear=function(){this.head=this.tail=null,this._len=0};var Tw=function(t){this.value=t,this.next,this.prev},Aw=function(t){this._list=new Sw,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},Dw=Aw.prototype;Dw.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&0<o){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Tw(e),a.key=t,n.insertEntry(a),i[t]=a}return r},Dw.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},Dw.clear=function(){this._list.clear(),this._map={}};var Mw={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},Iw=new Aw(20),kw=null,Ew=Ht,Lw=Bt,Ow=(Object.freeze||Object)({parse:Pt,lift:Ft,toHex:zt,fastLerp:Ht,fastMapToColor:Ew,lerp:Bt,mapToColor:Lw,modifyHSL:Vt,modifyAlpha:jt,stringify:Wt}),Pw=Array.prototype.slice,Nw=function(t,e,n,i){this._tracks={},this._target=t,this._loop=e||!1,this._getter=n||Ut,this._setter=i||$t,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Nw.prototype={when:function(t,e){var n=this._tracks;for(var i in e)if(e.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==t&&n[i].push({time:0,value:Jt(r)})}n[i].push({time:t,value:e[i]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,n=0;n<e;n++)t[n].call(this)},start:function(t,e){var n,i=this,r=0,o=function(){--r||i._doneCallback()};for(var a in this._tracks)if(this._tracks.hasOwnProperty(a)){var s=ne(this,t,o,this._tracks[a],a,e);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),n=s)}if(n){var l=n.onframe;n.onframe=function(t,e){l(t,e);for(var n=0;n<i._onframeList.length;n++)i._onframeList[n](t,e)}}return r||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,n=this.animation,i=0;i<e.length;i++){var r=e[i];t&&r.onframe(this._target,1),n&&n.removeClip(r)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}};var Rw=1;"undefined"!=typeof window&&(Rw=Math.max(window.devicePixelRatio||1,1));var Fw=0,zw=Rw,Hw=function(){};1===Fw?Hw=function(){for(var t in arguments)throw new Error(arguments[t])}:1<Fw&&(Hw=function(){for(var t in arguments)console.log(arguments[t])});var Bw=Hw,Vw=function(){this.animators=[]};Vw.prototype={constructor:Vw,animate:function(t,e){var n,i=!1,r=this,o=this.__zr;if(t){var a=t.split("."),s=r;i="shape"===a[0];for(var l=0,u=a.length;l<u;l++)s&&(s=s[a[l]]);s&&(n=s)}else n=r;if(n){var c=r.animators,h=new Nw(n,e);return h.during(function(){r.dirty(i)}).done(function(){c.splice(x(c,h),1)}),c.push(h),o&&o.animation.addAnimator(h),h}Bw('Property "'+t+'" is not existed in element '+r.id)},stopAnimation:function(t){for(var e=this.animators,n=e.length,i=0;i<n;i++)e[i].stop(t);return e.length=0,this},animateTo:function(t,e,n,i,r,o){function a(){--l||r&&r()}w(n)?(r=i,i=n,n=0):m(i)?(r=i,i="linear",n=0):m(n)?(r=n,n=0):m(e)?(r=e,e=500):e||(e=500),this.stopAnimation(),this._animateToShallow("",this,t,e,n);var s=this.animators.slice(),l=s.length;l||r&&r();for(var u=0;u<s.length;u++)s[u].done(a).start(i,o)},_animateToShallow:function(t,e,n,i,r){var o={},a=0;for(var s in n)if(n.hasOwnProperty(s))if(null!=e[s])b(n[s])&&!P(n[s])?this._animateToShallow(t?t+"."+s:s,e[s],n[s],i,r):(o[s]=n[s],a++);else if(null!=n[s])if(t){var l={};l[t]={},l[t][s]=n[s],this.attr(l)}else this.attr(s,n[s]);return 0<a&&this.animate(t,!1).when(null==i?500:i,o).delay(r||0),this}};var jw=function(t){xw.call(this,t),hw.call(this,t),Vw.call(this,t),this.id=t.id||Wb()};jw.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var n=this[t];n||(n=this[t]=[]),n[0]=e[0],n[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(b(t))for(var n in t)t.hasOwnProperty(n)&&this.attrKV(n,t[n]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),(this.clipPath=t).__zr=e,(t.__clipTarget=this).dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.addAnimator(e[n]);this.clipPath&&this.clipPath.addSelfToZr(t)},removeSelfFromZr:function(t){this.__zr=null;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.removeAnimator(e[n]);this.clipPath&&this.clipPath.removeSelfFromZr(t)}},r(jw,Vw),r(jw,xw),r(jw,hw);var Ww,Uw,$w,qw,Gw=ot,Yw=Math.min,Zw=Math.max;ie.prototype={constructor:ie,union:function(t){var e=Yw(t.x,this.x),n=Yw(t.y,this.y);this.width=Zw(t.x+t.width,this.x+this.width)-e,this.height=Zw(t.y+t.height,this.y+this.height)-n,this.x=e,this.y=n},applyTransform:(Ww=[],Uw=[],$w=[],qw=[],function(t){if(t){Ww[0]=$w[0]=this.x,Ww[1]=qw[1]=this.y,Uw[0]=qw[0]=this.x+this.width,Uw[1]=$w[1]=this.y+this.height,Gw(Ww,Ww,t),Gw(Uw,Uw,t),Gw($w,$w,t),Gw(qw,qw,t),this.x=Yw(Ww[0],Uw[0],$w[0],qw[0]),this.y=Yw(Ww[1],Uw[1],$w[1],qw[1]);var e=Zw(Ww[0],Uw[0],$w[0],qw[0]),n=Zw(Ww[1],Uw[1],$w[1],qw[1]);this.width=e-this.x,this.height=n-this.y}}),calculateTransform:function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=ft();return vt(r,r,[-e.x,-e.y]),xt(r,r,[n,i]),vt(r,r,[t.x,t.y]),r},intersect:function(t){if(!t)return!1;t instanceof ie||(t=ie.create(t));var e=this,n=e.x,i=e.x+e.width,r=e.y,o=e.y+e.height,a=t.x,s=t.x+t.width,l=t.y,u=t.y+t.height;return!(i<a||s<n||o<l||u<r)},contain:function(t,e){var n=this;return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},clone:function(){return new ie(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},ie.create=function(t){return new ie(t.x,t.y,t.width,t.height)};var Xw=function(t){for(var e in t=t||{},jw.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Xw.prototype={constructor:Xw,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},childCount:function(){return this._children.length},add:function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},addBefore:function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var n=this._children,i=n.indexOf(e);0<=i&&(n.splice(i,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t);var e=(t.parent=this).__storage,n=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof Xw&&t.addChildrenToStorage(e)),n&&n.refresh()},remove:function(t){var e=this.__zr,n=this.__storage,i=this._children,r=x(i,t);return r<0||(i.splice(r,1),t.parent=null,n&&(n.delFromStorage(t),t instanceof Xw&&t.delChildrenFromStorage(n)),e&&e.refresh()),this},removeAll:function(){var t,e,n=this._children,i=this.__storage;for(e=0;e<n.length;e++)t=n[e],i&&(i.delFromStorage(t),t instanceof Xw&&t.delChildrenFromStorage(i)),t.parent=null;return n.length=0,this},eachChild:function(t,e){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];t.call(e,r,i)}return this},traverse:function(t,e){for(var n=0;n<this._children.length;n++){var i=this._children[n];t.call(e,i),"group"===i.type&&i.traverse(t,e)}return this},addChildrenToStorage:function(t){for(var e=0;e<this._children.length;e++){var n=this._children[e];t.addToStorage(n),n instanceof Xw&&n.addChildrenToStorage(t)}},delChildrenFromStorage:function(t){for(var e=0;e<this._children.length;e++){var n=this._children[e];t.delFromStorage(n),n instanceof Xw&&n.delChildrenFromStorage(t)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(t){for(var e=null,n=new ie(0,0,0,0),i=t||this._children,r=[],o=0;o<i.length;o++){var a=i[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(r);l?(n.copy(s),n.applyTransform(l),(e=e||n.clone()).union(n)):(e=e||s.clone()).union(s)}}return e||n}},o(Xw,jw);var Kw=32,Qw=7,Jw=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Jw.prototype={constructor:Jw,traverse:function(t,e){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(t,e)},getDisplayList:function(t,e){return e=e||!1,t&&this.updateDisplayList(e),this._displayList},updateDisplayList:function(t){this._displayListLen=0;for(var e=this._roots,n=this._displayList,i=0,r=e.length;i<r;i++)this._updateAndAddDisplayable(e[i],null,t);n.length=this._displayListLen,Ub.canvasSupported&&he(n,de)},_updateAndAddDisplayable:function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var i=t.clipPath;if(i){e=e?e.slice():[];for(var r=i,o=t;r;)r.parent=o,r.updateTransform(),e.push(r),r=(o=r).clipPath}if(t.isGroup){for(var a=t._children,s=0;s<a.length;s++){var l=a[s];t.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,e,n)}t.__dirty=!1}else t.__clipPaths=e,this._displayList[this._displayListLen++]=t}},addRoot:function(t){t.__storage!==this&&(t instanceof Xw&&t.addChildrenToStorage(this),this.addToStorage(t),this._roots.push(t))},delRoot:function(t){if(null==t){for(var e=0;e<this._roots.length;e++){var n=this._roots[e];n instanceof Xw&&n.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(t instanceof Array){e=0;for(var i=t.length;e<i;e++)this.delRoot(t[e])}else{var r=x(this._roots,t);0<=r&&(this.delFromStorage(t),this._roots.splice(r,1),t instanceof Xw&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:de};var t_={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},e_=function(t,e,n){return t_.hasOwnProperty(e)?n*t.dpr:n},n_=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],i_=function(t,e){this.extendFrom(t,!1),this.host=e};i_.prototype={constructor:i_,host:null,fill:"#000",stroke:null,opacity:1,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,n){for(var i=this,r=n&&n.style,o=!r,a=0;a<n_.length;a++){var s=n_[a],l=s[0];(o||i[l]!==r[l])&&(t[l]=e_(t,l,i[l]||s[1]))}if((o||i.fill!==r.fill)&&(t.fillStyle=i.fill),(o||i.stroke!==r.stroke)&&(t.strokeStyle=i.stroke),(o||i.opacity!==r.opacity)&&(t.globalAlpha=null==i.opacity?1:i.opacity),(o||i.blend!==r.blend)&&(t.globalCompositeOperation=i.blend||"source-over"),this.hasStroke()){var u=i.lineWidth;t.lineWidth=u/(this.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1)}},hasFill:function(){var t=this.fill;return null!=t&&"none"!==t},hasStroke:function(){var t=this.stroke;return null!=t&&"none"!==t&&0<this.lineWidth},extendFrom:function(t,e){if(t)for(var n in t)!t.hasOwnProperty(n)||!0!==e&&(!1===e?this.hasOwnProperty(n):null==t[n])||(this[n]=t[n])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,n){for(var i=("radial"===e.type?pe:fe)(t,e,n),r=e.colorStops,o=0;o<r.length;o++)i.addColorStop(r[o].offset,r[o].color);return i}};for(var r_=i_.prototype,o_=0;o_<n_.length;o_++){var a_=n_[o_];a_[0]in r_||(r_[a_[0]]=a_[1])}i_.getGradient=r_.getGradient;var s_=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};s_.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")};var l_=function(t,e,n){var i;n=n||zw,"string"==typeof t?i=me(t,e,n):b(t)&&(t=(i=t).id),this.id=t;var r=(this.dom=i).style;r&&(i.onselectstart=ge,r["-webkit-user-select"]="none",r["user-select"]="none",r["-webkit-touch-callout"]="none",r["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",r.padding=0,r.margin=0,r["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=e,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=n};l_.prototype={constructor:l_,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var t=this.dpr;this.domBack=me("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!=t&&this.ctxBack.scale(t,t)},resize:function(t,e){var n=this.dpr,i=this.dom,r=i.style,o=this.domBack;r&&(r.width=t+"px",r.height=e+"px"),i.width=t*n,i.height=e*n,o&&(o.width=t*n,o.height=e*n,1!=n&&this.ctxBack.scale(n,n))},clear:function(t,e){var n,i=this.dom,r=this.ctx,o=i.width,a=i.height,s=(e=e||this.clearColor,this.motionBlur&&!t),l=this.lastFrameAlpha,u=this.dpr;(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,o/u,a/u)),r.clearRect(0,0,o,a),e&&"transparent"!==e)&&(e.colorStops?(n=e.__canvasGradient||i_.getGradient(r,e,{x:0,y:0,width:o,height:a}),e.__canvasGradient=n):e.image&&(n=s_.prototype.getCanvasPattern.call(e,r)),r.save(),r.fillStyle=n||e,r.fillRect(0,0,o,a),r.restore());if(s){var c=this.domBack;r.save(),r.globalAlpha=l,r.drawImage(c,0,0,o,a),r.restore()}}};var u_="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)},c_=new Aw(50),h_={},d_=0,f_=5e3,p_=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,g_="12px sans-serif",m_={measureText:function(t,e){var n=i();return n.font=e||g_,n.measureText(t)}},v_={left:1,right:1,center:1},y_={top:1,bottom:1,middle:1},x_=new ie,b_=function(){};b_.prototype={constructor:b_,drawRectText:function(t,e){var n=this.style;e=n.textRect||e,this.__dirty&&Be(n,!0);var i=n.text;if(null!=i&&(i+=""),rn(i,n)){t.save();var r=this.transform;n.transformText?this.setTransform(t):r&&(x_.copy(e),x_.applyTransform(r),e=x_),je(this,t,i,n,e),t.restore()}}},on.prototype={constructor:on,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,inplace:!1,
|
|
beforeBrush:function(){},afterBrush:function(){},brush:function(){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(n[0],n[1])},dirty:function(){this.__dirty=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?jw.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new i_(t,this),this.dirty(!1),this}},o(on,jw),r(on,b_),an.prototype={constructor:an,type:"image",brush:function(t,e){var n=this.style,i=n.image;n.bind(t,this,e);var r=this._image=ye(i,this._image,this,this.onload);if(r&&be(r)){var o=n.x||0,a=n.y||0,s=n.width,l=n.height,u=r.width/r.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=r.width,l=r.height),this.setTransform(t),n.sWidth&&n.sHeight){var c=n.sx||0,h=n.sy||0;t.drawImage(r,c,h,n.sWidth,n.sHeight,o,a,s,l)}else if(n.sx&&n.sy){var d=s-(c=n.sx),f=l-(h=n.sy);t.drawImage(r,c,h,d,f,o,a,s,l)}else t.drawImage(r,o,a,s,l);null!=n.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new ie(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},o(an,on);var w_=1e5,__=314159,S_=.01,C_=.001,T_=new ie(0,0,0,0),A_=new ie(0,0,0,0),D_=function(t,e,n){this.type="canvas";var i=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=n=O({},n||{}),this.dpr=n.devicePixelRatio||zw,this._singleCanvas=i;var r=(this.root=t).style;r&&(r["-webkit-tap-highlight-color"]="transparent",r["-webkit-user-select"]=r["user-select"]=r["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var o=this._zlevelList=[],a=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,i){var s=t.width,l=t.height;null!=n.width&&(s=n.width),null!=n.height&&(l=n.height),this.dpr=n.devicePixelRatio||1,t.width=s*this.dpr,t.height=l*this.dpr,this._width=s,this._height=l;var u=new l_(t,this,this.dpr);u.__builtin__=!0,u.initContext(),(a[__]=u).zlevel=__,o.push(__),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var c=this._domRoot=dn(this._width,this._height);t.appendChild(c)}this._hoverlayer=null,this._hoverElements=[]};D_.prototype={constructor:D_,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(t){var e=this.storage.getDisplayList(!0),n=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,this._redrawId);for(var i=0;i<n.length;i++){var r=n[i],o=this._layers[r];if(!o.__builtin__&&o.refresh){var a=0===i?this._backgroundColor:null;o.refresh(a)}}return this.refreshHover(),this},addHover:function(t,e){if(!t.__hoverMir){var n=new t.constructor({style:t.style,shape:t.shape});((n.__from=t).__hoverMir=n).setStyle(e),this._hoverElements.push(n)}},removeHover:function(t){var e=t.__hoverMir,n=this._hoverElements,i=x(n,e);0<=i&&n.splice(i,1),t.__hoverMir=null},clearHover:function(){for(var t=this._hoverElements,e=0;e<t.length;e++){var n=t[e].__from;n&&(n.__hoverMir=null)}t.length=0},refreshHover:function(){var t=this._hoverElements,e=t.length,n=this._hoverlayer;if(n&&n.clear(),e){he(t,this.storage.displayableSortFunc),n||(n=this._hoverlayer=this.getLayer(w_));var i={};n.ctx.save();for(var r=0;r<e;){var o=t[r],a=o.__from;a&&a.__zr?(r++,a.invisible||(o.transform=a.transform,o.invTransform=a.invTransform,o.__clipPaths=a.__clipPaths,this._doPaintEl(o,n,!0,i))):(t.splice(r,1),a.__hoverMir=null,e--)}n.ctx.restore()}},getHoverLayer:function(){return this.getLayer(w_)},_paintList:function(t,e,n){if(this._redrawId===n){e=e||!1,this._updateLayerStatus(t);var i=this._doPaintList(t,e);if(this._needsManuallyCompositing&&this._compositeManually(),!i){var r=this;u_(function(){r._paintList(t,e,n)})}}},_compositeManually:function(){var e=this.getLayer(__).ctx,n=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,n,i),this.eachBuiltinLayer(function(t){t.virtual&&e.drawImage(t.dom,0,0,n,i)})},_doPaintList:function(t,e){for(var n=[],i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];(s=this._layers[r]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||e)&&n.push(s)}for(var o=!0,a=0;a<n.length;a++){var s,l=(s=n[a]).ctx,u={};l.save();var c=e?s.__startIndex:s.__drawIndex,h=!e&&s.incremental&&Date.now,d=h&&Date.now(),f=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,f);else if(c===s.__startIndex){var p=t[c];p.incremental&&p.notClear&&!e||s.clear(!1,f)}-1===c&&(console.error("For some unknown reason. drawIndex is -1"),c=s.__startIndex);for(var g=c;g<s.__endIndex;g++){var m=t[g];if(this._doPaintEl(m,s,e,u),m.__dirty=!1,h)if(15<Date.now()-d)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(o=!1),u.prevElClipPaths&&l.restore(),l.restore()}return Ub.wxa&&k(this._layers,function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()}),o},_doPaintEl:function(t,e,n,i){var r=e.ctx,o=t.transform;if((e.__dirty||n)&&!t.invisible&&0!==t.style.opacity&&(!o||o[0]||o[3])&&(!t.culling||!un(t,this._width,this._height))){var a=t.__clipPaths;i.prevElClipPaths&&!cn(a,i.prevElClipPaths)||(i.prevElClipPaths&&(e.ctx.restore(),i.prevElClipPaths=null,i.prevEl=null),a&&(r.save(),hn(a,r),i.prevElClipPaths=a)),t.beforeBrush&&t.beforeBrush(r),t.brush(r,i.prevEl||null),(i.prevEl=t).afterBrush&&t.afterBrush(r)}},getLayer:function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=__);var n=this._layers[t];return n||((n=new l_("zr_"+t,this,this.dpr)).zlevel=t,n.__builtin__=!0,this._layerConfig[t]&&g(n,this._layerConfig[t],!0),e&&(n.virtual=e),this.insertLayer(t,n),n.initContext()),n},insertLayer:function(t,e){var n=this._layers,i=this._zlevelList,r=i.length,o=null,a=-1,s=this._domRoot;if(n[t])Bw("ZLevel "+t+" has been used already");else if(ln(e)){if(0<r&&t>i[0]){for(a=0;a<r-1&&!(i[a]<t&&i[a+1]>t);a++);o=n[i[a]]}if(i.splice(a+1,0,t),!(n[t]=e).virtual)if(o){var l=o.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else Bw("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var n,i,r=this._zlevelList;for(i=0;i<r.length;i++)n=r[i],t.call(e,this._layers[n],n)},eachBuiltinLayer:function(t,e){var n,i,r,o=this._zlevelList;for(r=0;r<o.length;r++)i=o[r],(n=this._layers[i]).__builtin__&&t.call(e,n,i)},eachOtherLayer:function(t,e){var n,i,r,o=this._zlevelList;for(r=0;r<o.length;r++)i=o[r],(n=this._layers[i]).__builtin__||t.call(e,n,i)},getLayers:function(){return this._layers},_updateLayerStatus:function(t){function e(t){i&&(i.__endIndex!==t&&(i.__dirty=!0),i.__endIndex=t)}if(this.eachBuiltinLayer(function(t){t.__dirty=t.__used=!1}),this._singleCanvas)for(var n=1;n<t.length;n++){if((o=t[n]).zlevel!==t[n-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var i=null,r=0;for(n=0;n<t.length;n++){var o,a,s=(o=t[n]).zlevel;o.incremental?((a=this.getLayer(s+C_,this._needsManuallyCompositing)).incremental=!0,r=1):a=this.getLayer(s+(0<r?S_:0),this._needsManuallyCompositing),a.__builtin__||Bw("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==n&&(a.__dirty=!0),a.__startIndex=n,a.incremental?a.__drawIndex=-1:a.__drawIndex=n,e(n),i=a),o.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=n))}e(n),this.eachBuiltinLayer(function(t){!t.__used&&0<t.getElementCount()&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var n=this._layerConfig;n[t]?g(n[t],e,!0):n[t]=e;for(var i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];if(r===t||r===t+S_)g(this._layers[r],n[t],!0)}}},delLayer:function(t){var e=this._layers,n=this._zlevelList,i=e[t];i&&(i.dom.parentNode.removeChild(i.dom),delete e[t],n.splice(x(n,t),1))},resize:function(e,n){if(this._domRoot.style){var t=this._domRoot;t.style.display="none";var i=this._opts;if(null!=e&&(i.width=e),null!=n&&(i.height=n),e=this._getSize(0),n=this._getSize(1),t.style.display="",this._width!=e||n!=this._height){for(var r in t.style.width=e+"px",t.style.height=n+"px",this._layers)this._layers.hasOwnProperty(r)&&this._layers[r].resize(e,n);k(this._progressiveLayers,function(t){t.resize(e,n)}),this.refresh(!0)}this._width=e,this._height=n}else{if(null==e||null==n)return;this._width=e,this._height=n,this.getLayer(__).resize(e,n)}return this},clearLayer:function(t){var e=this._layers[t];e&&e.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[__].dom;var e=new l_("image",this,t.pixelRatio||this.dpr);if(e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor),t.pixelRatio<=this.dpr){this.refresh();var n=e.dom.width,i=e.dom.height,r=e.ctx;this.eachLayer(function(t){t.__builtin__?r.drawImage(t.dom,0,0,n,i):t.renderToCanvas&&(e.ctx.save(),t.renderToCanvas(e.ctx),e.ctx.restore())})}else for(var o={},a=this.storage.getDisplayList(!0),s=0;s<a.length;s++){var l=a[s];this._doPaintEl(l,e,!0,o)}return e.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,n=["width","height"][t],i=["clientWidth","clientHeight"][t],r=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[n]&&"auto"!==e[n])return parseFloat(e[n]);var a=this.root,s=document.defaultView.getComputedStyle(a);return(a[i]||sn(s[n])||sn(a.style[n]))-(sn(s[r])||0)-(sn(s[o])||0)|0},pathToImage:function(t,e){e=e||this.dpr;var n=document.createElement("canvas"),i=n.getContext("2d"),r=t.getBoundingRect(),o=t.style,a=o.shadowBlur*e,s=o.shadowOffsetX*e,l=o.shadowOffsetY*e,u=o.hasStroke()?o.lineWidth:0,c=Math.max(u/2,-s+a),h=Math.max(u/2,s+a),d=Math.max(u/2,-l+a),f=Math.max(u/2,l+a),p=r.width+c+h,g=r.height+d+f;n.width=p*e,n.height=g*e,i.scale(e,e),i.clearRect(0,0,p,g),i.dpr=e;var m={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[c-r.x,d-r.y],t.rotation=0,t.scale=[1,1],t.updateTransform(),t&&t.brush(i);var v=new an({style:{x:0,y:0,image:n}});return null!=m.position&&(v.position=t.position=m.position),null!=m.rotation&&(v.rotation=t.rotation=m.rotation),null!=m.scale&&(v.scale=t.scale=m.scale),v}};var M_="undefined"!=typeof window&&!!window.addEventListener,I_=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,k_=M_?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},E_=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,hw.call(this)};E_.prototype={constructor:E_,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),n=0;n<e.length;n++)this.addClip(e[n])},removeClip:function(t){var e=x(this._clips,t);0<=e&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),n=0;n<e.length;n++)this.removeClip(e[n]);t.animation=null},_update:function(){for(var t=(new Date).getTime()-this._pausedTime,e=t-this._time,n=this._clips,i=n.length,r=[],o=[],a=0;a<i;a++){var s=n[a],l=s.step(t,e);l&&(r.push(l),o.push(s))}for(a=0;a<i;)n[a]._needsRemove?(n[a]=n[i-1],n.pop(),i--):a++;i=r.length;for(a=0;a<i;a++)o[a].fire(r[a]);this._time=t,this.onframe(e),this.trigger("frame",e),this.stage.update&&this.stage.update()},_startLoop:function(){function t(){e._running&&(u_(t),!e._paused&&e._update())}var e=this;this._running=!0,u_(t)},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(t,e){var n=new Nw(t,(e=e||{}).loop,e.getter,e.setter);return this.addAnimator(n),n}},r(E_,hw);var L_=function(){this._track=[]};L_.prototype={constructor:L_,recognize:function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o<a;o++){var s=i[o],l=pn(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},_recognize:function(t){for(var e in O_)if(O_.hasOwnProperty(e)){var n=O_[e](this._track,t);if(n)return n}}};var O_={pinch:function(t,e){var n=t.length;if(n){var i=(t[n-1]||{}).points,r=(t[n-2]||{}).points||i;if(r&&1<r.length&&i&&1<i.length){var o=bn(i)/bn(r);!isFinite(o)&&(o=1),e.pinchScale=o;var a=wn(i);return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}},P_=300,N_=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],R_=["touchstart","touchend","touchmove"],F_={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},z_=A(N_,function(t){var e=t.replace("mouse","pointer");return F_[e]?e:t}),H_={mousemove:function(t){t=mn(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=mn(this.dom,t)).toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=mn(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,Sn(this,t,"start"),H_.mousemove.call(this,t),H_.mousedown.call(this,t),Cn(this)},touchmove:function(t){(t=mn(this.dom,t)).zrByTouch=!0,Sn(this,t,"change"),H_.mousemove.call(this,t),Cn(this)},touchend:function(t){(t=mn(this.dom,t)).zrByTouch=!0,Sn(this,t,"end"),H_.mouseup.call(this,t),+new Date-this._lastTouchMoment<P_&&H_.click.call(this,t),Cn(this)},pointerdown:function(t){H_.mousedown.call(this,t)},pointermove:function(t){Tn(t)||H_.mousemove.call(this,t)},pointerup:function(t){H_.mouseup.call(this,t)},pointerout:function(t){Tn(t)||H_.mouseout.call(this,t)}};k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){H_[e]=function(t){t=mn(this.dom,t),this.trigger(e,t)}});var B_=Dn.prototype;B_.dispose=function(){for(var t=N_.concat(R_),e=0;e<t.length;e++){var n=t[e];yn(this.dom,_n(n),this._handlers[n])}},B_.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},r(Dn,hw);var V_=!Ub.canvasSupported,j_={canvas:D_},W_={},U_="4.0.4",$_=function(t,e,n){n=n||{},this.dom=e,this.id=t;var i=this,r=new Jw,o=n.renderer;if(V_){if(!j_.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");o="vml"}else o&&j_[o]||(o="canvas");var a=new j_[o](e,r,n,t);this.storage=r,this.painter=a;var s=Ub.node||Ub.worker?null:new Dn(a.getViewportRoot());this.handler=new pw(r,a,s,a.root),this.animation=new E_({stage:{update:v(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=r.delFromStorage,u=r.addToStorage;r.delFromStorage=function(t){l.call(r,t),t&&t.removeSelfFromZr(i)},r.addToStorage=function(t){u.call(r,t),t.addSelfToZr(i)}};$_.prototype={constructor:$_,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this._needsRefresh=!0},setBackgroundColor:function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var t;this._needsRefresh&&(t=!0,this.refreshImmediately()),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately()),t&&this.trigger("rendered")},addHover:function(t,e){this.painter.addHover&&(this.painter.addHover(t,e),this.refreshHover())},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,n){this.handler.on(t,e,n)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,Ln(this.id)}};var q_=(Object.freeze||Object)({version:U_,init:Mn,dispose:In,getInstance:kn,registerPainter:En}),G_=k,Y_=b,Z_=E,X_="series\0",K_=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"],Q_=0,J_=".",tS="___EC__COMPONENT__CONTAINER___",eS=0,nS=function(s){for(var t=0;t<s.length;t++)s[t][1]||(s[t][1]=s[t][0]);return function(t,e,n){for(var i={},r=0;r<s.length;r++){var o=s[r][1];if(!(e&&0<=x(e,o)||n&&x(n,o)<0)){var a=t.getShallow(o);null!=a&&(i[s[r][0]]=a)}}return i}},iS=nS([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),rS={getLineStyle:function(t){var e=iS(this,t),n=this.getLineDash(e.lineWidth);return n&&(e.lineDash=n),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),n=Math.max(t,2),i=4*t;return"solid"===e||null==e?null:"dashed"===e?[i,i]:[n,n]}},oS=nS([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),aS={getAreaStyle:function(t,e){return oS(this,t,e)}},sS=Math.pow,lS=Math.sqrt,uS=1e-8,cS=1e-4,hS=lS(3),dS=1/3,fS=V(),pS=V(),gS=V(),mS=Math.min,vS=Math.max,yS=Math.sin,xS=Math.cos,bS=2*Math.PI,wS=V(),_S=V(),SS=V(),CS=[],TS=[],AS={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},DS=[],MS=[],IS=[],kS=[],ES=Math.min,LS=Math.max,OS=Math.cos,PS=Math.sin,NS=Math.sqrt,RS=Math.abs,FS="undefined"!=typeof Float32Array,zS=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};zS.prototype={constructor:zS,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=RS(1/zw/t)||0,this._uy=RS(1/zw/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return(this._ctx=t)&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(AS.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var n=RS(t-this._xi)>this._ux||RS(e-this._yi)>this._uy||this._len<5;return this.addData(AS.L,t,e),this._ctx&&n&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,n,i,r,o){return this.addData(AS.C,t,e,n,i,r,o),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,n,i,r,o):this._ctx.bezierCurveTo(t,e,n,i,r,o)),this._xi=r,this._yi=o,this},quadraticCurveTo:function(t,e,n,i){return this.addData(AS.Q,t,e,n,i),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},arc:function(t,e,n,i,r,o){return this.addData(AS.A,t,e,n,n,i,r-i,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=OS(r)*n+t,this._yi=PS(r)*n+t,this},arcTo:function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},rect:function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(AS.R,t,e,n,i),this},closePath:function(){this.addData(AS.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;n<t.length;n++)e+=t[n];this._dashSum=e}return this},setLineDashOffset:function(t){return this._dashOffset=t,this},len:function(){return this._len},setData:function(t){var e=t.length;this.data&&this.data.length==e||!FS||(this.data=new Float32Array(e));for(var n=0;n<e;n++)this.data[n]=t[n];this._len=e},appendPath:function(t){t instanceof Array||(t=[t]);for(var e=t.length,n=0,i=this._len,r=0;r<e;r++)n+=t[r].len();FS&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n));for(r=0;r<e;r++)for(var o=t[r].data,a=0;a<o.length;a++)this.data[i++]=o[a];this._len=i},addData:function(t){if(this._saveData){var e=this.data;this._len+arguments.length>e.length&&(this._expandData(),e=this.data);for(var n=0;n<arguments.length;n++)e[this._len++]=arguments[n];this._prevCmd=t}},_expandData:function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(t,e){var n,i,r=this._dashSum,o=this._dashOffset,a=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,c=t-l,h=e-u,d=NS(c*c+h*h),f=l,p=u,g=a.length;for(o<0&&(o=r+o),f-=(o%=r)*(c/=d),p-=o*(h/=d);0<c&&f<=t||c<0&&t<=f||0==c&&(0<h&&p<=e||h<0&&e<=p);)f+=c*(n=a[i=this._dashIdx]),p+=h*n,this._dashIdx=(i+1)%g,0<c&&f<l||c<0&&l<f||0<h&&p<u||h<0&&u<p||s[i%2?"moveTo":"lineTo"](0<=c?ES(f,t):LS(f,t),0<=h?ES(p,e):LS(p,e));c=f-t,h=p-e,this._dashOffset=-NS(c*c+h*h)},_dashedBezierTo:function(t,e,n,i,r,o){var a,s,l,u,c,h=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=ii,y=0,x=this._dashIdx,b=f.length,w=0;for(d<0&&(d=h+d),d%=h,a=0;a<1;a+=.1)s=v(g,t,n,r,a+.1)-v(g,t,n,r,a),l=v(m,e,i,o,a+.1)-v(m,e,i,o,a),y+=NS(s*s+l*l);for(;x<b&&!(d<(w+=f[x]));x++);for(a=(w-d)/y;a<=1;)u=v(g,t,n,r,a),c=v(m,e,i,o,a),x%2?p.moveTo(u,c):p.lineTo(u,c),a+=f[x]/y,x=(x+1)%b;x%2!=0&&p.lineTo(r,o),s=r-u,l=o-c,this._dashOffset=-NS(s*s+l*l)},_dashedQuadraticTo:function(t,e,n,i){var r=n,o=i;n=(n+2*t)/3,i=(i+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,n,i,r,o)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,FS&&(this.data=new Float32Array(t)))},getBoundingRect:function(){DS[0]=DS[1]=IS[0]=IS[1]=Number.MAX_VALUE,MS[0]=MS[1]=kS[0]=kS[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,n=0,i=0,r=0,o=0;o<t.length;){var a=t[o++];switch(1==o&&(i=e=t[o],r=n=t[o+1]),a){case AS.M:e=i=t[o++],n=r=t[o++],IS[0]=i,IS[1]=r,kS[0]=i,kS[1]=r;break;case AS.L:mi(e,n,t[o],t[o+1],IS,kS),e=t[o++],n=t[o++];break;case AS.C:vi(e,n,t[o++],t[o++],t[o++],t[o++],t[o],t[o+1],IS,kS),e=t[o++],n=t[o++];break;case AS.Q:yi(e,n,t[o++],t[o++],t[o],t[o+1],IS,kS),e=t[o++],n=t[o++];break;case AS.A:var s=t[o++],l=t[o++],u=t[o++],c=t[o++],h=t[o++],d=t[o++]+h,f=(t[o++],1-t[o++]);1==o&&(i=OS(h)*u+s,r=PS(h)*c+l),xi(s,l,u,c,h,d,f,IS,kS),e=OS(d)*u+s,n=PS(d)*c+l;break;case AS.R:mi(i=e=t[o++],r=n=t[o++],i+t[o++],r+t[o++],IS,kS);break;case AS.Z:e=i,n=r}at(DS,DS,IS),st(MS,MS,kS)}return 0===o&&(DS[0]=DS[1]=MS[0]=MS[1]=0),new ie(DS[0],DS[1],MS[0]-DS[0],MS[1]-DS[1])},rebuildPath:function(t){for(var e,n,i,r,o,a,s=this.data,l=this._ux,u=this._uy,c=this._len,h=0;h<c;){var d=s[h++];switch(1==h&&(e=i=s[h],n=r=s[h+1]),d){case AS.M:e=i=s[h++],n=r=s[h++],t.moveTo(i,r);break;case AS.L:o=s[h++],a=s[h++],(RS(o-i)>l||RS(a-r)>u||h===c-1)&&(t.lineTo(o,a),i=o,r=a);break;case AS.C:t.bezierCurveTo(s[h++],s[h++],s[h++],s[h++],s[h++],s[h++]),i=s[h-2],r=s[h-1];break;case AS.Q:t.quadraticCurveTo(s[h++],s[h++],s[h++],s[h++]),i=s[h-2],r=s[h-1];break;case AS.A:var f=s[h++],p=s[h++],g=s[h++],m=s[h++],v=s[h++],y=s[h++],x=s[h++],b=s[h++],w=m<g?g:m,_=m<g?1:g/m,S=m<g?m/g:1,C=v+y;.001<Math.abs(g-m)?(t.translate(f,p),t.rotate(x),t.scale(_,S),t.arc(0,0,w,v,C,1-b),t.scale(1/_,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,C,1-b),1==h&&(e=OS(v)*g+f,n=PS(v)*m+p),i=OS(C)*g+f,r=PS(C)*m+p;break;case AS.R:e=i=s[h],n=r=s[h+1],t.rect(s[h++],s[h++],s[h++],s[h++]);break;case AS.Z:t.closePath(),i=e,r=n}}}},zS.CMD=AS;var HS=2*Math.PI,BS=2*Math.PI,VS=zS.CMD,jS=2*Math.PI,WS=1e-4,US=[-1,-1,-1],$S=[-1,-1],qS=s_.prototype.getCanvasPattern,GS=Math.abs,YS=new zS(!0);Pi.prototype={constructor:Pi,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var n,i=this.style,r=this.path||YS,o=i.hasStroke(),a=i.hasFill(),s=i.fill,l=i.stroke,u=a&&!!s.colorStops,c=o&&!!l.colorStops,h=a&&!!s.image,d=o&&!!l.image;(i.bind(t,this,e),this.setTransform(t),this.__dirty)&&(u&&(n=n||this.getBoundingRect(),this._fillGradient=i.getGradient(t,s,n)),c&&(n=n||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,l,n)));u?t.fillStyle=this._fillGradient:h&&(t.fillStyle=qS.call(s,t)),c?t.strokeStyle=this._strokeGradient:d&&(t.strokeStyle=qS.call(l,t));var f=i.lineDash,p=i.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();r.setScale(m[0],m[1]),this.__dirtyPath||f&&!g&&o?(r.beginPath(t),f&&!g&&(r.setLineDash(f),r.setLineDashOffset(p)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a&&r.fill(t),f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o&&r.stroke(t),f&&g&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(){},createPathProxy:function(){this.path=new zS},getBoundingRect:function(){var t=this._rect,e=this.style,n=!t;if(n){var i=this.path;i||(i=this.path=new zS),this.__dirtyPath&&(i.beginPath(),this.buildPath(i,this.shape,!1)),t=i.getBoundingRect()}if(this._rect=t,e.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||n){r.copy(t);var o=e.lineWidth,a=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(o=Math.max(o,this.strokeContainThreshold||4)),1e-10<a&&(r.width+=o/a,r.height+=o/a,r.x-=o/a/2,r.y-=o/a/2)}return r}return t},contain:function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path.data;if(r.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(1e-10<s&&(r.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),Oi(o,a/s,t,e)))return!0}if(r.hasFill())return Li(o,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):on.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var n=this.shape;if(n){if(b(t))for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);else n[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&1e-10<GS(t[0]-1)&&1e-10<GS(t[3]-1)?Math.sqrt(GS(t[0]*t[3]-t[2]*t[1])):1}},Pi.extend=function(r){var t=function(t){Pi.call(this,t),r.style&&this.style.extendFrom(r.style,!1);var e=r.shape;if(e){this.shape=this.shape||{};var n=this.shape;for(var i in e)!n.hasOwnProperty(i)&&e.hasOwnProperty(i)&&(n[i]=e[i])}r.init&&r.init.call(this,t)};for(var e in o(t,Pi),r)"style"!==e&&"shape"!==e&&(t.prototype[e]=r[e]);return t},o(Pi,on);var ZS=zS.CMD,XS=[[],[],[]],KS=Math.sqrt,QS=Math.atan2,JS=function(t,e){var n,i,r,o,a,s=t.data,l=ZS.M,u=ZS.C,c=ZS.L,h=ZS.R,d=ZS.A,f=ZS.Q;for(o=r=0;r<s.length;){switch(n=s[r++],o=r,i=0,n){case l:case c:i=1;break;case u:i=3;break;case f:i=2;break;case d:var p=e[4],g=e[5],m=KS(e[0]*e[0]+e[1]*e[1]),v=KS(e[2]*e[2]+e[3]*e[3]),y=QS(-e[1]/v,e[0]/m);s[r]*=m,s[r++]+=p,s[r]*=v,s[r++]+=g,s[r++]*=m,s[r++]*=v,s[r++]+=y,s[r++]+=y,o=r+=2;break;case h:x[0]=s[r++],x[1]=s[r++],ot(x,x,e),s[o++]=x[0],s[o++]=x[1],x[0]+=s[r++],x[1]+=s[r++],ot(x,x,e),s[o++]=x[0],s[o++]=x[1]}for(a=0;a<i;a++){var x;(x=XS[a])[0]=s[r++],x[1]=s[r++],ot(x,x,e),s[o++]=x[0],s[o++]=x[1]}}},tC=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"],eC=Math.sqrt,nC=Math.sin,iC=Math.cos,rC=Math.PI,oC=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},aC=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(oC(t)*oC(e))},sC=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(aC(t,e))},lC=function(t){on.call(this,t)};lC.prototype={constructor:lC,type:"text",brush:function(t,e){var n=this.style;this.__dirty&&Be(n,!0),n.fill=n.stroke=n.shadowBlur=n.shadowColor=n.shadowOffsetX=n.shadowOffsetY=null;var i=n.text;null!=i&&(i+=""),n.bind(t,this,e),rn(i,n)&&(this.setTransform(t),je(this,t,i,n),this.restoreTransform(t))},getBoundingRect:function(){var t=this.style;if(this.__dirty&&Be(t,!0),!this._rect){var e=t.text;null!=e?e+="":e="";var n=Se(t.text+"",t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.rich);if(n.x+=t.x||0,n.y+=t.y||0,Je(t.textStroke,t.textStrokeWidth)){var i=t.textStrokeWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect}},o(lC,on);var uC=Pi.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(t,e,n){n&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI,!0)}}),cC=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]],hC=function(l){return Ub.browser.ie&&11<=Ub.browser.version?function(){var t,e=this.__clipPaths,n=this.style;if(e)for(var i=0;i<e.length;i++){var r=e[i],o=r&&r.shape,a=r&&r.type;if(o&&("sector"===a&&o.startAngle===o.endAngle||"rect"===a&&(!o.width||!o.height))){for(var s=0;s<cC.length;s++)cC[s][2]=n[cC[s][0]],n[cC[s][0]]=cC[s][1];t=!0;break}}if(l.apply(this,arguments),t)for(s=0;s<cC.length;s++)n[cC[s][0]]=cC[s][2]}:l},dC=Pi.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:hC(Pi.prototype.brush),buildPath:function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=e.startAngle,s=e.endAngle,l=e.clockwise,u=Math.cos(a),c=Math.sin(a);t.moveTo(u*r+n,c*r+i),t.lineTo(u*o+n,c*o+i),t.arc(n,i,o,a,s,!l),t.lineTo(Math.cos(s)*r+n,Math.sin(s)*r+i),0!==r&&t.arc(n,i,r,s,a,l),t.closePath()}}),fC=Pi.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)}}),pC=function(t,e){for(var n=t.length,i=[],r=0,o=1;o<n;o++)r+=et(t[o-1],t[o]);var a=r/2;a=a<n?n:a;for(o=0;o<a;o++){var s,l,u,c=o/(a-1)*(e?n:n-1),h=Math.floor(c),d=c-h,f=t[h%n];e?(s=t[(h-1+n)%n],l=t[(h+1)%n],u=t[(h+2)%n]):(s=t[0===h?h:h-1],l=t[n-2<h?n-1:h+1],u=t[n-3<h?n-1:h+2]);var p=d*d,g=d*p;i.push([Vi(s[0],f[0],l[0],u[0],d,p,g),Vi(s[1],f[1],l[1],u[1],d,p,g)])}return i},gC=function(t,e,n,i){var r,o,a,s,l=[],u=[],c=[],h=[];if(i){a=[Infinity,Infinity],s=[-Infinity,-Infinity];for(var d=0,f=t.length;d<f;d++)at(a,a,t[d]),st(s,s,t[d]);at(a,a,i[0]),st(s,s,i[1])}for(d=0,f=t.length;d<f;d++){var p=t[d];if(n)r=t[d?d-1:f-1],o=t[(d+1)%f];else{if(0===d||d===f-1){l.push(W(t[d]));continue}r=t[d-1],o=t[d+1]}G(u,o,r),J(u,u,e);var g=et(p,r),m=et(p,o),v=g+m;0!==v&&(g/=v,m/=v),J(c,u,-g),J(h,u,m);var y=$([],p,c),x=$([],p,h);i&&(st(y,y,a),at(y,y,s),st(x,x,a),at(x,x,s)),l.push(y),l.push(x)}return n&&l.push(l.shift()),l},mC=Pi.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){ji(t,e,!0)}}),vC=Pi.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){ji(t,e,!1)}}),yC=Pi.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,r=e.width,o=e.height;e.r?He(t,e):t.rect(n,i,r,o),t.closePath()}}),xC=Pi.extend({type:"line",shape:{
|
|
x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,o=e.y2,a=e.percent;0!==a&&(t.moveTo(n,i),a<1&&(r=n*(1-a)+r*a,o=i*(1-a)+o*a),t.lineTo(r,o))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}}),bC=[],wC=Pi.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,o=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,c=e.percent;0!==c&&(t.moveTo(n,i),null==l||null==u?(c<1&&(fi(n,a,r,c,bC),a=bC[1],r=bC[2],fi(i,s,o,c,bC),s=bC[1],o=bC[2]),t.quadraticCurveTo(a,s,r,o)):(c<1&&(si(n,a,l,r,c,bC),a=bC[1],l=bC[2],r=bC[3],si(i,s,u,o,c,bC),s=bC[1],u=bC[2],o=bC[3]),t.bezierCurveTo(a,s,l,u,r,o)))},pointAt:function(t){return Wi(this.shape,t,!1)},tangentAt:function(t){var e=Wi(this.shape,t,!0);return tt(e,e)}}),_C=Pi.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r,0),o=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*r+n,u*r+i),t.arc(n,i,r,o,a,!s)}}),SC=Pi.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,n=0;n<e.length;n++)t=t||e[n].__dirtyPath;this.__dirtyPath=t,this.__dirty=this.__dirty||t},beforeBrush:function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),n=0;n<t.length;n++)t[n].path||t[n].createPathProxy(),t[n].path.setScale(e[0],e[1])},buildPath:function(t,e){for(var n=e.paths||[],i=0;i<n.length;i++)n[i].buildPath(t,n[i].shape,!0)},afterBrush:function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),Pi.prototype.getBoundingRect.call(this)}}),CC=function(t){this.colorStops=t||[]};CC.prototype={constructor:CC,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}};var TC=function(t,e,n,i,r,o){this.x=null==t?0:t,this.y=null==e?0:e,this.x2=null==n?1:n,this.y2=null==i?0:i,this.type="linear",this.global=o||!1,CC.call(this,r)};TC.prototype={constructor:TC},o(TC,CC);var AC=function(t,e,n,i,r){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==n?.5:n,this.type="radial",this.global=r||!1,CC.call(this,i)};AC.prototype={constructor:AC},o(AC,CC),Ui.prototype.incremental=!0,Ui.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},Ui.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},Ui.prototype.addDisplayables=function(t,e){e=e||!1;for(var n=0;n<t.length;n++)this.addDisplayable(t[n],e)},Ui.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},Ui.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){(e=this._displayables[t]).parent=this,e.update(),e.parent=null}for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},Ui.prototype.brush=function(t){for(var e=this._cursor;e<this._displayables.length;e++){(n=this._displayables[e]).beforeBrush&&n.beforeBrush(t),n.brush(t,e===this._cursor?null:this._displayables[e-1]),n.afterBrush&&n.afterBrush(t)}this._cursor=e;for(e=0;e<this._temporaryDisplayables.length;e++){var n;(n=this._temporaryDisplayables[e]).beforeBrush&&n.beforeBrush(t),n.brush(t,0===e?null:this._temporaryDisplayables[e-1]),n.afterBrush&&n.afterBrush(t)}this._temporaryDisplayables=[],this.notClear=!0};var DC=[];Ui.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new ie(Infinity,Infinity,-Infinity,-Infinity),e=0;e<this._displayables.length;e++){var n=this._displayables[e],i=n.getBoundingRect().clone();n.needLocalTransform()&&i.applyTransform(n.getLocalTransform(DC)),t.union(i)}this._rect=t}return this._rect},Ui.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(n[0],n[1]))for(var i=0;i<this._displayables.length;i++){if(this._displayables[i].contain(t,e))return!0}return!1},o(Ui,on);var MC=Math.round,IC=Math.max,kC=Math.min,EC={},LC=Bi,OC=(Object.freeze||Object)({extendShape:$i,extendPath:qi,makePath:Gi,makeImage:Yi,mergePath:LC,resizePath:Xi,subPixelOptimizeLine:Ki,subPixelOptimizeRect:Qi,subPixelOptimize:Ji,setHoverStyle:dr,setLabelStyle:fr,setTextStyle:pr,setText:gr,getFont:_r,updateProps:Cr,initProps:Tr,getTransform:Ar,applyTransform:Dr,transformDirection:Mr,groupTransition:Ir,clipPointsByRect:kr,clipRectByRect:Er,createIcon:Lr,Group:Xw,Image:an,Text:lC,Circle:uC,Sector:dC,Ring:fC,Polygon:mC,Polyline:vC,Rect:yC,Line:xC,BezierCurve:wC,Arc:_C,IncrementalDisplayable:Ui,CompoundPath:SC,LinearGradient:TC,RadialGradient:AC,BoundingRect:ie}),PC=["textStyle","color"],NC={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(PC):null)},getFont:function(){return _r({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return Se(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("rich"),this.getShallow("truncateText"))}},RC=nS([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),FC={getItemStyle:function(t,e){var n=RC(this,t,e),i=this.getBorderLineDash();return i&&(n.lineDash=i),n},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},zC=r,HC=Wn();Or.prototype={constructor:Or,init:null,mergeOption:function(t){g(this.option,t,!0)},get:function(t,e){return null==t?this.option:Pr(this.option,this.parsePath(t),!e&&Nr(this,t))},getShallow:function(t,e){var n=this.option,i=null==n?n:n[t],r=!e&&Nr(this,t);return null==i&&r&&(i=r.getShallow(t)),i},getModel:function(t,e){var n;return new Or(null==t?this.option:Pr(this.option,t=this.parsePath(t)),e=e||(n=Nr(this,t))&&n.getModel(t),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new this.constructor(L(this.option))},setReadOnly:function(){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){HC(this).getParent=t},isAnimationEnabled:function(){if(!Ub.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},Xn(Or),Kn(Or),zC(Or,rS),zC(Or,aS),zC(Or,NC),zC(Or,FC);var BC=0,VC=1e-4,jC=9007199254740991,WC=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,UC=(Object.freeze||Object)({linearMap:Br,parsePercent:Vr,round:jr,asc:Wr,getPrecision:Ur,getPrecisionSafe:$r,getPixelPrecision:qr,getPercentWithPrecision:Gr,MAX_SAFE_INTEGER:jC,remRadian:Yr,isRadianAroundZero:Zr,parseDate:Xr,quantity:Kr,nice:Jr,reformIntervals:to,isNumeric:eo}),$C=u,qC=/([&<>"'])/g,GC={"&":"&","<":"<",">":">",'"':""","'":"'"},YC=["a","b","c","d","e","f","g"],ZC=function(t,e){return"{"+t+(null==e?"":e)+"}"},XC=Ie,KC=Se,QC=(Object.freeze||Object)({addCommas:no,toCamelCase:io,normalizeCssArray:$C,encodeHTML:ro,formatTpl:oo,formatTplSimple:ao,getTooltipMarker:so,formatTime:uo,capitalFirst:co,truncateText:XC,getTextRect:KC}),JC=k,tT=["left","right","top","bottom","width","height"],eT=[["width","left","right"],["height","top","bottom"]],nT=ho,iT=(y(ho,"vertical"),y(ho,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),rT=Wn(),oT=Or.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,n,i){Or.call(this,t,e,n,i),this.uid=Rr("ec_cpt_model")},init:function(t,e,n){this.mergeDefaultAndTheme(t,n)},mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?yo(t):{};g(t,e.getTheme().get(this.mainType)),g(t,this.getDefaultOption()),n&&vo(t,i,n)},mergeOption:function(t){g(this.option,t,!0);var e=this.layoutMode;e&&vo(this.option,t,e)},optionUpdated:function(){},getDefaultOption:function(){var t=rT(this);if(!t.defaultOption){for(var e=[],n=this.constructor;n;){var i=n.prototype.defaultOption;i&&e.push(i),n=n.superClass}for(var r={},o=e.length-1;0<=o;o--)r=g(r,e[o],!0);t.defaultOption=r}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});ti(oT,{registerWhenExtend:!0}),Fr(oT),zr(oT,bo),r(oT,iT);var aT="";"undefined"!=typeof navigator&&(aT=navigator.platform||"");var sT={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:aT.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},lT=Wn(),uT={clearColorPalette:function(){lT(this).colorIdx=0,lT(this).colorNameMap={}},getColorFromPalette:function(t,e,n){var i=lT(e=e||this),r=i.colorIdx||0,o=i.colorNameMap=i.colorNameMap||{};if(o.hasOwnProperty(t))return o[t];var a=On(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=n&&s?wo(s,n):a;if((l=l||a)&&l.length){var u=l[r];return t&&(o[t]=u),i.colorIdx=(r+1)%l.length,u}}},cT={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis")[0],o=t.getReferringComponents("yAxis")[0];if(Vb){if(!r)throw new Error('xAxis "'+N(t.get("xAxisIndex"),t.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+N(t.get("xAxisIndex"),t.get("yAxisId"),0)+'" not found')}e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),So(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),So(o)&&(i.set("y",o),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis")[0];if(Vb&&!r)throw new Error("singleAxis should be specified.");e.coordSysDims=["single"],n.set("single",r),So(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar")[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");if(Vb){if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),So(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),So(a)&&(i.set("angle",a),e.firstCategoryDimIndex=1)},geo:function(t,e){e.coordSysDims=["lng","lat"]},parallel:function(t,r,o,a){var s=t.ecModel,e=s.getComponent("parallel",t.get("parallelIndex")),l=r.coordSysDims=e.dimensions.slice();k(e.parallelAxisIndex,function(t,e){var n=s.getComponent("parallelAxis",t),i=l[e];o.set(i,n),So(n)&&null==r.firstCategoryDimIndex&&(a.set(i,n),r.firstCategoryDimIndex=e)})}},hT="original",dT="arrayRows",fT="objectRows",pT="keyedColumns",gT="unknown",mT="typedArray",vT="column",yT="row";Co.seriesDataToSource=function(t){return new Co({data:t,sourceFormat:_(t)?mT:hT,fromDataset:!1})},Kn(Co);var xT=Wn(),bT="\0_ec_inner",wT=Or.extend({init:function(t,e,n,i){n=n||{},this.option=null,this._theme=new Or(n),this._optionManager=i},setOption:function(t,e){T(!(bT in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,n=this._optionManager;if(!t||"recreate"===t){var i=n.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(i)):Ho.call(this,i),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=n.getTimelineOption(this);r&&(this.mergeOption(r),e=!0)}if(!t||"recreate"===t||"media"===t){var o=n.getMediaOption(this,this._api);o.length&&k(o,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(i){function t(a,t){var e=On(i[a]),n=Fn(u.get(a),e);zn(n),k(n,function(t){var e=t.option;b(e)&&(t.keyInfo.mainType=a,t.keyInfo.subType=Vo(a,e,t.exist))});var s=Bo(u,t);l[a]=[],u.set(a,[]),k(n,function(t,e){var n=t.exist,i=t.option;if(T(b(i)||n,"Empty component definition"),i){var r=oT.getClass(a,t.keyInfo.subType,!0);if(n&&n instanceof r)n.name=t.keyInfo.name,n.mergeOption(i,this),n.optionUpdated(i,!1);else{var o=O({dependentModels:s,componentIndex:e},t.keyInfo);O(n=new r(i,this,this,o),o),n.init(i,this,this,o),n.optionUpdated(null,!0)}}else n.mergeOption({},this),n.optionUpdated({},!1);u.get(a)[e]=n,l[a][e]=n.option},this),"series"===a&&jo(this,u.get("series"))}var l=this.option,u=this._componentsMap,n=[];Do(this),k(i,function(t,e){null!=t&&(oT.hasClass(e)?e&&n.push(e):l[e]=null==l[e]?L(t):g(l[e],t,!0))}),oT.topologicalTravel(n,oT.getAllClassMainTypes(),t,this),this._seriesIndicesMap=z(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var i=L(this.option);return k(i,function(t,e){if(oT.hasClass(e)){for(var n=(t=On(t)).length-1;0<=n;n--)Bn(t[n])&&t.splice(n,1);i[e]=t}}),delete i[bT],i},getTheme:function(){return this._theme},getComponent:function(t,e){var n=this._componentsMap.get(t);if(n)return n[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,r=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];if(null!=i)E(i)||(i=[i]),n=f(A(i,function(t){return a[t]}),function(t){return!!t});else if(null!=r){var s=E(r);n=f(a,function(t){return s&&0<=x(r,t.id)||!s&&t.id===r})}else if(null!=o){var l=E(o);n=f(a,function(t){return l&&0<=x(o,t.name)||!l&&t.name===o})}else n=a.slice();return Wo(n,t)},findComponents:function(e){function t(t){var e=r+"Index",n=r+"Id",i=r+"Name";return!t||null==t[e]&&null==t[n]&&null==t[i]?null:{mainType:r,index:t[e],id:t[n],name:t[i]}}function n(t){return e.filter?f(t,e.filter):t}var i=e.query,r=e.mainType,o=t(i);return n(Wo(o?this.queryComponents(o):this._componentsMap.get(r),e))},eachComponent:function(t,i,r){var e=this._componentsMap;if("function"==typeof t)r=i,i=t,e.each(function(t,n){k(t,function(t,e){i.call(r,n,t,e)})});else if(w(t))k(e.get(t),i,r);else if(b(t)){k(this.findComponents(t),i,r)}},getSeriesByName:function(e){return f(this._componentsMap.get("series"),function(t){return t.name===e})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(e){return f(this._componentsMap.get("series"),function(t){return t.subType===e})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(n,i){Uo(this),k(this._seriesIndices,function(t){var e=this._componentsMap.get("series")[t];n.call(i,e,t)},this)},eachRawSeries:function(t,e){k(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(n,i,r){Uo(this),k(this._seriesIndices,function(t){var e=this._componentsMap.get("series")[t];e.subType===n&&i.call(r,e,t)},this)},eachRawSeriesByType:function(t,e,n){return k(this.getSeriesByType(t),e,n)},isSeriesFiltered:function(t){return Uo(this),null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){Uo(this),jo(this,f(this._componentsMap.get("series"),t,e))},restoreData:function(n){var t=this._componentsMap;jo(this,t.get("series"));var i=[];t.each(function(t,e){i.push(e)}),oT.topologicalTravel(i,oT.getAllClassMainTypes(),function(e){k(t.get(e),function(t){("series"!==e||!Fo(t,n))&&t.restoreData()})})}});r(wT,uT);var _T=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],ST={};qo.prototype={constructor:qo,create:function(n,i){var r=[];k(ST,function(t){var e=t.create(n,i);r=r.concat(e||[])}),this._coordinateSystems=r},update:function(e,n){k(this._coordinateSystems,function(t){t.update&&t.update(e,n)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},qo.register=function(t,e){ST[t]=e},qo.get=function(t){return ST[t]};var CT=k,TT=L,AT=A,DT=g,MT=/^(min|max)?(.+)$/;Go.prototype={constructor:Go,setOption:function(t,e){t&&k(On(t.series),function(t){t&&t.data&&_(t.data)&&d(t.data)}),t=TT(t,!0);var n=this._optionBackup,i=Yo.call(this,t,e,!n);this._newBaseOption=i.baseOption,n?(Qo(n.baseOption,i.baseOption),i.timelineOptions.length&&(n.timelineOptions=i.timelineOptions),i.mediaList.length&&(n.mediaList=i.mediaList),i.mediaDefault&&(n.mediaDefault=i.mediaDefault)):this._optionBackup=i},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=AT(e.timelineOptions,TT),this._mediaList=AT(e.mediaList,TT),this._mediaDefault=TT(e.mediaDefault),this._currentMediaIndices=[],TT(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,n=this._timelineOptions;if(n.length){var i=t.getComponent("timeline");i&&(e=TT(n[i.getCurrentIndex()],!0))}return e},getMediaOption:function(){var t=this._api.getWidth(),e=this._api.getHeight(),n=this._mediaList,i=this._mediaDefault,r=[],o=[];if(!n.length&&!i)return o;for(var a=0,s=n.length;a<s;a++)Zo(n[a].query,t,e)&&r.push(a);return!r.length&&i&&(r=[-1]),r.length&&!Ko(r,this._currentMediaIndices)&&(o=AT(r,function(t){return TT(-1===t?i.option:n[t].option)})),this._currentMediaIndices=r,o}};var IT=k,kT=b,ET=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"],LT=function(e,t){IT(oa(e.series),function(t){kT(t)&&ra(t)});var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),IT(n,function(t){IT(oa(e[t]),function(t){t&&(na(t,"axisLabel"),na(t.axisPointer,"label"))})}),IT(oa(e.parallel),function(t){var e=t&&t.parallelAxisDefault;na(e,"axisLabel"),na(e&&e.axisPointer,"label")}),IT(oa(e.calendar),function(t){ta(t,"itemStyle"),na(t,"dayLabel"),na(t,"monthLabel"),na(t,"yearLabel")}),IT(oa(e.radar),function(t){na(t,"name")}),IT(oa(e.geo),function(t){kT(t)&&(ia(t),IT(oa(t.regions),function(t){ia(t)}))}),IT(oa(e.timeline),function(t){ia(t),ta(t,"label"),ta(t,"itemStyle"),ta(t,"controlStyle",!0);var e=t.data;E(e)&&k(e,function(t){b(t)&&(ta(t,"label"),ta(t,"itemStyle"))})}),IT(oa(e.toolbox),function(t){ta(t,"iconStyle"),IT(t.feature,function(t){ta(t,"iconStyle")})}),na(aa(e.axisPointer),"label"),na(aa(e.tooltip).axisPointer,"label")},OT=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],PT=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],NT=function(n,t){LT(n,t),n.series=On(n.series),k(n.series,function(t){if(b(t)){var e=t.type;if("pie"!==e&&"gauge"!==e||null!=t.clockWise&&(t.clockwise=t.clockWise),"gauge"===e){var n=sa(t,"pointer.color");null!=n&&la(t,"itemStyle.normal.color",n)}ua(t)}}),n.dataRange&&(n.visualMap=n.dataRange),k(PT,function(t){var e=n[t];e&&(E(e)||(e=[e]),k(e,function(t){ua(t)}))})},RT=function(t){var o=z();t.eachSeries(function(t){var e=t.get("stack");if(e){var n=o.get(e)||o.set(e,[]),i=t.getData(),r={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:t};if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;n.length&&i.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(r)}}),o.each(ca)},FT=ha.prototype;FT.pure=!1;var zT={arrayRows_column:{pure:FT.persistent=!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(t){return this._data[t+this._source.startIndex]},appendData:pa},arrayRows_row:{pure:!0,count:function(){var t=this._data[0];return t?Math.max(0,t.length-this._source.startIndex):0},getItem:function(t){t+=this._source.startIndex;for(var e=[],n=this._data,i=0;i<n.length;i++){var r=n[i];e.push(r?r[t]:null)}return e},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:da,getItem:fa,appendData:pa},keyedColumns:{pure:!0,count:function(){var t=this._source.dimensionsDefine[0].name,e=this._data[t];return e?e.length:0},getItem:function(t){for(var e=[],n=this._source.dimensionsDefine,i=0;i<n.length;i++){var r=this._data[n[i].name];e.push(r?r[t]:null)}return e},appendData:function(t){var r=this._data;k(t,function(t,e){for(var n=r[e]||(r[e]=[]),i=0;i<(t||[]).length;i++)n.push(t[i])})}},original:{count:da,getItem:fa,appendData:pa},typedArray:{persistent:!(FT.getSource=function(){return this._source}),pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(t,e){t-=this._offset,e=e||[];for(var n=this._dimSize*t,i=0;i<this._dimSize;i++)e[i]=this._data[n+i];return e},appendData:function(t){Vb&&T(_(t),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=t},clean:function(){this._offset+=this.count(),this._data=null}}},HT={arrayRows:ga,objectRows:function(t,e,n,i){return null!=n?t[i]:t},keyedColumns:ga,original:function(t,e,n){var i=Nn(t);return null!=n&&i instanceof Array?i[n]:i},typedArray:ga},BT={arrayRows:ma,objectRows:function(t,e){return va(t[e],this._dimensionInfos[e])},keyedColumns:ma,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return!this._rawData.pure&&Rn(t)&&(this.hasItemOption=!0),va(r instanceof Array?r[i]:r,this._dimensionInfos[e])},typedArray:function(t,e,n,i){return t[i]}},VT=/\{@(.+?)\}/g,jT={getDataParams:function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),r=n.getRawIndex(t),o=n.getName(t),a=n.getRawDataItem(t),s=n.getItemVisual(t,"color");return{componentType:this.mainType,componentSubType:this.subType,seriesType:"series"===this.mainType?this.subType:null,seriesIndex:this.seriesIndex,seriesId:this.id,seriesName:this.name,name:o,dataIndex:r,data:a,dataType:e,value:i,color:s,marker:so(s),$vars:["seriesName","name","value"]}},getFormattedLabel:function(i,t,e,n,r){t=t||"normal";var o=this.getData(e),a=o.getItemModel(i),s=this.getDataParams(i,e);null!=n&&s.value instanceof Array&&(s.value=s.value[n]);var l=a.get("normal"===t?[r||"label","formatter"]:[t,r||"label","formatter"]);return"function"==typeof l?(s.status=t,l(s)):"string"==typeof l?oo(l,s).replace(VT,function(t,e){var n=e.length;return"["===e.charAt(0)&&"]"===e.charAt(n-1)&&(e=+e.slice(1,n-1)),ya(o,i,e)}):void 0},getRawValue:function(t,e){return ya(this.getData(e),t)},formatTooltip:function(){}},WT=wa.prototype;WT.perform=function(t){function e(t){return!(1<=t)&&(t=1),t}var n,i=this._upstream,r=t&&t.skip;if(this._dirty&&i){var o=this.context;o.data=o.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(n=this._plan(this.context));var a,s=e(this._modBy),l=this._modDataCount||0,u=e(t&&t.modBy),c=t&&t.modDataCount||0;s===u&&l===c||(n="reset"),(this._dirty||"reset"===n)&&(this._dirty=!1,a=Sa(this,r)),this._modBy=u,this._modDataCount=c;var h=t&&t.step;if(i?(Vb&&T(null!=i._outputDueEnd),this._dueEnd=i._outputDueEnd):(Vb&&T(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):Infinity),this._progress){var d=this._dueIndex,f=Math.min(null!=h?this._dueIndex+h:Infinity,this._dueEnd);if(!r&&(a||d<f)){var p=this._progress;if(E(p))for(var g=0;g<p.length;g++)_a(this,p[g],d,f,u,c);else _a(this,p,d,f,u,c)}this._dueIndex=f;var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;Vb&&T(m>=this._outputDueEnd),this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var UT=function(){function r(){return s<a?s++:null}function o(){var t=s%c*l+Math.ceil(s/c),e=a<=s?null:t<u?t:s;return s++,e}var a,s,l,u,c,h={reset:function(t,e,n,i){s=t,a=e,l=n,u=i,c=Math.ceil(u/l),h.next=1<l&&0<u?o:r}};return h}();WT.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},WT.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},WT.pipe=function(t){Vb&&T(t&&!t._disposed&&t!==this),(this._downstream!==t||this._dirty)&&((this._downstream=t)._upstream=this,t.dirty())},WT.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},WT.getUpstream=function(){return this._upstream},WT.getDownstream=function(){return this._downstream},WT.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t};var $T=Wn(),qT=oT.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendDataProvider:null,visualColorAccessPath:"itemStyle.color",layoutMode:null,init:function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=ba({count:Aa,reset:Da}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),Mo(this);var i=this.getInitialData(t,n);Ia(i,this),this.dataTask.context.data=i,Vb&&T(i,"getInitialData returned invalid data."),$T(this).dataBeforeProcessed=i,Ca(this)},mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?yo(t):{},r=this.subType;oT.hasClass(r)&&(r+="Series"),g(t,e.getTheme().get(this.subType)),g(t,this.getDefaultOption()),Pn(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&vo(t,i,n)},mergeOption:function(t,e){t=g(this.option,t,!0),this.fillDataTextStyle(t.data);var n=this.layoutMode;n&&vo(this.option,t,n),Mo(this);var i=this.getInitialData(t,e);Ia(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,$T(this).dataBeforeProcessed=i,Ca(this)},fillDataTextStyle:function(t){if(t&&!_(t))for(var e=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&Pn(t[n],"label",e)},getInitialData:function(){},appendData:function(t){this.getRawData().appendData(t.data)},getData:function(t){var e=Ea(this);if(e){var n=e.context.data;return null==t?n:n.getLinkedData(t)}return $T(this).data},setData:function(t){var e=Ea(this);if(e){var n=e.context;n.data!==t&&e.modifyOutputEnd&&e.setOutputEnd(t.count()),n.outputData=t,e!==this.dataTask&&(n.data=t)}$T(this).data=t},getSource:function(){return Ao(this)},getRawData:function(){return $T(this).dataBeforeProcessed},getBaseAxis:function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},formatTooltip:function(n,l){function t(t){function e(t,e){var n=u.getDimensionInfo(e);if(n&&!1!==n.otherDims.tooltip){var i=n.type,r=so({color:c,type:"subItem"}),o=(a?r+ro(n.displayName||"-")+": ":"")+ro("ordinal"===i?t+"":"time"===i?l?"":uo("yyyy/MM/dd hh:mm:ss",t):no(t));o&&s.push(o)}}var a=p(t,function(t,e,n){var i=u.getDimensionInfo(n);return t|(i&&!1!==i.tooltip&&null!=i.displayName)},0),s=[];return i.length?k(i,function(t){e(ya(u,n,t),t)}):k(t,e),(a?"<br/>":"")+s.join(a?"<br/>":", ")}function e(t){return ro(no(t))}var u=this.getData(),i=u.mapDimension("defaultedTooltip",!0),r=i.length,o=this.getRawValue(n),a=E(o),c=u.getItemVisual(n,"color");b(c)&&c.colorStops&&(c=(c.colorStops[0]||{}).color),c=c||"transparent";var s=1<r||a&&!r?t(o):e(r?ya(u,n,i[0]):a?o[0]:o),h=so(c),d=u.getName(n),f=this.name;return Hn(this)||(f=""),f=f?ro(f)+(l?": ":"<br/>"):"",l?h+f+s:f+h+(d?ro(d)+": "+s:s)},isAnimationEnabled:function(){if(Ub.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,n){var i=this.ecModel,r=uT.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});r(qT,jT),r(qT,uT);var GT=function(){this.group=new Xw,this.uid=Rr("viewComponent")};GT.prototype={constructor:GT,init:function(){},render:function(){},dispose:function(){}};var YT=GT.prototype;YT.updateView=YT.updateLayout=YT.updateVisual=function(){},Xn(GT),ti(GT,{registerWhenExtend:!0});var ZT=function(){var s=Wn();return function(t){var e=s(t),n=t.pipelineContext,i=e.large,r=e.progressiveRender,o=e.large=n.large,a=e.progressiveRender=n.progressiveRender;return!!(i^o||r^a)&&"reset"}},XT=Wn(),KT=ZT();La.prototype={type:"chart",init:function(){},render:function(){},highlight:function(t,e,n,i){Pa(t.getData(),i,"emphasis")},downplay:function(t,e,n,i){Pa(t.getData(),i,"normal")},remove:function(){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null};var QT=La.prototype;QT.updateView=QT.updateLayout=QT.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},Xn(La,["dispose"]),ti(La,{registerWhenExtend:!0}),La.markUpdateMethod=function(t,e){XT(t).updateMethod=e};var JT={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},tA="\0__throttleOriginMethod",eA="\0__throttleRate",nA="\0__throttleType",iA={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=(e.visualColorAccessPath||"itemStyle.color").split("."),r=e.get(i)||e.getColorFromPalette(e.name,null,t.getSeriesCount());if(n.setVisual("color",r),!t.isSeriesFiltered(e)){"function"!=typeof r||r instanceof CC||n.each(function(t){n.setItemVisual(t,"color",r(e.getDataParams(t)))});var o=function(t,e){var n=t.getItemModel(e).get(i,!0);null!=n&&t.setItemVisual(e,"color",n)};return{dataEach:n.hasItemOption?o:null}}}},rA={toolbox:{brush:{title:{rect:"\u77e9\u5f62\u9009\u62e9",polygon:"\u5708\u9009",lineX:"\u6a2a\u5411\u9009\u62e9",lineY:"\u7eb5\u5411\u9009\u62e9",keep:"\u4fdd\u6301\u9009\u62e9",clear:"\u6e05\u9664\u9009\u62e9"}},dataView:{title:"\u6570\u636e\u89c6\u56fe",lang:["\u6570\u636e\u89c6\u56fe","\u5173\u95ed","\u5237\u65b0"]},dataZoom:{title:{zoom:"\u533a\u57df\u7f29\u653e",back:"\u533a\u57df\u7f29\u653e\u8fd8\u539f"}},magicType:{title:{line:"\u5207\u6362\u4e3a\u6298\u7ebf\u56fe",bar:"\u5207\u6362\u4e3a\u67f1\u72b6\u56fe",stack:"\u5207\u6362\u4e3a\u5806\u53e0",tiled:"\u5207\u6362\u4e3a\u5e73\u94fa"}},restore:{title:"\u8fd8\u539f"},saveAsImage:{title:"\u4fdd\u5b58\u4e3a\u56fe\u7247",lang:["\u53f3\u952e\u53e6\u5b58\u4e3a\u56fe\u7247"]}},series:{typeNames:{pie:"\u997c\u56fe",bar:"\u67f1\u72b6\u56fe",line:"\u6298\u7ebf\u56fe",scatter:"\u6563\u70b9\u56fe",effectScatter:"\u6d9f\u6f2a\u6563\u70b9\u56fe",radar:"\u96f7\u8fbe\u56fe",tree:"\u6811\u56fe",treemap:"\u77e9\u5f62\u6811\u56fe",boxplot:"\u7bb1\u578b\u56fe",candlestick:"K\u7ebf\u56fe",k:"K\u7ebf\u56fe",heatmap:"\u70ed\u529b\u56fe",map:"\u5730\u56fe",parallel:"\u5e73\u884c\u5750\u6807\u56fe",lines:"\u7ebf\u56fe",graph:"\u5173\u7cfb\u56fe",sankey:"\u6851\u57fa\u56fe",funnel:"\u6f0f\u6597\u56fe",gauge:"\u4eea\u8868\u76d8\u56fe",pictorialBar:"\u8c61\u5f62\u67f1\u56fe",themeRiver:"\u4e3b\u9898\u6cb3\u6d41\u56fe",sunburst:"\u65ed\u65e5\u56fe"}},aria:{general:{withTitle:"\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u201c{title}\u201d\u7684\u56fe\u8868\u3002",withoutTitle:"\u8fd9\u662f\u4e00\u4e2a\u56fe\u8868\uff0c"},series:{single:{prefix:"",withName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\uff0c\u8868\u793a{seriesName}\u3002",withoutName:"\u56fe\u8868\u7c7b\u578b\u662f{seriesType}\u3002"},multiple:{prefix:"\u5b83\u7531{seriesCount}\u4e2a\u56fe\u8868\u7cfb\u5217\u7ec4\u6210\u3002",withName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a\u8868\u793a{seriesName}\u7684{seriesType}\uff0c",withoutName:"\u7b2c{seriesId}\u4e2a\u7cfb\u5217\u662f\u4e00\u4e2a{seriesType}\uff0c",separator:{middle:"\uff1b",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636e\u662f\u2014\u2014",partialData:"\u5176\u4e2d\uff0c\u524d{displayCnt}\u9879\u662f\u2014\u2014",withName:"{name}\u7684\u6570\u636e\u662f{value}",withoutName:"{value}",
|
|
separator:{middle:"\uff0c",end:""}}}},oA=function(t,e){function c(t,e){if("string"!=typeof t)return t;var n=t;return k(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}function h(t){var e=o.get(t);if(null!=e)return e;for(var n=t.split("."),i=rA.aria,r=0;r<n.length;++r)i=i[n[r]];return i}function n(){var t=e.getModel("title").option;return t&&t.length&&(t=t[0]),t&&t.text}function d(t){return rA.series.typeNames[t]||"\u81ea\u5b9a\u4e49\u56fe"}var o=e.getModel("aria");if(o.get("show"))if(o.get("description"))t.setAttribute("aria-label",o.get("description"));else{var f=0;e.eachSeries(function(){++f},this);var i,p=o.get("data.maxCount")||10,r=o.get("series.maxCount")||10,g=Math.min(f,r);if(!(f<1)){var a=n();i=a?c(h("general.withTitle"),{title:a}):h("general.withoutTitle");var m=[];i+=c(h(1<f?"series.multiple.prefix":"series.single.prefix"),{seriesCount:f}),e.eachSeries(function(t,e){if(e<g){var n,i=t.get("name"),r="series."+(1<f?"multiple":"single")+".";n=c(n=h(i?r+"withName":r+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:d(t.subType)});var o=t.getData();(window.data=o).count()>p?n+=c(h("data.partialData"),{displayCnt:p}):n+=h("data.allData");for(var a=[],s=0;s<o.count();s++)if(s<p){var l=o.getName(s),u=ya(o,s);a.push(c(h(l?"data.withName":"data.withoutName"),{name:l,value:u}))}n+=a.join(h("data.separator.middle"))+h("data.separator.end"),m.push(n)}}),i+=m.join(h("series.multiple.separator.middle"))+h("series.multiple.separator.end"),t.setAttribute("aria-label",i)}}},aA=Math.PI,sA=function(i,t){D(t=t||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var r=new yC({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4}),o=new _C({shape:{startAngle:-aA/2,endAngle:-aA/2+.1,r:10},style:{stroke:t.color,lineCap:"round",lineWidth:5},zlevel:t.zlevel,z:10001}),a=new yC({style:{fill:"none",text:t.text,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*aA/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*aA/2}).delay(300).start("circularInOut");var e=new Xw;return e.add(o),e.add(a),e.add(r),e.resize=function(){var t=i.getWidth()/2,e=i.getHeight()/2;o.setShape({cx:t,cy:e});var n=o.shape.r;a.setShape({x:t-n,y:e-n,width:2*n,height:2*n}),r.setShape({x:0,y:0,width:i.getWidth(),height:i.getHeight()})},e.resize(),e},lA=Ba.prototype;lA.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},lA.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},lA.getPipeline=function(t){return this._pipelineMap.get(t)},lA.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,o=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},lA.restorePipelines=function(t){var i=this,r=i._pipelineMap=z();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),Qa(i,t,t.dataTask)})},lA.prepareStageTasks=function(){var n=this._stageTaskMap,i=this.ecInstance.getModel(),r=this.api;k(this._allHandlers,function(t){var e=n.get(t.uid)||n.set(t.uid,[]);t.reset&&ja(this,t,e,i,r),t.overallReset&&Wa(this,t,e,i,r)},this)},lA.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,Qa(this,e,r)},lA.performDataProcessorTasks=function(t,e){Va(this,this._dataProcessorHandlers,t,e,{block:!0})},lA.performVisualTasks=function(t,e,n){Va(this,this._visualHandlers,t,e,n)},lA.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},lA.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var uA=lA.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},cA=Xa(0);Ba.wrapStageHandler=function(t,e){return m(t)&&(t={overallReset:t,seriesType:Ja(t)}),t.uid=Rr("stageHandler"),e&&(t.visualType=e),t};var hA,dA={},fA={};ts(dA,wT),ts(fA,$o),dA.eachSeriesByType=dA.eachRawSeriesByType=function(t){hA=t},dA.eachComponent=function(t){"series"===t.mainType&&t.subType&&(hA=t.subType)};var pA=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],gA={color:pA,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],pA]},mA="#eee",vA=function(){return{axisLine:{lineStyle:{color:mA}},axisTick:{lineStyle:{color:mA}},axisLabel:{textStyle:{color:mA}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:mA}}}},yA=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],xA={color:yA,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:mA},crossStyle:{color:mA}}},legend:{textStyle:{color:mA}},textStyle:{color:mA},title:{textStyle:{color:mA}},toolbox:{iconStyle:{normal:{borderColor:mA}}},dataZoom:{textStyle:{color:mA}},visualMap:{textStyle:{color:mA}},timeline:{lineStyle:{color:mA},itemStyle:{normal:{color:yA[1]}},label:{normal:{textStyle:{color:mA}}},controlStyle:{normal:{color:mA,borderColor:mA}}},timeAxis:vA(),logAxis:vA(),valueAxis:vA(),categoryAxis:vA(),line:{symbol:"circle"},graph:{color:yA},gauge:{title:{textStyle:{color:mA}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};xA.categoryAxis.splitLine.show=!1,oT.extend({type:"dataset",defaultOption:{seriesLayoutBy:vT,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){To(this)}}),GT.extend({type:"dataset"});var bA=T,wA=k,_A=m,SA=b,CA=oT.parseClassType,TA="4.1.0",AA={zrender:"4.0.4"},DA=1,MA=1e3,IA=5e3,kA=1e3,EA=2e3,LA=3e3,OA={PROCESSOR:{FILTER:MA,STATISTIC:IA},VISUAL:{LAYOUT:kA,GLOBAL:EA,CHART:LA,COMPONENT:4e3,BRUSH:5e3}},PA="__flagInMainProcess",NA="__optionUpdated",RA=/^[a-zA-Z0-9_]+$/;ns.prototype.on=es("on"),ns.prototype.off=es("off"),ns.prototype.one=es("one"),r(ns,hw);var FA=is.prototype;FA._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[NA]){var e=this[NA].silent;this[PA]=!0,os(this),zA.update.call(this),this[PA]=!1,this[NA]=!1,us.call(this,e),cs.call(this,e)}else if(t.unfinished){var n=DA,i=this._model,r=this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(i),t.performDataProcessorTasks(i),ss(this,i),t.performVisualTasks(i),ms(this,this._model,r,"remain"),n-=+new Date-o}while(0<n&&t.unfinished);t.unfinished||this._zr.flush()}}},FA.getDom=function(){return this._dom},FA.getZr=function(){return this._zr},FA.setOption=function(t,e,n){var i;if(Vb&&bA(!this[PA],"`setOption` should not be called during main process."),SA(e)&&(n=e.lazyUpdate,i=e.silent,e=e.notMerge),this[PA]=!0,!this._model||e){var r=new Go(this._api),o=this._theme,a=this._model=new wT(null,null,o,r);a.scheduler=this._scheduler,a.init(null,null,o,r)}this._model.setOption(t,WA),n?(this[NA]={silent:i},this[PA]=!1):(os(this),zA.update.call(this),this._zr.flush(),this[NA]=!1,this[PA]=!1,us.call(this,i),cs.call(this,i))},FA.setTheme=function(){console.log("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},FA.getModel=function(){return this._model},FA.getOption=function(){return this._model&&this._model.getOption()},FA.getWidth=function(){return this._zr.getWidth()},FA.getHeight=function(){return this._zr.getHeight()},FA.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},FA.getRenderedCanvas=function(t){if(Ub.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},FA.getSvgDataUrl=function(){if(Ub.svgSupported){var t=this._zr;return k(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},FA.getDataURL=function(t){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;wA(e,function(t){n.eachComponent({mainType:t},function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return wA(i,function(t){t.group.ignore=!1}),o},FA.getConnectedDataURL=function(i){if(Ub.canvasSupported){var r=this.group,o=Math.min,a=Math.max,t=Infinity;if(ZA[r]){var s=t,l=t,u=-t,c=-t,h=[],n=i&&i.pixelRatio||1;k(YA,function(t){if(t.group===r){var e=t.getRenderedCanvas(L(i)),n=t.getDom().getBoundingClientRect();s=o(n.left,s),l=o(n.top,l),u=a(n.right,u),c=a(n.bottom,c),h.push({dom:e,left:n.left,top:n.top})}});var e=(u*=n)-(s*=n),d=(c*=n)-(l*=n),f=ew();f.width=e,f.height=d;var p=Mn(f);return wA(h,function(t){var e=new an({style:{x:t.left*n-s,y:t.top*n-l,image:t.dom}});p.add(e)}),p.refreshImmediately(),f.toDataURL("image/"+(i&&i.type||"png"))}return this.getDataURL(i)}},FA.convertToPixel=y(rs,"convertToPixel"),FA.convertFromPixel=y(rs,"convertFromPixel"),FA.containPixel=function(t,r){var o;return k(t=Un(this._model,t),function(t,i){0<=i.indexOf("Models")&&k(t,function(t){var e=t.coordinateSystem;if(e&&e.containPoint)o|=!!e.containPoint(r);else if("seriesModels"===i){var n=this._chartsMap[t.__viewId];n&&n.containPoint?o|=n.containPoint(r,t):Vb&&console.warn(i+": "+(n?"The found component do not support containPoint.":"No view mapping to the found component."))}else Vb&&console.warn(i+": containPoint is not supported")},this)},this),!!o},FA.getVisual=function(t,e){var n=(t=Un(this._model,t,{defaultMainType:"series"})).seriesModel;Vb&&(n||console.warn("There is no specified seires model"));var i=n.getData(),r=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=r?i.getItemVisual(r,e):i.getVisual(e)},FA.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},FA.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var zA={prepareAndUpdate:function(t){os(this),zA.update.call(this,t)},update:function(t){var e=this._model,n=this._api,i=this._zr,r=this._coordSysMgr,o=this._scheduler;if(e){o.restoreData(e,t),o.performSeriesTasks(e),r.create(e,n),o.performDataProcessorTasks(e,t),ss(this,e),r.update(e,n),fs(e),o.performVisualTasks(e,t),ps(this,e,n,t);var a=e.get("backgroundColor")||"transparent";if(Ub.canvasSupported)i.setBackgroundColor(a);else{var s=Pt(a);a=Wt(s,"rgb"),0===s[3]&&(a="transparent")}vs(e,n)}},updateTransform:function(r){var o=this._model,a=this,s=this._api;if(o){var l=[];o.eachComponent(function(t,e){var n=a.getViewOfComponentModel(e);if(n&&n.__alive)if(n.updateTransform){var i=n.updateTransform(e,o,s,r);i&&i.update&&l.push(n)}else l.push(n)});var i=z();o.eachSeries(function(t){var e=a._chartsMap[t.__viewId];if(e.updateTransform){var n=e.updateTransform(t,o,s,r);n&&n.update&&i.set(t.uid,1)}else i.set(t.uid,1)}),fs(o),this._scheduler.performVisualTasks(o,r,{setDirty:!0,dirtyMap:i}),ms(a,o,s,r,i),vs(o,this._api)}},updateView:function(t){var e=this._model;e&&(La.markUpdateMethod(t,"updateView"),fs(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),ps(this,this._model,this._api,t),vs(e,this._api))},updateVisual:function(t){zA.update.call(this,t)},updateLayout:function(t){zA.update.call(this,t)}};FA.resize=function(t){Vb&&bA(!this[PA],"`resize` should not be called during main process."),this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[PA]=!0,n&&os(this),zA.update.call(this),this[PA]=!1,us.call(this,i),cs.call(this,i)}},FA.showLoading=function(t,e){if(SA(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),GA[t]){var n=GA[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}else Vb&&console.warn("Loading effects "+t+" not exists.")},FA.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},FA.makeActionFromEvent=function(t){var e=O({},t);return e.type=VA[t.type],e},FA.dispatchAction=function(t,e){SA(e)||(e={silent:!!e}),BA[t.type]&&this._model&&(this[PA]?this._pendingActions.push(t):(ls.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&Ub.browser.weChat&&this._throttledZrFlush(),us.call(this,e.silent),cs.call(this,e.silent)))},FA.appendData=function(t){var e=t.seriesIndex,n=this.getModel().getSeriesByIndex(e);Vb&&bA(t.data&&n),n.appendData(t),this._scheduler.unfinished=!0},FA.on=es("on"),FA.off=es("off"),FA.one=es("one");var HA=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];FA._initEvents=function(){wA(HA,function(o){this._zr.on(o,function(t){var e,n=this.getModel(),i=t.target;if("globalout"===o)e={};else if(i&&null!=i.dataIndex){var r=i.dataModel||n.getSeriesByIndex(i.seriesIndex);e=r&&r.getDataParams(i.dataIndex,i.dataType)||{}}else i&&i.eventData&&(e=O({},i.eventData));e&&(e.event=t,e.type=o,this.trigger(o,e))},this)},this),wA(VA,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},FA.isDisposed=function(){return this._disposed},FA.clear=function(){this.setOption({series:[]},!0)},FA.dispose=function(){if(this._disposed)Vb&&console.warn("Instance "+this.id+" has been disposed");else{this._disposed=!0,qn(this.getDom(),QA,"");var e=this._api,n=this._model;wA(this._componentsViews,function(t){t.dispose(n,e)}),wA(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete YA[this.id]}},r(is,hw);var BA={},VA={},jA=[],WA=[],UA=[],$A=[],qA={},GA={},YA={},ZA={},XA=new Date-0,KA=new Date-0,QA="_echarts_instance_",JA={},tD=Ts;Fs(EA,iA),ks(NT),Es(IA,RT),Hs("default",sA),Os({type:"highlight",event:"highlight",update:"highlight"},B),Os({type:"downplay",event:"downplay",update:"downplay"},B),Is("light",gA),Is("dark",xA);var eD={};Ys.prototype={constructor:Ys,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,n={},i=[],r=[];for(Zs(t,{},i,"_oldKeyGetter",this),Zs(e,n,r,"_newKeyGetter",this),o=0;o<t.length;o++){if(null!=(s=n[a=i[o]]))(u=s.length)?(1===u&&(n[a]=null),s=s.unshift()):n[a]=null,this._update&&this._update(s,o);else this._remove&&this._remove(o)}for(var o=0;o<r.length;o++){var a=r[o];if(n.hasOwnProperty(a)){var s;if(null==(s=n[a]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var nD=z(["tooltip","label","itemName","itemId","seriesName"]),iD=b,rD="undefined",oD="e\0\0",aD={"float":typeof Float64Array===rD?Array:Float64Array,"int":typeof Int32Array===rD?Array:Int32Array,ordinal:Array,number:Array,time:Array},sD=typeof Uint32Array===rD?Array:Uint32Array,lD=typeof Uint16Array===rD?Array:Uint16Array,uD=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],cD=["_extent","_approximateExtent","_rawExtent"],hD=function(t,e){t=t||["x","y"];for(var n={},i=[],r={},o=0;o<t.length;o++){var a=t[o];w(a)&&(a={name:a});var s=a.name;a.type=a.type||"float",a.coordDim||(a.coordDim=s,a.coordDimIndex=0),a.otherDims=a.otherDims||{},i.push(s),(n[s]=a).index=o,a.createInvertedIndices&&(r[s]=[])}this.dimensions=i,this._dimensionInfos=n,this.hostModel=e,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=Xs(this),this._invertedIndicesMap=r,this._calculationInfo={}},dD=hD.prototype;dD.type="list",dD.hasItemOption=!0,dD.getDimension=function(t){return isNaN(t)||(t=this.dimensions[t]||t),t},dD.getDimensionInfo=function(t){return this._dimensionInfos[this.getDimension(t)]},dD.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},dD.mapDimension=function(t,e){var n=this._dimensionsSummary;if(null==e)return n.encodeFirstDimNotExtra[t];var i=n.encode[t];return!0===e?(i||[]).slice():i&&i[e]},dD.initData=function(t,e,n){var i=Co.isInstance(t)||P(t);if(i&&(t=new ha(t,this.dimensions.length)),Vb&&!i&&("function"!=typeof t.getItem||"function"!=typeof t.count))throw new Error("Inavlid data provider.");this._rawData=t,this._storage={},this._indices=null,this._nameList=e||[],this._idList=[],this._nameRepeatCount={},n||(this.hasItemOption=!1),this.defaultDimValueGetter=BT[this._rawData.getSource().sourceFormat],this._dimValueGetter=n=n||this.defaultDimValueGetter,this._rawExtent={},this._initDataFromProvider(0,t.count()),t.pure&&(this.hasItemOption=!1)},dD.getProvider=function(){return this._rawData},dD.appendData=function(t){Vb&&T(!this._indices,"appendData can only be called on raw data.");var e=this._rawData,n=this.count();e.appendData(t);var i=e.count();e.persistent||(i+=n),this._initDataFromProvider(n,i)},dD._initDataFromProvider=function(t,e){if(!(e<=t)){for(var n,i=this._chunkSize,r=this._rawData,o=this._storage,a=this.dimensions,s=a.length,l=this._dimensionInfos,u=this._nameList,c=this._idList,h=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=f-1,g=0;g<s;g++){h[A=a[g]]||(h[A]=hl());var m=l[A];0===m.otherDims.itemName&&(n=this._nameDimIdx=g),0===m.otherDims.itemId&&(this._idDimIdx=g);var v=aD[m.type];o[A]||(o[A]=[]);var y=o[A][p];if(y&&y.length<i){for(var x=new v(Math.min(e-p*i,i)),b=0;b<y.length;b++)x[b]=y[b];o[A][p]=x}for(var w=f*i;w<e;w+=i)o[A].push(new v(Math.min(e-w,i)));this._chunkCount=o[A].length}for(var _=new Array(s),S=t;S<e;S++){_=r.getItem(S,_);var C=Math.floor(S/i),T=S%i;for(w=0;w<s;w++){var A,D=o[A=a[w]][C],M=this._dimValueGetter(_,A,S,w);D[T]=M;var I=h[A];M<I[0]&&(I[0]=M),M>I[1]&&(I[1]=M)}if(!r.pure){var k=u[S];if(_&&null==k)if(null!=_.name)u[S]=k=_.name;else if(null!=n){var E=a[n],L=o[E][C];if(L){k=L[T];var O=l[E].ordinalMeta;O&&O.categories.length&&(k=O.categories[k])}}var P=null==_?null:_.id;null==P&&null!=k&&(d[k]=d[k]||0,0<d[P=k]&&(P+="__ec__"+d[k]),d[k]++),null!=P&&(c[S]=P)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent={},nl(this)}},dD.count=function(){return this._count},dD.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i<n;i++)r[i]=t[i]}else r=new e(t.buffer,0,n)}else{var r=new(e=Js(this))(this.count());for(i=0;i<r.length;i++)r[i]=i}return r},dD.get=function(t,e){if(!(0<=e&&e<this._count))return NaN;var n=this._storage;if(!n[t])return NaN;e=this.getRawIndex(e);var i=Math.floor(e/this._chunkSize),r=e%this._chunkSize;return n[t][i][r]},dD.getByRawIndex=function(t,e){if(!(0<=e&&e<this._rawCount))return NaN;var n=this._storage[t];if(!n)return NaN;var i=Math.floor(e/this._chunkSize),r=e%this._chunkSize;return n[i][r]},dD._getFast=function(t,e){var n=Math.floor(e/this._chunkSize),i=e%this._chunkSize;return this._storage[t][n][i]},dD.getValues=function(t,e){var n=[];E(t)||(e=t,t=this.dimensions);for(var i=0,r=t.length;i<r;i++)n.push(this.get(t[i],e));return n},dD.hasValue=function(t){for(var e=this._dimensionsSummary.dataDimsOnCoord,n=this._dimensionInfos,i=0,r=e.length;i<r;i++)if("ordinal"!==n[e[i]].type&&isNaN(this.get(e[i],t)))return!1;return!0},dD.getDataExtent=function(t){t=this.getDimension(t);var e=this._storage[t],n=hl();if(!e)return n;var i,r=this.count();if(!this._indices)return this._rawExtent[t].slice();if(i=this._extent[t])return i.slice();for(var o=(i=n)[0],a=i[1],s=0;s<r;s++){var l=this._getFast(t,this.getRawIndex(s));l<o&&(o=l),a<l&&(a=l)}return i=[o,a],this._extent[t]=i},dD.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},dD.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},dD.getCalculationInfo=function(t){return this._calculationInfo[t]},dD.setCalculationInfo=function(t,e){iD(t)?O(this._calculationInfo,t):this._calculationInfo[t]=e},dD.getSum=function(t){var e=0;if(this._storage[t])for(var n=0,i=this.count();n<i;n++){var r=this.get(t,n);isNaN(r)||(e+=r)}return e},dD.getMedian=function(t){var e=[];this.each(t,function(t){isNaN(t)||e.push(t)});var n=[].concat(e).sort(function(t,e){return t-e}),i=this.count();return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},dD.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t];if(Vb&&!n)throw new Error("Do not supported yet");var i=n[e];return null==i||isNaN(i)?-1:i},dD.indexOfName=function(t){for(var e=0,n=this.count();e<n;e++)if(this.getName(e)===t)return e;return-1},dD.indexOfRawIndex=function(t){if(!this._indices)return t;if(t>=this._rawCount||t<0)return-1;var e=this._indices,n=e[t];if(null!=n&&n<this._count&&n===t)return t;for(var i=0,r=this._count-1;i<=r;){var o=(i+r)/2|0;if(e[o]<t)i=o+1;else{if(!(e[o]>t))return o;r=o-1}}return-1},dD.indicesOfNearest=function(t,e,n){var i=[];if(!this._storage[t])return i;null==n&&(n=Infinity);for(var r=Number.MAX_VALUE,o=-1,a=0,s=this.count();a<s;a++){var l=e-this.get(t,a),u=Math.abs(l);l<=n&&u<=r&&((u<r||0<=l&&o<0)&&(r=u,o=l,i.length=0),i.push(a))}return i},dD.getRawIndex=rl,dD.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],n=0;n<this.dimensions.length;n++){var i=this.dimensions[n];e.push(this.get(i,t))}return e},dD.getName=function(t){var e=this.getRawIndex(t);return this._nameList[e]||il(this,this._nameDimIdx,e)||""},dD.getId=function(t){return al(this,this.getRawIndex(t))},dD.each=function(t,e,n,i){if(this._count){"function"==typeof t&&(i=n,n=e,e=t,t=[]),n=n||i||this,t=A(sl(t),this.getDimension,this),Vb&&ll(this,t);for(var r=t.length,o=0;o<this.count();o++)switch(r){case 0:e.call(n,o);break;case 1:e.call(n,this.get(t[0],o),o);break;case 2:e.call(n,this.get(t[0],o),this.get(t[1],o),o);break;default:for(var a=0,s=[];a<r;a++)s[a]=this.get(t[a],o);s[a]=o,e.apply(n,s)}}},dD.filterSelf=function(t,e,n,i){if(this._count){"function"==typeof t&&(i=n,n=e,e=t,t=[]),n=n||i||this,t=A(sl(t),this.getDimension,this),Vb&&ll(this,t);for(var r=this.count(),o=new(Js(this))(r),a=[],s=t.length,l=0,u=t[0],c=0;c<r;c++){var h,d=this.getRawIndex(c);if(0===s)h=e.call(n,c);else if(1===s){var f=this._getFast(u,d);h=e.call(n,f,c)}else{for(var p=0;p<s;p++)a[p]=this._getFast(u,d);a[p]=c,h=e.apply(n,a)}h&&(o[l++]=d)}return l<r&&(this._indices=o),this._count=l,this._extent={},this.getRawIndex=this._indices?ol:rl,this}},dD.selectRange=function(t){if(this._count){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);Vb&&ll(this,e);var i=e.length;if(i){var r=this.count(),o=new(Js(this))(r),a=0,s=e[0],l=t[s][0],u=t[s][1],c=!1;if(!this._indices){var h=0;if(1===i){for(var d=this._storage[e[0]],f=0;f<this._chunkCount;f++)for(var p=d[f],g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){(l<=(w=p[m])&&w<=u||isNaN(w))&&(o[a++]=h),h++}c=!0}else if(2===i){d=this._storage[s];var v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1];for(f=0;f<this._chunkCount;f++){p=d[f];var b=v[f];for(g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){var w=p[m],_=b[m];(l<=w&&w<=u||isNaN(w))&&(y<=_&&_<=x||isNaN(_))&&(o[a++]=h),h++}}c=!0}}if(!c)if(1===i)for(m=0;m<r;m++){var S=this.getRawIndex(m);(l<=(w=this._getFast(s,S))&&w<=u||isNaN(w))&&(o[a++]=S)}else for(m=0;m<r;m++){var C=!0;for(S=this.getRawIndex(m),f=0;f<i;f++){var T=e[f];((w=this._getFast(n,S))<t[T][0]||w>t[T][1])&&(C=!1)}C&&(o[a++]=this.getRawIndex(m))}return a<r&&(this._indices=o),this._count=a,this._extent={},this.getRawIndex=this._indices?ol:rl,this}}},dD.mapArray=function(t,e,n,i){"function"==typeof t&&(i=n,n=e,e=t,t=[]),n=n||i||this;var r=[];return this.each(t,function(){r.push(e&&e.apply(this,arguments))},n),r},dD.map=function(t,e,n,i){n=n||i||this,t=A(sl(t),this.getDimension,this),Vb&&ll(this,t);var r=ul(this,t);r._indices=this._indices,r.getRawIndex=r._indices?ol:rl;for(var o=r._storage,a=[],s=this._chunkSize,l=t.length,u=this.count(),c=[],h=r._rawExtent,d=0;d<u;d++){for(var f=0;f<l;f++)c[f]=this.get(t[f],d);c[l]=d;var p=e&&e.apply(n,c);if(null!=p){"object"!=typeof p&&(a[0]=p,p=a);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<p.length;y++){var x=t[y],b=p[y],w=h[x],_=o[x];_&&(_[m][v]=b),b<w[0]&&(w[0]=b),b>w[1]&&(w[1]=b)}}}return r},dD.downSample=function(t,e,n,i){for(var r=ul(this,[t]),o=r._storage,a=[],s=Math.floor(1/e),l=o[t],u=this.count(),c=this._chunkSize,h=r._rawExtent[t],d=new(Js(this))(u),f=0,p=0;p<u;p+=s){u-p<s&&(s=u-p,a.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(p+g),v=Math.floor(m/c),y=m%c;a[g]=l[v][y]}var x=n(a),b=this.getRawIndex(Math.min(p+i(a,x)||0,u-1)),w=b%c;(l[Math.floor(b/c)][w]=x)<h[0]&&(h[0]=x),x>h[1]&&(h[1]=x),d[f++]=b}return r._count=f,r._indices=d,r.getRawIndex=ol,r},dD.getItemModel=function(t){var e=this.hostModel;return new Or(this.getRawDataItem(t),e,e&&e.ecModel)},dD.diff=function(e){var n=this;return new Ys(e?e.getIndices():[],this.getIndices(),function(t){return al(e,t)},function(t){return al(n,t)})},dD.getVisual=function(t){var e=this._visual;return e&&e[t]},dD.setVisual=function(t,e){if(iD(t))for(var n in t)t.hasOwnProperty(n)&&this.setVisual(n,t[n]);else this._visual=this._visual||{},this._visual[t]=e},dD.setLayout=function(t,e){if(iD(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},dD.getLayout=function(t){return this._layout[t]},dD.getItemLayout=function(t){return this._itemLayouts[t]},dD.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?O(this._itemLayouts[t]||{},e):e},dD.clearItemLayouts=function(){this._itemLayouts.length=0},dD.getItemVisual=function(t,e,n){var i=this._itemVisuals[t],r=i&&i[e];return null!=r||n?r:this.getVisual(e)},dD.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{},r=this.hasItemVisual;if(this._itemVisuals[t]=i,iD(e))for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o],r[o]=!0);else i[e]=n,r[e]=!0},dD.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var fD=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};dD.setItemGraphicEl=function(t,e){var n=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=n&&n.seriesIndex,"group"===e.type&&e.traverse(fD,e)),this._graphicEls[t]=e},dD.getItemGraphicEl=function(t){return this._graphicEls[t]},dD.eachItemGraphicEl=function(n,i){k(this._graphicEls,function(t,e){t&&n&&n.call(i,t,e)})},dD.cloneShallow=function(t){if(!t){var e=A(this.dimensions,this.getDimensionInfo,this);t=new hD(e,this.hostModel)}if(t._storage=this._storage,el(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?ol:rl,t},dD.wrapMethod=function(t,e){var n=this[t];"function"==typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(l(arguments)))})},dD.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],dD.CHANGABLE_METHODS=["filterSelf","selectRange"];var pD=function(t,e){return dl((e=e||{}).coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};wl.prototype.parse=function(t){return t},wl.prototype.getSetting=function(t){return this._setting[t]},wl.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},wl.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},wl.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},wl.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},wl.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},wl.prototype.getExtent=function(){return this._extent.slice()},wl.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},wl.prototype.isBlank=function(){return this._isBlank},wl.prototype.setBlank=function(t){this._isBlank=t},wl.prototype.getLabel=null,Xn(wl),ti(wl,{registerWhenExtend:!0}),_l.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&A(n,Cl);return new _l({categories:i,needCollect:!i,deduplication:!1!==e.dedplication})};var gD=_l.prototype;gD.getOrdinal=function(t){return Sl(this).get(t)},gD.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!=typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=Sl(this);return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e};var mD=wl.prototype,vD=wl.extend({type:"ordinal",init:function(t,e){t&&!E(t)||(t=new _l({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),mD.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return mD.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(mD.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push(n),n++;return t},getLabel:function(t){if(!this.isBlank())return this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:B,niceExtent:B});vD.create=function(){return new vD};var yD=jr,xD=jr,bD=wl.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),bD.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Al(t)},getTicks:function(){return Il(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=$r(t)||0:"auto"===n&&(n=this._intervalPrecision),no(t=xD(t,n,!0))},niceTicks:function(t,e,n){t=t||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){r<0&&(r=-r,i.reverse());var o=Tl(i,t,e,n);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var n=e[0];t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;var i=e[1]-e[0];isFinite(i)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var r=this._interval;t.fixMin||(e[0]=xD(Math.floor(e[0]/r)*r)),t.fixMax||(e[1]=xD(Math.ceil(e[1]/r)*r))}});bD.create=function(){return new bD};var wD="__ec_stack_",_D=.5,SD="undefined"!=typeof Float32Array?Float32Array:Array,CD={seriesType:"bar",plan:ZT(),reset:function(t){function e(t,e){for(var n,i=new SD(2*t.count),r=[],o=[],a=0;null!=(n=t.next());)o[f]=e.get(c,n),o[1-f]=e.get(h,n),r=s.dataToPoint(o,null,r),i[a++]=r[0],i[a++]=r[1];e.setLayout({largePoints:i,barWidth:p,valueAxisStart:Bl(l,u,!1),valueAxisHorizontal:d})}if(zl(t)&&Hl(t)){var n=t.getData(),s=t.coordinateSystem,l=s.getBaseAxis(),u=s.getOtherAxis(l),c=n.mapDimension(u.dim),h=n.mapDimension(l.dim),d=u.isHorizontal(),f=d?0:1,p=Rl(Pl([t]),l,t).width;return _D<p||(p=_D),{progress:e}}}},TD=bD.prototype,AD=Math.ceil,DD=Math.floor,MD=1e3,ID=60*MD,kD=60*ID,ED=24*kD,LD=function(t,e,n,i){for(;n<i;){var r=n+i>>>1;t[r][1]<e?n=r+1:i=r}return n},OD=bD.extend({type:"time",getLabel:function(t){var e=this._stepLvl,n=new Date(t);return uo(e[0],n,this.getSetting("useUTC"))},niceExtent:function(t){var e=this._extent;if(e[0]===e[1]&&(e[0]-=ED,e[1]+=ED),e[1]===-Infinity&&e[0]===Infinity
|
|
){var n=new Date;e[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),e[0]=e[1]-ED}this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var i=this._interval;t.fixMin||(e[0]=jr(DD(e[0]/i)*i)),t.fixMax||(e[1]=jr(AD(e[1]/i)*i))},niceTicks:function(t,e,n){t=t||10;var i=this._extent,r=i[1]-i[0],o=r/t;null!=e&&o<e&&(o=e),null!=n&&n<o&&(o=n);var a=PD.length,s=LD(PD,o,0,a),l=PD[Math.min(s,a-1)],u=l[1];"year"===l[0]&&(u*=Jr(r/u/t,!0));var c=this.getSetting("useUTC")?0:60*new Date(+i[0]||+i[1]).getTimezoneOffset()*1e3,h=[Math.round(AD((i[0]-c)/u)*u+c),Math.round(DD((i[1]-c)/u)*u+c)];Ml(h,i),this._stepLvl=l,this._interval=u,this._niceExtent=h},parse:function(t){return+Xr(t)}});k(["contain","normalize"],function(e){OD.prototype[e]=function(t){return TD[e].call(this,this.parse(t))}});var PD=[["hh:mm:ss",MD],["hh:mm:ss",5*MD],["hh:mm:ss",10*MD],["hh:mm:ss",15*MD],["hh:mm:ss",30*MD],["hh:mm\nMM-dd",ID],["hh:mm\nMM-dd",5*ID],["hh:mm\nMM-dd",10*ID],["hh:mm\nMM-dd",15*ID],["hh:mm\nMM-dd",30*ID],["hh:mm\nMM-dd",kD],["hh:mm\nMM-dd",2*kD],["hh:mm\nMM-dd",6*kD],["hh:mm\nMM-dd",12*kD],["MM-dd\nyyyy",ED],["MM-dd\nyyyy",2*ED],["MM-dd\nyyyy",3*ED],["MM-dd\nyyyy",4*ED],["MM-dd\nyyyy",5*ED],["MM-dd\nyyyy",6*ED],["week",7*ED],["MM-dd\nyyyy",10*ED],["week",14*ED],["week",21*ED],["month",31*ED],["week",42*ED],["month",62*ED],["week",42*ED],["quarter",380*ED/4],["month",31*ED*4],["month",31*ED*5],["half-year",380*ED/2],["month",31*ED*8],["month",31*ED*10],["year",380*ED]];OD.create=function(t){return new OD({useUTC:t.ecModel.get("useUTC")})};var ND=wl.prototype,RD=bD.prototype,FD=$r,zD=jr,HD=Math.floor,BD=Math.ceil,VD=Math.pow,jD=Math.log,WD=wl.extend({type:"log",base:10,$constructor:function(){wl.apply(this,arguments),this._originalScale=new bD},getTicks:function(){var n=this._originalScale,i=this._extent,r=n.getExtent();return A(RD.getTicks.call(this),function(t){var e=jr(VD(this.base,t));return e=t===i[0]&&n.__fixMin?Vl(e,r[0]):e,e=t===i[1]&&n.__fixMax?Vl(e,r[1]):e},this)},getLabel:RD.getLabel,scale:function(t){return t=ND.scale.call(this,t),VD(this.base,t)},setExtent:function(t,e){var n=this.base;t=jD(t)/jD(n),e=jD(e)/jD(n),RD.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=ND.getExtent.call(this);e[0]=VD(t,e[0]),e[1]=VD(t,e[1]);var n=this._originalScale,i=n.getExtent();return n.__fixMin&&(e[0]=Vl(e[0],i[0])),n.__fixMax&&(e[1]=Vl(e[1],i[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=jD(t[0])/jD(e),t[1]=jD(t[1])/jD(e),ND.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===Infinity||n<=0)){var i=Kr(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&0<Math.abs(i);)i*=10;var r=[jr(BD(e[0]/i)*i),jr(HD(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},niceExtent:function(t){RD.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});k(["contain","normalize"],function(e){WD.prototype[e]=function(t){return t=jD(t)/jD(this.base),ND[e].call(this,t)}}),WD.create=function(){return new WD};var UD={getMin:function(t){var e=this.option,n=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=n&&"dataMin"!==n&&"function"!=typeof n&&!C(n)&&(n=this.axis.scale.parse(n)),n},getMax:function(t){var e=this.option,n=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=n&&"dataMax"!==n&&"function"!=typeof n&&!C(n)&&(n=this.axis.scale.parse(n)),n},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:B,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},$D=$i({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,o=e.height/2;t.moveTo(n,i-o),t.lineTo(n+r,i+o),t.lineTo(n-r,i+o),t.closePath()}}),qD=$i({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,o=e.height/2;t.moveTo(n,i-o),t.lineTo(n+r,i),t.lineTo(n,i+o),t.lineTo(n-r,i),t.closePath()}}),GD=$i({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,r=e.width/5*3,o=Math.max(r,e.height),a=r/2,s=a*a/(o-a),l=i-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),f=.6*a,p=.7*a;t.moveTo(n-c,l+s),t.arc(n,l,a,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+c-h*f,l+s+d*f,n,i-p,n,i),t.bezierCurveTo(n,i-p,n-c+h*f,l+s+d*f,n-c,l+s),t.closePath()}}),YD=$i({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,i=e.width,r=e.x,o=e.y,a=i/3*2;t.moveTo(r,o),t.lineTo(r+a,o+n),t.lineTo(r,o+n/4*3),t.lineTo(r-a,o+n),t.lineTo(r,o),t.closePath()}}),ZD={line:function(t,e,n,i,r){r.x1=t,r.y1=e+i/2,r.x2=t+n,r.y2=e+i/2},rect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i},roundRect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(t,e,n,i,r){var o=Math.min(n,i);r.x=t,r.y=e,r.width=o,r.height=o},circle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.r=Math.min(n,i)/2},diamond:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i},pin:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},arrow:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},triangle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i}},XD={};k({line:xC,rect:yC,roundRect:yC,square:yC,circle:uC,diamond:qD,pin:GD,arrow:YD,triangle:$D},function(t,e){XD[e]=new t});var KD=$i({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style;"pin"===this.shape.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,n){var i=e.symbolType,r=XD[i];"none"!==e.symbolType&&(r||(r=XD[i="rect"]),ZD[i](e.x,e.y,e.width,e.height,r.shape),r.buildPath(t,r.shape,n))}}),QD={isDimensionStacked:ml,enableDataStack:gl,getStackedDimension:vl},JD=(Object.freeze||Object)({createList:Jl,getLayoutRect:po,dataStack:QD,createScale:tu,mixinAxisModelCommonMethods:eu,completeDimensions:dl,createDimensions:pD,createSymbol:Ql}),tM=1e-8;ru.prototype={constructor:ru,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,n=[e,e],i=[-e,-e],r=[],o=[],a=this.geometries,s=0;s<a.length;s++){if("polygon"===a[s].type)gi(a[s].exterior,r,o),at(n,n,r),st(i,i,o)}return 0===s&&(n[0]=n[1]=i[0]=i[1]=0),this._rect=new ie(n[0],n[1],i[0]-n[0],i[1]-n[1])},contain:function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,r=n.length;i<r;i++)if("polygon"===n[i].type){var o=n[i].exterior,a=n[i].interiors;if(iu(o,t[0],t[1])){for(var s=0;s<(a?a.length:0);s++)if(iu(a[s]))continue t;return!0}}return!1},transformTo:function(t,e,n,i){var r=this.getBoundingRect(),o=r.width/r.height;n?i||(i=n/o):n=o*i;for(var a=new ie(t,e,n,i),s=r.calculateTransform(a),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var c=l[u].exterior,h=l[u].interiors,d=0;d<c.length;d++)ot(c[d],c[d],s);for(var f=0;f<(h?h.length:0);f++)for(d=0;d<h[f].length;d++)ot(h[f][d],h[f][d],s)}(r=this._rect).copy(a),this.center=[r.x+r.width/2,r.y+r.height/2]}};var eM=function(t){return ou(t),A(f(t.features,function(t){return t.geometry&&t.properties&&0<t.geometry.coordinates.length}),function(t){var e=t.properties,n=t.geometry,i=n.coordinates,r=[];"Polygon"===n.type&&r.push({type:"polygon",exterior:i[0],interiors:i.slice(1)}),"MultiPolygon"===n.type&&k(i,function(t){t[0]&&r.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var o=new ru(e.name,r,e.cp);return o.properties=e,o})},nM=Wn(),iM=[0,1],rM=function(t,e,n){this.dim=t,this.scale=e,this._extent=n||[0,0],this.inverse=!1,this.onBand=!1};rM.prototype={constructor:rM,contain:function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return n<=t&&t<=i},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return qr(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var n=this._extent;n[0]=t,n[1]=e},dataToCoord:function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&_u(n=n.slice(),i.count()),Br(t,iM,n,e)},coordToData:function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&_u(n=n.slice(),i.count());var r=Br(t,n,iM,e);return this.scale.scale(r)},pointToData:function(){},getTicksCoords:function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=lu(this,e),i=A(n.ticks,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this),r=e.get("alignWithLabel");return Su(this,i,n.tickCategoryInterval,r,t.clamp),i},getViewLabels:function(){return su(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return vu(this)}};var oM=eM,aM={};k(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){aM[t]=iw[t]}),qT.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t){if(Vb){var e=t.coordinateSystem;if("polar"!==e&&"cartesian2d"!==e)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return yl(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:Infinity}});var sM=Tu.prototype,lM=Tu.getSymbolSize=function(t,e){var n=t.getItemVisual(e,"symbolSize");return n instanceof Array?n.slice():[+n,+n]};sM._createSymbol=function(t,e,n,i,r){this.removeAll();var o=Ql(t,-1,-1,2,2,e.getItemVisual(n,"color"),r);o.attr({z2:100,culling:!0,scale:Au(i)}),o.drift=Du,this._symbolType=t,this.add(o)},sM.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},sM.getSymbolPath=function(){return this.childAt(0)},sM.getScale=function(){return this.childAt(0).scale},sM.highlight=function(){this.childAt(0).trigger("emphasis")},sM.downplay=function(){this.childAt(0).trigger("normal")},sM.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},sM.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":"pointer"},sM.updateData=function(t,e,n){this.silent=!1;var i=t.getItemVisual(e,"symbol")||"circle",r=t.hostModel,o=lM(t,e),a=i!==this._symbolType;if(a){var s=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(i,t,e,o,s)}else{(l=this.childAt(0)).silent=!1,Cr(l,{scale:Au(o)},r,e)}if(this._updateCommon(t,e,o,n),a){var l=this.childAt(0),u=n&&n.fadeIn,c={scale:l.scale.slice()};u&&(c.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),Tr(l,c,r,e)}this._seriesModel=r};var uM=["itemStyle"],cM=["emphasis","itemStyle"],hM=["label"],dM=["emphasis","label"];sM._updateCommon=function(e,t,n,i){function r(t){return w?e.getName(t):Cu(e,t)}var o=this.childAt(0),a=e.hostModel,s=e.getItemVisual(t,"color");"image"!==o.type&&o.useStyle({strokeNoScale:!0});var l=i&&i.itemStyle,u=i&&i.hoverItemStyle,c=i&&i.symbolRotate,h=i&&i.symbolOffset,d=i&&i.labelModel,f=i&&i.hoverLabelModel,p=i&&i.hoverAnimation,g=i&&i.cursorStyle;if(!i||e.hasItemOption){var m=i&&i.itemModel?i.itemModel:e.getItemModel(t);l=m.getModel(uM).getItemStyle(["color"]),u=m.getModel(cM).getItemStyle(),c=m.getShallow("symbolRotate"),h=m.getShallow("symbolOffset"),d=m.getModel(hM),f=m.getModel(dM),p=m.getShallow("hoverAnimation"),g=m.getShallow("cursor")}else u=O({},u);var v=o.style;o.attr("rotation",(c||0)*Math.PI/180||0),h&&o.attr("position",[Vr(h[0],n[0]),Vr(h[1],n[1])]),g&&o.attr("cursor",g),o.setColor(s,i&&i.symbolInnerColor),o.setStyle(l);var y=e.getItemVisual(t,"opacity");null!=y&&(v.opacity=y);var x=e.getItemVisual(t,"liftZ"),b=o.__z2Origin;null!=x?null==b&&(o.__z2Origin=o.z2,o.z2+=x):null!=b&&(o.z2=b,o.__z2Origin=null);var w=i&&i.useNameLabel;fr(v,u,d,f,{labelFetcher:a,labelDataIndex:t,defaultText:r,isRectText:!0,autoColor:s}),o.off("mouseover").off("mouseout").off("emphasis").off("normal"),o.hoverStyle=u,dr(o);var _=Au(n);if(p&&a.isAnimationEnabled()){var S=function(){if(!this.incremental){var t=_[1]/_[0];this.animateTo({scale:[Math.max(1.1*_[0],_[0]+3),Math.max(1.1*_[1],_[1]+3*t)]},400,"elasticOut")}},C=function(){this.incremental||this.animateTo({scale:_},400,"elasticOut")};o.on("mouseover",S).on("mouseout",C).on("emphasis",S).on("normal",C)}},sM.fadeOut=function(t,e){var n=this.childAt(0);this.silent=n.silent=!0,(!e||!e.keepLabel)&&(n.style.text=null),Cr(n,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,t)},o(Tu,Xw);var fM=Mu.prototype;fM.updateData=function(r,o){o=ku(o);var a=this.group,s=r.hostModel,l=this._data,u=this._symbolCtor,c=Eu(r);l||a.removeAll(),r.diff(l).add(function(t){var e=r.getItemLayout(t);if(Iu(r,e,t,o)){var n=new u(r,t,c);n.attr("position",e),r.setItemGraphicEl(t,n),a.add(n)}}).update(function(t,e){var n=l.getItemGraphicEl(e),i=r.getItemLayout(t);Iu(r,i,t,o)?(n?(n.updateData(r,t,c),Cr(n,{position:i},s)):(n=new u(r,t)).attr("position",i),a.add(n),r.setItemGraphicEl(t,n)):a.remove(n)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&e.fadeOut(function(){a.remove(e)})}).execute(),this._data=r},fM.isPersistent=function(){return!0},fM.updateLayout=function(){var i=this._data;i&&i.eachItemGraphicEl(function(t,e){var n=i.getItemLayout(e);t.attr("position",n)})},fM.incrementalPrepareUpdate=function(t){this._seriesScope=Eu(t),this._data=null,this.group.removeAll()},fM.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=t.useHoverLayer=!0)}n=ku(n);for(var r=t.start;r<t.end;r++){var o=e.getItemLayout(r);if(Iu(e,o,r,n)){var a=new this._symbolCtor(e,r,this._seriesScope);a.traverse(i),a.attr("position",o),this.group.add(a),e.setItemGraphicEl(r,a)}}},fM.remove=function(t){var e=this.group,n=this._data;n&&t?n.eachItemGraphicEl(function(t){t.fadeOut(function(){e.remove(t)})}):e.removeAll()};var pM=function(t,e,n,i,r,o,a,s){for(var l=Nu(t,e),u=[],c=[],h=[],d=[],f=[],p=[],g=[],m=Lu(r,e,a),v=Lu(o,t,s),y=0;y<l.length;y++){var x=l[y],b=!0;switch(x.cmd){case"=":var w=t.getItemLayout(x.idx),_=e.getItemLayout(x.idx1);(isNaN(w[0])||isNaN(w[1]))&&(w=_.slice()),u.push(w),c.push(_),h.push(n[x.idx]),d.push(i[x.idx1]),g.push(e.getRawIndex(x.idx1));break;case"+":var S=x.idx;u.push(r.dataToPoint([e.get(m.dataDimsForPoint[0],S),e.get(m.dataDimsForPoint[1],S)])),c.push(e.getItemLayout(S).slice()),h.push(Pu(m,r,e,S)),d.push(i[S]),g.push(e.getRawIndex(S));break;case"-":S=x.idx;var C=t.getRawIndex(S);C!==S?(u.push(t.getItemLayout(S)),c.push(o.dataToPoint([t.get(v.dataDimsForPoint[0],S),t.get(v.dataDimsForPoint[1],S)])),h.push(n[S]),d.push(Pu(v,o,t,S)),g.push(C)):b=!1}b&&(f.push(x),p.push(p.length))}p.sort(function(t,e){return g[t]-g[e]});var T=[],A=[],D=[],M=[],I=[];for(y=0;y<p.length;y++){S=p[y];T[y]=u[S],A[y]=c[S],D[y]=h[S],M[y]=d[S],I[y]=f[S]}return{current:T,next:A,stackedOnCurrent:D,stackedOnNext:M,status:I}},gM=at,mM=st,vM=q,yM=j,xM=[],bM=[],wM=[],_M=Pi.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:hC(Pi.prototype.brush),buildPath:function(t,e){var n=e.points,i=0,r=n.length,o=Bu(n,e.smoothConstraint);if(e.connectNulls){for(;0<r&&Ru(n[r-1]);r--);for(;i<r&&Ru(n[i]);i++);}for(;i<r;)i+=Fu(t,n,i,r,r,1,o.min,o.max,e.smooth,e.smoothMonotone,e.connectNulls)+1}}),SM=Pi.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:hC(Pi.prototype.brush),buildPath:function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length,a=e.smoothMonotone,s=Bu(n,e.smoothConstraint),l=Bu(i,e.smoothConstraint);if(e.connectNulls){for(;0<o&&Ru(n[o-1]);o--);for(;r<o&&Ru(n[r]);r++);}for(;r<o;){var u=Fu(t,n,r,o,o,1,s.min,s.max,e.smooth,a,e.connectNulls);Fu(t,i,r+u-1,u,o,-1,l.min,l.max,e.stackedOnSmooth,a,e.connectNulls),r+=u+1,t.closePath()}}});La.extend({type:"line",init:function(){var t=new Xw,e=new Mu;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,n){var i=t.coordinateSystem,r=this.group,o=t.getData(),a=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=o.mapArray(o.getItemLayout),u="polar"===i.type,c=this._coordSys,h=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=Uu(i,o,Lu(i,o,v)),x=t.get("showSymbol"),b=x&&!u&&Xu(t,o,i),w=this._data;w&&w.eachItemGraphicEl(function(t,e){t.__temp&&(r.remove(t),w.setItemGraphicEl(e,null))}),x||h.remove(),r.add(p);var _=!u&&t.get("step");d&&c.type===i.type&&_===this._step?(m&&!f?f=this._newPolygon(l,y,i,g):f&&!m&&(p.remove(f),f=this._polygon=null),p.setClipPath(Gu(i,!1,!1,t)),x&&h.updateData(o,{isIgnore:b,clipShape:Gu(i,!1,!0,t)}),o.eachItemGraphicEl(function(t){t.stopAnimation(!0)}),Vu(this._stackedOnPoints,y)&&Vu(this._points,l)||(g?this._updateAnimation(o,y,i,n,_,v):(_&&(l=Yu(l,i,_),y=Yu(y,i,_)),d.setShape({points:l}),f&&f.setShape({points:l,stackedOnPoints:y})))):(x&&h.updateData(o,{isIgnore:b,clipShape:Gu(i,!1,!0,t)}),_&&(l=Yu(l,i,_),y=Yu(y,i,_)),d=this._newPolyline(l,i,g),m&&(f=this._newPolygon(l,y,i,g)),p.setClipPath(Gu(i,!0,!1,t)));var S=Zu(o,i)||o.getVisual("color");d.useStyle(D(a.getLineStyle(),{fill:"none",stroke:S,lineJoin:"bevel"}));var C=t.get("smooth");if(C=ju(t.get("smooth")),d.setShape({smooth:C,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),f){var T=o.getCalculationInfo("stackedOnSeries"),A=0;f.useStyle(D(s.getAreaStyle(),{fill:S,opacity:.7,lineJoin:"bevel"})),T&&(A=ju(T.get("smooth"))),f.setShape({smooth:C,stackedOnSmooth:A,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=o,this._coordSys=i,this._stackedOnPoints=y,this._points=l,this._step=_,this._valueOrigin=v},dispose:function(){},highlight:function(t,e,n,i){var r=t.getData(),o=jn(r,i);if(!(o instanceof Array)&&null!=o&&0<=o){var a=r.getItemGraphicEl(o);if(!a){var s=r.getItemLayout(o);if(!s)return;(a=new Tu(r,o)).position=s,a.setZ(t.get("zlevel"),t.get("z")),a.ignore=isNaN(s[0])||isNaN(s[1]),a.__temp=!0,r.setItemGraphicEl(o,a),a.stopSymbolAnimation(!0),this.group.add(a)}a.highlight()}else La.prototype.highlight.call(this,t,e,n,i)},downplay:function(t,e,n,i){var r=t.getData(),o=jn(r,i);if(null!=o&&0<=o){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else La.prototype.downplay.call(this,t,e,n,i)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new _M({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e},_newPolygon:function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new SM({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(n),this._polygon=n},_updateAnimation:function(t,e,n,i,r,o){var a=this._polyline,s=this._polygon,l=t.hostModel,u=pM(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,o),c=u.current,h=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;r&&(c=Yu(u.current,n,r),h=Yu(u.stackedOnCurrent,n,r),d=Yu(u.next,n,r),f=Yu(u.stackedOnNext,n,r)),a.shape.__points=u.current,a.shape.points=c,Cr(a,{shape:{points:d}},l),s&&(s.setShape({points:c,stackedOnPoints:h}),Cr(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;m<g.length;m++){if("="===g[m].cmd){var v=t.getItemGraphicEl(g[m].idx1);v&&p.push({el:v,ptIdx:m})}}a.animators&&a.animators.length&&a.animators[0].during(function(){for(var t=0;t<p.length;t++){p[t].el.attr("position",a.shape.__points[p[t].ptIdx])}})},remove:function(){var n=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl(function(t,e){t.__temp&&(n.remove(t),i.setItemGraphicEl(e,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});var CM=function(t,a,s){return{seriesType:t,performRawSeries:!0,reset:function(l,t){function e(t,e){if("function"==typeof u){var n=l.getRawValue(e),i=l.getDataParams(e);t.setItemVisual(e,"symbolSize",u(n,i))}if(t.hasItemOption){var r=t.getItemModel(e),o=r.getShallow("symbol",!0),a=r.getShallow("symbolSize",!0),s=r.getShallow("symbolKeepAspect",!0);null!=o&&t.setItemVisual(e,"symbol",o),null!=a&&t.setItemVisual(e,"symbolSize",a),null!=s&&t.setItemVisual(e,"symbolKeepAspect",s)}}var n=l.getData(),i=l.get("symbol")||a,u=l.get("symbolSize"),r=l.get("symbolKeepAspect");if(n.setVisual({legendSymbol:s||i,symbol:i,symbolSize:u,symbolKeepAspect:r}),!t.isSeriesFiltered(l)){var o="function"==typeof u;return{dataEach:n.hasItemOption||o?e:null}}}}},TM=function(t){return{seriesType:t,plan:ZT(),reset:function(t){function e(t,e){for(var n=t.end-t.start,i=d&&new Float32Array(n*p),r=t.start,o=0,a=[],s=[];r<t.end;r++){var l;if(1===p){var u=e.get(f[0],r);l=!isNaN(u)&&h.dataToPoint(u,null,s)}else{u=a[0]=e.get(f[0],r);var c=a[1]=e.get(f[1],r);l=!isNaN(u)&&!isNaN(c)&&h.dataToPoint(a,null,s)}d?(i[o++]=l?l[0]:NaN,i[o++]=l?l[1]:NaN):e.setItemLayout(r,l&&l.slice()||[NaN,NaN])}d&&e.setLayout("symbolPoints",i)}var n=t.getData(),h=t.coordinateSystem,d=t.pipelineContext.large;if(h){var f=A(h.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),p=f.length,i=n.getCalculationInfo("stackResultDimension");return ml(n,f[0])&&(f[0]=i),ml(n,f[1])&&(f[1]=i),p&&{progress:e}}}}},AM={average:function(t){for(var e=0,n=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],n++);return 0===n?NaN:e/n},sum:function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n]||0;return e},max:function(t){for(var e=-Infinity,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=Infinity,n=0;n<t.length;n++)t[n]<e&&(e=t[n]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},DM=function(t){return Math.round(t.length/2)},MM=function(t){return{seriesType:t,modifyOutputEnd:!0,reset:function(t){var e=t.getData(),n=t.get("sampling"),i=t.coordinateSystem;if("cartesian2d"===i.type&&n){var r,o=i.getBaseAxis(),a=i.getOtherAxis(o),s=o.getExtent(),l=s[1]-s[0],u=Math.round(e.count()/l);if(1<u)"string"==typeof n?r=AM[n]:"function"==typeof n&&(r=n),r&&t.setData(e.downSample(e.mapDimension(a.dim),1/u,r,DM))}}}},IM=function(t){this._axes={},this._dimList=[],this.name=t||""};IM.prototype={constructor:IM,type:"cartesian",getAxis:function(t){return this._axes[t]},getAxes:function(){return A(this._dimList,Qu,this)},getAxesByScale:function(e){return e=e.toLowerCase(),f(this.getAxes(),function(t){return t.scale.type===e})},addAxis:function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},dataToCoord:function(t){return this._dataCoordConvert(t,"dataToCoord")},coordToData:function(t){return this._dataCoordConvert(t,"coordToData")},_dataCoordConvert:function(t,e){for(var n=this._dimList,i=t instanceof Array?[]:{},r=0;r<n.length;r++){var o=n[r],a=this._axes[o];i[o]=a[e](t[o])}return i}},Ju.prototype={constructor:Ju,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},dataToPoint:function(t,e,n){var i=this.getAxis("x"),r=this.getAxis("y");return(n=n||[])[0]=i.toGlobalCoord(i.dataToCoord(t[0])),n[1]=r.toGlobalCoord(r.dataToCoord(t[1])),n},clampData:function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},pointToData:function(t,e){var n=this.getAxis("x"),i=this.getAxis("y");return(e=e||[])[0]=n.coordToData(n.toLocalCoord(t[0])),e[1]=i.coordToData(i.toLocalCoord(t[1])),e},getOtherAxis:function(t){return this.getAxis("x"===t.dim?"y":"x")}},o(Ju,IM);var kM=function(t,e,n,i,r){rM.call(this,t,e,n),this.type=i||"value",this.position=r||"bottom"};kM.prototype={constructor:kM,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},getGlobalExtent:function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},o(kM,rM);var EM={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},LM={};LM.categoryAxis=g({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},EM),LM.valueAxis=g({boundaryGap:[0,0],splitNumber:5},EM),LM.timeAxis=D({scale:!0,min:"dataMin",max:"dataMax"},LM.valueAxis),LM.logAxis=D({scale:!0,logBase:10},LM.valueAxis);var OM=["value","category","time","log"],PM=function(o,t,a,e){k(OM,function(r){t.extend({type:o+"Axis."+r,mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?yo(t):{};g(t,e.getTheme().get(r+"Axis")),g(t,this.getDefaultOption()),t.type=a(o,t),n&&vo(t,i,n)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=_l.createByAxisModel(this))},getCategories:function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:c([{},LM[r+"Axis"],e],!0)})}),oT.registerSubTypeDefaulter(o+"Axis",y(a,o))},NM=oT.extend({type:"cartesian2dAxis",axis:null,init:function(){NM.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){NM.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){NM.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});g(NM.prototype,UD);var RM={offset:0};PM("x",NM,tc,RM),PM("y",NM,tc,RM),oT.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var FM=nc.prototype;FM.type="grid",FM.axisPointerEnabled=!0,FM.getRect=function(){return this._rect},FM.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),k(n.x,function(t){Ul(t.scale,t.model)}),k(n.y,function(t){Ul(t.scale,t.model)}),k(n.x,function(t){ic(n,"y",t)}),k(n.y,function(t){ic(n,"x",t)}),this.resize(this.model,e)},FM.resize=function(t,e,n){function i(){k(o,function(t){var e=t.isHorizontal(),n=e?[0,r.width]:[0,r.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),oc(t,e?r.x:r.y)})}var r=po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=r;var o=this._axesList;i(),!n&&t.get("containLabel")&&(k(o,function(t){if(!t.model.get("axisLabel.inside")){var e=Zl(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get("axisLabel.margin");r[n]-=e[n]+i,"top"===t.position?r.y+=e.height+i:"left"===t.position&&(r.x+=e.width+i)}}}),i())},FM.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n){if(null==e)for(var i in n)if(n.hasOwnProperty(i))return n[i];return n[e]}},FM.getAxes=function(){return this._axesList.slice()},FM.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}b(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===t||r[i].getAxis("y").index===e)return r[i]},FM.getCartesians=function(){return this._coordsList.slice()},FM.convertToPixel=function(t,e,n){var i=this._findConvertTarget(t,e);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},FM.convertFromPixel=function(t,e,n){var i=this._findConvertTarget(t,e);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},FM._findConvertTarget=function(t,e){var n,i,r=e.seriesModel,o=e.xAxisModel||r&&r.getReferringComponents("xAxis")[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis")[0],s=e.gridModel,l=this._coordsList;if(r)x(l,n=r.coordinateSystem)<0&&(n=null);else if(o&&a)n=this.getCartesian(o.componentIndex,a.componentIndex);else if(o)i=this.getAxis("x",o.componentIndex);else if(a)i=this.getAxis("y",a.componentIndex);else if(s){s.coordinateSystem===this&&(n=this._coordsList[0])}return{cartesian:n,axis:i}},FM.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},FM._initCartesian=function(a,s){function t(o){return function(t,e){if(ec(t,a,s)){var n=t.get("position");"x"===o?"top"!==n&&"bottom"!==n&&l[n="bottom"]&&(n="top"===n?"bottom":"top"):"left"!==n&&"right"!==n&&l[n="left"]&&(n="left"===n?"right":"left"),l[n]=!0;var i=new kM(o,$l(t),[0,0],t.get("type"),n),r="category"===i.type;i.onBand=r&&t.get("boundaryGap"),i.inverse=t.get("inverse"),(t.axis=i).model=t,i.grid=this,i.index=e,this._axesList.push(i),u[o][e]=i,c[o]++}}}var l={left:!1,right:!1,top:!1,bottom:!1},u={x:{},y:{}},c={x:0,y:0};if(s.eachComponent("xAxis",t("x"),this),s.eachComponent("yAxis",t("y"),this),!c.x||!c.y)return this._axesMap={},void(this._axesList=[]);k((this._axesMap=u).x,function(r,o){k(u.y,function(t,e){var n="x"+o+"y"+e,i=new Ju(n);i.grid=this,i.model=a,this._coordsMap[n]=i,this._coordsList.push(i),i.addAxis(r),i.addAxis(t)},this)},this)},FM._updateScale=function(l,u){function c(e,n){k(e.mapDimension(n.dim,!0),function(t){n.scale.unionExtentFromData(e,vl(e,t))})}k(this._axesList,function(t){t.scale.setExtent(Infinity,-Infinity)}),l.eachSeries(function(t){if(sc(t)){var e=ac(t,l),n=e[0],i=e[1];if(!ec(n,u,l)||!ec(i,u,l))return;var r=this.getCartesian(n.componentIndex,i.componentIndex),o=t.getData(),a=r.getAxis("x"),s=r.getAxis("y");"list"===o.type&&(c(o,a,t),c(o,s,t))}},this)},FM.getTooltipAxes=function(i){var r=[],o=[];return k(this.getCartesians(),function(t){var e=null!=i&&"auto"!==i?t.getAxis(i):t.getBaseAxis(),n=t.getOtherAxis(e);x(r,e)<0&&r.push(e),x(o,n)<0&&o.push(n)}),{baseAxes:r,otherAxes:o}};var zM=["xAxis","yAxis"];nc.create=function(a,i){var r=[];return a.eachComponent("grid",function(t,e){var n=new nc(t,a,i);n.name="grid_"+e,n.resize(t,i,!0),t.coordinateSystem=n,r.push(n)}),a.eachSeries(function(t){if(sc(t)){var e=ac(t,a),n=e[0],i=e[1],r=n.getCoordSysModel();if(Vb){if(!r)throw new Error('Grid "'+N(n.get("gridIndex"),n.get("gridId"),0)+'" not found');if(n.getCoordSysModel()!==i.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var o=r.coordinateSystem;t.coordinateSystem=o.getCartesian(n.componentIndex,i.componentIndex)}}),r},nc.dimensions=nc.prototype.dimensions=Ju.prototype.dimensions,qo.register("cartesian2d",nc);var HM=Math.PI,BM=function(t,e){this.opt=e,this.axisModel=t,D(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new Xw;var n=new Xw({position:e.position.slice(),rotation:e.rotation});n.updateTransform(),this._transform=n.transform,this._dumbGroup=n};BM.prototype={constructor:BM,hasBuilder:function(t){return!!VM[t]},add:function(t){VM[t].call(this)},getGroup:function(){return this.group}};var VM={axisLine:function(){var o=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var e=this.axisModel.axis.getExtent(),n=this._transform,a=[e[0],0],i=[e[1],0];n&&(ot(
|
|
a,a,n),ot(i,i,n));var s=O({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new xC(Ki({anid:"line",shape:{x1:a[0],y1:a[1],x2:i[0],y2:i[1]},style:s,strokeContainThreshold:o.strokeContainThreshold||5,silent:!0,z2:1})));var l=t.get("axisLine.symbol"),r=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=l){"string"==typeof l&&(l=[l,l]),"string"!=typeof r&&"number"!=typeof r||(r=[r,r]);var c=r[0],h=r[1];k([{rotate:o.rotation+Math.PI/2,offset:u[0],r:0},{rotate:o.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((a[0]-i[0])*(a[0]-i[0])+(a[1]-i[1])*(a[1]-i[1]))}],function(t,e){if("none"!==l[e]&&null!=l[e]){var n=Ql(l[e],-c/2,-h/2,c,h,s.stroke,!0),i=t.r+t.offset,r=[a[0]+i*Math.cos(o.rotation),a[1]-i*Math.sin(o.rotation)];n.attr({rotation:t.rotate,position:r,silent:!0}),this.group.add(n)}},this)}}},axisTickLabel:function(){var t=this.axisModel,e=this.opt,n=gc(this,t,e);hc(t,mc(this,t,e),n)},axisName:function(){var t=this.opt,e=this.axisModel,n=N(t.axisName,e.get("name"));if(n){var i,r,o=e.get("nameLocation"),a=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=this.axisModel.axis.getExtent(),c=u[0]>u[1]?-1:1,h=["start"===o?u[0]-c*l:"end"===o?u[1]+c*l:(u[0]+u[1])/2,pc(o)?t.labelOffset+a*l:0],d=e.get("nameRotate");null!=d&&(d=d*HM/180),pc(o)?i=jM(t.rotation,null!=d?d:t.rotation,a):(i=uc(t,o,d||0,u),null!=(r=t.axisNameAvailableWidth)&&(r=Math.abs(r/Math.sin(i.rotation)),!isFinite(r)&&(r=null)));var f=s.getFont(),p=e.get("nameTruncate",!0)||{},g=p.ellipsis,m=N(t.nameTruncateMaxWidth,p.maxWidth,r),v=null!=g&&null!=m?XC(n,m,f,g,{minChar:2,placeholder:p.placeholder}):n,y=e.get("tooltip",!0),x=e.mainType,b={componentType:x,name:n,$vars:["name"]};b[x+"Index"]=e.componentIndex;var w=new lC({anid:"name",__fullText:n,__truncatedText:v,position:h,rotation:i.rotation,silent:cc(e),z2:1,tooltip:y&&y.show?O({content:n,formatter:function(){return n},formatterParams:b},y):null});pr(w.style,s,{text:v,textFont:f,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:i.textAlign,textVerticalAlign:i.textVerticalAlign}),e.get("triggerEvent")&&(w.eventData=lc(e),w.eventData.targetType="axisName",w.eventData.name=n),this._dumbGroup.add(w),w.updateTransform(),this.group.add(w),w.decomposeTransform()}}},jM=BM.innerTextLayout=function(t,e,n){var i,r,o=Yr(e-t);return Zr(o)?(r=0<n?"top":"bottom",i="center"):Zr(o-HM)?(r=0<n?"bottom":"top",i="center"):(r="middle",i=0<o&&o<HM?0<n?"right":"left":0<n?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},WM=k,UM=y,$M=Vs({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,n,i){this.axisPointerClass&&Sc(t),$M.superApply(this,"render",arguments),Mc(this,t,e,n,i,!0)},updateAxisPointer:function(t,e,n,i){Mc(this,t,e,n,i,!1)},remove:function(t,e){var n=this._axisPointer;n&&n.remove(e),$M.superApply(this,"remove",arguments)},dispose:function(t,e){Ic(this,e),$M.superApply(this,"dispose",arguments)}}),qM=[];$M.registerAxisPointerClass=function(t,e){if(Vb&&qM[t])throw new Error("axisPointer "+t+" exists");qM[t]=e},$M.getAxisPointerClass=function(t){return t&&qM[t]};var GM=["axisLine","axisTickLabel","axisName"],YM=["splitArea","splitLine"],ZM=$M.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,n,i){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Xw,this.group.add(this._axisGroup),e.get("show")){var o=e.getCoordSysModel(),a=kc(o,e),s=new BM(e,a);k(GM,s.add,s),this._axisGroup.add(s.getGroup()),k(YM,function(t){e.get(t+".show")&&this["_"+t](e,o)},this),Ir(r,this._axisGroup,e),ZM.superCall(this,"render",e,t,n,i)}},remove:function(){this._splitAreaColors=null},_splitLine:function(t,e){var n=t.axis;if(!n.scale.isBlank()){var i=t.getModel("splitLine"),r=i.getModel("lineStyle"),o=r.get("color");o=E(o)?o:[o];for(var a=e.coordinateSystem.getRect(),s=n.isHorizontal(),l=0,u=n.getTicksCoords({tickModel:i}),c=[],h=[],d=r.getLineStyle(),f=0;f<u.length;f++){var p=n.toGlobalCoord(u[f].coord);s?(c[0]=p,c[1]=a.y,h[0]=p,h[1]=a.y+a.height):(c[0]=a.x,c[1]=p,h[0]=a.x+a.width,h[1]=p);var g=l++%o.length,m=u[f].tickValue;this._axisGroup.add(new xC(Ki({anid:null!=m?"line_"+u[f].tickValue:null,shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]},style:D({stroke:o[g]},d),silent:!0})))}}},_splitArea:function(t,e){var n=t.axis;if(!n.scale.isBlank()){var i=t.getModel("splitArea"),r=i.getModel("areaStyle"),o=r.get("color"),a=e.coordinateSystem.getRect(),s=n.getTicksCoords({tickModel:i,clamp:!0});if(s.length){var l=o.length,u=this._splitAreaColors,c=z(),h=0;if(u)for(var d=0;d<s.length;d++){var f=u.get(s[d].tickValue);if(null!=f){h=(f+(l-1)*d)%l;break}}var p=n.toGlobalCoord(s[0].coord),g=r.getAreaStyle();o=E(o)?o:[o];for(d=1;d<s.length;d++){var m,v,y,x,b=n.toGlobalCoord(s[d].coord);n.isHorizontal()?(m=p,v=a.y,y=b-m,x=a.height,p=m+y):(m=a.x,v=p,y=a.width,p=v+(x=b-v));var w=s[d-1].tickValue;null!=w&&c.set(w,h),this._axisGroup.add(new yC({anid:null!=w?"area_"+w:null,shape:{x:m,y:v,width:y,height:x},style:D({fill:o[h]},g),silent:!0})),h=(h+1)%l}this._splitAreaColors=c}}}});ZM.extend({type:"xAxis"}),ZM.extend({type:"yAxis"}),Vs({type:"grid",render:function(t){this.group.removeAll(),t.get("show")&&this.group.add(new yC({shape:t.coordinateSystem.getRect(),style:D({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))}}),ks(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})}),Fs(CM("line","circle","line")),Rs(TM("line")),Es(OA.PROCESSOR.STATISTIC,MM("line"));var XM=qT.extend({type:"series.__base_bar__",getInitialData:function(){return yl(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var n=e.dataToPoint(e.clampData(t)),i=this.getData(),r=i.getLayout("offset"),o=i.getLayout("size");return n[e.getBaseAxis().isHorizontal()?0:1]+=r+o/2,n}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});XM.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return t<e&&(t=e),t}});var KM=nS([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),QM={getBarItemStyle:function(t){var e=KM(this,t);if(this.getBorderLineDash){var n=this.getBorderLineDash();n&&(e.lineDash=n)}return e}},JM=["itemStyle","barBorderWidth"];O(Or.prototype,QM),Ws({type:"bar",render:function(t,e,n){this._updateDrawMode(t);var i=t.get("coordinateSystem");return"cartesian2d"===i||"polar"===i?this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n):Vb&&console.warn("Only cartesian2d and polar supported for bar."),this.group},incrementalPrepareRender:function(t){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e){this._incrementalRenderLarge(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(o){var a,s=this.group,l=o.getData(),u=this._data,c=o.coordinateSystem,t=c.getBaseAxis();"cartesian2d"===c.type?a=t.isHorizontal():"polar"===c.type&&(a="angle"===t.dim);var h=o.isAnimationEnabled()?o:null;l.diff(u).add(function(t){if(l.hasValue(t)){var e=l.getItemModel(t),n=eI[c.type](l,t,e),i=tI[c.type](l,t,e,n,a,h);l.setItemGraphicEl(t,i),s.add(i),Nc(i,l,t,e,n,o,a,"polar"===c.type)}}).update(function(t,e){var n=u.getItemGraphicEl(e);if(l.hasValue(t)){var i=l.getItemModel(t),r=eI[c.type](l,t,i);n?Cr(n,{shape:r},h,t):n=tI[c.type](l,t,i,r,a,h,!0),l.setItemGraphicEl(t,n),s.add(n),Nc(n,l,t,i,r,o,a,"polar"===c.type)}else s.remove(n)}).remove(function(t){var e=u.getItemGraphicEl(t);"cartesian2d"===c.type?e&&Oc(t,h,e):e&&Pc(t,h,e)}).execute(),this._data=l},_renderLarge:function(t){this._clear(),Fc(t,this.group)},_incrementalRenderLarge:function(t,e){Fc(e,this.group,!0)},dispose:B,remove:function(t){this._clear(t)},_clear:function(e){var t=this.group,n=this._data;e&&e.get("animation")&&n&&!this._isLargeDraw?n.eachItemGraphicEl(function(t){"sector"===t.type?Pc(t.dataIndex,e,t):Oc(t.dataIndex,e,t)}):t.removeAll(),this._data=null}});var tI={cartesian2d:function(t,e,n,i,r,o,a){var s=new yC({shape:O({},i)});if(o){var l=r?"height":"width",u={};s.shape[l]=0,u[l]=i[l],OC[a?"updateProps":"initProps"](s,{shape:u},o,e)}return s},polar:function(t,e,n,i,r,o,a){var s=i.startAngle<i.endAngle,l=new dC({shape:D({clockwise:s},i)});if(o){var u=r?"r":"endAngle",c={};l.shape[u]=r?0:i.startAngle,c[u]=i[u],OC[a?"updateProps":"initProps"](l,{shape:c},o,e)}return l}},eI={cartesian2d:function(t,e,n){var i=t.getItemLayout(e),r=Rc(n,i),o=0<i.width?1:-1,a=0<i.height?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}},nI=Pi.extend({type:"largeBar",shape:{points:[]},buildPath:function(t,e){for(var n=e.points,i=this.__startPoint,r=this.__valueIdx,o=0;o<n.length;o+=2)i[this.__valueIdx]=n[o+r],t.moveTo(i[0],i[1]),t.lineTo(n[o],n[o+1])}});Rs(y(Fl,"bar")),Rs(CD),Fs({seriesType:"bar",reset:function(t){t.getData().setVisual("legendSymbol","roundRect")}});var iI=function(t,e,n){e=E(e)&&{coordDimensions:e}||O({},e);var i=t.getSource(),r=pD(i,e),o=new hD(r,t);return o.initData(i,n),o},rI={updateSelectedMap:function(t){this._targetList=E(t)?t.slice():[],this._selectTargetMap=p(t||[],function(t,e){return t.set(e.name,e),t},z())},select:function(t,e){var n=null!=e?this._targetList[e]:this._selectTargetMap.get(t);"single"===this.get("selectedMode")&&this._selectTargetMap.each(function(t){t.selected=!1}),n&&(n.selected=!0)},unSelect:function(t,e){var n=null!=e?this._targetList[e]:this._selectTargetMap.get(t);n&&(n.selected=!1)},toggleSelected:function(t,e){var n=null!=e?this._targetList[e]:this._selectTargetMap.get(t);if(null!=n)return this[n.selected?"unSelect":"select"](t,e),n.selected},isSelected:function(t,e){var n=null!=e?this._targetList[e]:this._selectTargetMap.get(t);return n&&n.selected}},oI=js({type:"series.pie",init:function(t){oI.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(t)},mergeOption:function(t){oI.superCall(this,"mergeOption",t),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(){return iI(this,["value"])},_createSelectableList:function(){for(var t=this.getRawData(),e=t.mapDimension("value"),n=[],i=0,r=t.count();i<r;i++)n.push({name:t.getName(i),value:t.get(e,i),selected:xa(t,i,"selected")});return n},getDataParams:function(t){var e=this.getData(),n=oI.superCall(this,"getDataParams",t),i=[];return e.each(e.mapDimension("value"),function(t){i.push(t)}),n.percent=Gr(i,t,e.hostModel.get("percentPrecision")),n.$vars.push("percent"),n},_defaultLabelLine:function(t){Pn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,label:{rotate:!1,show:!0,position:"outer"},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationEasing:"cubicOut"}});r(oI,rI);var aI=Vc.prototype;aI.updateData=function(t,e,n){function i(){o.stopAnimation(!0),o.animateTo({shape:{r:l.r+a.get("hoverOffset")}},300,"elasticOut")}function r(){o.stopAnimation(!0),o.animateTo({shape:{r:l.r}},300,"elasticOut")}var o=this.childAt(0),a=t.hostModel,s=t.getItemModel(e),l=t.getItemLayout(e),u=O({},l);(u.label=null,n)?(o.setShape(u),"scale"===a.getShallow("animationType")?(o.shape.r=l.r0,Tr(o,{shape:{r:l.r}},a,e)):(o.shape.endAngle=l.startAngle,Cr(o,{shape:{endAngle:l.endAngle}},a,e))):Cr(o,{shape:u},a,e);var c=t.getItemVisual(e,"color");o.useStyle(D({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),o.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var h=s.getShallow("cursor");h&&o.attr("cursor",h),Bc(this,t.getItemLayout(e),a.isSelected(null,e),a.get("selectedOffset"),a.get("animation")),o.off("mouseover").off("mouseout").off("emphasis").off("normal"),s.get("hoverAnimation")&&a.isAnimationEnabled()&&o.on("mouseover",i).on("mouseout",r).on("emphasis",i).on("normal",r),this._updateLabel(t,e),dr(this)},aI._updateLabel=function(t,e){var n=this.childAt(1),i=this.childAt(2),r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");Cr(n,{shape:{points:a.linePoints||[[a.x,a.y],[a.x,a.y],[a.x,a.y]]}},r,e),Cr(i,{style:{x:a.x,y:a.y}},r,e),i.attr({rotation:a.rotation,origin:[a.x,a.y],z2:10});var l=o.getModel("label"),u=o.getModel("emphasis.label"),c=o.getModel("labelLine"),h=o.getModel("emphasis.labelLine");s=t.getItemVisual(e,"color");fr(i.style,i.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!a.inside},{textAlign:a.textAlign,textVerticalAlign:a.verticalAlign,opacity:t.getItemVisual(e,"opacity")}),i.ignore=i.normalIgnore=!l.get("show"),i.hoverIgnore=!u.get("show"),n.ignore=n.normalIgnore=!c.get("show"),n.hoverIgnore=!h.get("show"),n.setStyle({stroke:s,opacity:t.getItemVisual(e,"opacity")}),n.setStyle(c.getModel("lineStyle").getLineStyle()),n.hoverStyle=h.getModel("lineStyle").getLineStyle();var d=c.get("smooth");d&&!0===d&&(d=.4),n.setShape({smooth:d})},o(Vc,Xw);La.extend({type:"pie",init:function(){var t=new Xw;this._sectorGroup=t},render:function(t,e,n,i){if(!i||i.from!==this.uid){var r=t.getData(),o=this._data,a=this.group,s=e.get("animation"),l=!o,u=t.get("animationType"),c=y(Hc,this.uid,t,s,n),h=t.get("selectedMode");if(r.diff(o).add(function(t){var e=new Vc(r,t);l&&"scale"!==u&&e.eachChild(function(t){t.stopAnimation(!0)}),h&&e.on("click",c),r.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var n=o.getItemGraphicEl(e);n.updateData(r,t),n.off("click"),h&&n.on("click",c),a.add(n),r.setItemGraphicEl(t,n)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),s&&l&&0<r.count()&&"scale"!==u){var d=r.getItemLayout(0),f=Math.max(n.getWidth(),n.getHeight())/2,p=v(a.removeClipPath,a);a.setClipPath(this._createClipPath(d.cx,d.cy,f,d.startAngle,d.clockwise,p,t))}this._data=r}},dispose:function(){},_createClipPath:function(t,e,n,i,r,o,a){var s=new dC({shape:{cx:t,cy:e,r0:0,r:n,startAngle:i,endAngle:i,clockwise:r}});return Tr(s,{shape:{endAngle:i+(r?1:-1)*Math.PI*2}},a,o),s},containPoint:function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,r=t[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}}});var sI=function(n,t){k(t,function(o){o.update="updateView",Os(o,function(t,e){var r={};return e.eachComponent({mainType:"series",subType:n,query:t},function(n){n[o.method]&&n[o.method](t.name,t.dataIndex);var i=n.getData();i.each(function(t){var e=i.getName(t);r[e]=n.isSelected(e)||!1})}),{name:t.name,selected:r}})})},lI=function(i){return{getTargetSeries:function(t){var e={},n=z();return t.eachSeriesByType(i,function(t){t.__paletteScope=e,n.set(t.uid,t)}),n},reset:function(r){var o=r.getRawData(),a={},s=r.getData();s.each(function(t){var e=s.getRawIndex(t);a[e]=t}),o.each(function(t){var e=a[t],n=null!=e&&s.getItemVisual(e,"color",!0);if(n)o.setItemVisual(t,"color",n);else{var i=o.getItemModel(t).get("itemStyle.color")||r.getColorFromPalette(o.getName(t)||t+"",r.__paletteScope,o.count());o.setItemVisual(t,"color",i),null!=e&&s.setItemVisual(e,"color",i)}})}}},uI=function(C,T,t,e){var A,D,M=C.getData(),I=[],k=!1;M.each(function(t){var e,n,i,r,o=M.getItemLayout(t),a=M.getItemModel(t),s=a.getModel("label"),l=s.get("position")||a.get("emphasis.label.position"),u=a.getModel("labelLine"),c=u.get("length"),h=u.get("length2"),d=(o.startAngle+o.endAngle)/2,f=Math.cos(d),p=Math.sin(d);A=o.cx,D=o.cy;var g="inside"===l||"inner"===l;if("center"===l)e=o.cx,n=o.cy,r="center";else{var m=(g?(o.r+o.r0)/2*f:o.r*f)+A,v=(g?(o.r+o.r0)/2*p:o.r*p)+D;if(e=m+3*f,n=v+3*p,!g){var y=m+f*(c+T-o.r),x=v+p*(c+T-o.r),b=y+(f<0?-1:1)*h;e=b+(f<0?-5:5),i=[[m,v],[y,x],[b,n=x]]}r=g?"center":0<f?"left":"right"}var w=s.getFont(),_=s.get("rotate")?f<0?-d+Math.PI:-d:0,S=Se(C.getFormattedLabel(t,"normal")||M.getName(t),w,r,"top");k=!!_,o.label={x:e,y:n,position:l,height:S.height,len:c,len2:h,linePoints:i,textAlign:r,verticalAlign:"middle",rotation:_,inside:g},g||I.push(o.label)}),!k&&C.get("avoidLabelOverlap")&&Wc(I,A,D,T,t,e)},cI=2*Math.PI,hI=Math.PI/180,dI=function(t,e,A){e.eachSeriesByType(t,function(t){var r=t.getData(),e=r.mapDimension("value"),n=t.get("center"),i=t.get("radius");E(i)||(i=[0,i]),E(n)||(n=[n,n]);var o=A.getWidth(),a=A.getHeight(),s=Math.min(o,a),l=Vr(n[0],o),u=Vr(n[1],a),c=Vr(i[0],s/2),h=Vr(i[1],s/2),d=-t.get("startAngle")*hI,f=t.get("minAngle")*hI,p=0;r.each(e,function(t){!isNaN(t)&&p++});var g=r.getSum(e),m=Math.PI/(g||p)*2,v=t.get("clockwise"),y=t.get("roseType"),x=t.get("stillShowZeroSum"),b=r.getDataExtent(e);b[0]=0;var w=cI,_=0,S=d,C=v?1:-1;if(r.each(e,function(t,e){var n;if(isNaN(t))r.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:l,cy:u,r0:c,r:y?NaN:h});else{(n="area"!==y?0===g&&x?m:t*m:cI/p)<f?w-=n=f:_+=t;var i=S+C*n;r.setItemLayout(e,{angle:n,startAngle:S,endAngle:i,clockwise:v,cx:l,cy:u,r0:c,r:y?Br(t,b,[c,h]):h}),S=i}}),w<cI&&p)if(w<=.001){var T=cI/p;r.each(e,function(t,e){if(!isNaN(t)){var n=r.getItemLayout(e);n.angle=T,n.startAngle=d+C*e*T,n.endAngle=d+C*(e+1)*T}})}else m=w/_,S=d,r.each(e,function(t,e){if(!isNaN(t)){var n=r.getItemLayout(e),i=n.angle===f?f:t*m;n.startAngle=S,n.endAngle=S+C*i,S+=C*i}});uI(t,h,o,a)})},fI=function(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var r=t.getData();r.filterSelf(function(t){for(var e=r.getName(t),n=0;n<i.length;n++)if(!i[n].isSelected(e))return!1;return!0})}}}};sI("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),Fs(lI("pie")),Rs(y(dI,"pie")),Es(fI("pie")),qT.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(){return yl(this.getSource(),this)},brushSelector:"point",getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8}}});var pI=4,gI=$i({shape:{points:null},symbolProxy:null,buildPath:function(t,e){var n=e.points,i=e.size,r=this.symbolProxy,o=r.shape;if(!((t.getContext?t.getContext():t)&&i[0]<pI))for(var a=0;a<n.length;){var s=n[a++],l=n[a++];isNaN(s)||isNaN(l)||(o.x=s-i[0]/2,o.y=l-i[1]/2,o.width=i[0],o.height=i[1],r.buildPath(t,o,!0))}},afterBrush:function(t){var e=this.shape,n=e.points,i=e.size;if(i[0]<pI){this.setTransform(t);for(var r=0;r<n.length;){var o=n[r++],a=n[r++];isNaN(o)||isNaN(a)||t.fillRect(o-i[0]/2,a-i[1]/2,i[0],i[1])}this.restoreTransform(t)}},findDataIndex:function(t,e){for(var n=this.shape,i=n.points,r=n.size,o=Math.max(r[0],4),a=Math.max(r[1],4),s=i.length/2-1;0<=s;s--){var l=2*s,u=i[l]-o/2,c=i[l+1]-a/2;if(u<=t&&c<=e&&t<=u+o&&e<=c+a)return s}return-1}}),mI=Uc.prototype;mI.isPersistent=function(){return!this._incremental},mI.updateData=function(t){this.group.removeAll();var e=new gI({rectHover:!0,cursor:"default"});e.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},mI.updateLayout=function(t){if(!this._incremental){var i=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var e=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;i=new Float32Array(i.buffer,n,e)}t.setShape("points",i)})}},mI.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),2e6<t.count()?(this._incremental||(this._incremental=new Ui({silent:!0})),this.group.add(this._incremental)):this._incremental=null},mI.incrementalUpdate=function(t,e){var n;this._incremental?(n=new gI,this._incremental.addDisplayable(n,!0)):((n=new gI({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(n)),n.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(n,e,!!this._incremental)},mI._setCommon=function(n,t,e){var i=t.hostModel,r=t.getVisual("symbolSize");n.setShape("size",r instanceof Array?r:[r,r]),n.symbolProxy=Ql(t.getVisual("symbol"),0,0,0,0),n.setColor=n.symbolProxy.setColor;var o=n.shape.size[0]<pI;n.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("color");a&&n.setColor(a),e||(n.seriesIndex=i.seriesIndex,n.on("mousemove",function(t){n.dataIndex=null;var e=n.findDataIndex(t.offsetX,t.offsetY);0<=e&&(n.dataIndex=e+(n.startIndex||0))}))},mI.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},mI._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},Ws({type:"scatter",render:function(t){var e=t.getData();this._updateSymbolDraw(e,t).updateData(e),this._finished=!0},incrementalPrepareRender:function(t){var e=t.getData();this._updateSymbolDraw(e,t).incrementalPrepareUpdate(e),this._finished=!1},incrementalRender:function(t,e){this._symbolDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t){var e=t.getData();if(this.group.dirty(),!this._finished||1e4<e.count()||!this._symbolDraw.isPersistent())return{update:!0};var n=TM().reset(t);n.progress&&n.progress({start:0,end:e.count()},e),this._symbolDraw.updateLayout(e)},_updateSymbolDraw:function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new Uc:new Mu,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},remove:function(){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),Fs(CM("scatter","circle")),Rs(TM("scatter")),o($c,rM),qc.prototype.getIndicatorAxes=function(){return this._indicatorAxes},qc.prototype.dataToPoint=function(t,e){var n=this._indicatorAxes[e];return this.coordToPoint(n.dataToCoord(t),e)},qc.prototype.coordToPoint=function(t,e){var n=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(n),this.cy-t*Math.sin(n)]},qc.prototype.pointToData=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=Math.sqrt(e*e+n*n);e/=i,n/=i;for(var r,o=Math.atan2(-n,e),a=Infinity,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(o-u.angle);c<a&&(r=u,s=l,a=c)}return[s,+(r&&r.coodToData(i))]},qc.prototype.resize=function(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r)/2;this.cx=Vr(n[0],i),this.cy=Vr(n[1],r),this.startAngle=t.get("startAngle")*Math.PI/180,this.r=Vr(t.get("radius"),o),k(this._indicatorAxes,function(t,e){t.setExtent(0,this.r);var n=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),t.angle=n},this)},qc.prototype.update=function(n){function d(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.LN10)),n=t/e;return 2===n?n=5:n*=2,n*e}var i=this._indicatorAxes,r=this._model;k(i,function(t){t.scale.setExtent(Infinity,-Infinity)}),n.eachSeriesByType("radar",function(t){if("radar"===t.get("coordinateSystem")&&n.getComponent("radar",t.get("radarIndex"))===r){var e=t.getData();k(i,function(t){t.scale.unionExtentFromData(e,e.mapDimension(t.dim))})}},this);var f=r.get("splitNumber");k(i,function(t){var e=jl(t.scale,t.model);Ul(t.scale,t.model);var n=t.model,i=t.scale,r=n.getMin(),o=n.getMax(),a=i.getInterval();if(null!=r&&null!=o)i.setExtent(+r,+o),i.setInterval((o-r)/f);else if(null!=r)for(var s;s=r+a*f,i.setExtent(+r,s),i.setInterval(a),a=d(a),s<e[1]&&isFinite(s)&&isFinite(e[1]););else if(null!=o)for(var l;l=o-a*f,i.setExtent(l,+o),i.setInterval(a),a=d(a),l>e[0]&&isFinite(l)&&isFinite(e[0]););else{var u=i.getTicks().length-1;f<u&&(a=d(a));var c=Math.round((e[0]+e[1])/2/a)*a,h=Math.round(f/2);i.setExtent(jr(c-h*a),jr(c+(f-h)*a)),i.setInterval(a)}})},qc.dimensions=[],qc.create=function(n,i){var r=[];return n.eachComponent("radar",function(t){var e=new qc(t,n,i);r.push(e),t.coordinateSystem=e}),n.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=r[t.get("radarIndex")||0])}),r},qo.register("radar",qc);var vI=LM.valueAxis,yI=(Bs({type:"radar",optionUpdated:function(){var r=this.get("boundaryGap"),o=this.get("splitNumber"),a=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisLabel"),c=this.get("name"),h=this.get("name.show"),d=this.get("name.formatter"),f=this.get("nameGap"),p=this.get("triggerEvent"),t=A(this.get("indicator")||[],function(t){null!=t.max&&0<t.max&&!t.min?t.min=0:null!=t.min&&t.min<0&&!t.max&&(t.max=0);var e=c;if(null!=t.color&&(e=D({color:t.color},c)),t=g(L(t),{boundaryGap:r,splitNumber:o,scale:a,axisLine:s,axisTick:l,axisLabel:u,name:t.text,nameLocation:"end",nameGap:f,nameTextStyle:e,triggerEvent:p},!1),h||(t.name=""),"string"==typeof d){var n=t.name;t.name=d.replace("{value}",null!=n?n:"")}else"function"==typeof d&&(t.name=d(t.name,t));var i=O(new Or(t,null,this.ecModel),UD);return i.mainType="radar",i.componentIndex=this.componentIndex,i},this);this.getIndicatorModels=function(){return t}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:g({lineStyle:{color:"#bbb"}},vI.axisLine),axisLabel:Gc(vI.axisLabel,!1),axisTick:Gc(vI.axisTick,!1),splitLine:Gc(vI.splitLine,!0),splitArea:Gc(vI.splitArea,!0),indicator:[]}}),["axisLine","axisTickLabel","axisName"]);Vs({type:"radar",render:function(t){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;k(A(e.getIndicatorAxes(),function(t){return new BM(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){k(yI,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,n){var i=n%e.length;return t[i]=t[i]||[],i}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var r=t.get("shape"),o=t.getModel("splitLine"),a=t.getModel("splitArea"),s=o.getModel("lineStyle"),l=a.getModel("areaStyle"),u=o.get("show"),c=a.get("show"),h=s.get("color"),d=l.get("color");h=E(h)?h:[h],d=E(d)?d:[d];var f=[],p=[];if("circle"===r)for(var g=n[0].getTicksCoords(),m=i.cx,v=i.cy,y=0;y<g.length;y++){if(u)f[e(f,h,y)].push(new uC({shape:{cx:m,cy:v,r:g[y].coord}}));if(c&&y<g.length-1)p[e(p,d,y)].push(new fC({shape:{cx:m,cy:v,r0:g[y].coord,r:g[y+1].coord}}))}else{var x,b=A(n,function(t,e){var n=t.getTicksCoords();return x=null==x?n.length-1:Math.min(n.length-1,x),A(n,function(t){return i.coordToPoint(t.coord,e)})}),w=[];for(y=0;y<=x;y++){for(var _=[],S=0;S<n.length;S++)_.push(b[S][y]);if(_[0]?_.push(_[0].slice()):Vb&&console.error("Can't draw value axis "+y),u)f[e(f,h,y)].push(new vC({shape:{points:_}}));if(c&&w)p[e(p,d,y-1)].push(new mC({shape:{points:_.concat(w)}}));w=_.slice().reverse()}}var C=s.getLineStyle(),T=l.getAreaStyle();k(p,function(t,e){this.group.add(LC(t,{style:D({stroke:"none",fill:d[e%d.length]},T),silent:!0}))},this),k(f,function(t,e){this.group.add(LC(t,{style:D({fill:"none",stroke:h[e%h.length]},C),silent:!0}))},this)}}});var xI=qT.extend({type:"series.radar",dependencies:["radar"],init:function(){xI.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},getInitialData:function(){return iI(this,{generateCoord:"indicator_",generateCoordCount:Infinity})},formatTooltip:function(n){var i=this.getData(),t=this.coordinateSystem.getIndicatorAxes(),e=this.getData().getName(n);return ro(""===e?this.name:e)+"<br/>"+A(t,function(t){var e=i.get(i.mapDimension(t.dim),n);return ro(t.name+" : "+e)}).join("<br />")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});Ws({type:"radar",render:function(l){function u(t,e){var n=t.getItemVisual(e,"symbol")||"circle",i=t.getItemVisual(e,"color");if("none"!==n){var r=Yc(t.getItemVisual(e,"symbolSize")),o=Ql(n,-1,-1,2,2,i);return o.attr({style:{strokeNoScale:!0},z2:100,scale:[r[0]/2,r[1]/2]}),o}}function s(t,e,n,i,r,o){n.removeAll();for(var a=0;a<e.length-1;a++){var s=u(i,r);s&&(t[s.__dimIdx=a]?(s.attr("position",t[a]),OC[o?"initProps":"updateProps"](s,{position:e[a]},l,r)):s.attr("position",e[a]),n.add(s))}}function c(t){return A(t,function(){return[e.cx,e.cy]})}var e=l.coordinateSystem,v=this.group,y=l.getData(),h=this._data;y.diff(h).add(function(t){var e=y.getItemLayout(t);if(e){var n=new mC,i=new vC,r={shape:{points:e}};n.shape.points=c(e),i.shape.points=c(e),Tr(n,r,l,t),Tr(i,r,l,t);var o=new Xw,a=new Xw;o.add(i),o.add(n),o.add(a),s(i.shape.points,e,a,y,t,!0),y.setItemGraphicEl(t,o)}}).update(function(t,e){var n=h.getItemGraphicEl(e),i=n.childAt(0),r=n.childAt(1),o=n.childAt(2),a={shape:{points:y.getItemLayout(t)}};a.shape.points&&(s(i.shape.points,a.shape.points,o,y,t,!1),Cr(i,a,l),Cr(r,a,l),y.setItemGraphicEl(t,n))}).remove(function(t){v.remove(h.getItemGraphicEl(t))}).execute(),y.eachItemGraphicEl(function(t,e){function n(){a.attr("ignore",d)}function i(){a.attr("ignore",h)}var r=y.getItemModel(e),o=t.childAt(0),a=t.childAt(1),s=t.childAt(2),l=y.getItemVisual(e,"color");v.add(t),o.useStyle(D(r.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:l})),o.hoverStyle=r.getModel("emphasis.lineStyle").getLineStyle();var u=r.getModel("areaStyle"),c=r.getModel("emphasis.areaStyle"),h=u.isEmpty()&&u.parentModel.isEmpty(),d=c.isEmpty()&&c.parentModel.isEmpty();d=d&&h,a.ignore=h,a.useStyle(D(u.getAreaStyle(),{fill:l,opacity:.7})),a.hoverStyle=c.getAreaStyle();var f=r.getModel("itemStyle").getItemStyle(["color"]),p=r.getModel("emphasis.itemStyle").getItemStyle(),g=r.getModel("label"),m=r.getModel("emphasis.label");s.eachChild(function(t){t.setStyle(f),t.hoverStyle=L(p),fr(t.style,t.hoverStyle,g,m,{labelFetcher:y.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:y.get(y.dimensions[t.__dimIdx],e),autoColor:l,isRectText:!0})}),t.off("mouseover").off("mouseout").off("normal").off("emphasis"),t.on("emphasis",n).on("mouseover",n).on("normal",i).on("mouseout",i),dr(t)}),this._data=y},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var bI=function(t){t.eachSeriesByType("radar",function(t){function e(t,e){i[e]=i[e]||[],i[e][a]=r.dataToPoint(t,a)}var n=t.getData(),i=[],r=t.coordinateSystem;if(r){for(var o=r.getIndicatorAxes(),a=0;a<o.length;a++)n.each(n.mapDimension(o[a].dim),e);n.each(function(t){i[t][0]&&i[t].push(i[t][0].slice()),n.setItemLayout(t,i[t])})}})},wI=function(e){var t=e.polar;if(t){E(t)||(t=[t]);var n=[];k(t,function(t){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],E(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):n.push(t)}),e.polar=n}k(e.series,function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)})};Fs(lI("radar")),Fs(CM("radar","circle")),Rs(bI),Es(fI("radar")),ks(wI);var _I=ot;r(Zc,xw),Xc.prototype={constructor:Xc,type:"view",dimensions:["x","y"],setBoundingRect:function(t,e,n,i){return this._rect=new ie(t,e,n,i),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(t,e,n,i){this.transformTo(t,e,n,i),this._viewRect=new ie(t,e,n,i)},transformTo:function(t,e,n,i){var r=this.getBoundingRect(),o=this._rawTransformable;o.transform=r.calculateTransform(new ie(t,e,n,i)),o.decomposeTransform(),this._updateTransform()},setCenter:function(t){t&&(this._center=t,this._updateCenterAndZoom())},setZoom:function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},getDefaultCenter:function(){var t=this.getBoundingRect();return[
|
|
t.x+t.width/2,t.y+t.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),r=this.getZoom();i=ot([],i,t),n=ot([],n,t),e.origin=i,e.position=[n[0]-i[0],n[1]-i[1]],e.scale=[r,r],this._updateTransform()},_updateTransform:function(){var t=this._roamTransformable,e=this._rawTransformable;(e.parent=t).updateTransform(),e.updateTransform(),gt(this.transform||(this.transform=[]),e.transform||ft()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],bt(this.invTransform,this.transform),this.decomposeTransform()},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},dataToPoint:function(t,e,n){var i=e?this._rawTransform:this.transform;return n=n||[],i?_I(n,t,i):j(n,t)},pointToData:function(t){var e=this.invTransform;return e?_I([],t,e):[t[0],t[1]]},convertToPixel:y(Kc,"dataToPoint"),convertFromPixel:y(Kc,"pointToData"),containPoint:function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])}},r(Xc,xw);for(var SI=[126,25],CI=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],TI=0;TI<CI.length;TI++)for(var AI=0;AI<CI[TI].length;AI++)CI[TI][AI][0]/=10.5,CI[TI][AI][1]/=-14,CI[TI][AI][0]+=SI[0],CI[TI][AI][1]+=SI[1];var DI={"\u5357\u6d77\u8bf8\u5c9b":[32,80],"\u5e7f\u4e1c":[0,-10],"\u9999\u6e2f":[10,5],"\u6fb3\u95e8":[-10,10],"\u5929\u6d25":[5,5]},MI={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]},II=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]],kI=[function(t){"china"===t.map&&t.regions.push(new ru("\u5357\u6d77\u8bf8\u5c9b",A(CI,function(t){return{type:"polygon",exterior:t}}),SI))},function(t){k(t.regions,function(t){var e=DI[t.name];if(e){var n=t.center;n[0]+=e[0]/10.5,n[1]+=-e[1]/14}})},function(t){k(t.regions,function(t){var e=MI[t.name];if(e){var n=t.center;n[0]=e[0],n[1]=e[1]}})},function(t){if("china"===t.map)for(var e=0,n=t.regions.length;e<n;++e)"\u53f0\u6e7e"===t.regions[e].name&&t.regions[e].geometries.push({type:"polygon",exterior:II[0]})}];if(Qc.prototype={constructor:Qc,type:"geo",dimensions:["lng","lat"],containCoord:function(t){for(var e=this.regions,n=0;n<e.length;n++)if(e[n].contain(t))return!0;return!1},loadGeoJson:function(t,e,n){try{this.regions=t?eM(t):[]}catch(l){throw"Invalid geoJson format\n"+l.message}e=e||{},n=n||{};for(var i=this.regions,r=z(),o=0;o<i.length;o++){var a=i[o].name;a=n.hasOwnProperty(a)?n[a]:a,i[o].name=a,r.set(a,i[o]),this.addGeoCoord(a,i[o].center);var s=e[a];s&&i[o].transformTo(s.left,s.top,s.width,s.height)}this._regionsMap=r,this._rect=null,k(kI,function(t){t(this)},this)},transformTo:function(t,e,n,i){var r=this.getBoundingRect();(r=r.clone()).y=-r.y-r.height;var o=this._rawTransformable;o.transform=r.calculateTransform(new ie(t,e,n,i)),o.decomposeTransform();var a=o.scale;a[1]=-a[1],o.updateTransform(),this._updateTransform()},getRegion:function(t){return this._regionsMap.get(t)},getRegionByCoord:function(t){for(var e=this.regions,n=0;n<e.length;n++)if(e[n].contain(t))return e[n]},addGeoCoord:function(t,e){this._nameCoordMap.set(t,e)},getGeoCoord:function(t){return this._nameCoordMap.get(t)},getBoundingRect:function(){if(this._rect)return this._rect;for(var t,e=this.regions,n=0;n<e.length;n++){var i=e[n].getBoundingRect();(t=t||i.clone()).union(i)}return this._rect=t||new ie(0,0,0,0)},dataToPoint:function(t,e,n){if("string"==typeof t&&(t=this.getGeoCoord(t)),t)return Xc.prototype.dataToPoint.call(this,t,e,n)},convertToPixel:y(Jc,"dataToPoint"),convertFromPixel:y(Jc,"pointToData")},r(Qc,Xc),Vb)var EI=function(t){console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")};var LI={dimensions:Qc.prototype.dimensions,create:function(t,o){var a=[];t.eachComponent("geo",function(t,e){var n=t.get("map"),i=qs(n);Vb&&(i||EI(n));var r=new Qc(n+e,n,i&&i.geoJson,i&&i.specialAreas,t.get("nameMap"));r.zoomLimit=t.get("scaleLimit"),a.push(r),eh(r,t),(t.coordinateSystem=r).model=t,r.resize=th,r.resize(t,o)}),t.eachSeries(function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=a[e]}});var n={};return t.eachSeriesByType("map",function(t){if(!t.getHostGeoModel()){var e=t.getMapType();n[e]=n[e]||[],n[e].push(t)}}),k(n,function(t,e){var n=qs(e);Vb&&(n||EI(t[0].get("map")));var i=A(t,function(t){return t.get("nameMap")}),r=new Qc(e,e,n&&n.geoJson,n&&n.specialAreas,c(i));r.zoomLimit=N.apply(null,A(t,function(t){return t.get("scaleLimit")})),a.push(r),r.resize=th,r.resize(t[0],o),k(t,function(t){eh(t.coordinateSystem=r,t)})}),a},getFilledRegions:function(t,e,n){var i=(t||[]).slice();n=n||{};var r=qs(e),o=r&&r.geoJson;if(!o)return Vb&&EI(e),t;for(var a=z(),s=o.features,l=0;l<i.length;l++)a.set(i[l].name,i[l]);for(l=0;l<s.length;l++){var u=s[l].properties.name;a.get(u)||(n.hasOwnProperty(u)&&(u=n[u]),i.push({name:u}))}return i}};Ps("geo",LI);var OI=qT.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],init:function(){OI.superApply(this,"init",arguments),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(){return iI(this,["value"])},mergeOption:function(){OI.superApply(this,"mergeOption",arguments),this.updateSelectedMap(this._createSelectableList())},_createSelectableList:function(){for(var t=this.getRawData(),e=t.mapDimension("value"),n=[],i=0,r=t.count();i<r;i++)n.push({name:t.getName(i),value:t.get(e,i),selected:xa(t,i,"selected")});return n=LI.getFilledRegions(n,this.getMapType(),this.option.nameMap)},getHostGeoModel:function(){var t=this.option.geoIndex;return null!=t?this.dependentModels.geo[t]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},_fillOption:function(){},getRawValue:function(t){var e=this.getData();return e.get(e.mapDimension("value"),t)},getRegionModel:function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},formatTooltip:function(t){for(var e=this.getData(),n=no(this.getRawValue(t)),i=e.getName(t),r=this.seriesGroup,o=[],a=0;a<r.length;a++){var s=r[a].originalData.indexOfName(i),l=e.mapDimension("value");isNaN(r[a].originalData.get(l,s))||o.push(ro(r[a].name))}return o.join(", ")+"<br />"+ro(i+" : "+n)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,i=n.getRegion(e);return i&&n.dataToPoint(i.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}}}});r(OI,rI);var PI="\0_ec_interaction_mutex";Os({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),r(ah,hw);var NI={axisPointer:1,tooltip:1,brush:1};bh.prototype={constructor:bh,draw:function(x,t,e,n,i){var b="geo"===x.mainType,w=x.getData&&x.getData();b&&t.eachComponent({mainType:"series",subType:"map"},function(t){w||t.getHostGeoModel()!==x||(w=t.getData())});var r=x.coordinateSystem,_=this.group,S=r.scale,o={position:r.position,scale:S};!_.childAt(0)||i?_.attr(o):Cr(_,o,x),_.removeAll();var C=["itemStyle"],T=["emphasis","itemStyle"],A=["label"],D=["emphasis","label"],M=z();k(r.regions,function(t){var e=M.get(t.name)||M.set(t.name,new Xw),n=new SC({shape:{paths:[]}});e.add(n);var i,r=(y=x.getRegionModel(t.name)||x).getModel(C),o=y.getModel(T),a=vh(r,S),s=vh(o,S),l=y.getModel(A),u=y.getModel(D);if(w){i=w.indexOfName(t.name);var c=w.getItemVisual(i,"color",!0);c&&(a.fill=c)}k(t.geometries,function(t){if("polygon"===t.type){n.shape.paths.push(new mC({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)n.shape.paths.push(new mC({shape:{points:t.interiors[e]}}))}}),n.setStyle(a),n.style.strokeNoScale=!0,n.culling=!0;var h=l.get("show"),d=u.get("show"),f=w&&isNaN(w.get(w.mapDimension("value"),i)),p=w&&w.getItemLayout(i);if(b||f&&(h||d)||p&&p.showLabel){var g,m=b?t.name:i;(!w||0<=i)&&(g=x);var v=new lC({position:t.center.slice(),scale:[1/S[0],1/S[1]],z2:10,silent:!0});fr(v.style,v.hoverStyle={},l,u,{labelFetcher:g,labelDataIndex:m,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),e.add(v)}if(w)w.setItemGraphicEl(i,e);else{var y=x.getRegionModel(t.name);n.eventData={componentType:"geo",geoIndex:x.componentIndex,name:t.name,region:y&&y.option||{}}}(e.__regions||(e.__regions=[])).push(t),dr(e,s,{hoverSilentOnTouch:!!x.get("selectedMode")}),_.add(e)}),this._updateController(x,t,e),yh(this,x,_,e,n),xh(x,_)},remove:function(){this.group.removeAll(),this._controller.dispose(),this._controllerHost={}},_updateController:function(i,t,o){function a(){var t={type:"geoRoam",componentType:n};return t[n+"Id"]=i.id,t}var r=i.coordinateSystem,e=this._controller,s=this._controllerHost;s.zoomLimit=i.get("scaleLimit"),s.zoom=r.getZoom(),e.enable(i.get("roam")||!1);var n=i.mainType;e.off("pan").on("pan",function(t,e){this._mouseDownFlag=!1,ph(s,t,e),o.dispatchAction(O(a(),{dx:t,dy:e}))},this),e.off("zoom").on("zoom",function(t,e,n){if(this._mouseDownFlag=!1,gh(s,t,e,n),o.dispatchAction(O(a(),{zoom:t,originX:e,originY:n})),this._updateGroup){var i=this.group,r=i.scale;i.traverse(function(t){"text"===t.type&&t.attr("scale",[1/r[0],1/r[1]])})}},this),e.setPointerChecker(function(t,e,n){return r.getViewRectAfterRoam().contain(e,n)&&!mh(t,o,i)})}},Ws({type:"map",render:function(t,e,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!t.getHostGeoModel()){if(i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===t.id)(o=this._mapDraw)&&r.add(o.group);else if(t.needsDrawMap){var o=this._mapDraw||new bh(n,!0);r.add(o.group),o.draw(t,e,n,this,i),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(v){var y=v.originalData,x=this.group;y.each(y.mapDimension("value"),function(t,e){if(!isNaN(t)){var n=y.getItemLayout(e);if(n&&n.point){var i=n.point,r=n.offset,o=new uC({style:{fill:v.getData().getVisual("color")},shape:{cx:i[0]+9*r,cy:i[1],r:3},silent:!0,z2:r?8:10});if(!r){var a=v.mainSeries.getData(),s=y.getName(e),l=a.indexOfName(s),u=y.getItemModel(e),c=u.getModel("label"),h=u.getModel("emphasis.label"),d=a.getItemGraphicEl(l),f=R(v.getFormattedLabel(e,"normal"),s),p=R(v.getFormattedLabel(e,"emphasis"),f),g=function(){var t=pr({},h,{text:h.get("show")?p:null},{isRectText:!0,useInsideStyle:!1},!0);o.style.extendFrom(t),o.__mapOriginalZ2=o.z2,o.z2+=1},m=function(){pr(o.style,c,{text:c.get("show")?f:null,textPosition:c.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),null!=o.__mapOriginalZ2&&(o.z2=o.__mapOriginalZ2,o.__mapOriginalZ2=null)};d.on("mouseover",g).on("mouseout",m).on("emphasis",g).on("normal",m),m()}x.add(o)}}})}}),Os({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(i,t){var r=i.componentType||"series";t.eachComponent({mainType:r,query:i},function(t){var e=t.coordinateSystem;if("geo"===e.type){var n=wh(e,i,t.get("scaleLimit"));t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom),"series"===r&&k(t.seriesGroup,function(t){t.setCenter(n.center),t.setZoom(n.zoom)})}})});var RI=function(t){t.eachSeriesByType("map",function(t){var e=t.get("color"),n=t.getModel("itemStyle"),i=n.get("areaColor"),r=n.get("color")||e[t.seriesIndex%e.length];t.getData().setVisual({areaColor:i,color:r})})},FI=function(t){var i={};t.eachSeriesByType("map",function(t){var e=t.getHostGeoModel(),n=e?"o"+e.id:"i"+t.getMapType();(i[n]=i[n]||[]).push(t)}),k(i,function(t){for(var e=_h(A(t,function(t){return t.getData()}),t[0].get("mapValueCalculation")),n=0;n<t.length;n++)t[n].originalData=t[n].getData();for(n=0;n<t.length;n++)(t[n].seriesGroup=t)[n].needsDrawMap=0===n&&!t[n].getHostGeoModel(),t[n].setData(e.cloneShallow()),t[n].mainSeries=t[0]})},zI=function(t){var e=[];k(t.series,function(t){t&&"map"===t.type&&(e.push(t),t.map=t.map||t.mapType,D(t,t.mapLocation))})};Rs(function(n){var r={};n.eachSeriesByType("map",function(t){var e=t.getMapType();if(!t.getHostGeoModel()&&!r[e]){var l={};k(t.seriesGroup,function(t){var a=t.coordinateSystem,s=t.originalData;t.get("showLegendSymbol")&&n.getComponent("legend")&&s.each(s.mapDimension("value"),function(t,e){var n=s.getName(e),i=a.getRegion(n);if(i&&!isNaN(t)){var r=l[n]||0,o=a.dataToPoint(i.center);l[n]=r+1,s.setItemLayout(e,{point:o,offset:r})}})});var i=t.getData();i.each(function(t){var e=i.getName(t),n=i.getItemLayout(t)||{};n.showLabel=!l[e],i.setItemLayout(t,n)}),r[e]=!0}})}),Fs(RI),Es(OA.PROCESSOR.STATISTIC,FI),ks(zI),sI("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var HI=k,BI="\0__link_datas",VI="\0__link_mainData",jI=function(t,e){this.name=t||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=e};jI.prototype={constructor:jI,isRemoved:function(){return this.dataIndex<0},eachNode:function(t,e,n){"function"==typeof t&&(n=e,e=t,t=null),w(t=t||{})&&(t={order:t});var i,r=t.order||"preorder",o=this[t.attr||"children"];"preorder"===r&&(i=e.call(n,this));for(var a=0;!i&&a<o.length;a++)o[a].eachNode(t,e,n);"postorder"===r&&e.call(n,this)},updateDepthAndHeight:function(t){var e=0;this.depth=t;for(var n=0;n<this.children.length;n++){var i=this.children[n];i.updateDepthAndHeight(t+1),i.height>e&&(e=i.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e<i;e++){var r=n[e].getNodeById(t);if(r)return r}},contains:function(t){if(t===this)return!0;for(var e=0,n=this.children,i=n.length;e<i;e++){var r=n[e].contains(t);if(r)return r}},getAncestors:function(t){for(var e=[],n=t?this:this.parentNode;n;)e.push(n),n=n.parentNode;return e.reverse(),e},getValue:function(t){var e=this.hostTree.data;return e.get(e.getDimension(t||"value"),this.dataIndex)},setLayout:function(t,e){0<=this.dataIndex&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,n=this.hostTree,i=n.data.getItemModel(this.dataIndex),r=this.getLevelModel();return r||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),i.getModel(t,(r||e||n.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){0<=this.dataIndex&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Eh.prototype={constructor:Eh,type:"tree",eachNode:function(t,e,n){this.root.eachNode(t,e,n)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,n=0,i=e.length;n<i;n++)e[n].dataIndex=-1;for(n=0,i=t.count();n<i;n++)e[t.getRawIndex(n)].dataIndex=n},clearLayouts:function(){this.data.clearItemLayouts()}},Eh.createTree=function(t,e,n){function a(t,e){var n=t.value;u=Math.max(u,E(n)?n.length:1),l.push(t);var i=new jI(t.name,s);e?Lh(i,e):s.root=i,s._nodes.push(i);var r=t.children;if(r)for(var o=0;o<r.length;o++)a(r[o],i)}var s=new Eh(e,n.levels,n.leaves),l=[],u=1;a(t),s.root.updateDepthAndHeight(0);var i=pD(l,{coordDimensions:["value"],dimensionsCount:u}),r=new hD(i,e);return r.initData(l),Sh({mainData:r,struct:s,structAttr:"tree"}),s.update(),s},qT.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i={};i.leaves=n;var r=Eh.createTree(e,this,i),o=0;r.eachNode("preorder",function(t){t.depth>o&&(o=t.depth)});var a=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:o;return r.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),r.data},getOrient:function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},formatTooltip:function(t){for(var e=this.getData().tree,n=e.root.children[0],i=e.getNodeByDataIndex(t),r=i.getValue(),o=i.name;i&&i!==n;)o=i.parentNode.name+"."+o,i=i.parentNode;return ro(o+(isNaN(r)||null==r?"":" : "+r))},defaultOption:{zlevel:0,z:2,left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),Ws({type:"tree",init:function(){this._oldTree,this._mainGroup=new Xw,this.group.add(this._mainGroup)},render:function(i,t,n){var r=i.getData(),e=i.layoutInfo,o=this._mainGroup,a=i.get("layout");"radial"===a?o.attr("position",[e.x+e.width/2,e.y+e.height/2]):o.attr("position",[e.x,e.y]);var s=this._data,l={expandAndCollapse:i.get("expandAndCollapse"),layout:a,orient:i.getOrient(),curvature:i.get("lineStyle.curveness"),symbolRotate:i.get("symbolRotate"),symbolOffset:i.get("symbolOffset"),hoverAnimation:i.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};r.diff(s).add(function(t){qh(r,t)&&Yh(r,t,null,o,i,l)}).update(function(t,e){var n=s.getItemGraphicEl(e);qh(r,t)?Yh(r,t,n,o,i,l):n&&Zh(s,e,n,o,i,l)}).remove(function(t){var e=s.getItemGraphicEl(t);e&&Zh(s,t,e,o,i,l)}).execute(),!0===l.expandAndCollapse&&r.eachItemGraphicEl(function(t,e){t.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:i.id,dataIndex:e})})}),this._data=r},dispose:function(){},remove:function(){this._mainGroup.removeAll(),this._data=null}}),Os({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(i,t){t.eachComponent({mainType:"series",subType:"tree",query:i},function(t){var e=i.dataIndex,n=t.getData().tree.getNodeByDataIndex(e);n.isExpand=!n.isExpand})});var WI=function(t,e){t.eachSeriesByType("tree",function(t){Jh(t,e)})};Fs(CM("tree","circle")),Rs(WI),qT.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:Infinity,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25b6",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var n={name:t.name,children:t.data};rd(n);var i=t.levels||[];i=t.levels=od(i,e);var r={};return r.levels=i,Eh.createTree(n,this,r).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),n=this.getRawValue(t),i=E(n)?no(n[0]):no(n);return ro(e.getName(t)+": "+i)},getDataParams:function(t){var e=qT.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=id(n,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},O(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=z(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var UI=8,$I=8,qI=5;ad.prototype={constructor:ad,render:function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=a.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(t,l,a,s,i),go(o,l.pos,l.box)}},_prepare:function(t,e,n){for(var i=t;i;i=i.parentNode){var r=i.getModel().get("name"),o=n.getTextRect(r),a=Math.max(o.width+2*UI,e.emptyItemWidth);e.totalWidth+=a+$I,e.renderList.push({node:i,text:r,width:a})}},_renderContent:function(t,e,n,i,r){for(var o=0,a=e.emptyItemWidth,s=t.get("breadcrumb.height"),l=fo(e.pos,e.box),u=e.totalWidth,c=e.renderList,h=c.length-1;0<=h;h--){var d=c[h],f=d.node,p=d.width,g=d.text;u>l.width&&(u-=p-a,p=a,g=null);var m=new mC({shape:{points:sd(o,0,p,s,h===c.length-1,0===h)},style:D(n.getItemStyle(),{lineJoin:"bevel",text:g,textFill:i.getTextColor(),textFont:i.getFont()}),z:10,onclick:y(r,f)});this.group.add(m),ld(m,t,f),o+=p+$I}},remove:function(){this.group.removeAll()}};var GI=v,YI=Xw,ZI=yC,XI=k,KI=3,QI=["label"],JI=["emphasis","label"],tk=["upperLabel"],ek=["emphasis","upperLabel"],nk=10,ik=1,rk=2,ok=nS([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),ak=function(t){var e=ok(t);return e.stroke=e.fill=e.lineWidth=null,e};Ws({type:"treemap",init:function(){this._containerGroup,this._storage=cd(),this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,n,i){if(!(x(e.findComponents({mainType:"series",subType:"treemap",query:i}),t)<0)){this.seriesModel=t,this.api=n,this.ecModel=e;var r=td(i,["treemapZoomToNode","treemapRootToNode"],t),o=i&&i.type,a=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&r&&l?{rootNodeGroup:l.nodeGroup[r.node.getRawIndex()],direction:i.direction}:null,c=this._giveContainerGroup(a),h=this._doRender(c,t,u);s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?h.renderFinally():this._doAnimation(c,h,t,u),this._resetController(n),this._renderBreadcrumb(t,n,r)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new YI,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,n){function c(o,a,s,l,u){function t(t){return t.getId()}function n(t,e){var n=null!=t?o[t]:null,i=null!=e?a[e]:null,r=d(n,i,s,u);r&&c(n&&n.viewChildren||[],i&&i.viewChildren||[],r,l,u+1)}l?XI(a=o,function(t,e){!t.isRemoved()&&n(e,e)}):new Ys(a,o,t,t).add(n).update(n).remove(y(n,null)).execute()}function i(t){var i=cd();return t&&XI(t,function(t,e){var n=i[e];XI(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),i}function r(){XI(f,function(t){XI(t,function(t){t.parent&&t.parent.remove(t)})}),XI(h,function(t){t.invisible=!0,t.dirty()})}var o=e.getData().tree,a=this._oldTree,s=cd(),l=cd(),u=this._storage,h=[],d=y(hd,e,l,u,n,s,h);c(o.root?[o.root]:[],a&&a.root?[a.root]:[],t,o===a||!a,0);var f=i(u);return this._oldTree=o,this._storage=l,{lastsForAnimation:s,willDeleteEls:f,renderFinally:r}},_doAnimation:function(t,o,e,a){if(e.get("animation")){var s=e.get("animationDurationUpdate"),l=e.get("animationEasing"),u=ud();XI(o.willDeleteEls,function(t,o){XI(t,function(t){if(!t.invisible){var e,n=t.parent;if(a&&"drillDown"===a.direction)e=n===a.rootNodeGroup?{shape:{x:0,y:0,width:n.__tmNodeWidth,height:n.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var i=0,r=0;n.__tmWillDelete||(i=n.__tmNodeWidth/2,r=n.__tmNodeHeight/2),e="nodeGroup"===o?{position:[i,r],style:{opacity:0}}:{shape:{x:i,y:r,width:0,height:0},style:{opacity:0}}}e&&u.add(t,e,s,l)}})}),XI(this._storage,function(t,r){XI(t,function(t,e){var n=o.lastsForAnimation[r][e],i={};n&&("nodeGroup"===r?n.old&&(i.position=t.position.slice(),t.attr("position",n.old)):(n.old&&(i.shape=O({},t.shape),t.setShape(n.old)),n.fadein?(t.setStyle("opacity",0),i.style={opacity:1}):1!==t.style.opacity&&(i.style={opacity:1})),u.add(t,i,s,l))})},this),this._state="animating",u.done(GI(function(){this._state="ready",o.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new ah(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",GI(this._onPan,this)),e.on("zoom",GI(this._onZoom,this)));var i=new ie(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t,e){if("animating"!==this._state&&(Math.abs(t)>KI||Math.abs(e)>KI)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t,y:i.y+e,width:i.width,height:i.height}})}},_onZoom:function(t,e,n){if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var o=new ie(r.x,r.y,r.width,r.height),a=this.seriesModel.layoutInfo;e-=a.x,n-=a.y;var s=ft();vt(s,s,[-e,-n]),xt(s,s,[t,t]),vt(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var n=this.findTarget(t.offsetX,t.offsetY);if(n){var i=n.node;if(i.getLayout().isLeafRoot)this._rootToNode(n);else if("zoomToNode"===e)this._zoomToNode(n);else if("link"===e){var r=i.hostTree.data.getItemModel(i.dataIndex),o=r.get("link",!0),a=r.get("target",!0)||"blank";o&&window.open(o,a)}}}}},this)},_renderBreadcrumb:function(e,t,n){function i(t){"animating"!==this._state&&(nd(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}n||(n=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(n={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new ad(this.group))).render(e,t,n.node,GI(i,this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=cd(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(r,o){var a;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(t){var e=this._storage.background[t.getRawIndex()];if(e){var n=e.transformCoordToLocal(r,o),i=e.shape;if(!(i.x<=n[0]&&n[0]<=i.x+i.width&&i.y<=n[1]&&n[1]<=i.y+i.height))return!1;a={node:t,offsetX:n[0],offsetY:n[1]}}},this),a}});for(var sk=function(){},lk=["treemapZoomToNode","treemapRender","treemapMove"],uk=0;uk<lk.length;uk++)Os({type:lk[uk],update:"updateView"},sk);Os({type:"treemapRootToNode",update:"updateView"},function(i,t){function e(t){var e=td(i,["treemapZoomToNode","treemapRootToNode"],t);if(e){var n=t.getViewRoot();n&&(i.direction=nd(n,e.node)?"rollUp":"drillDown"),t.resetViewRoot(e.node)}}t.eachComponent({mainType:"series",subType:"treemap",query:i},e)});var ck=k,hk=b,dk=-1,fk=function(t){var e=t.mappingMethod,n=t.type,i=this.option=L(t);this.type=n,this.mappingMethod=e,this._normalizeData=gk[e];var r=pk[n];this.applyVisual=r.applyVisual,this.getColorMapper=r.getColorMapper,this._doMap=r._doMap[e],"piecewise"===e?(gd(i),fd(i)):"category"===e?i.categories?pd(i):gd(i,!0):(T("linear"!==e||i.dataExtent),gd(i))};fk.prototype={constructor:fk,mapValueToVisual:function(t){var e=this._normalizeData(t);return this._doMap(e,t)},getNormalizer:function(){return v(this._normalizeData,this)}};var pk=fk.visualHandlers={color:{applyVisual:yd("color"),getColorMapper:function(){var r=this.option;return v("category"===r.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),xd.call(this,t)}:function(t,e,n){var i=!!n;return!e&&(t=this._normalizeData(t)),n=Ht(t,r.parsedVisual,n),i?n:Wt(n,"rgba")},this)},_doMap:{linear:function(t){return Wt(Ht(t,this.option.parsedVisual),"rgba")},category:xd,piecewise:function(t,e){var n=_d.call(this,e);return null==n&&(n=Wt(Ht(t,this.option.parsedVisual),"rgba")),n},fixed:bd}},colorHue:md(function(t,e){return Vt(t,e)}),colorSaturation:md(function(t,e){return Vt(t,null,e)}),colorLightness:md(function(t,e){return Vt(t,null,null,e)}),colorAlpha:md(function(t,e){return jt(t,e)}),opacity:{applyVisual:yd("opacity"),_doMap:wd([0,1])},liftZ:{applyVisual:yd("liftZ"),_doMap:{linear:bd,category:bd,piecewise:bd,fixed:bd}},symbol:{applyVisual:function(t,e,n){var i=this.mapValueToVisual(t);if(w(i))n("symbol",i);else if(hk(i))for(var r in i)i.hasOwnProperty(r)&&n(r,i[r])},_doMap:{linear:vd,category:xd,piecewise:function(t,e){var n=_d.call(this,e);return null==n&&(n=vd.call(this,t)),n},fixed:bd}},symbolSize:{applyVisual:yd("symbolSize"),_doMap:wd([0,1])}},gk={linear:function(t){return Br(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=fk.findPieceIndex(t,e,!0);if(null!=n)return Br(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?dk:e},fixed:B};fk.listVisualTypes=function(){var n=[];return k(pk,function(t,e){n.push(e)}),n},fk.addVisualHandler=function(t,e){pk[t]=e},fk.isValidType=function(t){return pk.hasOwnProperty(t)},fk.eachVisual=function(t,e,n){b(t)?k(t,e,n):e.call(n,t)},fk.mapVisual=function(t,i,r){var o,a=E(t)?[]:b(t)?{}:(o=!0,null);return fk.eachVisual(t,function(t,e){var n=i.call(r,t,e);o?a=n:a[e]=n}),a},fk.retrieveVisuals=function(n){var i,r={};return n&&ck(pk,function(t,e){n.hasOwnProperty(e)&&(r[e]=n[e],i=!0)}),i?r:null},fk.prepareVisualTypes=function(t){if(hk(t)){var n=[];ck(t,function(t,e){n.push(e)}),t=n}else{if(!E(t))return[];t=t.slice()}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},
|
|
fk.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},fk.findPieceIndex=function(i,t,e){function n(t,e){var n=Math.abs(t-i);n<o&&(o=n,r=e)}for(var r,o=Infinity,a=0,s=t.length;a<s;a++){var l=t[a].value;if(null!=l){if(l===i||"string"==typeof l&&l===i+"")return a;e&&n(l,a)}}for(a=0,s=t.length;a<s;a++){var u=t[a],c=u.interval,h=u.close;if(c){if(c[0]===-Infinity){if(Cd(h[1],i,c[1]))return a}else if(c[1]===Infinity){if(Cd(h[0],c[0],i))return a}else if(Cd(h[0],c[0],i)&&Cd(h[1],i,c[1]))return a;e&&n(c[0],a),e&&n(c[1],a)}}if(e)return i===Infinity?t.length-1:i===-Infinity?0:r};var mk=E,vk="itemStyle",yk={seriesType:"treemap",reset:function(t){var e=t.getData().tree,n=e.root,i=t.getModel(vk);n.isRemoved()||Td(n,{},A(e.levelModels,function(t){return t?t.get(vk):null}),i,t.getViewRoot().getAncestors(),t)}},xk=Math.max,bk=Math.min,wk=N,_k=k,Sk=["itemStyle","borderWidth"],Ck=["itemStyle","gapWidth"],Tk=["upperLabel","show"],Ak=["upperLabel","height"],Dk={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=po(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=Vr(wk(s.width,l[0]),r),c=Vr(wk(s.height,l[1]),o),h=i&&i.type,d=td(i,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===h||"treemapMove"===h?i.rootRect:null,p=t.getViewRoot(),g=ed(p);if("treemapMove"!==h){var m="treemapZoomToNode"===h?Bd(t,d,p,u,c):f?[f.width,f.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};p.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(x),Od(p,y,!1,0);x=p.getLayout();_k(g,function(t,e){var n=(g[e+1]||p).getValue();t.setLayout(O({dataExtent:[n,n],borderWidth:0,upperHeight:0},x))})}var b=t.getData().tree.root;b.setLayout(Vd(s,f,d),!0),t.setLayoutInfo(s),jd(b,new ie(-s.x,-s.y,r,o),g,p,0)}};Fs(yk),Rs(Dk);var Mk=function(t){this._directed=t||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},Ik=Mk.prototype;Ik.type="graph",Ik.isDirected=function(){return this._directed},Ik.addNode=function(t,e){t=t||""+e;var n=this._nodesMap;if(!n[Ud(t)]){var i=new $d(t,e);return(i.hostGraph=this).nodes.push(i),n[Ud(t)]=i}Vb&&console.error("Graph nodes have duplicate name or id")},Ik.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},Ik.getNodeById=function(t){return this._nodesMap[Ud(t)]},Ik.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if("number"==typeof t&&(t=this.nodes[t]),"number"==typeof e&&(e=this.nodes[e]),$d.isInstance(t)||(t=i[Ud(t)]),$d.isInstance(e)||(e=i[Ud(e)]),t&&e){var o=t.id+"-"+e.id;if(!r[o]){var a=new qd(t,e,n);return(a.hostGraph=this)._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a}}},Ik.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},Ik.getEdge=function(t,e){$d.isInstance(t)&&(t=t.id),$d.isInstance(e)&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},Ik.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r<i;r++)0<=n[r].dataIndex&&t.call(e,n[r],r)},Ik.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r<i;r++)0<=n[r].dataIndex&&0<=n[r].node1.dataIndex&&0<=n[r].node2.dataIndex&&t.call(e,n[r],r)},Ik.breadthFirstTraverse=function(t,e,n,i){if($d.isInstance(e)||(e=this._nodesMap[Ud(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(i,e,null))for(var a=[e];a.length;){var s=a.shift(),l=s[r];for(o=0;o<l.length;o++){var u=l[o],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(t.call(i,c,s))return;a.push(c),c.__visited=!0}}}}},Ik.update=function(){for(var t=this.data,n=this.edgeData,e=this.nodes,i=this.edges,r=0,o=e.length;r<o;r++)e[r].dataIndex=-1;for(r=0,o=t.count();r<o;r++)e[t.getRawIndex(r)].dataIndex=r;n.filterSelf(function(t){var e=i[n.getRawIndex(t)];return 0<=e.node1.dataIndex&&0<=e.node2.dataIndex});for(r=0,o=i.length;r<o;r++)i[r].dataIndex=-1;for(r=0,o=n.count();r<o;r++)i[n.getRawIndex(r)].dataIndex=r},Ik.clone=function(){for(var t=new Mk(this._directed),e=this.nodes,n=this.edges,i=0;i<e.length;i++)t.addNode(e[i].id,e[i].dataIndex);for(i=0;i<n.length;i++){var r=n[i];t.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return t},$d.prototype={constructor:$d,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)}},qd.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)};var kk=function(n,i){return{getValue:function(t){var e=this[n][i];return e.get(e.getDimension(t||"value"),this.dataIndex)},setVisual:function(t,e){0<=this.dataIndex&&this[n][i].setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this[n][i].getItemVisual(this.dataIndex,t,e)},setLayout:function(t,e){0<=this.dataIndex&&this[n][i].setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this[n][i].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[n][i].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[n][i].getRawIndex(this.dataIndex)}}};r($d,kk("hostGraph","data")),r(qd,kk("hostGraph","edgeData")),Mk.Node=$d,Mk.Edge=qd,Kn($d),Kn(qd);var Ek=function(t,e,n,i,r){for(var o=new Mk(i),a=0;a<t.length;a++)o.addNode(N(t[a].id,t[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<e.length;a++){var c=e[a],h=c.source,d=c.target;o.addEdge(h,d,u)&&(l.push(c),s.push(N(c.id,h+" > "+d)),u++)}var f,p=n.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=yl(t,n);else{var g=qo.get(p),m=g&&"view"!==g.type&&g.dimensions||[];x(m,"value")<0&&m.concat(["value"]);var v=pD(t,{coordDimensions:m});(f=new hD(v,n)).initData(t)}var y=new hD(["value"],n);return y.initData(l,s),r&&r(f,y),Sh({mainData:f,struct:o,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o},Lk=js({type:"series.graph",init:function(t){Lk.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){Lk.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){Lk.superApply(this,"mergeDefaultAndTheme",arguments),Pn(t,["edgeLabel"],["show"])},getInitialData:function(t,s){function e(t,e){function n(t){return(t=this.parsePath(t))&&"label"===t[0]?r:t&&"emphasis"===t[0]&&"label"===t[1]?a:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=l._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var i=l.getModel("edgeLabel"),r=new Or({label:i.option},i.parentModel,s),o=l.getModel("emphasis.edgeLabel"),a=new Or({emphasis:{label:o.option}},o.parentModel,s);e.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),t})}var n=t.edges||t.links||[],i=t.data||t.nodes||[],l=this;if(i&&n)return Ek(i,n,this,!0,e).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,n){if("edge"!==n)return Lk.superApply(this,"formatTooltip",arguments);var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=ro(l.join(" > ")),r.value&&(l+=" : "+ro(r.value)),l},_updateCategoriesData:function(){var t=A(this.option.categories||[],function(t){return null!=t.value?t:O({value:0},t)}),e=new hD(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return Lk.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),Ok=xC.prototype,Pk=wC.prototype,Nk=$i({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){(Gd(e)?Ok:Pk).buildPath(t,e)},pointAt:function(t){return Gd(this.shape)?Ok.pointAt.call(this,t):Pk.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,n=Gd(e)?[e.x2-e.x1,e.y2-e.y1]:Pk.tangentAt.call(this,t);return tt(n,n)}}),Rk=["fromSymbol","toSymbol"],Fk=Jd.prototype;Fk.beforeUpdate=Qd,Fk._createLine=function(n,i,t){var e=n.hostModel,r=Xd(n.getItemLayout(i));r.shape.percent=0,Tr(r,{shape:{percent:1}},e,i),this.add(r);var o=new lC({name:"label"});this.add(o),k(Rk,function(t){var e=Zd(t,n,i);this.add(e),this[Yd(t)]=n.getItemVisual(i,t)},this),this._updateCommonStl(n,i,t)},Fk.updateData=function(r,o,t){var e=r.hostModel,n=this.childOfName("line"),i=r.getItemLayout(o),a={shape:{}};Kd(a.shape,i),Cr(n,a,e,o),k(Rk,function(t){var e=r.getItemVisual(o,t),n=Yd(t);if(this[n]!==e){this.remove(this.childOfName(t));var i=Zd(t,r,o);this.add(i)}this[n]=e},this),this._updateCommonStl(r,o,t)},Fk._updateCommonStl=function(t,e,n){var i=t.hostModel,r=this.childOfName("line"),o=n&&n.lineStyle,a=n&&n.hoverLineStyle,s=n&&n.labelModel,l=n&&n.hoverLabelModel;if(!n||t.hasItemOption){var u=t.getItemModel(e);o=u.getModel("lineStyle").getLineStyle(),a=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var c=t.getItemVisual(e,"color"),h=F(t.getItemVisual(e,"opacity"),o.opacity,1);r.useStyle(D({strokeNoScale:!0,fill:"none",stroke:c,opacity:h},o)),r.hoverStyle=a,k(Rk,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:h}))},this);var d,f,p=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((p||g)&&(d=c||"#000",null==(f=i.getFormattedLabel(e,"normal",t.dataType)))){var v=i.getRawValue(e);f=null==v?t.getName(e):isFinite(v)?jr(v):v}var y=p?f:null,x=g?R(i.getFormattedLabel(e,"emphasis",t.dataType),f):null,b=m.style;null==y&&null==x||(pr(m.style,s,{text:y},{autoColor:d}),m.__textAlign=b.textAlign,m.__verticalAlign=b.textVerticalAlign,m.__position=s.get("position")||"middle"),m.hoverStyle=null!=x?{text:x,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!p&&!g,dr(this)},Fk.highlight=function(){this.trigger("emphasis")},Fk.downplay=function(){this.trigger("normal")},Fk.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},Fk.setLinePoints=function(t){var e=this.childOfName("line");Kd(e.shape,t),e.dirty()},o(Jd,Xw);var zk=tf.prototype;zk.isPersistent=function(){return!0},zk.updateData=function(n){var i=this,e=i.group,r=i._lineData;i._lineData=n,r||e.removeAll();var o=rf(n);n.diff(r).add(function(t){ef(i,n,t,o)}).update(function(t,e){nf(i,r,n,e,t,o)}).remove(function(t){e.remove(r.getItemGraphicEl(t))}).execute()},zk.updateLayout=function(){var n=this._lineData;n&&n.eachItemGraphicEl(function(t,e){t.updateLayout(n,e)},this)},zk.incrementalPrepareUpdate=function(t){this._seriesScope=rf(t),this._lineData=null,this.group.removeAll()},zk.incrementalUpdate=function(t,e){function n(t){t.isGroup||(t.incremental=t.useHoverLayer=!0)}for(var i=t.start;i<t.end;i++){if(af(e.getItemLayout(i))){var r=new this._ctor(e,i,this._seriesScope);r.traverse(n),this.group.add(r),e.setItemGraphicEl(i,r)}}},zk.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},zk._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var Hk=[],Bk=[],Vk=[],jk=ui,Wk=lw,Uk=Math.abs,$k=function(t,s){function l(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),e}var u=[],c=fi,h=[[],[],[]],d=[[],[]],f=[];s/=2,t.eachEdge(function(t){var e=t.getLayout(),n=t.getVisual("fromSymbol"),i=t.getVisual("toSymbol");e.__original||(e.__original=[W(e[0]),W(e[1])],e[2]&&e.__original.push(W(e[2])));var r=e.__original;if(null!=e[2]){if(j(h[0],r[0]),j(h[1],r[2]),j(h[2],r[1]),n&&"none"!=n){var o=l(t.node1),a=sf(h,r[0],o*s);c(h[0][0],h[1][0],h[2][0],a,u),h[0][0]=u[3],h[1][0]=u[4],c(h[0][1],h[1][1],h[2][1],a,u),h[0][1]=u[3],h[1][1]=u[4]}if(i&&"none"!=i){o=l(t.node2),a=sf(h,r[1],o*s);c(h[0][0],h[1][0],h[2][0],a,u),h[1][0]=u[1],h[2][0]=u[2],c(h[0][1],h[1][1],h[2][1],a,u),h[1][1]=u[1],h[2][1]=u[2]}j(e[0],h[0]),j(e[1],h[2]),j(e[2],h[1])}else{if(j(d[0],r[0]),j(d[1],r[1]),G(f,d[1],d[0]),tt(f,f),n&&"none"!=n){o=l(t.node1);q(d[0],d[0],f,o*s)}if(i&&"none"!=i){o=l(t.node2);q(d[1],d[1],f,-o*s)}j(e[0],d[0]),j(e[1],d[1])}})},qk=["itemStyle","opacity"],Gk=["lineStyle","opacity"];Ws({type:"graph",init:function(t,e){var n=new Mu,i=new tf,r=this.group;this._controller=new ah(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},render:function(r,t,o){var e=r.coordinateSystem;this._model=r,this._nodeScaleRatio=r.get("nodeScaleRatio");var n=this._symbolDraw,i=this._lineDraw,a=this.group;if("view"===e.type){var s={position:e.position,scale:e.scale};this._firstRender?a.attr(s):Cr(a,s,r)}$k(r.getGraph(),this._getNodeGlobalScale(r));var l=r.getData();n.updateData(l);var u=r.getEdgeData();i.updateData(u),this._updateNodeAndLinkScale(),this._updateController(r,t,o),clearTimeout(this._layoutTimeout);var c=r.forceLayout,h=r.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,h),l.eachItemGraphicEl(function(t,e){var n=l.getItemModel(e);t.off("drag").off("dragend");var i=l.getItemModel(e).get("draggable");i&&t.on("drag",function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,h),c.setFixed(e),l.setItemLayout(e,t.position))},this).on("dragend",function(){c&&c.setUnfixed(e)},this),t.setDraggable(i&&c),t.off("mouseover",t.__focusNodeAdjacency),t.off("mouseout",t.__unfocusNodeAdjacency),n.get("focusNodeAdjacency")&&(t.on("mouseover",t.__focusNodeAdjacency=function(){o.dispatchAction({type:"focusNodeAdjacency",seriesId:r.id,dataIndex:t.dataIndex})}),t.on("mouseout",t.__unfocusNodeAdjacency=function(){o.dispatchAction({type:"unfocusNodeAdjacency",seriesId:r.id})}))},this),l.graph.eachEdge(function(t){var e=t.getGraphicEl();e.off("mouseover",e.__focusNodeAdjacency),e.off("mouseout",e.__unfocusNodeAdjacency),t.getModel().get("focusNodeAdjacency")&&(e.on("mouseover",e.__focusNodeAdjacency=function(){o.dispatchAction({type:"focusNodeAdjacency",seriesId:r.id,edgeDataIndex:t.dataIndex})}),e.on("mouseout",e.__unfocusNodeAdjacency=function(){o.dispatchAction({type:"unfocusNodeAdjacency",seriesId:r.id})}))});var d="circular"===r.get("layout")&&r.get("circular.rotateLabel"),f=l.getLayout("cx"),p=l.getLayout("cy");l.eachItemGraphicEl(function(t,e){var n=t.getSymbolPath();if(d){var i=l.getItemLayout(e),r=Math.atan2(i[1]-p,i[0]-f);r<0&&(r=2*Math.PI+r);var o=i[0]<f;o&&(r-=Math.PI);var a=o?"left":"right";n.setStyle({textRotation:-r,textPosition:a,textOrigin:"center"}),n.hoverStyle&&(n.hoverStyle.textPosition=a)}else n.setStyle({textRotation:0})}),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},focusNodeAdjacency:function(t,e,n,i){var r=this._model.getData().graph,o=i.dataIndex,a=i.edgeDataIndex,s=r.getNodeByIndex(o),l=r.getEdgeByIndex(a);(s||l)&&(r.eachNode(function(t){uf(t,qk,.1)}),r.eachEdge(function(t){uf(t,Gk,.1)}),s&&(cf(s,qk),k(s.edges,function(t){t.dataIndex<0||(cf(t,Gk),cf(t.node1,qk),cf(t.node2,qk))})),l&&(cf(l,Gk),cf(l.node1,qk),cf(l.node2,qk)))},unfocusNodeAdjacency:function(){var t=this._model.getData().graph;t.eachNode(function(t){uf(t,qk)}),t.eachEdge(function(t){uf(t,Gk)})},_startForceLayoutIteration:function(t,e){var n=this;!function i(){t.step(function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())})}()},_updateController:function(r,t,o){var e=this._controller,i=this._controllerHost,a=this.group;e.setPointerChecker(function(t,e,n){var i=a.getBoundingRect();return i.applyTransform(a.transform),i.contain(e,n)&&!mh(t,o,r)}),"view"===r.coordinateSystem.type?(e.enable(r.get("roam")),i.zoomLimit=r.get("scaleLimit"),i.zoom=r.coordinateSystem.getZoom(),e.off("pan").off("zoom").on("pan",function(t,e){ph(i,t,e),o.dispatchAction({seriesId:r.id,type:"graphRoam",dx:t,dy:e})}).on("zoom",function(t,e,n){gh(i,t,e,n),o.dispatchAction({seriesId:r.id,type:"graphRoam",zoom:t,originX:e,originY:n}),this._updateNodeAndLinkScale(),$k(r.getGraph(),this._getNodeGlobalScale(r)),this._lineDraw.updateLayout()},this)):e.disable()},_updateNodeAndLinkScale:function(){var t=this._model,e=t.getData(),n=this._getNodeGlobalScale(t),i=[n,n];e.eachItemGraphicEl(function(t){t.attr("scale",i)})},_getNodeGlobalScale:function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=this._nodeScaleRatio,i=e.scale,r=i&&i[0]||1;return((e.getZoom()-1)*n+1)/r},updateLayout:function(t){$k(t.getGraph(),this._getNodeGlobalScale(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}}),Os({type:"graphRoam",event:"graphRoam",update:"none"},function(n,t){t.eachComponent({mainType:"series",query:n},function(t){var e=wh(t.coordinateSystem,n);t.setCenter&&t.setCenter(e.center),t.setZoom&&t.setZoom(e.zoom)})}),Os({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series.graph:focusNodeAdjacency"},function(){}),Os({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series.graph:unfocusNodeAdjacency"},function(){});var Yk=function(t){var a={};t.eachSeriesByType("graph",function(i){var r=i.getCategoriesData(),n=i.getData(),o={};r.each(function(t){var e=r.getName(t);o["ec-"+e]=t;var n=r.getItemModel(t).get("itemStyle.color")||i.getColorFromPalette(e,a);r.setItemVisual(t,"color",n)}),r.count()&&n.each(function(t){var e=n.getItemModel(t).getShallow("category");null!=e&&("string"==typeof e&&(e=o["ec-"+e]),n.getItemVisual(t,"color",!0)||n.setItemVisual(t,"color",r.getItemVisual(e,"color")))})})},Zk=function(t){t.eachSeriesByType("graph",function(t){var s=t.getGraph(),l=t.getEdgeData(),e=hf(t.get("edgeSymbol")),n=hf(t.get("edgeSymbolSize")),u="lineStyle.color".split("."),c="lineStyle.opacity".split(".");l.setVisual("fromSymbol",e&&e[0]),l.setVisual("toSymbol",e&&e[1]),l.setVisual("fromSymbolSize",n&&n[0]),l.setVisual("toSymbolSize",n&&n[1]),l.setVisual("color",t.get(u)),l.setVisual("opacity",t.get(c)),l.each(function(t){var e=l.getItemModel(t),n=s.getEdgeByIndex(t),i=hf(e.getShallow("symbol",!0)),r=hf(e.getShallow("symbolSize",!0)),o=e.get(u),a=e.get(c);switch(o){case"source":o=n.node1.getVisual("color");break;case"target":o=n.node2.getVisual("color")}i[0]&&n.setVisual("fromSymbol",i[0]),i[1]&&n.setVisual("toSymbol",i[1]),r[0]&&n.setVisual("fromSymbolSize",r[0]),r[1]&&n.setVisual("toSymbolSize",r[1]),n.setVisual("color",o),n.setVisual("opacity",a)})})},Xk=function(t){t.eachSeriesByType("graph",function(t){var e=t.get("layout"),n=t.coordinateSystem;if(n&&"view"!==n.type){var i=t.getData(),r=[];k(n.dimensions,function(t){r=r.concat(i.mapDimension(t,!0))});for(var o=0;o<i.count();o++){for(var a=[],s=!1,l=0;l<r.length;l++){var u=i.get(r[l],o);isNaN(u)||(s=!0),a.push(u)}s?i.setItemLayout(o,n.dataToPoint(a)):i.setItemLayout(o,[NaN,NaN])}ff(i.graph)}else e&&"none"!==e||df(t)})},Kk=function(t){t.eachSeriesByType("graph",function(t){"circular"===t.get("layout")&&pf(t)})},Qk=q,Jk=function(t){t.eachSeriesByType("graph",function(t){if(!(l=t.coordinateSystem)||"view"===l.type)if("force"===t.get("layout")){var h=t.preservedPoints||{},d=t.getGraph(),f=d.data,e=d.edgeData,n=t.getModel("force"),i=n.get("initLayout");t.preservedPoints?f.each(function(t){var e=f.getId(t);f.setItemLayout(t,h[e]||[NaN,NaN])}):i&&"none"!==i?"circular"===i&&pf(t):df(t);var r=f.getDataExtent("value"),o=e.getDataExtent("value"),a=n.get("repulsion"),s=n.get("edgeLength");E(a)||(a=[a,a]),E(s)||(s=[s,s]),s=[s[1],s[0]];var l,u=f.mapArray("value",function(t,e){var n=f.getItemLayout(e),i=Br(t,r,a);return isNaN(i)&&(i=(a[0]+a[1])/2),{w:i,rep:i,fixed:f.getItemModel(e).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}}),c=e.mapArray("value",function(t,e){var n=d.getEdgeByIndex(e),i=Br(t,o,s);return isNaN(i)&&(i=(s[0]+s[1])/2),{n1:u[n.node1.dataIndex],n2:u[n.node2.dataIndex],d:i,curveness:n.getModel().get("lineStyle.curveness")||0}}),p=(l=t.coordinateSystem).getBoundingRect(),g=gf(u,c,{rect:p,gravity:n.get("gravity")}),m=g.step;g.step=function(c){for(var t=0,e=u.length;t<e;t++)u[t].fixed&&j(u[t].p,d.getNodeByIndex(t).getLayout());m(function(t,e,n){for(var i=0,r=t.length;i<r;i++)t[i].fixed||d.getNodeByIndex(i).setLayout(t[i].p),h[f.getId(i)]=t[i].p;for(i=0,r=e.length;i<r;i++){var o=e[i],a=d.getEdgeByIndex(i),s=o.n1.p,l=o.n2.p,u=a.getLayout();(u=u?u.slice():[])[0]=u[0]||[],u[1]=u[1]||[],j(u[0],s),j(u[1],l),+o.curveness&&(u[2]=[(s[0]+l[0])/2-(s[1]-l[1])*o.curveness,(s[1]+l[1])/2-(l[0]-s[0])*o.curveness]),a.setLayout(u)}c&&c(n)})},t.forceLayout=g,t.preservedPoints=h,g.step()}else t.forceLayout=null})},tE=function(t,d){var f=[];return t.eachSeriesByType("graph",function(t){var e=t.get("coordinateSystem");if(!e||"view"===e){var n=t.getData(),i=[],r=[];gi(n.mapArray(function(t){var e=n.getItemModel(t);return[+e.get("x"),+e.get("y")]}),i,r),r[0]-i[0]==0&&(r[0]+=1,i[0]-=1),r[1]-i[1]==0&&(r[1]+=1,i[1]-=1);var o=(r[0]-i[0])/(r[1]-i[1]),a=mf(t,d,o);isNaN(o)&&(i=[a.x,a.y],r=[a.x+a.width,a.y+a.height]);var s=r[0]-i[0],l=r[1]-i[1],u=a.width,c=a.height,h=t.coordinateSystem=new Xc;h.zoomLimit=t.get("scaleLimit"),h.setBoundingRect(i[0],i[1],s,l),h.setViewRect(a.x,a.y,u,c),h.setCenter(t.get("center")),h.setZoom(t.get("zoom")),f.push(h)}}),f};Es(function(t){var o=t.findComponents({mainType:"legend"});o&&o.length&&t.eachSeriesByType("graph",function(t){var e=t.getCategoriesData(),i=t.getGraph().data,r=e.mapArray(e.getName);i.filterSelf(function(t){var e=i.getItemModel(t).getShallow("category");if(null!=e){"number"==typeof e&&(e=r[e]);for(var n=0;n<o.length;n++)if(!o[n].isSelected(e))return!1}return!0})},this)}),Fs(CM("graph","circle",null)),Fs(Yk),Fs(Zk),Rs(Xk),Rs(Kk),Rs(Jk),Ps("graphView",{create:tE});qT.extend({type:"series.gauge",getInitialData:function(t){var e=t.data||[];return E(e)||(e=[e]),t.data=e,iI(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var eE=Pi.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(r/3<=o?1:2),l=e.y-i(a)*o*(r/3<=o?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)}}),nE=2*Math.PI,iE=(La.extend({type:"gauge",render:function(t,e,n){this.group.removeAll();var i=t.get("axisLine.lineStyle.color"),r=vf(t,n);this._renderMain(t,e,n,i,r)},dispose:function(){},_renderMain:function(t,e,n,i,r){for(var o=this.group,a=t.getModel("axisLine").getModel("lineStyle"),s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=((f=-t.get("endAngle")/180*Math.PI)-l)%nE,c=l,h=a.get("width"),d=0;d<i.length;d++){var f,p=Math.min(Math.max(i[d][0],0),1),g=new dC({shape:{startAngle:c,endAngle:f=l+u*p,cx:r.cx,cy:r.cy,clockwise:s,r0:r.r-h,r:r.r},silent:!0});g.setStyle({fill:i[d][1]}),g.setStyle(a.getLineStyle(["color","borderWidth","borderColor"])),o.add(g),c=f}var m=function(t){if(t<=0)return i[0][1];for(var e=0;e<i.length;e++)if(i[e][0]>=t&&(0===e?0:i[e-1][0])<t)return i[e][1];return i[e-1][1]};if(!s){var v=l;l=f,f=v}this._renderTicks(t,e,n,m,r,l,f,s),this._renderPointer(t,e,n,m,r,l,f,s),this._renderTitle(t,e,n,m,r),this._renderDetail(t,e,n,m,r)},_renderTicks:function(t,e,n,i,r,o,a){for(var s=this.group,l=r.cx,u=r.cy,c=r.r,h=+t.get("min"),d=+t.get("max"),f=t.getModel("splitLine"),p=t.getModel("axisTick"),g=t.getModel("axisLabel"),m=t.get("splitNumber"),v=p.get("splitNumber"),y=Vr(f.get("length"),c),x=Vr(p.get("length"),c),b=o,w=(a-o)/m,_=w/v,S=f.getModel("lineStyle").getLineStyle(),C=p.getModel("lineStyle").getLineStyle(),T=0;T<=m;T++){var A=Math.cos(b),D=Math.sin(b);if(f.get("show")){var M=new xC({shape:{x1:A*c+l,y1:D*c+u,x2:A*(c-y)+l,y2:D*(c-y)+u},style:S,silent:!0});"auto"===S.stroke&&M.setStyle({stroke:i(T/m)}),s.add(M)}if(g.get("show")){var I=yf(jr(T/m*(d-h)+h),g.get("formatter")),k=g.get("distance"),E=i(T/m);s.add(new lC({style:pr({},g,{text:I,x:A*(c-y-k)+l,y:D*(c-y-k)+u,textVerticalAlign:D<-.4?"top":.4<D?"bottom":"middle",textAlign:A<-.4?"left":.4<A?"right":"center"},{autoColor:E}),silent:!0}))}if(p.get("show")&&T!==m){for(var L=0;L<=v;L++){A=Math.cos(b),D=Math.sin(b);var O=new xC({shape:{x1:A*c+l,y1:D*c+u,x2:A*(c-x)+l,y2:D*(c-x)+u},silent:!0,style:C});"auto"===C.stroke&&O.setStyle({stroke:i((T+L/v)/m)}),s.add(O),b+=_}b-=_}else b+=w}},_renderPointer:function(i,t,e,r,o,n,a){var s=this.group,l=this._data;if(i.get("pointer.show")){var u=[+i.get("min"),+i.get("max")],c=[n,a],h=i.getData(),d=h.mapDimension("value");h.diff(l).add(function(t){var e=new eE({shape:{angle:n}});Tr(e,{shape:{angle:Br(h.get(d,t),u,c,!0)}},i),s.add(e),h.setItemGraphicEl(t,e)}).update(function(t,e){var n=l.getItemGraphicEl(e);Cr(n,{shape:{angle:Br(h.get(d,t),u,c,!0)}},i),s.add(n),h.setItemGraphicEl(t,n)}).remove(function(t){var e=l.getItemGraphicEl(t);s.remove(e)}).execute(),h.eachItemGraphicEl(function(t,e){var n=h.getItemModel(e),i=n.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:Vr(i.get("width"),o.r),r:Vr(i.get("length"),o.r)}),t.useStyle(n.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",r(Br(h.get(d,e),u,[0,1],!0))),dr(t,n.getModel("emphasis.itemStyle").getItemStyle())}),this._data=h}else l&&l.eachItemGraphicEl(function(t){s.remove(t)})},_renderTitle:function(t,e,n,i,r){var o=t.getData(),a=o.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=r.cx+Vr(l[0],r.r),c=r.cy+Vr(l[1],r.r),h=+t.get("min"),d=+t.get("max"),f=i(Br(t.getData().get(a,0),[h,d],[0,1],!0));this.group.add(new lC({silent:!0,style:pr({},s,{x:u,y:c,text:o.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,n,i,r){var o=t.getModel("detail"),a=+t.get("min"),s=+t.get("max");if(o.get("show")){var l=o.get("offsetCenter"),u=r.cx+Vr(l[0],r.r),c=r.cy+Vr(l[1],r.r),h=Vr(o.get("width"),r.r),d=Vr(o.get("height"),r.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=i(Br(p,[a,s],[0,1],!0));this.group.add(new lC({silent:!0,style:pr({},o,{x:u,y:c,text:yf(p,o.get("formatter")),textWidth:isNaN(h)?null:h,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),js({type:"series.funnel",init:function(t){iE.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(){return iI(this,["value"])},_defaultLabelLine:function(t){Pn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),n=iE.superCall(this,"getDataParams",t),i=e.mapDimension("value"),r=e.getSum(i);return n.percent=r?+(e.get(i,t)/r*100).toFixed(2):0,n.$vars.push("percent"),n},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}})),rE=xf.prototype,oE=["itemStyle","opacity"];rE.updateData=function(t,e,n){var i=this.childAt(0),r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=t.getItemModel(e).get(oE);s=null==s?1:s,i.useStyle({}),n?(i.setShape({points:a.points}),i.setStyle({opacity:0}),Tr(i,{style:{opacity:s}},r,e)):Cr(i,{style:{opacity:s},shape:{points:a.points}},r,e);var l=o.getModel("itemStyle"),u=t.getItemVisual(e,"color");i.setStyle(D({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),i.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),dr(this)},rE._updateLabel=function(t,e){var n=this.childAt(1),i=this.childAt(2),r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");Cr(n,{shape:{points:a.linePoints||a.linePoints}},r,e),Cr(i,{style:{x:a.x,y:a.y}},r,e),i.attr({rotation:a.rotation,origin:[a.x,a.y],z2:10});var l=o.getModel("label"),u=o.getModel("emphasis.label"),c=o.getModel("labelLine"),h=o.getModel("emphasis.labelLine");s=t.getItemVisual(e,"color");fr(i.style,i.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!a.inside},{textAlign:a.textAlign,textVerticalAlign:a.verticalAlign}),i.ignore=i.normalIgnore=!l.get("show"),i.hoverIgnore=!u.get("show"),n.ignore=n.normalIgnore=!c.get("show"),n.hoverIgnore=!h.get("show"),n.setStyle({stroke:s}),n.setStyle(c.getModel("lineStyle").getLineStyle()),n.hoverStyle=h.getModel("lineStyle").getLineStyle()},o(xf,Xw);La.extend({type:"funnel",render:function(t){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add(function(t){var e=new xf(i,t);i.setItemGraphicEl(t,e),o.add(e)}).update(function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)}).remove(function(t){var e=r.getItemGraphicEl(t);o.remove(e)}).execute(),this._data=i},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var aE=function(t,w){t.eachSeriesByType("funnel",function(t){var r=t.getData(),o=r.mapDimension("value"),e=t.get("sort"),a=bf(t,w),n=wf(r,e),s=[Vr(t.get("minSize"),a.width),Vr(t.get("maxSize"),a.width)],i=r.getDataExtent(o),l=t.get("min"),u=t.get("max");null==l&&(l=Math.min(i[0],0)),null==u&&(u=i[1]);var c=t.get("funnelAlign"),h=t.get("gap"),d=(a.height-h*(r.count()-1))/r.count(),f=a.y,p=function(t,e){var n,i=Br(r.get(o,t)||0,[l,u],s,!0);switch(c){case"left":n=a.x;break;case"center":n=a.x+(a.width-i)/2;break;case"right":n=a.x+a.width-i}return[[n,e],[n+i,e]]};"ascending"===e&&(d=-d,h=-h,f+=a.height,n=n.reverse());for(var g=0;g<n.length;g++){var m=n[g],v=n[g+1],y=r.getItemModel(m).get("itemStyle.height");null==y?y=d:(y=Vr(y,a.height),"ascending"===e&&(y=-y));var x=p(m,f),b=p(v,f+y);f+=y+h,r.setItemLayout(m,{points:x.concat(b.slice().reverse())})}_f(r)})};Fs(lI("funnel")),Rs(aE),Es(fI("funnel"));var sE=function(t){Sf(t),Cf(t)},lE=function(t,e,n,i,r){rM.call(this,t,e,n),this.type=i||"value",this.axisIndex=r};lE.prototype={constructor:lE,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},o(lE,rM);var uE=function(t,e,n,i,r,o){e[0]=Af(e[0],n),e[1]=Af(e[1],n),t=t||0;var a=n[1]-n[0];null!=r&&(r=Af(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i&&(r=o=Math.abs(e[1]-e[0]),i=0);var s=Tf(e,i);e[i]+=t;var l=r||0,u=n.slice();s.sign<0?u[0]+=l:u[1]-=l,e[i]=Af(e[i],u);var c=Tf(e,i);null!=r&&(c.sign!==s.sign||c.span<r)&&(e[1-i]=e[i]+s.sign*r);c=Tf(e,i);return null!=o&&c.span>o&&(e[1-i]=e[i]+c.sign*o),e},cE=k,hE=Math.min,dE=Math.max,fE=Math.floor,pE=Math.ceil,gE=jr,mE=Math.PI;Df.prototype={type:"parallel",constructor:Df,_init:function(t,a){var e=t.dimensions,
|
|
s=t.parallelAxisIndex;cE(e,function(t,e){var n=s[e],i=a.getComponent("parallelAxis",n),r=this._axesMap.set(t,new lE(t,$l(i),[0,0],i.get("type"),n)),o="category"===r.type;r.onBand=o&&i.get("boundaryGap"),r.inverse=i.get("inverse"),(i.axis=r).model=i,r.coordinateSystem=i.coordinateSystem=this},this)},update:function(t){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return n<=o&&o<=n+e.axisLength&&i<=a&&a<=i+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,i){i.eachSeries(function(t){if(e.contains(t,i)){var n=t.getData();cE(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),Ul(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=po(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],u=this.dimensions.length,c=Mf(e.get("axisExpandWidth"),l),h=Mf(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&3<u&&h<u&&1<h&&0<c&&0<s,f=e.get("axisExpandWindow");f?(t=Mf(f[1]-f[0],l),f[1]=f[0]+t):(t=Mf(c*(h-1),l),(f=[c*(e.get("axisExpandCenter")||fE(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-h);p<3&&(p=0);var g=[fE(gE(f[0]/c,1))+1,pE(gE(f[1]/c,1))-1],m=p/c*f[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:d,axisExpandWidth:c,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var l=this._rect,t=this._axesMap,e=this.dimensions,u=this._makeLayoutInfo(),c=u.layout;t.each(function(t){var e=[0,u.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])}),cE(e,function(t,e){var n=(u.axisExpandable?kf:If)(e,u),i={horizontal:{x:n.position,y:u.axisLength},vertical:{x:0,y:n.position}},r={horizontal:mE/2,vertical:0},o=[i[c].x+l.x,i[c].y+l.y],a=r[c],s=ft();yt(s,s,a),vt(s,s,o),this._axesLayout[t]={position:o,rotation:a,transform:s,axisNameAvailableWidth:n.axisNameAvailableWidth,axisLabelShow:n.axisLabelShow,nameTruncateMaxWidth:n.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(e,t,n,i){null==n&&(n=0),null==i&&(i=e.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];k(o,function(t){a.push(e.mapDimension(t)),s.push(r.get(t).model)});for(var l=this.hasAxisBrushed(),u=n;u<i;u++){var c;if(l){c="active";for(var h=e.getValues(a,u),d=0,f=o.length;d<f;d++){if("inactive"===s[d].getActiveState(h[d])){c="inactive";break}}}else c="normal";t(c,u)}},hasAxisBrushed:function(){for(var t=this.dimensions,e=this._axesMap,n=!1,i=0,r=t.length;i<r;i++)"normal"!==e.get(t[i]).model.getActiveState()&&(n=!0);return n},axisCoordToPoint:function(t,e){return Dr([t,0],this._axesLayout[e].transform)},getAxisLayout:function(t){return L(this._axesLayout[t])},getSlidedAxisExpandWindow:function(t){var e=this._makeLayoutInfo(),n=e.pixelDimIndex,i=e.axisExpandWindow.slice(),r=i[1]-i[0],o=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:i};var a,s=t[n]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),h=null!=c[0];if(u)h&&u&&s<r*c[0]?(l="jump",a=s-r*c[2]):h&&u&&s>r*(1-c[0])?(l="jump",a=s-r*(1-c[2])):0<=(a=s-r*c[1])&&(a=s-r*(1-c[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?uE(a,i,o,"all"):l="none";else{r=i[1]-i[0];var d=o[1]*s/r;(i=[dE(0,d-r/2)])[1]=hE(o[1],i[0]+r),i[0]=i[1]-r}return{axisExpandWindow:i,behavior:l}}},qo.register("parallel",{create:Ef});var vE=oT.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return nS([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=L(t);if(e)for(var n=e.length-1;0<=n;n--)Wr(e[n])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;i<r;i++)if(e[i][0]<=t&&t<=e[i][1])return"active";return"inactive"}}),yE={type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};g(vE.prototype,UD),PM("parallel",vE,Lf,yE),oT.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},init:function(){oT.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(t){var e=this.option;t&&g(e,t,!0),this._initDimensions()},contains:function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},setAxisExpand:function(e){k(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])},this)},_initDimensions:function(){var e=this.dimensions=[],n=this.parallelAxisIndex=[];k(f(this.dependentModels.parallelAxis,function(t){return(t.get("parallelIndex")||0)===this.componentIndex},this),function(t){e.push("dim"+t.get("dim")),n.push(t.componentIndex)})}}),Os({type:"axisAreaSelect",event:"axisAreaSelected"},function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(t){t.axis.model.setActiveIntervals(e.intervals)})}),Os("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(t){t.setAxisExpand(e)})});var xE=y,bE=k,wE=A,_E=Math.min,SE=Math.max,CE=Math.pow,TE=1e4,AE=6,DE=6,ME="globalPan",IE={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},kE={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},EE={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},LE=0;Of.prototype={constructor:Of,enableBrush:function(t){return Vb&&T(this._mounted),this._brushType&&Nf(this),t.brushType&&Pf(this,t),this},setPanels:function(t){if(t&&t.length){var e=this._panels={};k(t,function(t){e[t.panelId]=L(t)})}else this._panels=null;return this},mount:function(t){t=t||{},Vb&&(this._mounted=!0),this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({position:t.position||[0,0],rotation:t.rotation||0,scale:t.scale||[1,1]}),this._transform=e.getLocalTransform(),this},eachCover:function(t,e){bE(this._covers,t,e)},updateCovers:function(r){function n(t,e){return(null!=t.id?t.id:o+e)+"-"+t.brushType}function t(t,e){return n(t.__brushOption,e)}function e(t,e){var n=r[t];if(null!=e&&a[e]===u)s[t]=a[e];else{var i=s[t]=null!=e?(a[e].__brushOption=n,a[e]):Ff(l,Rf(l,n));Bf(l,i)}}function i(t){a[t]!==u&&l.group.remove(a[t])}Vb&&T(this._mounted),r=A(r,function(t){return g(L(EE),t,!0)});var o="\0-brush-index-",a=this._covers,s=this._covers=[],l=this,u=this._creatingCover;return new Ys(a,r,t,n).add(e).update(e).remove(i).execute(),this},unmount:function(){if(!Vb||this._mounted)return this.enableBrush(!1),Uf(this),this._zr.remove(this.group),Vb&&(this._mounted=!1),this},dispose:function(){this.unmount(),this.off()}},r(Of,hw);var OE={mousedown:function(t){if(this._dragging)dp.call(this,t);else if(!t.target||!t.target.draggable){lp(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=jf(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);if(sp(this,t,e),this._dragging){lp(t);var n=cp(this,t,e,!1);n&&$f(this,n)}},mouseup:dp},PE={lineX:fp(0),lineY:fp(1),rect:{createCover:function(t,e){return Yf(xE(np,function(t){return t},function(t){return t}),t,e,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(t){var e=Gf(t);return Jf(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){Zf(t,e,n,i)},updateCommon:Xf,contain:up},polygon:{createCover:function(t,e){var n=new Xw;return n.add(new vC({name:"main",style:Qf(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new mC({name:"main",draggable:!0,drift:xE(ip,t,e),ondragend:xE($f,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n){e.childAt(0).setShape({points:op(t,e,n)})},updateCommon:Xf,contain:up}},NE=["axisLine","axisTickLabel","axisName"],RE=Vs({type:"parallelAxis",init:function(t,e){RE.superApply(this,"init",arguments),(this._brushController=new Of(e.getZr())).on("brush",v(this._onBrush,this))},render:function(t,e,n,i){if(!yp(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Xw,this.group.add(this._axisGroup),t.get("show")){var o=bp(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,c=O({strokeContainThreshold:l},a.getAxisLayout(u)),h=new BM(t,c);k(NE,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(c,s,t,o,l,n);var d=i&&!1===i.animation?null:t;Ir(r,this._axisGroup,d)}}},_refreshBrushController:function(t,e,n,i,r,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=ie.create({x:a[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,position:t.position}).setPanels([{panelId:"pl",clipPath:pp(u),isTargetByCursor:mp(u,o,i),getLinearBrushOtherExtent:gp(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(xp(n))},_onBrush:function(t,e){var n=this.axisModel,i=n.axis,r=A(t,function(t){return[i.coordToData(t.range[0],!0),i.coordToData(t.range[1],!0)]});(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},dispose:function(){this._brushController.dispose()}}),FE=5;Vs({type:"parallel",render:function(t,e,n){this._model=t,this._api=n,this._handlers||(this._handlers={},k(zE,function(t,e){n.getZr().on(e,this._handlers[e]=v(t,this))},this)),za(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},dispose:function(t,n){k(this._handlers,function(t,e){n.getZr().off(e,t)}),this._handlers=null},_throttledDispatchExpand:function(t){this._dispatchExpand(t)},_dispatchExpand:function(t){t&&this._api.dispatchAction(O({type:"parallelAxisExpand"},t))}});var zE={mousedown:function(t){wp(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(wp(this,"click")&&e){var n=[t.offsetX,t.offsetY],i=Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2);if(FE<i)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&wp(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i&&null})}}};ks(sE),qT.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(){var t=this.getSource();return _p(t,this),yl(t,this)},getRawIndicesByActiveState:function(n){var t=this.coordinateSystem,i=this.getData(),r=[];return t.eachActiveState(i,function(t,e){n===t&&r.push(i.getRawIndex(e))}),r},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});var HE=.3,BE=(La.extend({type:"parallel",init:function(){this._dataGroup=new Xw,this.group.add(this._dataGroup),this._data,this._initialized},render:function(r,t,e,o){function n(t){Mp(Ap(l,s,t,h,c),l,t,d)}function i(t,e){var n=u.getItemGraphicEl(e),i=Tp(l,t,h,c);l.setItemGraphicEl(t,n),Cr(n,{shape:{points:i}},o&&!1===o.animation?null:r,t),Mp(n,l,t,d)}function a(t){var e=u.getItemGraphicEl(t);s.remove(e)}var s=this._dataGroup,l=r.getData(),u=this._data,c=r.coordinateSystem,h=c.dimensions,d=Dp(r);if(l.diff(u).add(n).update(i).remove(a).execute(),!this._initialized){this._initialized=!0;var f=Cp(c,r,function(){setTimeout(function(){s.removeClipPath()})});s.setClipPath(f)}this._data=l},incrementalPrepareRender:function(){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(t,e){for(var n=e.getData(),i=e.coordinateSystem,r=i.dimensions,o=Dp(e),a=t.start;a<t.end;a++){var s=Ap(n,this._dataGroup,a,r,i);s.incremental=!0,Mp(s,n,a,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}}),["lineStyle","normal","opacity"]);Fs({seriesType:"parallel",reset:function(t,e){function n(t,r){c.eachActiveState(r,function(t,e){var n=d[t];if("normal"===t&&r.hasItemOption){var i=r.getItemModel(e).get(BE,!0);null!=i&&(n=i)}r.setItemVisual(e,"opacity",n)},t.start,t.end)}var i=t.getModel("itemStyle"),r=t.getModel("lineStyle"),o=e.get("color"),a=r.get("color")||i.get("color")||o[t.seriesIndex%o.length],s=t.get("inactiveOpacity"),l=t.get("activeOpacity"),u=t.getModel("lineStyle").getLineStyle(),c=t.coordinateSystem,h=t.getData(),d={normal:u.opacity,active:l,inactive:s};return h.setVisual("color",a),{progress:n}}});var VE=qT.extend({type:"series.sankey",layoutInfo:null,getInitialData:function(t){var e=t.edges||t.links,n=t.data||t.nodes;if(n&&e)return Ek(n,e,this,!0).data},setNodePosition:function(t,e){var n=this.option.data[t];n.localX=e[0],n.localY=e[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(t,e,n){if("edge"!==n)return VE.superCall(this,"formatTooltip",t,e);var i=this.getDataParams(t,n),r=i.data,o=r.source+" -- "+r.target;return i.value&&(o+=" : "+i.value),ro(o)},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.6}},animationEasing:"linear",animationDuration:1e3}}),jE=$i({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0},buildPath:function(t,e){var n=e.extent/2;t.moveTo(e.x1,e.y1-n),t.bezierCurveTo(e.cpx1,e.cpy1-n,e.cpx2,e.cpy2-n,e.x2,e.y2-n),t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n),t.closePath()}});Ws({type:"sankey",_model:null,render:function(w,t,i){var e=w.getGraph(),_=this.group,n=w.layoutInfo,S=n.width,C=n.height,u=w.getData(),T=w.getData("edge");this._model=w,_.removeAll(),_.attr("position",[n.x,n.y]),e.eachEdge(function(t){var e=new jE;e.dataIndex=t.dataIndex,e.seriesIndex=w.seriesIndex,e.dataType="edge";var n=t.getModel("lineStyle"),i=n.get("curveness"),r=t.node1.getLayout(),o=t.node1.getModel(),a=o.get("localX"),s=o.get("localY"),l=t.node2.getLayout(),u=t.node2.getModel(),c=u.get("localX"),h=u.get("localY"),d=t.getLayout();e.shape.extent=Math.max(1,d.dy);var f=(null!=a?a*S:r.x)+r.dx,p=(null!=s?s*C:r.y)+d.sy+d.dy/2,g=null!=c?c*S:l.x,m=(null!=h?h*C:l.y)+d.ty+d.dy/2,v=f*(1-i)+g*i,y=p,x=f*i+g*(1-i),b=m;switch(e.setShape({x1:f,y1:p,x2:g,y2:m,cpx1:v,cpy1:y,cpx2:x,cpy2:b}),e.setStyle(n.getItemStyle()),e.style.fill){case"source":e.style.fill=t.node1.getVisual("color");break;case"target":e.style.fill=t.node2.getVisual("color")}dr(e,t.getModel("emphasis.lineStyle").getItemStyle()),_.add(e),T.setItemGraphicEl(t.dataIndex,e)}),e.eachNode(function(t){var e=t.getLayout(),n=t.getModel(),i=n.get("localX"),r=n.get("localY"),o=n.getModel("label"),a=n.getModel("emphasis.label"),s=new yC({shape:{x:null!=i?i*S:e.x,y:null!=r?r*C:e.y,width:e.dx,height:e.dy},style:n.getModel("itemStyle").getItemStyle()}),l=t.getModel("emphasis.itemStyle").getItemStyle();fr(s.style,l,o,a,{labelFetcher:w,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),s.setStyle("fill",t.getVisual("color")),dr(s,l),_.add(s),u.setItemGraphicEl(t.dataIndex,s),s.dataType="node"}),w.get("draggable")&&u.eachItemGraphicEl(function(t,n){t.drift=function(t,e){this.shape.x+=t,this.shape.y+=e,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:w.id,dataIndex:u.getRawIndex(n),localX:this.shape.x/S,localY:this.shape.y/C})},t.draggable=!0,t.cursor="move"}),!this._data&&w.get("animation")&&_.setClipPath(kp(_.getBoundingRect(),w,function(){_.removeClipPath()})),this._data=w.getData()},dispose:function(){}}),Os({type:"dragNode",event:"dragNode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])})});var WE=function(t){t.eachSeriesByType("sankey",function(i){var t=i.getGraph().nodes;if(t.length){var r=Infinity,o=-Infinity;k(t,function(t){var e=t.getLayout().value;e<r&&(r=e),o<e&&(o=e)}),k(t,function(t){var e=new fk({type:"color",mappingMethod:"linear",dataExtent:[r,o],visual:i.get("color")}).mapValueToVisual(t.getLayout().value);t.setVisual("color",e);var n=t.getModel().get("itemStyle.color");null!=n&&t.setVisual("color",n)})}})};Rs(function(t,u){t.eachSeriesByType("sankey",function(t){var e=t.get("nodeWidth"),n=t.get("nodeGap"),i=Lp(t,u),r=(t.layoutInfo=i).width,o=i.height,a=t.getGraph(),s=a.nodes,l=a.edges;Pp(s),Op(s,l,e,n,r,o,0!==f(s,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"))})}),Fs(WE);var UE={_baseAxisDim:null,getInitialData:function(t,e){var n,i,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=r.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),i=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],d=[r,o],f=d[u].get("type"),p=d[1-u].get("type"),g=t.data;if(g&&i){var m=[];k(g,function(t,e){var n;t.value&&E(t.value)?(n=t.value.slice(),t.value.unshift(e)):E(t)?(n=t.slice(),t.unshift(e)):n=t,m.push(n)}),t.data=m}var v=this.defaultValueDimensions;return iI(this,{coordDimensions:[{name:c,type:Ks(f),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Ks(p),dimsDef:v.slice()}],dimensionsCount:v.length+1})},getBaseAxis:function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis}};r(qT.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}}),UE,!0);var $E=["itemStyle"],qE=["emphasis","itemStyle"],GE=(La.extend({type:"boxplot",render:function(t){var r=t.getData(),o=this.group,a=this._data;this._data||o.removeAll();var s="horizontal"===t.get("layout")?1:0;r.diff(a).add(function(t){if(r.hasValue(t)){var e=Jp(r.getItemLayout(t),r,t,s,!0);r.setItemGraphicEl(t,e),o.add(e)}}).update(function(t,e){var n=a.getItemGraphicEl(e);if(r.hasValue(t)){var i=r.getItemLayout(t);n?tg(i,n,r,t):n=Jp(i,r,t,s),o.add(n),r.setItemGraphicEl(t,n)}else o.remove(n)}).remove(function(t){var e=a.getItemGraphicEl(t);e&&o.remove(e)}).execute(),this._data=r},remove:function(){var e=this.group,t=this._data;this._data=null,t&&t.eachItemGraphicEl(function(t){t&&e.remove(t)})},dispose:B}),Pi.extend({type:"boxplotBoxPath",shape:{},buildPath:function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();i<n.length;i++)t.moveTo(n[i][0],n[i][1]),i++,t.lineTo(n[i][0],n[i][1])}})),YE=["itemStyle","borderColor"],ZE=k,XE=function(t){var e=ng(t);ZE(e,function(n){var t=n.seriesModels;t.length&&(ig(n),ZE(t,function(t,e){rg(t,n.boxOffsetList[e],n.boxWidthList[e])}))})};Fs(function(i){var r=i.get("color");i.eachRawSeriesByType("boxplot",function(t){var e=r[t.seriesIndex%r.length],n=t.getData();n.setVisual({legendSymbol:"roundRect",color:t.get(YE)||e}),i.isSeriesFiltered(t)||n.each(function(t){var e=n.getItemModel(t);n.setItemVisual(t,{color:e.get(YE,!0)})})})}),Rs(XE),r(qT.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)}}),UE,!0);var KE=["itemStyle"],QE=["emphasis","itemStyle"],JE=["color","color0","borderColor","borderColor0"],tL=(La.extend({type:"candlestick",render:function(t){this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},incrementalPrepareRender:function(t){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e){this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(r){var o=r.getData(),a=this._data,s=this.group,l=o.getLayout("isSimpleBox");this._data||s.removeAll(),o.diff(a).add(function(t){if(o.hasValue(t)){var e,n=o.getItemLayout(t);Tr(e=og(n,t,!0),{shape:{points:n.ends}},r,t),ag(e,o,t,l),s.add(e),o.setItemGraphicEl(t,e)}}).update(function(t,e){var n=a.getItemGraphicEl(e);if(o.hasValue(t)){var i=o.getItemLayout(t);n?Cr(n,{shape:{points:i.ends}},r,t):n=og(i,t),ag(n,o,t,l),s.add(n),o.setItemGraphicEl(t,n)}else s.remove(n)}).remove(function(t){var e=a.getItemGraphicEl(t);e&&s.remove(e)}).execute(),this._data=o},_renderLarge:function(t){this._clear(),lg(t,this.group)},_incrementalRenderNormal:function(t,e){for(var n,i=e.getData(),r=i.getLayout("isSimpleBox");null!=(n=t.next());){var o;ag(o=og(i.getItemLayout(n),n),i,n,r),o.incremental=!0,this.group.add(o)}},_incrementalRenderLarge:function(t,e){lg(e,this.group,!0)},remove:function(){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:B}),Pi.extend({type:"normalCandlestickBox",shape:{},buildPath:function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))}})),eL=Pi.extend({type:"largeCandlestickBox",shape:{},buildPath:function(t,e){for(var n=e.points,i=0;i<n.length;)if(this.__sign===n[i++]){var r=n[i++];t.moveTo(r,n[i++]),t.lineTo(r,n[i++])}else i+=3}}),nL=function(t){t&&E(t.series)&&k(t.series,function(t){b(t)&&"k"===t.type&&(t.type="candlestick")})},iL=["itemStyle","borderColor"],rL=["itemStyle","borderColor0"],oL=["itemStyle","color"],aL=["itemStyle","color0"],sL={seriesType:"candlestick",plan:ZT(),performRawSeries:!0,reset:function(t,e){function n(t,e){for(var n;null!=(n=t.next());){var i=e.getItemModel(n),r=e.getItemLayout(n).sign;e.setItemVisual(n,{color:o(r,i),borderColor:a(r,i)})}}function o(t,e){return e.get(0<t?oL:aL)}function a(t,e){return e.get(0<t?iL:rL)}var i=t.getData(),r=t.pipelineContext.large;if(i.setVisual({legendSymbol:"roundRect",colorP:o(1,t),colorN:o(-1,t),borderColorP:a(1,t),borderColorN:a(-1,t)}),!e.isSeriesFiltered(t))return!r&&{progress:n}}},lL="undefined"!=typeof Float32Array?Float32Array:Array,uL={seriesType:"candlestick",plan:ZT(),reset:function(t){function e(t,e){function o(t,e){var n=[];return n[w]=e,n[_]=t,isNaN(e)||isNaN(t)?[NaN,NaN]:x.dataToPoint(n)}function n(t,e,n){var i=e.slice(),r=e.slice();i[w]=Ji(i[w]+b/2,1,!1),r[w]=Ji(r[w]-b/2,1,!0),n?t.push(i,r):t.push(r,i)}function i(t,e,n){var i=o(t,n),r=o(e,n);return i[w]-=b/2,r[w]-=b/2,{x:i[0],y:i[1],width:_?b:r[0]-i[0],height:_?r[1]-i[1]:b}}function r(t){return t[w]=Ji(t[w],1),t}for(var a;null!=(a=t.next());){var s=e.get(S,a),l=e.get(C,a),u=e.get(T,a),c=e.get(A,a),h=e.get(D,a),d=Math.min(l,u),f=Math.max(l,u),p=o(d,s),g=o(f,s),m=o(c,s),v=o(h,s),y=[];n(y,g,0),n(y,p,1),y.push(r(v),r(g),r(m),r(p)),e.setItemLayout(a,{sign:cg(e,a,l,u,T),initBaseline:u<l?g[_]:p[_],ends:y,brushRect:i(c,h,s)})}}function n(t,e){for(var n,i,r=new lL(5*t.count),o=0,a=[],s=[];null!=(i=t.next());){var l=e.get(S,i),u=e.get(C,i),c=e.get(T,i),h=e.get(A,i),d=e.get(D,i);isNaN(l)||isNaN(h)||isNaN(d)?(r[o++]=NaN,o+=4):(r[o++]=cg(e,i,u,c,T),a[w]=l,a[_]=h,n=x.dataToPoint(a,null,s),r[o++]=n?n[0]:NaN,r[o++]=n?n[1]:NaN,a[_]=d,n=x.dataToPoint(a,null,s),r[o++]=n?n[1]:NaN)}e.setLayout("largePoints",r)}var x=t.coordinateSystem,i=t.getData(),b=hg(t,i),w=0,_=1,r=["x","y"],S=i.mapDimension(r[w]),o=i.mapDimension(r[_],!0),C=o[0],T=o[1],A=o[2],D=o[3];if(i.setLayout({candleWidth:b,isSimpleBox:b<=1.3}),!(null==S||o.length<4))return{progress:t.pipelineContext.large?n:e}}};ks(nL),Fs(sL),Rs(uL),qT.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(){return yl(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var cL=3,hL=pg.prototype;hL.stopEffectAnimation=function(){this.childAt(1).removeAll()},hL.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=this.childAt(1),r=0;r<cL;r++){var o=Ql(e,-1,-1,2,2,n);o.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var a=-r/cL*t.period+t.effectOffset;o.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(a).start(),o.animateStyle(!0).when(t.period,{opacity:0}).delay(a).start(),i.add(o)}fg(i,t)},hL.updateEffectAnimation=function(t){for(var e=this._effectCfg,n=this.childAt(1),i=["symbolType","period","rippleScale"],r=0;r<i.length;r++){var o=i[r];if(e[o]!==t[o])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}fg(n,t)},hL.highlight=function(){this.trigger("emphasis")},hL.downplay=function(){this.trigger("normal")},hL.updateData=function(t,e){var n=t.hostModel;this.childAt(0).updateData(t,e);var i=this.childAt(1),r=t.getItemModel(e),o=t.getItemVisual(e,"symbol"),a=dg(t.getItemVisual(e,"symbolSize")),s=t.getItemVisual(e,"color");i.attr("scale",a),i.traverse(function(t){t.attr({fill:s})});var l=r.getShallow("symbolOffset");if(l){var u=i.position;u[0]=Vr(l[0],a[0]),u[1]=Vr(l[1],a[1])}i.rotation=(r.getShallow("symbolRotate")||0)*Math.PI/180||0;var c={};if(c.showEffectOn=n.get("showEffectOn"),c.rippleScale=r.get("rippleEffect.scale"),c.brushType=r.get("rippleEffect.brushType"),c.period=1e3*r.get("rippleEffect.period"),c.effectOffset=e/t.count(),c.z=r.getShallow("z")||0,c.zlevel=r.getShallow("zlevel")||0,c.symbolType=o,c.color=s,this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===c.showEffectOn)this._effectCfg?this.updateEffectAnimation(c):this.startEffectAnimation(c),this._effectCfg=c;else{this._effectCfg=null,this.stopEffectAnimation();var h=this.childAt(0),d=function(){h.highlight(),"render"!==c.showEffectOn&&this.startEffectAnimation(c)},f=function(){h.downplay(),"render"!==c.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",d,this).on("mouseout",f,this).on("emphasis",d,this).on("normal",f,this)}this._effectCfg=c},hL.fadeOut=function(t){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),t&&t()},o(pg,Xw),Ws({type:"effectScatter",init:function(){this._symbolDraw=new Mu(pg)},render:function(t){var e=t.getData(),n=this._symbolDraw;n.updateData(e),this.group.add(n.group)},updateTransform:function(t){var e=t.getData();this.group.dirty();var n=TM().reset(t);n.progress&&n.progress({start:0,end:e.count()},e),this._symbolDraw.updateLayout(e)},_updateGroupTransform:function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=wt(e.getRoamTransform()),this.group.decomposeTransform())},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e)},dispose:function(){}}),Fs(CM("effectScatter","circle")),Rs(TM("effectScatter"));var dL="undefined"==typeof Uint32Array?Array:Uint32Array,fL="undefined"==typeof Float64Array?Array:Float64Array,pL=qT.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(t){t.data=t.data||[],gg(t);var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),pL.superApply(this,"init",arguments)},mergeOption:function(t){if(t.data=t.data||[],gg(t),t.data){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count))}pL.superApply(this,"mergeOption",arguments)},appendData:function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=H(this._flatCoords,e.flatCoords),this._flatCoordsOffset=H(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},_getCoordsFromItemModel:function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");if(Vb&&!(n instanceof Array&&0<n.length&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},getLineCoords:function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r<i;r++)e[r]=e[r]||[],e[r][0]=this._flatCoords[n+2*r],e[r][1]=this._flatCoords[n+2*r+1];return i}var o=this._getCoordsFromItemModel(t);for(r=0;r<o.length;r++)e[r]=e[r]||[],e[r][0]=o[r][0],e[r][1]=o[r][1];return o.length},_processFlatCoordsArray:function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),"number"!=typeof t[0])return{flatCoordsOffset:null,flatCoords:null,count:t.length};for(var n=t.length,i=new dL(n),r=new fL(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=t[l++];i[a++]=o+e,i[a++]=u;for(var c=0;c<u;c++){var h=t[l++],d=t[l++];if(r[o++]=h,r[o++]=d,n<l&&Vb)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,a),flatCoords:r,count:s}},getInitialData:function(t){if(Vb&&!qo.get(t.coordinateSystem))throw new Error("Unkown coordinate system "+t.coordinateSystem);var o=new hD(["value"],this);return o.hasItemOption=!1,o.initData(t.data,[],function(t,e,n,i){if(t instanceof Array)return NaN;o.hasItemOption=!0;var r=t.value;return null!=r?r instanceof Array?r[i]:r:void 0}),o},formatTooltip:function(t){var e=this.getData().getItemModel(t),n=e.get("name");if(n)return n;var i=e.get("fromName"),r=e.get("toName"),o=[];return null!=i&&o.push(i),null!=r&&o.push(r),ro(o.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive
|
|
;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),gL=mg.prototype;gL.createLine=function(t,e,n){return new Jd(t,e,n)},gL._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),i=n.get("symbolSize"),r=n.get("symbol");E(i)||(i=[i,i]);var o=n.get("color")||t.getItemVisual(e,"color"),a=this.childAt(1);this._symbolType!==r&&(this.remove(a),(a=Ql(r,-.5,-.5,1,1,o)).z2=100,a.culling=!0,this.add(a)),a&&(a.setStyle("shadowColor",o),a.setStyle(n.getItemStyle(["color"])),a.attr("scale",i),a.setColor(o),a.attr("scale",i),this._symbolType=r,this._updateEffectAnimation(t,n,e))},gL._updateEffectAnimation=function(e,t,n){var i=this.childAt(1);if(i){var r=this,o=e.getItemLayout(n),a=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=N(t.get("delay"),function(t){return t/e.count()*a/3}),c="function"==typeof u;if(i.ignore=!0,this.updateAnimationPoints(i,o),0<l&&(a=this.getLineLength(i)/l*1e3),a!==this._period||s!==this._loop){i.stopAnimation();var h=u;c&&(h=u(n)),0<i.__t&&(h=-a*i.__t),i.__t=0;var d=i.animate("",s).when(a,{__t:1}).delay(h).during(function(){r.updateSymbolPosition(i)});s||d.done(function(){r.remove(i)}),d.start()}this._period=a,this._loop=s}},gL.getLineLength=function(t){return sw(t.__p1,t.__cp1)+sw(t.__cp1,t.__p2)},gL.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},gL.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},gL.updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t,o=t.position,a=ui,s=ci;o[0]=a(e[0],i[0],n[0],r),o[1]=a(e[1],i[1],n[1],r);var l=s(e[0],i[0],n[0],r),u=s(e[1],i[1],n[1],r);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},gL.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var n=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,n,e)},o(mg,Xw);var mL=vg.prototype;mL._createPolyline=function(t,e,n){var i=t.getItemLayout(e),r=new vC({shape:{points:i}});this.add(r),this._updateCommonStl(t,e,n)},mL.updateData=function(t,e,n){var i=t.hostModel;Cr(this.childAt(0),{shape:{points:t.getItemLayout(e)}},i,e),this._updateCommonStl(t,e,n)},mL._updateCommonStl=function(t,e,n){var i=this.childAt(0),r=t.getItemModel(e),o=t.getItemVisual(e,"color"),a=n&&n.lineStyle,s=n&&n.hoverLineStyle;n&&!t.hasItemOption||(a=r.getModel("lineStyle").getLineStyle(),s=r.getModel("emphasis.lineStyle").getLineStyle()),i.useStyle(D({strokeNoScale:!0,fill:"none",stroke:o},a)),i.hoverStyle=s,dr(this)},mL.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},o(vg,Xw);var vL=yg.prototype;vL.createLine=function(t,e,n){return new vg(t,e,n)},vL.updateAnimationPoints=function(t,e){this._points=e;for(var n=[0],i=0,r=1;r<e.length;r++){var o=e[r-1],a=e[r];i+=sw(o,a),n.push(i)}if(0!==i){for(r=0;r<n.length;r++)n[r]/=i;this._offsets=n,this._length=i}},vL.getLineLength=function(){return this._length},vL.updateSymbolPosition=function(t){var e=t.__t,n=this._points,i=this._offsets,r=n.length;if(i){var o=this._lastFrame;if(e<this._lastFramePercent){for(a=Math.min(o+1,r-1);0<=a&&!(i[a]<=e);a--);a=Math.min(a,r-2)}else{for(var a=o;a<r&&!(i[a]>e);a++);a=Math.min(a-1,r-2)}rt(t.position,n[a],n[a+1],(e-i[a])/(i[a+1]-i[a]));var s=n[a+1][0]-n[a][0],l=n[a+1][1]-n[a][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=a,this._lastFramePercent=e,t.ignore=!1}},o(yg,mg);var yL=$i({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var n=e.segs,i=e.curveness;if(e.polyline)for(var r=0;r<n.length;){var o=n[r++];if(0<o){t.moveTo(n[r++],n[r++]);for(var a=1;a<o;a++)t.lineTo(n[r++],n[r++])}}else for(r=0;r<n.length;){var s=n[r++],l=n[r++],u=n[r++],c=n[r++];if(t.moveTo(s,l),0<i){var h=(s+u)/2-(l-c)*i,d=(l+c)/2-(u-s)*i;t.quadraticCurveTo(h,d,u,c)}else t.lineTo(u,c)}},findDataIndex:function(){var t=this.shape,e=t.segs,n=t.curveness;if(t.polyline)for(var i=0,r=0;r<e.length;){var o=e[r++];if(0<o)for(var a=e[r++],s=e[r++],l=1;l<o;l++){if(bi(a,s,u=e[r++],c=e[r++]))return i}i++}else for(i=0,r=0;r<e.length;){a=e[r++],s=e[r++];var u=e[r++],c=e[r++];if(0<n){if(_i(a,s,(a+u)/2-(s-c)*n,(s+c)/2-(u-a)*n,u,c))return i}else if(bi(a,s,u,c))return i;i++}return-1}}),xL=xg.prototype;xL.isPersistent=function(){return!this._incremental},xL.updateData=function(t){this.group.removeAll();var e=new yL({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},xL.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),5e5<t.count()?(this._incremental||(this._incremental=new Ui({silent:!0})),this.group.add(this._incremental)):this._incremental=null},xL.incrementalUpdate=function(t,e){var n=new yL;n.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(n,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=t.start,this.group.add(n))},xL.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},xL._setCommon=function(n,t,e){var i=t.hostModel;n.setShape({polyline:i.get("polyline"),curveness:i.get("lineStyle.curveness")}),n.useStyle(i.getModel("lineStyle").getLineStyle()),n.style.strokeNoScale=!0;var r=t.getVisual("color");r&&n.setStyle("stroke",r),n.setStyle("fill"),e||(n.seriesIndex=i.seriesIndex,n.on("mousemove",function(t){n.dataIndex=null;var e=n.findDataIndex(t.offsetX,t.offsetY);0<e&&(n.dataIndex=e+n.__startIndex)}))},xL._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var bL={seriesType:"lines",plan:ZT(),reset:function(g){function t(t,e){var n=[];if(y){var i,r=t.end-t.start;if(v){for(var o=0,a=t.start;a<t.end;a++)o+=g.getLineCoordsCount(a);i=new Float32Array(r+2*o)}else i=new Float32Array(4*r);var s=0,l=[];for(a=t.start;a<t.end;a++){var u=g.getLineCoords(a,n);v&&(i[s++]=u);for(var c=0;c<u;c++)l=m.dataToPoint(n[c],!1,l),i[s++]=l[0],i[s++]=l[1]}e.setLayout("linesPoints",i)}else for(a=t.start;a<t.end;a++){var h=e.getItemModel(a),d=(u=g.getLineCoords(a,n),[]);if(v)for(var f=0;f<u;f++)d.push(m.dataToPoint(n[f]));else{d[0]=m.dataToPoint(n[0]),d[1]=m.dataToPoint(n[1]);var p=h.get("lineStyle.curveness");+p&&(d[2]=[(d[0][0]+d[1][0])/2-(d[0][1]-d[1][1])*p,(d[0][1]+d[1][1])/2-(d[1][0]-d[0][0])*p])}e.setItemLayout(a,d)}}var m=g.coordinateSystem,v=g.get("polyline"),y=g.pipelineContext.large;return{progress:t}}};Ws({type:"lines",init:function(){},render:function(e,t,n){var i=e.getData(),r=this._updateLineDraw(i,e),o=e.get("zlevel"),a=e.get("effect.trailLength"),s=n.getZr(),l="svg"===s.painter.getType();if(l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&a){if(Vb){var u=!1;t.eachSeries(function(t){t!==e&&t.get("zlevel")===o&&(u=!0)}),u&&console.warn("Lines with trail effect should have an individual zlevel")}l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})}r.updateData(i),this._lastZlevel=o,this._finished=!0},incrementalPrepareRender:function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},incrementalRender:function(t,e){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=bL.reset(t);o.progress&&o.progress({start:0,end:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},_updateLineDraw:function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext.large;return Vb&&i&&o&&console.warn("Large lines not support effect"),n&&i===this._hasEffet&&r===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new xg:new tf(r?i?yg:vg:i?mg:Jd),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=o,this.group.removeAll()),this.group.add(n.group),n},_showEffect:function(t){return!!t.get("effect.show")},_clearLayer:function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},dispose:function(){}});var wL="lineStyle.opacity".split("."),_L={seriesType:"lines",reset:function(t){function e(t,e){var n=t.getItemModel(e),i=bg(n.getShallow("symbol",!0)),r=bg(n.getShallow("symbolSize",!0)),o=n.get(wL);i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1]),t.setItemVisual(e,"opacity",o)}var n=bg(t.get("symbol")),i=bg(t.get("symbolSize")),r=t.getData();return r.setVisual("fromSymbol",n&&n[0]),r.setVisual("toSymbol",n&&n[1]),r.setVisual("fromSymbolSize",i&&i[0]),r.setVisual("toSymbolSize",i&&i[1]),r.setVisual("opacity",t.get(wL)),{dataEach:r.hasItemOption?e:null}}};Rs(bL),Fs(_L),qT.extend({type:"series.heatmap",getInitialData:function(){return yl(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var t=qo.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});var SL=256;wg.prototype={update:function(t,e,n,i,r,o){var a=this._getBrush(),s=this._getGradient(t,r,"inRange"),l=this._getGradient(t,r,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=t.length;c.width=e,c.height=n;for(var f=0;f<d;++f){var p=t[f],g=p[0],m=p[1],v=i(p[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),x=y.data,b=0,w=x.length,_=this.minOpacity,S=this.maxOpacity-_;b<w;){v=x[b+3]/256;var C=4*Math.floor(v*(SL-1));if(0<v){var T=o(v)?s:l;0<v&&(v=v*S+_),x[b++]=T[C],x[b++]=T[C+1],x[b++]=T[C+2],x[b++]=T[C+3]*v*256}else b+=4}return h.putImageData(y,0,0),c},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=ew()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},_getGradient:function(t,e,n){for(var i=this._gradientPixels,r=i[n]||(i[n]=new Uint8ClampedArray(1024)),o=[0,0,0,0],a=0,s=0;s<256;s++)e[n](s/255,!0,o),r[a++]=o[0],r[a++]=o[1],r[a++]=o[2],r[a++]=o[3];return r}},Ws({type:"heatmap",render:function(n,t,e){var i;if(t.eachComponent("visualMap",function(e){e.eachTargetSeries(function(t){t===n&&(i=e)})}),Vb&&!i)throw new Error("Heatmap must use with visualMap");this.group.removeAll(),this._incrementalDisplayable=null;var r=n.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(n,e,0,n.getData().count()):Cg(r)&&this._renderOnGeo(r,n,i,e)},incrementalPrepareRender:function(){this.group.removeAll()},incrementalRender:function(t,e,n,i){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,n,i,r){var o,a,s=t.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");if(Vb){if("category"!==l.type||"category"!==u.type)throw new Error("Heatmap on cartesian must have two category axes");if(!l.onBand||!u.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}o=l.getBandWidth(),a=u.getBandWidth()}for(var c=this.group,h=t.getData(),d="itemStyle",f="emphasis.itemStyle",p="label",g="emphasis.label",m=t.getModel(d).getItemStyle(["color"]),v=t.getModel(f).getItemStyle(),y=t.getModel(p),x=t.getModel(g),b=s.type,w="cartesian2d"===b?[h.mapDimension("x"),h.mapDimension("y"),h.mapDimension("value")]:[h.mapDimension("time"),h.mapDimension("value")],_=n;_<i;_++){var S;if("cartesian2d"===b){if(isNaN(h.get(w[2],_)))continue;var C=s.dataToPoint([h.get(w[0],_),h.get(w[1],_)]);S=new yC({shape:{x:C[0]-o/2,y:C[1]-a/2,width:o,height:a},style:{fill:h.getItemVisual(_,"color"),opacity:h.getItemVisual(_,"opacity")}})}else{if(isNaN(h.get(w[1],_)))continue;S=new yC({z2:1,shape:s.dataToRect([h.get(w[0],_)]).contentShape,style:{fill:h.getItemVisual(_,"color"),opacity:h.getItemVisual(_,"opacity")}})}var T=h.getItemModel(_);h.hasItemOption&&(m=T.getModel(d).getItemStyle(["color"]),v=T.getModel(f).getItemStyle(),y=T.getModel(p),x=T.getModel(g));var A=t.getRawValue(_),D="-";A&&null!=A[2]&&(D=A[2]),fr(m,v,y,x,{labelFetcher:t,labelDataIndex:_,defaultText:D,isRectText:!0}),S.setStyle(m),dr(S,h.hasItemOption?v:O({},v)),(S.incremental=r)&&(S.useHoverLayer=!0),c.add(S),h.setItemGraphicEl(_,S)}},_renderOnGeo:function(r,t,e,n){var i=e.targetVisuals.inRange,o=e.targetVisuals.outOfRange,a=t.getData(),s=this._hmLayer||this._hmLayer||new wg;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=r.getViewRect().clone(),u=r.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),f=Math.min(l.height+l.y,n.getHeight()),p=d-c,g=f-h,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(m,function(t,e,n){var i=r.dataToPoint([t,e]);return i[0]-=c,i[1]-=h,i.push(n),i}),y=e.getExtent(),x="visualMap.continuous"===e.type?Sg(y,e.option.range):_g(y,e.getPieceList(),e.option.selected);s.update(v,p,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},x);var b=new an({style:{width:p,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(b)},dispose:function(){}});var CL=XM.extend({type:"series.pictorialBar",dependencies:["grid"],defaultOption:{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,hoverAnimation:!1},getInitialData:function(t){return t.stack=null,CL.superApply(this,"getInitialData",arguments)}}),TL=["itemStyle","borderWidth"],AL=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],DL=new uC;Ws({type:"pictorialBar",render:function(t,e,n){var a=this.group,s=t.getData(),l=this._data,i=t.coordinateSystem,r=!!i.getBaseAxis().isHorizontal(),o=i.grid.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:i,coordSysExtent:[[o.x,o.x+o.width],[o.y,o.y+o.height]],isHorizontal:r,valueDim:AL[+r],categoryDim:AL[1-r]};return s.diff(l).add(function(t){if(s.hasValue(t)){var e=Rg(s,t),n=Tg(s,t,e,u),i=Bg(s,u,n);s.setItemGraphicEl(t,i),a.add(i),qg(i,u,n)}}).update(function(t,e){var n=l.getItemGraphicEl(e);if(s.hasValue(t)){var i=Rg(s,t),r=Tg(s,t,i,u),o=Wg(s,r);n&&o!==n.__pictorialShapeStr&&(a.remove(n),s.setItemGraphicEl(t,null),n=null),n?Vg(n,u,r):n=Bg(s,u,r,!0),s.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=r,a.add(n),qg(n,u,r)}else a.remove(n)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&jg(l,t,e.__pictorialSymbolMeta.animationModel,e)}).execute(),this._data=s,this.group},dispose:B,remove:function(e){var t=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl(function(t){jg(n,t.dataIndex,e,t)}):t.removeAll()}});Rs(y(Fl,"pictorialBar")),Fs(CM("pictorialBar","roundRect"));var ML=function(t,e,n,i,r){rM.call(this,t,e,n),this.type=i||"value",this.position=r||"bottom",this.orient=null};ML.prototype={constructor:ML,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},pointToData:function(t,e){return this.coordinateSystem.pointToData(t,e)[0]},toGlobalCoord:null,toLocalCoord:null},o(ML,rM),Yg.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:Yg,_init:function(t){var e=this.dimension,n=new ML(e,$l(t),[0,0],t.get("type"),t.get("position")),i="category"===n.type;n.onBand=i&&t.get("boundaryGap"),n.inverse=t.get("inverse"),n.orient=t.get("orient"),(t.axis=n).model=t,(n.coordinateSystem=this)._axis=n},update:function(t){t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData();k(e.mapDimension(this.dimension,!0),function(t){this._axis.scale.unionExtentFromData(e,t)},this),Ul(this._axis.scale,this._axis.model)}},this)},resize:function(t,e){this._rect=po({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var t=this._rect,e=this._axis,n=e.isHorizontal(),i=n?[0,t.width]:[0,t.height],r=e.reverse?1:0;e.setExtent(i[r],i[1-r]),this._updateAxisTransform(e,n?t.x:t.y)},_updateAxisTransform:function(t,e){var n=t.getExtent(),i=n[0]+n[1],r=t.isHorizontal();t.toGlobalCoord=r?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord=r?function(t){return t-e}:function(t){return i-t+e}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(t){var e=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[r]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i}},qo.register("single",{create:Zg,dimensions:Yg.prototype.dimensions});var IL=["axisLine","axisTickLabel","axisName"],kL="splitLine",EL=$M.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,n,i){var r=this.group;r.removeAll();var o=Xg(t),a=new BM(t,o);k(IL,a.add,a),r.add(a.getGroup()),t.get(kL+".show")&&this["_"+kL](t),EL.superCall(this,"render",t,e,n,i)},_splitLine:function(t){var e=t.axis;if(!e.scale.isBlank()){var n=t.getModel("splitLine"),i=n.getModel("lineStyle"),r=i.get("width"),o=i.get("color");o=o instanceof Array?o:[o];for(var a=t.coordinateSystem.getRect(),s=e.isHorizontal(),l=[],u=0,c=e.getTicksCoords({tickModel:n}),h=[],d=[],f=0;f<c.length;++f){var p=e.toGlobalCoord(c[f].coord);s?(h[0]=p,h[1]=a.y,d[0]=p,d[1]=a.y+a.height):(h[0]=a.x,h[1]=p,d[0]=a.x+a.width,d[1]=p);var g=u++%o.length;l[g]=l[g]||[],l[g].push(new xC(Ki({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]},style:{lineWidth:r},silent:!0})))}for(f=0;f<l.length;++f)this.group.add(LC(l[f],{style:{stroke:o[f%o.length],lineDash:i.getLineDash(r),lineWidth:r},silent:!0}))}}}),LL=oT.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}}),OL={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:2,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:2}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}};g(LL.prototype,UD),PM("single",LL,Kg,OL);var PL=function(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=jn(o,t);if(null==a||a<0||E(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)i=l.dataToPoint(o.getValues(A(l.dimensions,function(t){return o.mapDimension(t)}),a,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),i=[u.x+u.width/2,u.y+u.height/2]}return{point:i,el:s}},NL=k,RL=y,FL=Wn(),zL=function(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,a=t.dispatchAction||v(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){sm(o)&&(o=PL({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},e).point);var l=sm(o),u=r.axesInfo,c=s.axesInfo,h="leave"===i||sm(o),d={},f={},p={list:[],map:{}},g={showPointer:RL(tm,f),showTooltip:RL(em,p)};NL(s.coordSysMap,function(t,e){var r=l||t.containPoint(o);NL(s.coordSysAxesInfo[e],function(t){var e=t.axis,n=om(u,t);if(!h&&r&&(!u||n)){var i=n&&n.value;null!=i||l||(i=e.pointToData(o)),null!=i&&Qg(t,i,g,!1,d)}})});var m={};return NL(c,function(r,t){var o=r.linkGroup;o&&!f[t]&&NL(o.axesInfo,function(t,e){var n=f[e];if(t!==r&&n){var i=n.value;o.mapper&&(i=r.axis.scale.parse(o.mapper(i,am(t),am(r)))),m[r.key]=i}})}),NL(m,function(t,e){Qg(c[e],t,g,!0,d)}),nm(f,c,d),im(p,o,t,a),rm(c,a,n),d}},HL=(Bs({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}}),Wn()),BL=k,VL=Vs({type:"axisPointer",render:function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";lm("axisPointer",n,function(t,e,n){"none"!==r&&("leave"===t||0<=r.indexOf(t))&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){pm(e.getZr(),"axisPointer"),VL.superApply(this._model,"remove",arguments)},dispose:function(t,e){pm("axisPointer",e),VL.superApply(this._model,"dispose",arguments)}}),jL=Wn(),WL=L,UL=v;gm.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,n,i){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(t,e);if(a){var h=y(mm,e,c);this.updatePointerEl(a,l,h,e),this.updateLabelEl(a,l,h,e)}else a=this._group=new Xw,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);bm(a,e,!0),this._renderHandle(r)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var n=e.get("animation"),i=t.axis,r="category"===i.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"!==n&&null!=n)return!0===n;var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=Cc(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1},makeElOption:function(){},createPointerEl:function(t,e){var n=e.pointer;if(n){var i=jL(t).pointerEl=new OC[n.type](WL(e.pointer));t.add(i)}},createLabelEl:function(t,e,n,i){if(e.label){var r=jL(t).labelEl=new yC(WL(e.label));t.add(r),ym(r,i)}},updatePointerEl:function(t,e,n){var i=jL(t).pointerEl;i&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,n,i){var r=jL(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{shape:e.label.shape,position:e.label.position}),ym(r,i))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=Lr(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){k_(t.event)},onmousedown:UL(this._onHandleDragMove,this,0,0),drift:UL(this._onHandleDragMove,this),ondragend:UL(this._onHandleDragEnd,this)}),i.add(r)),bm(r,n,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];r.setStyle(o.getItemStyle(null,s));var l=o.get("size");E(l)||(l=[l,l]),r.attr("scale",[l[0]/2,l[1]/2]),za(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){mm(this._axisPointerModel,!e&&this._moveAnimation,this._handle,xm(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(xm(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(xm(i)),jL(n).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}},Xn(gm.prototype.constructor=gm);var $L=gm.extend({makeElOption:function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=km(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var c=wm(i),h=qL[s](o,u,l,c);h.style=c,t.graphicKey=h.type,t.pointer=h}Am(e,t,kc(a.model,n),n,i,r)},getHandleTransform:function(t,e,n){var i=kc(e.axis.grid.model,e,{labelInside:!1});return i.labelMargin=n.get("handle.margin"),{position:Tm(e.axis,t,i),rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,n){var i=n.axis,r=i.grid,o=i.getGlobalExtent(!0),a=km(r,i).getOtherAxis(i).getGlobalExtent(),s="x"===i.dim?0:1,l=t.position;l[s]+=e[s],l[s]=Math.min(o[1],l[s]),l[s]=Math.max(o[0],l[s]);var u=(a[1]+a[0])/2,c=[u,u];c[s]=l[s];var h=[{verticalAlign:"middle"},{align:"center"}];return{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:h[s]}}}),qL={line:function(t,e,n,i){var r=Dm([e,n[0]],[e,n[1]],Em(t));return Ki({shape:r,style:i}),{type:"Line",shape:r}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:Mm([e-i/2,n[0]],[i,r],Em(t))}}};$M.registerAxisPointerClass("CartesianAxisPointer",$L),ks(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!E(e)&&(t.axisPointer.link=[e])}}),Es(OA.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=vc(t,e)}),Os({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},zL);var GL=["x","y"],YL=["width","height"],ZL=gm.extend({makeElOption:function(t,e,n,i,r){var o=n.axis,a=o.coordinateSystem,s=Om(a,1-Lm(o)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var c=wm(i),h=XL[u](o,l,s,c);h.style=c,t.graphicKey=h.type,t.pointer=h}Am(e,t,Xg(n),n,i,r)},getHandleTransform:function(t,e,n){var i=Xg(e,{labelInside:!1});return i.labelMargin=n.get("handle.margin"),{position:Tm(e.axis,t,i),rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,n){var i=n.axis,r=i.coordinateSystem,o=Lm(i),a=Om(r,o),s=t.position;s[o]+=e[o],s[o]=Math.min(a[1],s[o]),s[o]=Math.max(a[0],s[o]);var l=Om(r,1-o),u=(l[1]+l[0])/2,c=[u,u];return c[o]=s[o],{position:s,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),XL={line:function(t,e,n,i){var r=Dm([e,n[0]],[e,n[1]],Lm(t));return Ki({shape:r,style:i}),{type:"Line",shape:r}},shadow:function(t,e,n){var i=t.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:Mm([e-i/2,n[0]],[i,r],Lm(t))}}};$M.registerAxisPointerClass("SingleAxisPointer",ZL),Vs({type:"single"});var KL=2,QL=qT.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(){QL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){for(var e=t.length,n=A(Ep().key(function(t){return t[2]}).entries(t),function(t){return{name:t.key,dataList:t.values}}),i=n.length,r=-1,o=-1,a=0;a<i;++a){var s=n[a].dataList.length;r<s&&(r=s,o=a)}for(var l=0;l<i;++l)if(l!==o)for(var u=n[l].name,c=0;c<r;++c){for(var h=n[o].dataList[c][0],d=n[l].dataList.length,f=-1,p=0;p<d;++p){if(n[l].dataList[p][0]===h){f=p;break}}-1===f&&(t[e]=[],t[e][0]=h,t[e][1]=0,t[e][2]=u,e++)}return t},getInitialData:function(t,e){for(var n=e.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),i=f(t.data,function(t){return t[2]!==undefined}),r=this.fixData(i||[]),o=[],a=this.nameMap=z(),s=0,l=0;l<r.length;++l)o.push(r[l][KL]),a.get(r[l][KL])||(a.set(r[l][KL],s),s++);var u=pD(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:Ks(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),c=new hD(u,this);return c.initData(r),c},getLayerSeries:function(){function t(t,e){return n.get(a,t)-n.get(a,e)}for(var n=this.getData(),e=n.count(),i=[],r=0;r<e;++r)i[r]=r;for(var o=A(Ep().key(function(t){return n.get("name",t)}).entries(i),function(t){return{name:t.key,indices:t.values}}),a=n.mapDimension("single"),s=0;s<o.length;++s)o[s].indices.sort(t);return o},getAxisTooltipData:function(t,e){E(t)||(t=t?[t]:[]);for(var n,i=this.getData(),r=this.getLayerSeries(),o=[],a=r.length,s=0;s<a;++s){for(var l=Number.MAX_VALUE,u=-1,c=r[s].indices.length,h=0;h<c;++h){var d=i.get(t[0],r[s].indices[h]),f=Math.abs(d-e);f<=l&&(n=d,l=f,u=r[s].indices[h])}o.push(u)}return{dataIndices:o,nestestValue:n}},formatTooltip:function(t){var e=this.getData(),n=e.getName(t),i=e.get(e.mapDimension("value"),t);return(isNaN(i)||null==i)&&(i="-"),ro(n+" : "+i)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}});Ws({type:"themeRiver",init:function(){this._layers=[]},render:function(_){function t(t){return t.name}function e(t,e,n){var i=this._layers;if("remove"!==t){for(var r,o,a,s=[],l=[],u=T[e].indices,c=0;c<u.length;c++){var h=S.getItemLayout(u[c]),d=h.x,f=h.y0,p=h.y;s.push([d,f]),l.push([d,f+p]),r=S.getItemVisual(u[c],"color")}var g=S.getItemLayout(u[0]),m=S.getItemModel(u[c-1]),v=m.getModel("label"),y=v.get("margin");if("add"===t){var x=A[e]=new Xw;o=new SM({shape:{points:s,stackedOnPoints:l,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),a=new lC({style:{x:g.x-y,y:g.y0+g.y/2}}),x.add(o),x.add(a),C.add(x),o.setClipPath(Pm(o.getBoundingRect(),_,function(){o.removeClipPath()}))}else{x=i[n];o=x.childAt(0),a=x.childAt(1),C.add(x),A[e]=x,Cr(o,{shape:{points:s,stackedOnPoints:l}},_),Cr(a,{style:{x:g.x-y,y:g.y0+g.y/2}},_)}var b=m.getModel("emphasis.itemStyle"),w=m.getModel("itemStyle");pr(a.style,v,{text:v.get("show")?_.getFormattedLabel(u[c-1],"normal")||S.getName(u[c-1]):null,textVerticalAlign:"middle"}),o.setStyle(O({fill:r},w.getItemStyle(["color"]))),dr(o,b.getItemStyle())}else C.remove(i[e])}var S=_.getData(),C=this.group,T=_.getLayerSeries(),n=S.getLayout("layoutInfo"),i=n.rect,r=n.boundaryGap;C.attr("position",[0,i.y+r[0]]);var o=new Ys(this._layersSeries||[],T,t,t),A={};o.add(v(e,this,"add")).update(v(e,this,"update")).remove(v(e,this,"remove")).execute(),this._layersSeries=T,this._layers=A},dispose:function(){}}
|
|
);var JL=function(t){t.eachSeriesByType("themeRiver",function(r){var o=r.getData(),a=r.getRawData(),s=r.get("color"),l=z();o.each(function(t){l.set(o.getRawIndex(t),t)}),a.each(function(t){var e=a.getName(t),n=s[(r.nameMap.get(e)-1)%s.length];a.setItemVisual(t,"color",n);var i=l.get(t);null!=i&&o.setItemVisual(i,"color",n)})})};Rs(function(t){t.eachSeriesByType("themeRiver",function(t){var e=t.getData(),n=t.coordinateSystem,i={},r=n.getRect();i.rect=r;var o=t.get("boundaryGap"),a=n.getAxis();(i.boundaryGap=o,"horizontal"===a.orient)?(o[0]=Vr(o[0],r.height),o[1]=Vr(o[1],r.height),Nm(e,t,r.height-o[0]-o[1])):(o[0]=Vr(o[0],r.width),o[1]=Vr(o[1],r.width),Nm(e,t,r.width-o[0]-o[1]));e.setLayout("layoutInfo",i)})}),Fs(JL),Es(fI("themeRiver")),qT.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(t){var e={name:t.name,children:t.data};Fm(e);var n=t.levels||[],i={};return i.levels=n,Eh.createTree(e,this,i).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(t){var e=qT.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=id(n,this),e},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0,emphasis:{}},itemStyle:{borderWidth:1,borderColor:"white",opacity:1,emphasis:{},highlight:{opacity:1},downplay:{opacity:.9}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var tO={NONE:"none",DESCENDANT:"descendant",ANCESTOR:"ancestor",SELF:"self"},eO=2,nO=4,iO=zm.prototype;iO.updateData=function(t,e,n,i,r){(this.node=e).piece=this,i=i||this._seriesModel,r=r||this._ecModel;var o=this.childAt(0);o.dataIndex=e.dataIndex;var a=e.getModel(),s=e.getLayout();s||console.log(e.getLayout());var l=O({},s);l.label=null;var u,c=Hm(e,i,r),h=a.getModel("itemStyle").getItemStyle();"normal"===n?u=h:u=g(a.getModel(n+".itemStyle").getItemStyle(),h);u=D({lineJoin:"bevel",fill:u.fill||c},u),t?(o.setShape(l),o.shape.r=s.r0,Cr(o,{shape:{r:s.r}},i,e.dataIndex),o.useStyle(u)):"object"==typeof u.fill&&u.fill.type||"object"==typeof o.style.fill&&o.style.fill.type?(Cr(o,{shape:l},i),o.useStyle(u)):Cr(o,{shape:l,style:u},i),this._updateLabel(i,c,n);var d=a.getShallow("cursor");if(d&&o.attr("cursor",d),t){var f=i.getShallow("highlightPolicy");this._initEvents(o,e,i,f)}this._seriesModel=i||this._seriesModel,this._ecModel=r||this._ecModel},iO.onEmphasis=function(e){var n=this;this.node.hostTree.root.eachNode(function(t){t.piece&&(n.node===t?t.piece.updateData(!1,t,"emphasis"):Vm(t,n.node,e)?t.piece.childAt(0).trigger("highlight"):e!==tO.NONE&&t.piece.childAt(0).trigger("downplay"))})},iO.onNormal=function(){this.node.hostTree.root.eachNode(function(t){t.piece&&t.piece.updateData(!1,t,"normal")})},iO.onHighlight=function(){this.updateData(!1,this.node,"highlight")},iO.onDownplay=function(){this.updateData(!1,this.node,"downplay")},iO._updateLabel=function(t,e,n){function i(t){var e=a.get(t);return null==e?o.get(t):e}var r=this.node.getModel(),o=r.getModel("label"),a="normal"===n||"emphasis"===n?o:r.getModel(n+".label"),s=r.getModel("emphasis.label"),l=N(t.getFormattedLabel(this.node.dataIndex,"normal",null,null,"label"),this.node.name);!1===i("show")&&(l="");var u=this.node.getLayout(),c=a.get("minAngle");null==c&&(c=o.get("minAngle")),c=c/180*Math.PI;var h=u.endAngle-u.startAngle;null!=c&&Math.abs(h)<c&&(l="");var d=this.childAt(1);fr(d.style,d.hoverStyle||{},o,s,{defaultText:a.getShallow("show")?l:null,autoColor:e,useInsideStyle:!0});var f,p=(u.startAngle+u.endAngle)/2,g=Math.cos(p),m=Math.sin(p),v=i("position"),y=i("distance")||0,x=i("align");"outside"===v?(f=u.r+y,x=p>Math.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:i("verticalAlign")||"middle",opacity:i("opacity")});var b=f*g+u.cx,w=f*m+u.cy;d.attr("position",[b,w]);var _=i("rotate"),S=0;"radial"===_?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===_?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof _&&(S=_*Math.PI/180),d.attr("rotation",S)},iO._initEvents=function(t,e,n,i){t.off("mouseover").off("mouseout").off("emphasis").off("normal");var r=this,o=function(){r.onEmphasis(i)},a=function(){r.onNormal()},s=function(){r.onDownplay()},l=function(){r.onHighlight()};n.isAnimationEnabled()&&t.on("mouseover",o).on("mouseout",a).on("emphasis",o).on("normal",a).on("downplay",s).on("highlight",l)},o(zm,Xw);var rO="sunburstRootToNode",oO=(La.extend({type:"sunburst",init:function(){},render:function(i,r,t,e){function n(n,i){function t(t){return t.getId()}function e(t,e){o(null==t?null:n[t],null==e?null:i[e])}0===n.length&&0===i.length||new Ys(i,n,t,t).add(e).update(e).remove(y(e,null)).execute()}function o(t,e){if(f||!t||t.getValue()||(t=null),t!==c&&e!==c)if(e&&e.piece)t?(e.piece.updateData(!1,t,"normal",i,r),u.setItemGraphicEl(t.dataIndex,e.piece)):a(e);else if(t){var n=new zm(t,i,r);d.add(n),u.setItemGraphicEl(t.dataIndex,n)}}function a(t){t&&t.piece&&(d.remove(t.piece),t.piece=null)}function s(t,e){if(0<e.depth){l.virtualPiece?l.virtualPiece.updateData(!1,t,"normal",i,r):(l.virtualPiece=new zm(t,i,r),d.add(l.virtualPiece)),e.piece._onclickEvent&&e.piece.off("click",e.piece._onclickEvent);var n=function(){l._rootToNode(e.parentNode)};e.piece._onclickEvent=n,l.virtualPiece.on("click",n)}else l.virtualPiece&&(d.remove(l.virtualPiece),l.virtualPiece=null)}var l=this;this.seriesModel=i,this.api=t,this.ecModel=r;var u=i.getData(),c=u.tree.root,h=i.getViewRoot(),d=this.group,f=i.get("renderLabelForZeroData"),p=[];h.eachNode(function(t){p.push(t)});var g=this._oldChildren||[];if(n(p,g),s(c,h),e&&e.highlight&&e.highlight.piece){var m=i.getShallow("highlightPolicy");e.highlight.piece.onEmphasis(m)}else if(e&&e.unhighlight){var v=this.virtualPiece;!v&&c.children.length&&(v=c.children[0].piece),v&&v.onNormal()}this._initEvents(),this._oldChildren=p},dispose:function(){},_initEvents:function(){var s=this,t=function(o){var a=!1;s.seriesModel.getViewRoot().eachNode(function(t){if(!a&&t.piece&&t.piece.childAt(0)===o.target){var e=t.getModel().get("nodeClick");if("rootToNode"===e)s._rootToNode(t);else if("link"===e){var n=t.getModel(),i=n.get("link");if(i){var r=n.get("target",!0)||"_blank";window.open(i,r)}}a=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:rO,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,r=t[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}}}),"sunburstRootToNode");Os({type:oO,update:"updateView"},function(i,t){function e(t){var e=td(i,[oO],t);if(e){var n=t.getViewRoot();n&&(i.direction=nd(n,e.node)?"rollUp":"drillDown"),t.resetViewRoot(e.node)}}t.eachComponent({mainType:"series",subType:"sunburst",query:i},e)});var aO="sunburstHighlight";Os({type:aO,update:"updateView"},function(n,t){function e(t){var e=td(n,[aO],t);e&&(n.highlight=e.node)}t.eachComponent({mainType:"series",subType:"sunburst",query:n},e)}),Os({type:"sunburstUnhighlight",update:"updateView"},function(t,e){function n(){t.unhighlight=!0}e.eachComponent({mainType:"series",subType:"sunburst",query:t},n)});var sO=Math.PI/180,lO=function(t,e,I){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");E(n)||(n=[0,n]),E(e)||(e=[e,e]);var i=I.getWidth(),r=I.getHeight(),c=Math.min(i,r),h=Vr(e[0],i),d=Vr(e[1],r),f=Vr(n[0],c/2),o=Vr(n[1],c/2),a=-t.get("startAngle")*sO,p=t.get("minAngle")*sO,g=t.getData().tree.root,s=t.getViewRoot(),m=s.depth,l=t.get("sort");null!=l&&jm(s,l);var u=0;k(s.children,function(t){!isNaN(t.getValue())&&u++});var v=s.getValue(),y=Math.PI/(v||u)*2,x=0<s.depth,b=s.height-(x?-1:1),w=(o-f)/(b||1),_=t.get("clockwise"),S=t.get("stillShowZeroSum"),C=_?1:-1,T=function(t,e){if(t){var n=e;if(t!==g){var i=t.getValue(),r=0===v&&S?y:i*y;r<p&&(r=p),n=e+C*r;var o=t.depth-m-(x?-1:1),a=f+w*o,s=f+w*(o+1),l=t.getModel();null!=l.get("r0")&&(a=Vr(l.get("r0"),c/2)),null!=l.get("r")&&(s=Vr(l.get("r"),c/2)),t.setLayout({angle:r,startAngle:e,endAngle:n,clockwise:_,cx:h,cy:d,r0:a,r:s})}if(t.children&&t.children.length){var u=0;k(t.children,function(t){u+=T(t,e+u)})}return n-e}};if(x){var A=f,D=f+w,M=2*Math.PI;g.setLayout({angle:M,startAngle:a,endAngle:a+M,clockwise:_,cx:h,cy:d,r0:A,r:D})}T(s,a)})};Fs(y(lI,"sunburst")),Rs(y(lO,"sunburst")),Es(y(fI,"sunburst"));var uO=["itemStyle"],cO=["emphasis","itemStyle"],hO=["label"],dO=["emphasis","label"],fO="e\0\0",pO={cartesian2d:function(e){var t=e.grid.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:v(Um,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:v($m,e)}}},singleAxis:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:v(qm,e)}}},polar:function(r){var o=r.getRadiusAxis(),a=r.getAngleAxis(),t=o.getExtent();return t[0]>t[1]&&t.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:t[1],r0:t[0]},api:{coord:v(function(t){var e=o.dataToRadius(t[0]),n=a.dataToAngle(t[1]),i=r.coordToPoint([e,n]);return i.push(e,n*Math.PI/180),i}),size:v(Gm,r)}}},calendar:function(n){var t=n.getRect(),e=n.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return n.dataToPoint(t,e)}}}}};js({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0},getInitialData:function(){return yl(this.getSource(),this)}}),Ws({type:"custom",_data:null,render:function(n,t,e){var i=this._data,r=n.getData(),o=this.group,a=Km(n,r,t,e);this.group.removeAll(),r.diff(i).add(function(t){Jm(null,t,a(t),n,o,r)}).update(function(t,e){Jm(i.getItemGraphicEl(e),t,a(t),n,o,r)}).remove(function(t){var e=i.getItemGraphicEl(t);e&&o.remove(e)}).execute(),this._data=r},incrementalPrepareRender:function(){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,n,i){function r(t){t.isGroup||(t.incremental=!0,t.useHoverLayer=!0)}for(var o=e.getData(),a=Km(e,o,n,i),s=t.start;s<t.end;s++){Jm(null,s,a(s),e,this.group,o).traverse(r)}},dispose:B}),ks(function(t){var e=t.graphic;E(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])});var gO=Bs({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(){var t=this.option.elements;this.option.elements=null,gO.superApply(this,"mergeOption",arguments),this.option.elements=t},optionUpdated:function(t,e){var n=this.option,i=(e?n:t).elements,r=n.elements=e?[]:n.elements,o=[];this._flatten(i,o);var a=Fn(r,o);zn(a);var s=this._elOptionsToUpdate=[];k(a,function(t,e){var n=t.option;Vb&&T(b(n)||t.exist,"Empty graphic option definition"),n&&(s.push(n),uv(t,n),cv(r,e,n),hv(r[e],n))},this);for(var l=r.length-1;0<=l;l--)null==r[l]?r.splice(l,1):delete r[l].$action},_flatten:function(t,n,i){k(t,function(t){if(t){i&&(t.parentOption=i),n.push(t);var e=t.children;"group"===t.type&&e&&this._flatten(e,n,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});Vs({type:"graphic",init:function(){this._elMap=z(),this._lastGraphicModel},render:function(t,e,n){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t,n),this._relocate(t,n)},_updateElements:function(t){var e=t.useElOptionsToUpdate();if(e){var u=this._elMap,c=this.group;k(e,function(t){var e=t.$action,n=t.id,i=u.get(n),r=t.parentId,o=null!=r?u.get(r):c;if("text"===t.type){var a=t.style;t.hv&&t.hv[1]&&(a.textVerticalAlign=a.textBaseline=null),!a.hasOwnProperty("textFill")&&a.fill&&(a.textFill=a.fill),!a.hasOwnProperty("textStroke")&&a.stroke&&(a.textStroke=a.stroke)}var s=sv(t);Vb&&i&&T(o===i.parent,"Changing parent is not supported."),e&&"merge"!==e?"replace"===e?(av(i,u),ov(n,o,s,u)):"remove"===e&&av(i,u):i?i.attr(s):ov(n,o,s,u);var l=u.get(n);l&&(l.__ecGraphicWidth=t.width,l.__ecGraphicHeight=t.height)})}},_relocate:function(t,e){for(var n=t.option.elements,i=this.group,r=this._elMap,o=n.length-1;0<=o;o--){var a=n[o],s=r.get(a.id);if(s){var l=s.parent;go(s,a,l===i?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0},null,{hv:a.hv,boundingMode:a.bounding})}}},_clear:function(){var e=this._elMap;e.each(function(t){av(t,e)}),this._elMap=z()},dispose:function(){this._clear()}});var mO=Bs({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{}},mergeOption:function(t){mO.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n<t.length;n++){var i=t[n].get("name");if(this.isSelected(i)){this.select(i),e=!0;break}}!e&&this.select(t[0].get("name"))}},_updateData:function(o){var a=[],s=[];o.eachRawSeries(function(t){var e,n=t.name;if(s.push(n),t.legendDataProvider){var i=t.legendDataProvider(),r=i.mapArray(i.getName);o.isSeriesFiltered(t)||(s=s.concat(r)),r.length?a=a.concat(r):e=!0}else e=!0;e&&Hn(t)&&a.push(t.name)}),this._availableNames=s;var t=A(this.get("data")||a,function(t){return"string"!=typeof t&&"number"!=typeof t||(t={name:t}),new Or(t,this,this.ecModel)},this);this._data=t},getData:function(){return this._data},select:function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&k(this._data,function(t){e[t.get("name")]=!1});e[t]=!0},unSelect:function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},toggleSelected:function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},isSelected:function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&0<=x(this._availableNames,t)},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});Os("legendToggleSelect","legendselectchanged",y(dv,"toggleSelected")),Os("legendSelect","legendselected",y(dv,"select")),Os("legendUnSelect","legendunselected",y(dv,"unSelect"));var vO=y,yO=k,xO=Xw,bO=Vs({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new xO),this._backgroundEl},getContentGroup:function(){return this._contentGroup},render:function(t,e,n){if(this.resetInner(),t.get("show",!0)){var i=t.get("align");i&&"auto"!==i||(i="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left"),this.renderInner(i,t,e,n);var r=t.getBoxLayoutParams(),o={width:n.getWidth(),height:n.getHeight()},a=t.get("padding"),s=po(r,o,a),l=this.layoutInner(t,i,s),u=po(D({width:l.width,height:l.height},r),o,a);this.group.attr("position",[u.x-l.x,u.y-l.y]),this.group.add(this._backgroundEl=pv(l,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl)},renderInner:function(l,u,c,h){var d=this.getContentGroup(),f=z(),p=u.get("selectedMode"),g=[];c.eachRawSeries(function(t){!t.get("legendHoverLink")&&g.push(t.id)}),yO(u.getData(),function(o,a){var s=o.get("name");if(this.newlineDisabled||""!==s&&"\n"!==s){var t=c.getSeriesByName(s)[0];if(!f.get(s)){if(t){var e=t.getData(),n=e.getVisual("color");"function"==typeof n&&(n=n(t.getDataParams(0)));var i=e.getVisual("legendSymbol")||"roundRect",r=e.getVisual("symbol");this._createItem(s,a,o,u,i,r,l,n,p).on("click",vO(gv,s,h)).on("mouseover",vO(mv,t,null,h,g)).on("mouseout",vO(vv,t,null,h,g)),f.set(s,!0)}else c.eachRawSeries(function(t){if(!f.get(s)&&t.legendDataProvider){var e=t.legendDataProvider(),n=e.indexOfName(s);if(n<0)return;var i=e.getItemVisual(n,"color"),r="roundRect";this._createItem(s,a,o,u,r,null,l,i,p).on("click",vO(gv,s,h)).on("mouseover",vO(mv,t,s,h,g)).on("mouseout",vO(vv,t,s,h,g)),f.set(s,!0)}},this);Vb&&(f.get(s)||console.warn(s+" series not exists. Legend data should be same with series name or data name."))}}else d.add(new xO({newline:!0}))},this)},_createItem:function(t,e,n,i,r,o,a,s,l){var u=i.get("itemWidth"),c=i.get("itemHeight"),h=i.get("inactiveColor"),d=i.get("symbolKeepAspect"),f=i.isSelected(t),p=new xO,g=n.getModel("textStyle"),m=n.get("icon"),v=n.getModel("tooltip"),y=v.parentModel;if(r=m||r,p.add(Ql(r,0,0,u,c,f?s:h,null==d||d)),!m&&o&&(o!==r||"none"==o)){var x=.8*c;"none"===o&&(o="circle"),p.add(Ql(o,(u-x)/2,(c-x)/2,x,x,f?s:h,null==d||d))}var b="left"===a?u+5:-5,w=a,_=i.get("formatter"),S=t;"string"==typeof _&&_?S=_.replace("{name}",null!=t?t:""):"function"==typeof _&&(S=_(t)),p.add(new lC({style:pr({},g,{text:S,x:b,y:c/2,textFill:f?g.getTextColor():h,textAlign:w,textVerticalAlign:"middle"})}));var C=new yC({shape:p.getBoundingRect(),invisible:!0,tooltip:v.get("show")?O({content:t,formatter:y.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:i.componentIndex,name:t,$vars:["name"]}},v.option):null});return p.add(C),p.eachChild(function(t){t.silent=!0}),C.silent=!l,this.getContentGroup().add(p),dr(p),p.__legendDataIndex=e,p},layoutInner:function(t,e,n){var i=this.getContentGroup();nT(t.get("orient"),i,t.get("itemGap"),n.width,n.height);var r=i.getBoundingRect();return i.attr("position",[-r.x,-r.y]),this.group.getBoundingRect()}});Es(function(t){var n=t.findComponents({mainType:"legend"});n&&n.length&&t.filterSeries(function(t){for(var e=0;e<n.length;e++)if(!n[e].isSelected(t.name))return!1;return!0})}),oT.registerSubTypeDefaulter("legend",function(){return"plain"});var wO=mO.extend({type:"legend.scroll",setScrollDataIndex:function(t){this.option.scrollDataIndex=t},defaultOption:{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(t,e,n,i){var r=yo(t);wO.superCall(this,"init",t,e,n,i),yv(this,t,r)},mergeOption:function(t,e){wO.superCall(this,"mergeOption",t,e),yv(this,this.option,t)},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}}}),_O=Xw,SO=["width","height"],CO=["x","y"],TO=bO.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){TO.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new _O),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new _O),this._showController},resetInner:function(){TO.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(t,r,e,o){function n(t,e){var n=t+"DataIndex",i=Lr(r.get("pageIcons",!0)[r.getOrient().name][e],{onclick:v(a._pageGo,a,n,r,o)},{x:-l[0]/2,y:-l[1]/2,width:l[0],height:l[1]});i.name=t,s.add(i)}var a=this;TO.superCall(this,"renderInner",t,r,e,o);var s=this._controllerGroup,l=r.get("pageIconSize",!0);E(l)||(l=[l,l]),n("pagePrev",0);var i=r.getModel("pageTextStyle");s.add(new lC({name:"pageText",style:{textFill:i.getTextColor(),font:i.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),n("pageNext",1)},layoutInner:function(t,e,n){var i=this.getContentGroup(),r=this._containerGroup,o=this._controllerGroup,a=t.getOrient().index,s=SO[a],l=SO[1-a],u=CO[1-a];nT(t.get("orient"),i,t.get("itemGap"),a?n.width:null,a?null:n.height),nT("horizontal",o,t.get("pageButtonItemGap",!0));var c=i.getBoundingRect(),h=o.getBoundingRect(),d=this._showController=c[s]>n[s],f=[-c.x,-c.y];f[a]=i.position[a];var p=[0,0],g=[-h.x,-h.y],m=R(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[a]+=n[s]-h[s]:p[a]+=h[s]+m);g[1-a]+=c[l]/2-h[l]/2,i.attr("position",f),r.attr("position",p),o.attr("position",g);var v=this.group.getBoundingRect();if((v={x:0,y:0})[s]=d?n[s]:c[s],v[l]=Math.max(c[l],h[l]),v[u]=Math.min(0,h[u]+g[1-a]),r.__rectSize=n[s],d){var y={x:0,y:0};y[s]=Math.max(n[s]-h[s]-m,0),y[l]=v[l],r.setClipPath(new yC({shape:y})),r.__rectSize=y[s]}else o.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Cr(i,{position:x.contentPosition},!!d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},_updatePageInfoView:function(i,r){var o=this._controllerGroup;k(["pagePrev","pageNext"],function(t){var e=null!=r[t+"DataIndex"],n=o.childOfName(t);n&&(n.setStyle("fill",e?i.get("pageIconColor",!0):i.get("pageIconInactiveColor",!0)),n.cursor=e?"pointer":"default")});var t=o.childOfName("pageText"),e=i.get("pageFormatter"),n=r.pageIndex,a=null!=n?n+1:0,s=r.pageCount;t&&e&&t.setStyle("text",w(e)?e.replace("{current}",a).replace("{total}",s):e({current:a,total:s}))},_getPageInfo:function(t){function i(t){var e=t.getBoundingRect().clone();return e[f]+=t.position[c],e}var e,n,r,o,a=t.get("scrollDataIndex",!0),s=this.getContentGroup(),l=s.getBoundingRect(),u=this._containerGroup.__rectSize,c=t.getOrient().index,h=SO[c],d=SO[1-c],f=CO[c],p=s.position.slice();this._showController?s.eachChild(function(t){t.__legendDataIndex===a&&(o=t)}):o=s.childAt(0);var g=u?Math.ceil(l[h]/u):0;if(o){var m=o.getBoundingRect(),v=o.position[c]+m[f];p[c]=-v-l[f],e=Math.floor(g*(v+m[f]+u/2)/l[h]),e=l[h]&&g?Math.max(0,Math.min(g-1,e)):-1;var y,x={x:0,y:0};x[h]=u,x[d]=l[d],x[f]=-p[c]-l[f];var b=s.children();if(s.eachChild(function(t,e){var n=i(t);n.intersect(x)&&(null==y&&(y=e),r=t.__legendDataIndex),e===b.length-1&&n[f]+n[h]<=x[f]+x[h]&&(r=null)}),null!=y){var w=i(b[y]);if(x[f]=w[f]+w[h]-x[h],y<=0&&w[f]>=x[f])n=null;else{for(;0<y&&i(b[y-1]).intersect(x);)y--;n=b[y].__legendDataIndex}}}return{contentPosition:p,pageIndex:e,pageCount:g,pagePrevDataIndex:n,pageNextDataIndex:r}}});Os("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})}),Bs({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:8,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var AO=k,DO=io,MO=["","-webkit-","-moz-","-o-"],IO="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";_v.prototype={constructor:_v,_enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),n=t.style;"absolute"!==n.position&&"absolute"!==e.position&&(n.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText=IO+wv(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",this._show=!0},setContent:function(t){this.el.innerHTML=null==t?"":t},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el;return[t.clientWidth,t.clientHeight]},moveTo:function(t,e){var n,i=this._zr;i&&i.painter&&(n=i.painter.getViewportRootOffset())&&(t+=n.offsetLeft,e+=n.offsetTop);var r=this.el.style;r.left=t+"px",r.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(v(this.hide,this),t)):this.hide())},isShow:function(){return this._show}};var kO=v,EO=k,LO=Vr,OO=new yC({shape:{x:-1,y:-1,width:2,height:2}});Vs({type:"tooltip",init:function(t,e){if(!Ub.node){var n=new _v(e.getDom(),e);this._tooltipContent=n}},render:function(t,e,n){if(!Ub.node&&!Ub.wxa){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var i=this._tooltipContent;i.update(),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var i=this._tooltipModel.get("triggerOn");lm("itemTooltip",this._api,kO(function(t,e,n){"none"!==i&&(0<=i.indexOf(t)?this._tryShow(e,n):"leave"===t&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){i.manuallyShowTip(t,e,n,{x:i._lastX,y:i._lastY})})}},manuallyShowTip:function(t,e,n,i){if(i.from!==this.uid&&!Ub.node){var r=Cv(i,n);this._ticket="";var o=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var a=OO;a.position=[i.x,i.y],a.update(),a.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:a},r)}else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,event:{},dataByCoordSys:i.dataByCoordSys,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var s=PL(i,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:i.position,target:s.el,event:{}},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target,event:{}},r))}},manuallyHideTip:function(t,e,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,i.from!==this.uid&&this._hide(Cv(i,n))},_manuallyAxisShowTip:function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s)if("axis"===(t=Sv([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},_tryShow:function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;i&&i.length?this._showAxisTooltip(i,t):n&&null!=n.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,n,e)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,n,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var n=t.get("showDelay");e=v(e,this),clearTimeout(this._showTimout),0<n?this._showTimout=setTimeout(e,n):e()},_showAxisTooltip:function(t,e){var u=this._ecModel,n=this._tooltipModel,i=[e.offsetX,e.offsetY],c=[],h=[],r=Sv([e.tooltipOption,n]);EO(t,function(t){EO(t.dataByAxis,function(r){var o=u.getComponent(r.axisDim+"Axis",r.axisIndex),a=r.value,s=[];if(o&&null!=a){var l=Cm(a,o.axis,u,r.seriesDataIndices,r.valueLabelOpt);k(r.seriesDataIndices,function(t){var e=u.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,i=e&&e.getDataParams(n);i.axisDim=r.axisDim,i.axisIndex=r.axisIndex,i.axisType=r.axisType,i.axisId=r.axisId,i.axisValue=Yl(o.axis,a),i.axisValueLabel=l,i&&(h.push(i),s.push(e.formatTooltip(n,!0)))});var t=l;c.push((t?ro(t)+"<br />":"")+s.join("<br />"))}})},this),c.reverse(),c=c.join("<br /><br />");var o=e.position;this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(r,o,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(r,c,h,Math.random(),i[0],i[1],o)})},_showSeriesItemTooltip:function(t,e,n){var i=this._ecModel,r=e.seriesIndex,o=i.getSeriesByIndex(r),a=e.dataModel||o,s=e.dataIndex,l=e.dataType,u=a.getData(),c=Sv([u.getItemModel(s),a,o&&(o.coordinateSystem||{}).model,this._tooltipModel]),h=c.get("trigger");if(null==h||"item"===h){var d=a.getDataParams(s,l),f=a.formatTooltip(s,!1,l),p="item_"+a.name+"_"+s;this._showOrMove(c,function(){this._showTooltipContent(c,f,d,p,t.offsetX,t.offsetY,t.position,t.target)}),n({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:r,from:this.uid})}},_showComponentItemTooltip:function(t,e,n){var i=e.tooltip;if("string"==typeof i){i={content:i,formatter:i}}var r=new Or(i,this._tooltipModel,this._ecModel),o=r.get("content"),a=Math.random();this._showOrMove(r,function(){this._showTooltipContent(r,o,r.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e)}),n({type:"showTip",from:this.uid})},_showTooltipContent:function(n,t,i,e,r,o,a,s){if(this._ticket="",n.get("showContent")&&n.get("show")){var l=this._tooltipContent,u=n.get("formatter");a=a||n.get("position");var c=t;if(u&&"string"==typeof u)c=oo(u,i,!0);else if("function"==typeof u){var h=kO(function(t,e){t===this._ticket&&(l.setContent(e),this._updatePosition(n,a,r,o,l,i,s))},this);this._ticket=e,c=u(i,e,h)}l.setContent(c),l.show(n),this._updatePosition(n,a,r,o,l,i,s)}},_updatePosition:function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),c=t.get("align"),h=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),"function"==typeof e&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),E(e))n=LO(e[0],s),i=LO(e[1],l);else if(b(e)){e.width=u[0],e.height=u[1];var f=po(e,{width:s,height:l});n=f.x,i=f.y,h=c=null}else if("string"==typeof e&&a){n=(p=Mv(e,d,u))[0],i=p[1]}else{var p;n=(p=Tv(n,i,r.el,s,l,c?null:20,h?null:20))[0],i=p[1]}(c&&(n-=Iv(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=Iv(h)?u[1]/2:"bottom"===h?u[1]:0),t.get("confine"))&&(n=(p=Av(n,i,r.el,s,l))[0],i=p[1]);r.moveTo(n,i)},_updateContentNotChangedOnAxis:function(i){var t=this._lastDataByCoordSys,a=!!t&&t.length===i.length;return a&&EO(t,function(t,e){var n=t.dataByAxis||{},o=(i[e]||{}).dataByAxis||[];(a&=n.length===o.length)&&EO(n,function(t,e){var n=o[e]||{},i=t.seriesDataIndices||[],r=n.seriesDataIndices||[];(a&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&i.length===r.length)&&EO(i,function(t,e){var n=r[e];a&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=i,!!a},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){Ub.node||Ub.wxa||(this._tooltipContent.hide(),pm("itemTooltip",e))}}),Os({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),Os({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){}),Pv.prototype={constructor:Pv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:rM.prototype.dataToCoord,radiusToData:rM.prototype.coordToData},o(Pv,rM),Nv.prototype={constructor:Nv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:rM.prototype.dataToCoord,angleToData:rM.prototype.coordToData},o(Nv,rM);var PO=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new Pv,this._angleAxis=new Nv,this._radiusAxis.polar=this._angleAxis.polar=this};PO.prototype={type:"polar",axisPointerEnabled:!0,constructor:PO,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t)
|
|
;return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);i.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,u=l<o?1:-1;l<o||a<l;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],n=t[1]/180*Math.PI;return[Math.cos(n)*e+this.cx,-Math.sin(n)*e+this.cy]}};var NO=oT.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});g(NO.prototype,UD);var RO={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};PM("angle",NO,Rv,RO.angle),PM("radius",NO,Rv,RO.radius),Bs({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var FO={dimensions:PO.prototype.dimensions,create:function(n,s){var l=[];return n.eachComponent("polar",function(t,e){var n=new PO(e);n.update=zv;var i=n.getRadiusAxis(),r=n.getAngleAxis(),o=t.findAxisModel("radiusAxis"),a=t.findAxisModel("angleAxis");Hv(i,o),Hv(r,a),Fv(n,t,s),l.push(n),(t.coordinateSystem=n).model=t}),n.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];if(Vb&&!e)throw new Error('Polar "'+N(t.get("polarIndex"),t.get("polarId"),0)+'" not found');t.coordinateSystem=e.coordinateSystem}}),l}};qo.register("polar",FO);var zO=["axisLine","axisLabel","axisTick","splitLine","splitArea"];$M.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=A(n.getViewLabels(),function(t){return(t=L(t)).coord=n.dataToCoord(t.tickValue),t});jv(a),jv(o),k(zO,function(t){!e.get(t+".show")||n.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,i,o,r,a)},this)}},_axisLine:function(t,e,n,i){var r=t.getModel("axisLine.lineStyle"),o=new uC({shape:{cx:e.cx,cy:e.cy,r:i[Vv(e)]},style:r.getLineStyle(),z2:1,silent:!0});o.style.fill=null,this.group.add(o)},_axisTick:function(t,e,n,i){var r=t.getModel("axisTick"),o=(r.get("inside")?-1:1)*r.get("length"),a=i[Vv(e)],s=A(n,function(t){return new xC({shape:Bv(e,[a,a+o],t.coord)})});this.group.add(LC(s,{style:D(r.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(c,h,t,d,e){var f=c.getCategories(!0),p=c.getModel("axisLabel"),g=p.get("margin");k(e,function(t){var e=p,n=t.tickValue,i=d[Vv(h)],r=h.coordToPoint([i+g,t.coord]),o=h.cx,a=h.cy,s=Math.abs(r[0]-o)/i<.3?"center":r[0]>o?"left":"right",l=Math.abs(r[1]-a)/i<.3?"middle":r[1]>a?"top":"bottom";f&&f[n]&&f[n].textStyle&&(e=new Or(f[n].textStyle,p,p.ecModel));var u=new lC({silent:!0});this.group.add(u),pr(u.style,e,{x:r[0],y:r[1],textFill:e.getTextColor()||c.get("axisLine.lineStyle.color"),text:t.formattedLabel,textAlign:s,textVerticalAlign:l})},this)},_splitLine:function(t,e,n,i){var r=t.getModel("splitLine").getModel("lineStyle"),o=r.get("color"),a=0;o=o instanceof Array?o:[o];for(var s=[],l=0;l<n.length;l++){var u=a++%o.length;s[u]=s[u]||[],s[u].push(new xC({shape:Bv(e,i,n[l].coord)}))}for(l=0;l<s.length;l++)this.group.add(LC(s[l],{style:D({stroke:o[l%o.length]},r.getLineStyle()),silent:!0,z:t.get("z")}))},_splitArea:function(t,e,n,i){if(n.length){var r=t.getModel("splitArea").getModel("areaStyle"),o=r.get("color"),a=0;o=o instanceof Array?o:[o];for(var s=[],l=Math.PI/180,u=-n[0].coord*l,c=Math.min(i[0],i[1]),h=Math.max(i[0],i[1]),d=t.get("clockwise"),f=1;f<n.length;f++){var p=a++%o.length;s[p]=s[p]||[],s[p].push(new dC({shape:{cx:e.cx,cy:e.cy,r0:c,r:h,startAngle:u,endAngle:-n[f].coord*l,clockwise:d},silent:!0})),u=-n[f].coord*l}for(f=0;f<s.length;f++)this.group.add(LC(s[f],{style:D({fill:o[f%o.length]},r.getAreaStyle()),silent:!0}))}}});var HO=["axisLine","axisTickLabel","axisName"],BO=["splitLine","splitArea"];$M.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e){if(this.group.removeAll(),e.get("show")){var n=e.axis,i=n.polar,t=i.getAngleAxis(),r=n.getTicksCoords(),o=t.getExtent()[0],a=n.getExtent(),s=Wv(i,e,o),l=new BM(e,s);k(HO,l.add,l),this.group.add(l.getGroup()),k(BO,function(t){e.get(t+".show")&&!n.scale.isBlank()&&this["_"+t](e,i,o,a,r)},this)}},_splitLine:function(t,e,n,i,r){var o=t.getModel("splitLine").getModel("lineStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=0;u<r.length;u++){var c=s++%a.length;l[c]=l[c]||[],l[c].push(new uC({shape:{cx:e.cx,cy:e.cy,r:r[u].coord},silent:!0}))}for(u=0;u<l.length;u++)this.group.add(LC(l[u],{style:D({stroke:a[u%a.length],fill:null},o.getLineStyle()),silent:!0}))},_splitArea:function(t,e,n,i,r){if(r.length){var o=t.getModel("splitArea").getModel("areaStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=r[0].coord,c=1;c<r.length;c++){var h=s++%a.length;l[h]=l[h]||[],l[h].push(new dC({shape:{cx:e.cx,cy:e.cy,r0:u,r:r[c].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=r[c].coord}for(c=0;c<l.length;c++)this.group.add(LC(l[c],{style:D({fill:a[c%a.length]},o.getAreaStyle()),silent:!0}))}}});var VO=gm.extend({makeElOption:function(t,e,n,i,r){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a,s=o.polar,l=s.getOtherAxis(o).getExtent();a=o["dataTo"+co(o.dim)](e);var u=i.get("type");if(u&&"none"!==u){var c=wm(i),h=jO[u](o,s,a,l,c);h.style=c,t.graphicKey=h.type,t.pointer=h}_m(t,n,i,r,Uv(e,n,i,s,i.get("label.margin")))}}),jO={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:Dm(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:Im(e.cx,e.cy,i[0],i[1],(-n-r/2)*o,(r/2-n)*o)}:{type:"Sector",shape:Im(e.cx,e.cy,n-r/2,n+r/2,0,2*Math.PI)}}};$M.registerAxisPointerClass("PolarAxisPointer",VO),Rs(y(Lv,"bar")),Vs({type:"polar"}),r(oT.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(t){oT.prototype.init.apply(this,arguments),Pn(t,"label",["show"])},optionUpdated:function(){var t=this.option,n=this;t.regions=LI.getFilledRegions(t.regions,t.map,t.nameMap),this._optionModelMap=p(t.regions||[],function(t,e){return e.name&&t.set(e.name,new Or(e,n)),t},z()),this.updateSelectedMap(t.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:.75,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(t){return this._optionModelMap.get(t)||new Or(null,this,this.ecModel)},getFormattedLabel:function(t,e){var n=this.getRegionModel(t).get("label."+e+".formatter"),i={name:t};return"function"==typeof n?(i.status=e,n(i)):"string"==typeof n?n.replace("{a}",null!=t?t:""):void 0},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t}}),rI),Vs({type:"geo",init:function(t,e){var n=new bh(e,!0);this._mapDraw=n,this.group.add(n.group)},render:function(t,e,n,i){if(!i||"geoToggleSelect"!==i.type||i.from!==this.uid){var r=this._mapDraw;t.get("show")?r.draw(t,e,n,this,i):this._mapDraw.group.removeAll(),this.group.silent=t.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}}),$v("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),$v("select",{type:"geoSelect",event:"geoselected"}),$v("unSelect",{type:"geoUnSelect",event:"geounselected"});var WO=["rect","polygon","keep","clear"],UO=function(t,e){var n=t&&t.brush;if(E(n)||(n=n?[n]:[]),n.length){var i=[];k(n,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(i=i.concat(e))});var r=t&&t.toolbox;E(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),qv(s),e&&!s.length&&s.push.apply(s,WO)}},$O=k,qO={lineX:Qv(0),lineY:Qv(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&iu(n.range,t[0],t[1])},rect:function(t,e,n){var i=n.range;if(!t||i.length<=1)return!1;var r=t.x,o=t.y,a=t.width,s=t.height,l=i[0];return!!(iu(i,r,o)||iu(i,r+a,o)||iu(i,r,o+s)||iu(i,r+a,o+s)||ie.create(t).contain(l[0],l[1])||ty(r,o,r+a,o,i)||ty(r,o,r,o+s,i)||ty(r+a,o,r+a,o+s,i)||ty(r,o+s,r+a,o+s,i))||void 0}}},GO=k,YO=x,ZO=y,XO=["dataToPoint","pointToData"],KO=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],QO=ry.prototype;QO.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=nP[t.brushType](0,n,e);t.__rangeOffset={offset:iP[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})},QO.matchOutputRanges=function(t,i,r){GO(t,function(n){var t=this.findTargetInfo(n,i);t&&!0!==t&&k(t.coordSyses,function(t){var e=nP[n.brushType](1,t,n.range);r(n,e.values,t,i)})},this)},QO.setInputRanges=function(t,r){GO(t,function(t){var e=this.findTargetInfo(t,r);if(Vb&&(T(!e||!0===e||t.coordRange,"coordRange must be specified when coord index specified."),T(!e||!0!==e||t.range,"range must be specified in global brush.")),t.range=t.range||[],e&&!0!==e){t.panelId=e.panelId;var n=nP[t.brushType](0,e.coordSys,t.coordRange),i=t.__rangeOffset;t.range=i?iP[t.brushType](n.values,i.offset,uy(n.xyMinMax,i.xyMinMax)):n.values}},this)},QO.makePanelOpts=function(n,i){return A(this._targetInfoList,function(t){var e=t.getPanelRect();return{panelId:t.panelId,defaultBrushType:i&&i(t),clipPath:pp(e),isTargetByCursor:mp(e,n,t.coordSysModel),getLinearBrushOtherExtent:gp(e)}})},QO.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&0<=YO(i.coordSyses,e.coordinateSystem)},QO.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=ay(e,t),r=0;r<n.length;r++){var o=n[r],a=t.panelId;if(a){if(o.panelId===a)return o}else for(r=0;r<tP.length;r++)if(tP[r](i,o))return o}return!0};var JO={grid:function(t,i){var r=t.xAxisModels,o=t.yAxisModels,e=t.gridModels,n=z(),a={},s={};(r||o||e)&&(GO(r,function(t){var e=t.axis.grid.model;n.set(e.id,e),a[e.id]=!0}),GO(o,function(t){var e=t.axis.grid.model;n.set(e.id,e),s[e.id]=!0}),GO(e,function(t){n.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),n.each(function(t){var e=t.coordinateSystem,n=[];GO(e.getCartesians(),function(t){(0<=YO(r,t.getAxis("x").model)||0<=YO(o,t.getAxis("y").model))&&n.push(t)}),i.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:n[0],coordSyses:n,getPanelRect:eP.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,n){GO(t.geoModels,function(t){var e=t.coordinateSystem;n.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:eP.geo})})}},tP=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],eP={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Ar(t)),e}},nP={lineX:ZO(sy,0),lineY:ZO(sy,1),rect:function(t,e,n){var i=e[XO[t]]([n[0][0],n[1][0]]),r=e[XO[t]]([n[0][1],n[1][1]]),o=[oy([i[0],r[0]]),oy([i[1],r[1]])];return{values:o,xyMinMax:o}},polygon:function(n,i,t){var r=[[Infinity,-Infinity],[Infinity,-Infinity]];return{values:A(t,function(t){var e=i[XO[n]](t);return r[0][0]=Math.min(r[0][0],e[0]),r[1][0]=Math.min(r[1][0],e[1]),r[0][1]=Math.max(r[0][1],e[0]),r[1][1]=Math.max(r[1][1],e[1]),e}),xyMinMax:r}}},iP={lineX:ZO(ly,0),lineY:ZO(ly,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,n,i){return A(t,function(t,e){return[t[0]-i[0]*n[e][0],t[1]-i[1]*n[e][1]]})}},rP=["inBrush","outOfBrush"],oP="__ecBrushSelect",aP="__ecInBrushSelectEvent",sP=OA.VISUAL.BRUSH;Rs(sP,function(e,t,n){e.eachComponent({mainType:"brush"},function(t){n&&"takeGlobalCursor"===n.type&&t.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1}),(t.brushTargetManager=new ry(t.option,e)).setInputRanges(t.areas,e)})}),Fs(sP,function(g,t,e){var m,v,y=[];g.eachComponent({mainType:"brush"},function(o,t){function s(t){return"all"===n||a[t]}function l(t){return!!t.length}function i(t,e){var n=t.coordinateSystem;d|=n.hasAxisBrushed(),s(e)&&n.eachActiveState(t.getData(),function(t,e){"active"===t&&(c[e]=1)})}function r(e,t,n){var i=py(e);if(i&&!gy(o,t)&&(k(f,function(t){i[t.brushType]&&o.brushTargetManager.controlSeries(t,e,g)&&n.push(t),d|=l(n)}),s(t)&&l(n))){var r=e.getData();r.each(function(t){fy(i,n,r,t)&&(c[t]=1)})}}var u={brushId:o.id,brushIndex:t,brushName:o.name,areas:L(o.areas),selected:[]};y.push(u);var e=o.option,n=e.brushLink,a=[],c=[],h=[],d=0;t||(m=e.throttleType,v=e.throttleDelay);var f=A(o.areas,function(t){return my(D({boundingRect:lP[t.brushType](t)},t))}),p=Yv(o.option,rP,function(t){t.mappingMethod="fixed"});E(n)&&k(n,function(t){a[t]=1}),g.eachSeries(function(t,e){var n=h[e]=[];"parallel"===t.subType?i(t,e,n):r(t,e,n)}),g.eachSeries(function(t,e){var n={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};u.selected.push(n);var i=py(t),r=h[e],o=t.getData(),a=s(e)?function(t){return c[t]?(n.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return fy(i,r,o,t)?(n.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"};(s(e)?d:l(r))&&Xv(rP,p,o,a)})}),hy(t,m,v,y,e)});var lP={lineX:B,lineY:B,rect:function(t){return vy(t.range)},polygon:function(t){for(var e,n=t.range,i=0,r=n.length;i<r;i++){e=e||[[Infinity,-Infinity],[Infinity,-Infinity]];var o=n[i];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&vy(e)}},uP=["#ddd"];Bs({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var n=this.option;!e&&Zv(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:uP},i.hasOwnProperty("liftZ")||(i.liftZ=5)},setAreas:function(t){Vb&&(T(E(t)),k(t,function(t){T(t.brushType,"Illegal areas")})),t&&(this.areas=A(t,function(t){return yy(this.option,t)},this))},setBrushOption:function(t){this.brushOption=yy(this.option,t),this.brushType=this.brushOption.brushType}});Vs({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Of(e.getZr())).on("brush",v(this._onBrush,this)).mount()},render:function(t){return this.model=t,xy.apply(this,arguments)},updateTransform:xy,updateView:xy,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var n=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:L(t),$from:n})}}),Os({type:"brush",event:"brush"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),Os({type:"brushSelect",event:"brushSelected",update:"none"},function(){});var cP={},hP=rA.toolbox.brush;_y.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:L(hP.title)};var dP=_y.prototype;dP.render=dP.updateView=function(e,t){var n,i,r;t.eachComponent({mainType:"brush"},function(t){n=t.brushType,i=t.brushOption.brushMode||"single",r|=t.areas.length}),this._brushType=n,this._brushMode=i,k(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===i:"clear"===t?r:t===n)?"emphasis":"normal")})},dP.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return k(t.get("type",!0),function(t){e[t]&&(n[t]=e[t])}),n},dP.onclick=function(t,e,n){var i=this._brushType,r=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},by("brush",_y),ks(UO);var fP=864e5;Sy.prototype={constructor:Sy,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=Xr(t)).getFullYear(),n=t.getMonth()+1;n=n<10?"0"+n:n;var i=t.getDate();i=i<10?"0"+i:i;var r=t.getDay();return{y:e,m:n,d:i,day:r=Math.abs((r+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+n+"-"+i,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},update:function(t,e){function n(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,r=["width","height"],o=this._model.get("cellSize").slice(),a=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[i,7]:[7,i];k([0,1],function(t){n(o,t)&&(a[r[t]]=o[t]*s[t])});var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=po(a,l);k([0,1],function(t){n(o,t)||(o[t]=u[r[t]]/s[t])}),this._sw=o[0],this._sh=o[1]},dataToPoint:function(t,e){E(t)&&(t=t[0]),null==e&&(e=!0);var n=this.getDateInfo(t),i=this._rangeInfo,r=n.formatedDate;if(e&&!(n.time>=i.start.time&&n.time<i.end.time+fP))return[NaN,NaN];var o=n.day,a=this._getRangeInfo([i.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]:[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},pointToData:function(t){var e=this.pointToDate(t);return e&&e.time},dataToRect:function(t,e){var n=this.dataToPoint(t,e);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},pointToDate:function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,n=Math.floor((t[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,e-1,i):this._getDateByWeeksAndDay(e,n-1,i)},convertToPixel:y(Cy,"dataToPoint"),convertFromPixel:y(Cy,"pointToData"),_initRangeOption:function(){var t=this._model.get("range"),e=t;if(E(e)&&1===e.length&&(e=e[0]),/^\d{4}$/.test(e)&&(t=[e+"-01-01",e+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(e)){var n=this.getDateInfo(e),i=n.date;i.setMonth(i.getMonth()+1);var r=this.getNextNDay(i,-1);t=[n.formatedDate,r.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e)&&(t=[e,e]);var o=this._getRangeInfo(t);return o.start.time>o.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var n=Math.floor(t[1].time/fP)-Math.floor(t[0].time/fP)+1,i=new Date(t[0].time),r=i.getDate(),o=t[1].date.getDate();if(i.setDate(r+n-1),i.getDate()!==o)for(var a=0<i.getTime()-t[1].time?1:-1;i.getDate()!==o&&0<(i.getTime()-t[1].time)*a;)n-=a,i.setDate(r+n-1);var s=Math.floor((n+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:n,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&e<i.fweek||t===i.weeks&&e>i.lweek)return!1;var r=7*(t-1)-i.fweek+e,o=new Date(i.start.time);return o.setDate(i.start.d+r),this.getDateInfo(o)}},Sy.dimensions=Sy.prototype.dimensions,Sy.getDimensionsInfo=Sy.prototype.getDimensionsInfo,Sy.create=function(n,i){var r=[];return n.eachComponent("calendar",function(t){var e=new Sy(t,n,i);r.push(e),t.coordinateSystem=e}),n.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=r[t.get("calendarIndex")||0])}),r},qo.register("calendar",Sy);var pP=oT.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t){var e=yo(t);pP.superApply(this,"init",arguments),Ty(t,e)},mergeOption:function(t){pP.superApply(this,"mergeOption",arguments),Ty(this.option,t)}}),gP={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"]},mP={EN:["S","M","T","W","T","F","S"],CN:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]};Vs({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t){var e=this.group;e.removeAll();var n=t.coordinateSystem,i=n.getRangeInfo(),r=n.getOrient();this._renderDayRect(t,i,e),this._renderLines(t,i,r,e),this._renderYearText(t,i,r,e),this._renderMonthText(t,r,e),this._renderWeekText(t,i,r,e)},_renderDayRect:function(t,e,n){for(var i=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new yC({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:r});n.add(u)}},_renderLines:function(n,t,i,r){function e(t){o._firstDayOfMonth.push(a.getDateInfo(t)),o._firstDayPoints.push(a.dataToRect([t],!1).tl);var e=o._getLinePointsOfOneWeek(n,t,i);o._tlpoints.push(e[0]),o._blpoints.push(e[e.length-1]),l&&o._drawSplitline(e,s,r)}var o=this,a=n.coordinateSystem,s=n.getModel("splitLine.lineStyle").getLineStyle(),l=n.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=t.start,h=0;c.time<=t.end.time;h++){e(c.formatedDate),0===h&&(c=a.getDateInfo(t.start.y+"-"+t.start.m));var d=c.date;d.setMonth(d.getMonth()+1),c=a.getDateInfo(d)}e(a.getNextNDay(t.end.time,1).formatedDate),l&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,u,i),s,r),l&&this._drawSplitline(o._getEdgesPoints(o._blpoints,u,i),s,r)},_getEdgesPoints:function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-e/2,i[1][r]=i[1][r]+e/2,i},_drawSplitline:function(t,e,n){var i=new vC({z2:20,shape:{points:t},style:e});n.add(i)},_getLinePointsOfOneWeek:function(t,e,n){var i=t.coordinateSystem;e=i.getDateInfo(e);for(var r=[],o=0;o<7;o++){var a=i.getNextNDay(e.time,o),s=i.dataToRect([a.time],!1);r[2*a.day]=s.tl,r[2*a.day+1]=s["horizontal"===n?"bl":"tr"]}return r},_formatterLabel:function(t,e){return"string"==typeof t&&t?ao(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,n,i,r){e=e.slice();var o=["center","bottom"];"bottom"===i?(e[1]+=r,o=["center","top"]):"left"===i?e[0]-=r:"right"===i?(e[0]+=r,o=["center","top"]):e[1]-=r;var a=0;return"left"!==i&&"right"!==i||(a=Math.PI/2),{rotation:a,position:e,style:{textAlign:o[0],textVerticalAlign:o[1]}}},_renderYearText:function(t,e,n,i){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),a=r.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=r.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new lC({z2:30});pr(m.style,r,{text:g}),m.attr(this._yearTextPositionControl(m,h[a],n,a,o)),i.add(m)}},_monthTextPositionControl:function(t,e,n,i,r){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=r,e&&(o="center"),"start"===i&&(a="bottom")):(s+=r,e&&(a="middle"),"start"===i&&(o="right")),{x:s,y:l,textAlign:o,textVerticalAlign:a}},_renderMonthText:function(t,e,n){var i=t.getModel("monthLabel");if(i.get("show")){var r=i.get("nameMap"),o=i.get("margin"),a=i.get("position"),s=i.get("align"),l=[this._tlpoints,this._blpoints];w(r)&&(r=gP[r.toUpperCase()]||[]);var u="start"===a?0:1,c="horizontal"===e?0:1;o="start"===a?-o:o;for(var h="center"===s,d=0;d<l[u].length-1;d++){var f=l[u][d].slice(),p=this._firstDayOfMonth[d];if(h){var g=this._firstDayPoints[d];f[c]=(g[c]+l[0][d+1][c])/2}var m=i.get("formatter"),v=r[+p.m-1],y={yyyy:p.y,yy:(p.y+"").slice(2),MM:p.m,M:+p.m,nameMap:v},x=this._formatterLabel(m,y),b=new lC({z2:30});O(pr(b.style,i,{text:x}),this._monthTextPositionControl(f,h,e,a,o)),n.add(b)}}},_weekTextPositionControl:function(t,e,n,i,r){var o="center",a="middle",s=t[0],l=t[1],u="start"===n;return"horizontal"===e?(s=s+i+(u?1:-1)*r[0]/2,o=u?"right":"left"):(l=l+i+(u?1:-1)*r[1]/2,a=u?"bottom":"top"),{x:s,y:l,textAlign:o,textVerticalAlign:a}},_renderWeekText:function(t,e,n,i){var r=t.getModel("dayLabel");if(r.get("show")){var o=t.coordinateSystem,a=r.get("position"),s=r.get("nameMap"),l=r.get("margin"),u=o.getFirstDayOfWeek();w(s)&&(s=mP[s.toUpperCase()]||[]);var c=o.getNextNDay(e.end.time,7-e.lweek).time,h=[o.getCellWidth(),o.getCellHeight()];l=Vr(l,h["horizontal"===n?0:1]),"start"===a&&(c=o.getNextNDay(e.start.time,-(7+e.fweek)).time,l=-l);for(var d=0;d<7;d++){var f=o.getNextNDay(c,d),p=o.dataToRect([f.time],!1).center,g=d;g=Math.abs((d+u)%7);var m=new lC({z2:30});O(pr(m.style,r,{text:s[g]}),this._weekTextPositionControl(p,n,a,l,h)),i.add(m)}}}}),Bs({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),Vs({type:"title",render:function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=t.get("textBaseline"),l=new lC({style:pr({},r,{text:t.get("text"),textFill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=t.get("subtext"),h=new lC({style:pr({},o,{text:c,textFill:o.getTextColor(),y:u.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink");l.silent=!d,h.silent=!f,d&&l.on("click",function(){window.open(d,"_"+t.get("target"))}),f&&h.on("click",function(){window.open(f,"_"+t.get("subtarget"))}),i.add(l),c&&i.add(h);var p=i.getBoundingRect(),g=t.getBoxLayoutParams();g.width=p.width,g.height=p.height;var m=po(g,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?m.x+=m.width:"center"===a&&(m.x+=m.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?m.y+=m.height:"middle"===s&&(m.y+=m.height/2),s=s||"top"),i.attr("position",[m.x,m.y]);var v={textAlign:a,textVerticalAlign:s};l.setStyle(v),h.setStyle(v),p=i.getBoundingRect();var y=m.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new yC({shape:{x:p.x-y[3],y:p.y-y[0],width:p.width+y[1]+y[3],height:p.height+y[0]+y[2],r:t.get("borderRadius")},style:x,silent:!0});Qi(b),i.add(b)}}}),oT.registerSubTypeDefaulter("dataZoom",function(){return"slider"});var vP=["cartesian2d","polar","singleAxis"],yP=Dy(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]),xP=k,bP=Wr,wP=function(t,e,n,i){this._dimName=t,this._axisIndex=e,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=i,this._dataZoomModel=n};wP.prototype={constructor:wP,hostedBy:function(t){return this._dataZoomModel===t},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var i=[],r=this.ecModel;return r.eachSeries(function(t){if(Ay(t.get("coordinateSystem"))){var e=this._dimName,n=r.queryComponents({mainType:e+"Axis",index:t.get(e+"AxisIndex"),id:t.get(e+"AxisId")})[0];this._axisIndex===(n&&n.componentIndex)&&i.push(t)}},this),i},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var t,e,n,i=this._dimName,r=this.ecModel,o=this.getAxisModel();return"x"===i||"y"===i?(e="gridIndex",t="x"===i?"y":"x"):(e="polarIndex",t="angle"===i?"radius":"angle"),r.eachComponent(t+"Axis",function(t){(t.get(e)||0)===(o.get(e)||0)&&(n=t)}),n},
|
|
getMinMaxSpan:function(){return L(this._minMaxSpan)},calculateDataWindow:function(e){var i=this._dataExtent,r=this.getAxisModel().axis.scale,o=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[e.start,e.end],l=[];return xP(["startValue","endValue"],function(t){l.push(null!=e[t]?r.parse(e[t]):null)}),xP([0,1],function(t){var e=l[t],n=s[t];"percent"===o[t]?(null==n&&(n=a[t]),e=r.parse(Br(n,a,i,!0))):n=Br(e,i,a,!0),l[t]=e,s[t]=n}),{valueWindow:bP(l),percentWindow:bP(s)}},reset:function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=Iy(this,this._dimName,e);var n=this.calculateDataWindow(t.option);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,Ly(this),Ey(this)}},restore:function(t){t===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,Ey(this,!0))},filterData:function(t){function i(t){return t>=h[0]&&t<=h[1]}if(t===this._dataZoomModel){var e=this._dimName,n=this.getTargetSeriesModels(),r=t.get("filterMode"),h=this._valueWindow;"none"!==r&&xP(n,function(n){var u=n.getData(),c=u.mapDimension(e,!0);"weakFilter"===r?u.filterSelf(function(t){for(var e,n,i,r=0;r<c.length;r++){var o=u.get(c[r],t),a=!isNaN(o),s=o<h[0],l=o>h[1];if(a&&!s&&!l)return!0;a&&(i=!0),s&&(e=!0),l&&(n=!0)}return i&&e&&n}):xP(c,function(t){if("empty"===r)n.setData(u.map(t,function(t){return i(t)?t:NaN}));else{var e={};e[t]=h,u.selectRange(e)}}),xP(c,function(t){u.setApproximateExtent(h,t)})})}}};var _P=k,SP=yP,CP=Bs({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,n){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var i=Oy(t);this.mergeDefaultAndTheme(t,n),this.doInit(i)},mergeOption:function(t){var e=Oy(t);g(this.option,t,!0),this.doInit(e)},doInit:function(t){var n=this.option;Ub.canvasSupported||(n.realtime=!1),this._setDefaultThrottle(t),Py(this,t),_P([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(n[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var a=this._axisProxies;this.eachTargetAxis(function(t,e,n,i){var r=this.dependentModels[t.axis][e],o=r.__dzAxisProxy||(r.__dzAxisProxy=new wP(t.name,e,this,i));a[t.name+"_"+e]=o},this)},_resetTarget:function(){var n=this.option,t=this._judgeAutoMode();SP(function(t){var e=t.axisIndex;n[e]=On(n[e])},this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,n=!1;SP(function(t){null!=e[t.axisIndex]&&(n=!0)},this);var t=e.orient;return null==t&&n?"orient":n?void 0:(null==t&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var o=!0,e=this.get("orient",!0),a=this.option,t=this.dependentModels;if(o){var n="vertical"===e?"y":"x";t[n+"Axis"].length?(a[n+"AxisIndex"]=[0],o=!1):_P(t.singleAxis,function(t){o&&t.get("orient",!0)===e&&(a.singleAxisIndex=[t.componentIndex],o=!1)})}o&&SP(function(t){if(o){var e=[],n=this.dependentModels[t.axis];if(n.length&&!e.length)for(var i=0,r=n.length;i<r;i++)"category"===n[i].get("type")&&e.push(i);(a[t.axisIndex]=e).length&&(o=!1)}},this),o&&this.ecModel.eachSeries(function(o){this._isSeriesHasAllAxesTypeOf(o,"value")&&SP(function(t){var e=a[t.axisIndex],n=o.get(t.axisIndex),i=o.get(t.axisId),r=o.ecModel.queryComponents({mainType:t.axis,index:n,id:i})[0];if(Vb&&!r)throw new Error(t.axis+' "'+N(n,i,0)+'" not found');x(e,n=r.componentIndex)<0&&e.push(n)})},this)},_autoSetOrient:function(){var e;this.eachTargetAxis(function(t){!e&&(e=t.name)},this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(i,r){var o=!0;return SP(function(t){var e=i.get(t.axisIndex),n=this.dependentModels[t.axis][e];n&&n.get("type")===r||(o=!1)},this),o},_setDefaultThrottle:function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&0<e.animationDurationUpdate?100:20}},getFirstTargetAxisModel:function(){var n;return SP(function(t){if(null==n){var e=this.get(t.axisIndex);e.length&&(n=this.dependentModels[t.axis][e[0]])}},this),n},eachTargetAxis:function(n,i){var r=this.ecModel;SP(function(e){_P(this.get(e.axisIndex),function(t){n.call(i,e,t,this,r)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var n=this.getAxisProxy(t,e);return n&&n.getAxisModel()},setRawRange:function(e,t){var n=this.option;_P([["start","startValue"],["end","endValue"]],function(t){null==e[t[0]]&&null==e[t[1]]||(n[t[0]]=e[t[0]],n[t[1]]=e[t[1]])},this),!t&&Py(this,e)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var n in e)if(e.hasOwnProperty(n)&&e[n].hostedBy(this))return e[n];for(var n in e)if(e.hasOwnProperty(n)&&!e[n].hostedBy(this))return e[n]},getRangePropMode:function(){return this._rangePropMode.slice()}}),TP=GT.extend({type:"dataZoom",render:function(t,e,n){this.dataZoomModel=t,this.ecModel=e,this.api=n},getTargetCoordInfo:function(){function r(t,e,n,i){for(var r,o=0;o<n.length;o++)if(n[o].model===t){r=n[o];break}r||n.push(r={model:t,axisModels:[],coordIndex:i}),r.axisModels.push(e)}var t=this.dataZoomModel,o=this.ecModel,a={};return t.eachTargetAxis(function(t,e){var n=o.getComponent(t.axis,e);if(n){var i=n.getCoordSysModel();i&&r(i,n,a[i.mainType]||(a[i.mainType]=[]),i.componentIndex)}},this),a}}),AP=(CP.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}}),yC),DP=Br,MP=Wr,IP=v,kP=k,EP=7,LP=1,OP=30,PP="horizontal",NP="vertical",RP=5,FP=["line","bar","candlestick","scatter"],zP=TP.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,n,i){zP.superApply(this,"render",arguments),za(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){zP.superApply(this,"remove",arguments),Ha(this,"_dispatchZoomAction")},dispose:function(){zP.superApply(this,"dispose",arguments),Ha(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Xw;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,n=this._findCoordRect(),i={width:e.getWidth(),height:e.getHeight()},r=this._orient===PP?{right:i.width-n.x-n.width,top:i.height-OP-EP,width:n.width,height:OP}:{right:EP,top:n.y,width:OP,height:n.height},o=yo(t.option);k(["right","top","width","height"],function(t){"ph"===o[t]&&(o[t]=r[t])});var a=po(o,i,t.padding);this._location={x:a.x,y:a.y},this._size=[a.width,a.height],this._orient===NP&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.barGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==PP||r?n===PP&&r?{scale:a?[-1,1]:[-1,-1]}:n!==NP||r?{scale:a?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:a?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:a?[1,1]:[1,-1]});var s=t.getBoundingRect([o]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.barGroup;n.add(new AP({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),n.add(new AP({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:v(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,n=t.series,i=n.getRawData(),r=n.getShadowDim?n.getShadowDim():t.otherDim;if(null!=r){var o=i.getDataExtent(r),a=.3*(o[1]-o[0]);o=[o[0]-a,o[1]+a];var s,l=[0,e[1]],u=[0,e[0]],c=[[e[0],0],[0,0]],h=[],d=u[1]/(i.count()-1),f=0,p=Math.round(i.count()/e[0]);i.each([r],function(t,e){if(0<p&&e%p)f+=d;else{var n=null==t||isNaN(t)||""===t,i=n?0:DP(t,o,l,!0);n&&!s&&e?(c.push([c[c.length-1][0],0]),h.push([h[h.length-1][0],0])):!n&&s&&(c.push([f,0]),h.push([f,0])),c.push([f,i]),h.push([f,i]),f+=d,s=n}});var g=this.dataZoomModel;this._displayables.barGroup.add(new mC({shape:{points:c},style:D({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new vC({shape:{points:h},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,s=t.get("showDataShadow");if(!1!==s){var l,u=this.ecModel;return t.eachTargetAxis(function(o,a){k(t.getAxisProxy(o.name,a).getTargetSeriesModels(),function(t){if(!(l||!0!==s&&x(FP,t.get("type"))<0)){var e,n=u.getComponent(o.axis,a).axis,i=Ny(o.name),r=t.coordinateSystem;null!=i&&r.getOtherAxis&&(e=r.getOtherAxis(n).inverse),i=t.getData().mapDimension(i),l={thisAxis:n,series:t,thisDim:o.name,otherDim:i,otherAxisInverse:e}}},this)},this),l}},_renderHandle:function(){var t=this._displayables,o=t.handles=[],a=t.handleLabels=[],s=this._displayables.barGroup,e=this._size,l=this.dataZoomModel;s.add(t.filler=new AP({draggable:!0,cursor:Ry(this._orient),drift:IP(this._onDragMove,this,"all"),onmousemove:function(t){k_(t.event)},ondragstart:IP(this._showDataInfo,this,!0),ondragend:IP(this._onDragEnd,this),onmouseover:IP(this._showDataInfo,this,!0),onmouseout:IP(this._showDataInfo,this,!1),style:{fill:l.get("fillerColor"),textPosition:"inside"}})),s.add(new AP(Qi({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:LP,fill:"rgba(0,0,0,0)"}}))),kP([0,1],function(t){var e=Lr(l.get("handleIcon"),{cursor:Ry(this._orient),draggable:!0,drift:IP(this._onDragMove,this,t),onmousemove:function(t){k_(t.event)},ondragend:IP(this._onDragEnd,this),onmouseover:IP(this._showDataInfo,this,!0),onmouseout:IP(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),n=e.getBoundingRect();this._handleHeight=Vr(l.get("handleSize"),this._size[1]),this._handleWidth=n.width/n.height*this._handleHeight,e.setStyle(l.getModel("handleStyle").getItemStyle());var i=l.get("handleColor");null!=i&&(e.style.fill=i),s.add(o[t]=e);var r=l.textStyleModel;this.group.add(a[t]=new lC({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:r.getTextColor(),textFont:r.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[DP(t[0],[0,100],e,!0),DP(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];uE(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?DP(o.minSpan,a,r,!0):null,null!=o.maxSpan?DP(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=MP([DP(i[0],r,a,!0),DP(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(t){var i=this._displayables,r=this._handleEnds,e=MP(r.slice()),o=this._size;kP([0,1],function(t){var e=i.handles[t],n=this._handleHeight;e.attr({scale:[n/2,n/2],position:[r[t],o[1]/2-n/2]})},this),i.filler.setShape({x:e[0],y:0,width:e[1]-e[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=Ar(o.handles[t].parent,this.group),n=Mr(0===t?"right":"left",e),i=this._handleWidth/2+RP,r=Dr([h[t]+(0===t?-i:i),this._size[1]/2],e);a[t].setStyle({x:r[0],y:r[1],textVerticalAlign:s===PP?"middle":n,textAlign:s===PP?n:"center",text:l[t]})}var n=this.dataZoomModel,o=this._displayables,a=o.handleLabels,s=this._orient,l=["",""];if(n.get("showDetail")){var i=n.findRepresentativeAxisProxy();if(i){var r=i.getAxisModel().axis,u=this._range,c=t?i.calculateDataWindow({start:u[0],end:u[1]}).valueWindow:i.getDataValueWindow();l=[this._formatLabel(c[0],r),this._formatLabel(c[1],r)]}}var h=MP(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var n=this.dataZoomModel,i=n.get("labelFormatter"),r=n.get("labelPrecision");null!=r&&"auto"!==r||(r=e.getPixelPrecision());var o=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(r,20));return m(i)?i(t,o):w(i)?i.replace("{value}",o):o},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,n){this._dragging=!0;var i=Dr([e,n],this._displayables.barGroup.getLocalTransform(),!0),r=this._updateInterval(t,i[0]),o=this.dataZoomModel.get("realtime");this._updateView(!o),r&&o&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,n=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>e[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var n;if(kP(this.getTargetCoordInfo(),function(t){if(!n&&t.length){var e=t[0].model.coordinateSystem;n=e.getRect&&e.getRect()}}),!n){var t=this.api.getWidth(),e=this.api.getHeight();n={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return n}});CP.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}});var HP=y,BP="\0_ec_dataZoom_roams",VP=v,jP=TP.extend({type:"dataZoom.inside",init:function(){this._range},render:function(o,t,a){jP.superApply(this,"render",arguments),this._range=o.getPercentRange(),k(this.getTargetCoordInfo(),function(t,n){var r=A(t,function(t){return Hy(t.model)});k(t,function(t){var i=t.model,e=o.option;Fy(a,{coordId:Hy(i),allCoordIds:r,containsPoint:function(t,e,n){return i.coordinateSystem.containPoint([e,n])},dataZoomId:o.id,throttleRate:o.get("throttle",!0),panGetRange:VP(this._onPan,this,t,n),zoomGetRange:VP(this._onZoom,this,t,n),zoomLock:e.zoomLock,disabled:e.disabled,roamControllerOpt:{zoomOnMouseWheel:e.zoomOnMouseWheel,moveOnMouseMove:e.moveOnMouseMove,preventDefaultMouseMove:e.preventDefaultMouseMove}})},this)},this)},dispose:function(){zy(this.api,this.dataZoomModel.id),jP.superApply(this,"dispose",arguments),this._range=null},_onPan:function(t,e,n,i,r,o,a,s,l){var u=this._range,c=u.slice(),h=t.axisModels[0];if(h){var d=WP[e]([o,a],[s,l],h,n,t),f=d.signal*(c[1]-c[0])*d.pixel/d.pixelLength;return uE(f,c,[0,100],"all"),this._range=c,u[0]!==c[0]||u[1]!==c[1]?c:void 0}},_onZoom:function(t,e,n,i,r,o){var a=this._range,s=a.slice(),l=t.axisModels[0];if(l){var u=WP[e](null,[r,o],l,n,t),c=(0<u.signal?u.pixelStart+u.pixelLength-u.pixel:u.pixel-u.pixelStart)/u.pixelLength*(s[1]-s[0])+s[0];i=Math.max(1/i,0),s[0]=(s[0]-c)*i+c,s[1]=(s[1]-c)*i+c;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return uE(0,s,[0,100],0,h.minSpan,h.maxSpan),this._range=s,a[0]!==s[0]||a[1]!==s[1]?s:void 0}}}),WP={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};Es({getTargetSeries:function(t){var i=z();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,e,n){k(n.getAxisProxy(t.name,e).getTargetSeriesModels(),function(t){i.set(t.uid,t)})})}),i},modifyOutputEnd:!0,overallReset:function(t,i){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,e,n){n.getAxisProxy(t.name,e).reset(n,i)}),t.eachTargetAxis(function(t,e,n){n.getAxisProxy(t.name,e).filterData(n,i)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setRawRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]},!0)})}}),Os("dataZoom",function(e,t){var n=My(v(t.eachComponent,t,"dataZoom"),yP,function(t,e){return t.get(e.axisIndex)}),i=[];t.eachComponent({mainType:"dataZoom",query:e},function(t){i.push.apply(i,n(t).nodes)}),k(i,function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})});var UP=k,$P=function(t){var e=t&&t.visualMap;E(e)||(e=e?[e]:[]),UP(e,function(t){if(t){Yy(t,"splitList")&&!Yy(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&E(e)&&UP(e,function(t){b(t)&&(Yy(t,"start")&&!Yy(t,"min")&&(t.min=t.start),Yy(t,"end")&&!Yy(t,"max")&&(t.max=t.end))})}})};oT.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?0<t.pieces.length:0<t.splitNumber)&&!t.calculable?"piecewise":"continuous"});var qP=OA.VISUAL.COMPONENT;Fs(qP,{createOnAllSeries:!0,reset:function(n,t){var i=[];return t.eachComponent("visualMap",function(t){var e=n.pipelineContext;!t.isTargetSeries(n)||e&&e.large||i.push(Kv(t.stateList,t.targetVisuals,v(t.getValueState,t),t.getDataDimension(n.getData())))}),i}}),Fs(qP,{createOnAllSeries:!0,reset:function(r,t){var o=r.getData(),a=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(r)){var e=t.getVisualMeta(v(Zy,null,r,t))||{stops:[],outerColors:[]},n=t.getDataDimension(o),i=o.getDimensionInfo(n);null!=i&&(e.dimension=i.index,a.push(e))}}),r.getData().setVisual("visualMeta",a)}});var GP={get:function(t,e,n){var i=L((YP[t]||{})[e]);return n&&E(i)?i[i.length-1]:i}},YP={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},ZP=fk.mapVisual,XP=fk.eachVisual,KP=E,QP=k,JP=Wr,tN=Br,eN=Bs({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-Infinity,Infinity],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,n){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,n)},optionUpdated:function(t,e){var n=this.option;Ub.canvasSupported||(n.realtime=!1),!e&&Zv(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=v(t,this),this.controllerVisuals=Yv(this.option.controller,e,t),this.targetVisuals=Yv(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,n=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,e){n.push(e)}):n=On(t),n},eachTargetSeries:function(e,n){k(this.getTargetSeriesIndices(),function(t){e.call(n,this.ecModel.getSeriesByIndex(t))},this)},isTargetSeries:function(e){var n=!1;return this.eachTargetSeries(function(t){t===e&&(n=!0)}),n},formatValueText:function(t,e,n){function i(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}var r,o,a=this.option,s=a.precision,l=this.dataBound,u=a.formatter;return n=n||["<",">"],E(t)&&(t=t.slice(),r=!0),o=e?t:r?[i(t[0]),i(t[1])]:i(t),w(u)?u.replace("{value}",r?o[0]:o).replace("{value2}",r?o[1]:o):m(u)?r?u(t[0],t[1]):u(t):r?t[0]===l[0]?n[0]+" "+o[1]:t[1]===l[1]?n[1]+" "+o[0]:o[0]+" - "+o[1]:o},resetExtent:function(){var t=this.option,e=JP([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,n=t.dimensions;if(null!=e||n.length){if(null!=e)return t.getDimension(e);for(var i=t.dimensions,r=i.length-1;0<=r;r--){var o=i[r];if(!t.getDimensionInfo(o).isCalculationCoord)return o}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(i){KP(o.color)&&!i.inRange&&(i.inRange={color:o.color.slice().reverse()}),i.inRange=i.inRange||{color:r.get("gradientColor")},QP(this.stateList,function(t){var e=i[t];if(w(e)){var n=GP.get(e,"active",u);n?(i[t]={},i[t][e]=n):delete i[t]}},this)}function e(t,e,n){var i=t[e],r=t[n];i&&!r&&(r=t[n]={},QP(i,function(t,e){if(fk.isValidType(e)){var n=GP.get(e,"inactive",u);null!=n&&(r[e]=n,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}}))}function n(o){var a=(o.inRange||{}).symbol||(o.outOfRange||{}).symbol,s=(o.inRange||{}).symbolSize||(o.outOfRange||{}).symbolSize,l=this.get("inactiveColor");QP(this.stateList,function(t){var e=this.itemSize,n=o[t];n||(n=o[t]={color:u?l:[l]}),null==n.symbol&&(n.symbol=a&&L(a)||(u?"roundRect":["roundRect"])),null==n.symbolSize&&(n.symbolSize=s&&L(s)||(u?e[0]:[e[0],e[0]])),n.symbol=ZP(n.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var i=n.symbolSize;if(null!=i){var r=-Infinity;XP(i,function(t){r<t&&(r=t)}),n.symbolSize=ZP(i,function(t){return tN(t,[0,r],[0,e[0]],!0)})}},this)}var r=this.ecModel,o=this.option,i={inRange:o.inRange,outOfRange:o.outOfRange},a=o.target||(o.target={}),s=o.controller||(o.controller={});g(a,i),g(s,i);var u=this.isCategory();t.call(this,a),t.call(this,s),e.call(this,a,"inRange","outOfRange"),n.call(this,s)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:B,getValueState:B,getVisualMeta:B}),nN=[20,140],iN=eN.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(){iN.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){iN.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=nN[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=nN[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):E(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){eN.prototype.completeVisualOption.apply(this,arguments),k(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Wr((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},getValueState:function(t){var e=this.option.range,n=this.getExtent();return(e[0]<=n[0]||e[0]<=t)&&(e[1]>=n[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(i){var r=[];return this.eachTargetSeries(function(t){var n=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){i[0]<=t&&t<=i[1]&&n.push(e)},this),r.push({seriesId:t.id,dataIndex:n})},this),r},getVisualMeta:function(n){function t(t,e){r.push({value:t,color:n(t,e)})}for(var e=Xy(this,"outOfRange",this.getExtent()),i=Xy(this,"inRange",this.option.range.slice()),r=[],o=0,a=0,s=i.length,l=e.length;a<l&&(!i.length||e[a]<=i[0]);a++)e[a]<i[o]&&t(e[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&t(i[o],"outOfRange"),t(i[o],"inRange");for(u=1;a<l;a++)(!i.length||i[i.length-1]<e[a])&&(u&&(r.length&&t(r[r.length-1].value,"outOfRange"),u=0),t(e[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}}}),rN=Vs({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(t,e){this.ecModel=t,this.api=e,this.visualMapModel},render:function(t){!1!==(this.visualMapModel=t).get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(t){var e=this.visualMapModel,n=$C(e.get("padding")||0),i=t.getBoundingRect();t.add(new yC({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},getControllerVisual:function(n,i,r){function o(t){return s[t]}function a(t,e){s[t]=e}var t=(r=r||{}).forceState,e=this.visualMapModel,s={};if("symbol"===i&&(s.symbol=e.get("itemSymbol")),"color"===i){var l=e.get("contentColor");s.color=l}var u=e.controllerVisuals[t||e.getValueState(n)];return k(fk.prepareVisualTypes(u),function(t){var e=u[t];r.convertOpacityToAlpha&&"opacity"===t&&(t="colorAlpha",e=u.__alphaForOpacity),fk.dependsOn(t,i)&&e&&e.applyVisual(n,o,a)}),s[i]},positionGroup:function(t){var e=this.visualMapModel,n=this.api;go(t,e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},doRender:B}),oN=Br,aN=k,sN=Math.min,lN=Math.max,uN=12,cN=6,hN=rN.extend({type:"visualMap.continuous",init:function(){hN.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(t,e,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},_buildView:function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var n=t.get("text");this._renderEndsText(e,n,0),this._renderEndsText(e,n,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},_renderEndsText:function(t,e,n){if(e){var i=e[1-n];i=null!=i?i+"":"";var r=this.visualMapModel,o=r.get("textGap"),a=r.itemSize,s=this._shapes.barGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new lC({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===c?"middle":u,textAlign:"horizontal"===c?u:"center",text:i,textFont:h.getFont(),textFill:h.getTextColor()}}))}},_renderBar:function(t){var e=this.visualMapModel,n=this._shapes,i=e.itemSize,r=this._orient,o=this._useHandle,a=Ky(e,this.api,i),s=n.barGroup=this._createBarGroup(a);s.add(n.outOfRange=Jy()),s.add(n.inRange=Jy(null,o?rx(this._orient):null,v(this._dragHandle,this,"all",!1),v(this._dragHandle,this,"all",!0)));var l=e.textStyleModel.getTextRect("\u56fd"),u=lN(l.width,l.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(s,0,i,u,r,a),this._createHandle(s,1,i,u,r,a)),this._createIndicator(s,i,u,r),t.add(s)},_createHandle:function(t,e,n,i,r){var o=v(this._dragHandle,this,e,!1),a=v(this._dragHandle,this,e,!0),s=Jy(tx(e,i),rx(this._orient),o,a);s.position[0]=n[0],t.add(s);var l=this.visualMapModel.textStyleModel,u=new lC({draggable:!0,drift:o,onmousemove:function(t){k_(t.event)},ondragend:a,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var c=["horizontal"===r?i/2:1.5*i,"horizontal"===r?0===e?-1.5*i:1.5*i:0===e?-i/2:i/2],h=this._shapes;h.handleThumbs[e]=s,h.handleLabelPoints[e]=c,h.handleLabels[e]=u},_createIndicator:function(t,e,n,i){var r=Jy([[0,0]],"move");r.position[0]=e[0],r.attr({invisible:!0,silent:!0}),t.add(r);var o=this.visualMapModel.textStyleModel,a=new lC({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:o.getFont(),textFill:o.getTextColor()}});this.group.add(a);var s=["horizontal"===i?n/2:cN+3,0],l=this._shapes;l.indicator=r,l.indicatorLabel=a,l.indicatorLabelPoint=s},_dragHandle:function(t,e,n,i){if(this._useHandle){if(this._dragging=!e,!e){var r=this._applyTransform([n,i],this._shapes.barGroup,!0);this._updateInterval(t,r[1]),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():ix(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},_resetInterval:function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),n=t.getExtent(),i=[0,t.itemSize[1]];this._handleEnds=[oN(e[0],n,i,!0),oN(e[1],n,i,!0)]},_updateInterval:function(t,e){e=e||0;var n=this.visualMapModel,i=this._handleEnds,r=[0,n.itemSize[1]];uE(e,i,r,t,0);var o=n.getExtent();this._dataInterval=[oN(i[0],r,o,!0),oN(i[1],r,o,!0)]},_updateView:function(t){var e=this.visualMapModel,n=e.getExtent(),i=this._shapes,r=[0,e.itemSize[1]],o=t?r:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,r,"outOfRange");i.inRange.setStyle({fill:a.barColor,opacity:a.opacity}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(o,a)},_createBarVisual:function(t,e,n,i){var r={forceState:i,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,r),a=[this.getControllerVisual(t[0],"symbolSize",r),this.getControllerVisual(t[1],"symbolSize",r)],s=this._createBarPoints(n,a);return{barColor:new TC(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},_makeColorGradient:function(t,e){var n=100,i=[],r=(t[1]-t[0])/n;i.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var o=1;o<n;o++){var a=t[0]+r*o;if(a>t[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/n})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Xw("horizontal"!==e||n?"horizontal"===e&&n?{scale:"bottom"===t?[-1,1]:[1,1],
|
|
rotation:-Math.PI/2}:"vertical"!==e||n?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(i,r){if(this._useHandle){var o=this._shapes,a=this.visualMapModel,s=o.handleThumbs,l=o.handleLabels;aN([0,1],function(t){var e=s[t];e.setStyle("fill",r.handlesColor[t]),e.position[1]=i[t];var n=Dr(o.handleLabelPoints[t],Ar(e,this.group));l[t].setStyle({x:n[0],y:n[1],text:a.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",o.barGroup)})},this)}},_showIndicator:function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=oN(t,o,s,!0),u=this._shapes,c=u.indicator;if(c){c.position[1]=l,c.attr("invisible",!1),c.setShape("points",ex(!!n,i,l,a[1]));var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",h);c.setStyle("fill",d);var f=Dr(u.indicatorLabelPoint,Ar(c,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var g=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(n||"")+r.formatValueText(e),textVerticalAlign:"horizontal"===m?g:"middle",textAlign:"horizontal"===m?"center":g,x:f[0],y:f[1]})}},_enableHoverLinkToSeries:function(){var i=this;this._shapes.barGroup.on("mousemove",function(t){if(i._hovering=!0,!i._dragging){var e=i.visualMapModel.itemSize,n=i._applyTransform([t.offsetX,t.offsetY],i._shapes.barGroup,!0,!0);n[1]=sN(lN(0,n[1]),e[1]),i._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=e[0])}}).on("mouseout",function(){i._hovering=!1,!i._dragging&&i._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var r=[0,i[1]],o=n.getExtent();t=sN(lN(r[0],t),r[1]);var a=nx(n,o,r),s=[t-a,t+a],l=oN(t,r,o,!0),u=[oN(s[0],r,o,!0),oN(s[1],r,o,!0)];s[0]<r[0]&&(u[0]=-Infinity),s[1]>r[1]&&(u[1]=Infinity),e&&(u[0]===-Infinity?this._showIndicator(l,u[1],"< ",a):u[1]===Infinity?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"\u2248 ",a));var c=this._hoverLinkDataIndices,h=[];(e||ix(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=Vn(c,h);this._dispatchHighDown("downplay",Qy(d[0])),this._dispatchHighDown("highlight",Qy(d[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,n=this.visualMapModel;if(e&&null!=e.dataIndex){var i=this.ecModel.getSeriesByIndex(e.seriesIndex);if(n.isTargetSeries(i)){var r=i.getData(e.dataType),o=r.get(n.getDataDimension(r),e.dataIndex,!0);isNaN(o)||this._showIndicator(o,o)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Qy(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,n,i){var r=Ar(e,i?null:this.group);return OC[E(t)?"applyTransform":"transformDirection"](t,r,n)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});Os({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})}),ks($P);var dN=eN.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){dN.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var n=this._mode=this._determineMode();fN[this._mode].call(this),this._resetSelected(t,e);var i=this.option.categories;this.resetVisual(function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=L(i)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=A(this._pieceList,function(t){t=L(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function i(t,e,n){return t&&t[e]&&(b(t[e])?t[e].hasOwnProperty(n):t[e]===n)}var r=this.option,n={},t=fk.listVisualTypes(),o=this.isCategory();k(r.pieces,function(e){k(t,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),k(n,function(t,e){var n=0;k(this.stateList,function(t){n|=i(r,t,e)||i(r.target,t,e)},this),!n&&k(this.stateList,function(t){(r[t]||(r[t]={}))[e]=GP.get(e,"inRange"===t?"active":"inactive",o)})},this),eN.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var n=this.option,i=this._pieceList,r=(e?n:t).selected||{};if(n.selected=r,k(i,function(t){var e=this.getSelectedMapKey(t);r.hasOwnProperty(e)||(r[e]=!0)},this),"single"===n.selectedMode){var o=!1;k(i,function(t){var e=this.getSelectedMapKey(t);r[e]&&(o?r[e]=!1:o=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&0<t.pieces.length?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=L(t)},getValueState:function(t){var e=fk.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(i){var r=[];return this.eachTargetSeries(function(t){var n=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){fk.findPieceIndex(t,this._pieceList)===i&&n.push(e)},this),r.push({seriesId:t.id,dataIndex:n})},this),r},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-Infinity&&n[1]===Infinity?0:(n[0]+n[1])/2}return e},getVisualMeta:function(r){function n(t,e){var n=s.getRepresentValue({interval:t});e||(e=s.getValueState(n));var i=r(n,e);t[0]===-Infinity?a[0]=i:t[1]===Infinity?a[1]=i:o.push({value:t[0],color:i},{value:t[1],color:i})}if(!this.isCategory()){var o=[],a=[],s=this,t=this._pieceList.slice();if(t.length){var e=t[0].interval[0];e!==-Infinity&&t.unshift({interval:[-Infinity,e]}),(e=t[t.length-1].interval[1])!==Infinity&&t.push({interval:[e,Infinity]})}else t.push({interval:[-Infinity,Infinity]});var i=-Infinity;return k(t,function(t){var e=t.interval;e&&(e[0]>i&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:o,outerColors:a}}}}),fN={splitNumber:function(){var t=this.option,e=this._pieceList,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;r=Math.max(parseInt(r,10),1),t.splitNumber=r;for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n);var a=0;t.minOpen&&e.push({index:a++,interval:[-Infinity,i[0]],close:[0,0]});for(var s=i[0],l=a+r;a<l;s+=o){var u=a===r-1?i[1]:s+o;e.push({index:a++,interval:[s,u],close:[1,1]})}t.maxOpen&&e.push({index:a++,interval:[i[1],Infinity],close:[0,0]}),to(e),k(e,function(t){t.text=this.formatValueText(t.interval)},this)},categories:function(){var t=this.option;k(t.categories,function(t){this._pieceList.push({text:this.formatValueText(t,!0),value:t})},this),ox(t,this._pieceList)},pieces:function(){var t=this.option,d=this._pieceList;k(t.pieces,function(t,e){b(t)||(t={value:t});var n={text:"",index:e};if(null!=t.label&&(n.text=t.label),t.hasOwnProperty("value")){var i=n.value=t.value;n.interval=[i,i],n.close=[1,1]}else{for(var r=n.interval=[],o=n.close=[0,0],a=[1,0,1],s=[-Infinity,Infinity],l=[],u=0;u<2;u++){for(var c=[["gte","gt","min"],["lte","lt","max"]][u],h=0;h<3&&null==r[u];h++)r[u]=t[c[h]],o[u]=a[h],l[u]=2===h;null==r[u]&&(r[u]=s[u])}l[0]&&r[1]===Infinity&&(o[0]=0),l[1]&&r[0]===-Infinity&&(o[1]=0),Vb&&r[0]>r[1]&&console.warn("Piece "+e+"is illegal: "+r+" lower bound should not greater then uppper bound."),r[0]===r[1]&&o[0]&&o[1]&&(n.value=r[0])}n.visual=fk.retrieveVisuals(t),d.push(n)},this),ox(t,d),to(d),k(d,function(t){var e=t.close,n=[["<","\u2264"][e[1]],[">","\u2265"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)},this)}};rN.extend({type:"visualMap.piecewise",doRender:function(){function t(t){var e=t.piece,n=new Xw;n.onclick=v(this._onItemClick,this,e),this._enableHoverLink(n,t.indexInModelPieceList);var i=a.getRepresentValue(e);if(this._createItemSymbol(n,i,[0,0,h[0],h[1]]),d){var r=this.visualMapModel.getValueState(i);n.add(new lC({style:{x:"right"===c?-s:h[0]+s,y:h[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:c,textFont:l,textFill:u,opacity:"outOfRange"===r?.5:1}}))}o.add(n)}var o=this.group;o.removeAll();var a=this.visualMapModel,s=a.get("textGap"),e=a.textStyleModel,l=e.getFont(),u=e.getTextColor(),c=this._getItemAlign(),h=a.itemSize,n=this._getViewData(),i=n.endsText,d=N(a.get("showLabel",!0),!i);i&&this._renderEndsText(o,i[0],h,d,c),k(n.viewPieceList,t,this),i&&this._renderEndsText(o,i[1],h,d,c),nT(a.get("orient"),o,a.get("itemGap")),this.renderBackground(o),this.positionGroup(o)},_enableHoverLink:function(t,n){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:Qy(e.findTargetDataIndices(n))})}t.on("mouseover",v(e,this,"highlight")).on("mouseout",v(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return Ky(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},_renderEndsText:function(t,e,n,i,r){if(e){var o=new Xw,a=this.visualMapModel.textStyleModel;o.add(new lC({style:{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,textVerticalAlign:"middle",textAlign:i?r:"center",text:e,textFont:a.getFont(),textFill:a.getTextColor()}})),t.add(o)}},_getViewData:function(){var t=this.visualMapModel,e=A(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),i=t.get("orient"),r=t.get("inverse");return("horizontal"===i?r:!r)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},_createItemSymbol:function(t,e,n){t.add(Ql(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,n=e.option,i=L(n.selected),r=e.getSelectedMapKey(t);"single"===n.selectedMode?(i[r]=!0,k(i,function(t,e){i[e]=e===r})):i[r]=!i[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}});ks($P);var pN=no,gN=ro,mN=Bs({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,n,i){if(Vb&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(t,n),this.mergeOption(t,n,i.createdBySelf,!0)},isAnimationEnabled:function(){if(Ub.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,i,e,r){var o=this.constructor,a=this.mainType+"Model";e||i.eachSeries(function(t){var e=t.get(this.mainType,!0),n=t[a];e&&e.data?(n?n.mergeOption(e,i,!0):(r&&ax(e),k(e.data,function(t){t instanceof Array?(ax(t[0]),ax(t[1])):ax(t)}),O(n=new o(e,this,i),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),n.__hostSeries=t),t[a]=n):t[a]=null},this)},formatTooltip:function(t){var e=this.getData(),n=this.getRawValue(t),i=E(n)?A(n,pN).join(", "):pN(n),r=e.getName(t),o=gN(this.name);return(null!=n||r)&&(o+="<br />"),r&&(o+=gN(r),null!=n&&(o+=" : ")),null!=n&&(o+=gN(i)),o},getData:function(){return this._data},setData:function(t){this._data=t}});r(mN,jT),mN.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var vN=x,yN=y,xN={min:yN(ux,"min"),max:yN(ux,"max"),average:yN(ux,"average")},bN=Vs({type:"marker",init:function(){this.markerGroupMap=z()},render:function(t,n,i){var e=this.markerGroupMap;e.each(function(t){t.__keep=!1});var r=this.type+"Model";n.eachSeries(function(t){var e=t[r];e&&this.renderSeries(t,e,n,i)},this),e.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}});bN.extend({type:"markPoint",updateTransform:function(t,e,n){e.eachSeries(function(t){var e=t.markPointModel;e&&(mx(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,i,e,n){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new Mu),u=vx(r,t,i);i.setData(u),mx(i.getData(),t,n),u.each(function(t){var e=u.getItemModel(t),n=e.getShallow("symbolSize");"function"==typeof n&&(n=n(i.getRawValue(t),i.getDataParams(t))),u.setItemVisual(t,{symbolSize:n,color:e.get("itemStyle.color")||a.getVisual("color"),symbol:e.getShallow("symbol")})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=i})}),l.__keep=!0,l.group.silent=i.get("silent")||t.get("silent")}}),ks(function(t){t.markPoint=t.markPoint||{}}),mN.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var wN=function(t,e,n,i){var r=t.getData(),o=i.type;if(!E(i)&&("min"===o||"max"===o||"average"===o||"median"===o||null!=i.xAxis||null!=i.yAxis)){var a,s;if(null!=i.yAxis||null!=i.xAxis)a=null!=i.yAxis?"y":"x",e.getAxis(a),s=N(i.yAxis,i.xAxis);else{var l=hx(i,r,e,t);a=l.valueDataDim,l.valueAxis,s=gx(r,a,o)}var u="x"===a?0:1,c=1-u,h=L(i),d={};h.type=null,h.coord=[],d.coord=[],h.coord[c]=-Infinity,d.coord[c]=Infinity;var f=n.get("precision");0<=f&&"number"==typeof s&&(s=+s.toFixed(Math.min(f,20))),h.coord[u]=d.coord[u]=s,i=[h,d,{type:o,valueIndex:i.valueIndex,value:s}]}return(i=[cx(t,i[0]),cx(t,i[1]),O({},i[2])])[2].type=i[2].type||"",g(i[2],i[0]),g(i[2],i[1]),i};bN.extend({type:"markLine",updateTransform:function(t,e,o){e.eachSeries(function(e){var t=e.markLineModel;if(t){var n=t.getData(),i=t.__from,r=t.__to;i.each(function(t){_x(i,t,!0,e,o),_x(r,t,!1,e,o)}),n.each(function(t){n.setItemLayout(t,[i.getItemLayout(t),r.getItemLayout(t)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},renderSeries:function(r,e,t,o){function n(t,e,n){var i=t.getItemModel(e);_x(t,e,n,r,o),t.setItemVisual(e,{symbolSize:i.get("symbolSize")||g[n?0:1],symbol:i.get("symbol",!0)||p[n?0:1],color:i.get("itemStyle.color")||s.getVisual("color")})}var i=r.coordinateSystem,a=r.id,s=r.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,new tf);this.group.add(u.group);var c=Sx(i,r,e),h=c.from,d=c.to,f=c.line;e.__from=h,e.__to=d,e.setData(f);var p=e.get("symbol"),g=e.get("symbolSize");E(p)||(p=[p,p]),"number"==typeof g&&(g=[g,g]),c.from.each(function(t){n(h,t,!0),n(d,t,!1)}),f.each(function(t){var e=f.getItemModel(t).get("lineStyle.color");f.setItemVisual(t,{color:e||h.getItemVisual(t,"color")}),f.setItemLayout(t,[h.getItemLayout(t),d.getItemLayout(t)]),f.setItemVisual(t,{fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolSize:d.getItemVisual(t,"symbolSize"),toSymbol:d.getItemVisual(t,"symbol")})}),u.updateData(f),c.line.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),u.__keep=!0,u.group.silent=e.get("silent")||r.get("silent")}}),ks(function(t){t.markLine=t.markLine||{}}),mN.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var _N=function(t,e,n,i){var r=cx(t,i[0]),o=cx(t,i[1]),a=N,s=r.coord,l=o.coord;s[0]=a(s[0],-Infinity),s[1]=a(s[1],-Infinity),l[0]=a(l[0],Infinity),l[1]=a(l[1],Infinity);var u=c([{},r,o]);return u.coord=[r.coord,o.coord],u.x0=r.x,u.y0=r.y,u.x1=o.x,u.y1=o.y,u},SN=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];bN.extend({type:"markArea",updateTransform:function(t,e,r){e.eachSeries(function(n){var t=n.markAreaModel;if(t){var i=t.getData();i.each(function(e){var t=A(SN,function(t){return Dx(i,e,t,n,r)});i.setItemLayout(e,t),i.getItemGraphicEl(e).setShape("points",t)})}},this)},renderSeries:function(n,a,t,i){var e=n.coordinateSystem,r=n.id,o=n.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,{group:new Xw});this.group.add(l.group),l.__keep=!0;var u=Mx(e,n,a);a.setData(u),u.each(function(e){u.setItemLayout(e,A(SN,function(t){return Dx(u,e,t,n,i)})),u.setItemVisual(e,{color:o.getVisual("color")})}),u.diff(l.__data).add(function(t){var e=new mC({shape:{points:u.getItemLayout(t)}});u.setItemGraphicEl(t,e),l.group.add(e)}).update(function(t,e){var n=l.__data.getItemGraphicEl(e);Cr(n,{shape:{points:u.getItemLayout(t)}},a,t),l.group.add(n),u.setItemGraphicEl(t,n)}).remove(function(t){var e=l.__data.getItemGraphicEl(t);l.group.remove(e)}).execute(),u.eachItemGraphicEl(function(t,e){var n=u.getItemModel(e),i=n.getModel("label"),r=n.getModel("emphasis.label"),o=u.getItemVisual(e,"color");t.useStyle(D(n.getModel("itemStyle").getItemStyle(),{fill:jt(o,.4),stroke:o})),t.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),fr(t.style,t.hoverStyle,i,r,{labelFetcher:a,labelDataIndex:e,defaultText:u.getName(e)||"",isRectText:!0,autoColor:o}),dr(t,{}),t.dataModel=a}),l.__data=u,l.group.silent=a.get("silent")||n.get("silent")}}),ks(function(t){t.markArea=t.markArea||{}});var CN=function(t){var e=t&&t.timeline;E(e)||(e=e?[e]:[]),k(e,function(t){t&&Ix(t)})};oT.registerSubTypeDefaulter("timeline",function(){return"slider"}),Os({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var n=e.getComponent("timeline");return n&&null!=t.currentIndex&&(n.setCurrentIndex(t.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.setPlayState(!1)),e.resetOption("timeline"),D({currentIndex:n.option.currentIndex},t)}),Os({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var n=e.getComponent("timeline");n&&null!=t.playState&&n.setPlayState(t.playState)});var TN=oT.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,n){this._data,this._names,this.mergeDefaultAndTheme(t,n),this._initData()},mergeOption:function(){TN.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],n=t.axisType,r=this._names=[];if("category"===n){var o=[];k(e,function(t,e){var n,i=Nn(t);b(t)?(n=L(t)).value=e:n=e,o.push(n),w(i)||null!=i&&!isNaN(i)||(i=""),r.push(i+"")}),e=o}var i={category:"ordinal",time:"time"}[n]||"number";(this._data=new hD([{name:"value",type:i}],this)).initData(e,r)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});r(TN.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),jT);var AN=GT.extend({type:"timeline"}),DN=function(t,e,n,i){rM.call(this,t,e,n),this.type=i||"value",this.model=null};DN.prototype={constructor:DN,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},o(DN,rM);var MN=v,IN=k,kN=Math.PI;AN.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var i=this._layout(e,n),r=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),a=this._axis=this._createAxis(i,e);e.formatTooltip=function(t){return ro(a.scale.getLabel(t))},IN(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](i,r,a,e)},this),this._renderAxisLabel(i,o,a,e),this._position(i,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var n=t.get("label.position"),i=t.get("orient"),r=Lx(t,e);null==n||"auto"===n?n="horizontal"===i?r.y+r.height/2<e.getHeight()/2?"-":"+":r.x+r.width/2<e.getWidth()/2?"+":"-":isNaN(n)&&(n={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[i][n]);var o,a,s,l,u={horizontal:"center",vertical:0<=n||"+"===n?"left":"right"},c={horizontal:0<=n||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:kN/2},d="vertical"===i?r.height:r.width,f=t.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=t.get("label.rotate")||0;y=y*kN/180;var x=f.get("position",!0),b=p&&f.get("showPlayBtn",!0),w=p&&f.get("showPrevBtn",!0),_=p&&f.get("showNextBtn",!0),S=0,C=d;return"left"===x||"bottom"===x?(b&&(o=[0,0],S+=v),w&&(a=[S,0],S+=v)):(b&&(o=[C-g,0],C-=v),w&&(a=[0,0],S+=v)),_&&(s=[C-g,0],C-=v),l=[S,C],t.get("inverse")&&l.reverse(),{viewRect:r,mainLength:d,orient:i,rotation:h[i],labelRotation:y,labelPosOpt:n,labelAlign:t.get("label.align")||u[i],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||c[i],playPosition:o,prevBtnPosition:a,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(t){function e(t){var e=t.position;t.origin=[c[0][0]-e[0],c[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function i(t,e,n,i,r){t[i]+=n[i][r]-e[i][r]}var r=this._mainGroup,o=this._labelGroup,a=t.viewRect;if("vertical"===t.orient){var s=ft(),l=a.x,u=a.y+a.height;vt(s,s,[-l,-u]),yt(s,s,-kN/2),vt(s,s,[l,u]),(a=a.clone()).applyTransform(s)}var c=n(a),h=n(r.getBoundingRect()),d=n(o.getBoundingRect()),f=r.position,p=o.position;p[0]=f[0]=c[0][0];var g,m=t.labelPosOpt;isNaN(m)?(i(f,h,c,1,g="+"===m?0:1),i(p,d,c,1,1-g)):(i(f,h,c,1,g=0<=m?0:1),p[1]=f[1]+m);r.attr("position",f),o.attr("position",p),r.rotation=o.rotation=t.rotation,e(r),e(o)},_createAxis:function(t,e){var n=e.getData(),i=e.get("axisType"),r=$l(e,i);r.getTicks=function(){return n.mapArray(["value"],function(t){return t})};var o=n.getDataExtent("value");r.setExtent(o[0],o[1]),r.niceTicks();var a=new DN("value",r,t.axisExtent,i);return a.model=e,a},_createGroup:function(t){var e=this["_"+t]=new Xw;return this.group.add(e),e},_renderAxisLine:function(t,e,n,i){var r=n.getExtent();i.get("lineStyle.show")&&e.add(new xC({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:O({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,s,l,u){var c=u.getData(),e=l.scale.getTicks();IN(e,function(t){var e=l.dataToCoord(t),n=c.getItemModel(t),i=n.getModel("itemStyle"),r=n.getModel("emphasis.itemStyle"),o={position:[e,0],onclick:MN(this._changeTimeline,this,t)},a=Px(n,i,s,o);dr(a,r.getItemStyle()),n.get("tooltip")?(a.dataIndex=t,a.dataModel=u):a.dataIndex=a.dataModel=null},this)},_renderAxisLabel:function(s,l,u,t){if(u.getLabelModel().get("show")){var c=t.getData(),e=u.getViewLabels();IN(e,function(t){var e=t.tickValue,n=c.getItemModel(e),i=n.getModel("label"),r=n.getModel("emphasis.label"),o=u.dataToCoord(t.tickValue),a=new lC({position:[o,0],rotation:s.labelRotation-s.rotation,onclick:MN(this._changeTimeline,this,e),silent:!1});pr(a.style,i,{text:t.formattedLabel,textAlign:s.labelAlign,textVerticalAlign:s.labelBaseline}),l.add(a),dr(a,pr({},r))},this)}},_renderControl:function(t,o,e,a){function n(t,e,n,i){if(t){var r=Ox(a,e,h,{position:t,origin:[s/2,0],rotation:i?-l:0,rectHover:!0,style:u,onclick:n});o.add(r),dr(r,c)}}var s=t.controlSize,l=t.rotation,u=a.getModel("controlStyle").getItemStyle(),c=a.getModel("emphasis.controlStyle").getItemStyle(),h=[0,-s/2,s,s],i=a.getPlayState(),r=a.get("inverse",!0);n(t.nextBtnPosition,"controlStyle.nextIcon",MN(this._changeTimeline,this,r?"-":"+")),n(t.prevBtnPosition,"controlStyle.prevIcon",MN(this._changeTimeline,this,r?"+":"-")),n(t.playPosition,"controlStyle."+(i?"stopIcon":"playIcon"),MN(this._handlePlayClick,this,!i),!0)},_renderCurrentPointer:function(t,e,n,i){var r=i.getData(),o=i.getCurrentIndex(),a=r.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=MN(s._handlePointerDrag,s),t.ondragend=MN(s._handlePointerDragend,s),Nx(t,o,n,i,!0)},onUpdate:function(t){Nx(t,o,n,i)}};this._currentPointer=Px(a,a,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var n=this._toAxisCoord(t)[0],i=Wr(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.position[0]=n,this._currentPointer.dirty();var r=this._findNearestTick(n),o=this.model;(e||r!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(r)},_doPlayStop:function(){function t(){var t=this.model;this._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))}this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(MN(t,this),this.model.get("playInterval")))},_toAxisCoord:function(t){return Dr(t,this._mainGroup.getLocalTransform(),!0)},_findNearestTick:function(r){var o,t=this.model.getData(),a=Infinity,s=this._axis;return t.each(["value"],function(t,e){var n=s.dataToCoord(t),i=Math.abs(n-r);i<a&&(a=i,o=e)}),o},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_changeTimeline:function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})}}),ks(CN);var EN=Bs({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){EN.superApply(this,"optionUpdated",arguments),k(this.option.feature,function(t,e){var n=wy(e);n&&g(t,n.defaultOption)})},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}}}});Vs({type:"toolbox",render:function(c,h,d,s){function t(t,e){var n,i=m[t],r=m[e],o=new Or(u[i],c,c.ecModel);if(i&&!r){if(Rx(i))n={model:o,onclick:o.option.onclick,featureName:i};else{var a=wy(i);if(!a)return;n=new a(o,h,d)}g[i]=n}else{if(!(n=g[r]))return;n.model=o,n.ecModel=h,n.api=d}i||!r?o.get("show")&&!n.unusable?(l(o,n,i),o.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&i[t].trigger(e)},n.render&&n.render(o,h,d,s)):n.remove&&n.remove(h,d):n.dispose&&n.dispose(h,d)}function l(i,r,t){var o=i.getModel("iconStyle"),a=i.getModel("emphasis.iconStyle"),e=r.getIcons?r.getIcons():i.get("icon"),s=i.get("title")||{};if("string"==typeof e){var n=e,l=s;s={},(e={})[t]=n,s[t]=l}var u=i.iconPaths={};k(e,function(t,e){var n=Lr(t,{},{x:-p/2,y:-p/2,width:p,height:p});n.setStyle(o.getItemStyle()),n.hoverStyle=a.getItemStyle(),dr(n),c.get("showTitle")&&(n.__title=s[e],n.on("mouseover",function(){var t=a.getItemStyle();n.setStyle({text:s[e],textPosition:t.textPosition||"bottom",textFill:t.fill||t.stroke||"#000",textAlign:t.textAlign||"center"})}).on("mouseout",function(){n.setStyle({textFill:null})})),n.trigger(i.get("iconStatus."+e)||"normal"),f.add(n),n.on("click",v(r.onclick,r,h,d,e)),u[e]=n})}var f=this.group;if(f.removeAll(),c.get("show")){var p=+c.get("itemSize"),u=c.get("feature")||{},g=this._features||(this._features={}),m=[];k(u,function(t,e){m.push(e)}),new Ys(this._featureNames||[],m).add(t).update(t).remove(y(t,null)).execute(),this._featureNames=m,fv(f,c,d),f.add(pv(f.getBoundingRect(),c)),f.eachChild(function(t){var e=t.__title,n=t.hoverStyle;if(n&&e){var i=Se(e,ze(n)),r=t.position[0]+f.position[0],o=!1;t.position[1]+f.position[1]+p+i.height>d.getHeight()&&(n.textPosition="top",o=!0);var a=o?-5-i.height:p+8;r+i.width/2>d.getWidth()?(n.textPosition=["100%",a],n.textAlign="right"):r-i.width/2<0&&(n.textPosition=[0,a],n.textAlign="left")}})}},updateView:function(t,e,n,i){k(this._features,function(t){t.updateView&&t.updateView(t.model,e,n,i)})},remove:function(e,n){k(this._features,function(t){t.remove&&t.remove(e,n)}),this.group.removeAll()},dispose:function(e,n){k(this._features,function(t){t.dispose&&t.dispose(e,n)})}});var LN=rA.toolbox.saveAsImage;Fx.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:LN.title,type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:LN.lang.slice()},Fx.prototype.unusable=!Ub.canvasSupported,Fx.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r=document.createElement("a"),o=n.get("type",!0)||"png";r.download=i+"."+o,r.target="_blank";var a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if(r.href=a,"function"!=typeof MouseEvent||Ub.browser.ie||Ub.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(a.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var c=new Blob([u]);window.navigator.msSaveOrOpenBlob(c,i+"."+o)}else{var h=n.get("lang"),d='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open(
|
|
).document.write(d)}else{var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});r.dispatchEvent(f)}},by("saveAsImage",Fx);var ON=rA.toolbox.magicType;zx.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:L(ON.title),option:{},seriesIndex:{}};var PN=zx.prototype;PN.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return k(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n};var NN={line:function(t,e,n,i){if("bar"===t)return g({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get("option.line")||{},!0)},bar:function(t,e,n,i){if("line"===t)return g({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get("option.bar")||{},!0)},stack:function(t,e,n,i){if("line"===t||"bar"===t)return g({id:e,stack:"__ec_magicType_stack__"},i.get("option.stack")||{},!0)},tiled:function(t,e,n,i){if("line"===t||"bar"===t)return g({id:e,stack:""},i.get("option.tiled")||{},!0)}},RN=[["line","bar"],["stack","tiled"]];PN.onclick=function(u,t,c){var h=this.model,e=h.get("seriesIndex."+c);if(NN[c]){var d={series:[]},n=function(t){var e=t.subType,n=t.id,i=NN[c](e,n,t,h);i&&(D(i,t.option),d.series.push(i));var r=t.coordinateSystem;if(r&&"cartesian2d"===r.type&&("line"===c||"bar"===c)){var o=r.getAxesByScale("ordinal")[0];if(o){var a=o.dim+"Axis",s=u.queryComponents({mainType:a,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;d[a]=d[a]||[];for(var l=0;l<=s;l++)d[a][s]=d[a][s]||{};d[a][s].boundaryGap="bar"===c}}};k(RN,function(t){0<=x(t,c)&&k(t,function(t){h.setIconStatus(t,"normal")})}),h.setIconStatus(c,"emphasis"),u.eachComponent({mainType:"series",query:null==e?null:{seriesIndex:e}},n),t.dispatchAction({type:"changeMagicType",currentType:c,newOption:d})}},Os({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),by("magicType",zx);var FN=rA.toolbox.dataView,zN=new Array(60).join("-"),HN="\t",BN=new RegExp("["+HN+"]+","g");Yx.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:L(FN.title),lang:L(FN.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},Yx.prototype.onclick=function(t,n){function i(){e.removeChild(o),x._dom=null}var e=n.getDom(),r=this.model;this._dom&&e.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",o.style.backgroundColor=r.get("backgroundColor")||"#fff";var a=document.createElement("h4"),s=r.get("lang")||[];a.innerHTML=s[0]||r.get("title"),a.style.cssText="margin: 10px 20px;",a.style.color=r.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="display:block;width:100%;overflow:auto;";var c=r.get("optionToContent"),h=r.get("contentToOption"),d=jx(t);if("function"==typeof c){var f=c(n.getOption());"string"==typeof f?l.innerHTML=f:S(f)&&l.appendChild(f)}else l.appendChild(u),u.readOnly=r.get("readOnly"),u.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",u.style.color=r.get("textColor"),u.style.borderColor=r.get("textareaBorderColor"),u.style.backgroundColor=r.get("textareaColor"),u.value=d.value;var p=d.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:0;left:0;right:0;";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+r.get("buttonColor"),m+=";color:"+r.get("buttonTextColor");var x=this;vn(v,"click",i),vn(y,"click",function(){var t;try{t="function"==typeof h?h(l,n.getOption()):Gx(u.value,p)}catch(e){throw i(),new Error("Data view format error "+e)}t&&n.dispatchAction({type:"changeDataView",newOption:t}),i()}),v.innerHTML=s[1],y.innerHTML=s[2],y.style.cssText=m,v.style.cssText=m,!r.get("readOnly")&&g.appendChild(y),g.appendChild(v),vn(u,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,n=this.selectionStart,i=this.selectionEnd;this.value=e.substring(0,n)+HN+e.substring(i),this.selectionStart=this.selectionEnd=n+1,k_(t)}}),o.appendChild(a),o.appendChild(l),o.appendChild(g),l.style.height=e.clientHeight-80+"px",e.appendChild(o),this._dom=o},Yx.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},Yx.prototype.dispose=function(t,e){this.remove(t,e)},by("dataView",Yx),Os({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,i){var r=[];k(t.newOption.series,function(t){var e=i.getSeriesByName(t.name)[0];if(e){var n=e.get("data");r.push({name:t.name,data:Zx(t.data,n)})}else r.push(O({type:"scatter"},t))}),i.mergeOption(D({series:r},t.newOption))});var VN=k,jN="\0_ec_hist_store";CP.extend({type:"dataZoom.select"}),TP.extend({type:"dataZoom.select"});var WN=rA.toolbox.dataZoom,UN=k,$N="\0_ec_\0toolbox-dataZoom_";eb.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:L(WN.title)};var qN=eb.prototype;qN.render=function(t,e,n,i){this.model=t,this.ecModel=e,this.api=n,rb(t,e,this,i,n),ib(t,e)},qN.onclick=function(t,e,n){GN[n].call(this)},qN.remove=function(){this._brushController.unmount()},qN.dispose=function(){this._brushController.dispose()};var GN={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(Kx(this.ecModel))}};qN._onBrush=function(t,e){function r(t,e,n){var i=e.getAxis(t),r=i.model,o=s(t,r,u),a=o.findRepresentativeAxisProxy(r).getMinMaxSpan();null==a.minValueSpan&&null==a.maxValueSpan||(n=uE(0,n.slice(),i.scale.getExtent(),0,a.minValueSpan,a.maxValueSpan)),o&&(l[o.id]={dataZoomId:o.id,startValue:n[0],endValue:n[1]})}function s(e,n,t){var i;return t.eachComponent({mainType:"dataZoom",subType:"select"},function(t){t.getAxisModel(e,n.componentIndex)&&(i=t)}),i}if(e.isEnd&&t.length){var l={},u=this.ecModel;this._brushController.updateCovers([]),new ry(nb(this.model.option),u,{include:["grid"]}).matchOutputRanges(t,u,function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(r("x",n,e[0]),r("y",n,e[1])):r({lineX:"x",lineY:"y"}[i],n,e)}}),Xx(u,l),this._dispatchZoomAction(l)}},qN._dispatchZoomAction=function(t){var e=[];UN(t,function(t){e.push(L(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},by("dataZoom",eb),ks(function(i){function t(i,t){if(t){var r=i+"Index",o=t[r];null==o||"all"==o||E(o)||(o=!1===o||"none"===o?[]:[o]),e(i,function(t,e){if(null==o||"all"==o||-1!==x(o,e)){var n={type:"select",$fromToolbox:!0,id:$N+i+e};n[r]=e,a.push(n)}})}}function e(t,e){var n=i[t];E(n)||(n=n?[n]:[]),UN(n,e)}if(i){var a=i.dataZoom||(i.dataZoom=[]);E(a)||(i.dataZoom=a=[a]);var n=i.toolbox;if(n&&(E(n)&&(n=n[0]),n&&n.feature)){var r=n.feature.dataZoom;t("xAxis",r),t("yAxis",r)}}});var YN=rA.toolbox.restore;ob.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:YN.title},ob.prototype.onclick=function(t,e){Qx(t),e.dispatchAction({type:"restore",from:this.uid})},by("restore",ob),Os({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var ZN,XN="urn:schemas-microsoft-com:vml",KN="undefined"==typeof window?null:window,QN=!1,JN=KN&&KN.document;if(JN&&!Ub.canvasSupported)try{!JN.namespaces.zrvml&&JN.namespaces.add("zrvml",XN),ZN=function(t){return JN.createElement("<zrvml:"+t+' class="zrvml">')}}catch(uF){ZN=function(t){return JN.createElement("<"+t+' xmlns="'+XN+'" class="zrvml">')}}var tR=zS.CMD,eR=Math.round,nR=Math.sqrt,iR=Math.abs,rR=Math.cos,oR=Math.sin,aR=Math.max;if(!Ub.canvasSupported){var sR=",",lR="progid:DXImageTransform.Microsoft",uR=21600,cR=uR/2,hR=1e5,dR=1e3,fR=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=uR+","+uR,t.coordorigin="0,0"},pR=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},gR=function(t,e,n){return"rgb("+[t,e,n].join(",")+")"},mR=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},vR=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},yR=function(t,e,n){return(parseFloat(t)||0)*hR+(parseFloat(e)||0)*dR+n},xR=function(t,e){return"string"==typeof t?0<=t.lastIndexOf("%")?parseFloat(t)/100*e:parseFloat(t):t},bR=function(t,e,n){var i=Pt(e);n=+n,isNaN(n)&&(n=1),i&&(t.color=gR(i[0],i[1],i[2]),t.opacity=n*i[3])},wR=function(t){var e=Pt(t);return[gR(e[0],e[1],e[2]),e[3]]},_R=function(t,e,n){var i=e.fill;if(null!=i)if(i instanceof CC){var r,o=0,a=[0,0],s=0,l=1,u=n.getBoundingRect(),c=u.width,h=u.height;if("linear"===i.type){r="gradient";var d=n.transform,f=[i.x*c,i.y*h],p=[i.x2*c,i.y2*h];d&&(ot(f,f,d),ot(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(o=180*Math.atan2(g,m)/Math.PI)<0&&(o+=360),o<1e-6&&(o=0)}else{r="gradientradial";f=[i.x*c,i.y*h],d=n.transform;var v=n.scale,y=c,x=h;a=[(f[0]-u.x)/y,(f[1]-u.y)/x],d&&ot(f,f,d),y/=v[0]*uR,x/=v[1]*uR;var b=aR(y,x);s=0/b,l=2*i.r/b-s}var w=i.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var _=w.length,S=[],C=[],T=0;T<_;T++){var A=w[T],D=wR(A.color);C.push(A.offset*l+s+" "+D[0]),0!==T&&T!==_-1||S.push(D)}if(2<=_){var M=S[0][0],I=S[1][0],k=S[0][1]*e.opacity,E=S[1][1]*e.opacity;t.type=r,t.method="none",t.focus="100%",t.angle=o,t.color=M,t.color2=I,t.colors=C.join(","),t.opacity=E,t.opacity2=k}"radial"===r&&(t.focusposition=a.join(","))}else bR(t,i,e.opacity)},SR=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof CC||bR(t,e.stroke,e.opacity)},CR=function(t,e,n,i){var r="fill"==e,o=t.getElementsByTagName(e)[0];null!=n[e]&&"none"!==n[e]&&(r||!r&&n.lineWidth)?(t[r?"filled":"stroked"]="true",n[e]instanceof CC&&vR(t,o),o||(o=ab(e)),r?_R(o,n,i):SR(o,n),mR(t,o)):(t[r?"filled":"stroked"]="false",vR(t,o))},TR=[[],[],[]],AR=function(t,e){var n,i,r,o,a,s,l=tR.M,u=tR.C,c=tR.L,h=tR.A,d=tR.Q,f=[],p=t.data,g=t.len();for(o=0;o<g;){switch(i="",n=0,r=p[o++]){case l:i=" m ",n=1,a=p[o++],s=p[o++],TR[0][0]=a,TR[0][1]=s;break;case c:i=" l ",n=1,a=p[o++],s=p[o++],TR[0][0]=a,TR[0][1]=s;break;case d:case u:i=" c ",n=3;var m,v,y=p[o++],x=p[o++],b=p[o++],w=p[o++];r===d?(b=((m=b)+2*y)/3,w=((v=w)+2*x)/3,y=(a+2*y)/3,x=(s+2*x)/3):(m=p[o++],v=p[o++]),TR[0][0]=y,TR[0][1]=x,TR[1][0]=b,TR[1][1]=w,a=TR[2][0]=m,s=TR[2][1]=v;break;case h:var _=0,S=0,C=1,T=1,A=0;e&&(_=e[4],S=e[5],C=nR(e[0]*e[0]+e[1]*e[1]),T=nR(e[2]*e[2]+e[3]*e[3]),A=Math.atan2(-e[1]/T,e[0]/C));var D=p[o++],M=p[o++],I=p[o++],k=p[o++],E=p[o++]+A,L=p[o++]+E+A;o++;var O=p[o++],P=D+rR(E)*I,N=M+oR(E)*k,R=(y=D+rR(L)*I,x=M+oR(L)*k,O?" wa ":" at ");Math.abs(P-y)<1e-4&&(.01<Math.abs(L-E)?O&&(P+=270/uR):Math.abs(N-M)<1e-4?O&&P<D||!O&&D<P?x-=270/uR:x+=270/uR:O&&N<M||!O&&M<N?y+=270/uR:y-=270/uR),f.push(R,eR(((D-I)*C+_)*uR-cR),sR,eR(((M-k)*T+S)*uR-cR),sR,eR(((D+I)*C+_)*uR-cR),sR,eR(((M+k)*T+S)*uR-cR),sR,eR((P*C+_)*uR-cR),sR,eR((N*T+S)*uR-cR),sR,eR((y*C+_)*uR-cR),sR,eR((x*T+S)*uR-cR)),a=y,s=x;break;case tR.R:var F=TR[0],z=TR[1];F[0]=p[o++],F[1]=p[o++],z[0]=F[0]+p[o++],z[1]=F[1]+p[o++],e&&(ot(F,F,e),ot(z,z,e)),F[0]=eR(F[0]*uR-cR),z[0]=eR(z[0]*uR-cR),F[1]=eR(F[1]*uR-cR),z[1]=eR(z[1]*uR-cR),f.push(" m ",F[0],sR,F[1]," l ",z[0],sR,F[1]," l ",z[0],sR,z[1]," l ",F[0],sR,z[1]);break;case tR.Z:f.push(" x ")}if(0<n){f.push(i);for(var H=0;H<n;H++){var B=TR[H];e&&ot(B,B,e),f.push(eR(B[0]*uR-cR),sR,eR(B[1]*uR-cR),H<n-1?sR:"")}}}return f.join("")};Pi.prototype.brushVML=function(t){var e=this.style,n=this._vmlEl;n||(n=ab("shape"),fR(n),this._vmlEl=n),CR(n,"fill",e,this),CR(n,"stroke",e,this);var i=this.transform,r=null!=i,o=n.getElementsByTagName("stroke")[0];if(o){var a=e.lineWidth;if(r&&!e.strokeNoScale){var s=i[0]*i[3]-i[1]*i[2];a*=nR(iR(s))}o.weight=a+"px"}var l=this.path||(this.path=new zS);this.__dirtyPath&&(l.beginPath(),this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),n.path=AR(l,this.transform),n.style.zIndex=yR(this.zlevel,this.z,this.z2),mR(t,n),null!=e.text?this.drawRectText(t,this.getBoundingRect()):this.removeRectText(t)},Pi.prototype.onRemove=function(t){vR(t,this._vmlEl),this.removeRectText(t)},Pi.prototype.onAdd=function(t){mR(t,this._vmlEl),this.appendRectText(t)};var DR=function(t){return"object"==typeof t&&t.tagName&&"IMG"===t.tagName.toUpperCase()};an.prototype.brushVML=function(t){var e,n,i=this.style,r=i.image;if(DR(r)){var o=r.src;if(o===this._imageSrc)e=this._imageWidth,n=this._imageHeight;else{var a=r.runtimeStyle,s=a.width,l=a.height;a.width="auto",a.height="auto",e=r.width,n=r.height,a.width=s,a.height=l,this._imageSrc=o,this._imageWidth=e,this._imageHeight=n}r=o}else r===this._imageSrc&&(e=this._imageWidth,n=this._imageHeight);if(r){var u=i.x||0,c=i.y||0,h=i.width,d=i.height,f=i.sWidth,p=i.sHeight,g=i.sx||0,m=i.sy||0,v=f&&p,y=this._vmlEl;y||(y=JN.createElement("div"),fR(y),this._vmlEl=y);var x,b=y.style,w=!1,_=1,S=1;if(this.transform&&(x=this.transform,_=nR(x[0]*x[0]+x[1]*x[1]),S=nR(x[2]*x[2]+x[3]*x[3]),w=x[1]||x[2]),w){var C=[u,c],T=[u+h,c],A=[u,c+d],D=[u+h,c+d];ot(C,C,x),ot(T,T,x),ot(A,A,x),ot(D,D,x);var M=aR(C[0],T[0],A[0],D[0]),I=aR(C[1],T[1],A[1],D[1]),k=[];k.push("M11=",x[0]/_,sR,"M12=",x[2]/S,sR,"M21=",x[1]/_,sR,"M22=",x[3]/S,sR,"Dx=",eR(u*_+x[4]),sR,"Dy=",eR(c*S+x[5])),b.padding="0 "+eR(M)+"px "+eR(I)+"px 0",b.filter=lR+".Matrix("+k.join("")+", SizingMethod=clip)"}else x&&(u=u*_+x[4],c=c*S+x[5]),b.filter="",b.left=eR(u)+"px",b.top=eR(c)+"px";var E=this._imageEl,L=this._cropEl;E||(E=JN.createElement("div"),this._imageEl=E);var O=E.style;if(v){if(e&&n)O.width=eR(_*e*h/f)+"px",O.height=eR(S*n*d/p)+"px";else{var P=new Image,N=this;P.onload=function(){P.onload=null,e=P.width,n=P.height,O.width=eR(_*e*h/f)+"px",O.height=eR(S*n*d/p)+"px",N._imageWidth=e,N._imageHeight=n,N._imageSrc=r},P.src=r}L||((L=JN.createElement("div")).style.overflow="hidden",this._cropEl=L);var R=L.style;R.width=eR((h+g*h/f)*_),R.height=eR((d+m*d/p)*S),R.filter=lR+".Matrix(Dx="+-g*h/f*_+",Dy="+-m*d/p*S+")",L.parentNode||y.appendChild(L),E.parentNode!=L&&L.appendChild(E)}else O.width=eR(_*h)+"px",O.height=eR(S*d)+"px",y.appendChild(E),L&&L.parentNode&&(y.removeChild(L),this._cropEl=null);var F="",z=i.opacity;z<1&&(F+=".Alpha(opacity="+eR(100*z)+") "),F+=lR+".AlphaImageLoader(src="+r+", SizingMethod=scale)",O.filter=F,y.style.zIndex=yR(this.zlevel,this.z,this.z2),mR(t,y),null!=i.text&&this.drawRectText(t,this.getBoundingRect())}},an.prototype.onRemove=function(t){vR(t,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(t)},an.prototype.onAdd=function(t){mR(t,this._vmlEl),this.appendRectText(t)};var MR,IR="normal",kR={},ER=0,LR=100,OR=document.createElement("div"),PR=function(t){var e=kR[t];if(!e){LR<ER&&(ER=0,kR={});var n,i=OR.style;try{i.font=t,n=i.fontFamily.split(",")[0]}catch(uF){}e={style:i.fontStyle||IR,variant:i.fontVariant||IR,weight:i.fontWeight||IR,size:0|parseFloat(i.fontSize||12),family:n||"Microsoft YaHei"},kR[t]=e,ER++}return e};we("measureText",function(t,e){var n=JN;MR||((MR=n.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",JN.body.appendChild(MR));try{MR.style.font=e}catch(i){}return MR.innerHTML="",MR.appendChild(n.createTextNode(t)),{width:MR.offsetWidth}});for(var NR=new ie,RR=function(t,e,n,i){var r=this.style;this.__dirty&&Be(r,!0);var o=r.text;if(null!=o&&(o+=""),o){if(r.rich){var a=Re(o,r);o=[];for(var s=0;s<a.lines.length;s++){for(var l=a.lines[s].tokens,u=[],c=0;c<l.length;c++)u.push(l[c].text);o.push(u.join(""))}o=o.join("\n")}var h,d,f=r.textAlign,p=r.textVerticalAlign,g=PR(r.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';n=n||Se(o,m,f,p);var v=this.transform;if(v&&!i&&(NR.copy(e),NR.applyTransform(v),e=NR),i)h=e.x,d=e.y;else{var y=r.textPosition,x=r.textDistance;if(y instanceof Array)h=e.x+xR(y[0],e.width),d=e.y+xR(y[1],e.height),f=f||"left";else{var b=Me(y,e,x);h=b.x,d=b.y,f=f||b.textAlign,p=p||b.textVerticalAlign}}h=Ae(h,n.width,f),d=De(d,n.height,p),d+=n.height/2;var w,_,S,C=ab,T=this._textVmlEl;T?_=(w=(S=T.firstChild).nextSibling).nextSibling:(T=C("line"),w=C("path"),_=C("textpath"),S=C("skew"),_.style["v-text-align"]="left",fR(T),w.textpathok=!0,_.on=!0,T.from="0 0",T.to="1000 0.05",mR(T,S),mR(T,w),mR(T,_),this._textVmlEl=T);var A=[h,d],D=T.style;v&&i?(ot(A,A,v),S.on=!0,S.matrix=v[0].toFixed(3)+sR+v[2].toFixed(3)+sR+v[1].toFixed(3)+sR+v[3].toFixed(3)+",0,0",S.offset=(eR(A[0])||0)+","+(eR(A[1])||0),S.origin="0 0",D.left="0px",D.top="0px"):(S.on=!1,D.left=eR(h)+"px",D.top=eR(d)+"px"),_.string=pR(o);try{_.style.font=m}catch(uF){}CR(T,"fill",{fill:r.textFill,opacity:r.opacity},this),CR(T,"stroke",{stroke:r.textStroke,opacity:r.opacity,lineDash:r.lineDash},this),T.style.zIndex=yR(this.zlevel,this.z,this.z2),mR(t,T)}},FR=function(t){vR(t,this._textVmlEl),this._textVmlEl=null},zR=function(t){mR(t,this._textVmlEl)},HR=[b_,on,an,Pi,lC],BR=0;BR<HR.length;BR++){var VR=HR[BR].prototype;VR.drawRectText=RR,VR.removeRectText=FR,VR.appendRectText=zR}lC.prototype.brushVML=function(t){var e=this.style;null!=e.text?this.drawRectText(t,{x:e.x||0,y:e.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(t)},lC.prototype.onRemove=function(t){this.removeRectText(t)},lC.prototype.onAdd=function(t){this.appendRectText(t)}}ub.prototype={constructor:ub,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0,!0);this._paintList(t)},_paintList:function(t){for(var e=this._vmlRoot,n=0;n<t.length;n++){var i=t[n];i.invisible||i.ignore?(i.__alreadyNotVisible||i.onRemove(e),i.__alreadyNotVisible=!0):(i.__alreadyNotVisible&&i.onAdd(e),i.__alreadyNotVisible=!1,i.__dirty&&(i.beforeBrush&&i.beforeBrush(),(i.brushVML||i.brush).call(i,e),i.afterBrush&&i.afterBrush())),i.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(e),this._firstPaint=!1)},resize:function(t,e){t=null==t?this._getWidth():t,e=null==e?this._getHeight():e;if(this._width!=t||this._height!=e){this._width=t,this._height=e;var n=this._vmlViewport.style;n.width=t+"px",n.height=e+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var t=this.root,e=t.currentStyle;return(t.clientWidth||lb(e.width))-lb(e.paddingLeft)-lb(e.paddingRight)|0},_getHeight:function(){var t=this.root,e=t.currentStyle;return(t.clientHeight||lb(e.height))-lb(e.paddingTop)-lb(e.paddingBottom)|0}},k(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){ub.prototype[t]=cb(t)}),En("vml",ub);var jR="http://www.w3.org/2000/svg",WR=zS.CMD,UR=Array.prototype.join,$R="none",qR=Math.round,GR=Math.sin,YR=Math.cos,ZR=Math.PI,XR=2*Math.PI,KR=180/ZR,QR=1e-4,JR={brush:function(t){var e=t.style,n=t.__svgEl;n||(n=hb("path"),t.__svgEl=n),t.path||t.createPathProxy();var i=t.path;if(t.__dirtyPath){i.beginPath(),t.buildPath(i,t.shape),t.__dirtyPath=!1;var r=bb(i);r.indexOf("NaN")<0&&vb(n,"d",r)}xb(n,e),mb(n,t.transform),null!=e.text&&iF(t,t.getBoundingRect())}},tF={brush:function(t){var e=t.style,n=e.image;n instanceof HTMLImageElement&&(n=n.src);if(n){var i=e.x||0,r=e.y||0,o=e.width,a=e.height,s=t.__svgEl;s||(s=hb("image"),t.__svgEl=s),n!==t.__imageSrc&&(yb(s,"href",n),t.__imageSrc=n),vb(s,"width",o),vb(s,"height",a),vb(s,"x",i),vb(s,"y",r),mb(s,t.transform),null!=e.text&&iF(t,t.getBoundingRect())}}},eF={},nF=new ie,iF=function(t,e,n){var i=t.style;t.__dirty&&Be(i,!0);var r=i.text;if(null!=r){r+="";var o,a,s=t.__textSvgEl;s||(s=hb("text"),t.__textSvgEl=s);var l=i.textPosition,u=i.textDistance,c=i.textAlign||"left";"number"==typeof i.fontSize&&(i.fontSize+="px");var h=i.font||[i.fontStyle||"",i.fontWeight||"",i.fontSize||"",i.fontFamily||""].join(" ")||g_,d=wb(i.textVerticalAlign),f=(n=Se(r,h,c,d)).lineHeight;if(l instanceof Array)o=e.x+l[0],a=e.y+l[1];else{var p=Me(l,e,u);o=p.x,a=p.y,d=wb(p.textVerticalAlign),c=p.textAlign}vb(s,"alignment-baseline",d),h&&(s.style.font=h);var g=i.textPadding;if(vb(s,"x",o),vb(s,"y",a),xb(s,i,!0),t instanceof lC||t.style.transformText)mb(s,t.transform);else{if(t.transform)nF.copy(e),nF.applyTransform(t.transform),e=nF;else{var m=t.transformCoordToGlobal(e.x,e.y);e.x=m[0],e.y=m[1]}var v=i.textOrigin;"center"===v?(o=n.width/2+o,a=n.height/2+a):v&&(o=v[0]+o,a=v[1]+a);var y=-i.textRotation||0,x=ft();yt(x,t.transform,y),mb(s,x)}var b=r.split("\n"),w=b.length,_=c;"left"===_?(_="start",g&&(o+=g[3])):"right"===_?(_="end",g&&(o-=g[1])):"center"===_&&(_="middle",g&&(o+=(g[3]-g[1])/2));var S=0;if("baseline"===d?(S=-n.height+f,g&&(S-=g[2])):"middle"===d?(S=(-n.height+f)/2,g&&(a+=(g[0]-g[2])/2)):g&&(S+=g[0]),t.__text!==r||t.__textFont!==h){var C=t.__tspanList||[];t.__tspanList=C;for(var T=0;T<w;T++){(D=C[T])?D.innerHTML="":(D=C[T]=hb("tspan"),s.appendChild(D),vb(D,"alignment-baseline",d),vb(D,"text-anchor",_)),vb(D,"x",o),vb(D,"y",a+T*f+S),D.appendChild(document.createTextNode(b[T]))}for(;T<C.length;T++)s.removeChild(C[T]);C.length=w,t.__text=r,t.__textFont=h}else if(t.__tspanList.length){var A=t.__tspanList.length;for(T=0;T<A;++T){var D;(D=t.__tspanList[T])&&(vb(D,"x",o),vb(D,"y",a+T*f+S))}}}};eF.drawRectText=iF,eF.brush=function(t){var e=t.style;null!=e.text&&(e.textPosition=[0,0],iF(t,{x:e.x||0,y:e.y||0,width:0,height:0},t.getBoundingRect()))},_b.prototype={diff:function(s,l,t){function e(){for(var t=-1*d;t<=d;t+=2){var e,n=f[t-1],i=f[t+1],r=(i?i.newPos:0)-t;n&&(f[t-1]=undefined);var o=n&&n.newPos+1<c,a=i&&0<=r&&r<h;if(o||a){if(!o||a&&n.newPos<i.newPos?(e=Cb(i),u.pushComponent(e.components,undefined,!0)):((e=n).newPos++,u.pushComponent(e.components,!0,undefined)),r=u.extractCommon(e,l,s,t),e.newPos+1>=c&&h<=r+1)return Sb(u,e.components,l,s);f[t]=e}else f[t]=undefined}d++}t||(t=function(t,e){return t===e}),this.equals=t;var u=this;s=s.slice();var c=(l=l.slice()).length,h=s.length,d=1,n=c+h,f=[{newPos:-1,components:[]}],i=this.extractCommon(f[0],l,s,0);if(f[0].newPos+1>=c&&h<=i+1){for(var r=[],o=0;o<l.length;o++)r.push(o);return[{indices:r,count:l.length}]}for(;d<=n;){var a=e();if(a)return a}},pushComponent:function(t,e,n){var i=t[t.length-1];i&&i.added===e&&i.removed===n?t[t.length-1]={count:i.count+1,added:e,removed:n}:t.push({count:1,added:e,removed:n})},extractCommon:function(t,e,n,i){for(var r=e.length,o=n.length,a=t.newPos,s=a-i,l=0;a+1<r&&s+1<o&&this.equals(e[a+1],n[s+1]);)a++,s++,l++;return l&&t.components.push({count:l}),t.newPos=a,s},tokenize:function(t){return t.slice()},join:function(t){return t.slice()}};var rF=new _b,oF=function(t,e,n){return rF.diff(t,e,n)},aF="0",sF="1";Tb.prototype.createElement=hb,Tb.prototype.getDefs=function(t){var e=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?t?((i=e.insertBefore(this.createElement("defs"),e.firstChild)).contains||(i.contains=function(t){var e=i.children;if(!e)return!1;for(var n=e.length-1;0<=n;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},Tb.prototype.update=function(t,e){if(t){var n=this.getDefs(!1);if(t[this._domName]&&n.contains(t[this._domName]))"function"==typeof e&&e(t);else{var i=this.add(t);i&&(t[this._domName]=i)}}},Tb.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},Tb.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},Tb.prototype.getDoms=function(){var n=this.getDefs(!1);if(!n)return[];var i=[];return k(this._tagNames,function(t){var e=n.getElementsByTagName(t);i=i.concat([].slice.call(e))}),i},Tb.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;k(t,function(t){t[e._markLabel]=aF})},Tb.prototype.markUsed=function(t){t&&(t[this._markLabel]=sF)},Tb.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),n=this;k(t,function(t){t[n._markLabel]!==sF&&e.removeChild(t)})}},Tb.prototype.getSvgProxy=function(t){return t instanceof Pi?JR:t instanceof an?tF:t instanceof lC?eF:JR},Tb.prototype.getTextSvgElement=function(t){return t.__textSvgEl},Tb.prototype.getSvgElement=function(t){return t.__svgEl},o(Ab,Tb),Ab.prototype.addWithoutUpdate=function(o,a){if(a&&a.style){var s=this;k(["fill","stroke"],function(t){if(a.style[t]&&("linear"===a.style[t].type||"radial"===a.style[t].type)){var e,n=a.style[t],i=s.getDefs(!0);n._dom?(e=n._dom,i.contains(n._dom)||s.addDom(e)):e=s.add(n),s.markUsed(a);var r=e.getAttribute("id");o.setAttribute(t,"url(#"+r+")")}})}},Ab.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return Bw("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},Ab.prototype.update=function(n){var i=this;Tb.prototype.update.call(this,n,function(){var t=n.type,e=n._dom.tagName;"linear"===t&&"linearGradient"===e||"radial"===t&&"radialGradient"===e?i.updateDom(n,n._dom):(i.removeDom(n),i.add(n))})},Ab.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void Bw("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var n=t.colorStops,i=0,r=n.length;i<r;++i){var o=this.createElement("stop");o.setAttribute("offset",100*n[i].offset+"%"),o.setAttribute("stop-color",n[i].color),e.appendChild(o)}t._dom=e},Ab.prototype.markUsed=function(t){if(t.style){var e=t.style.fill;e&&e._dom&&Tb.prototype.markUsed.call(this,e._dom),(e=t.style.stroke)&&e._dom&&Tb.prototype.markUsed.call(this,e._dom)}},o(Db,Tb),Db.prototype.update=function(t){var e=this.getSvgElement(t);e&&this.updateDom(e,t.__clipPaths,!1);var n=this.getTextSvgElement(t);n&&this.updateDom(n,t.__clipPaths,!0),this.markUsed(t)},Db.prototype.updateDom=function(t,e,n){if(e&&0<e.length){var i,r,o=this.getDefs(!0),a=e[0],s=n?"_textDom":"_dom";a[s]?(r=a[s].getAttribute("id"),i=a[s],o.contains(i)||o.appendChild(i)):(r="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(i=this.createElement("clipPath")).setAttribute("id",r),o.appendChild(i),a[s]=i);var l=this.getSvgProxy(a);if(a.transform&&a.parent.invTransform&&!n){var u=Array.prototype.slice.call(a.transform);mt(a.transform,a.parent.invTransform,a.transform),l.brush(a),a.transform=u}else l.brush(a);var c=this.getSvgElement(a);i.innerHTML="",i.appendChild(c.cloneNode()),t.setAttribute("clip-path","url(#"+r+")"),1<e.length&&this.updateDom(i,e.slice(1),n)}else t&&t.setAttribute("clip-path","none")},Db.prototype.markUsed=function(t){var e=this;t.__clipPaths&&0<t.__clipPaths.length&&k(t.__clipPaths,function(t){t._dom&&Tb.prototype.markUsed.call(e,t._dom),t._textDom&&Tb.prototype.markUsed.call(e,t._textDom)})},o(Mb,Tb),Mb.prototype.addWithoutUpdate=function(t,e){if(e&&Ib(e.style)){var n,i=e.style;if(i._shadowDom)n=i._shadowDom,this.getDefs(!0).contains(i._shadowDom)||this.addDom(n);else n=this.add(e);this.markUsed(e);var r=n.getAttribute("id");t.style.filter="url(#"+r+")"}},Mb.prototype.add=function(t){var e=this.createElement("filter"),n=t.style;return n._shadowDomId=n._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+n._shadowDomId),this.updateDom(t,e),this.addDom(e),e},Mb.prototype.update=function(t,e){var n=e.style;if(Ib(n)){var i=this;Tb.prototype.update.call(this,e,function(t){i.updateDom(e,t._shadowDom)})}else this.remove(t,n)},Mb.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},Mb.prototype.updateDom=function(t,e){var n=e.getElementsByTagName("feDropShadow");n=0===n.length?this.createElement("feDropShadow"):n[0];var i,r,o,a,s=t.style,l=t.scale&&t.scale[0]||1,u=t.scale&&t.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)i=s.shadowOffsetX||0,r=s.shadowOffsetY||0,o=s.shadowBlur,a=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);i=s.textShadowOffsetX||0,r=s.textShadowOffsetY||0,o=s.textShadowBlur,a=s.textShadowColor}n.setAttribute("dx",i/l),n.setAttribute("dy",r/u),n.setAttribute("flood-color",a);var c=o/2/l+" "+o/2/u;n.setAttribute("stdDeviation",c),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(o/2*200)+"%"),e.setAttribute("height",Math.ceil(o/2*200)+"%"),e.appendChild(n),s._shadowDom=e},Mb.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&Tb.prototype.markUsed.call(this,e._shadowDom)};var lF=function(t,e,n,i){this.root=t,this.storage=e,this._opts=n=O({},n||{});var r=hb("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new Ab(i,r),this.clipPathManager=new Db(i,r),this.shadowManager=new Mb(i,r);var o=document.createElement("div");o.style.cssText="overflow:hidden;position:relative",this._svgRoot=r,this._viewport=o,t.appendChild(o),o.appendChild(r),this.resize(n.width,n.height),this._visibleList=[]};lF.prototype={constructor:lF,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,n=this._svgRoot,i=this._visibleList,r=t.length,o=[];for(e=0;e<r;e++){var a=Eb(f=t[e]),s=Fb(f)||Rb(f);f.invisible||(f.__dirty&&(a&&a.brush(f),this.clipPathManager.update(f),f.style&&(this.gradientManager.update(f.style.fill),this.gradientManager.update(f.style.stroke),this.shadowManager.update(s,f)),f.__dirty=!1),o.push(f))}var l,u=oF(i,o);for(e=0;e<u.length;e++){if((d=u[e]).removed)for(var c=0;c<d.count;c++){s=Fb(f=i[d.indices[c]]);var h=Rb(f);Nb(n,s),Nb(n,h)}}for(e=0;e<u.length;e++){var d;if((d=u[e]).added)for(c=0;c<d.count;c++){s=Fb(f=o[d.indices[c]]),h=Rb(f);l?Ob(n,s,l):Pb(n,s),s?Ob(n,h,s):l?Ob(n,h,l):Pb(n,h),Ob(n,h,s),l=h||s||l,this.gradientManager.addWithoutUpdate(s,f),this.shadowManager.addWithoutUpdate(l,f),this.clipPathManager.markUsed(f)}else if(!d.removed)for(c=0;c<d.count;c++){var f;l=s=Rb(f=o[d.indices[c]])||Fb(f)||l,this.gradientManager.markUsed(f),this.gradientManager.addWithoutUpdate(s,f),this.shadowManager.markUsed(f),this.shadowManager.addWithoutUpdate(s,f),this.clipPathManager.markUsed(f)}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=o},_getDefs:function(t){var i,e=this._svgRoot;return 0!==(i=this._svgRoot.getElementsByTagName("defs")).length?i[0]:t?((i=e.insertBefore(hb("defs"),e.firstChild)).contains||(i.contains=function(t){var e=i.children;if(!e)return!1;for(var n=e.length-1;0<=n;--n)if(e[n]===t)return!0;return!1}),i):null},resize:function(t,e){var n=this._viewport;n.style.display="none";var i=this._opts;if(null!=t&&(i.width=t),null!=e&&(i.height=e),t=this._getSize(0),
|
|
e=this._getSize(1),n.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var r=n.style;r.width=t+"px",r.height=e+"px";var o=this._svgRoot;o.setAttribute("width",t),o.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,n=["width","height"][t],i=["clientWidth","clientHeight"][t],r=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[n]&&"auto"!==e[n])return parseFloat(e[n]);var a=this.root,s=document.defaultView.getComputedStyle(a);return(a[i]||kb(s[n])||kb(a.style[n]))-(kb(s[r])||0)-(kb(s[o])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},k(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){lF.prototype[t]=zb(t)}),En("svg",lF),t.version=TA,t.dependencies=AA,t.PRIORITY=OA,t.init=Ss,t.connect=Cs,t.disConnect=Ts,t.disconnect=tD,t.dispose=As,t.getInstanceByDom=Ds,t.getInstanceById=Ms,t.registerTheme=Is,t.registerPreprocessor=ks,t.registerProcessor=Es,t.registerPostUpdate=Ls,t.registerAction=Os,t.registerCoordinateSystem=Ps,t.getCoordinateSystemDimensions=Ns,t.registerLayout=Rs,t.registerVisual=Fs,t.registerLoading=Hs,t.extendComponentModel=Bs,t.extendComponentView=Vs,t.extendSeriesModel=js,t.extendChartView=Ws,t.setCanvasCreator=Us,t.registerMap=$s,t.getMap=qs,t.dataTool=eD,t.zrender=q_,t.graphic=OC,t.number=UC,t.format=QC,t.throttle=Fa,t.helper=JD,t.matrix=mw,t.vector=uw,t.color=Ow,t.parseGeoJSON=eM,t.parseGeoJson=oM,t.util=aM,t.List=hD,t.Model=Or,t.Axis=rM,t.env=Ub}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.CodeMirror=e()}(this,function(){"use strict";function s(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function p(t){for(var e=t.childNodes.length;0<e;--e)t.removeChild(t.firstChild);return t}function o(t,e){return p(t).appendChild(e)}function w(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)r.appendChild(e[o]);return r}function h(t,e,n,i){var r=w(t,e,n,i);return r.setAttribute("role","presentation"),r}function m(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function d(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function i(t,e){var n=t.className;s(e).test(n)||(t.className+=(n?" ":"")+e)}function l(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!s(n[i]).test(e)&&(e+=" "+n[i]);return e}function u(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function f(t,e,n){for(var i in e||(e={}),t)!t.hasOwnProperty(i)||!1===n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e}function C(t,e,n,i,r){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=i||0,a=r||0;;){var s=t.indexOf("\t",o);if(s<0||e<=s)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}function g(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}function T(t,e,n){for(var i=0,r=0;;){var o=t.indexOf("\t",i);-1==o&&(o=t.length);var a=o-i;if(o==t.length||e<=r+a)return i+Math.min(a,e-r);if(r+=o-i,i=o+1,e<=(r+=n-r%n))return i}}function _(t){for(;Qa.length<=t;)Qa.push(W(Qa)+" ");return Qa[t]}function W(t){return t[t.length-1]}function v(t,e){for(var n=[],i=0;i<t.length;i++)n[i]=e(t[i],i);return n}function a(t,e,n){for(var i=0,r=n(e);i<t.length&&n(t[i])<=r;)i++;t.splice(i,0,e)}function r(){}function n(t,e){var n;return Object.create?n=Object.create(t):(r.prototype=t,n=new r),e&&f(e,n),n}function c(t){return/\w/.test(t)||"\x80"<t&&(t.toUpperCase()!=t.toLowerCase()||Ja.test(t))}function y(t,e){return e?!!(-1<e.source.indexOf("\\w")&&c(t))||e.test(t):c(t)}function x(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function S(t){return 768<=t.charCodeAt(0)&&ts.test(t)}function A(t,e,n){for(;(n<0?0<e:e<t.length)&&S(t.charAt(e));)e+=n;return e}function D(t,e,n){for(var i=n<e?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function k(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,o=0;o<t.length;++o){var a=t[o];(a.from<n&&a.to>e||e==n&&a.to==e)&&(i(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}function b(t,e,n){var i;es=null;for(var r=0;r<t.length;++r){var o=t[r];if(o.from<e&&o.to>e)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:es=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:es=r)}return null!=i?i:es}function E(t,e){var n=t.order;return null==n&&(n=t.order=ns(t.text,e)),n}function M(t,e){return t._handlers&&t._handlers[e]||is}function I(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var o=g(r,n);-1<o&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function L(t,e){var n=M(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function O(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),L(t,n||e.type,t,e),F(e)||e.codemirrorIgnore}function P(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),i=0;i<e.length;++i)-1==g(n,e[i])&&n.push(e[i])}function N(t,e){return 0<M(t,e).length}function t(t){t.prototype.on=function(t,e){rs(this,t,e)},t.prototype.off=function(t,e){I(this,t,e)}}function R(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function e(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function F(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function z(t){R(t),e(t)}function H(t){return t.target||t.srcElement}function B(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),Pa&&t.ctrlKey&&1==e&&(e=3),e}function V(t){if(null==Ua){var e=w("span","\u200b");o(t,w("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Ua=e.offsetWidth<=1&&2<e.offsetHeight&&!(_a&&Sa<8))}var n=Ua?w("span","\u200b"):w("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function j(t){if(null!=$a)return $a;var e=o(t,document.createTextNode("A\u062eA")),n=za(e,0,1).getBoundingClientRect(),i=za(e,1,2).getBoundingClientRect();return p(t),!(!n||n.left==n.right)&&($a=i.right-n.right<3)}function U(t){if(null!=us)return us;var e=o(t,w("span","x")),n=e.getBoundingClientRect(),i=za(e,0,1).getBoundingClientRect();return us=1<Math.abs(n.left-i.left)}function $(t,e){2<arguments.length&&(e.dependencies=Array.prototype.slice.call(arguments,2)),cs[t]=e}function q(t,e){hs[t]=e}function G(t){if("string"==typeof t&&hs.hasOwnProperty(t))t=hs[t];else if(t&&"string"==typeof t.name&&hs.hasOwnProperty(t.name)){var e=hs[t.name];"string"==typeof e&&(e={name:e}),(t=n(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return G("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return G("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Y(t,e){e=G(e);var n=cs[e.name];if(!n)return Y(t,"text/plain");var i=n(t,e);if(ds.hasOwnProperty(e.name)){var r=ds[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)i[a]=e.modeProps[a];return i}function Z(t,e){f(e,ds.hasOwnProperty(t)?ds[t]:ds[t]={})}function X(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function K(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Q(t,e,n){return!t.startState||t.startState(e,n)}function J(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e<o){n=r;break}e-=o}return n.lines[e]}function tt(t,n,i){var r=[],o=n.line;return t.iter(n.line,i.line+1,function(t){var e=t.text;o==i.line&&(e=e.slice(0,i.ch)),o==n.line&&(e=e.slice(n.ch)),r.push(e),++o}),r}function et(t,e,n){var i=[];return t.iter(e,n,function(t){i.push(t.text)}),i}function nt(t,e){var n=e-t.height;if(n)for(var i=t;i;i=i.parent)i.height+=n}function it(t){if(null==t.parent)return null;for(var e=t.parent,n=g(e.lines,t),i=e.parent;i;i=(e=i).parent)for(var r=0;i.children[r]!=e;++r)n+=i.children[r].chunkSize();return n+e.first}function rt(t,e){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var r=t.children[i],o=r.height;if(e<o){t=r;continue t}e-=o,n+=r.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return n+a}function ot(t,e){return e>=t.first&&e<t.first+t.size}function at(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function st(t,e,n){if(void 0===n&&(n=null),!(this instanceof st))return new st(t,e,n);this.line=t,this.ch=e,this.sticky=n}function lt(t,e){return t.line-e.line||t.ch-e.ch}function ut(t,e){return t.sticky==e.sticky&&0==lt(t,e)}function ct(t){return st(t.line,t.ch)}function ht(t,e){return lt(t,e)<0?e:t}function dt(t,e){return lt(t,e)<0?t:e}function ft(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function pt(t,e){if(e.line<t.first)return st(t.first,0);var n=t.first+t.size-1;return e.line>n?st(n,J(t,n).text.length):gt(e,J(t,e.line).text.length)}function gt(t,e){var n=t.ch;return null==n||e<n?st(t.line,e):n<0?st(t.line,0):t}function mt(t,e){for(var n=[],i=0;i<e.length;i++)n[i]=pt(t,e[i]);return n}function vt(e,n,i,t){var l=[e.state.modeGen],r={};Tt(e,n.text,e.doc.mode,i,function(t,e){return l.push(t,e)},r,t);for(var u=i.state,o=function(t){i.baseTokens=l;var o=e.state.overlays[t],a=1,s=0;i.state=!0,Tt(e,n.text,o.mode,i,function(t,e){for(var n=a;s<t;){var i=l[a];t<i&&l.splice(a,1,t,l[a+1],i),a+=2,s=Math.min(t,i)}if(e)if(o.opaque)l.splice(n,a-n,t,"overlay "+e),a=n+2;else for(;n<a;n+=2){var r=l[n+1];l[n+1]=(r?r+" ":"")+"overlay "+e}},r),i.state=u,i.baseTokens=null,i.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)o(a);return{styles:l,classes:r.bgClass||r.textClass?r:null}}function yt(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var i=xt(t,it(e)),r=e.text.length>t.options.maxHighlightLength&&X(t.doc.mode,i.state),o=vt(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function xt(n,i,t){var e=n.doc,r=n.display;if(!e.mode.startState)return new gs(e,!0,i);var o=At(n,i,t),a=o>e.first&&J(e,o-1).stateAfter,s=a?gs.fromSaved(e,a,o):new gs(e,Q(e.mode),o);return e.iter(o,i,function(t){bt(n,t.text,s);var e=s.line;t.stateAfter=e==i-1||e%5==0||e>=r.viewFrom&&e<r.viewTo?s.save():null,s.nextLine()}),t&&(e.modeFrontier=s.line),s}function bt(t,e,n,i){var r=t.doc.mode,o=new fs(e,t.options.tabSize,n);for(o.start=o.pos=i||0,""==e&&wt(r,n.state);!o.eol();)_t(r,o,n.state),o.start=o.pos}function wt(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=K(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function _t(t,e,n,i){for(var r=0;r<10;r++){i&&(i[0]=K(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}function St(t,e,n,i){var r,o,a=t.doc,s=a.mode,l=J(a,(e=pt(a,e)).line),u=xt(t,e.line,n),c=new fs(l.text,t.options.tabSize,u);for(i&&(o=[]);(i||c.pos<e.ch)&&!c.eol();)c.start=c.pos,r=_t(s,c,u.state),i&&o.push(new ms(c,r,X(a.mode,u.state)));return i?o:new ms(c,r,u.state)}function Ct(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==e[i]?e[i]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[i])||(e[i]+=" "+n[2])}return t}function Tt(t,e,n,i,r,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,u=0,c=null,h=new fs(e,t.options.tabSize,i),d=t.options.addModeClass&&[null];for(""==e&&Ct(wt(n,i.state),o);!h.eol();){if(h.pos>t.options.maxHighlightLength?(s=!1,a&&bt(t,e,i,h.pos),h.pos=e.length,l=null):l=Ct(_t(n,h,i.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;u<h.start;)r(u=Math.min(h.start,u+5e3),c);c=l}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);r(p,c),u=p}}function At(t,e,n){for(var i,r,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;a<s;--s){if(s<=o.first)return o.first;var l=J(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ps?u.lookAhead:0)<=o.modeFrontier))return s;var c=C(l.text,null,t.options.tabSize);(null==r||c<i)&&(r=s-1,i=c)}return r}function Dt(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,i=e-1;n<i;i--){var r=J(t,i).stateAfter;if(r&&(!(r instanceof ps)||i+r.lookAhead<e)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}function Mt(){vs=!0}function It(){ys=!0}function kt(t,e,n){this.marker=t,this.from=e,this.to=n}function Et(t,e){if(t)for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==e)return i}}function Lt(t,e){for(var n,i=0;i<t.length;++i)t[i]!=e&&(n||(n=[])).push(t[i]);return n}function Ot(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}function Pt(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new kt(a,o.from,s?null:o.to))}}return i}function Nt(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new kt(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return i}function Rt(t,e){if(e.full)return null;var n=ot(t,e.from.line)&&J(t,e.from.line).markedSpans,i=ot(t,e.to.line)&&J(t,e.to.line).markedSpans;if(!n&&!i)return null;var r=e.from.ch,o=e.to.ch,a=0==lt(e.from,e.to),s=Pt(n,r,a),l=Nt(i,o,a),u=1==e.text.length,c=W(e.text).length+(u?r:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var f=Et(l,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=r}}if(l)for(var p=0;p<l.length;++p){var g=l[p];if(null!=g.to&&(g.to+=c),null==g.from)Et(s,g.marker)||(g.from=c,u&&(s||(s=[])).push(g));else g.from+=c,u&&(s||(s=[])).push(g)}s&&(s=Ft(s)),l&&l!=s&&(l=Ft(l));var m=[s];if(!u){var v,y=e.text.length-2;if(0<y&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(v||(v=[])).push(new kt(s[x].marker,null,null));for(var b=0;b<y;++b)m.push(v);m.push(l)}return m}function Ft(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function zt(t,e,n){var i=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||i&&-1!=g(i,n)||(i||(i=[])).push(n)}}),!i)return null;for(var r=[{from:e,to:n}],o=0;o<i.length;++o)for(var a=i[o],s=a.find(0),l=0;l<r.length;++l){var u=r[l];if(!(lt(u.to,s.from)<0||0<lt(u.from,s.to))){var c=[l,1],h=lt(u.from,s.from),d=lt(u.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(0<d||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}function Ht(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Bt(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Vt(t){return t.inclusiveLeft?-1:0}function jt(t){return t.inclusiveRight?1:0}function Wt(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var i=t.find(),r=e.find(),o=lt(i.from,r.from)||Vt(t)-Vt(e);if(o)return-o;var a=lt(i.to,r.to)||jt(t)-jt(e);return a||e.id-t.id}function Ut(t,e){var n,i=ys&&t.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(e?r.from:r.to)&&(!n||Wt(n,r.marker)<0)&&(n=r.marker);return n}function $t(t){return Ut(t,!0)}function qt(t){return Ut(t,!1)}function Gt(t,e){var n,i=ys&&t.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||Wt(n,o.marker)<0)&&(n=o.marker)}return n}function Yt(t,e,n,i,r){var o=J(t,e),a=ys&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=lt(u.from,n)||Vt(l.marker)-Vt(r),h=lt(u.to,i)||jt(l.marker)-jt(r);if(!(0<=c&&h<=0||c<=0&&0<=h)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?0<=lt(u.to,n):0<lt(u.to,n))||0<=c&&(l.marker.inclusiveRight&&r.inclusiveLeft?lt(u.from,i)<=0:lt(u.from,i)<0)))return!0}}}function Zt(t){for(var e;e=$t(t);)t=e.find(-1,!0).line;return t}function Xt(t){for(var e;e=qt(t);)t=e.find(1,!0).line;return t}function Kt(t){for(var e,n;e=qt(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function Qt(t,e){var n=J(t,e),i=Zt(n);return n==i?e:it(i)}function Jt(t,e){if(e>t.lastLine())return e;var n,i=J(t,e);if(!te(t,i))return e;for(;n=qt(i);)i=n.find(1,!0).line;return it(i)+1}function te(t,e){var n=ys&&e.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&ee(t,e,i))return!0}}function ee(t,e,n){if(null==n.to){var i=n.marker.find(1,!0);return ee(t,i.line,Et(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var r=void 0,o=0;o<e.markedSpans.length;++o)if((r=e.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&ee(t,e,r))return!0}function ne(t){for(var e=0,n=(t=Zt(t)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==t)break;e+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;e+=s.height}return e}function ie(t){if(0==t.height)return 0;for(var e,n=t.text.length,i=t;e=$t(i);){var r=e.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=t;e=qt(i);){var o=e.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function re(t){var n=t.display,e=t.doc;n.maxLine=J(e,e.first),n.maxLineLength=ie(n.maxLine),n.maxLineChanged=!0,e.iter(function(t){var e=ie(t);e>n.maxLineLength&&(n.maxLineLength=e,n.maxLine=t)})}function oe(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ht(t),Bt(t,n);var r=i?i(t):1;r!=t.height&&nt(t,r)}function ae(t){t.parent=null,Ht(t)}function se(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?_s:ws;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function le(t,e){var n=h("span",null,null,Ca?"padding-right: .1px":null),i={pre:h("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,a=void 0;i.pos=0,i.addToken=ce,j(t.display.measure)&&(a=E(o,t.doc.direction))&&(i.addToken=de(i.addToken,a)),i.map=[],pe(o,i,yt(t,o,e!=t.display.externalMeasured&&it(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=l(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=l(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(V(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(Ca){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return L(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=l(i.pre.className,i.textClass||"")),i}function ue(t){var e=w("span","\u2022","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function ce(t,e,n,i,r,o,a){if(e){var s,l=t.splitSpaces?he(e,t.trailingSpace):e,u=t.cm.state.specialChars,c=!1;if(u.test(e)){s=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var d=u.exec(e),f=d?d.index-h:e.length-h;if(f){var p=document.createTextNode(l.slice(h,h+f));_a&&Sa<9?s.appendChild(w("span",[p])):s.appendChild(p),t.map.push(t.pos,t.pos+f,p),t.col+=f,t.pos+=f}if(!d)break;h+=f+1;var g=void 0;if("\t"==d[0]){var m=t.cm.options.tabSize,v=m-t.col%m;(g=s.appendChild(w("span",_(v),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),t.col+=v}else"\r"==d[0]||"\n"==d[0]?(g=s.appendChild(w("span","\r"==d[0]?"\u240d":"\u2424","cm-invalidchar"))).setAttribute("cm-text",d[0]):((g=t.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),_a&&Sa<9?s.appendChild(w("span",[g])):s.appendChild(g)),t.col+=1;t.map.push(t.pos,t.pos+1,g),t.pos++}}else t.col+=e.length,s=document.createTextNode(l),t.map.push(t.pos,t.pos+e.length,s),_a&&Sa<9&&(c=!0),t.pos+=e.length;if(t.trailingSpace=32==l.charCodeAt(e.length-1),n||i||r||c||o){var y=n||"";i&&(y+=i),r&&(y+=r);var x=w("span",[s],y,o);if(a)for(var b in a)a.hasOwnProperty(b)&&"style"!=b&&"class"!=b&&x.setAttribute(b,a[b]);return t.content.appendChild(x)}t.content.appendChild(s)}}function he(t,e){if(1<t.length&&!/ /.test(t))return t;for(var n=e,i="",r=0;r<t.length;r++){var o=t.charAt(r);" "!=o||!n||r!=t.length-1&&32!=t.charCodeAt(r+1)||(o="\xa0"),i+=o,n=" "==o}return i}function de(h,d){return function(t,e,n,i,r,o,a){n=n?n+" cm-force-border":"cm-force-border";for(var s=t.pos,l=s+e.length;;){for(var u=void 0,c=0;c<d.length&&!((u=d[c]).to>s&&u.from<=s);c++);if(u.to>=l)return h(t,e,n,i,r,o,a);h(t,e.slice(0,u.to-s),n,i,null,o,a),i=null,e=e.slice(u.to-s),s=u.to}}}function fe(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function pe(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var a,s,l,u,c,h,d,f=r.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=s="",h=d=null,v=Infinity;for(var y=[],x=void 0,b=0;b<i.length;++b){var w=i[b],_=w.marker;if("bookmark"==_.type&&w.from==p&&_.widgetNode)y.push(_);else if(w.from<=p&&(null==w.to||w.to>p||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(c+=" "+_.startStyle),_.endStyle&&w.to==v&&(x||(x=[])).push(_.endStyle,w.to),_.title&&((d||(d={})).title=_.title),_.attributes)for(var S in _.attributes)(d||(d={}))[S]=_.attributes[S];_.collapsed&&(!h||Wt(h.marker,_)<0)&&(h=w)}else w.from>p&&v>w.from&&(v=w.from)}if(x)for(var C=0;C<x.length;C+=2)x[C+1]==v&&(u+=" "+x[C]);if(!h||h.from==p)for(var T=0;T<y.length;++T)fe(e,0,y[T]);if(h&&(h.from||0)==p){if(fe(e,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(f<=p)break;for(var A=Math.min(f,v);;){if(m){var D=p+m.length;if(!h){var M=A<D?m.slice(0,A-p):m;e.addToken(e,M,a?a+l:l,c,p+M.length==v?u:"",s,d)}if(A<=D){m=m.slice(A-p),p=A;break}p=D,c=""}m=r.slice(o,o=n[g++]),a=se(n[g++],e.cm.options)}}else for(var I=1;I<n.length;I+=2)e.addToken(e,r.slice(o,o=n[I]),se(n[I+1],e.cm.options))}function ge(t,e,n){this.line=e,this.rest=Kt(e),this.size=this.rest?it(W(this.rest))-n+1:1,this.node=this.text=null,this.hidden=te(t,e)}function me(t,e,n){for(var i,r=[],o=e;o<n;o=i){var a=new ge(t.doc,J(t.doc,o),o);i=o+a.size,r.push(a)}return r}function ve(t){Ss?Ss.ops.push(t):t.ownsGroup=Ss={ops:[t],delayedCallbacks:[]}}function ye(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var i=0;i<t.ops.length;i++){var r=t.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<e.length)}function xe(t,e){var n=t.ownsGroup;if(n)try{ye(n)}finally{Ss=null,e(n)}}function be(t,e){var n=M(t,e);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Ss?i=Ss.delayedCallbacks:Cs?i=Cs:(i=Cs=[],setTimeout(we,0));for(var o=function(t){i.push(function(){return n[t].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function we(){var t=Cs;Cs=null;for(var e=0;e<t.length;++e)t[e]()}function _e(t,e,n,i){for(var r=0;r<e.changes.length;r++){var o=e.changes[r];"text"==o?Ae(t,e):"gutter"==o?Me(t,e,n,i):"class"==o?De(t,e):"widget"==o&&Ie(t,e,i)}e.changes=null}function Se(t){return t.node==t.text&&(t.node=w("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),_a&&Sa<8&&(t.node.style.zIndex=2)),t.node}function Ce(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var i=Se(e);e.background=i.insertBefore(w("div",null,n),i.firstChild),t.display.input.setUneditable(e.background)}}function Te(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):le(t,e)}function Ae(t,e){var n=e.text.className,i=Te(t,e);e.text==e.node&&(e.node=i.pre),e.text.parentNode.replaceChild(i.pre,e.text),e.text=i.pre,i.bgClass!=e.bgClass||i.textClass!=e.textClass?(e.bgClass=i.bgClass,e.textClass=i.textClass,De(t,e)):n&&(e.text.className=n)}function De(t,e){Ce(t,e),e.line.wrapClass?Se(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function Me(t,e,n,i){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var r=Se(e);e.gutterBackground=w("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),r.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=Se(e),s=e.gutter=w("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(w("div",at(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var u=t.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(w("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Ie(t,e,n){e.alignable&&(e.alignable=null);for(var i=e.node.firstChild,r=void 0;i;i=r)r=i.nextSibling,"CodeMirror-linewidget"==i.className&&e.node.removeChild(i);Ee(t,e,n)}function ke(t,e,n,i){var r=Te(t,e);return e.text=e.node=r.pre,r.bgClass&&(e.bgClass=r.bgClass),r.textClass&&(e.textClass=r.textClass),De(t,e),Me(t,e,n,i),Ee(t,e,i),e.node}function Ee(t,e,n){if(Le(t,e.line,e,n,!0),e.rest)for(var i=0;i<e.rest.length;i++)Le(t,e.rest[i],e,n,!1)}function Le(t,e,n,i,r){if(e.widgets)for(var o=Se(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],u=w("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Oe(l,u,n,i),t.display.input.setUneditable(u),r&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),be(l,"redraw")}}function Oe(t,e,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var r=i.wrapperWidth;e.style.left=i.fixedPos+"px",t.coverGutter||(r-=i.gutterTotalWidth,e.style.paddingLeft=i.gutterTotalWidth+"px"),e.style.width=r+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-i.gutterTotalWidth+"px"))}function Pe(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!m(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),o(e.display.measure,w("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Ne(t,e){for(var n=H(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Re(t){return t.lineSpace.offsetTop}function Fe(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function ze(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=o(t.measure,w("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(t.cachedPaddingH=i),i}function He(t){return Ga-t.display.nativeBarWidth}function Be(t){return t.display.scroller.clientWidth-He(t)-t.display.barWidth}function Ve(t){return t.display.scroller.clientHeight-He(t)-t.display.barHeight}function je(t,e,n){var i=t.options.lineWrapping,r=i&&Be(t);if(!e.measure.heights||i&&e.measure.width!=r){var o=e.measure.heights=[];if(i){e.measure.width=r;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];2<Math.abs(l.bottom-u.bottom)&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function We(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var i=0;i<t.rest.length;i++)if(t.rest[i]==e)return{map:t.measure.maps[i],cache:t.measure.caches[i]};for(var r=0;r<t.rest.length;r++)if(it(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Ue(t,e){var n=it(e=Zt(e)),i=t.display.externalMeasured=new ge(t.doc,e,n);i.lineN=n;var r=i.built=le(t,i);return i.text=r.pre,o(t.display.lineMeasure,r.pre),i}function $e(t,e,n,i){return Ye(t,Ge(t,e),n,i)}function qe(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[An(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Ge(t,e){var n=it(e),i=qe(t,n);i&&!i.text?i=null:i&&i.changes&&(_e(t,i,n,wn(t)),t.curOp.forceUpdate=!0),i||(i=Ue(t,e));var r=We(i,e,n);return{line:e,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Ye(t,e,n,i,r){e.before&&(n=-1);var o,a=n+(i||"");return e.cache.hasOwnProperty(a)?o=e.cache[a]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(je(t,e.view,e.rect),e.hasHeights=!0),(o=Ke(t,e,n,i)).bogus||(e.cache[a]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}function Ze(t,e,n){for(var i,r,o,a,s,l,u=0;u<t.length;u+=3)if(s=t[u],l=t[u+1],e<s?(r=0,o=1,a="left"):e<l?o=(r=e-s)+1:(u==t.length-3||e==l&&t[u+3]>e)&&(r=(o=l-s)-1,l<=e&&(a="right")),null!=r){if(i=t[u+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)i=t[2+(u-=3)],a="left";if("right"==n&&r==l-s)for(;u<t.length-3&&t[u+3]==t[u+4]&&!t[u+5].insertLeft;)i=t[(u+=3)+2],a="right";break}return{node:i,start:r,end:o,collapse:a,coverStart:s,coverEnd:l}}function Xe(t,e){var n=Ts;if("left"==e)for(var i=0;i<t.length&&(n=t[i]).left==n.right;i++);else for(var r=t.length-1;0<=r&&(n=t[r]).left==n.right;r--);return n}function Ke(t,e,n,i){var r,o=Ze(e.map,n,i),a=o.node,s=o.start,l=o.end,u=o.collapse;if(3==a.nodeType){for(var c=0;c<4;c++){for(;s&&S(e.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l<o.coverEnd&&S(e.line.text.charAt(o.coverStart+l));)++l;if((r=_a&&Sa<9&&0==s&&l==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Xe(za(a,s,l).getClientRects(),i)).left||r.right||0==s)break;l=s,s-=1,u="right"}_a&&Sa<11&&(r=Qe(
|
|
t.display.measure,r))}else{var h;0<s&&(u=i="right"),r=t.options.lineWrapping&&1<(h=a.getClientRects()).length?h["right"==i?h.length-1:0]:a.getBoundingClientRect()}if(_a&&Sa<9&&!s&&(!r||!r.left&&!r.right)){var d=a.parentNode.getClientRects()[0];r=d?{left:d.left,right:d.left+bn(t.display),top:d.top,bottom:d.bottom}:Ts}for(var f=r.top-e.rect.top,p=r.bottom-e.rect.top,g=(f+p)/2,m=e.view.measure.heights,v=0;v<m.length-1&&!(g<m[v]);v++);var y=v?m[v-1]:0,x=m[v],b={left:("right"==u?r.right:r.left)-e.rect.left,right:("left"==u?r.left:r.right)-e.rect.left,top:y,bottom:x};return r.left||r.right||(b.bogus=!0),t.options.singleCursorHeightPerLine||(b.rtop=f,b.rbottom=p),b}function Qe(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!U(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}function Je(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function tn(t){t.display.externalMeasure=null,p(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Je(t.display.view[e])}function en(t){tn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function nn(){return Aa&&La?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function rn(){return Aa&&La?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function on(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=Pe(t.widgets[n]));return e}function an(t,e,n,i,r){if(!r){var o=on(e);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var a=ne(e);if("local"==i?a+=Re(t.display):a-=t.display.viewOffset,"page"==i||"window"==i){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==i?0:rn());var l=s.left+("window"==i?0:nn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function sn(t,e,n){if("div"==n)return e;var i=e.left,r=e.top;if("page"==n)i-=nn(),r-=rn();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:r-a.top}}function ln(t,e,n,i,r){return i||(i=J(t.doc,e.line)),an(t,i,$e(t,i,e.ch,r),n)}function un(i,t,r,o,a,s){function l(t,e){var n=Ye(i,a,t,e?"right":"left",s);return e?n.left=n.right:n.right=n.left,an(i,o,n,r)}function e(t,e,n){return l(n?t-1:t,1==u[e].level!=n)}o=o||J(i.doc,t.line),a||(a=Ge(i,o));var u=E(o,i.doc.direction),n=t.ch,c=t.sticky;if(n>=o.text.length?(n=o.text.length,c="before"):n<=0&&(n=0,c="after"),!u)return l("before"==c?n-1:n,"before"==c);var h=b(u,n,c),d=es,f=e(n,h,"before"==c);return null!=d&&(f.other=e(n,d,"before"!=c)),f}function cn(t,e){var n=0;e=pt(t.doc,e),t.options.lineWrapping||(n=bn(t.display)*e.ch);var i=J(t.doc,e.line),r=ne(i)+Re(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function hn(t,e,n,i,r){var o=st(t,e,n);return o.xRel=r,i&&(o.outside=i),o}function dn(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return hn(i.first,0,null,-1,-1);var r=rt(i,n),o=i.first+i.size-1;if(o<r)return hn(i.first+i.size-1,J(i,o).text.length,null,1,1);e<0&&(e=0);for(var a=J(i,r);;){var s=mn(t,a,r,e,n),l=Gt(a,s.ch+(0<s.xRel||0<s.outside?1:0));if(!l)return s;var u=l.find(1);if(u.line==r)return u;a=J(i,r=u.line)}}function fn(e,t,n,i){i-=on(t);var r=t.text.length,o=D(function(t){return Ye(e,n,t-1).bottom<=i},r,0);return{begin:o,end:r=D(function(t){return Ye(e,n,t).top>i},o,r)}}function pn(t,e,n,i){return n||(n=Ge(t,e)),fn(t,e,n,an(t,e,Ye(t,n,i),"line").top)}function gn(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function mn(n,t,e,i,r){r-=ne(t);var o=Ge(n,t),a=on(t),s=0,l=t.text.length,u=!0,c=E(t,n.doc.direction);if(c){var h=(n.options.lineWrapping?yn:vn)(n,t,e,o,c,i,r);s=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var d,f,p=null,g=null,m=D(function(t){var e=Ye(n,o,t);return e.top+=a,e.bottom+=a,!!gn(e,i,r,!1)&&(e.top<=r&&e.left<=i&&(p=t,g=e),!0)},s,l),v=!1;if(g){var y=i-g.left<g.right-i,x=y==u;m=p+(x?0:1),f=x?"after":"before",d=y?g.left:g.right}else{u||m!=l&&m!=s||m++,f=0==m?"after":m==t.text.length?"before":Ye(n,o,m-(u?1:0)).bottom+a<=r==u?"after":"before";var b=un(n,st(e,m,f),"line",t,o);d=b.left,v=r<b.top?-1:r>=b.bottom?1:0}return hn(e,m=A(t.text,m,1),f,v,i-d)}function vn(i,r,o,a,s,l,u){var t=D(function(t){var e=s[t],n=1!=e.level;return gn(un(i,st(o,n?e.to:e.from,n?"before":"after"),"line",r,a),l,u,!0)},0,s.length-1),e=s[t];if(0<t){var n=1!=e.level,c=un(i,st(o,n?e.from:e.to,n?"after":"before"),"line",r,a);gn(c,l,u,!0)&&c.top>u&&(e=s[t-1])}return e}function yn(t,e,n,i,r,o,a){var s=fn(t,e,i,a),l=s.begin,u=s.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=u||f.to<=l)){var p=Ye(t,i,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=p<o?o-p+1e9:p-o;(!c||g<h)&&(c=f,h=g)}}return c||(c=r[r.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function xn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==bs){bs=w("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)bs.appendChild(document.createTextNode("x")),bs.appendChild(w("br"));bs.appendChild(document.createTextNode("x"))}o(t.measure,bs);var n=bs.offsetHeight/50;return 3<n&&(t.cachedTextHeight=n),p(t.measure),n||1}function bn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=w("span","xxxxxxxxxx"),n=w("pre",[e],"CodeMirror-line-like");o(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return 2<r&&(t.cachedCharWidth=r),r||10}function wn(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:_n(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function _n(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Sn(i){var r=xn(i.display),o=i.options.lineWrapping,a=o&&Math.max(5,i.display.scroller.clientWidth/bn(i.display)-3);return function(t){if(te(i.doc,t))return 0;var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;n++)t.widgets[n].height&&(e+=t.widgets[n].height);return o?e+(Math.ceil(t.text.length/a)||1)*r:e+r}}function Cn(t){var e=t.doc,n=Sn(t);e.iter(function(t){var e=n(t);e!=t.height&&nt(t,e)})}function Tn(t,e,n,i){var r=t.display;if(!n&&"true"==H(e).getAttribute("cm-not-content"))return null;var o,a,s=r.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(e){return null}var l,u=dn(t,o,a);if(i&&1==u.xRel&&(l=J(t.doc,u.line).text).length==u.ch){var c=C(l,l.length,t.options.tabSize)-l.length;u=st(u.line,Math.max(0,Math.round((o-ze(t.display).left)/bn(t.display))-c))}return u}function An(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;i<n.length;i++)if((e-=n[i].size)<0)return i}function Dn(t,e,n,i){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),i||(i=0);var r=t.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>e)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)ys&&Qt(t.doc,e)<r.viewTo&&In(t);else if(n<=r.viewFrom)ys&&Jt(t.doc,n+i)>r.viewFrom?In(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)In(t);else if(e<=r.viewFrom){var o=kn(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):In(t)}else if(n>=r.viewTo){var a=kn(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):In(t)}else{var s=kn(t,e,e,-1),l=kn(t,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(me(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):In(t)}var u=r.externalMeasured;u&&(n<u.lineN?u.lineN+=i:e<u.lineN+u.size&&(r.externalMeasured=null))}function Mn(t,e,n){t.curOp.viewChanged=!0;var i=t.display,r=t.display.externalMeasured;if(r&&e>=r.lineN&&e<r.lineN+r.size&&(i.externalMeasured=null),!(e<i.viewFrom||e>=i.viewTo)){var o=i.view[An(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==g(a,n)&&a.push(n)}}}function In(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function kn(t,e,n,i){var r,o=An(t,e),a=t.display.view;if(!ys||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=e){if(0<i){if(o==a.length-1)return null;r=s+a[o].size-e,o++}else r=s-e;e+=r,n+=r}for(;Qt(t.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function En(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=me(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=me(t,e,i.viewFrom).concat(i.view):i.viewFrom<e&&(i.view=i.view.slice(An(t,e))),i.viewFrom=e,i.viewTo<n?i.view=i.view.concat(me(t,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,An(t,n)))),i.viewTo=n}function Ln(t){for(var e=t.display.view,n=0,i=0;i<e.length;i++){var r=e[i];r.hidden||r.node&&!r.changes||++n}return n}function On(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Pn(t,e){void 0===e&&(e=!0);for(var n=t.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(e||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom)){var l=s.empty();(l||t.options.showCursorWhenSelecting)&&Nn(t,s.head,r),l||Fn(t,s,o)}}return i}function Nn(t,e,n){var i=un(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),r=n.appendChild(w("div","\xa0","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px",i.other){var o=n.appendChild(w("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Rn(t,e){return t.top-e.top||t.left-e.left}function Fn(a,t,e){function A(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),o.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?M-t:n)+"px;\n height: "+(i-e)+"px"))}function n(n,y,x){function b(t,e){return ln(a,st(n,t),"div",o,e)}function w(t,e,n){var i=pn(a,o,null,t),r="ltr"==e==("after"==n)?"left":"right";return b("after"==n?i.begin:i.end-(/\s/.test(o.text.charAt(i.end-1))?2:1),r)[r]}var _,S,o=J(r,n),C=o.text.length,T=E(o,r.direction);return k(T,y||0,null==x?C:x,function(t,e,n,i){var r="ltr"==n,o=b(t,r?"left":"right"),a=b(e-1,r?"right":"left"),s=null==y&&0==t,l=null==x&&e==C,u=0==i,c=!T||i==T.length-1;if(a.top-o.top<=3){var h=(I?l:s)&&c,d=(I?s:l)&&u?D:(r?o:a).left,f=h?M:(r?a:o).right;A(d,o.top,f-d,o.bottom)}else{var p,g,m,v;r?(p=I&&s&&u?D:o.left,g=I?M:w(t,n,"before"),m=I?D:w(e,n,"after"),v=I&&l&&c?M:a.right):(p=I?w(t,n,"before"):D,g=!I&&s&&u?M:o.right,m=!I&&l&&c?D:a.left,v=I?w(e,n,"after"):M),A(p,o.top,g-p,o.bottom),o.bottom<a.top&&A(D,o.bottom,null,a.top),A(m,a.top,v-m,a.bottom)}(!_||Rn(o,_)<0)&&(_=o),Rn(a,_)<0&&(_=a),(!S||Rn(o,S)<0)&&(S=o),Rn(a,S)<0&&(S=a)}),{start:_,end:S}}var i=a.display,r=a.doc,o=document.createDocumentFragment(),s=ze(a.display),D=s.left,M=Math.max(i.sizerWidth,Be(a)-i.sizer.offsetLeft)-s.right,I="ltr"==r.direction,l=t.from(),u=t.to();if(l.line==u.line)n(l.line,l.ch,u.ch);else{var c=J(r,l.line),h=J(r,u.line),d=Zt(c)==Zt(h),f=n(l.line,l.ch,d?c.text.length+1:null).end,p=n(u.line,d?0:null,u.ch).start;d&&(f.top<p.top-2?(A(f.right,f.top,null,f.bottom),A(D,p.top,p.left,p.bottom)):A(f.right,f.top,p.left-f.right,f.bottom)),f.bottom<p.top&&A(D,f.bottom,null,p.top)}e.appendChild(o)}function zn(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",0<t.options.cursorBlinkRate?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Hn(t){t.state.focused||(t.display.input.focus(),Vn(t))}function Bn(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,jn(t))},100)}function Vn(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(L(t,"focus",t,e),t.state.focused=!0,i(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),Ca&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),zn(t))}function jn(t,e){t.state.delayingBlurEvent||(t.state.focused&&(L(t,"blur",t,e),t.state.focused=!1,Va(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Wn(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i<e.view.length;i++){var r=e.view[i],o=t.options.lineWrapping,a=void 0,s=0;if(!r.hidden){if(_a&&Sa<8){var l=r.node.offsetTop+r.node.offsetHeight;a=l-n,n=l}else{var u=r.node.getBoundingClientRect();a=u.bottom-u.top,!o&&r.text.firstChild&&(s=r.text.firstChild.getBoundingClientRect().right-u.left-1)}var c=r.line.height-a;if((.005<c||c<-.005)&&(nt(r.line,a),Un(r.line),r.rest))for(var h=0;h<r.rest.length;h++)Un(r.rest[h]);if(s>t.display.sizerWidth){var d=Math.ceil(s/bn(t.display));d>t.display.maxLineLength&&(t.display.maxLineLength=d,t.display.maxLine=r.line,t.display.maxLineChanged=!0)}}}}function Un(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function $n(t,e,n){var i=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-Re(t));var r=n&&null!=n.bottom?n.bottom:i+t.wrapper.clientHeight,o=rt(e,i),a=rt(e,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?a=rt(e,ne(J(e,o=s))+t.wrapper.clientHeight):Math.min(l,e.lastLine())>=a&&(o=rt(e,ne(J(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function qn(t,e){if(!O(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!ka){var o=w("div","\u200b",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Re(t.display))+"px;\n height: "+(e.bottom-e.top+He(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}function Gn(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?st(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?st(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=un(t,e),l=n&&n!=e?un(t,n):s,u=Zn(t,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=u.scrollTop&&(ni(t,u.scrollTop),1<Math.abs(t.doc.scrollTop-c)&&(a=!0)),null!=u.scrollLeft&&(ri(t,u.scrollLeft),1<Math.abs(t.doc.scrollLeft-h)&&(a=!0)),!a)break}return r}function Yn(t,e){var n=Zn(t,e);null!=n.scrollTop&&ni(t,n.scrollTop),null!=n.scrollLeft&&ri(t,n.scrollLeft)}function Zn(t,e){var n=t.display,i=xn(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Ve(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Fe(n),l=e.top<i,u=e.bottom>s-i;if(e.top<r)a.scrollTop=l?0:e.top;else if(e.bottom>r+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=r&&(a.scrollTop=c)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,d=Be(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>d;return f&&(e.right=e.left+d),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left-(f?0:10)):e.right>d+h-3&&(a.scrollLeft=e.right+(f?0:10)-d),a}function Xn(t,e){null!=e&&(ti(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Kn(t){ti(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Qn(t,e,n){null==e&&null==n||ti(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Jn(t,e){ti(t),t.curOp.scrollToPos=e}function ti(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,ei(t,cn(t,e.from),cn(t,e.to),e.margin))}function ei(t,e,n,i){var r=Zn(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Qn(t,r.scrollLeft,r.scrollTop)}function ni(t,e){Math.abs(t.doc.scrollTop-e)<2||(ya||Mi(t,{top:e}),ii(t,e,!0),ya&&Mi(t),wi(t,100))}function ii(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function ri(t,e,n,i){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Li(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function oi(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Fe(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+He(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function ai(t,e){e||(e=oi(t));var n=t.display.barWidth,i=t.display.barHeight;si(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&Wn(t),si(t,oi(t)),n=t.display.barWidth,i=t.display.barHeight}function si(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}function li(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&Va(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Ms[n.options.scrollbarStyle](function(t){n.display.wrapper.insertBefore(t,n.display.scrollbarFiller),rs(t,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,e){"horizontal"==e?ri(n,t):ni(n,t)},n),n.display.scrollbars.addClass&&i(n.display.wrapper,n.display.scrollbars.addClass)}function ui(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Is},ve(t.curOp)}function ci(t){var e=t.curOp;e&&xe(e,function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;hi(t)})}function hi(t){for(var e=t.ops,n=0;n<e.length;n++)di(e[n]);for(var i=0;i<e.length;i++)fi(e[i]);for(var r=0;r<e.length;r++)pi(e[r]);for(var o=0;o<e.length;o++)gi(e[o]);for(var a=0;a<e.length;a++)mi(e[a])}function di(t){var e=t.cm,n=e.display;Si(e),t.updateMaxLine&&re(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new ks(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function fi(t){t.updatedDisplay=t.mustUpdate&&Ai(t.cm,t.update)}function pi(t){var e=t.cm,n=e.display;t.updatedDisplay&&Wn(e),t.barMeasure=oi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=$e(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+He(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Be(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function gi(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&ri(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==d();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&ai(e,t.barMeasure),t.updatedDisplay&&Ei(e,t.barMeasure),t.selectionChanged&&zn(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Hn(t.cm)}function mi(t){var e=t.cm,n=e.display,i=e.doc;(t.updatedDisplay&&Di(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&ii(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&ri(e,t.scrollLeft,!0,!0),t.scrollToPos)&&qn(e,Gn(e,pt(i,t.scrollToPos.from),pt(i,t.scrollToPos.to),t.scrollToPos.margin));var r=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(r)for(var a=0;a<r.length;++a)r[a].lines.length||L(r[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&L(o[s],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&L(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function vi(t,e){if(t.curOp)return e();ui(t);try{return e()}finally{ci(t)}}function yi(t,e){return function(){if(t.curOp)return e.apply(t,arguments);ui(t);try{return e.apply(t,arguments)}finally{ci(t)}}}function xi(t){return function(){if(this.curOp)return t.apply(this,arguments);ui(this);try{return t.apply(this,arguments)}finally{ci(this)}}}function bi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ui(t);try{return e.apply(this,arguments)}finally{ci(t)}}}function wi(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,u(_i,t))}function _i(l){var u=l.doc;if(!(u.highlightFrontier>=l.display.viewTo)){var c=+new Date+l.options.workTime,h=xt(l,u.highlightFrontier),d=[];u.iter(h.line,Math.min(u.first+u.size,l.display.viewTo+500),function(t){if(h.line>=l.display.viewFrom){var e=t.styles,n=t.text.length>l.options.maxHighlightLength?X(u.mode,h.state):null,i=vt(l,t,h,!0);n&&(h.state=n),t.styles=i.styles;var r=t.styleClasses,o=i.classes;o?t.styleClasses=o:r&&(t.styleClasses=null);for(var a=!e||e.length!=t.styles.length||r!=o&&(!r||!o||r.bgClass!=o.bgClass||r.textClass!=o.textClass),s=0;!a&&s<e.length;++s)a=e[s]!=t.styles[s];a&&d.push(h.line),t.stateAfter=h.save(),h.nextLine()}else t.text.length<=l.options.maxHighlightLength&&bt(l,t.text,h),t.stateAfter=h.line%5==0?h.save():null,h.nextLine();if(+new Date>c)return wi(l,l.options.workDelay),!0}),u.highlightFrontier=h.line,u.modeFrontier=Math.max(u.modeFrontier,h.line),d.length&&vi(l,function(){for(var t=0;t<d.length;t++)Mn(l,d[t],"text")})}}function Si(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=He(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=He(t)+"px",e.scrollbarsClipped=!0)}function Ci(t){if(t.hasFocus())return null;var e=d();if(!e||!m(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&m(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function Ti(t){if(t&&t.activeElt&&t.activeElt!=d()&&(t.activeElt.focus(),t.anchorNode&&m(document.body,t.anchorNode)&&m(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}function Ai(t,e){var n=t.display,i=t.doc;if(e.editorIsHidden)return In(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ln(t))return!1;Oi(t)&&(In(t),e.dims=wn(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),a=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),ys&&(o=Qt(t.doc,o),a=Jt(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;En(t,o,a),n.viewOffset=ne(J(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Ln(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ci(t);return 4<l&&(n.lineDiv.style.display="none"),Ii(t,n.updateLineNumbers,e.dims),4<l&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ti(u),p(n.cursorDiv),p(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,wi(t,400)),!(n.updateLineNumbers=null)}function Di(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Be(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Fe(t.display)-Ve(t),n.top)}),e.visible=$n(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Ai(t,e);i=!1){Wn(t);var r=oi(t);On(t),ai(t,r),Ei(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Mi(t,e){var n=new ks(t,e);if(Ai(t,n)){Wn(t),Di(t,n);var i=oi(t);On(t),ai(t,i),Ei(t,i),n.finish()}}function Ii(n,t,e){function i(t){var e=t.nextSibling;return Ca&&Pa&&n.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),e}for(var r=n.display,o=n.options.lineNumbers,a=r.lineDiv,s=a.firstChild,l=r.view,u=r.viewFrom,c=0;c<l.length;c++){var h=l[c];if(h.hidden);else if(h.node&&h.node.parentNode==a){for(;s!=h.node;)s=i(s);var d=o&&null!=t&&t<=u&&h.lineNumber;h.changes&&(-1<g(h.changes,"gutter")&&(d=!1),_e(n,h,u,e)),d&&(p(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(at(n.options,u)))),s=h.node.nextSibling}else{var f=ke(n,h,u,e);a.insertBefore(f,s)}u+=h.size}for(;s;)s=i(s)}function ki(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Ei(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+He(t)+"px"}function Li(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=_n(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=i+r+"px")}}function Oi(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=at(t.options,e.first+e.size-1),i=t.display;if(n.length==i.lineNumChars)return!1;var r=i.measure.appendChild(w("div",[w("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,a=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",ki(t.display),!0}function Pi(t,e){for(var n=[],i=!1,r=0;r<t.length;r++){var o=t[r],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;i=!0}n.push({className:o,style:a})}return e&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ni(t){var e=t.gutters,n=t.gutterSpecs;p(e),t.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,a=r.style,s=e.appendChild(w("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&((t.lineGutter=s).style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",ki(t)}function Ri(t){Ni(t.display),Dn(t),Li(t)}function Fi(t,e,n,i){var r=this;this.input=n,r.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=h("div",null,"CodeMirror-code"),r.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=w("div",null,"CodeMirror-cursors"),r.measure=w("div",null,"CodeMirror-measure"),r.lineMeasure=w("div",null,"CodeMirror-measure"),r.lineSpace=h("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var o=h("div",[r.lineSpace],"CodeMirror-lines");r.mover=w("div",[o],null,"position: relative"),r.sizer=w("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=w("div",null,null,"position: absolute; height: "+Ga+"px; width: 1px;"),r.gutters=w("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=w("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=w("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),_a&&Sa<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),Ca||ya&&Oa||(r.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(r.wrapper):t(r.wrapper)),r.viewFrom=r.viewTo=e.first,r.reportedViewFrom=r.reportedViewTo=e.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Pi(i.gutters,i.lineNumbers),Ni(r),n.init(r)}function zi(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Hi(t){var e=zi(t);return e.x*=Ls,e.y*=Ls,e}function Bi(t,e){var n=zi(e),i=n.x,r=n.y,o=t.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(i&&s||r&&l){if(r&&Pa&&Ca)t:for(var u=e.target,c=o.view;u!=a;u=u.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==u){t.display.currentWheelTarget=u;break t}if(i&&!ya&&!Da&&null!=Ls)return r&&l&&ni(t,Math.max(0,a.scrollTop+r*Ls)),ri(t,Math.max(0,a.scrollLeft+i*Ls)),(!r||r&&l)&&R(e),void(o.wheelStartX=null);if(r&&null!=Ls){var d=r*Ls,f=t.doc.scrollTop,p=f+o.wrapper.clientHeight;d<0?f=Math.max(0,f+d-50):p=Math.min(t.doc.height,p+d+50),Mi(t,{top:f,bottom:p})}Es<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=i,o.wheelDY=r,setTimeout(function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ls=(Ls*Es+n)/(Es+1),++Es)}},200)):(o.wheelDX+=i,o.wheelDY+=r))}}function Vi(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort(function(t,e){return lt(t.from(),e.from())}),n=g(e,r);for(
|
|
var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=lt(s.to(),a.from());if(i&&!a.empty()?0<l:0<=l){var u=dt(s.from(),a.from()),c=ht(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new Ps(h?c:u,h?u:c))}}return new Os(e,n)}function ji(t,e){return new Os([new Ps(t,e||t)],0)}function Wi(t){return t.text?st(t.from.line+t.text.length-1,W(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Ui(t,e){if(lt(t,e.from)<0)return t;if(lt(t,e.to)<=0)return Wi(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=Wi(e).ch-e.to.ch),st(n,i)}function $i(t,e){for(var n=[],i=0;i<t.sel.ranges.length;i++){var r=t.sel.ranges[i];n.push(new Ps(Ui(r.anchor,e),Ui(r.head,e)))}return Vi(t.cm,n,t.sel.primIndex)}function qi(t,e,n){return t.line==e.line?st(n.line,t.ch-e.ch+n.ch):st(n.line+(t.line-e.line),t.ch)}function Gi(t,e,n){for(var i=[],r=st(t.first,0),o=r,a=0;a<e.length;a++){var s=e[a],l=qi(s.from,r,o),u=qi(Wi(s),r,o);if(r=s.to,o=u,"around"==n){var c=t.sel.ranges[a],h=lt(c.head,c.anchor)<0;i[a]=new Ps(h?u:l,h?l:u)}else i[a]=new Ps(l,l)}return new Os(i,t.sel.primIndex)}function Yi(t){t.doc.mode=Y(t.options,t.doc.modeOption),Zi(t)}function Zi(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,wi(t,100),t.state.modeGen++,t.curOp&&Dn(t)}function Xi(t,e){return 0==e.from.ch&&0==e.to.ch&&""==W(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Ki(t,i,e,r){function o(t){return e?e[t]:null}function n(t,e,n){oe(t,e,n,r),be(t,"change",t,i)}function a(t,e){for(var n=[],i=t;i<e;++i)n.push(new xs(u[i],o(i),r));return n}var s=i.from,l=i.to,u=i.text,c=J(t,s.line),h=J(t,l.line),d=W(u),f=o(u.length-1),p=l.line-s.line;if(i.full)t.insert(0,a(0,u.length)),t.remove(u.length,t.size-u.length);else if(Xi(t,i)){var g=a(0,u.length-1);n(h,h.text,f),p&&t.remove(s.line,p),g.length&&t.insert(s.line,g)}else if(c==h)if(1==u.length)n(c,c.text.slice(0,s.ch)+d+c.text.slice(l.ch),f);else{var m=a(1,u.length-1);m.push(new xs(d+c.text.slice(l.ch),f,r)),n(c,c.text.slice(0,s.ch)+u[0],o(0)),t.insert(s.line+1,m)}else if(1==u.length)n(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(l.ch),o(0)),t.remove(s.line+1,p);else{n(c,c.text.slice(0,s.ch)+u[0],o(0)),n(h,d+h.text.slice(l.ch),f);var v=a(1,u.length-1);1<p&&t.remove(s.line+1,p-1),t.insert(s.line+1,v)}be(t,"change",t,i)}function Qi(t,a,s){function l(t,e,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var r=t.linked[i];if(r.doc!=e){var o=n&&r.sharedHist;s&&!o||(a(r.doc,o),l(r.doc,t,o))}}}l(t,null,!0)}function Ji(t,e){if(e.cm)throw new Error("This document is already in use.");Cn((t.doc=e).cm=t),Yi(t),tr(t),t.options.lineWrapping||re(t),t.options.mode=e.modeOption,Dn(t)}function tr(t){("rtl"==t.doc.direction?i:Va)(t.display.lineDiv,"CodeMirror-rtl")}function er(t){vi(t,function(){tr(t),Dn(t)})}function nr(t){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function ir(t,e){var n={from:ct(e.from),to:Wi(e),text:tt(t,e.from,e.to)};return cr(t,n,e.from.line,e.to.line+1),Qi(t,function(t){return cr(t,n,e.from.line,e.to.line+1)},!0),n}function rr(t){for(;t.length;){if(!W(t).ranges)break;t.pop()}}function or(t,e){return e?(rr(t.done),W(t.done)):t.done.length&&!W(t.done).ranges?W(t.done):1<t.done.length&&!t.done[t.done.length-2].ranges?(t.done.pop(),W(t.done)):void 0}function ar(t,e,n,i){var r=t.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=or(r,r.lastOp==i)))a=W(o.changes),0==lt(e.from,e.to)&&0==lt(e.from,a.to)?a.to=Wi(e):o.changes.push(ir(t,e));else{var l=W(r.done);for(l&&l.ranges||ur(t.sel,r.done),o={changes:[ir(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,a||L(t,"historyAdded")}function sr(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function lr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||sr(t,o,W(r.done),e))?r.done[r.done.length-1]=e:ur(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&rr(r.undone)}function ur(t,e){var n=W(e);n&&n.ranges&&n.equals(t)||e.push(t)}function cr(e,n,t,i){var r=n["spans_"+e.id],o=0;e.iter(Math.max(e.first,t),Math.min(e.first+e.size,i),function(t){t.markedSpans&&((r||(r=n["spans_"+e.id]={}))[o]=t.markedSpans),++o})}function hr(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function dr(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var i=[],r=0;r<e.text.length;++r)i.push(hr(n[r]));return i}function fr(t,e){var n=dr(t,e),i=Rt(t,e);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],a=i[r];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else a&&(n[r]=a)}return n}function pr(t,e,n){for(var i=[],r=0;r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?Os.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),e)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&-1<g(e,Number(c[1]))&&(W(s)[h]=u[h],delete u[h])}}}return i}function gr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=lt(e,r)<0;o!=lt(n,r)<0?(r=e,e=n):o!=lt(e,n)<0&&(e=n)}return new Ps(r,e)}return new Ps(n||e,e)}function mr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),_r(t,new Os([gr(t.sel.primary(),e,n,r)],0),i)}function vr(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)i[o]=gr(t.sel.ranges[o],e[o],null,r);_r(t,Vi(t.cm,i,t.sel.primIndex),n)}function yr(t,e,n,i){var r=t.sel.ranges.slice(0);r[e]=n,_r(t,Vi(t.cm,r,t.sel.primIndex),i)}function xr(t,e,n,i){_r(t,ji(e,n),i)}function br(i,t,e){var n={ranges:t.ranges,update:function(t){var e=this;this.ranges=[];for(var n=0;n<t.length;n++)e.ranges[n]=new Ps(pt(i,t[n].anchor),pt(i,t[n].head))},origin:e&&e.origin};return L(i,"beforeSelectionChange",i,n),i.cm&&L(i.cm,"beforeSelectionChange",i.cm,n),n.ranges!=t.ranges?Vi(i.cm,n.ranges,n.ranges.length-1):t}function wr(t,e,n){var i=t.history.done,r=W(i);r&&r.ranges?Sr(t,i[i.length-1]=e,n):_r(t,e,n)}function _r(t,e,n){Sr(t,e,n),lr(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Sr(t,e,n){(N(t,"beforeSelectionChange")||t.cm&&N(t.cm,"beforeSelectionChange"))&&(e=br(t,e,n)),Cr(t,Ar(t,e,n&&n.bias||(lt(e.primary().head,t.sel.primary().head)<0?-1:1),!0)),n&&!1===n.scroll||!t.cm||Kn(t.cm)}function Cr(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,P(t.cm)),be(t,"cursorActivity",t))}function Tr(t){Cr(t,Ar(t,t.sel,null,!1))}function Ar(t,e,n,i){for(var r,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=Mr(t,a.anchor,s&&s.anchor,n,i),u=Mr(t,a.head,s&&s.head,n,i);(r||l!=a.anchor||u!=a.head)&&(r||(r=e.ranges.slice(0,o)),r[o]=new Ps(l,u))}return r?Vi(t.cm,r,e.primIndex):e}function Dr(t,e,n,i,r){var o=J(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(u?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(c?s.to>=e.ch:s.to>e.ch))){if(r&&(L(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?c:u)&&(h=Ir(t,h,-i,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(d=lt(h,n))&&(i<0?d<0:0<d))return Dr(t,h,e,i,r)}var f=l.find(i<0?-1:1);return(i<0?u:c)&&(f=Ir(t,f,i,f.line==e.line?o:null)),f?Dr(t,f,e,i,r):null}}return e}function Mr(t,e,n,i,r){var o=i||1,a=Dr(t,e,n,o,r)||!r&&Dr(t,e,n,o,!0)||Dr(t,e,n,-o,r)||!r&&Dr(t,e,n,-o,!0);return a||(t.cantEdit=!0,st(t.first,0))}function Ir(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?pt(t,st(e.line-1)):null:0<n&&e.ch==(i||J(t,e.line)).text.length?e.line<t.first+t.size-1?st(e.line+1,0):null:new st(e.line,e.ch+n)}function kr(t){t.setSelection(st(t.firstLine(),0),st(t.lastLine()),Za)}function Er(r,t,e){var o={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return o.canceled=!0}};return e&&(o.update=function(t,e,n,i){t&&(o.from=pt(r,t)),e&&(o.to=pt(r,e)),n&&(o.text=n),i!==undefined&&(o.origin=i)}),L(r,"beforeChange",r,o),r.cm&&L(r.cm,"beforeChange",r.cm,o),o.canceled?(r.cm&&(r.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function Lr(t,e,n){if(t.cm){if(!t.cm.curOp)return yi(t.cm,Lr)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(N(t,"beforeChange")||t.cm&&N(t.cm,"beforeChange"))||(e=Er(t,e,!0))){var i=vs&&!n&&zt(t,e.from,e.to);if(i)for(var r=i.length-1;0<=r;--r)Or(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Or(t,e)}}function Or(t,n){if(1!=n.text.length||""!=n.text[0]||0!=lt(n.from,n.to)){var e=$i(t,n);ar(t,n,e,t.cm?t.cm.curOp.id:NaN),Rr(t,n,e,Rt(t,n));var i=[];Qi(t,function(t,e){e||-1!=g(i,t.history)||(Vr(t.history,n),i.push(t.history)),Rr(t,n,null,Rt(t,n))})}}function Pr(r,o,t){var e=r.cm&&r.cm.state.suppressEdits;if(!e||t){for(var a,n=r.history,i=r.sel,s="undo"==o?n.done:n.undone,l="undo"==o?n.undone:n.done,u=0;u<s.length&&(a=s[u],t?!a.ranges||a.equals(r.sel):a.ranges);u++);if(u!=s.length){for(n.lastOrigin=n.lastSelOrigin=null;;){if(!(a=s.pop()).ranges){if(e)return void s.push(a);break}if(ur(a,l),t&&!a.equals(r.sel))return void _r(r,a,{clearRedo:!1});i=a}var c=[];ur(i,l),l.push({changes:c,generation:n.generation}),n.generation=a.generation||++n.maxGeneration;for(var h=N(r,"beforeChange")||r.cm&&N(r.cm,"beforeChange"),d=function(t){var n=a.changes[t];if(n.origin=o,h&&!Er(r,n,!1))return s.length=0,{};c.push(ir(r,n));var e=t?$i(r,n):W(s);Rr(r,n,e,fr(r,n)),!t&&r.cm&&r.cm.scrollIntoView({from:n.from,to:Wi(n)});var i=[];Qi(r,function(t,e){e||-1!=g(i,t.history)||(Vr(t.history,n),i.push(t.history)),Rr(t,n,null,fr(t,n))})},f=a.changes.length-1;0<=f;--f){var p=d(f);if(p)return p.v}}}}function Nr(t,e){if(0!=e&&(t.first+=e,t.sel=new Os(v(t.sel.ranges,function(t){return new Ps(st(t.anchor.line+e,t.anchor.ch),st(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){Dn(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++)Mn(t.cm,i,"gutter")}}function Rr(t,e,n,i){if(t.cm&&!t.cm.curOp)return yi(t.cm,Rr)(t,e,n,i);if(e.to.line<t.first)Nr(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var r=e.text.length-1-(t.first-e.from.line);Nr(t,r),e={from:st(t.first,0),to:st(e.to.line+r,e.to.ch),text:[W(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:st(o,J(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=tt(t,e.from,e.to),n||(n=$i(t,e)),t.cm?Fr(t.cm,e,i):Ki(t,e,i),Sr(t,n,Za),t.cantEdit&&Mr(t,st(t.firstLine(),0))&&(t.cantEdit=!1)}}function Fr(t,e,n){var i=t.doc,r=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=it(Zt(J(i,o.line))),i.iter(l,a.line+1,function(t){if(t==r.maxLine)return s=!0})),-1<i.sel.contains(e.from,e.to)&&P(t),Ki(i,e,n,Sn(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=ie(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)}),s&&(t.curOp.updateMaxLine=!0)),Dt(i,o.line),wi(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?Dn(t):o.line!=a.line||1!=e.text.length||Xi(t.doc,e)?Dn(t,o.line,a.line+1,u):Mn(t,o.line,"text");var c=N(t,"changes"),h=N(t,"change");if(h||c){var d={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};h&&be(t,"change",t,d),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function zr(t,e,n,i,r){var o;i||(i=n),lt(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Lr(t,{from:n,to:i,text:e,origin:r})}function Hr(t,e,n,i){n<t.line?t.line+=i:e<t.line&&(t.line=e,t.ch=0)}function Br(t,e,n,i){for(var r=0;r<t.length;++r){var o=t[r],a=!0;if(o.ranges){o.copied||((o=t[r]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)Hr(o.ranges[s].anchor,e,n,i),Hr(o.ranges[s].head,e,n,i)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=st(u.from.line+i,u.from.ch),u.to=st(u.to.line+i,u.to.ch);else if(e<=u.to.line){a=!1;break}}a||(t.splice(0,r+1),r=0)}}}function Vr(t,e){var n=e.from.line,i=e.to.line,r=e.text.length-(i-n)-1;Br(t.done,n,i,r),Br(t.undone,n,i,r)}function jr(t,e,n,i){var r=e,o=e;return"number"==typeof e?o=J(t,ft(t,e)):r=it(e),null==r?null:(i(o,r)&&t.cm&&Mn(t.cm,r,n),o)}function Wr(t){var e=this;this.lines=t,this.parent=null;for(var n=0,i=0;i<t.length;++i)t[i].parent=e,n+=t[i].height;this.height=n}function Ur(t){var e=this;this.children=t;for(var n=0,i=0,r=0;r<t.length;++r){var o=t[r];n+=o.chunkSize(),i+=o.height,o.parent=e}this.size=n,this.height=i,this.parent=null}function $r(t,e,n){ne(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Xn(t,n)}function qr(i,t,e,n){var r=new Ns(i,e,n),o=i.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),jr(i,t,"widget",function(t){var e=t.widgets||(t.widgets=[]);if(null==r.insertAt?e.push(r):e.splice(Math.min(e.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!te(i,t)){var n=ne(t)<i.scrollTop;nt(t,t.height+Pe(r)),n&&Xn(o,r.height),o.curOp.forceUpdate=!0}return!0}),o&&be(o,"lineWidgetAdded",o,r,"number"==typeof t?t:it(t)),r}function Gr(e,n,i,t,r){if(t&&t.shared)return Yr(e,n,i,t,r);if(e.cm&&!e.cm.curOp)return yi(e.cm,Gr)(e,n,i,t,r);var o=new Fs(e,r),a=lt(n,i);if(t&&f(t,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=h("span",[o.replacedWith],"CodeMirror-widget"),t.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),t.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Yt(e,n.line,n,i,o)||n.line!=i.line&&Yt(e,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");It()}o.addToHistory&&ar(e,{from:n,to:i,origin:"markText"},e.sel,NaN);var s,l=n.line,u=e.cm;if(e.iter(l,i.line+1,function(t){u&&o.collapsed&&!u.options.lineWrapping&&Zt(t)==u.display.maxLine&&(s=!0),o.collapsed&&l!=n.line&&nt(t,0),Ot(t,new kt(o,l==n.line?n.ch:null,l==i.line?i.ch:null)),++l}),o.collapsed&&e.iter(n.line,i.line+1,function(t){te(e,t)&&nt(t,0)}),o.clearOnEnter&&rs(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Mt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Rs,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Dn(u,n.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=n.line;c<=i.line;c++)Mn(u,c,"text");o.atomic&&Tr(u.doc),be(u,"markerAdded",u,o)}return o}function Yr(t,n,i,r,o){(r=f(r)).shared=!1;var a=[Gr(t,n,i,r,o)],s=a[0],l=r.widgetNode;return Qi(t,function(t){l&&(r.widgetNode=l.cloneNode(!0)),a.push(Gr(t,pt(t,n),pt(t,i),r,o));for(var e=0;e<t.linked.length;++e)if(t.linked[e].isParent)return;s=W(a)}),new zs(a,s)}function Zr(t){return t.findMarks(st(t.first,0),t.clipPos(st(t.lastLine())),function(t){return t.parent})}function Xr(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=i.find(),o=t.clipPos(r.from),a=t.clipPos(r.to);if(lt(o,a)){var s=Gr(t,o,a,i.primary,i.primary.type);i.markers.push(s),s.parent=i}}}function Kr(o){for(var t=function(t){var e=o[t],n=[e.primary.doc];Qi(e.primary.doc,function(t){return n.push(t)});for(var i=0;i<e.markers.length;i++){var r=e.markers[i];-1==g(n,r.doc)&&(r.parent=null,e.markers.splice(i--,1))}},e=0;e<o.length;e++)t(e)}function Qr(t){var r=this;if(eo(r),!O(r,t)&&!Ne(r.display,t)){R(t),_a&&(Vs=+new Date);var o=Tn(r,t,!0),e=t.dataTransfer.files;if(o&&!r.isReadOnly())if(e&&e.length&&window.FileReader&&window.File)for(var a=e.length,s=Array(a),l=0,n=function(t,n){if(!r.options.allowDropFileTypes||-1!=g(r.options.allowDropFileTypes,t.type)){var i=new FileReader;i.onload=yi(r,function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),s[n]=t,++l==a){var e={from:o=pt(r.doc,o),to:o,text:r.doc.splitLines(s.join(r.doc.lineSeparator())),origin:"paste"};Lr(r.doc,e),wr(r.doc,ji(o,Wi(e)))}}),i.readAsText(t)}},i=0;i<a;++i)n(e[i],i);else{if(r.state.draggingText&&-1<r.doc.sel.contains(o))return r.state.draggingText(t),void setTimeout(function(){return r.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var c;if(r.state.draggingText&&!r.state.draggingText.copy&&(c=r.listSelections()),Sr(r.doc,ji(o,o)),c)for(var h=0;h<c.length;++h)zr(r.doc,"",c[h].anchor,c[h].head,"drag");r.replaceSelection(u,"around","paste"),r.display.input.focus()}}catch(t){}}}}function Jr(t,e){if(_a&&(!t.state.draggingText||+new Date-Vs<100))z(e);else if(!O(t,e)&&!Ne(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!Ma)){var n=w("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Da&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),Da&&n.parentNode.removeChild(n)}}function to(t,e){var n=Tn(t,e);if(n){var i=document.createDocumentFragment();Nn(t,n,i),t.display.dragCursor||(t.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),o(t.display.dragCursor,i)}}function eo(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function no(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}function io(){js||(ro(),js=!0)}function ro(){var t;rs(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null,no(oo)},100))}),rs(window,"blur",function(){return no(jn)})}function oo(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}function ao(t){var e,n,i,r,o=t.split(/-(?!$)/);t=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),r&&(t="Cmd-"+t),i&&(t="Shift-"+t),t}function so(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete t[n];continue}for(var r=v(n.split(" "),ao),o=0;o<r.length;o++){var a=void 0,s=void 0;o==r.length-1?(s=r.join(" "),a=i):(s=r.slice(0,o+1).join(" "),a="...");var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var u in e)t[u]=e[u];return t}function lo(t,e,n,i){var r=(e=fo(e)).call?e.call(t,i):e[t];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return lo(t,e.fallthrough,n,i);for(var o=0;o<e.fallthrough.length;o++){var a=lo(t,e.fallthrough[o],n,i);if(a)return a}}}function uo(t){var e="string"==typeof t?t:Ws[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function co(t,e,n){var i=t;return e.altKey&&"Alt"!=i&&(t="Alt-"+t),(Ha?e.metaKey:e.ctrlKey)&&"Ctrl"!=i&&(t="Ctrl-"+t),(Ha?e.ctrlKey:e.metaKey)&&"Cmd"!=i&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=i&&(t="Shift-"+t),t}function ho(t,e){if(Da&&34==t.keyCode&&t["char"])return!1;var n=Ws[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),co(n,t,e))}function fo(t){return"string"==typeof t?Gs[t]:t}function po(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&<(o.from,W(i).to)<=0;){var a=i.pop();if(lt(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}vi(e,function(){for(var t=i.length-1;0<=t;t--)zr(e.doc,"",i[t].from,i[t].to,"+delete");Kn(e)})}function go(t,e,n){var i=A(t.text,e+n,n);return i<0||i>t.text.length?null:i}function mo(t,e,n){var i=go(t,e.ch,n);return null==i?null:new st(e.line,i,n<0?"after":"before")}function vo(t,e,n,i,r){if(t){var o=E(n,e.doc.direction);if(o){var a,s=r<0?W(o):o[0],l=r<0==(1==s.level)?"after":"before";if(0<s.level||"rtl"==e.doc.direction){var u=Ge(e,n);a=r<0?n.text.length-1:0;var c=Ye(e,u,a).top;a=D(function(t){return Ye(e,u,t).top==c},r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=go(n,a,1))}else a=r<0?s.to:s.from;return new st(i,a,l)}}return new st(i,r<0?n.text.length:0,r<0?"before":"after")}function yo(e,n,s,t){var l=E(n,e.doc.direction);if(!l)return mo(n,s,t);s.ch>=n.text.length?(s.ch=n.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var i=b(l,s.ch,s.sticky),r=l[i];if("ltr"==e.doc.direction&&r.level%2==0&&(0<t?r.to>s.ch:r.from<s.ch))return mo(n,s,t);var o,u=function(t,e){return go(n,t instanceof st?t.ch:t,e)},a=function(t){return e.options.lineWrapping?(o=o||Ge(e,n),pn(e,n,o,t)):{begin:0,end:n.text.length}},c=a("before"==s.sticky?u(s,-1):s.ch);if("rtl"==e.doc.direction||1==r.level){var h=1==r.level==t<0,d=u(s,h?1:-1);if(null!=d&&(h?d<=r.to&&d<=c.end:d>=r.from&&d>=c.begin)){var f=h?"before":"after";return new st(s.line,d,f)}}var p=function(t,e,n){for(var i=function(t,e){return e?new st(s.line,u(t,1),"before"):new st(s.line,t,"after")};0<=t&&t<l.length;t+=e){var r=l[t],o=0<e==(1!=r.level),a=o?n.begin:u(n.end,-1);if(r.from<=a&&a<r.to)return i(a,o);if(a=o?r.from:u(r.to,-1),n.begin<=a&&a<n.end)return i(a,o)}},g=p(i+t,t,c);if(g)return g;var m=0<t?c.end:u(c.begin,-1);return null==m||0<t&&m==n.text.length||!(g=p(0<t?0:l.length-1,t,a(m)))?null:g}function xo(t,e){var n=J(t.doc,e),i=Zt(n);return i!=n&&(e=it(i)),vo(!0,t,i,e,1)}function bo(t,e){var n=J(t.doc,e),i=Xt(n);return i!=n&&(e=it(i)),vo(!0,t,n,e,-1)}function wo(t,e){var n=xo(t,e.line),i=J(t.doc,n.line),r=E(i,t.doc.direction);if(r&&0!=r[0].level)return n;var o=Math.max(0,i.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return st(n.line,a?0:o,n.sticky)}function _o(t,e,n){if("string"==typeof e&&!(e=Xs[e]))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=Ya}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}function So(t,e,n){for(var i=0;i<t.state.keyMaps.length;i++){var r=lo(e,t.state.keyMaps[i],n,t);if(r)return r}return t.options.extraKeys&&lo(e,t.options.extraKeys,n,t)||lo(e,t.options.keyMap,n,t)}function Co(t,e,n,i){var r=t.state.keySeq;if(r){if(uo(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:Ks.set(50,function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())}),To(t,r+" "+e,n,i))return!0}return To(t,e,n,i)}function To(t,e,n,i){var r=So(t,e,i);return"multi"==r&&(t.state.keySeq=e),"handled"==r&&be(t,"keyHandled",t,e,n),"handled"!=r&&"multi"!=r||(R(n),zn(t)),!!r}function Ao(e,t){var n=ho(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?Co(e,"Shift-"+n,t,function(t){return _o(e,t,!0)})||Co(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return _o(e,t)}):Co(e,n,t,function(t){return _o(e,t)}))}function Do(e,t,n){return Co(e,"'"+n+"'",t,function(t){return _o(e,t,!0)})}function Mo(t){var e=this;if(e.curOp.focus=d(),!O(e,t)){_a&&Sa<11&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var i=Ao(e,t);Da&&(Qs=i?n:null,!i&&88==n&&!ls&&(Pa?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||Io(e)}}function Io(t){function e(t){18!=t.keyCode&&t.altKey||(Va(n,"CodeMirror-crosshair"),I(document,"keyup",e),I(document,"mouseover",e))}var n=t.display.lineDiv;i(n,"CodeMirror-crosshair"),rs(document,"keyup",e),rs(document,"mouseover",e)}function ko(t){16==t.keyCode&&(this.doc.sel.shift=!1),O(this,t)}function Eo(t){var e=this;if(!(Ne(e.display,t)||O(e,t)||t.ctrlKey&&!t.altKey||Pa&&t.metaKey)){var n=t.keyCode,i=t.charCode;if(Da&&n==Qs)return Qs=null,void R(t);if(!Da||t.which&&!(t.which<10)||!Ao(e,t)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(Do(e,t,r)||e.display.input.onKeyPress(t))}}}function Lo(t,e){var n=+new Date;return Zs&&Zs.compare(n,t,e)?(Ys=Zs=null,"triple"):Ys&&Ys.compare(n,t,e)?(Zs=new tl(n,t,e),Ys=null,"double"):(Ys=new tl(n,t,e),Zs=null,"single")}function Oo(t){var e=this,n=e.display;if(!(O(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Ne(n,t))Ca||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!jo(e,t)){var i=Tn(e,t),r=B(t),o=i?Lo(i,r):"single";window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),i&&Po(e,r,i,o,t)||(1==r?i?Ro(e,i,o,t):H(t)==n.scroller&&R(t):2==r?(i&&mr(e.doc,i),setTimeout(function(){return n.input.focus()},20)):3==r&&(Ba?e.display.input.onContextMenu(t):Bn(e)))}}function Po(n,t,i,e,r){var o="Click";return"double"==e?o="Double"+o:"triple"==e&&(o="Triple"+o),Co(n,co(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,function(t){if("string"==typeof t&&(t=Xs[t]),!t)return!1;var e=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),e=t(n,i)!=Ya}finally{n.state.suppressEdits=!1}return e})}function No(t,e,n){var i=t.getOption("configureMouse"),r=i?i(t,e,n):{};if(null==r.unit){var o=Na?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==r.extend||t.doc.extend)&&(r.extend=t.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=Pa?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(Pa?n.altKey:n.ctrlKey)),r}function Ro(t,e,n,i){_a?setTimeout(u(Hn,t),0):t.curOp.focus=d();var r,o=No(t,n,i),a=t.doc.sel;t.options.dragDrop&&os&&!t.isReadOnly()&&"single"==n&&-1<(r=a.contains(e))&&(lt((r=a.ranges[r]).from(),e)<0||0<e.xRel)&&(0<lt(r.to(),e)||e.xRel<0)?Fo(t,i,e,o):Ho(t,i,e,o)}function Fo(e,n,i,r){var o=e.display,a=!1,s=yi(e,function(t){Ca&&(o.scroller.draggable=!1),e.state.draggingText=!1,I(o.wrapper.ownerDocument,"mouseup",s),I(o.wrapper.ownerDocument,"mousemove",l),I(o.scroller,"dragstart",u),I(o.scroller,"drop",s),a||(R(t),r.addNew||mr(e.doc,i,null,null,r.extend),Ca||_a&&9==Sa?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),l=function(t){a=a||10<=Math.abs(n.clientX-t.clientX)+Math.abs(n.clientY-t.clientY)},u=function(){return a=!0};Ca&&(o.scroller.draggable=!0),(e.state.draggingText=s).copy=!r.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),rs(o.wrapper.ownerDocument,"mouseup",s),rs(o.wrapper.ownerDocument,"mousemove",l),rs(o.scroller,"dragstart",u),rs(o.scroller,"drop",s),Bn(e),setTimeout(function(){return o.input.focus()},20)}function zo(t,e,n){if("char"==n)return new Ps(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ps(st(e.line,0),pt(t.doc,st(e.line+1,0)));var i=n(t,e);return new Ps(i.from,i.to)}function Ho(m,t,v,y){function o(t){if(0!=lt(S,t))if(S=t,"rectangle"==y.unit){for(var e=[],n=m.options.tabSize,i=C(J(x,v.line).text,v.ch,n),r=C(J(x,t.line).text,t.ch,n),o=Math.min(i,r),a=Math.max(i,r),s=Math.min(v.line,t.line),l=Math.min(m.lastLine(),Math.max(v.line,t.line));s<=l;s++){var u=J(x,s).text,c=T(u,o,n);o==a?e.push(new Ps(st(s,c),st(s,c))):u.length>c&&e.push(new Ps(st(s,c),st(s,T(u,a,n))))}e.length||e.push(new Ps(v,v)),_r(x,Vi(m,_.ranges.slice(0,w).concat(e),w),{origin:"*mouse",scroll:!1}),m.scrollIntoView(t)}else{var h,d=b,f=zo(m,t,y.unit),p=d.anchor;0<lt(f.anchor,p)?(h=f.head,p=dt(d.from(),f.anchor)):(h=f.anchor,p=ht(d.to(),f.head));var g=_.ranges.slice(0);g[w]=Bo(m,new Ps(pt(x,p),h)),_r(x,Vi(m,g,w),Xa)}}function a(t){var e=++u,n=Tn(m,t,!0,"rectangle"==y.unit);if(n)if(0!=lt(n,S)){m.curOp.focus=d(),o(n);var i=$n(s,x);(n.line>=i.to||n.line<i.from)&&setTimeout(yi(m,function(){u==e&&a(t)}),150)}else{var r=t.clientY<l.top?-20:t.clientY>l.bottom?20:0;r&&setTimeout(yi(m,function(){u==e&&(s.scroller.scrollTop+=r,a(t))}),50)}}function e(t){m.state.selectingText=!1,u=Infinity,t&&(R(t),s.input.focus()),I(s.wrapper.ownerDocument,"mousemove",r),I(s.wrapper.ownerDocument,"mouseup",c),x.history.lastSelOrigin=null}var s=m.display,x=m.doc;R(t);var b,w,_=x.sel,n=_.ranges;if(y.addNew&&!y.extend?(w=x.sel.contains(v),b=-1<w?n[w]:new Ps(v,v)):(b=x.sel.primary(),w=x.sel.primIndex),"rectangle"==y.unit)y.addNew||(b=new Ps(v,v)),v=Tn(m,t,!0,!0),w=-1;else{var i=zo(m,v,y.unit);b=y.extend?gr(b,i.anchor,i.head,y.extend):i}y.addNew?-1==w?(w=n.length,_r(x,Vi(m,n.concat([b]),w),{scroll:!1,origin:"*mouse"})):1<n.length&&n[w].empty()&&"char"==y.unit&&!y.extend?(_r(x,Vi(m,n.slice(0,w).concat(n.slice(w+1)),0),{scroll:!1,origin:"*mouse"}),_=x.sel):yr(x,w,b,Xa):(_r(x,new Os([b],w=0),Xa),_=x.sel);var S=v,l=s.wrapper.getBoundingClientRect(),u=0,r=yi(m,function(t){0!==t.buttons&&B(t)?a(t):e(t)}),c=yi(m,e);m.state.selectingText=c,rs(s.wrapper.ownerDocument,"mousemove",r),rs(s.wrapper.ownerDocument,"mouseup",c)}function Bo(t,e){var n=e.anchor,i=e.head,r=J(t.doc,n.line);if(0==lt(n,i)&&n.sticky==i.sticky)return e;var o=E(r);if(!o)return e;var a=b(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return e;if(i.line!=n.line)l=0<(i.line-n.line)*("ltr"==t.doc.direction?1:-1);else{var c=b(o,i.ch,i.sticky),h=c-a||(i.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?h<0:0<h}var d=o[u+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new Ps(new st(n.line,p,g),i)}function Vo(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(e){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&R(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!N(t,n))return F(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=r)return L(t,n,t,rt(t.doc,o),t.display.gutterSpecs[l].className,e),F(e)}}function jo(t,e){return Vo(t,e,"gutterClick",!0)}function Wo(t,e){Ne(t.display,e)||Uo(t,e)||O(t,e,"contextmenu")||Ba||t.display.input.onContextMenu(e)}function Uo(t,e){return!!N(t,"gutterContextMenu")&&Vo(t,e,"gutterContextMenu",!1)}function $o(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),en(t)}function qo(r){function t(t,e,i,n){r.defaults[t]=e,i&&(o[t]=n?function(t,e,n){n!=el&&i(t,e,n)}:i)}var o=r.optionHandlers;r.defineOption=t,r.Init=el,t("value","",function(t,e){return t.setValue(e)},!0),t("mode",null,function(t,e){t.doc.modeOption=e,Yi(t)},!0),t("indentUnit",2,Yi,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(t){Zi(t),en(t),Dn(t)},!0),t("lineSeparator",null,function(t,i){if(t.doc.lineSep=i){var r=[],o=t.doc.first;t.doc.iter(function(t){for(var e=0;;){var n=t.text.indexOf(i,e);if(-1==n)break;e=n+i.length,r.push(st(o,n))}o++});for(var e=r.length-1;0<=e;e--)zr(t.doc,i,r[e],st(r[e].line,r[e].ch+i.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=el&&t.refresh()}),t("specialCharPlaceholder",ue,function(t){return t.refresh()},!0),t("electricChars",!0),t("inputStyle",Oa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),t("autocorrect",!1,function(t,e){return t.getInputField().autocorrect=e},!0),t("autocapitalize",!1,function(t,e){return t.getInputField().autocapitalize=e},!0),t("rtlMoveVisually",!Ra),t("wholeLineUpdateBefore",!0),t("theme","default",function(t){$o(t),Ri(t)},!0),t("keyMap","default",function(t,e,n){var i=fo(e),r=n!=el&&fo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Yo,!0),t("gutters",[],function(t,e){t.display.gutterSpecs=Pi(e,t.options.lineNumbers),Ri(t)},!0),t("fixedGutter",!0,
|
|
function(t,e){t.display.gutters.style.left=e?_n(t.display)+"px":"0",t.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(t){return ai(t)},!0),t("scrollbarStyle","native",function(t){li(t),ai(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),t("lineNumbers",!1,function(t,e){t.display.gutterSpecs=Pi(t.options.gutters,e),Ri(t)},!0),t("firstLineNumber",1,Ri,!0),t("lineNumberFormatter",function(t){return t},Ri,!0),t("showCursorWhenSelecting",!1,On,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,function(t,e){"nocursor"==e&&(jn(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),t("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),t("dragDrop",!0,Go),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,On,!0),t("singleCursorHeightPerLine",!0,On,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Zi,!0),t("addModeClass",!1,Zi,!0),t("pollInterval",100),t("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),t("historyEventDelay",1250),t("viewportMargin",10,function(t){return t.refresh()},!0),t("maxHighlightLength",1e4,Zi,!0),t("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),t("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),t("autofocus",null),t("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0),t("phrases",null)}function Go(t,e,n){if(!e!=!(n&&n!=el)){var i=t.display.dragFunctions,r=e?rs:I;r(t.display.scroller,"dragstart",i.start),r(t.display.scroller,"dragenter",i.enter),r(t.display.scroller,"dragover",i.over),r(t.display.scroller,"dragleave",i.leave),r(t.display.scroller,"drop",i.drop)}}function Yo(t){t.options.lineWrapping?(i(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Va(t.display.wrapper,"CodeMirror-wrap"),re(t)),Cn(t),Dn(t),en(t),setTimeout(function(){return ai(t)},100)}function Zo(t,e){var n=this;if(!(this instanceof Zo))return new Zo(t,e);this.options=e=e?f(e):{},f(nl,e,!1);var i=e.value;"string"==typeof i?i=new Bs(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Zo.inputStyles[e.inputStyle](this),o=this.display=new Fi(t,i,r,e);for(var a in $o(o.wrapper.CodeMirror=this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),li(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 Wa,keySeq:null,specialChars:null},e.autofocus&&!Oa&&o.input.focus(),_a&&Sa<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Xo(this),io(),ui(this),this.curOp.forceUpdate=!0,Ji(this,i),e.autofocus&&!Oa||this.hasFocus()?setTimeout(u(Vn,this),20):jn(this),il)il.hasOwnProperty(a)&&il[a](n,e[a],el);Oi(this),e.finishInit&&e.finishInit(this);for(var s=0;s<rl.length;++s)rl[s](n);ci(this),Ca&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Xo(r){function o(){s.activeTouch&&(i=setTimeout(function(){return s.activeTouch=null},1e3),(l=s.activeTouch).end=+new Date)}function n(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function a(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return 400<n*n+i*i}var s=r.display;rs(s.scroller,"mousedown",yi(r,Oo)),rs(s.scroller,"dblclick",_a&&Sa<11?yi(r,function(t){if(!O(r,t)){var e=Tn(r,t);if(e&&!jo(r,t)&&!Ne(r.display,t)){R(t);var n=r.findWordAt(e);mr(r.doc,n.anchor,n.head)}}}):function(t){return O(r,t)||R(t)}),rs(s.scroller,"contextmenu",function(t){return Wo(r,t)});var i,l={end:0};rs(s.scroller,"touchstart",function(t){if(!O(r,t)&&!n(t)&&!jo(r,t)){s.input.ensurePolled(),clearTimeout(i);var e=+new Date;s.activeTouch={start:e,moved:!1,prev:e-l.end<=300?l:null},1==t.touches.length&&(s.activeTouch.left=t.touches[0].pageX,s.activeTouch.top=t.touches[0].pageY)}}),rs(s.scroller,"touchmove",function(){s.activeTouch&&(s.activeTouch.moved=!0)}),rs(s.scroller,"touchend",function(t){var e=s.activeTouch;if(e&&!Ne(s,t)&&null!=e.left&&!e.moved&&new Date-e.start<300){var n,i=r.coordsChar(s.activeTouch,"page");n=!e.prev||a(e,e.prev)?new Ps(i,i):!e.prev.prev||a(e,e.prev.prev)?r.findWordAt(i):new Ps(st(i.line,0),pt(r.doc,st(i.line+1,0))),r.setSelection(n.anchor,n.head),r.focus(),R(t)}o()}),rs(s.scroller,"touchcancel",o),rs(s.scroller,"scroll",function(){s.scroller.clientHeight&&(ni(r,s.scroller.scrollTop),ri(r,s.scroller.scrollLeft,!0),L(r,"scroll",r))}),rs(s.scroller,"mousewheel",function(t){return Bi(r,t)}),rs(s.scroller,"DOMMouseScroll",function(t){return Bi(r,t)}),rs(s.wrapper,"scroll",function(){return s.wrapper.scrollTop=s.wrapper.scrollLeft=0}),s.dragFunctions={enter:function(t){O(r,t)||z(t)},over:function(t){O(r,t)||(to(r,t),z(t))},start:function(t){return Jr(r,t)},drop:yi(r,Qr),leave:function(t){O(r,t)||eo(r)}};var t=s.input.getField();rs(t,"keyup",function(t){return ko.call(r,t)}),rs(t,"keydown",yi(r,Mo)),rs(t,"keypress",yi(r,Eo)),rs(t,"focus",function(t){return Vn(r,t)}),rs(t,"blur",function(t){return jn(r,t)})}function Ko(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=xt(t,e).state:n="prev");var a=t.options.tabSize,s=J(o,e),l=C(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(r,s.text.slice(c.length),s.text))==Ya||150<u)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?C(J(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)d+=a,h+="\t";if(d<u&&(h+=_(u-d)),h!=c)return zr(o,h,st(e,0),st(e,c.length),"+input"),!(s.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==e&&g.head.ch<c.length){var m=st(e,c.length);yr(o,p,new Ps(m,m));break}}}function Qo(t){ol=t}function Jo(t,e,n,i,r){var o=t.doc;t.display.shift=!1,i||(i=o.sel);var a=+new Date-200,s="paste"==r||t.state.pasteIncoming>a,l=as(e),u=null;if(s&&1<i.ranges.length)if(ol&&ol.text.join("\n")==e){if(i.ranges.length%ol.text.length==0){u=[];for(var c=0;c<ol.text.length;c++)u.push(o.splitLines(ol.text[c]))}}else l.length==i.ranges.length&&t.options.pasteLinesPerSelection&&(u=v(l,function(t){return[t]}));for(var h=t.curOp.updateInput,d=i.ranges.length-1;0<=d;d--){var f=i.ranges[d],p=f.from(),g=f.to();f.empty()&&(n&&0<n?p=st(p.line,p.ch-n):t.state.overwrite&&!s?g=st(g.line,Math.min(J(o,g.line).text.length,g.ch+W(l).length)):s&&ol&&ol.lineWise&&ol.text.join("\n")==e&&(p=g=st(p.line,0)));var m={from:p,to:g,text:u?u[d%u.length]:l,origin:r||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Lr(t.doc,m),be(t,"inputRead",t,m)}e&&!s&&ea(t,e),Kn(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function ta(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||vi(e,function(){return Jo(e,n,0,null,"paste")}),!0}function ea(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;0<=i;i--){var r=n.ranges[i];if(!(100<r.head.ch||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<e.indexOf(o.electricChars.charAt(s))){a=Ko(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(J(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Ko(t,r.head.line,"smart"));a&&be(t,"electricInput",t,r.head.line)}}}function na(t){for(var e=[],n=[],i=0;i<t.doc.sel.ranges.length;i++){var r=t.doc.sel.ranges[i].head.line,o={anchor:st(r,0),head:st(r+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function ia(t,e,n,i){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",i?"":"off"),t.setAttribute("spellcheck",!!e)}function ra(){var t=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=w("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Ca?t.style.width="1000px":t.setAttribute("wrap","off"),Ea&&(t.style.border="1px solid black"),ia(t),e}function oa(r){var o=r.optionHandlers,c=r.helpers={};r.prototype={constructor:r,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,e){var n=this.options,i=n[t];n[t]==e&&"mode"!=t||(n[t]=e,o.hasOwnProperty(t)&&yi(this,o[t])(this,e,i),L(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](fo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:xi(function(t,e){var n=t.token?t:r.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");a(this.state.overlays,{mode:n,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},function(t){return t.priority}),this.state.modeGen++,Dn(this)}),removeOverlay:xi(function(t){for(var e=this,n=this.state.overlays,i=0;i<n.length;++i){var r=n[i].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return n.splice(i,1),e.state.modeGen++,void Dn(e)}}),indentLine:xi(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ot(this.doc,t)&&Ko(this,t,e,n)}),indentSelection:xi(function(t){for(var e=this,n=this.doc.sel.ranges,i=-1,r=0;r<n.length;r++){var o=n[r];if(o.empty())o.head.line>i&&(Ko(e,o.head.line,t,!0),i=o.head.line,r==e.doc.sel.primIndex&&Kn(e));else{var a=o.from(),s=o.to(),l=Math.max(i,a.line);i=Math.min(e.lastLine(),s.line-(s.ch?0:1))+1;for(var u=l;u<i;++u)Ko(e,u,t);var c=e.doc.sel.ranges;0==a.ch&&n.length==c.length&&0<c[r].from().ch&&yr(e.doc,r,new Ps(a,c[r].to()),Za)}}}),getTokenAt:function(t,e){return St(this,t,e)},getLineTokens:function(t,e){return St(this,st(t),e,!0)},getTokenTypeAt:function(t){t=pt(this.doc,t);var e,n=yt(this,J(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}i=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(t){var e=this.doc.mode;return e.innerMode?r.innerMode(e,this.getTokenAt(t).state).mode:e},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=this,i=[];if(!c.hasOwnProperty(e))return i;var r=c[e],o=this.getModeAt(t);if("string"==typeof o[e])r[o[e]]&&i.push(r[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=r[o[e][a]];s&&i.push(s)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var u=r._global[l];u.pred(o,n)&&-1==g(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(t,e){var n=this.doc;return xt(this,(t=ft(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return un(this,null==t?n.head:"object"==typeof t?pt(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return ln(this,pt(this.doc,t),e||"page")},coordsChar:function(t,e){return dn(this,(t=sn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=sn(this,{top:t,left:0},e||"page").top,rt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var i,r=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:o<t&&(t=o,r=!0),i=J(this.doc,t)}else i=t;return an(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-ne(i):0)},defaultTextHeight:function(){return xn(this.display)},defaultCharWidth:function(){return bn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display,a=(t=un(this,pt(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)a=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==r?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&Yn(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:xi(Mo),triggerOnKeyPress:xi(Eo),triggerOnKeyUp:ko,triggerOnMouseDown:xi(Oo),execCommand:function(t){if(Xs.hasOwnProperty(t))return Xs[t].call(null,this)},triggerElectric:xi(function(t){ea(this,t)}),findPosH:function(t,e,n,i){var r=this,o=1;e<0&&(o=-1,e=-e);for(var a=pt(this.doc,t),s=0;s<e&&!(a=aa(r.doc,a,o,n,i)).hitSide;++s);return a},moveH:xi(function(e,n){var i=this;this.extendSelectionsBy(function(t){return i.display.shift||i.doc.extend||t.empty()?aa(i.doc,t.head,e,n,i.options.rtlMoveVisually):e<0?t.from():t.to()},Ka)}),deleteH:xi(function(n,i){var t=this.doc.sel,r=this.doc;t.somethingSelected()?r.replaceSelection("",null,"+delete"):po(this,function(t){var e=aa(r,t.head,n,i,!1);return n<0?{from:e,to:t.head}:{from:t.head,to:e}})}),findPosV:function(t,e,n,i){var r=this,o=1,a=i;e<0&&(o=-1,e=-e);for(var s=pt(this.doc,t),l=0;l<e;++l){var u=un(r,s,"div");if(null==a?a=u.left:u.left=a,(s=sa(r,u,o,n)).hitSide)break}return s},moveV:xi(function(i,r){var o=this,a=this.doc,s=[],l=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(t){if(l)return i<0?t.from():t.to();var e=un(o,t.head,"div");null!=t.goalColumn&&(e.left=t.goalColumn),s.push(e.left);var n=sa(o,e,i,r);return"page"==r&&t==a.sel.primary()&&Xn(o,ln(o,n,"div").top-e.top),n},Ka),s.length)for(var t=0;t<a.sel.ranges.length;t++)a.sel.ranges[t].goalColumn=s[t]}),findWordAt:function(t){var e=J(this.doc,t.line).text,n=t.ch,i=t.ch;if(e){var r=this.getHelper(t,"wordChars");"before"!=t.sticky&&i!=e.length||!n?++i:--n;for(var o=e.charAt(n),a=y(o,r)?function(t){return y(t,r)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!y(t)};0<n&&a(e.charAt(n-1));)--n;for(;i<e.length&&a(e.charAt(i));)++i}return new Ps(st(t.line,n),st(t.line,i))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?i(this.display.cursorDiv,"CodeMirror-overwrite"):Va(this.display.cursorDiv,"CodeMirror-overwrite"),L(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==d()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:xi(function(t,e){Qn(this,t,e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-He(this)-this.display.barHeight,width:t.scrollWidth-He(this)-this.display.barWidth,clientHeight:Ve(this),clientWidth:Be(this)}},scrollIntoView:xi(function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:st(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?Jn(this,t):ei(this,t.from,t.to,t.margin)}),setSize:xi(function(t,e){var n=this,i=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=i(t)),null!=e&&(this.display.wrapper.style.height=i(e)),this.options.lineWrapping&&tn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){Mn(n,r,"widget");break}++r}),this.curOp.forceUpdate=!0,L(this,"refresh",this)}),operation:function(t){return vi(this,t)},startOperation:function(){return ui(this)},endOperation:function(){return ci(this)},refresh:xi(function(){var t=this.display.cachedTextHeight;Dn(this),this.curOp.forceUpdate=!0,en(this),Qn(this,this.doc.scrollLeft,this.doc.scrollTop),ki(this.display),(null==t||.5<Math.abs(t-xn(this.display)))&&Cn(this),L(this,"refresh",this)}),swapDoc:xi(function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ji(this,t),en(this),this.display.input.reset(),Qn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,be(this,"swapDoc",this,e),e}),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[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}},t(r),r.registerHelper=function(t,e,n){c.hasOwnProperty(t)||(c[t]=r[t]={_global:[]}),c[t][e]=n},r.registerGlobalHelper=function(t,e,n,i){r.registerHelper(t,e,i),c[t]._global.push({pred:n,val:i})}}function aa(n,i,r,t,o){function a(){var t=i.line+r;return!(t<n.first||t>=n.first+n.size)&&(i=new st(t,i.ch,i.sticky),u=J(n,t))}function e(t){var e;if(null==(e=o?yo(n.cm,u,i,r):mo(u,i,r))){if(t||!a())return!1;i=vo(o,n.cm,u,i.line,r)}else i=e;return!0}var s=i,l=r,u=J(n,i.line);if("char"==t)e();else if("column"==t)e(!0);else if("word"==t||"group"==t)for(var c=null,h="group"==t,d=n.cm&&n.cm.getHelper(i,"wordChars"),f=!0;!(r<0)||e(!f);f=!1){var p=u.text.charAt(i.ch)||"\n",g=y(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),c&&c!=g){r<0&&(r=1,e(),i.sticky="after");break}if(g&&(c=g),0<r&&!e(!f))break}var m=Mr(n,i,s,l,!0);return ut(s,m)&&(m.hitSide=!0),m}function sa(t,e,n,i){var r,o,a=t.doc,s=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*xn(t.display),3);r=(0<n?e.bottom:e.top)+n*u}else"line"==i&&(r=0<n?e.bottom+3:e.top-3);for(;(o=dn(t,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}function la(t,e){var n=qe(t,e.line);if(!n||n.hidden)return null;var i=J(t.doc,e.line),r=We(n,i,e.line),o=E(i,t.doc.direction),a="left";o&&(a=b(o,e.ch)%2?"right":"left");var s=Ze(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ua(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function ca(t,e){return e&&(t.bad=!0),t}function ha(s,t,e,l,u){function c(e){return function(t){return t.id==e}}function h(){p&&(n+=g,m&&(n+=g),p=m=!1)}function d(t){t&&(h(),n+=t)}function f(t){if(1==t.nodeType){var e=t.getAttribute("cm-text");if(e)return void d(e);var n,i=t.getAttribute("cm-marker");if(i){var r=s.findMarks(st(l,0),st(u+1,0),c(+i));return void(r.length&&(n=r[0].find(0))&&d(tt(s.doc,n.from,n.to).join(g)))}if("false"==t.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;o&&h();for(var a=0;a<t.childNodes.length;a++)f(t.childNodes[a]);/^(pre|p)$/i.test(t.nodeName)&&(m=!0),o&&(p=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var n="",p=!1,g=s.doc.lineSeparator(),m=!1;f(t),t!=e;)t=t.nextSibling,m=!1;return n}function da(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return ca(t.clipPos(st(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r<t.display.view.length;r++){var o=t.display.view[r];if(o.node==i)return fa(o,e,n)}}function fa(u,t,e){function n(t,e,n){for(var i=-1;i<(h?h.length:0);i++)for(var r=i<0?c.map:h[i],o=0;o<r.length;o+=3){var a=r[o+2];if(a==t||a==e){var s=it(i<0?u.line:u.rest[i]),l=r[o]+n;return(n<0||a!=t)&&(l=r[o+(n?1:0)]),st(s,l)}}}var i=u.text.firstChild,r=!1;if(!t||!m(i,t))return ca(st(it(u.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[e],e=0,!t)){var o=u.rest?W(u.rest):u.line;return ca(st(it(o),o.text.length),r)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,e&&(e=a.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=u.measure,h=c.maps,l=n(a,s,e);if(l)return ca(l,r);for(var d=s.nextSibling,f=a?a.nodeValue.length-e:0;d;d=d.nextSibling){if(l=n(d,d.firstChild,0))return ca(st(l.line,l.ch-f),r);f+=d.textContent.length}for(var p=s.previousSibling,g=e;p;p=p.previousSibling){if(l=n(p,p.firstChild,-1))return ca(st(l.line,l.ch+g),r);g+=p.textContent.length}}function pa(e,t){function n(){e.value=s.getValue()}if((t=t?f(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var i=d();t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}var r;if(e.form&&(rs(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){n(),o.submit=r,o.submit(),o.submit=a}}catch(l){}}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&&(I(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=r))}},e.style.display="none";var s=Zo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function ga(t){t.off=I,t.on=rs,t.wheelEventPixels=Hi,t.Doc=Bs,t.splitLines=as,t.countColumn=C,t.findColumn=T,t.isWordChar=c,t.Pass=Ya,t.signal=L,t.Line=xs,t.changeEnd=Wi,t.scrollbarModel=Ms,t.Pos=st,t.cmpPos=lt,t.modes=cs,t.mimeModes=hs,t.resolveMode=G,t.getMode=Y,t.modeExtensions=ds,t.extendMode=Z,t.copyState=X,t.startState=Q,t.innerMode=K,t.commands=Xs,t.keyMap=Gs,t.keyName=ho,t.isModifierKey=uo,t.lookupKey=lo,t.normalizeKeyMap=so,t.StringStream=fs,t.SharedTextMarker=zs,t.TextMarker=Fs,t.LineWidget=Ns,t.e_preventDefault=R,t.e_stopPropagation=e,t.e_stop=z,t.addClass=i,t.contains=m,t.rmClass=Va,t.keyNames=Ws}var ma=navigator.userAgent,va=navigator.platform,ya=/gecko\/\d/i.test(ma),xa=/MSIE \d/.test(ma),ba=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ma),wa=/Edge\/(\d+)/.exec(ma),_a=xa||ba||wa,Sa=_a&&(xa?document.documentMode||6:+(wa||ba)[1]),Ca=!wa&&/WebKit\//.test(ma),Ta=Ca&&/Qt\/\d+\.\d+/.test(ma),Aa=!wa&&/Chrome\//.test(ma),Da=/Opera\//.test(ma),Ma=/Apple Computer/.test(navigator.vendor),Ia=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ma),ka=/PhantomJS/.test(ma),Ea=!wa&&/AppleWebKit/.test(ma)&&/Mobile\/\w+/.test(ma),La=/Android/.test(ma),Oa=Ea||La||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ma),Pa=Ea||/Mac/.test(va),Na=/\bCrOS\b/.test(ma),Ra=/win/i.test(va),Fa=Da&&ma.match(/Version\/(\d*\.\d*)/);Fa&&(Fa=Number(Fa[1])),Fa&&15<=Fa&&(Ca=!(Da=!1));var za,Ha=Pa&&(Ta||Da&&(null==Fa||Fa<12.11)),Ba=ya||_a&&9<=Sa,Va=function(t,e){var n=t.className,i=s(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};za=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var ja=function(t){t.select()};Ea?ja=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:_a&&(ja=function(t){try{t.select()}catch(e){}});var Wa=function(){this.id=null};Wa.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var Ua,$a,qa,Ga=30,Ya={toString:function(){return"CodeMirror.Pass"}},Za={scroll:!1},Xa={origin:"*mouse"},Ka={origin:"+move"},Qa=[""],Ja=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ts=/[\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]/,es=null,ns=function(){function R(t){return t<=247?e.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?n.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function F(t,e,n){this.level=t,this.from=e,this.to=n}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",z=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,H=/[stwN]/,B=/[LRr]/,V=/[Lb1n]/,j=/[1n]/;return function(t,e){var n="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!z.test(t))return!1;for(var i=t.length,r=[],o=0;o<i;++o)r.push(R(t.charCodeAt(o)));for(var a=0,s=n;a<i;++a){var l=r[a];"m"==l?r[a]=s:s=l}for(var u=0,c=n;u<i;++u){var h=r[u];"1"==h&&"r"==c?r[u]="n":B.test(h)&&"r"==(c=h)&&(r[u]="R")}for(var d=1,f=r[0];d<i-1;++d){var p=r[d];"+"==p&&"1"==f&&"1"==r[d+1]?r[d]="1":","!=p||f!=r[d+1]||"1"!=f&&"n"!=f||(r[d]=f),f=p}for(var g=0;g<i;++g){var m=r[g];if(","==m)r[g]="N";else if("%"==m){var v=void 0;for(v=g+1;v<i&&"%"==r[v];++v);for(var y=g&&"!"==r[g-1]||v<i&&"1"==r[v]?"1":"N",x=g;x<v;++x)r[x]=y;g=v-1}}for(var b=0,w=n;b<i;++b){var _=r[b];"L"==w&&"1"==_?r[b]="L":B.test(_)&&(w=_)}for(var S=0;S<i;++S)if(H.test(r[S])){var C=void 0;for(C=S+1;C<i&&H.test(r[C]);++C);for(var T="L"==(S?r[S-1]:n),A=T==("L"==(C<i?r[C]:n))?T?"L":"R":n,D=S;D<C;++D)r[D]=A;S=C-1}for(var M,I=[],k=0;k<i;)if(V.test(r[k])){var E=k;for(++k;k<i&&V.test(r[k]);++k);I.push(new F(0,E,k))}else{var L=k,O=I.length;for(++k;k<i&&"L"!=r[k];++k);for(var P=L;P<k;)if(j.test(r[P])){L<P&&I.splice(O,0,new F(1,L,P));var N=P;for(++P;P<k&&j.test(r[P]);++P);I.splice(O,0,new F(2,N,P)),L=P}else++P;L<k&&I.splice(O,0,new F(1,L,k))}return"ltr"==e&&(1==I[0].level&&(M=t.match(/^\s+/))&&(I[0].from=M[0].length,I.unshift(new F(0,0,M[0].length))),1==W(I).level&&(M=t.match(/\s+$/))&&(W(I).to-=M[0].length,I.push(new F(0,i-M[0].length,i)))),"rtl"==e?I.reverse():I}}(),is=[],rs=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var i=t._handlers||(t._handlers={});i[e]=(i[e]||is).concat(n)}},os=function(){if(_a&&Sa<9)return!1;var t=w("div");return"draggable"in t||"dragDrop"in t}(),as=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},ss=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},ls="oncopy"in(qa=w("div"))||(qa.setAttribute("oncopy","return;"),"function"==typeof qa.oncopy),us=null,cs={},hs={},ds={},fs=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};fs.prototype.eol=function(){return this.pos>=this.string.length},fs.prototype.sol=function(){return this.pos==this.lineStart},fs.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},fs.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},fs.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},fs.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},fs.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},fs.prototype.skipToEnd=function(){this.pos=this.string.length},fs.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(-1<e)return this.pos=e,!0},fs.prototype.backUp=function(t){this.pos-=t},fs.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=C(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},fs.prototype.indentation=function(){return C(this.string,null,this.tabSize)-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},fs.prototype.match=function(t,e,n){if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&0<i.index?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},fs.prototype.current=function(){return this.string.slice(this.start,this.pos)},fs.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},fs.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},fs.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ps=function(t,e){this.state=t,this.lookAhead=e},gs=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};gs.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},gs.prototype.baseToken=function(t){var e=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)e.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},gs.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},gs.fromSaved=function(t,e,n){return e instanceof ps?new gs(t,X(t.mode,e.state),n,e.lookAhead):new gs(t,X(t.mode,e),n)},gs.prototype.save=function(t){var e=!1!==t?X(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new ps(e,this.maxLookAhead):e};var ms=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n},vs=!1,ys=!1,xs=function(t,e,n){this.text=t,Bt(this,e),this.height=n?n(this):1};xs.prototype.lineNo=function(){return it(this)},t(xs);var bs,ws={},_s={},Ss=null,Cs=null,Ts={left:0,right:0,top:0,bottom:0},As=function(t,e,n){this.cm=n;var i=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=w("div",[
|
|
w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),rs(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),rs(r,"scroll",function(){r.clientWidth&&e(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,_a&&Sa<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};As.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<t.clientHeight&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},As.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},As.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},As.prototype.zeroWidthHack=function(){var t=Pa&&!Ia?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Wa,this.disableVert=new Wa},As.prototype.enableZeroWidthBar=function(e,n,i){function r(){var t=e.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=e?e.style.pointerEvents="none":n.set(1e3,r)}e.style.pointerEvents="auto",n.set(1e3,r)},As.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Ds=function(){};Ds.prototype.update=function(){return{bottom:0,right:0}},Ds.prototype.setScrollLeft=function(){},Ds.prototype.setScrollTop=function(){},Ds.prototype.clear=function(){};var Ms={"native":As,"null":Ds},Is=0,ks=function(t,e,n){var i=t.display;this.viewport=e,this.visible=$n(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Be(t),this.force=n,this.dims=wn(t),this.events=[]};ks.prototype.signal=function(t,e){N(t,e)&&this.events.push(arguments)},ks.prototype.finish=function(){for(var t=this,e=0;e<this.events.length;e++)L.apply(null,t.events[e])};var Es=0,Ls=null;_a?Ls=-.53:ya?Ls=15:Aa?Ls=-.7:Ma&&(Ls=-1/3);var Os=function(t,e){this.ranges=t,this.primIndex=e};Os.prototype.primary=function(){return this.ranges[this.primIndex]},Os.prototype.equals=function(t){var e=this;if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var i=e.ranges[n],r=t.ranges[n];if(!ut(i.anchor,r.anchor)||!ut(i.head,r.head))return!1}return!0},Os.prototype.deepCopy=function(){for(var t=this,e=[],n=0;n<this.ranges.length;n++)e[n]=new Ps(ct(t.ranges[n].anchor),ct(t.ranges[n].head));return new Os(e,this.primIndex)},Os.prototype.somethingSelected=function(){for(var t=this,e=0;e<this.ranges.length;e++)if(!t.ranges[e].empty())return!0;return!1},Os.prototype.contains=function(t,e){var n=this;e||(e=t);for(var i=0;i<this.ranges.length;i++){var r=n.ranges[i];if(0<=lt(e,r.from())&<(t,r.to())<=0)return i}return-1};var Ps=function(t,e){this.anchor=t,this.head=e};Ps.prototype.from=function(){return dt(this.anchor,this.head)},Ps.prototype.to=function(){return ht(this.anchor,this.head)},Ps.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Wr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=this,i=t,r=t+e;i<r;++i){var o=n.lines[i];n.height-=o.height,ae(o),be(o,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){var i=this;this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=i},iterN:function(t,e,n){for(var i=this,r=t+e;t<r;++t)if(n(i.lines[t]))return!0}},Ur.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){var n=this;this.size-=e;for(var i=0;i<this.children.length;++i){var r=n.children[i],o=r.chunkSize();if(t<o){var a=Math.min(e,o-t),s=r.height;if(r.removeInner(t,a),n.height-=s-r.height,o==a&&(n.children.splice(i--,1),r.parent=null),0==(e-=a))break;t=0}else t-=o}if(this.size-e<25&&(1<this.children.length||!(this.children[0]instanceof Wr))){var l=[];this.collapse(l),this.children=[new Wr(l)],this.children[0].parent=this}},collapse:function(t){for(var e=this,n=0;n<this.children.length;++n)e.children[n].collapse(t)},insertInner:function(t,e,n){var i=this;this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var o=i.children[r],a=o.chunkSize();if(t<=a){if(o.insertInner(t,e,n),o.lines&&50<o.lines.length){for(var s=o.lines.length%25+25,l=s;l<o.lines.length;){var u=new Wr(o.lines.slice(l,l+=25));o.height-=u.height,i.children.splice(++r,0,u),u.parent=i}o.lines=o.lines.slice(0,s),i.maybeSpill()}break}t-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new Ur(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=g(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var i=new Ur(t.children);(i.parent=t).children=[i,e],t=i}e.parent=t.parent}while(10<t.children.length);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=this,r=0;r<this.children.length;++r){var o=i.children[r],a=o.chunkSize();if(t<a){var s=Math.min(e,a-t);if(o.iterN(t,s,n))return!0;if(0==(e-=s))break;t=0}else t-=a}}};var Ns=function(t,e,n){var i=this;if(n)for(var r in n)n.hasOwnProperty(r)&&(i[r]=n[r]);this.doc=t,this.node=e};Ns.prototype.clear=function(){var t=this,e=this.doc.cm,n=this.line.widgets,i=this.line,r=it(i);if(null!=r&&n){for(var o=0;o<n.length;++o)n[o]==t&&n.splice(o--,1);n.length||(i.widgets=null);var a=Pe(this);nt(i,Math.max(0,i.height-a)),e&&(vi(e,function(){$r(e,i,-a),Mn(e,r,"widget")}),be(e,"lineWidgetCleared",e,this,r))}},Ns.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Pe(this)-e;r&&(te(this.doc,i)||nt(i,i.height+r),n&&vi(n,function(){n.curOp.forceUpdate=!0,$r(n,i,r),be(n,"lineWidgetChanged",n,t,it(i))}))},t(Ns);var Rs=0,Fs=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++Rs};Fs.prototype.clear=function(){var t=this;if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&ui(e),N(this,"clear")){var i=this.find();i&&be(this,"clear",i.from,i.to)}for(var r=null,o=null,a=0;a<this.lines.length;++a){var s=t.lines[a],l=Et(s.markedSpans,t);e&&!t.collapsed?Mn(e,it(s),"text"):e&&(null!=l.to&&(o=it(s)),null!=l.from&&(r=it(s))),s.markedSpans=Lt(s.markedSpans,l),null==l.from&&t.collapsed&&!te(t.doc,s)&&e&&nt(s,xn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=Zt(t.lines[u]),h=ie(c);h>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dn(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Tr(e.doc)),e&&be(e,"markerCleared",e,this,r,o),n&&ci(e),this.parent&&this.parent.clear()}},Fs.prototype.find=function(t,e){var n,i,r=this;null==t&&"bookmark"==this.type&&(t=1);for(var o=0;o<this.lines.length;++o){var a=r.lines[o],s=Et(a.markedSpans,r);if(null!=s.from&&(n=st(e?a:it(a),s.from),-1==t))return n;if(null!=s.to&&(i=st(e?a:it(a),s.to),1==t))return i}return n&&{from:n,to:i}},Fs.prototype.changed=function(){var o=this,a=this.find(-1,!0),s=this,l=this.doc.cm;a&&l&&vi(l,function(){var t=a.line,e=it(a.line),n=qe(l,e);if(n&&(Je(n),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!te(s.doc,t)&&null!=s.height){var i=s.height;s.height=null;var r=Pe(s)-i;r&&nt(t,t.height+r)}be(l,"markerChanged",l,o)})},Fs.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=g(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},Fs.prototype.detachLine=function(t){if(this.lines.splice(g(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},t(Fs);var zs=function(t,e){var n=this;this.markers=t,this.primary=e;for(var i=0;i<t.length;++i)t[i].parent=n};zs.prototype.clear=function(){var t=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)t.markers[e].clear();be(this,"clear")}},zs.prototype.find=function(t,e){return this.primary.find(t,e)},t(zs);var Hs=0,Bs=function(t,e,n,i,r){if(!(this instanceof Bs))return new Bs(t,e,n,i,r);null==n&&(n=0),Ur.call(this,[new Wr([new xs("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=st(n,0);this.sel=ji(o),this.history=new nr(null),this.id=++Hs,this.modeOption=e,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Ki(this,{from:o,to:o,text:t}),_r(this,ji(o),Za)};Bs.prototype=n(Ur.prototype,{constructor:Bs,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,i=0;i<e.length;++i)n+=e[i].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=et(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:bi(function(t){var e=st(this.first,0),n=this.first+this.size-1;Lr(this,{from:e,to:st(n,J(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Qn(this.cm,0,0),_r(this,ji(e),Za)}),replaceRange:function(t,e,n,i){zr(this,t,e=pt(this,e),n=n?pt(this,n):e,i)},getRange:function(t,e,n){var i=tt(this,pt(this,t),pt(this,e));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ot(this,t))return J(this,t)},getLineNumber:function(t){return it(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=J(this,t)),Zt(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return pt(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bi(function(t,e,n){xr(this,pt(this,"number"==typeof t?st(t,e||0):t),null,n)}),setSelection:bi(function(t,e,n){xr(this,pt(this,t),pt(this,e||t),n)}),extendSelection:bi(function(t,e,n){mr(this,pt(this,t),e&&pt(this,e),n)}),extendSelections:bi(function(t,e){vr(this,mt(this,t),e)}),extendSelectionsBy:bi(function(t,e){vr(this,mt(this,v(this.sel.ranges,t)),e)}),setSelections:bi(function(t,e,n){var i=this;if(t.length){for(var r=[],o=0;o<t.length;o++)r[o]=new Ps(pt(i,t[o].anchor),pt(i,t[o].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),_r(this,Vi(this.cm,r,e),n)}}),addSelection:bi(function(t,e,n){var i=this.sel.ranges.slice(0);i.push(new Ps(pt(this,t),pt(this,e||t))),_r(this,Vi(this.cm,i,i.length-1),n)}),getSelection:function(t){for(var e,n=this,i=this.sel.ranges,r=0;r<i.length;r++){var o=tt(n,i[r].from(),i[r].to());e=e?e.concat(o):o}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=this,n=[],i=this.sel.ranges,r=0;r<i.length;r++){var o=tt(e,i[r].from(),i[r].to());!1!==t&&(o=o.join(t||e.lineSeparator())),n[r]=o}return n},replaceSelection:function(t,e,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=t;this.replaceSelections(i,e,n||"+input")},replaceSelections:bi(function(t,e,n){for(var i=this,r=[],o=this.sel,a=0;a<o.ranges.length;a++){var s=o.ranges[a];r[a]={from:s.from(),to:s.to(),text:i.splitLines(t[a]),origin:n}}for(var l=e&&"end"!=e&&Gi(this,r,e),u=r.length-1;0<=u;u--)Lr(i,r[u]);l?wr(this,l):this.cm&&Kn(this.cm)}),undo:bi(function(){Pr(this,"undo")}),redo:bi(function(){Pr(this,"redo")}),undoSelection:bi(function(){Pr(this,"undo",!0)}),redoSelection:bi(function(){Pr(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i<t.done.length;i++)t.done[i].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new nr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:pr(this.history.done),undone:pr(this.history.undone)}},setHistory:function(t){var e=this.history=new nr(this.history.maxGeneration);e.done=pr(t.done.slice(0),null,!0),e.undone=pr(t.undone.slice(0),null,!0)},setGutterMarker:bi(function(t,n,i){return jr(this,t,"gutter",function(t){var e=t.gutterMarkers||(t.gutterMarkers={});return!(e[n]=i)&&x(e)&&(t.gutterMarkers=null),!0})}),clearGutter:bi(function(e){var n=this;this.iter(function(t){t.gutterMarkers&&t.gutterMarkers[e]&&jr(n,t,"gutter",function(){return t.gutterMarkers[e]=null,x(t.gutterMarkers)&&(t.gutterMarkers=null),!0})})}),lineInfo:function(t){var e;if("number"==typeof t){if(!ot(this,t))return null;if(!(t=J(this,e=t)))return null}else if(null==(e=it(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:bi(function(t,n,i){return jr(this,t,"gutter"==n?"gutter":"class",function(t){var e="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(t[e]){if(s(i).test(t[e]))return!1;t[e]+=" "+i}else t[e]=i;return!0})}),removeLineClass:bi(function(t,o,a){return jr(this,t,"gutter"==o?"gutter":"class",function(t){var e="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",n=t[e];if(!n)return!1;if(null==a)t[e]=null;else{var i=n.match(s(a));if(!i)return!1;var r=i.index+i[0].length;t[e]=n.slice(0,i.index)+(i.index&&r!=n.length?" ":"")+n.slice(r)||null}return!0})}),addLineWidget:bi(function(t,e,n){return qr(this,t,e,n)}),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return Gr(this,pt(this,t),pt(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return Gr(this,t=pt(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=J(this,(t=pt(this,t)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(r,o,a){r=pt(this,r),o=pt(this,o);var s=[],l=r.line;return this.iter(r.line,o.line+1,function(t){var e=t.markedSpans;if(e)for(var n=0;n<e.length;n++){var i=e[n];null!=i.to&&l==r.line&&r.ch>=i.to||null==i.from&&l!=r.line||null!=i.from&&l==o.line&&i.from>=o.ch||a&&!a(i.marker)||s.push(i.marker.parent||i.marker)}++l}),s},getAllMarks:function(){var i=[];return this.iter(function(t){var e=t.markedSpans;if(e)for(var n=0;n<e.length;++n)null!=e[n].from&&i.push(e[n].marker)}),i},posFromIndex:function(n){var i,r=this.first,o=this.lineSeparator().length;return this.iter(function(t){var e=t.text.length+o;if(n<e)return i=n,!0;n-=e,++r}),pt(this,st(r,i))},indexFromPos:function(t){var e=(t=pt(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,function(t){e+=t.text.length+n}),e},copy:function(t){var e=new Bs(et(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var i=new Bs(et(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],Xr(i,Zr(this)),i},unlinkDoc:function(t){var e=this;if(t instanceof Zo&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){if(e.linked[n].doc==t){e.linked.splice(n,1),t.unlinkDoc(e),Kr(Zr(e));break}}if(t.history==this.history){var i=[t.id];Qi(t,function(t){return i.push(t.id)},!0),t.history=new nr(null),t.history.done=pr(this.history.done,i),t.history.undone=pr(this.history.undone,i)}},iterLinkedDocs:function(t){Qi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):as(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:bi(function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(t){return t.order=null}),this.cm&&er(this.cm))})}),Bs.prototype.eachLine=Bs.prototype.iter;for(var Vs=0,js=!1,Ws={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Us=0;Us<10;Us++)Ws[Us+48]=Ws[Us+96]=String(Us);for(var $s=65;$s<=90;$s++)Ws[$s]=String.fromCharCode($s);for(var qs=1;qs<=12;qs++)Ws[qs+111]=Ws[qs+63235]="F"+qs;var Gs={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"},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"},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"},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"]}};Gs["default"]=Pa?Gs.macDefault:Gs.pcDefault;var Ys,Zs,Xs={selectAll:kr,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Za)},killLine:function(n){return po(n,function(t){if(t.empty()){var e=J(n.doc,t.head.line).text.length;return t.head.ch==e&&t.head.line<n.lastLine()?{from:t.head,to:st(t.head.line+1,0)}:{from:t.head,to:st(t.head.line,e)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return po(e,function(t){return{from:st(t.from().line,0),to:pt(e.doc,st(t.to().line+1,0))}})},delLineLeft:function(t){return po(t,function(t){return{from:st(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(n){return po(n,function(t){var e=n.charCoords(t.head,"div").top+5;return{from:n.coordsChar({left:0,top:e},"div"),to:t.from()}})},delWrappedLineRight:function(i){return po(i,function(t){var e=i.charCoords(t.head,"div").top+5,n=i.coordsChar({left:i.display.lineDiv.offsetWidth+100,top:e},"div");return{from:t.from(),to:n}})},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(st(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(st(t.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return xo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return wo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return bo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(t){var e=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:e},"div")},Ka)},goLineLeft:function(n){return n.extendSelectionsBy(function(t){var e=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:0,top:e},"div")},Ka)},goLineLeftSmart:function(i){return i.extendSelectionsBy(function(t){var e=i.cursorCoords(t.head,"div").top+5,n=i.coordsChar({left:0,top:e},"div");return n.ch<i.getLine(n.line).search(/\S/)?wo(i,t.head):n},Ka)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"char")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),i=t.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),a=C(t.getLine(o.line),o.ch,i);e.push(_(i-a%i))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(a){return vi(a,function(){for(var t=a.listSelections(),e=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,r=J(a.doc,i.line).text;if(r)if(i.ch==r.length&&(i=new st(i.line,i.ch-1)),0<i.ch)i=new st(i.line,i.ch+1),a.replaceRange(r.charAt(i.ch-1)+r.charAt(i.ch-2),st(i.line,i.ch-2),i,"+transpose");else if(i.line>a.doc.first){var o=J(a.doc,i.line-1).text;o&&(i=new st(i.line,1),a.replaceRange(r.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),st(i.line-1,o.length-1),i,"+transpose"))}e.push(new Ps(i,i))}a.setSelections(e)})},newlineAndIndent:function(i){return vi(i,function(){for(var t=i.listSelections(),e=t.length-1;0<=e;e--)i.replaceRange(i.doc.lineSeparator(),t[e].anchor,t[e].head,"+input");t=i.listSelections();for(var n=0;n<t.length;n++)i.indentLine(t[n].from().line,null,!0);Kn(i)})},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}},Ks=new Wa,Qs=null,Js=400,tl=function(t,e,n){this.time=t,this.pos=e,this.button=n};tl.prototype.compare=function(t,e,n){return this.time+Js>t&&0==lt(e,this.pos)&&n==this.button};var el={toString:function(){return"CodeMirror.Init"}},nl={},il={};Zo.defaults=nl,Zo.optionHandlers=il;var rl=[];Zo.defineInitHook=function(t){return rl.push(t)};var ol=null,al=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Wa,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};al.prototype.init=function(t){function e(t){if(!O(s,t)){if(s.somethingSelected())Qo({lineWise:!1,text:s.getSelections()}),"cut"==t.type&&s.replaceSelection("",null,"cut");else{if(!s.options.lineWiseCopyCut)return;var e=na(s);Qo({lineWise:!0,text:e.text}),"cut"==t.type&&s.operation(function(){s.setSelections(e.ranges,0,Za),s.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=ol.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var i=ra(),r=i.firstChild;s.display.lineSpace.insertBefore(i,s.display.lineSpace.firstChild),r.value=ol.text.join("\n");var o=document.activeElement;ja(r),setTimeout(function(){s.display.lineSpace.removeChild(i),o.focus(),o==l&&a.showPrimarySelection()},50)}}var n=this,a=this,s=a.cm,l=a.div=t.lineDiv;ia(l,s.options.spellcheck,s.options.autocorrect,s.options.autocapitalize),rs(l,"paste",function(t){O(s,t)||ta(t,s)||Sa<=11&&setTimeout(yi(s,function(){return n.updateFromDOM()}),20)}),rs(l,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),rs(l,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),rs(l,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),rs(l,"touchstart",function(){return a.forceCompositionEnd()}),rs(l,"input",function(){n.composing||n.readFromDOMSoon()}),rs(l,"copy",e),rs(l,"cut",e)},al.prototype.prepareSelection=function(){var t=Pn(this.cm,!1);return t.focus=this.cm.state.focused,t},al.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},al.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},al.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||r.line<e.display.viewFrom)t.removeAllRanges();else{var o=da(e,t.anchorNode,t.anchorOffset),a=da(e,t.focusNode,t.focusOffset);if(!o||o.bad||!a||a.bad||0!=lt(dt(o,a),i)||0!=lt(ht(o,a),r)){var s=e.display.view,l=i.line>=e.display.viewFrom&&la(e,i)||{node:s[0].measure.map[2],offset:0},u=r.line<e.display.viewTo&&la(e,r);if(!u){var c=s[s.length-1].measure,h=c.maps?c.maps[c.maps.length-1]:c.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(l&&u){var d,f=t.rangeCount&&t.getRangeAt(0);try{d=za(l.node,l.offset,u.offset,u.node)}catch(p){}d&&(!ya&&e.state.focused?(t.collapse(l.node,l.offset),d.collapsed||(t.removeAllRanges(),t.addRange(d))):(t.removeAllRanges(),t.addRange(d)),f&&null==t.anchorNode?t.addRange(f):ya&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},al.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation(function(){return t.cm.curOp.selectionChanged=!0})},20)},al.prototype.showMultipleSelections=function(t){o(this.cm.display.cursorDiv,t.cursors),o(this.cm.display.selectionDiv,t.selection)},al.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},al.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return m(this.div,e)},al.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},al.prototype.blur=function(){this.div.blur()},al.prototype.getField=function(){return this.div},al.prototype.supportsTouch=function(){return!0},al.prototype.receivedFocus=function(){function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}var e=this;this.selectionInEditor()?this.pollSelection():vi(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,t)},al.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},al.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(La&&Aa&&this.cm.display.gutterSpecs.length&&ua(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=da(e,t.anchorNode,t.anchorOffset),i=da(e,t.focusNode,t.focusOffset);n&&i&&vi(e,function(){_r(e.doc,ji(n,i),Za),(n.bad||i.bad)&&(e.curOp.selectionChanged=!0)})}}},al.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=st(a.line-1,J(i.doc,a.line-1).length)),s.ch==J(i.doc,s.line).text.length&&s.line<i.lastLine()&&(s=st(s.line+1,0)),a.line<r.viewFrom||s.line>r.viewTo-1)return!1;a.line==r.viewFrom||0==(t=An(i,a.line))?(e=it(r.view[0].line),n=r.view[0].node):(e=it(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,u,c=An(i,s.line);if(c==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=it(r.view[c+1].line)-1,u=r.view[c+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(ha(i,n,u,e,l)),d=tt(i.doc,st(e,0),st(l,J(i.doc,l).text.length));1<h.length&&1<d.length;)if(W(h)==W(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var f=0,p=0,g=h[0],m=d[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var y=W(h),x=W(d),b=Math.min(y.length-(1==h.length?f:0),x.length-(1==d.length?f:0));p<b&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==h.length&&1==d.length&&e==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=st(e,f),_=st(l,d.length?W(d).length-p:0);return 1<h.length||h[0]||lt(w,_)?(zr(i.doc,h,w,_,"+input"),!0):void 0},al.prototype.ensurePolled=function(){this.forceCompositionEnd()},al.prototype.reset=function(){this.forceCompositionEnd()},al.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},
|
|
al.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},al.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||vi(this.cm,function(){return Dn(t.cm)})},al.prototype.setUneditable=function(t){t.contentEditable="false"},al.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||yi(this.cm,Jo)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},al.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},al.prototype.onContextMenu=function(){},al.prototype.resetPosition=function(){},al.prototype.needsContentAttribute=!0;var sl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new Wa,this.hasSelection=!1,this.composing=null};sl.prototype.init=function(n){function t(t){if(!O(r,t)){if(r.somethingSelected())Qo({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=na(r);Qo({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Za):(i.prevInput="",o.value=e.text.join("\n"),ja(o))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}var e=this,i=this,r=this.cm;this.createField(n);var o=this.textarea;n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild),Ea&&(o.style.width="0px"),rs(o,"input",function(){_a&&9<=Sa&&e.hasSelection&&(e.hasSelection=null),i.poll()}),rs(o,"paste",function(t){O(r,t)||ta(t,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())}),rs(o,"cut",t),rs(o,"copy",t),rs(n.scroller,"paste",function(t){if(!Ne(n,t)&&!O(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void i.focus();var e=new Event("paste");e.clipboardData=t.clipboardData,o.dispatchEvent(e)}}),rs(n.lineSpace,"selectstart",function(t){Ne(n,t)||R(t)}),rs(o,"compositionstart",function(){var t=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}}),rs(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},sl.prototype.createField=function(){this.wrapper=ra(),this.textarea=this.wrapper.firstChild},sl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=Pn(t);if(t.options.moveInputWithCursor){var r=un(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},sl.prototype.showSelection=function(t){var e=this.cm.display;o(e.cursorDiv,t.cursors),o(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},sl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&ja(this.textarea),_a&&9<=Sa&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",_a&&9<=Sa&&(this.hasSelection=null))}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Oa||d()!=this.textarea))try{this.textarea.focus()}catch(t){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},sl.prototype.fastPoll=function(){function t(){n.poll()||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},sl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||ss(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(_a&&9<=Sa&&this.hasSelection===r||Pa&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="\u200b"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(i.length,r.length);a<s&&i.charCodeAt(a)==r.charCodeAt(a);)++a;return vi(e,function(){Jo(e,r.slice(a),i.length-a,null,t.composing?"*compose":null),1e3<r.length||-1<r.indexOf("\n")?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){_a&&9<=Sa&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(t){function n(){if(null!=s.selectionStart){var t=o.somethingSelected(),e="\u200b"+(t?s.value:"");s.value="\u21da",s.value=e,r.prevInput=t?"":"\u200b",s.selectionStart=1,s.selectionEnd=e.length,a.selForContextMenu=o.doc.sel}}function i(){if(r.contextMenuPending==i&&(r.contextMenuPending=!1,r.wrapper.style.cssText=h,s.style.cssText=c,_a&&Sa<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=l),null!=s.selectionStart)){(!_a||_a&&Sa<9)&&n();var t=0,e=function(){a.selForContextMenu==o.doc.sel&&0==s.selectionStart&&0<s.selectionEnd&&"\u200b"==r.prevInput?yi(o,kr)(o):t++<10?a.detectingSelectAll=setTimeout(e,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(e,200)}}var r=this,o=r.cm,a=o.display,s=r.textarea;r.contextMenuPending&&r.contextMenuPending();var e=Tn(o,t),l=a.scroller.scrollTop;if(e&&!Da){o.options.resetSelectionOnContextMenu&&-1==o.doc.sel.contains(e)&&yi(o,_r)(o.doc,ji(e),Za);var u,c=s.style.cssText,h=r.wrapper.style.cssText,d=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(_a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ca&&(u=window.scrollY),a.input.focus(),Ca&&window.scrollTo(null,u),a.input.reset(),o.somethingSelected()||(s.value=r.prevInput=" "),r.contextMenuPending=i,a.selForContextMenu=o.doc.sel,clearTimeout(a.detectingSelectAll),_a&&9<=Sa&&n(),Ba){z(t);var f=function(){I(window,"mouseup",f),setTimeout(i,20)};rs(window,"mouseup",f)}else setTimeout(i,50)}},sl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,qo(Zo),oa(Zo);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in Bs.prototype)Bs.prototype.hasOwnProperty(ul)&&g(ll,ul)<0&&(Zo.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(Bs.prototype[ul]));return t(Bs),Zo.inputStyles={textarea:sl,contenteditable:al},Zo.defineMode=function(t){Zo.defaults.mode||"null"==t||(Zo.defaults.mode=t),$.apply(this,arguments)},Zo.defineMIME=q,Zo.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Zo.defineMIME("text/plain","null"),Zo.defineExtension=function(t,e){Zo.prototype[t]=e},Zo.defineDocExtension=function(t,e){Bs.prototype[t]=e},Zo.fromTextArea=pa,ga(Zo),Zo.version="5.48.4",Zo}),function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(a){"use strict";a.defineMode("shell",function(){function t(t,e){for(var n=0;n<e.length;n++)o[e[n]]=t}function n(t,e){if(t.eatSpace())return null;var n=t.sol(),i=t.next();if("\\"===i)return t.next(),null;if("'"===i||'"'===i||"`"===i)return e.tokens.unshift(s(i,"`"===i?"quote":"string")),u(t,e);if("#"===i)return n&&t.eat("!")?(t.skipToEnd(),"meta"):(t.skipToEnd(),"comment");if("$"===i)return e.tokens.unshift(c),u(t,e);if("+"===i||"="===i)return"operator";if("-"===i)return t.eat("-"),t.eatWhile(/\w/),"attribute";if(/\d/.test(i)&&(t.eatWhile(/\d/),t.eol()||!/\w/.test(t.peek())))return"number";t.eatWhile(/[\w-]/);var r=t.current();return"="===t.peek()&&/\w+/.test(r)?"def":o.hasOwnProperty(r)?o[r]:null}function s(r,o){var a="("==r?")":"{"==r?"}":r;return function(t,e){for(var n,i=!1;null!=(n=t.next());){if(n===a&&!i){e.tokens.shift();break}if("$"===n&&!i&&"'"!==r&&t.peek()!=a){i=!0,t.backUp(1),e.tokens.unshift(c);break}if(!i&&r!==a&&n===r)return e.tokens.unshift(s(r,o)),u(t,e);if(!i&&/['"]/.test(n)&&!/['"]/.test(r)){e.tokens.unshift(l(n,"string")),t.backUp(1);break}i=!i&&"\\"===n}return o}}function l(n,i){return function(t,e){return e.tokens[0]=s(n,i),t.next(),u(t,e)}}function u(t,e){return(e.tokens[0]||n)(t,e)}var o={},e=["true","false"],i=["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],r=["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","nl","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"];a.registerHelper("hintWords","shell",e.concat(i,r)),t("atom",e),t("keyword",i),t("builtin",r);var c=function(t,e){1<e.tokens.length&&t.eat("$");var n=t.next();return/['"({]/.test(n)?(e.tokens[0]=s(n,"("==n?"quote":"{"==n?"def":"string"),u(t,e)):(/\d/.test(n)||t.eatWhile(/\w/),e.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(t,e){return u(t,e)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),a.defineMIME("text/x-sh","shell"),a.defineMIME("application/x-sh","shell")}),function(t){"use strict";"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=t:"function"==typeof define?define.amd||define(["jquery"],t):window.editormd=t()}(function(){"use strict";var w="undefined"!=typeof jQuery?jQuery:Zepto;if(void 0!==w){var f,p,_=function(t,e){return new _.fn.init(t,e)};_.title=_.$name="Editor.md",_.version="1.5.0",_.homePage="https://pandao.github.io/editor.md/",_.classPrefix="editormd-",_.toolbarModes={full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"],simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],mini:["undo","redo","|","watch","preview","|","help","info"]},_.defaults={mode:"gfm",name:"",value:"",theme:"",editorTheme:"default",previewTheme:"",markdown:"",appendMarkdown:"",width:"100%",height:"100%",path:"./lib/",pluginPath:"",delay:300,autoLoadModules:!0,watch:!0,placeholder:"Enjoy Markdown! coding now...",gotoLine:!0,codeFold:!1,autoHeight:!1,autoFocus:!0,autoCloseTags:!0,searchReplace:!0,syncScrolling:!0,readOnly:!1,tabSize:4,indentUnit:4,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,showTrailingSpace:!0,matchBrackets:!0,indentWithTabs:!0,styleSelectedText:!0,matchWordHighlight:!0,styleActiveLine:!0,dialogLockScreen:!0,dialogShowMask:!0,dialogDraggable:!0,dialogMaskBgColor:"#fff",dialogMaskOpacity:.1,fontSize:"13px",saveHTMLToTextarea:!1,disabledKeyMaps:[],onload:function(){},onresize:function(){},onchange:function(){},onwatch:null,onunwatch:null,onpreviewing:function(){},onpreviewed:function(){},onfullscreen:function(){},onfullscreenExit:function(){},onscroll:function(){},onpreviewscroll:function(){},imageUpload:!1,imageFormats:["jpg","jpeg","gif","png","bmp","webp"],imageUploadURL:"",crossDomainUpload:!1,uploadCallbackURL:"",toc:!0,tocm:!1,tocTitle:"",tocDropdown:!1,tocContainer:"",tocStartLevel:1,htmlDecode:!1,pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0,toolbar:!0,toolbarAutoFixed:!0,toolbarIcons:"full",toolbarTitles:{},toolbarHandlers:{ucwords:function(){return _.toolbarHandlers.ucwords},lowercase:function(){return _.toolbarHandlers.lowercase}},toolbarCustomIcons:{lowercase:'<a href="javascript:;" title="Lowercase" unselectable="on"><i class="fa" name="lowercase" style="font-size:24px;margin-top: -10px;">a</i></a>',ucwords:'<a href="javascript:;" title="ucwords" unselectable="on"><i class="fa" name="ucwords" style="font-size:20px;margin-top: -3px;">Aa</i></a>'},toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",uppercase:"fa-font",h1:_.classPrefix+"bold",h2:_.classPrefix+"bold",h3:_.classPrefix+"bold",h4:_.classPrefix+"bold",h5:_.classPrefix+"bold",h6:_.classPrefix+"bold","list-ul":"fa-list-ul","list-ol":"fa-list-ol",hr:"fa-minus",link:"fa-link","reference-link":"fa-anchor",image:"fa-picture-o",code:"fa-code","preformatted-text":"fa-file-code-o","code-block":"fa-file-code-o",table:"fa-table",datetime:"fa-clock-o",emoji:"fa-smile-o","html-entities":"fa-copyright",pagebreak:"fa-newspaper-o","goto-line":"fa-terminal",watch:"fa-eye-slash",unwatch:"fa-eye",preview:"fa-desktop",search:"fa-search",fullscreen:"fa-arrows-alt",clear:"fa-eraser",help:"fa-question-circle",info:"fa-info-circle"},toolbarIconTexts:{},lang:{name:"zh-cn",description:"\u5f00\u6e90\u5728\u7ebfMarkdown\u7f16\u8f91\u5668<br/>Open source online Markdown editor.",tocTitle:"\u76ee\u5f55",toolbar:{undo:"\u64a4\u9500\uff08Ctrl+Z\uff09",redo:"\u91cd\u505a\uff08Ctrl+Y\uff09",bold:"\u7c97\u4f53",del:"\u5220\u9664\u7ebf",italic:"\u659c\u4f53",quote:"\u5f15\u7528",ucwords:"\u5c06\u6bcf\u4e2a\u5355\u8bcd\u9996\u5b57\u6bcd\u8f6c\u6210\u5927\u5199",uppercase:"\u5c06\u6240\u9009\u8f6c\u6362\u6210\u5927\u5199",lowercase:"\u5c06\u6240\u9009\u8f6c\u6362\u6210\u5c0f\u5199",h1:"\u6807\u98981",h2:"\u6807\u98982",h3:"\u6807\u98983",h4:"\u6807\u98984",h5:"\u6807\u98985",h6:"\u6807\u98986","list-ul":"\u65e0\u5e8f\u5217\u8868","list-ol":"\u6709\u5e8f\u5217\u8868",hr:"\u6a2a\u7ebf",link:"\u94fe\u63a5","reference-link":"\u5f15\u7528\u94fe\u63a5",image:"\u6dfb\u52a0\u56fe\u7247",code:"\u884c\u5185\u4ee3\u7801","preformatted-text":"\u9884\u683c\u5f0f\u6587\u672c / \u4ee3\u7801\u5757\uff08\u7f29\u8fdb\u98ce\u683c\uff09","code-block":"\u4ee3\u7801\u5757\uff08\u591a\u8bed\u8a00\u98ce\u683c\uff09",table:"\u6dfb\u52a0\u8868\u683c",datetime:"\u65e5\u671f\u65f6\u95f4",emoji:"Emoji\u8868\u60c5","html-entities":"HTML\u5b9e\u4f53\u5b57\u7b26",pagebreak:"\u63d2\u5165\u5206\u9875\u7b26","goto-line":"\u8df3\u8f6c\u5230\u884c",watch:"\u5173\u95ed\u5b9e\u65f6\u9884\u89c8",unwatch:"\u5f00\u542f\u5b9e\u65f6\u9884\u89c8",preview:"\u5168\u7a97\u53e3\u9884\u89c8HTML\uff08\u6309 Shift + ESC\u8fd8\u539f\uff09",fullscreen:"\u5168\u5c4f\uff08\u6309ESC\u8fd8\u539f\uff09",clear:"\u6e05\u7a7a",search:"\u641c\u7d22",help:"\u4f7f\u7528\u5e2e\u52a9",info:"\u5173\u4e8e"+_.title},buttons:{enter:"\u786e\u5b9a",cancel:"\u53d6\u6d88",close:"\u5173\u95ed"},dialog:{link:{title:"\u6dfb\u52a0\u94fe\u63a5",url:"\u94fe\u63a5\u5730\u5740",urlTitle:"\u94fe\u63a5\u6807\u9898",urlEmpty:"\u9519\u8bef\uff1a\u8bf7\u586b\u5199\u94fe\u63a5\u5730\u5740\u3002"},referenceLink:{title:"\u6dfb\u52a0\u5f15\u7528\u94fe\u63a5",name:"\u5f15\u7528\u540d\u79f0",url:"\u94fe\u63a5\u5730\u5740",urlId:"\u94fe\u63a5ID",urlTitle:"\u94fe\u63a5\u6807\u9898",nameEmpty:"\u9519\u8bef\uff1a\u5f15\u7528\u94fe\u63a5\u7684\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a\u3002",idEmpty:"\u9519\u8bef\uff1a\u8bf7\u586b\u5199\u5f15\u7528\u94fe\u63a5\u7684ID\u3002",urlEmpty:"\u9519\u8bef\uff1a\u8bf7\u586b\u5199\u5f15\u7528\u94fe\u63a5\u7684URL\u5730\u5740\u3002"},image:{title:"\u6dfb\u52a0\u56fe\u7247",url:"\u56fe\u7247\u5730\u5740",link:"\u56fe\u7247\u94fe\u63a5",alt:"\u56fe\u7247\u63cf\u8ff0",uploadButton:"\u672c\u5730\u4e0a\u4f20",imageURLEmpty:"\u9519\u8bef\uff1a\u56fe\u7247\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\u3002",uploadFileEmpty:"\u9519\u8bef\uff1a\u4e0a\u4f20\u7684\u56fe\u7247\u4e0d\u80fd\u4e3a\u7a7a\u3002",formatNotAllowed:"\u9519\u8bef\uff1a\u53ea\u5141\u8bb8\u4e0a\u4f20\u56fe\u7247\u6587\u4ef6\uff0c\u5141\u8bb8\u4e0a\u4f20\u7684\u56fe\u7247\u6587\u4ef6\u683c\u5f0f\u6709\uff1a"},preformattedText:{title:"\u6dfb\u52a0\u9884\u683c\u5f0f\u6587\u672c\u6216\u4ee3\u7801\u5757",emptyAlert:"\u9519\u8bef\uff1a\u8bf7\u586b\u5199\u9884\u683c\u5f0f\u6587\u672c\u6216\u4ee3\u7801\u7684\u5185\u5bb9\u3002"},codeBlock:{title:"\u6dfb\u52a0\u4ee3\u7801\u5757",selectLabel:"\u4ee3\u7801\u8bed\u8a00\uff1a",selectDefaultText:"\u8bf7\u9009\u62e9\u4ee3\u7801\u8bed\u8a00",otherLanguage:"\u5176\u4ed6\u8bed\u8a00",unselectedLanguageAlert:"\u9519\u8bef\uff1a\u8bf7\u9009\u62e9\u4ee3\u7801\u6240\u5c5e\u7684\u8bed\u8a00\u7c7b\u578b\u3002",codeEmptyAlert:"\u9519\u8bef\uff1a\u8bf7\u586b\u5199\u4ee3\u7801\u5185\u5bb9\u3002"},htmlEntities:{title:"HTML \u5b9e\u4f53\u5b57\u7b26"},help:{title:"\u4f7f\u7528\u5e2e\u52a9"}}}},_.classNames={tex:_.classPrefix+"tex"},_.dialogZindex=99999,_.$katex=null,_.$marked=null,_.$CodeMirror=null,_.$prettyPrint=null,_.prototype=_.fn={state:{watching:!1,loaded:!1,preview:!1,fullscreen:!1},init:function(t,e){e=e||{},"object"==typeof t&&(e=t);var n=this.classPrefix=_.classPrefix,i=this.settings=w.extend(!0,_.defaults,e);t="object"==typeof t?i.id:t;var r=this.editor=w("#"+t);this.id=t,this.lang=i.lang;var o=this.classNames={textarea:{html:n+"html-textarea",markdown:n+"markdown-textarea"}};i.pluginPath=""===i.pluginPath?i.path+"../plugins/":i.pluginPath,this.state.watching=!!i.watch,r.hasClass("editormd")||r.addClass("editormd"),r.css({width:"number"==typeof i.width?i.width+"px":i.width,height:"number"==typeof i.height?i.height+"px":i.height}),i.autoHeight&&r.css("height","auto");var a=this.markdownTextarea=r.children("textarea");a.length<1&&(r.append("<textarea></textarea>"),a=this.markdownTextarea=r.children("textarea")),a.addClass(o.textarea.markdown).attr("placeholder",i.placeholder),void 0!==a.attr("name")&&""!==a.attr("name")||a.attr("name",""!==i.name?i.name:t+"-markdown-doc");var s=[i.readOnly?"":'<a href="javascript:;" class="fa fa-close '+n+'preview-close-btn"></a>',i.saveHTMLToTextarea?'<textarea class="'+o.textarea.html+'" name="'+t+'-html-code"></textarea>':"",'<div class="'+n+'preview"><div class="markdown-body '+n+'preview-container"></div></div>','<div class="'+n+'container-mask" style="display:block;"></div>','<div class="'+n+'mask"></div>'].join("\n");return r.append(s).addClass(n+"vertical"),""!==i.theme&&r.addClass(n+"theme-"+i.theme),this.mask=r.children("."+n+"mask"),this.containerMask=r.children("."+n+"container-mask"),""!==i.markdown&&a.val(i.markdown),""!==i.appendMarkdown&&a.val(a.val()+i.appendMarkdown),this.htmlTextarea=r.children("."+o.textarea.html),this.preview=r.children("."+n+"preview"),this.previewContainer=this.preview.children("."+n+"preview-container"),""!==i.previewTheme&&this.preview.addClass(n+"preview-theme-"+i.previewTheme),"function"==typeof define&&define.amd&&("undefined"!=typeof katex&&(_.$katex=katex),i.searchReplace&&!i.readOnly&&(_.loadCSS(i.path+"codemirror/addon/dialog/dialog"),_.loadCSS(i.path+"codemirror/addon/search/matchesonscrollbar"))),"function"==typeof define&&define.amd||!i.autoLoadModules?("undefined"!=typeof CodeMirror&&(_.$CodeMirror=CodeMirror),"undefined"!=typeof marked&&(_.$marked=marked),this.setCodeMirror().setToolbar().loadedDisplay()):this.loadQueues(),this},loadQueues:function(){var t=this,e=this.settings,n=e.path,i=function(){_.isIE8?t.loadedDisplay():e.flowChart||e.sequenceDiagram?_.loadScript(n+"raphael.min",function(){_.loadScript(n+"underscore.min",function(){!e.flowChart&&e.sequenceDiagram?_.loadScript(n+"sequence-diagram.min",function(){t.loadedDisplay()}):e.flowChart&&!e.sequenceDiagram?_.loadScript(n+"flowchart.min",function(){_.loadScript(n+"jquery.flowchart.min",function(){t.loadedDisplay()})}):e.flowChart&&e.sequenceDiagram&&_.loadScript(n+"flowchart.min",function(){_.loadScript(n+"jquery.flowchart.min",function(){_.loadScript(n+"sequence-diagram.min",function(){t.loadedDisplay()})})})})}):t.loadedDisplay()};return _.loadCSS(n+"codemirror/codemirror.min"),e.searchReplace&&!e.readOnly&&(_.loadCSS(n+"codemirror/addon/dialog/dialog"),_.loadCSS(n+"codemirror/addon/search/matchesonscrollbar")),e.codeFold&&_.loadCSS(n+"codemirror/addon/fold/foldgutter"),_.loadScript(n+"codemirror/codemirror.min",function(){_.$CodeMirror=CodeMirror,_.loadScript(n+"codemirror/modes.min",function(){_.loadScript(n+"codemirror/addons.min",function(){if(t.setCodeMirror(),"gfm"!==e.mode&&"markdown"!==e.mode)return t.loadedDisplay(),!1;t.setToolbar(),_.loadScript(n+"marked.min",function(){_.$marked=marked,e.previewCodeHighlight?_.loadScript(n+"prettify.min",function(){i()}):i()})})})}),this},setTheme:function(t){var e=this.editor,n=this.settings.theme,i=this.classPrefix+"theme-";return e.removeClass(i+n).addClass(i+t),this.settings.theme=t,this},setEditorTheme:function(t){var e=this.settings;return"default"!==(e.editorTheme=t)&&_.loadCSS(e.path+"codemirror/theme/"+e.editorTheme),this.cm.setOption("theme",t),this},setCodeMirrorTheme:function(t){return this.setEditorTheme(t),this},setPreviewTheme:function(t){var e=this.preview,n=this.settings.previewTheme,i=this.classPrefix+"preview-theme-";return e.removeClass(i+n).addClass(i+t),this.settings.previewTheme=t,this},setCodeMirror:function(){var t=this.settings,e=this.editor;"default"!==t.editorTheme&&_.loadCSS(t.path+"codemirror/theme/"+t.editorTheme);var n={mode:t.mode,theme:t.editorTheme,tabSize:t.tabSize,dragDrop:!1,autofocus:t.autoFocus,autoCloseTags:t.autoCloseTags,readOnly:!!t.readOnly&&"nocursor",indentUnit:t.indentUnit,lineNumbers:t.lineNumbers,lineWrapping:t.lineWrapping,extraKeys:{"Ctrl-Q":function(t){t.foldCode(t.getCursor())}},foldGutter:t.codeFold,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:t.matchBrackets,indentWithTabs:t.indentWithTabs,styleActiveLine:t.styleActiveLine,styleSelectedText:t.styleSelectedText,autoCloseBrackets:t.autoCloseBrackets,showTrailingSpace:t.showTrailingSpace,highlightSelectionMatches:!!t.matchWordHighlight&&{showToken:"onselected"!==t.matchWordHighlight&&/\w/}};return this.codeEditor=this.cm=_.$CodeMirror.fromTextArea(this.markdownTextarea[0],n),this.codeMirror=this.cmElement=e.children(".CodeMirror"),""!==t.value&&this.cm.setValue(t.value),this.codeMirror.css({fontSize:t.fontSize,width:t.watch?"50%":"100%"}),t.autoHeight&&(this.codeMirror.css("height","auto"),this.cm.setOption("viewportMargin",Infinity)),t.lineNumbers||this.codeMirror.find(".CodeMirror-gutters").css("border-right","none"),this},getCodeMirrorOption:function(t){return this.cm.getOption(t)},setCodeMirrorOption:function(t,e){return this.cm.setOption(t,e),this},addKeyMap:function(t,e){return this.cm.addKeyMap(t,e),this},removeKeyMap:function(t){return this.cm.removeKeyMap(t),this},gotoLine:function(t){var e=this.settings;if(!e.gotoLine)return this;var n=this.cm,i=(this.editor,n.lineCount()),r=this.preview;if("string"==typeof t&&("last"===t&&(t=i),"first"===t&&(t=1)),"number"!=typeof t)return alert("Error: The line number must be an integer."),this;if(i<(t=parseInt(t)-1))return alert("Error: The line number range 1-"+i),this;n.setCursor({line:t,ch:0});var o=n.getScrollInfo().clientHeight,a=n.charCoords({line:t,ch:0},"local");if(n.scrollTo(null,(a.top+a.bottom-o)/2),e.watch){var s=this.codeMirror.find(".CodeMirror-scroll")[0],l=w(s).height(),u=s.scrollTop,c=u/s.scrollHeight;0===u?r.scrollTop(0):u+l>=s.scrollHeight-16?r.scrollTop(r[0].scrollHeight):r.scrollTop(r[0].scrollHeight*c)}return n.focus(),this},extend:function(t,e){return void 0!==e&&("function"==typeof arguments[1]&&(arguments[1]=w.proxy(arguments[1],this)),this[arguments[0]]=arguments[1]),"object"==typeof arguments[0]&&"undefined"==typeof arguments[0].length&&w.extend(!0,this,arguments[0]),this},set:function(t,e){return void 0!==e&&"function"==typeof e&&(e=w.proxy(e,this)),this[t]=e,this},config:function(t,e){var n=this.settings;return"object"==typeof t&&(n=w.extend(!0,n,t)),"string"==typeof t&&(n[t]=e),this.settings=n,this.recreate(),this},on:function(t,e){var n=this.settings;return"undefined"!=typeof n["on"+t]&&(n["on"+t]=w.proxy(e,this)),this},off:function(t){var e=this.settings;return"undefined"!=typeof e["on"+t]&&(e["on"+t]=function(){}),this},showToolbar:function(t){var e=this.settings;return e.readOnly||(e.toolbar&&(this.toolbar.length<1||""===this.toolbar.find("."+this.classPrefix+"menu").html())&&this.setToolbar(),e.toolbar=!0,this.toolbar.show(),this.resize(),w.proxy(t||function(){},this)()),this},hideToolbar:function(t){return this.settings.toolbar=!1,this.toolbar.hide(),this.resize(),w.proxy(t||function(){},this)(),this},setToolbarAutoFixed:function(t){var e=this.state,n=this.editor,i=this.toolbar,r=this.settings;void 0!==t&&(r.toolbarAutoFixed=t);var o=function(){var t=w(window),e=t.scrollTop();if(!r.toolbarAutoFixed)return!1;10<e-n.offset().top&&e<n.height()?i.css({position:"fixed",width:n.width()+"px",left:(t.width()-n.width())/2+"px"}):i.css({position:"absolute",width:"100%",left:0})};return!e.fullscreen&&!e.preview&&r.toolbar&&r.toolbarAutoFixed&&w(window).bind("scroll",o),this},setToolbar:function(){var t=this.settings;if(t.readOnly)return this;var e=this.editor,n=(this.preview,this.classPrefix),i=this.toolbar=e.children("."+n+"toolbar");if(t.toolbar&&i.length<1){var r='<div class="'+n+'toolbar"><div class="'+n+'toolbar-container"><ul class="'+n+'menu"></ul></div></div>';e.append(r),i=this.toolbar=e.children("."+n+"toolbar")}if(!t.toolbar)return i.hide(),this;i.show();for(var o="function"==typeof t.toolbarIcons?t.toolbarIcons():"string"==typeof t.toolbarIcons?_.toolbarModes[t.toolbarIcons]:t.toolbarIcons,a=i.find("."+this.classPrefix+"menu"),s="",l=!1,u=0,c=o.length;u<c;u++){var h=o[u];if("||"===h)l=!0;else if("|"===h)s+='<li class="divider" unselectable="on">|</li>';else{var d=/h(\d)/.test(h),f=h;"watch"!==h||t.watch||(f="unwatch");var p=t.lang.toolbar[f],g=t.toolbarIconTexts[f],m=t.toolbarIconsClass[f];p=void 0===p?"":p,g=void 0===g?"":g,m=void 0===m?"":m;var v=l?'<li class="pull-right">':"<li>";"undefined"!=typeof t.toolbarCustomIcons[h]&&"function"!=typeof t.toolbarCustomIcons[h]?v+=t.toolbarCustomIcons[h]:(v+='<a href="javascript:;" title="'+p+'" unselectable="on">',v+='<i class="fa '+m+'" name="'+h+'" unselectable="on">'+(d?h.toUpperCase():""===m?g:"")+"</i>",v+="</a>"),v+="</li>",s=l?v+s:s+v}}return a.html(s),a.find('[title="Lowercase"]').attr("title",t.lang.toolbar.lowercase),a.find('[title="ucwords"]').attr("title",t.lang.toolbar.ucwords),this.setToolbarHandler(),this.setToolbarAutoFixed(),this},dialogLockScreen:function(){return w.proxy(_.dialogLockScreen,this)(),this},dialogShowMask:function(t){return w.proxy(_.dialogShowMask,this)(t),this},getToolbarHandles:function(t){var e=this.toolbarHandlers=_.toolbarHandlers;return t&&"undefined"!=typeof toolbarIconHandlers[t]?e[t]:e},setToolbarHandler:function(){var r=this,o=this.settings;if(!o.toolbar||o.readOnly)return this;var t=this.toolbar,a=this.cm,e=this.classPrefix,n=this.toolbarIcons=t.find("."+e+"menu > li > a"),s=this.getToolbarHandles();return n.bind(_.mouseOrTouch("click","touchend"),function(){var t=w(this).children(".fa"),e=t.attr("name"),n=a.getCursor(),i=a.getSelection();if(""!==e)return r.activeIcon=t,"undefined"!=typeof s[e]?w.proxy(s[e],r)(a):"undefined"!=typeof o.toolbarHandlers[e]&&w.proxy(o.toolbarHandlers[e],r)(a,t,n,i),"link"!==e&&"reference-link"!==e&&"image"!==e&&"code-block"!==e&&"preformatted-text"!==e&&"watch"!==e&&"preview"!==e&&"search"!==e&&"fullscreen"!==e&&"info"!==e&&a.focus(),!1}),this},createDialog:function(t){return w.proxy(_.createDialog,this)(t)},createInfoDialog:function(){var t=this,e=this.editor,n=this.classPrefix,i=['<div class="'+n+"dialog "+n+'dialog-info" style="">','<div class="'+n+'dialog-container">','<h1><i class="editormd-logo editormd-logo-lg editormd-logo-color"></i> '+_.title+"<small>v"+_.version+"</small></h1>","<p>"+this.lang.description+"</p>",'<p style="margin: 10px 0 20px 0;"><a href="'+_.homePage+'" target="_blank">'+_.homePage+' <i class="fa fa-external-link"></i></a></p>','<p style="font-size: 0.85em;">Copyright © 2015 <a href="https://github.com/pandao" target="_blank" class="hover-link">Pandao</a>, The <a href="https://github.com/pandao/editor.md/blob/master/LICENSE" target="_blank" class="hover-link">MIT</a> License.</p>',"</div>",'<a href="javascript:;" class="fa fa-close '+n+'dialog-close"></a>',"</div>"].join("\n");e.append(i);var r=this.infoDialog=e.children("."+n+"dialog-info");return r.find("."+n+"dialog-close").bind(_.mouseOrTouch("click","touchend"),function(){t.hideInfoDialog()}),r.css("border",_.isIE8?"1px solid #ddd":"").css("z-index",_.dialogZindex).show(),this.infoDialogPosition(),this},infoDialogPosition:function(){var t=this.infoDialog,e=function(){t.css({top:(w(window).height()-t.height())/2+"px",left:(w(window).width()-t.width())/2+"px"})};return e(),w(window).resize(e),this},showInfoDialog:function(){w("html,body").css("overflow-x","hidden");var t=this.editor,e=this.settings,n=this.infoDialog=t.children("."+this.classPrefix+"dialog-info");return n.length<1&&this.createInfoDialog(),this.lockScreen(!0),this.mask.css({opacity:e.dialogMaskOpacity,backgroundColor:e.dialogMaskBgColor}).show(),n.css("z-index",_.dialogZindex).show(),this.infoDialogPosition(),this},hideInfoDialog:function(){return w("html,body").css("overflow-x",""),this.infoDialog.hide(),this.mask.hide(),this.lockScreen(!1),this},lockScreen:function(t){return _.lockScreen(t),this.resize(),this},recreate:function(){var t=this.editor,e=this.settings;return this.codeMirror.remove(),this.setCodeMirror(),e.readOnly||(0<t.find(".editormd-dialog").length&&t.find(".editormd-dialog").remove(),e.toolbar&&(this.getToolbarHandles(),this.setToolbar())),this.loadedDisplay(!0),this},previewCodeHighlight:function(){var t=this.settings,e=this.previewContainer;return t.previewCodeHighlight&&(e.find("pre").addClass("prettyprint linenums"),"undefined"!=typeof prettyPrint&&prettyPrint()),this},katexRender:function(){return null===f||this.previewContainer.find("."+_.classNames.tex).each(function(){var t=w(this);_.$katex.render(t.text(),t[0]),t.find(".katex").css("font-size","1.6em")}),this},flowChartAndSequenceDiagramRender:function(){var t=this,e=this.settings,n=this.previewContainer;if(_.isIE8)return this;if(e.flowChart){if(null===p)return this;n.find(".flowchart").flowChart()}e.sequenceDiagram&&n.find(".sequence-diagram").sequenceDiagram({theme:"simple"});var i=t.preview,r=t.codeMirror.find(".CodeMirror-scroll"),o=r.height(),a=r.scrollTop(),s=a/r[0].scrollHeight,l=0;i.find(".markdown-toc-list").each(function(){l+=w(this).height()});var u=i.find(".editormd-toc-menu").height();return u=u||0,0===a?i.scrollTop(0):a+o>=r[0].scrollHeight-16?i.scrollTop(i[0].scrollHeight):i.scrollTop((i[0].scrollHeight+l+u)*s),this},registerKeyMaps:function(t){var n=this,e=this.cm,i=this.settings,r=_.toolbarHandlers,o=i.disabledKeyMaps;if(t=t||null)for(var a in t){if(w.inArray(a,o)<0)({})[a]=t[a],e.addKeyMap(t)}else{for(var s in _.keyMaps){var l=_.keyMaps[s],u="string"==typeof l?w.proxy(r[l],n):w.proxy(l,n);if(w.inArray(s,["F9","F10","F11"])<0&&w.inArray(s,o)<0){var c={};c[s]=u,e.addKeyMap(c)}}w(window).keydown(function(t){var e={120:"F9",121:"F10",122:"F11"};if(w.inArray(e[t.keyCode],o)<0)switch(t.keyCode){case 120:return w.proxy(r.watch,n)(),!1;case 121:return w.proxy(r.preview,n)(),!1;case 122:return w.proxy(r.fullscreen,n)(),!1}})}return this},bindScrollEvent:function(){var a=this,s=this.preview,l=this.settings,o=this.codeMirror,t=_.mouseOrTouch;if(!l.syncScrolling)return this;var e=function(){o.find(".CodeMirror-scroll").bind(t("scroll","touchmove"),function(t){var e=w(this).height(),n=w(this).scrollTop(),i=n/w(this)[0].scrollHeight,r=0;s.find(".markdown-toc-list").each(function(){r+=w(this).height()});var o=s.find(".editormd-toc-menu").height();o=o||0,0===n?s.scrollTop(0):n+e>=w(this
|
|
)[0].scrollHeight-16?s.scrollTop(s[0].scrollHeight):s.scrollTop((s[0].scrollHeight+r+o)*i),w.proxy(l.onscroll,a)(t)})},n=function(){o.find(".CodeMirror-scroll").unbind(t("scroll","touchmove"))},i=function(){s.bind(t("scroll","touchmove"),function(t){var e=w(this).height(),n=w(this).scrollTop(),i=n/w(this)[0].scrollHeight,r=o.find(".CodeMirror-scroll");0===n?r.scrollTop(0):n+e>=w(this)[0].scrollHeight?r.scrollTop(r[0].scrollHeight):r.scrollTop(r[0].scrollHeight*i),w.proxy(l.onpreviewscroll,a)(t)})},r=function(){s.unbind(t("scroll","touchmove"))};return o.bind({mouseover:e,mouseout:n,touchstart:e,touchend:n}),"single"===l.syncScrolling||s.bind({mouseover:i,mouseout:r,touchstart:i,touchend:r}),this},bindChangeEvent:function(){var t=this,e=this.cm,n=this.settings;return n.syncScrolling&&e.on("change",function(){n.watch&&t.previewContainer.css("padding",n.autoHeight?"20px 20px 50px 40px":"20px"),f=setTimeout(function(){clearTimeout(f),t.save(),f=null},n.delay)}),this},loadedDisplay:function(t){t=t||!1;var e=this,n=this.editor,i=this.preview,r=this.settings;return this.containerMask.hide(),this.save(),r.watch&&i.show(),n.data("oldWidth",n.width()).data("oldHeight",n.height()),this.resize(),this.registerKeyMaps(),w(window).resize(function(){e.resize()}),this.bindScrollEvent().bindChangeEvent(),t||w.proxy(r.onload,this)(),this.state.loaded=!0,this},width:function(t){return this.editor.css("width","number"==typeof t?t+"px":t),this.resize(),this},height:function(t){return this.editor.css("height","number"==typeof t?t+"px":t),this.resize(),this},resize:function(t,e){t=t||null,e=e||null;var n=this.state,i=this.editor,r=this.preview,o=this.toolbar,a=this.settings,s=this.codeMirror;if(t&&i.css("width","number"==typeof t?t+"px":t),!a.autoHeight||n.fullscreen||n.preview?(e&&i.css("height","number"==typeof e?e+"px":e),n.fullscreen&&i.height(w(window).height()),a.toolbar&&!a.readOnly?s.css("margin-top",o.height()+1).height(i.height()-o.height()):s.css("margin-top",0).height(i.height())):(i.css("height","auto"),s.css("height","auto")),a.watch)if(s.width(i.width()/2),r.width(n.preview?i.width():i.width()/2),this.previewContainer.css("padding",a.autoHeight?"20px 20px 50px 40px":"20px"),a.toolbar&&!a.readOnly?r.css("top",o.height()+1):r.css("top",0),!a.autoHeight||n.fullscreen||n.preview){var l=a.toolbar&&!a.readOnly?i.height()-o.height():i.height();r.height(l)}else r.height("");else s.width(i.width()),r.hide();return n.loaded&&w.proxy(a.onresize,this)(),this},save:function(){if(null===f)return this;var t=this,e=this.state,n=this.settings,i=this.cm,r=i.getValue(),o=this.previewContainer;if("gfm"!==n.mode&&"markdown"!==n.mode)return this.markdownTextarea.val(r),this;var a=_.$marked,s=this.markdownToC=[],l=this.markedRendererOptions={toc:n.toc,tocm:n.tocm,tocStartLevel:n.tocStartLevel,pageBreak:n.pageBreak,taskList:n.taskList,emoji:n.emoji,tex:n.tex,atLink:n.atLink,emailLink:n.emailLink,flowChart:n.flowChart,sequenceDiagram:n.sequenceDiagram,previewCodeHighlight:n.previewCodeHighlight},u=this.markedOptions={renderer:_.markedRenderer(s,l),gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:!n.htmlDecode,smartLists:!0,smartypants:!0};a.setOptions(u);var c=_.$marked(r,u);if(c=_.filterHTMLTags(c,n.htmlDecode),this.markdownTextarea.text(r),i.save(),n.saveHTMLToTextarea&&this.htmlTextarea.text(c),n.watch||!n.watch&&e.preview){if(o.html(c),this.previewCodeHighlight(),n.toc){var h=""===n.tocContainer?o:w(n.tocContainer),d=h.find("."+this.classPrefix+"toc-menu");h.attr("previewContainer",""===n.tocContainer?"true":"false"),""!==n.tocContainer&&0<d.length&&d.remove(),_.markdownToCRenderer(s,h,n.tocDropdown,n.tocStartLevel),(n.tocDropdown||0<h.find("."+this.classPrefix+"toc-menu").length)&&_.tocDropdownMenu(h,""!==n.tocTitle?n.tocTitle:this.lang.tocTitle),""!==n.tocContainer&&o.find(".markdown-toc").css("border","none")}n.tex&&(!_.kaTeXLoaded&&n.autoLoadModules?_.loadKaTeX(function(){_.$katex=katex,_.kaTeXLoaded=!0,t.katexRender()}):(_.$katex=katex,this.katexRender())),(n.flowChart||n.sequenceDiagram)&&(p=setTimeout(function(){clearTimeout(p),t.flowChartAndSequenceDiagramRender(),p=null},10)),e.loaded&&w.proxy(n.onchange,this)()}return this},focus:function(){return this.cm.focus(),this},setCursor:function(t){return this.cm.setCursor(t),this},getCursor:function(){return this.cm.getCursor()},setSelection:function(t,e){return this.cm.setSelection(t,e),this},getSelection:function(){return this.cm.getSelection()},setSelections:function(t){return this.cm.setSelections(t),this},getSelections:function(){return this.cm.getSelections()},replaceSelection:function(t){return this.cm.replaceSelection(t),this},insertValue:function(t){return this.replaceSelection(t),this},appendMarkdown:function(t){this.settings;var e=this.cm;return e.setValue(e.getValue()+t),this},setMarkdown:function(t){return this.cm.setValue(t||this.settings.markdown),this},getMarkdown:function(){return this.cm.getValue()},getValue:function(){return this.cm.getValue()},setValue:function(t){return this.cm.setValue(t),this},clear:function(){return this.cm.setValue(""),this},getHTML:function(){return this.settings.saveHTMLToTextarea?this.htmlTextarea.val():(alert("Error: settings.saveHTMLToTextarea == false"),!1)},getTextareaSavedHTML:function(){return this.getHTML()},getPreviewedHTML:function(){return this.settings.watch?this.previewContainer.html():(alert("Error: settings.watch == false"),!1)},watch:function(t){var e=this.settings;if(w.inArray(e.mode,["gfm","markdown"])<0)return this;if(this.state.watching=e.watch=!0,this.preview.show(),this.toolbar){var n=e.toolbarIconsClass.watch,i=e.toolbarIconsClass.unwatch,r=this.toolbar.find(".fa[name=watch]");r.parent().attr("title",e.lang.toolbar.watch),r.removeClass(i).addClass(n)}return this.codeMirror.css("border-right","1px solid #ddd").width(this.editor.width()/2),f=0,this.save().resize(),e.onwatch||(e.onwatch=t||function(){}),w.proxy(e.onwatch,this)(),this},unwatch:function(t){var e=this.settings;if(this.state.watching=e.watch=!1,this.preview.hide(),this.toolbar){var n=e.toolbarIconsClass.watch,i=e.toolbarIconsClass.unwatch,r=this.toolbar.find(".fa[name=watch]");r.parent().attr("title",e.lang.toolbar.unwatch),r.removeClass(n).addClass(i)}return this.codeMirror.css("border-right","none").width(this.editor.width()),this.resize(),e.onunwatch||(e.onunwatch=t||function(){}),w.proxy(e.onunwatch,this)(),this},show:function(t){t=t||function(){};var e=this;return this.editor.show(0,function(){w.proxy(t,e)()}),this},hide:function(t){t=t||function(){};var e=this;return this.editor.hide(0,function(){w.proxy(t,e)()}),this},previewing:function(){var e=this,t=this.editor,n=this.preview,i=this.toolbar,r=this.settings,o=this.codeMirror,a=this.previewContainer;if(w.inArray(r.mode,["gfm","markdown"])<0)return this;r.toolbar&&i&&(i.toggle(),i.find(".fa[name=preview]").toggleClass("active")),o.toggle();var s=function(t){t.shiftKey&&27===t.keyCode&&e.previewed()};"none"===o.css("display")?(this.state.preview=!0,this.state.fullscreen&&n.css("background","#fff"),t.find("."+this.classPrefix+"preview-close-btn").show().bind(_.mouseOrTouch("click","touchend"),function(){e.previewed()}),r.watch?a.css("padding",""):this.save(),a.addClass(this.classPrefix+"preview-active"),n.show().css({position:"",top:0,width:t.width(),height:r.autoHeight&&!this.state.fullscreen?"auto":t.height()}),this.state.loaded&&w.proxy(r.onpreviewing,this)(),w(window).bind("keyup",s)):(w(window).unbind("keyup",s),this.previewed())},previewed:function(){var t=this.editor,e=this.preview,n=this.toolbar,i=this.settings,r=this.previewContainer,o=t.find("."+this.classPrefix+"preview-close-btn");return this.state.preview=!1,this.codeMirror.show(),i.toolbar&&n.show(),e[i.watch?"show":"hide"](),o.hide().unbind(_.mouseOrTouch("click","touchend")),r.removeClass(this.classPrefix+"preview-active"),i.watch&&r.css("padding","20px"),e.css({background:null,position:"absolute",width:t.width()/2,height:i.autoHeight&&!this.state.fullscreen?"auto":t.height()-n.height(),top:i.toolbar?n.height():0}),this.state.loaded&&w.proxy(i.onpreviewed,this)(),this},fullscreen:function(){var e=this,n=this.state,t=this.editor,i=(this.preview,this.toolbar),r=this.settings,o=this.classPrefix+"fullscreen";i&&i.find(".fa[name=fullscreen]").parent().toggleClass("active");var a=function(t){t.shiftKey||27!==t.keyCode||n.fullscreen&&e.fullscreenExit()};return t.hasClass(o)?(w(window).unbind("keyup",a),this.fullscreenExit()):(n.fullscreen=!0,w("html,body").css("overflow","hidden"),t.css({width:w(window).width(),height:w(window).height()}).addClass(o),this.resize(),w.proxy(r.onfullscreen,this)(),w(window).bind("keyup",a)),this},fullscreenExit:function(){var t=this.editor,e=this.settings,n=this.toolbar,i=this.classPrefix+"fullscreen";return this.state.fullscreen=!1,n&&n.find(".fa[name=fullscreen]").parent().removeClass("active"),w("html,body").css("overflow",""),t.css({width:t.data("oldWidth"),height:t.data("oldHeight")}).removeClass(i),this.resize(),w.proxy(e.onfullscreenExit,this)(),this},executePlugin:function(t,e){var n=this,i=this.cm;return e=this.settings.pluginPath+e,"function"==typeof define?"undefined"==typeof this[t]?alert("Error: "+t+" plugin is not found, you are not load this plugin."):this[t](i):w.inArray(e,_.loadFiles.plugin)<0?_.loadPlugin(e,function(){_.loadPlugins[t]=n[t],n[t](i)}):w.proxy(_.loadPlugins[t],this)(i),this},search:function(t){var e=this.settings;return e.searchReplace?e.readOnly||this.cm.execCommand(t||"find"):alert("Error: settings.searchReplace == false"),this},searchReplace:function(){return this.search("replace"),this},searchReplaceAll:function(){return this.search("replaceAll"),this}},_.fn.init.prototype=_.fn,_.dialogLockScreen=function(){(this.settings||{dialogLockScreen:!0}).dialogLockScreen&&(w("html,body").css("overflow","hidden"),this.resize())},_.dialogShowMask=function(t){var e=this.editor,n=this.settings||{dialogShowMask:!0};t.css({top:(w(window).height()-t.height())/2+"px",left:(w(window).width()-t.width())/2+"px"}),n.dialogShowMask&&e.children("."+this.classPrefix+"mask").css("z-index",parseInt(t.css("z-index"))-1).show()},_.toolbarHandlers={undo:function(){this.cm.undo()},redo:function(){this.cm.redo()},bold:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection("**"+n+"**"),""===n&&t.setCursor(e.line,e.ch+2)},del:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection("~~"+n+"~~"),""===n&&t.setCursor(e.line,e.ch+2)},italic:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection("*"+n+"*"),""===n&&t.setCursor(e.line,e.ch+1)},quote:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("> "+n),t.setCursor(e.line,e.ch+2)):t.replaceSelection("> "+n)},ucfirst:function(){var t=this.cm,e=t.getSelection(),n=t.listSelections();t.replaceSelection(_.firstUpperCase(e)),t.setSelections(n)},ucwords:function(){var t=this.cm,e=t.getSelection(),n=t.listSelections();t.replaceSelection(_.wordsFirstUpperCase(e)),t.setSelections(n)},uppercase:function(){var t=this.cm,e=t.getSelection(),n=t.listSelections();t.replaceSelection(e.toUpperCase()),t.setSelections(n)},lowercase:function(){var t=this.cm,e=(t.getCursor(),t.getSelection()),n=t.listSelections();t.replaceSelection(e.toLowerCase()),t.setSelections(n)},h1:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("# "+n),t.setCursor(e.line,e.ch+2)):t.replaceSelection("# "+n)},h2:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("## "+n),t.setCursor(e.line,e.ch+3)):t.replaceSelection("## "+n)},h3:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("### "+n),t.setCursor(e.line,e.ch+4)):t.replaceSelection("### "+n)},h4:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("#### "+n),t.setCursor(e.line,e.ch+5)):t.replaceSelection("#### "+n)},h5:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("##### "+n),t.setCursor(e.line,e.ch+6)):t.replaceSelection("##### "+n)},h6:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();0!==e.ch?(t.setCursor(e.line,0),t.replaceSelection("###### "+n),t.setCursor(e.line,e.ch+7)):t.replaceSelection("###### "+n)},"list-ul":function(){var t=this.cm,e=(t.getCursor(),t.getSelection());if(""===e)t.replaceSelection("- "+e);else{for(var n=e.split("\n"),i=0,r=n.length;i<r;i++)n[i]=""===n[i]?"":"- "+n[i];t.replaceSelection(n.join("\n"))}},"list-ol":function(){var t=this.cm,e=(t.getCursor(),t.getSelection());if(""===e)t.replaceSelection("1. "+e);else{for(var n=e.split("\n"),i=0,r=n.length;i<r;i++)n[i]=""===n[i]?"":i+1+". "+n[i];t.replaceSelection(n.join("\n"))}},hr:function(){var t=this.cm,e=t.getCursor();t.getSelection();t.replaceSelection((0!==e.ch?"\n\n":"\n")+"------------\n\n")},tex:function(){if(!this.settings.tex)return alert("settings.tex === false"),this;var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection("$$"+n+"$$"),""===n&&t.setCursor(e.line,e.ch+2)},link:function(){this.executePlugin("linkDialog","link-dialog/link-dialog")},"reference-link":function(){this.executePlugin("referenceLinkDialog","reference-link-dialog/reference-link-dialog")},pagebreak:function(){if(!this.settings.pageBreak)return alert("settings.pageBreak === false"),this;var t=this.cm;t.getSelection();t.replaceSelection("\r\n[========]\r\n")},image:function(){this.executePlugin("imageDialog","image-dialog/image-dialog")},code:function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection("`"+n+"`"),""===n&&t.setCursor(e.line,e.ch+1)},"code-block":function(){this.executePlugin("codeBlockDialog","code-block-dialog/code-block-dialog")},"preformatted-text":function(){this.executePlugin("preformattedTextDialog","preformatted-text-dialog/preformatted-text-dialog")},table:function(){this.executePlugin("tableDialog","table-dialog/table-dialog")},datetime:function(){var t=this.cm,e=(t.getSelection(),new Date,this.settings.lang.name),n=_.dateFormat()+" "+_.dateFormat("zh-cn"===e||"zh-tw"===e?"cn-week-day":"week-day");t.replaceSelection(n)},emoji:function(){this.executePlugin("emojiDialog","emoji-dialog/emoji-dialog")},"html-entities":function(){this.executePlugin("htmlEntitiesDialog","html-entities-dialog/html-entities-dialog")},"goto-line":function(){this.executePlugin("gotoLineDialog","goto-line-dialog/goto-line-dialog")},watch:function(){this[this.settings.watch?"unwatch":"watch"]()},preview:function(){this.previewing()},fullscreen:function(){this.fullscreen()},clear:function(){this.clear()},search:function(){this.search()},help:function(){this.executePlugin("helpDialog","help-dialog/help-dialog")},info:function(){this.showInfoDialog()}},_.keyMaps={"Ctrl-1":"h1","Ctrl-2":"h2","Ctrl-3":"h3","Ctrl-4":"h4","Ctrl-5":"h5","Ctrl-6":"h6","Ctrl-B":"bold","Ctrl-D":"datetime","Ctrl-E":function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();this.settings.emoji?(t.replaceSelection(":"+n+":"),""===n&&t.setCursor(e.line,e.ch+1)):alert("Error: settings.emoji == false")},"Ctrl-Alt-G":"goto-line","Ctrl-H":"hr","Ctrl-I":"italic","Ctrl-K":"code","Ctrl-L":function(){var t=this.cm,e=t.getCursor(),n=t.getSelection(),i=""===n?"":' "'+n+'"';t.replaceSelection("["+n+"]("+i+")"),""===n&&t.setCursor(e.line,e.ch+1)},"Ctrl-U":"list-ul","Shift-Ctrl-A":function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();this.settings.atLink?(t.replaceSelection("@"+n),""===n&&t.setCursor(e.line,e.ch+1)):alert("Error: settings.atLink == false")},"Shift-Ctrl-C":"code","Shift-Ctrl-Q":"quote","Shift-Ctrl-S":"del","Shift-Ctrl-K":"tex","Shift-Alt-C":function(){var t=this.cm,e=t.getCursor(),n=t.getSelection();t.replaceSelection(["```",n,"```"].join("\n")),""===n&&t.setCursor(e.line,e.ch+3)},"Shift-Ctrl-Alt-C":"code-block","Shift-Ctrl-H":"html-entities","Shift-Alt-H":"help","Shift-Ctrl-E":"emoji","Shift-Ctrl-U":"uppercase","Shift-Alt-U":"ucwords","Shift-Ctrl-Alt-U":"ucfirst","Shift-Alt-L":"lowercase","Shift-Ctrl-I":function(){var t=this.cm,e=t.getCursor(),n=t.getSelection(),i=""===n?"":' "'+n+'"';t.replaceSelection("!["+n+"]("+i+")"),""===n&&t.setCursor(e.line,e.ch+4)},"Shift-Ctrl-Alt-I":"image","Shift-Ctrl-L":"link","Shift-Ctrl-O":"list-ol","Shift-Ctrl-P":"preformatted-text","Shift-Ctrl-T":"table","Shift-Alt-P":"pagebreak",F9:"watch",F10:"preview",F11:"fullscreen"};var d=function(t){return String.prototype.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};_.trim=d;var t=function(t){return t.toLowerCase().replace(/\b(\w)|\s(\w)/g,function(t){return t.toUpperCase()})};_.ucwords=_.wordsFirstUpperCase=t;var e=function(t){return t.toLowerCase().replace(/\b(\w)/,function(t){return t.toUpperCase()})};return _.firstUpperCase=_.ucfirst=e,_.urls={atLinkBase:"https://github.com/"},_.regexs={atLink:/@(\w+)/g,email:/(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,emailLink:/(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,emoji:/:([\w\+-]+):/g,emojiDatetime:/(\d{2}:\d{2}:\d{2})/g,twemoji:/:(tw-([\w]+)-?(\w+)?):/g,fontAwesome:/:(fa-([\w]+)(-(\w+)){0,}):/g,editormdLogo:/:(editormd-logo-?(\w+)?):/g,pageBreak:/^\[[=]{8,}\]$/},_.emoji={path:"http://www.emoji-cheat-sheet.com/graphics/emojis/",ext:".png"},_.twemoji={path:"http://twemoji.maxcdn.com/36x36/",ext:".png"},_.markedRenderer=function(h,t){var e={toc:!0,tocm:!1,tocStartLevel:1,pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1},s=w.extend(e,t||{}),i=_.$marked,n=new i.Renderer;h=h||[];var r=_.regexs,a=r.atLink,o=r.emoji,l=r.email,u=r.emailLink,g=r.twemoji,m=r.fontAwesome,v=r.editormdLogo,c=r.pageBreak;return n.emoji=function(t){var e=(t=t.replace(_.regexs.emojiDatetime,function(t){return t.replace(/:/g,":")})).match(o);if(!e||!s.emoji)return t;for(var n=0,i=e.length;n<i;n++)":+1:"===e[n]&&(e[n]=":\\+1:"),t=t.replace(new RegExp(e[n]),function(t){var e=t.match(m),n=t.replace(/:/g,"");if(e)for(var i=0,r=e.length;i<r;i++){var o=e[i].replace(/:/g,"");return'<i class="fa '+o+' fa-emoji" title="'+o.replace("fa-","")+'"></i>'}else{var a=t.match(v),s=t.match(g);if(a)for(var l=0,u=a.length;l<u;l++){var c=a[l].replace(/:/g,"");return'<i class="'+c+'" title="Editor.md logo ('+c+')"></i>'}else{if(!s){var h="+1"===n?"plus1":n;return h="moon"===(h="black_large_square"===h?"black_square":h)?"waxing_gibbous_moon":h,'<img src="'+_.emoji.path+h+_.emoji.ext+'" class="emoji" title=":'+n+':" alt=":'+n+':" />'}for(var d=0,f=s.length;d<f;d++){var p=s[d].replace(/:/g,"").replace("tw-","");return'<img src="'+_.twemoji.path+p+_.twemoji.ext+'" title="twemoji-'+p+'" alt="twemoji-'+p+'" class="emoji twemoji" />'}}}});return t},n.atLink=function(t){return a.test(t)&&(s.atLink&&(t=(t=t.replace(l,function(t){return t.replace(/@/g,"_#_@_#_")})).replace(a,function(t,e){return'<a href="'+_.urls.atLinkBase+e+'" title="@'+e+'" class="at-link">'+t+"</a>"}).replace(/_#_@_#_/g,"@")),s.emailLink&&(t=t.replace(u,function(t,e,n,i,r){return!e&&w.inArray(r,"jpg|jpeg|png|gif|webp|ico|icon|pdf".split("|"))<0?'<a href="mailto:'+t+'">'+t+"</a>":t}))),t},n.link=function(t,e,n){if(this.options.sanitize){try{var i=decodeURIComponent(unescape(t)).replace(/[^\w:]/g,"").toLowerCase()}catch(o){return""}if(0===i.indexOf("javascript:"))return""}var r='<a href="'+t+'"';return a.test(e)||a.test(n)?(e&&(r+=' title="'+e.replace(/@/g,"@")),r+'">'+n.replace(/@/g,"@")+"</a>"):(e&&(r+=' title="'+e+'"'),r+=">"+n+"</a>")},n.heading=function(t,e){var n=t,i=/\s*\<a\s*href\=\"(.*)\"\s*([^\>]*)\>(.*)\<\/a\>\s*/;if(i.test(t)){for(var r=[],o=0,a=(t=t.split(/\<a\s*([^\>]+)\>([^\>]*)\<\/a\>/)).length;o<a;o++)r.push(t[o].replace(/\s*href\=\"(.*)\"\s*/g,""));t=r.join(" ")}var s=(t=d(t)).toLowerCase().replace(/[^\w]+/g,"-"),l={text:t,level:e,slug:s},u=/^[\u4e00-\u9fa5]+$/.test(t)?escape(t).replace(/\%/g,""):t.toLowerCase().replace(/[^\w]+/g,"-");h.push(l);var c="<h"+e+' id="h'+e+"-"+this.options.headerPrefix+u+'">';return c+='<a name="'+t+'" class="reference-link"></a>',c+='<span class="header-link octicon octicon-link"></span>',c+=i?this.atLink(this.emoji(n)):this.atLink(this.emoji(t)),c+="</h"+e+">"},n.pageBreak=function(t){return c.test(t)&&s.pageBreak&&(t='<hr style="page-break-after:always;" class="page-break editormd-page-break" />'),t},n.paragraph=function(t){var e=/\$\$(.*)\$\$/g.test(t),n=/^\$\$(.*)\$\$$/.test(t),i=n?' class="'+_.classNames.tex+'"':"",r=s.tocm?/^(\[TOC\]|\[TOCM\])$/.test(t):/^\[TOC\]$/.test(t),o=/^\[TOCM\]$/.test(t),a='<div class="markdown-toc editormd-markdown-toc">'+(t=!n&&e?t.replace(/(\$\$([^\$]*)\$\$)+/g,function(t,e){return'<span class="'+_.classNames.tex+'">'+e.replace(/\$/g,"")+"</span>"}):n?t.replace(/\$/g,""):t)+"</div>";return r?o?'<div class="editormd-toc-menu">'+a+"</div><br/>":a:c.test(t)?this.pageBreak(t):"<p"+i+">"+this.atLink(this.emoji(t))+"</p>\n"},n.code=function(t,e,n){return"seq"===e||"sequence"===e?'<div class="sequence-diagram">'+t+"</div>":"flow"===e?'<div class="flowchart">'+t+"</div>":"math"===e||"latex"===e||"katex"===e?'<p class="'+_.classNames.tex+'">'+t+"</p>":i.Renderer.prototype.code.apply(this,arguments)},n.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' style="text-align:'+e.align+'">':"<"+n+">")+this.atLink(this.emoji(t))+"</"+n+">\n"},n.listitem=function(t){return s.taskList&&/^\s*\[[x\s]\]\s*/.test(t)?(t=t.replace(/^\s*\[\s\]\s*/,'<input type="checkbox" class="task-list-item-checkbox" /> ').replace(/^\s*\[x\]\s*/,'<input type="checkbox" class="task-list-item-checkbox" checked disabled /> '),'<li style="list-style: none;">'+this.atLink(this.emoji(t))+"</li>"):"<li>"+this.atLink(this.emoji(t))+"</li>"},n},_.markdownToCRenderer=function(t,e,n,i){var r="",o=0,a=this.classPrefix;i=i||1;for(var s=0,l=t.length;s<l;s++){var u=t[s].text,c=t[s].level;c<i||(r+=o<c?"":c<o?new Array(o-c+2).join("</ul></li>"):"</ul></li>",r+='<li><a class="toc-level-'+c+'" href="#'+u+'" level="'+c+'">'+u+"</a><ul>",o=c)}var h=e.find(".markdown-toc");if(h.length<1&&"false"===e.attr("previewContainer")){var d='<div class="markdown-toc '+a+'markdown-toc"></div>';d=n?'<div class="'+a+'toc-menu">'+d+"</div>":d,e.html(d),h=e.find(".markdown-toc")}return n&&h.wrap('<div class="'+a+'toc-menu"></div><br/>'),h.html('<ul class="markdown-toc-list"></ul>').children(".markdown-toc-list").html(r.replace(/\r?\n?\<ul\>\<\/ul\>/g,"")),h},_.tocDropdownMenu=function(t,a){a=a||"Table of Contents";var s=400,e=t.find("."+this.classPrefix+"toc-menu");return e.each(function(){var t=w(this),e=t.children(".markdown-toc"),i='<i class="fa fa-angle-down"></i>',n='<a href="javascript:;" class="toc-menu-btn">'+i+a+"</a>",r=e.children("ul"),o=r.find("li");e.append(n),o.first().before("<li><h1>"+a+" "+i+"</h1></li>"),t.mouseover(function(){r.show(),o.each(function(){var t=w(this),e=t.children("ul");if(""===e.html()&&e.remove(),0<e.length&&""!==e.html()){var n=t.children("a").first();n.children(".fa").length<1&&n.append(w(i).css({"float":"right",paddingTop:"4px"}))}t.mouseover(function(){e.css("z-index",s).show(),s+=1}).mouseleave(function(){e.hide()})})}).mouseleave(function(){r.hide()})}),e},_.filterHTMLTags=function(t,e){if("string"!=typeof t&&(t=new String(t)),"string"!=typeof e)return t;for(var n=e.split("|"),i=n[0].split(","),a=n[1],r=0,o=i.length;r<o;r++){var s=i[r];t=t.replace(new RegExp("<s*"+s+"s*([^>]*)>([^>]*)<s*/"+s+"s*>","igm"),"")}if(void 0!==a){var l=/\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/gi;t="*"===a?t.replace(l,function(t,e,n,i,r){return"<"+e+">"+i+"</"+r+">"}):"on*"===a?t.replace(l,function(t,e,n,i,r){var o=w("<"+e+">"+i+"</"+r+">"),a=w(t)[0].attributes,s={};w.each(a,function(t,e){'"'!==e.nodeName&&(s[e.nodeName]=e.nodeValue)}),w.each(s,function(t){0===t.indexOf("on")&&delete s[t]}),o.attr(s);var l="undefined"!=typeof o[1]?w(o[1]).text():"";return o[0].outerHTML+l}):t.replace(l,function(t,e,n,i){var r=a.split(","),o=w(t);return o.html(i),w.each(r,function(t){o.attr(r[t],null)}),o[0].outerHTML})}return t},_.markdownToHTML=function(t,e){var n={gfm:!0,toc:!0,tocm:!1,tocStartLevel:1,tocTitle:"\u76ee\u5f55",tocDropdown:!1,tocContainer:"",markdown:"",markdownSourceCode:!1,htmlDecode:!1,autoLoadKaTeX:!0,pageBreak:!0,atLink:!0,emailLink:!0,tex:!1,taskList:!1,emoji:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0};_.$marked=marked;var i=w("#"+t),r=i.settings=w.extend(!0,n,e||{}),o=i.find("textarea");o.length<1&&(i.append("<textarea></textarea>"),o=i.find("textarea"));var a=""===r.markdown?o.val():r.markdown,s=[],l={toc:r.toc,tocm:r.tocm,tocStartLevel:r.tocStartLevel,taskList:r.taskList,emoji:r.emoji,tex:r.tex,pageBreak:r.pageBreak,atLink:r.atLink,emailLink:r.emailLink,flowChart:r.flowChart,sequenceDiagram:r.sequenceDiagram,previewCodeHighlight:r.previewCodeHighlight},u={renderer:_.markedRenderer(s,l),gfm:r.gfm,tables:!0,breaks:!0,pedantic:!1,sanitize:!r.htmlDecode,smartLists:!0,smartypants:!0};a=new String(a);var c=marked(a,u);c=_.filterHTMLTags(c,r.htmlDecode),r.markdownSourceCode?o.text(a):o.remove(),i.addClass("markdown-body "+this.classPrefix+"html-preview").append(c);var h=""!==r.tocContainer?w(r.tocContainer):i;if(""!==r.tocContainer&&h.attr("previewContainer",!1),r.toc&&(i.tocContainer=this.markdownToCRenderer(s,h,r.tocDropdown,r.tocStartLevel),(r.tocDropdown||0<i.find("."+this.classPrefix+"toc-menu").length)&&this.tocDropdownMenu(i,r.tocTitle),""!==r.tocContainer&&i.find(".editormd-toc-menu, .editormd-markdown-toc").remove()),r.previewCodeHighlight&&(i.find("pre").addClass("prettyprint linenums"),prettyPrint()),_.isIE8||(r.flowChart&&i.find(".flowchart").flowChart(),r.sequenceDiagram&&i.find(".sequence-diagram").sequenceDiagram({theme:"simple"})),r.tex){var d=function(){i.find("."+_.classNames.tex).each(function(){var t=w(this);katex.render(t.html().replace(/</g,"<").replace(/>/g,">"),t[0]),t.find(".katex").css("font-size","1.6em")})};!r.autoLoadKaTeX||_.$katex||_.kaTeXLoaded?d():this.loadKaTeX(function(){_.$katex=katex,_.kaTeXLoaded=!0,d()})}return i.getMarkdown=function(){return o.val()},i},_.themes=["default","dark"],_.previewThemes=["default","dark"],_.editorThemes=["default","3024-day","3024-night","ambiance","ambiance-mobile","base16-dark","base16-light","blackboard","cobalt","eclipse","elegant","erlang-dark","lesser-dark","mbo","mdn-like","midnight","monokai","neat","neo","night","paraiso-dark","paraiso-light","pastel-on-dark","rubyblue","solarized","the-matrix","tomorrow-night-eighties","twilight","vibrant-ink","xq-dark","xq-light"],_.loadPlugins={},_.loadFiles={js:[],css:[],plugin:[]},_.loadPlugin=function(t,e,n){e=e||function(){},this.loadScript(t,function(){_.loadFiles.plugin.push(t),e()},n)},_.loadCSS=function(t,e,n){n=n||"head",e=e||function(){};var i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.onload=i.onreadystatechange=function(){_.loadFiles.css.push(t),e()},i.href=t+".css","head"===n?document.getElementsByTagName("head")[0].appendChild(i):document.body.appendChild(i)},_.isIE="Microsoft Internet Explorer"==navigator.appName,_.isIE8=_.isIE&&"8."==navigator.appVersion.match(/8./i),_.loadScript=function(t,e,n){n=n||"head",e=e||function(){};var i=null;(i=document.createElement("script")).id=t.replace(/[\./]+/g,"-"),i.type="text/javascript",i.src=t+".js",_.isIE8?i.onreadystatechange=function(){i.readyState&&("loaded"!==i.readyState&&"complete"!==i.readyState||(i.onreadystatechange=null,_.loadFiles.js.push(t),e()))}:i.onload=function(){_.loadFiles.js.push(t),e()},"head"===n?document.getElementsByTagName("head")[0].appendChild(i):document.body.appendChild(i)},_.katexURL={css:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",js:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"},_.kaTeXLoaded=!1,_.loadKaTeX=function(t){_.loadCSS(_.katexURL.css,function(){_.loadScript(_.katexURL.js,t||function(){})})},_.lockScreen=function(t){w("html,body").css("overflow",t?"hidden":"")},_.createDialog=function(e){var t={name:"",width:420,height:240,title:"",drag:!0,closed:!0,content:"",mask:!0,maskStyle:{backgroundColor:"#fff",opacity:.1},lockScreen:!0,footer:!0,buttons:!1};e=w.extend(!0,t,e);var n=this,i=this.editor,r=_.classPrefix,o=(new Date).getTime(),a=""===e.name?r+"dialog-"+o:e.name,s=_.mouseOrTouch,l='<div class="'+r+"dialog "+a+'">';""!==e.title&&(l+='<div class="'+r+'dialog-header"'+(e.drag?' style="cursor: move;"':"")+">",l+='<strong class="'+r+'dialog-title">'+e.title+"</strong>",l+="</div>"),e.closed&&(l+='<a href="javascript:;" class="fa fa-close '+r+'dialog-close"></a>'),l+='<div class="'+r+'dialog-container">'+e.content,(e.footer||"string"==typeof e.footer)&&(l+='<div class="'+r+'dialog-footer">'+("boolean"==typeof e.footer?"":e.footer)+"</div>"),l+="</div>",l+='<div class="'+r+"dialog-mask "+r+'dialog-mask-bg"></div>',l+='<div class="'+r+"dialog-mask "+r+'dialog-mask-con"></div>',l+="</div>",i.append(l);var u=i.find("."+a);u.lockScreen=function(t){return e.lockScreen&&(w("html,body").css("overflow",t?"hidden":""),n.resize()),u},u.showMask=function(){return e.mask&&i.find("."+r+"mask").css(e.maskStyle).css("z-index",_.dialogZindex-1).show(),u},u.hideMask=function(){return e.mask&&i.find("."+r+"mask").hide(),u},u.loading=function(t){return u.find("."+r+"dialog-mask")[t?"show":"hide"](),u},u.lockScreen(!0).showMask(),u.show().css({zIndex:_.dialogZindex,border:_.isIE8?"1px solid #ddd":"",width:"number"==typeof e.width?e.width+"px":e.width,height:"number"==typeof e.height?e.height+"px":e.height});var c=function(){u.css({top:(w(window).height()-u.height())/2+"px",left:(w(window).width()-u.width())/2+"px"})};if(c(),w(window).resize(c),u.children("."+r+"dialog-close").bind(s("click","touchend"),function(){u.hide().lockScreen(!1).hideMask()}),"object"==typeof e.buttons){var h=u.footer=u.find("."+r+"dialog-footer");for(var d in e.buttons){var f=e.buttons[d],p=r+d+"-btn";h.append('<button class="'+r+"btn "+p+'">'+f[0]+"</button>"),f[1]=w.proxy(f[1],u),h.children("."+p).bind(s("click","touchend"),f[1])}}if(""!==e.title&&e.drag){var g,m,v=u.children("."+r+"dialog-header");e.mask||v.bind(s("click","touchend"),function(){_.dialogZindex+=2,u.css("z-index",_.dialogZindex)}),v.mousedown(function(t){t=t||window.event,g=t.clientX-parseInt(u[0].style.left),m=t.clientY-parseInt(u[0].style.top),document.onmousemove=b});var y=function(t){t.removeClass(r+"user-unselect").off("selectstart")},x=function(t){t.addClass(r+"user-unselect").on("selectstart",function(){return!1})},b=function(t){t=t||window.event;var e,n,i=parseInt(u[0].style.left),r=parseInt(u[0].style.top);0<=i?i+u.width()<=w(window).width()?e=t.clientX-g:(e=w(window).width()-u.width(),document.onmousemove=null):(e=0,document.onmousemove=null),0<=r?n=t.clientY-m:(n=0,document.onmousemove=null),document.onselectstart=function(){return!1},x(w("body")),x(u),u[0].style.left=e+"px",u[0].style.top=n+"px"};document.onmouseup=function(){y(w("body")),y(u),document.onselectstart=null,document.onmousemove=null},v.touchDraggable=function(){var i=null,t=function(t){var e=t.originalEvent,n=w(this).parent().position();i={x:e.changedTouches[0].pageX-n.left,y:e.changedTouches[0].pageY-n.top}},e=function(t){t.preventDefault();var e=t.originalEvent;w(this).parent().css({top:e.changedTouches[0].pageY-i.y,left:e.changedTouches[0].pageX-i.x})};this.bind("touchstart",t).bind("touchmove",e)},v.touchDraggable()}return _.dialogZindex+=2,u},_.mouseOrTouch=function(t,e){e=e||"touchend";var n=t=t||"click";try{document.createEvent("TouchEvent"),n=e}catch(i){}return n},_.dateFormat=function(t){t=t||"";var e=function(t){return t<10?"0"+t:t},n=new Date,i=n.getFullYear(),r=i.toString().slice(2,4),o=e(n.getMonth()+1),a=e(n.getDate()),s=n.getDay(),l=e(n.getHours()),u=e(n.getMinutes()),c=e(n.getSeconds()),h=e(n.getMilliseconds()),d="",f=r+"-"+o+"-"+a,p=i+"-"+o+"-"+a,g=l+":"+u+":"+c;switch(t){case"UNIX Time":d=n.getTime();break;case"UTC":d=n.toUTCString();break;case"yy":d=r;break;case"year":case"yyyy":d=i;break;case"month":case"mm":d=o;break;case"cn-week-day":case"cn-wd":d="\u661f\u671f"+["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"][s];break;case"week-day":case"wd":d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][s];break;case"day":case"dd":d=a;break;case"hour":case"hh":d=l;break;case"min":case"ii":d=u;break;case"second":case"ss":d=c;break;case"ms":d=h;break;case"yy-mm-dd":d=f;break;case"yyyy-mm-dd":d=p;break;case"yyyy-mm-dd h:i:s ms":case"full + ms":d=p+" "+g+" "+h;break;case"full":case"yyyy-mm-dd h:i:s":default:d=p+" "+g}return d},_}}),function(){var n=function(t){var e={name:"zh-tw",description:"\u958b\u6e90\u5728\u7ddaMarkdown\u7de8\u8f2f\u5668<br/>Open source online Markdown editor.",tocTitle:"\u76ee\u9304",
|
|
toolbar:{undo:"\u64a4\u92b7\uff08Ctrl+Z\uff09",redo:"\u91cd\u505a\uff08Ctrl+Y\uff09",bold:"\u7c97\u9ad4",del:"\u522a\u9664\u7dda",italic:"\u659c\u9ad4",quote:"\u5f15\u7528",ucwords:"\u5c07\u6240\u9078\u7684\u6bcf\u500b\u55ae\u8a5e\u9996\u5b57\u6bcd\u8f49\u6210\u5927\u5beb",uppercase:"\u5c07\u6240\u9078\u6587\u672c\u8f49\u6210\u5927\u5beb",lowercase:"\u5c07\u6240\u9078\u6587\u672c\u8f49\u6210\u5c0f\u5beb",h1:"\u6a19\u984c1",h2:"\u6a19\u984c2",h3:"\u6a19\u984c3",h4:"\u6a19\u984c4",h5:"\u6a19\u984c5",h6:"\u6a19\u984c6","list-ul":"\u7121\u5e8f\u5217\u8868","list-ol":"\u6709\u5e8f\u5217\u8868",hr:"\u6a2a\u7ebf",link:"\u94fe\u63a5","reference-link":"\u5f15\u7528\u93c8\u63a5",image:"\u5716\u7247",code:"\u884c\u5167\u4ee3\u78bc","preformatted-text":"\u9810\u683c\u5f0f\u6587\u672c / \u4ee3\u78bc\u584a\uff08\u7e2e\u9032\u98a8\u683c\uff09","code-block":"\u4ee3\u78bc\u584a\uff08\u591a\u8a9e\u8a00\u98a8\u683c\uff09",table:"\u6dfb\u52a0\u8868\u683c",datetime:"\u65e5\u671f\u6642\u9593",emoji:"Emoji \u8868\u60c5","html-entities":"HTML \u5be6\u9ad4\u5b57\u7b26",pagebreak:"\u63d2\u5165\u5206\u9801\u7b26",watch:"\u95dc\u9589\u5be6\u6642\u9810\u89bd",unwatch:"\u958b\u555f\u5be6\u6642\u9810\u89bd",preview:"\u5168\u7a97\u53e3\u9810\u89bdHTML\uff08\u6309 Shift + ESC \u9000\u51fa\uff09",fullscreen:"\u5168\u5c4f\uff08\u6309 ESC \u9000\u51fa\uff09",clear:"\u6e05\u7a7a",search:"\u641c\u5c0b",help:"\u4f7f\u7528\u5e6b\u52a9",info:"\u95dc\u65bc"+t.title},buttons:{enter:"\u78ba\u5b9a",cancel:"\u53d6\u6d88",close:"\u95dc\u9589"},dialog:{link:{title:"\u6dfb\u52a0\u93c8\u63a5",url:"\u93c8\u63a5\u5730\u5740",urlTitle:"\u93c8\u63a5\u6a19\u984c",urlEmpty:"\u932f\u8aa4\uff1a\u8acb\u586b\u5beb\u93c8\u63a5\u5730\u5740\u3002"},referenceLink:{title:"\u6dfb\u52a0\u5f15\u7528\u93c8\u63a5",name:"\u5f15\u7528\u540d\u7a31",url:"\u93c8\u63a5\u5730\u5740",urlId:"\u93c8\u63a5ID",urlTitle:"\u93c8\u63a5\u6a19\u984c",nameEmpty:"\u932f\u8aa4\uff1a\u5f15\u7528\u93c8\u63a5\u7684\u540d\u7a31\u4e0d\u80fd\u70ba\u7a7a\u3002",idEmpty:"\u932f\u8aa4\uff1a\u8acb\u586b\u5beb\u5f15\u7528\u93c8\u63a5\u7684ID\u3002",urlEmpty:"\u932f\u8aa4\uff1a\u8acb\u586b\u5beb\u5f15\u7528\u93c8\u63a5\u7684URL\u5730\u5740\u3002"},image:{title:"\u6dfb\u52a0\u5716\u7247",url:"\u5716\u7247\u5730\u5740",link:"\u5716\u7247\u93c8\u63a5",alt:"\u5716\u7247\u63cf\u8ff0",uploadButton:"\u672c\u5730\u4e0a\u50b3",imageURLEmpty:"\u932f\u8aa4\uff1a\u5716\u7247\u5730\u5740\u4e0d\u80fd\u70ba\u7a7a\u3002",uploadFileEmpty:"\u932f\u8aa4\uff1a\u4e0a\u50b3\u7684\u5716\u7247\u4e0d\u80fd\u70ba\u7a7a\uff01",formatNotAllowed:"\u932f\u8aa4\uff1a\u53ea\u5141\u8a31\u4e0a\u50b3\u5716\u7247\u6587\u4ef6\uff0c\u5141\u8a31\u4e0a\u50b3\u7684\u5716\u7247\u6587\u4ef6\u683c\u5f0f\u6709\uff1a"},preformattedText:{title:"\u6dfb\u52a0\u9810\u683c\u5f0f\u6587\u672c\u6216\u4ee3\u78bc\u584a",emptyAlert:"\u932f\u8aa4\uff1a\u8acb\u586b\u5beb\u9810\u683c\u5f0f\u6587\u672c\u6216\u4ee3\u78bc\u7684\u5167\u5bb9\u3002"},codeBlock:{title:"\u6dfb\u52a0\u4ee3\u78bc\u584a",selectLabel:"\u4ee3\u78bc\u8a9e\u8a00\uff1a",selectDefaultText:"\u8acb\u8a9e\u8a00\u4ee3\u78bc\u8a9e\u8a00",otherLanguage:"\u5176\u4ed6\u8a9e\u8a00",unselectedLanguageAlert:"\u932f\u8aa4\uff1a\u8acb\u9078\u64c7\u4ee3\u78bc\u6240\u5c6c\u7684\u8a9e\u8a00\u985e\u578b\u3002",codeEmptyAlert:"\u932f\u8aa4\uff1a\u8acb\u586b\u5beb\u4ee3\u78bc\u5167\u5bb9\u3002"},htmlEntities:{title:"HTML\u5be6\u9ad4\u5b57\u7b26"},help:{title:"\u4f7f\u7528\u5e6b\u52a9"}}};t.defaults.lang=e};"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=n:"function"==typeof define?define.amd?define(["editormd"],function(t){n(t)}):define(function(t){var e=t("../editormd");n(e)}):n(window.editormd)}(),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).dragula=t()}}(function(){return function c(o,a,s){function l(n,t){if(!a[n]){if(!o[n]){var e="function"==typeof require&&require;if(!t&&e)return e(n,!0);if(u)return u(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var r=a[n]={exports:{}};o[n][0].call(r.exports,function(t){var e=o[n][1][t];return l(e||t)},r,r.exports,c,o,a,s)}return a[n].exports}for(var u="function"==typeof require&&require,t=0;t<s.length;t++)l(s[t]);return l}({1:[function(t,e){"use strict";function i(t){var e=o[t];return e?e.lastIndex=0:o[t]=e=new RegExp(a+t+s,"g"),e}function n(t,e){var n=t.className;n.length?i(e).test(n)||(t.className+=" "+e):t.className=e}function r(t,e){t.className=t.className.replace(i(e)," ").trim()}var o={},a="(?:^|\\s)",s="(?:\\s|$)";e.exports={add:n,rm:r}},{}],2:[function(i,o){(function(s){"use strict";function t(t,e){function a(t){return-1!==q.containers.indexOf(t)||$.isContainer(t)}function n(t){var e=t?"remove":"add";G(ut,e,"mousedown",l),G(ut,e,"mouseup",v)}function o(t){G(ut,t?"remove":"add","mousemove",u)}function s(t){var e=t?"remove":"add";at[e](ut,"selectstart",r),at[e](ut,"click",r)}function i(){n(!0),v({})}function r(t){W&&t.preventDefault()}function l(t){if(F=t.clientX,z=t.clientY,!(1!==Y(t)||t.metaKey||t.ctrlKey)){var e=t.target,n=c(e);n&&(W=n,o(),"mousedown"===t.type&&(nt(e)?e.focus():t.preventDefault()))}}function u(t){if(W)if(0!==Y(t)){if(void 0===t.clientX||t.clientX!==F||void 0===t.clientY||t.clientY!==z){if($.ignoreInputTextSelection){var e=rt("clientX",t),n=rt("clientY",t);if(nt(lt.elementFromPoint(e,n)))return}var i=W;o(!0),s(),g(),f(i);var r=Z(P);N=rt("pageX",t)-r.left,R=rt("pageY",t)-r.top,st.add(V||P,"gu-transit"),D(),C(t)}}else v({})}function c(t){if(!(q.dragging&&L||a(t))){for(var e=t;et(t)&&!1===a(et(t));){if($.invalid(t,e))return;if(!(t=et(t)))return}var n=et(t);if(n)if(!$.invalid(t,e))if($.moves(t,n,e,it(t)))return{item:t,source:n}}}function h(t){return!!c(t)}function d(t){var e=c(t);e&&f(e)}function f(t){E(t.item,t.source)&&(V=t.item.cloneNode(!0),q.emit("cloned",V,t.item,"copy")),O=t.source,P=t.item,H=B=it(t.item),q.dragging=!0,q.emit("drag",P,O)}function p(){return!1}function g(){if(q.dragging){var t=V||P;y(t,et(t))}}function m(){o(!(W=!1)),s(!0)}function v(t){if(m(),q.dragging){var e=V||P,n=rt("clientX",t),i=rt("clientY",t),r=S(X(L,n,i),n,i);r&&(V&&$.copySortSource||!V||r!==O)?y(e,r):$.removeOnSpill?x():b()}}function y(t,e){var n=et(t);V&&$.copySortSource&&e===O&&n.removeChild(P),_(e)?q.emit("cancel",t,O,O):q.emit("drop",t,e,O,B),w()}function x(){if(q.dragging){var t=V||P,e=et(t);e&&e.removeChild(t),q.emit(V?"cancel":"remove",t,e,O),w()}}function b(t){if(q.dragging){var e=0<arguments.length?t:$.revertOnSpill,n=V||P,i=et(n),r=_(i);!1===r&&e&&(V?i&&i.removeChild(V):O.insertBefore(n,H)),r||e?q.emit("cancel",n,O,O):q.emit("drop",n,i,O,B),w()}}function w(){var t=V||P;m(),M(),t&&st.rm(t,"gu-transit"),j&&clearTimeout(j),q.dragging=!1,U&&q.emit("out",t,U,O),q.emit("dragend",t),O=P=V=H=B=j=U=null}function _(t,e){var n;return n=void 0!==e?e:L?B:it(V||P),t===O&&n===H}function S(n,i,r){function t(){if(!1===a(o))return!1;var t=I(o,n),e=k(o,t,i,r);return!!_(o,e)||$.accepts(P,o,O,e)}for(var o=n;o&&!t();)o=et(o);return o}function C(t){function e(t){q.emit(t,l,U,O)}function n(){h&&e("over")}function i(){U&&e("out")}if(L){t.preventDefault();var r=rt("clientX",t),o=rt("clientY",t),a=r-N,s=o-R;L.style.left=a+"px",L.style.top=s+"px";var l=V||P,u=X(L,r,o),c=S(u,r,o),h=null!==c&&c!==U;(h||null===c)&&(i(),U=c,n());var d=et(l);if(c!==O||!V||$.copySortSource){var f,p=I(c,u);if(null!==p)f=k(c,p,r,o);else{if(!0!==$.revertOnSpill||V)return void(V&&d&&d.removeChild(l));f=H,c=O}(null===f&&h||f!==l&&f!==it(l))&&(B=f,c.insertBefore(l,f),q.emit("shadow",l,c,O))}else d&&d.removeChild(l)}}function T(t){st.rm(t,"gu-hide")}function A(t){q.dragging&&st.add(t,"gu-hide")}function D(){if(!L){var t=P.getBoundingClientRect();(L=P.cloneNode(!0)).style.width=J(t)+"px",L.style.height=tt(t)+"px",st.rm(L,"gu-transit"),st.add(L,"gu-mirror"),$.mirrorContainer.appendChild(L),G(ut,"add","mousemove",C),st.add($.mirrorContainer,"gu-unselectable"),q.emit("cloned",L,P,"mirror")}}function M(){L&&(st.rm($.mirrorContainer,"gu-unselectable"),G(ut,"remove","mousemove",C),et(L).removeChild(L),L=null)}function I(t,e){for(var n=e;n!==t&&et(n)!==t;)n=et(n);return n===ut?null:n}function k(r,e,o,a){function t(){var t,e,n,i=r.children.length;for(t=0;t<i;t++){if(n=(e=r.children[t]).getBoundingClientRect(),s&&n.left+n.width/2>o)return e;if(!s&&n.top+n.height/2>a)return e}return null}function n(){var t=e.getBoundingClientRect();return i(s?o>t.left+J(t)/2:a>t.top+tt(t)/2)}function i(t){return t?it(e):e}var s="horizontal"===$.direction;return e!==r?n():t()}function E(t,e){return"boolean"==typeof $.copy?$.copy:$.copy(t,e)}var L,O,P,N,R,F,z,H,B,V,j;1===arguments.length&&!1===Array.isArray(t)&&(e=t,t=[]);var W,U=null,$=e||{};void 0===$.moves&&($.moves=Q),void 0===$.accepts&&($.accepts=Q),void 0===$.invalid&&($.invalid=p),void 0===$.containers&&($.containers=t||[]),void 0===$.isContainer&&($.isContainer=K),void 0===$.copy&&($.copy=!1),void 0===$.copySortSource&&($.copySortSource=!1),void 0===$.revertOnSpill&&($.revertOnSpill=!1),void 0===$.removeOnSpill&&($.removeOnSpill=!1),void 0===$.direction&&($.direction="vertical"),void 0===$.ignoreInputTextSelection&&($.ignoreInputTextSelection=!0),void 0===$.mirrorContainer&&($.mirrorContainer=lt.body);var q=ot({containers:$.containers,start:d,end:g,cancel:b,remove:x,destroy:i,canMove:h,dragging:!1});return!0===$.removeOnSpill&&q.on("over",T).on("out",A),n(),q}function G(t,e,n,i){var r={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},o={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},a={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};s.navigator.pointerEnabled?at[e](t,o[n],i):s.navigator.msPointerEnabled?at[e](t,a[n],i):(at[e](t,r[n],i),at[e](t,n,i))}function Y(t){if(void 0!==t.touches)return t.touches.length;if(void 0!==t.which&&0!==t.which)return t.which;if(void 0!==t.buttons)return t.buttons;var e=t.button;return void 0!==e?1&e?1:2&e?3:4&e?2:0:void 0}function Z(t){var e=t.getBoundingClientRect();return{left:e.left+n("scrollLeft","pageXOffset"),top:e.top+n("scrollTop","pageYOffset")}}function n(t,e){return"undefined"!=typeof s[e]?s[e]:ut.clientHeight?ut[t]:lt.body[t]}function X(t,e,n){var i,r=t||{},o=r.className;return r.className+=" gu-hide",i=lt.elementFromPoint(e,n),r.className=o,i}function K(){return!1}function Q(){return!0}function J(t){return t.width||t.right-t.left}function tt(t){return t.height||t.bottom-t.top}function et(t){return t.parentNode===lt?null:t.parentNode}function nt(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||e(t)}function e(t){return!!t&&("false"!==t.contentEditable&&("true"===t.contentEditable||e(et(t))))}function it(e){function t(){for(var t=e;(t=t.nextSibling)&&1!==t.nodeType;);return t}return e.nextElementSibling||t()}function r(t){return t.targetTouches&&t.targetTouches.length?t.targetTouches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t}function rt(t,e){var n=r(e),i={pageX:"clientX",pageY:"clientY"};return t in i&&!(t in n)&&i[t]in n&&(t=i[t]),n[t]}var ot=i("contra/emitter"),at=i("crossvent"),st=i("./classes"),lt=document,ut=lt.documentElement;o.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(t,e){e.exports=function n(t,e){return Array.prototype.slice.call(t,e)}},{}],4:[function(t,e){"use strict";var r=t("ticky");e.exports=function o(t,e,n){t&&r(function i(){t.apply(n||null,e||[])})}},{ticky:9}],5:[function(t,e){"use strict";var l=t("atoa"),u=t("./debounce");e.exports=function n(o,t){var a=t||{},s={};return o===undefined&&(o={}),o.on=function(t,e){return s[t]?s[t].push(e):s[t]=[e],o},o.once=function(t,e){return e._once=!0,o.on(t,e),o},o.off=function(t,e){var n=arguments.length;if(1===n)delete s[t];else if(0===n)s={};else{var i=s[t];if(!i)return o;i.splice(i.indexOf(e),1)}return o},o.emit=function(){var t=l(arguments);return o.emitterSnapshot(t.shift()).apply(this,t)},o.emitterSnapshot=function(r){var t=(s[r]||[]).slice(0);return function(){var e=l(arguments),n=this||o;if("error"===r&&!1!==a["throws"]&&!t.length)throw 1===e.length?e[0]:e;return t.forEach(function i(t){a.async?u(t,e,n):t.apply(n,e),t._once&&o.off(r,t)}),o}},o}},{"./debounce":4,atoa:3}],6:[function(m,v){(function(s){"use strict";function t(t,e,n,i){return t.addEventListener(e,n,i)}function e(t,e,n){return t.attachEvent("on"+e,a(t,e,n))}function n(t,e,n,i){return t.removeEventListener(e,n,i)}function i(t,e,n){var i=l(t,e,n);if(i)return t.detachEvent("on"+e,i)}function r(t,e,n){function i(){var t;return d.createEvent?(t=d.createEvent("Event")).initEvent(e,!0,!0):d.createEventObject&&(t=d.createEventObject()),t}function r(){return new c(e,{detail:n})}var o=-1===h.indexOf(e)?r():i();t.dispatchEvent?t.dispatchEvent(o):t.fireEvent("on"+e,o)}function o(r,t,o){return function a(t){var e=t||s.event;e.target=e.target||e.srcElement,e.preventDefault=e.preventDefault||function n(){e.returnValue=!1},e.stopPropagation=e.stopPropagation||function i(){e.cancelBubble=!0},e.which=e.which||e.keyCode,o.call(r,e)}}function a(t,e,n){var i=l(t,e,n)||o(t,e,n);return g.push({wrapper:i,element:t,type:e,fn:n}),i}function l(t,e,n){var i=u(t,e,n);if(i){var r=g[i].wrapper;return g.splice(i,1),r}}function u(t,e,n){var i,r;for(i=0;i<g.length;i++)if((r=g[i]).element===t&&r.type===e&&r.fn===n)return i}var c=m("custom-event"),h=m("./eventmap"),d=s.document,f=t,p=n,g=[];s.addEventListener||(f=e,p=i),v.exports={add:f,remove:p,fabricate:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(t,r){(function(t){"use strict";var e=[],n="",i=/^on/;for(n in t)i.test(n)&&e.push(n.slice(2));r.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(t,r){(function(t){function e(){try{var t=new n("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(c){}return!1}var n=t.CustomEvent;r.exports=e()?n:"function"==typeof document.createEvent?function i(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function i(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(t,e){var n;n="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){setTimeout(t,0)},e.exports=n},{}]},{},[2])(2)}),jQuery.fn.datepicker.dates["zh-CN"]={days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],daysShort:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],daysMin:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],today:"\u4eca\u5929",monthsTitle:"\u9009\u62e9\u6708\u4efd",clear:"\u6e05\u9664",format:"yyyy-mm-dd",titleFormat:"yyyy\u5e74mm\u6708",weekStart:1},jQuery.fn.datetimepicker.dates["zh-CN"]={days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d","\u661f\u671f\u65e5"],daysShort:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d","\u5468\u65e5"],daysMin:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u65e5"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthsShort:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],today:"\u4eca\u5929",suffix:[],meridiem:["\u4e0a\u5348","\u4e0b\u5348"]},function(t){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate"],t):t(jQuery)}(function(t){t.extend(t.validator.messages,{required:"\u8fd9\u662f\u5fc5\u586b\u5b57\u6bb5",remote:"\u8bf7\u4fee\u6b63\u6b64\u5b57\u6bb5",email:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740",url:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u7f51\u5740",date:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f",dateISO:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f (YYYY-MM-DD)",number:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u6570\u5b57",digits:"\u53ea\u80fd\u8f93\u5165\u6570\u5b57",creditcard:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u4fe1\u7528\u5361\u53f7\u7801",equalTo:"\u4f60\u7684\u8f93\u5165\u4e0d\u76f8\u540c",extension:"\u8bf7\u8f93\u5165\u6709\u6548\u7684\u540e\u7f00",maxlength:t.validator.format("\u6700\u591a\u53ef\u4ee5\u8f93\u5165 {0} \u4e2a\u5b57\u7b26"),minlength:t.validator.format("\u6700\u5c11\u8981\u8f93\u5165 {0} \u4e2a\u5b57\u7b26"),rangelength:t.validator.format("\u8bf7\u8f93\u5165\u957f\u5ea6\u5728 {0} \u5230 {1} \u4e4b\u95f4\u7684\u5b57\u7b26\u4e32"),range:t.validator.format("\u8bf7\u8f93\u5165\u8303\u56f4\u5728 {0} \u5230 {1} \u4e4b\u95f4\u7684\u6570\u503c"),max:t.validator.format("\u8bf7\u8f93\u5165\u4e0d\u5927\u4e8e {0} \u7684\u6570\u503c"),min:t.validator.format("\u8bf7\u8f93\u5165\u4e0d\u5c0f\u4e8e {0} \u7684\u6570\u503c")})}),function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var t=jQuery.fn.select2.amd;t.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"\u65e0\u6cd5\u8f7d\u5165\u7ed3\u679c\u3002"},inputTooLong:function(t){return"\u8bf7\u5220\u9664"+(t.input.length-t.maximum)+"\u4e2a\u5b57\u7b26"},inputTooShort:function(t){return"\u8bf7\u518d\u8f93\u5165\u81f3\u5c11"+(t.minimum-t.input.length)+"\u4e2a\u5b57\u7b26"},loadingMore:function(){return"\u8f7d\u5165\u66f4\u591a\u7ed3\u679c\u2026"},maximumSelected:function(t){return"\u6700\u591a\u53ea\u80fd\u9009\u62e9"+t.maximum+"\u4e2a\u9879\u76ee"},noResults:function(){return"\u672a\u627e\u5230\u7ed3\u679c"},searching:function(){return"\u641c\u7d22\u4e2d\u2026"},removeAllItems:function(){return"\u5220\u9664\u6240\u6709\u9879\u76ee"}}}),t.define,t.require}(),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-carousels-index-page").length){var a=function(){$("#carousels-container .custom-carousel-item-no").each(function(t,e){$(e).html(t+1)})};$(document).on("delete_success",a),$(".carousels-card").on("click",".save-data-btn",function(){var t=$(this),e=t.data("id"),n=$(".custom-carousel-item-"+e).find(".link-input").val(),i=$(".custom-carousel-item-"+e).find(".name-input").val();i&&0!=i.length?(t.attr("disabled",!0),$.ajax({url:"/cooperative/carousels/"+e,method:"PATCH",dataType:"json",data:{link:n,name:i},success:function(){$.notify({message:"\u64cd\u4f5c\u6210\u529f"})},error:ajaxErrorNotifyHandler,complete:function(){t.removeAttr("disabled")}})):$.notify({message:"\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a"},{type:"danger"})}),$(".carousels-card").on("change",".online-check-box",function(){var t=$(this),e=t.data("id"),n=t.is(":checked");t.attr("disabled",!0),$.ajax({url:"/cooperative/carousels/"+e,method:"PATCH",dataType:"json",data:{status:n},success:function(){$.notify({message:"\u4fdd\u5b58\u6210\u529f"});var t=$(".custom-carousel-item-"+e).find(".drag");n?t.removeClass("not_active"):t.addClass("not_active")},error:ajaxErrorNotifyHandler,complete:function(){t.removeAttr("disabled")}})});var t=function(t,e,n,i){var r=$(t).data("id"),o=$(i).data("id")||"";$.ajax({url:"/cooperative/carousels/drag",method:"POST",dataType:"json",data:{move_id:r,after_id:o},success:function(){a()},error:function(t){var e=t.responseJSON;$.notify({message:"\u79fb\u52a8\u5931\u8d25\uff0c\u539f\u56e0\uff1a"+e.message},{type:"danger"})}})},e=document.getElementById("carousels-container");dragula([e],{mirrorContainer:e}).on("drop",t);var n=$(".modal.cooperative-add-carousel-modal"),i=n.find("form.cooperative-add-carousel-form");i.validate({errorElement:"span",errorClass:"danger text-danger",rules:{"portal_image[image]":{required:!0},"portal_image[name]":{required:!0}}}),n.on("show.bs.modal",function(){resetFileInputFunc(n.find(".img-file-input")),n.find(".file-names").html("\u9009\u62e9\u6587\u4ef6")}),n.on("click",".submit-btn",function(){i.find(".error").html(""),i.valid()?i.submit():i.find(".error").html("\u8bf7\u9009\u62e9\u56fe\u7247")}),n.on("change",".img-file-input",function(){var t=$(this)[0].files[0];n.find(".file-names").html(t?t.name:"\u8bf7\u9009\u62e9\u6587\u4ef6")}),$(".modal.cooperative-upload-file-modal").on("upload:success",function(t,e){$(".custom-carousel-item-"+e.source_id).find(".custom-carousel-item-img img").attr("src",e.url)})}}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-competition-settings-index-page").length){var n={autoclose:!0,language:"zh-CN",format:"yyyy-mm-dd",startDate:"2017-04-01"},i={autoclose:1,language:"zh-CN",format:"yyyy-mm-dd hh:ii",minuteStep:30},t=function(e){var t=$.extend({inputs:$(e).find(".start-date, .end-date")},n);$(e).datepicker(t),$(e).find(".start-date").datepicker().on("changeDate",function(t){$(e).find(".end-date").datepicker("setStartDate",t.date)})};$(".competition-start-end-date .start-date").datetimepicker(i),$(".competition-start-end-date .end-date").datetimepicker(i),$(".nav-setting-form .enroll_end_time").datetimepicker(i),$(".stage-update-form .section-start-time").datetimepicker(i),$(".stage-update-form .section-end-time").datetimepicker(i),t(".teaching-mode-date");var r=$("form.basic-setting-form");r.validate({errorElement:"span",errorClass:"danger text-danger",rules:{name:"required",subTitle:"required",startTime:"required",endTime:"required",mode:"required",identifier:"required"}}),r.on("click",".submit-btn",function(){r.find(".submit-btn").attr("disabled","disabled"),r.find(".error").html("");var t=r.valid();if(2==$("input[name='mode']:checked").val()){var e=$("input[name='course_id']");e.val()===undefined||0===e.val().length?(e.addClass("danger text-danger"),t=!1):e.removeClass("danger text-danger")}else if(3==$("input[name='mode']:checked").val()){var n=$("input[name='teach_start_time']"),i=$("input[name='teach_end_time']");n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),t=!1):n.removeClass("danger text-danger"),i.val()===undefined||0===i.val().length?(i.addClass("danger text-danger"),t=!1):i.removeClass("danger text-danger")}else $("input[name='course_id']").removeClass("danger text-danger"),$("input[name='teach_start_time']").removeClass("danger text-danger"),$("input[name='teach_end_time']").removeClass("danger text-danger");t&&$.ajax({method:"POST",dataType:"json",url:r.attr("action"),data:new FormData(r[0]),processData:!1,contentType:!1,success:function(){$.notify({message:"\u4fdd\u5b58\u6210\u529f"})},error:function(t){var e=t.responseJSON;r.find(".error").html(e.message)},complete:function(){r.find(".submit-btn").attr("disabled",!1)}})});var e={theme:"bootstrap4",placeholder:"\u8bf7\u8f93\u5165\u8981\u6dfb\u52a0\u7684\u5355\u4f4d\u540d\u79f0",multiple:!0,minimumInputLength:1,ajax:{delay:500,url:"/api/schools/search.json",dataType:"json",data:function(t){return{keyword:t.term}},processResults:function(t){return{results:t.schools}}},templateResult:function(t){return t.id&&""!==t.id&&t.name||t.text},templateSelection:function(t){return t.name||t.text}};$(".sponsor-select").select2(e),$(".allow-school-select").select2(e),$(".manager-select").select2({theme:"bootstrap4",placeholder:"\u8bf7\u8f93\u5165\u8981\u6dfb\u52a0\u7684\u7ba1\u7406\u5458\u59d3\u540d",multiple:!0,minimumInputLength:1,ajax:{delay:500,url:"/cooperative/users",dataType:"json",data:function(t){return{keyword:t.term}},processResults:function(t){return{results:t.users}}},templateResult:function(t){return t.id&&""!==t.id?$("<div class='row px-0'><span class='col-3'>"+t.real_name+"</span><span class='col-5 font-12'>"+t.school_name+"</span><span class='col-4 font-12'>"+t.hidden_phone+"</span></div>"):t.text},templateSelection:function(t){return t.id,t.real_name||t.text}}),$(".nav-setting-form").on("click",".add_linkBtn",function(){$(".nav-setting-form").find(".linkFormItem").length;var t='<div class="row mt-2 align-items-center linkFormItem">\n <div class="col-1 text-right">\n <label class="checkbox checkbox-primary mt-1">\n <input type="checkbox" name="navbar[][hidden]" value="0" hidden class="font-16" checked="checked">\n <input type="checkbox" value="0" class="font-16 module_hidden" checked="checked">\n </label>\n </div>\n <div class="col-md-label mt-1"><input type="hidden" value="md" name="navbar[][module_type]">\n <input type="text" name="navbar[][name]" value="" class="form-control" placeholder="\u6a21\u5757\u540d\u79f0"></div>\n <div class="col-md-1 mt-1"><input type="text" name="navbar[][position]" value="" class="form-control" placeholder="\u4f4d\u7f6e"></div>\n <div class="col-md-3 mt-1"><input type="text" name="navbar[][url]" value="" class="form-control" placeholder="\u8bf7\u8f93\u5165\u8d44\u6599\u4e0b\u8f7d\u5730\u5740"></div>\n <a class="mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn" href="javascript:void(0)">+</a>\n <a class="mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn" href="javascript:void(0)">\xd7</a>\n </div>';$(this).parents(".linkFormItem").after(t)}),$(".nav-setting-form").on("click",".del_linkBtn",function(){$(this).parents(".linkFormItem").remove()}),$(".addRequireBtn").on("click",function(){var t=$("#requireForm").find(".requireForm_item").length+1,e='<div class="row mt-2 mb-4 requireForm_item">\n <div class="col-1 text-right"> </div>\n <div class="col-1 text-left mt-1">\n <input type="text" class="form-control" name="competition_staffs[][minimum]" value="0">\n </div>\n <span class="mt-2">~</span>\n <div class="col-1 mt-1">\n <input type="text" class="form-control" name="competition_staffs[][maximum]" value="1">\n </div>\n <span class="mt-2">\u4eba</span>\n <div class="col-2 mt-1">\n <select class="form-control" name="competition_staffs[][category]">\n <option value="student">\u5b66\u751f</option>\n <option value="teacher">\u6559\u5e08</option>\n </select>\n </div>\n <div class="col-2 mt-1">\n <label class="radio checkbox-primary mt-1" value="require_'+t+'_1">\n <input id="require_'+t+'_1" class="mutiple-limited-radio" value="false" checked name="competition_staffs[][mutiple_limited]" type="checkbox">\n <label for="require_'+t+'_1">\u53ef\u591a\u6b21\u62a5\u540d</label>\n </label>\n </div>\n <div class="col-2 mt-1">\n <label class="radio checkbox-primary mt-1" value="require_'+t+'_2">\n <input id="require_'+t+'_2" class="mutiple-limited-radio" value="true" name="competition_staffs[][mutiple_limited]" type="checkbox">\n <label for="require_'+t+'_2">\u4e0d\u53ef\u591a\u6b21\u62a5\u540d</label>\n </label>\n <a href="javascript:void(0)" class="ml20 delRequrieBtn">\n <i class="fa fa-times-circle font-20 color-grey-c"></i>\n </a>\n </div>\n </div>';$("#requireForm").append(e)}),$("#requireForm").on("click",".delRequrieBtn",function(){$(this).parents(".requireForm_item").remove()}),$(".nav-setting-form").on("click",".module_hidden",function(){var t=$(this);t.is(":checked")?t.prev().val(0):t.prev().val(1)}),$(".competition-staff-settings").on("click",".mutiple-limited-radio",function(){var t=$(this);t.is(":checked")?t.parent().parent().siblings().find(".mutiple-limited-radio").attr("checked",!1):t.parent().parent().siblings().find(".mutiple-limited-radio").attr("checked",!0)});var a=$("form.nav-setting-form");a.on("click",".submit-btn",function(){a.find(".submit-btn").attr("disabled","disabled"),a.find(".error").html(""),a.valid()&&$.ajax({method:"POST",dataType:"json",url:a.attr("action"),data:new FormData(a[0]),processData:!1,contentType:!1,success:function(){$.notify({message:"\u4fdd\u5b58\u6210\u529f"})},error:function(t){var e=t.responseJSON;a.find(".error").html(e.message)},complete:function(){a.find(".submit-btn").attr("disabled",!1)}})}),$("#large_panel").on("click",".small_panel_item_del",function(){var t=$(this).parents(".small_panel");$(this).parents(".small_panel_item").remove();for(var e=0;e<$(t).find(".subName").length;e++)console.log(e),$(t).find(".subName").eq(e).html("\u7b2c"+parseInt(e+1)+"\u9636\u6bb5")}),$(".competition-chart-setting").on("click",".update-stage",function(){var r=$(this).parents("form");$(this).attr("disabled","disabled"),r.find(".error").html("");var o=!0,t=r.find('input[name="stage_name"]');t.val()===undefined||0===t.val().length?(t.addClass("danger text-danger"),o=!1):t.removeClass("danger text-danger");var e=r.find('input[name="score_rate"]');e.val()===undefined||0===e.val().length?(e.addClass("danger text-danger"),o=!1):100<parseInt(e.val())||parseInt(e.val())<0?(e.addClass("danger text-danger"),e.after('<span class="danger text-danger">0-100\u4e4b\u95f4\u7684\u6570\u503c</span>'),o=!1):(e.removeClass("danger text-danger"),e.siblings().remove()),r.find('input[name="stage[][start_time]"]').each(function(t,e){var n=$(e);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),o=!1):n.removeClass("danger text-danger")}),r.find('input[name="stage[][end_time]"]').each(function(t,e){var n=$(e);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),o=!1):n.removeClass("danger text-danger")}),r.find('input[name="stage[][mission_count]"]').each(function(t,e){var n=$(e),i=r.find('input[name="stage[][entry]"]').eq(t);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),o=!1):parseInt(n.val())<1?(n.addClass("danger text-danger"),n.after('<span class="danger text-danger">\u5927\u4e8e\u7b49\u4e8e1</span>'),o=!1):parseInt(n.val())>parseInt(i.val())?(n.addClass("danger text-danger"),n.after('<span class="danger text-danger">\u4e0d\u80fd\u5927\u4e8e\u603b\u4efb\u52a1\u6570</span>'),o=!1):(n.removeClass("danger text-danger"),n.siblings().remove())}),r.find('input[name="stage[][entry]"]').each(function(t,e){var n=$(e);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),o=!1):parseInt(n.val())<1?(n.addClass("danger text-danger"),n.after('<span class="danger text-danger">\u5927\u4e8e\u7b49\u4e8e1</span>'),o=!1):(n.removeClass("danger text-danger"),n.siblings().remove())}),r.find('input[name="stage[][identifiers][]"]').each(function(t,e){var n=$(e);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),o=!1):n.removeClass("danger text-danger")}),o&&(r.find('input[name="stage[][mission_count]"]').each(function(t,e){var n=$(e),i=$(e).parents("div.row").find('input[name="stage[][mission_count]"]');parseInt(n.val())>parseInt(i.val())?(n.addClass("danger text-danger"),n.after('<span class="danger text-danger">\u4e0d\u80fd\u5927\u4e8e\u603b\u4efb\u52a1\u6570</span>'),o=!1):(n.removeClass("danger text-danger"),n.siblings().remove())}),$.ajax({method:"POST",dataType:"json",url:r.attr("action"),data:new FormData(r[0]),processData:!1,contentType:!1,success:function(){$.notify({message:"\u4fdd\u5b58\u6210\u529f"}),window.location.reload()},error:function(t){var e=t.responseJSON;a.find(".error").html(e.message)},complete:function(){a.find(".submit-btn").attr("disabled",!1)}}))}),$(".competition-chart-stages").on("click",".add-new-tab",function(){if(0<$(".new-stage-form").length)alert("\u8bf7\u5148\u4fdd\u5b58\u4e0a\u4e00\u4e2atab");else{var t=parseInt($("#large_panel").find(".large_panel_part").length)+1,
|
|
e='<form class="stage-update-form new-stage-form flex-1" action="/cooperative/competitions/'+$(this).attr("data-competition-id")+'/competition_stages" accept-charset="UTF-8" data-remote="true" method="post"><div class="large_panel_part" attr_line="'+t+'"><div class="row d-flex mt-3">\n <span class="col-1 mt-2">tab\u6807\u9898</span>\n <div class="col-2 no_padding">\n <input type="text" class="form-control" name="stage_name"/>\n </div>\n <span class="col-1 text-right mt-2 no_padding">\u603b\u6392\u884c\u699c\u5360\u6bd4:</span>\n <div class="col-1 no_padding">\n <input type="number" class="form-control" name="score_rate" value="100"/>\n </div><span class=" mt-2">%</span>\n <div class="flex-1">\n <a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add-task-sub">\u65b0\u589e\u5b50\u9636\u6bb5</a>\n </div>\n <a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">\u5220\u9664</a>\n <a href="javascript:void(0)" class="btn btn-outline-primary update-stage export-action ml20">\u4fdd\u5b58</a>\n </div>\n <div id="small_panel_'+t+'" class="small_panel">\n <div class="row d-flex small_panel_item" attr_line="sub_new_new" count="1">\n <span class="mt-2 subName mr10">\u7b2c1\u9636\u6bb5</span>\n <div class="flex-1">\n <div class="row">\n <div class="row col-6"><span class="mt-2 ml20">\u6709\u6548\u65f6\u95f4:</span>\n <div class="col-4 no_padding">\n <input type="text" name="stage[][start_time]" id="stage__start_time" value="" autocomplete="off" class="section-start-time form-control" placeholder="\u6709\u6548\u5f00\u59cb\u65f6\u95f4">\n </div>\n <span class="mt-2">~</span>\n <div class="col-4 no_padding ">\n <input type="text" name="stage[][end_time]" id="stage__end_time" value="" autocomplete="off" class="section-end-time form-control" placeholder="\u6709\u6548\u7ed3\u675f\u65f6\u95f4">\n </div></div>\n <div class="row col-3"><span class="col-4 text-right mt-2 no_padding">\u603b\u4efb\u52a1\u6570:</span>\n <div class="col-6 no_padding ">\n <input type="number" class="form-control" onchange="change_total(this)" value="3" name="stage[][entry]">\n </div></div>\n <div class="row col-3"><span class="col-4 text-right mt-2 no_padding">\u6210\u7ee9\u6765\u6e90:</span>\n <div class="col-6 no_padding ">\n <select class="form-control" name="stage[][score_source]">\n <option value="0">\u7ecf\u9a8c\u503c</option>\n <option value="1">\u9884\u6d4b\u51c6\u786e\u7387</option>\n </select>\n </div></div>\n </div>\n <div class="row mt-2" id="task_Input_sub_new_new">\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a11</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a12</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a13</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n </div>\n </div>\n <span>\n <a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">\u5220\u9664</a>\n </span>\n </div>\n</div></div></form>';$("#large_panel").append(e),$(".stage-update-form .section-start-time").datetimepicker(i),$(".stage-update-form .section-end-time").datetimepicker(i)}}),$(".competition-chart-stages").on("click",".add-task-sub",function(){var t=$(this).parents(".large_panel_part").attr("attr_line"),e=0;console.log("sdfsf"),console.log(0<$("#small_panel_"+t).find(".small_panel_item").length),0<$("#small_panel_"+t).find(".small_panel_item").length?(e=parseInt($("#small_panel_"+t).find(".small_panel_item").last().attr("count"))+1,console.log($("#small_panel_"+t).find(".small_panel_item").last().attr("count"))):e=1;var n='<div class="row d-flex small_panel_item" attr_line="sub_'+t+"_"+e+'" count="'+e+'">\n <span class="mr10 mt-2 subName">\u7b2c'+(parseInt($("#small_panel_"+t).find(".small_panel_item").length)+1)+'\u9636\u6bb5</span>\n <div class="flex-1">\n <div class="row">\n <div class="row col-6"><span class="mt-2 ml20 mr10">\u6709\u6548\u65f6\u95f4:</span>\n <div class="col-4 no_padding ">\n <input type="text" name="stage[][start_time]" id="stage__start_time" value="" autocomplete="off" class="section-start-time form-control" placeholder="\u6709\u6548\u5f00\u59cb\u65f6\u95f4">\n </div>\n <span class="mt-2">~</span>\n <div class="col-4 no_padding ">\n <input type="text" name="stage[][end_time]" id="stage__end_time" value="" autocomplete="off" class="section-end-time form-control" placeholder="\u6709\u6548\u7ed3\u675f\u65f6\u95f4">\n </div></div>\n <div class="row col-3"><span class="col-4 text-right mt-2 no_padding mr10">\u603b\u4efb\u52a1\u6570:</span>\n <div class="col-6 no_padding ">\n <input type="number" class="form-control" onchange="change_total(this)" value="3" name="stage[][entry]">\n </div></div>\n <div class="row col-3"><span class="col-4 mr10 text-right mt-2 no_padding">\u6210\u7ee9\u6765\u6e90:</span>\n <div class="col-6 no_padding ">\n <select class="form-control" name="stage[][score_source]">\n <option value="0">\u7ecf\u9a8c\u503c</option>\n <option value="1">\u9884\u6d4b\u51c6\u786e\u7387</option>\n </select>\n </div></div>\n </div>\n <div class="row mt-2" id="task_Input_sub_'+t+"_"+e+'">\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a11</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a12</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n <div class="col-4 row task_Input_div">\n <span class="col-4 text-right mt-3 no_padding mr10">\u4efb\u52a13</span>\n <div class="col-6 no_padding">\n <input type="text" class="form-control mt-2" name="stage[][identifiers][]" placeholder="\u8bf7\u586b\u5199\u5b9e\u8badID">\n </div>\n </div>\n </div>\n </div>\n <span>\n <a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">\u5220\u9664</a>\n </span>\n </div>';$("#small_panel_"+t).append(n),$(".stage-update-form .section-start-time").datetimepicker(i),$(".stage-update-form .section-end-time").datetimepicker(i)});var o=$("#competition-prize-card"),s=o.data("id");$(document).on("prize.save.success",function(){$.ajax({method:"GET",url:"/cooperative/competitions/"+s+"/competition_prizes",dataType:"script"})}),$(".modal.cooperative-upload-file-modal").on("upload:success",function(t,e){var n;(n="_member"===e.suffix?$(".prize-member-image-"+e.source_id):"_team"===e.suffix?$(".prize-team-image-"+e.source_id):$(".prize-teacher-image-"+e.source_id)).attr("src",e.url),n.show(),n.next().html("\u91cd\u65b0\u4e0a\u4f20")}),o.on("click",".generate-prize-user-action",function(){var e=$(this),t=function(){return $.ajax({method:"POST",url:"/cooperative/competitions/"+s+"/competition_prize_users",dataType:"json",success:function(t){t&&0===t.status?(show_success_flash(),e.remove()):showErrorNotify(t.message)},error:function(t){showErrorNotify(t.responseJSON.message)}})};customConfirm({content:"\u786e\u8ba4\u751f\u6210\u5417\uff1f",ok:function(){customLoading({ajax:t})}})})}else $(document).unbind("prize.save.success")}),$(document).on("turbolinks:load",function(){0<$("body.cooperative-competitions-index-page").length&&$(".modal.cooperative-upload-file-modal").on("upload:success",function(t,e){var n=$(".competition-image-"+e.source_id);n.attr("src",e.url),n.show(),n.next().html("\u91cd\u65b0\u4e0a\u4f20")}),$(".cooperative-competition-list-form").on("change",".competitions-hot-select",function(){var t=$(this).get(0).checked?1:0,e={};e.hot=t,$.ajax({url:"/cooperative/competitions/hot_setting",type:"POST",dataType:"json",data:e,success:function(){$.notify({message:"\u64cd\u4f5c\u6210\u529f"})}})});var e=$(".modal.cooperative-create-competition-modal"),n=e.find("form.cooperative-create-competition-form"),t=n.find('input[name="competition_name"]');n.validate({errorElement:"span",errorClass:"danger text-danger",rules:{competition_name:{required:!0}}}),e.on("show.bs.modal",function(){t.val("")}),e.on("click",".submit-btn",function(){if(n.find(".error").html(""),n.valid()){var t=n.data("url");$.ajax({method:"POST",dataType:"json",url:t,data:n.serialize(),success:function(){$.notify({message:"\u521b\u5efa\u6210\u529f"}),e.modal("hide"),setTimeout(function(){window.location.reload()},500)},error:function(t){var e=t.responseJSON;n.find(".error").html(e.message)}})}});var i=$(".modal.cooperative-import-competition-score-modal"),r=i.find("form.cooperative-import-competition-score-form"),o=r.find('input[name="competition_id"]');i.on("show.bs.modal",function(t){resetFileInputFunc(i.find(".upload-file-input")),i.find(".file-names").html("\u9009\u62e9\u6587\u4ef6"),i.find(".upload-file-input").trigger("click");var e=$(t.relatedTarget).data("competition-id");o.val(e)}),i.on("change",".upload-file-input",function(){var t=$(this)[0].files[0];i.find(".file-names").html(t?t.name:"\u8bf7\u9009\u62e9\u6587\u4ef6")});var a=function(){return r.find('input[name="file"]').val()!=undefined&&0!=r.find('input[name="file"]').val().length||(r.find(".error").html("\u8bf7\u9009\u62e9\u6587\u4ef6"),!1)},s=function(t){var e="<div>\u5bfc\u5165\u7ed3\u679c\uff1a\u6210\u529f"+t.success+"\u6761\uff0c\u5931\u8d25"+t.fail.length+"\u6761</div>";return 0<t.fail.length&&(e+='<table class="table"><thead class="thead-light"><tr><th>\u6570\u636e</th><th>\u5931\u8d25\u539f\u56e0</th></tr></thead><tbody>',t.fail.forEach(function(t){e+="<tr><td>"+t.data+"</td><td>"+t.message+"</td></tr>"}),e+="</tbody></table>"),e};i.on("click",".submit-btn",function(){r.find(".error").html(""),a()&&($("body").mLoading({text:"\u6b63\u5728\u5bfc\u5165..."}),$.ajax({method:"POST",dataType:"json",url:"/cooperative/import_competition_scores",data:new FormData(r[0]),processData:!1,contentType:!1,success:function(t){$("body").mLoading("destroy"),i.modal("hide"),showMessageModal(s(t),function(){window.location.reload()})},error:function(t){$("body").mLoading("destroy");var e=t.responseJSON;r.find(".error").html(e.message)}}))})}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-enroll-lists-index-page").length){var t=$(".search-form");$(".competition-enroll-list-form").on("click","#enroll-lists-export",function(){window.location.href="/cooperative/competitions/"+$(this).attr("data-competition-id")+"/enroll_lists/export.xlsx?"+t.serialize()})}}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-laboratory-settings-edit-page, body.cooperative-laboratory-settings-update-page").length){var n=$(".edit-laboratory-setting-container").find(".edit_laboratory");$(".logo-item-left, .banner-item-bottom").on("change",'input[type="file"]',function(){var e=$(this),t=this.files[0],n=/image.*/;if(t&&t.type.match(n)){var i=new FileReader;i.onload=function(){var t=e.parent();t.find("img").attr("src",i.result).css("display","block"),t.addClass("has-img")},i.readAsDataURL(t)}}),createMDEditor("laboratory-footer-editor",{height:200,placeholder:"\u8bf7\u8f93\u5165\u5907\u6848\u4fe1\u606f"}),n.validate({errorElement:"span",errorClass:"danger text-danger",errorPlacement:function(t,e){e.parent().hasClass("input-group")?e.parent().after(t):e.after(t)},rules:{identifier:{required:!0,checkSite:!0},name:{required:!0}}}),$.validator.addMethod("checkSite",function(t,e){var n=/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/;return this.optional(e)||n.test(t+".educoder.com")},"\u57df\u540d\u4e0d\u5408\u6cd5\uff01"),n.on("click",".submit-btn",function(){n.find(".submit-btn").attr("disabled","disabled"),n.find(".error").html("");var i=n.valid();$('input[name="navbar[][name]"]').each(function(t,e){var n=$(e);n.val()===undefined||0===n.val().length?(n.addClass("danger text-danger"),i=!1):n.removeClass("danger text-danger")}),i&&$.ajax({method:"PATCH",dataType:"json",url:n.attr("action"),data:new FormData(n[0]),processData:!1,contentType:!1,success:function(){$.notify({message:"\u4fdd\u5b58\u6210\u529f"}),window.location.reload()},error:function(t){var e=t.responseJSON;n.find(".error").html(e.message)},complete:function(){n.find(".submit-btn").attr("disabled",!1)}})})}}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-laboratory-shixuns-index-page").length){$(".laboratory-shixun-list-form .search-form").find("select#tag_id").select2({placeholder:"\u8bf7\u9009\u62e9",allowClear:!0}),$(".modal.cooperative-upload-file-modal").on("upload:success",function(t,e){var n=$(".shixun-image-"+e.source_id);0!==n.length&&(n.attr("src",e.url),n.show(),n.next().html("\u91cd\u65b0\u4e0a\u4f20"))});var t=function(t,i,r,o){$(".laboratory-shixun-list-container").on("click",t,function(){var t=$(this),e=t.siblings(i),n=t.data("id");customConfirm({content:"\u786e\u8ba4\u8fdb\u884c\u8be5\u64cd\u4f5c\u5417\uff1f",ok:function(){$.ajax({url:"/cooperative/laboratory_shixuns/"+n+r,method:"POST",dataType:"json",success:function(){show_success_flash(),t.hide(),e.show(),o&&"function"==typeof o&&o(n,r)}})}})})},e=function(t,e){var n=$(".laboratory-shixun-list-container").find(".laboratory-shixun-item-"+t);"/homepage"===e?n.find(".homepage-badge").show():n.find(".homepage-badge").hide()};t(".homepage-show-action",".homepage-hide-action","/homepage",e),t(".homepage-hide-action",".homepage-show-action","/cancel_homepage",e)}}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-laboratory-subjects-index-page").length){$(".laboratory-subject-list-form .search-form").find(".school-select").select2({theme:"bootstrap4",placeholder:"\u8bf7\u9009\u62e9\u521b\u5efa\u8005\u5355\u4f4d",allowClear:!0,minimumInputLength:1,ajax:{delay:500,url:"/api/schools/search.json",dataType:"json",data:function(t){return{keyword:t.term}},processResults:function(t){return{results:t.schools}}},templateResult:function(t){return t.id&&""!==t.id?t.name:t.text},templateSelection:function(t){return t.id,t.name||t.text}}),$(".modal.cooperative-upload-file-modal").on("upload:success",function(t,e){var n=$(".subject-image-"+e.source_id);0!==n.length&&(n.attr("src",e.url),n.show(),n.next().html("\u91cd\u65b0\u4e0a\u4f20"))});var t=function(t,i,r,o){$(".laboratory-subject-list-container").on("click",t,function(){var t=$(this),e=t.siblings(i),n=t.data("id");customConfirm({content:"\u786e\u8ba4\u8fdb\u884c\u8be5\u64cd\u4f5c\u5417\uff1f",ok:function(){$.ajax({url:"/cooperative/laboratory_subjects/"+n+r,method:"POST",dataType:"json",success:function(){show_success_flash(),t.hide(),e.show(),o&&"function"==typeof o&&o(n,r)}})}})})},e=function(t,e){var n=$(".laboratory-subject-list-container").find(".laboratory-subject-item-"+t);"/homepage"===e?n.find(".homepage-badge").show():n.find(".homepage-badge").hide()};t(".homepage-show-action",".homepage-hide-action","/homepage",e),t(".homepage-hide-action",".homepage-show-action","/cancel_homepage",e)}}),$(document).on("turbolinks:load",function(){if(0<$("body.cooperative-laboratory-users-index-page").length){var e=$(".cooperative-add-laboratory-user-modal"),n=e.find(".cooperative-add-laboratory-user-form"),i=e.find(".laboratory-user-select");e.on("show.bs.modal",function(){i.select2("val"," ")}),i.select2({theme:"bootstrap4",placeholder:"\u8bf7\u8f93\u5165\u8981\u6dfb\u52a0\u7684\u7ba1\u7406\u5458\u59d3\u540d",multiple:!0,minimumInputLength:1,ajax:{delay:500,url:"/cooperative/users/for_select",dataType:"json",data:function(t){return{name:t.term}},processResults:function(t){return{results:t.users}}},templateResult:function(t){return t.id&&""!==t.id?$("<span>"+t.real_name+" <span class='font-12'>"+t.school_name+" "+t.hidden_phone+"</span></span>"):t.text},templateSelection:function(t){return t.id,t.real_name||t.text}}),e.on("click",".submit-btn",function(){n.find(".error").html("");var t=i.val();t&&0<t.length?$.ajax({method:"POST",dataType:"json",url:"/cooperative/laboratory_users",data:{user_ids:t},success:function(t){t&&0==t.status&&(show_success_flash(),e.modal("hide"),window.location.reload())}}):e.modal("hide")})}}),$(document).on("turbolinks:load",function(){$(".cooperative-modal-container").on("show.bs.modal",".modal.cooperative-edit-subject-modal",function(){var t=$(".modal.cooperative-edit-subject-modal"),e=t.find("form.cooperative-edit-subject-form");t.on("click",".submit-btn",function(){e.find(".error").html("");var t=e.attr("action");$.ajax({method:"PATCH",dataType:"script",url:t,data:e.serialize()})})})}),$(document).on("turbolinks:load",function(){var r=$(".modal.cooperative-upload-file-modal");if(0<r.length){var n=r.find("form.cooperative-upload-file-form"),o=r.find('input[name="source_id"]'),a=r.find('input[name="source_type"]');r.on("show.bs.modal",function(t){var e=$(t.relatedTarget),n=e.data("sourceId"),i=e.data("sourceType");o.val(n),a.val(i),r.find(".upload-file-input").trigger("click")}),r.find(".upload-file-input").on("change",function(){var t=$(this)[0].files[0];t&&(r.find(".file-names").html(t.name),r.find(".submit-btn").trigger("click"))});var e=function(){return n.find('input[name="file"]').val()!=undefined&&0!=n.find('input[name="file"]').val().length||(n.find(".error").html("\u8bf7\u9009\u62e9\u6587\u4ef6"),!1)};r.on("click",".submit-btn",function(){if(n.find(".error").html(""),e()){var t=n.serialize();$.ajax({method:"POST",dataType:"json",url:"/cooperative/files?"+t,data:new FormData(n[0]),processData:!1,contentType:!1,success:function(t){$.notify({message:"\u4e0a\u4f20\u6210\u529f"}),r.trigger("upload:success",t),r.modal("hide")},error:function(t){var e=t.responseJSON;n.find(".error").html(e.message)}})}})}}),$(document).on("turbolinks:load",function(){$("#sidebarCollapse").on("click",function(){$(this).toggleClass("active"),$("#sidebar").toggleClass("active"),$.cookie("cooperative_sidebar_collapse",$(this).hasClass("active"),{path:"/cooperative"})});var t=$("#sidebar").data("current-controller");if(0<t.length){$("#sidebar a.active").removeClass("active"),$("#sidebar ul.collapse.show").removeClass("show");var e=$('#sidebar a[data-controller="'+t+'"]');e.addClass("active"),e.parent().parent("ul.collapse").addClass("show")}}),$.ajaxSetup({beforeSend:function(t){t.setRequestHeader("X-CSRF-Token",$('meta[name="csrf-token"]').attr("content"))}}),$.fn.select2.defaults.set("theme","bootstrap4"),$.fn.select2.defaults.set("language","zh-CN"),Turbolinks.setProgressBarDelay(200),$.notifyDefaults({type:"success",z_index:9999,delay:2e3}),$(document).on("turbolinks:load",function(){$('[data-toggle="tooltip"]').tooltip({trigger:"hover"}),$('[data-toggle="popover"]').popover(),$("img.preview-image").bootstrapViewer(),0<$(".cooperative-alert-container .alert").length&&(setTimeout(function(){$(".cooperative-alert-container .alert:not(.alert-danger)").alert("close")},2e3),setTimeout(function(){$(".cooperative-alert-container .alert.alert-danger").alert("close")},5e3))}),$(document).on("turbolinks:before-cache",function(){$('[data-toggle="tooltip"]').tooltip("hide"),$('[data-toggle="popover"]').popover("hide")}),$(function(){}); |